1 #include "StEStructGevsim.h"
2 #include "StEStructPool/AnalysisMaker/StEStructEventCuts.h"
3 #include "StEStructPool/AnalysisMaker/StEStructTrackCuts.h"
4 #include "StEStructPool/EventMaker/StEStructEvent.h"
5 #include "StEStructPool/EventMaker/StEStructTrack.h"
9 StEStructGevsim::StEStructGevsim(): mgevsim(0), meventCount(0), meventsToDo(0), mAmDone(false) {};
17 mtrackArray = mgevsim->GetListOfParticles();
21 bool StEStructGevsim::hasGenerator() {
return (mgevsim) ?
true : false ; };
26 if(!mgevsim || meventCount==meventsToDo){
30 return generateEvent();
38 if(mgevsim) mgevsim->GenerateEvent();
43 retVal->SetCentrality((
double) mrefMult);
45 bool useEvent= (mECuts->goodCentrality(mrefMult));
50 retVal->FillChargeCollections();
52 mECuts->fillHistogram(mECuts->centralityName(),(float)mrefMult,useEvent);
61 int numParticles=mtrackArray->GetEntries();
65 for(
int i=0;i<numParticles;i++){
66 TParticle*
track = (TParticle*)mtrackArray->At(i);
70 eTrack->SetInComplete();
74 float pt = track->Pt();
77 float eta = track->Eta();
78 useTrack = (mTCuts->goodEta(eta) && useTrack);
79 float phi = track->Phi();
80 if(phi>M_PI) phi -= 2*M_PI;
81 useTrack = (mTCuts->goodPhi(phi) && useTrack);
82 useTrack = (mTCuts->goodPt(pt) && useTrack);
84 float yt=log(sqrt(1+_r*_r)+_r);
85 useTrack = (mTCuts->goodYt(yt) && useTrack);
86 float mt = sqrt(pt*pt + 0.139*0.139);
87 float xt = 1 - exp( -1*(mt-0.139)/0.4 );
88 useTrack = (mTCuts->goodXt(xt) && useTrack);
90 int pdgCode = track->GetPdgCode();
92 if(pdgCode>0) charge = 1;
94 useTrack = ( mTCuts->goodCharge(charge) && useTrack);
98 mTCuts->fillHistograms(useTrack);
101 eTrack->SetPx(track->Px());
102 eTrack->SetPy(track->Py());
103 eTrack->SetPz(track->Pz());
107 eTrack->SetBxGlobal(0);
108 eTrack->SetByGlobal(0);
109 eTrack->SetBzGlobal(0);
112 eTrack->SetDetectorID(1);
113 eTrack->SetCharge(charge);
115 estructEvent->AddTrack(eTrack);