13 #include <TDatabasePDG.h>
14 #include <TParticlePDG.h>
21 mFstream(0), mPtMin(0.0), mPtMax(0.0), mRemainingTrackCounter(0)
27 mFstream =
new std::fstream(fileName);
29 if (strcmp(title,
" HIJING EVENT FILE")) {
30 printf(
"no HIJING file header line found!\n");
55 for(
unsigned iq=0; iq<3; iq++) {
62 unsigned thisEventTrackCounter = 0;
70 for(
unsigned iq=0; iq<5; iq++)
72 if (
IsOver())
return kTRUE;
80 if (
IsOver())
return kTRUE;
89 for(
unsigned iq=0; iq<2; iq++)
91 if (
IsOver())
return kTRUE;
100 unsigned i0, i1, i2, i3, i4, i5;
101 double d0, d1, d2, d3, d4;
102 *
mFstream >> i0 >> pdg >> i1 >> i2 >> i3 >> i4 >> i5 >> px >> py >> pz >> d0 >> d1 >> d2 >> d3 >> d4;
103 if (
IsOver())
return kTRUE;
109 if (!px && !py)
continue;
112 TDatabasePDG *pdgTable = TDatabasePDG::Instance(); assert(pdgTable);
113 TParticlePDG *
particle = pdgTable->GetParticle(pdg);
114 if (!particle->Charge())
continue;
118 TVector3
p(px, py, pz);
124 if (p.Mag() <
mPmin || p.Mag() >
mPmax)
continue;
127 double thetaDeg = p.Theta()*180.0/TMath::Pi();
128 if (thetaDeg < mThetaMin || thetaDeg >
mThetaMax)
continue;
131 double phiDeg = p.Phi()*180.0/TMath::Pi();
132 if (phiDeg < mPhiMin || phiDeg >
mPhiMax)
continue;
139 primGen->
AddTrack(pdg, pvect[0], pvect[1], pvect[2], vtx[0], vtx[1], vtx[2]);
142 thisEventTrackCounter++;
144 if (
mMult && thisEventTrackCounter ==
mMult) {
145 mRemainingTrackCounter -= (tr+1);
152 if (!
mMult || (
mMult && thisEventTrackCounter !=
mMult)) mRemainingTrackCounter = 0;
155 if (!mRemainingTrackCounter)
161 if (
IsOver())
return kTRUE;