12 #include "StEStructQJ.h"
14 #include "StEStructPool/AnalysisMaker/StEStructEventCuts.h"
15 #include "StEStructPool/AnalysisMaker/StEStructTrackCuts.h"
16 #include "StEStructPool/EventMaker/StEStructEvent.h"
17 #include "StEStructPool/EventMaker/StEStructTrack.h"
19 StEStructQJ::StEStructQJ(
char *fileList): meventCount(0), meventsToDo(0), mAmDone(false) {
20 fileListName = fileList;
27 fileListName = fileList;
37 bool StEStructQJ::hasGenerator() {
return true; };
41 void StEStructQJ::setSeed(
int iseed) {
42 cout <<
" Calling srand48(" << iseed <<
")" << endl;
49 if(meventCount==meventsToDo){
53 return generateEvent();
64 if (!mECuts->goodCentrality(retVal->Centrality())) {
68 retVal->FillChargeCollections();
82 if ((totTracks = getNumTracks()) < 0) {
87 for(
int i=0;i<totTracks;i++) {
89 eTrack->SetInComplete();
90 *inFile >> px >> py >> eta >> pid;
97 double pt = sqrt( px*px + py*py );
98 double pz = sqrt( pt*pt + 0.139*0.139) * (exp(eta)-exp(-eta)) / 2;
99 double phi = atan2( py, px );
101 bool useTrack =
true;
102 useTrack = (mTCuts->goodEta(eta) && useTrack);
103 useTrack = (mTCuts->goodPhi(phi) && useTrack);
105 if (pt<0.15)
continue;
108 useTrack = (mTCuts->goodPt(pt) && useTrack);
110 float yt=log(sqrt(1+_r*_r)+_r);
111 useTrack = (mTCuts->goodYt(yt) && useTrack);
112 mTCuts->fillHistograms(useTrack);
113 if (!useTrack)
continue;
118 eTrack->SetBxGlobal(0);
119 eTrack->SetByGlobal(0);
120 eTrack->SetBzGlobal(0);
129 eTrack->SetCharge(-1);
131 eTrack->SetCharge(1);
133 estructEvent->AddTrack(eTrack);
135 estructEvent->SetCentrality(impact);
142 int StEStructQJ::getNumTracks() {
147 cout <<
"Opening file list " << fileListName << endl;
148 fList =
new std::ifstream(fileListName);
153 cout <<
"Got to end of fileList. Returning -1. (Should end program)" << endl;
157 cout <<
"About to open file " << buffer << endl;
158 inFile =
new std::ifstream(buffer);
160 *inFile >> nTot >> nAcc >> impact >> i >> i >> i >> i >> i >> i >> i;
161 if (!inFile->eof()) {
164 cout <<
"Read to end of file. Closing it and returning 0." << endl;
165 cout <<
"(Should allow us to go on to next file.)" << endl;