16 #include "StHbtMaker/Cut/helensLaPTrackCut.h"
17 #include "StHbtMaker/Cut/helensEventCut.h"
18 #include "StHbtMaker/Infrastructure/StHbtAnalysis.h"
25 helensLaPTrackCut::helensLaPTrackCut(){
26 mNTracksPassed = mNTracksFailed = 0;
27 mNSigmaElectron[0] = -1e9; mNSigmaElectron[1] = +1e9;
28 mNSigmaPion[0] = -1e9; mNSigmaPion[1] = +1e9;
29 mNSigmaKaon[0] = -1e9; mNSigmaKaon[1] = +1e9;
30 mNSigmaProton[0] = -1e9; mNSigmaProton[1] = +1e9;
31 mNSigmaAntiElectron[0] = 0.; mNSigmaAntiElectron[1] = 0.;
32 mNSigmaAntiPion[0] = 0.; mNSigmaAntiPion[1] = 0.;
33 mNSigmaAntiKaon[0] = 0.; mNSigmaAntiKaon[1] = 0.;
34 mNSigmaAntiProton[0] = 0.; mNSigmaAntiProton[1] = 0.;
35 mPt[0] = -1e9; mPt[1] = +1e9;
36 mPx[0] = -1e9; mPx[1] = +1e9;
37 mPy[0] = -1e9; mPy[1] = +1e9;
38 mPz[0] = -1e9; mPz[1] = +1e9;
42 mNTracksPassed = mNTracksFailed = 0;
44 mNSigmaElectron[0] = c.mNSigmaElectron[0];
45 mNSigmaElectron[1] = c.mNSigmaElectron[1];
46 mNSigmaPion[0] = c.mNSigmaPion[0];
47 mNSigmaPion[1] = c.mNSigmaPion[1];
48 mNSigmaKaon[0] = c.mNSigmaKaon[0];
49 mNSigmaKaon[1] = c.mNSigmaKaon[1];
50 mNSigmaProton[0] = c.mNSigmaProton[0];
51 mNSigmaProton[1] = c.mNSigmaProton[1];
52 mNSigmaAntiElectron[0] = c.mNSigmaAntiElectron[0];
53 mNSigmaAntiElectron[1] = c.mNSigmaAntiElectron[1];
54 mNSigmaAntiPion[0] = c.mNSigmaAntiPion[0];
55 mNSigmaAntiPion[1] = c.mNSigmaAntiPion[1];
56 mNSigmaAntiKaon[0] = c.mNSigmaAntiKaon[0];
57 mNSigmaAntiKaon[1] = c.mNSigmaAntiKaon[1];
58 mNSigmaAntiProton[0] = c.mNSigmaAntiProton[0];
59 mNSigmaAntiProton[1] = c.mNSigmaAntiProton[1];
60 mNHits[0] = c.mNHits[0];
61 mNHits[1] = c.mNHits[1];
62 mP[0] = c.mP[0]; mP[1] = c.mP[1];
63 mPt[0] = c.mPt[0]; mPt[1] = c.mPt[1];
64 mPx[0] = c.mPx[0]; mPx[1] = c.mPx[1];
65 mPy[0] = c.mPy[0]; mPy[1] = c.mPy[1];
66 mPz[0] = c.mPz[0]; mPz[1] = c.mPz[1];
67 mRapidity[0] = c.mRapidity[0];
68 mRapidity[1] = c.mRapidity[1];
74 cout <<
" helensLaPTrackCut::helensLaPTrackCut(helensLaPTrackCut& c) " << endl;
79 helensLaPTrackCut::~helensLaPTrackCut(){
86 float TEnergy = ::sqrt(track->P().mag2()+mMass*mMass);
87 float TRapidity = 0.5*::log((TEnergy+track->P().z())/
88 (TEnergy-track->P().z()));
92 track->NSigmaElectron() <<
" " <<
93 track->NSigmaPion() <<
" " <<
94 track->NSigmaKaon() <<
" " <<
95 track->NSigmaProton() <<
" " <<
96 track->DCAxy() <<
" " <<
97 track->NHits() <<
" " <<
98 track->P().mag() <<
" " <<
101 track->Charge() <<
" ";
105 (track->NSigmaElectron() >= mNSigmaElectron[0]) &&
106 (track->NSigmaElectron() <= mNSigmaElectron[1]) &&
107 (track->NSigmaPion() >= mNSigmaPion[0]) &&
108 (track->NSigmaPion() <= mNSigmaPion[1]) &&
109 (track->NSigmaKaon() >= mNSigmaKaon[0]) &&
110 (track->NSigmaKaon() <= mNSigmaKaon[1]) &&
111 (track->NSigmaProton() >= mNSigmaProton[0]) &&
112 (track->NSigmaProton() <= mNSigmaProton[1]) &&
113 !( (track->NSigmaElectron() >= mNSigmaAntiElectron[0]) &&
114 (track->NSigmaElectron() <= mNSigmaAntiElectron[1]) ) &&
115 !( (track->NSigmaPion() >= mNSigmaAntiPion[0]) &&
116 (track->NSigmaPion() <= mNSigmaAntiPion[1]) ) &&
117 !( (track->NSigmaKaon() >= mNSigmaAntiKaon[0]) &&
118 (track->NSigmaKaon() <= mNSigmaAntiKaon[1]) ) &&
119 !( (track->NSigmaProton() >= mNSigmaAntiProton[0]) &&
120 (track->NSigmaProton() <= mNSigmaAntiProton[1]) ) &&
121 (track->Charge() == mCharge || mCharge==0 )
127 cout << mNSigmaElectron[0] <<
" << " << track->NSigmaElectron() <<
" << " << mNSigmaElectron[1] <<
" ";
128 cout << (track->NSigmaElectron() >= mNSigmaElectron[0]) << (track->NSigmaElectron() <= mNSigmaElectron[1]) << endl;
131 bool goodTrack=(
true &&
132 (track->DCAxy() >= mDCA[0]) &&
133 (track->DCAxy() <= mDCA[1]) &&
134 (track->NHits() >= mNHits[0]) &&
135 (track->NHits() <= mNHits[1]) &&
136 (track->P().mag() >= mP[0]) &&
137 (track->P().mag() <= mP[1]) &&
138 (track->Pt() >= mPt[0]) &&
139 (track->Pt() <= mPt[1]) &&
140 (track->P().x() >= mPx[0]) &&
141 (track->P().x() <= mPx[1]) &&
142 (track->P().y() >= mPy[0]) &&
143 (track->P().y() <= mPy[1]) &&
144 (track->P().z() >= mPz[0]) &&
145 (track->P().z() <= mPz[1]) &&
146 (TRapidity >= mRapidity[0]) &&
147 (TRapidity <= mRapidity[1])
152 cout <<
" goodPID=" << goodPID <<
" ";
153 cout <<
" goodTrack=" << goodTrack <<
" ";
164 StHbtTrkV0Iterator pIter;
168 for( pIter= EventCut->TrkV0MatchCollection()->begin(); pIter!= EventCut->TrkV0MatchCollection()->end(); pIter++){
171 if( TheMatch->TrkId() == track->TrackId()){
172 goodTrack = !(TheMatch->Used());
180 (goodTrack && goodPID) ? mNTracksPassed++ : mNTracksFailed++;
182 return (goodPID && goodTrack);
185 StHbtString helensLaPTrackCut::Report(){
188 sprintf(Ctemp,
"\nParticle mass:\t%E",mMass);
190 sprintf(Ctemp,
"\nParticle charge:\t%d",mCharge);
192 sprintf(Ctemp,
"\nParticle Nsigma from pion:\t%E - %E",mNSigmaPion[0],mNSigmaPion[1]);
194 sprintf(Ctemp,
"\nParticle Nsigma from kaon:\t%E - %E",mNSigmaKaon[0],mNSigmaKaon[1]);
196 sprintf(Ctemp,
"\nParticle Nsigma from proton:\t%E - %E",mNSigmaProton[0],mNSigmaProton[1]);
198 sprintf(Ctemp,
"\nParticle Nsigma from electron:\t%E - %E",mNSigmaElectron[0],mNSigmaElectron[1]);
200 sprintf(Ctemp,
"\nParticle #hits:\t%d - %d",mNHits[0],mNHits[1]);
202 sprintf(Ctemp,
"\nParticle p:\t%E - %E",mP[0],mP[1]);
204 sprintf(Ctemp,
"\nParticle pT:\t%E - %E",mPt[0],mPt[1]);
206 sprintf(Ctemp,
"\nParticle rapidity:\t%E - %E",mRapidity[0],mRapidity[1]);
208 sprintf(Ctemp,
"\nParticle DCA:\t%E - %E",mDCA[0],mDCA[1]);
210 sprintf(Ctemp,
"\nNumber of tracks which passed:\t%ld Number which failed:\t%ld",mNTracksPassed,mNTracksFailed);
212 StHbtString returnThis = Stemp;