12 #include "StEStructAscii.h"
13 #include "StEStructPool/AnalysisMaker/StEStructEventCuts.h"
14 #include "StEStructPool/AnalysisMaker/StEStructTrackCuts.h"
15 #include "StEStructPool/EventMaker/StEStructEvent.h"
16 #include "StEStructPool/EventMaker/StEStructTrack.h"
17 #include "TLorentzVector.h"
19 StEStructAscii::StEStructAscii(): meventCount(0), meventsToDo(0), mAmDone(false) {};
27 cout <<
"Opening ASCII file " << infile << endl;
31 if (!in) cout <<
" *** WARNING: Error reading file " << infile << endl;
35 bool StEStructAscii::hasInputFile() {
return (in.good()) ?
true :
false ; };
40 if( (!in.good()&&meventCount>0) || ((meventsToDo>0)&&(meventCount==meventsToDo)) || in.eof() ){
43 cout <<
"Done. Quitting after " << meventCount <<
" events." << endl;
46 return generateEvent();
71 retVal->FillChargeCollections();
72 retVal->SetEventID(meventCount);
73 retVal->SetVertex(0,0,0);
89 int numParticles, charge;
93 cout <<
"Found EOF" << endl;
97 cout <<
"WARNING: Read error at line" << mlineNumber << endl;
102 estructEvent->SetCentrality(numParticles);
106 for(
int i=0;i<numParticles;i++){
107 eTrack->SetInComplete();
110 in >> pt >> eta >> phi >> charge;
113 cout <<
"WARNING: Read error near line" << mlineNumber << endl;
117 TLorentzVector
track;
118 track.SetPtEtaPhiM(pt, eta, phi, 0.14);
120 eTrack->SetPx(track.Px());
121 eTrack->SetPy(track.Py());
122 eTrack->SetPz(track.Pz());
125 eTrack->SetCharge(charge);
129 useTrack = (mTCuts->goodCharge(charge) && useTrack);
130 useTrack = (mTCuts->goodEta(eta) && useTrack);
131 useTrack = (mTCuts->goodPhi(phi) && useTrack);
132 useTrack = (mTCuts->goodPt(pt) && useTrack);
133 mTCuts->fillHistograms(
true);
136 estructEvent->AddTrack(eTrack);