53 #include "StHbtMaker/Cut/helensLaPV0Cut.h"
54 #include "StHbtMaker/Cut/helensEventCut.h"
55 #include "StHbtMaker/Infrastructure/StHbtAnalysis.h"
63 helensLaPV0Cut::helensLaPV0Cut(){
64 mNV0sPassed = mNV0sFailed = 0;
67 mV0MassRange[1]=10000;
70 mdcaV0daughters[1]=1000;
72 mdcaV0ToPrimVertex[0]=0;
73 mdcaV0ToPrimVertex[1]=1000;
76 mdecayLengthV0[1]=10000;
85 mdcaPosToPrimVertex[0]=0;
86 mdcaPosToPrimVertex[1]=1000;
88 mdcaNegToPrimVertex[0]=0;
89 mdcaNegToPrimVertex[1]=10000;
106 mRapidity[0]=-100000;
119 bool helensLaPV0Cut::Pass(
const StHbtV0* V0){
124 cout <<
" * dcaV0Daughters " << V0->dcaV0Daughters();
125 cout <<
" * dcaV0ToPrimVertex " << V0->dcaV0ToPrimVertex();
126 cout <<
" * decayLengthV0 " << V0->decayLengthV0();
127 cout <<
" * tpcHitsPos " << V0->tpcHitsPos();
128 cout <<
" * tpcHitsNeg " << V0->tpcHitsNeg();
129 cout <<
" * dcaPosToPrimVertex " << V0->dcaPosToPrimVertex();
130 cout <<
" * dcaNegToPrimVertex " << V0->dcaNegToPrimVertex();
131 cout <<
" * ptArmV0 " << V0->ptArmV0();
132 cout <<
" * alphaV0 " << V0->alphaV0();
133 cout <<
" * dEdxPos " << V0->dedxPos();
134 cout <<
" * dEdxNeg " << V0->dedxNeg();
142 if( strstr(V0Type,
"k") || strstr(V0Type,
"K")){
143 if( V0->massK0Short() < (mV0MassRange[1]) &&
144 V0->massK0Short() > (mV0MassRange[0]) ) inMassRange=1;
146 else if( (strstr(V0Type,
"anti") || strstr(V0Type,
"ANTI"))){
147 if( V0->massAntiLambda() < (mV0MassRange[1]) &&
148 V0->massAntiLambda() > (mV0MassRange[0]) ) inMassRange=1;
150 else if( (strstr(V0Type,
"ambda") || strstr(V0Type,
"AMBDA"))){
151 if( V0->massLambda() < (mV0MassRange[1]) &&
152 V0->massLambda() > (mV0MassRange[0]) ) inMassRange=1;
157 bool goodPID = ( inMassRange &&
158 (V0->dcaV0Daughters() > mdcaV0daughters[0]) &&
159 (V0->dcaV0Daughters() < mdcaV0daughters[1]) &&
160 (V0->dcaV0ToPrimVertex() > mdcaV0ToPrimVertex[0]) &&
161 (V0->dcaV0ToPrimVertex() < mdcaV0ToPrimVertex[1]) &&
162 (V0->decayLengthV0() > mdecayLengthV0[0]) &&
163 (V0->decayLengthV0() < mdecayLengthV0[1]) &&
164 (V0->tpcHitsPos() > mtpcHitsPos[0]) &&
165 (V0->tpcHitsPos() < mtpcHitsPos[1]) &&
166 (V0->tpcHitsNeg() > mtpcHitsNeg[0]) &&
167 (V0->tpcHitsNeg() < mtpcHitsNeg[1]) &&
168 (V0->dcaPosToPrimVertex() > mdcaPosToPrimVertex[0]) &&
169 (V0->dcaPosToPrimVertex() < mdcaPosToPrimVertex[1]) &&
170 (V0->dcaNegToPrimVertex() > mdcaNegToPrimVertex[0]) &&
171 (V0->dcaNegToPrimVertex() < mdcaNegToPrimVertex[1]) &&
172 (V0->ptArmV0() > mptArmV0[0]) &&
173 (V0->ptArmV0() < mptArmV0[1]) &&
174 (V0->alphaV0() > malphaV0[0]) &&
175 (V0->alphaV0() < malphaV0[1]));
179 if(goodPID && mChargedEdx !=0){
185 StHbtTrkV0Iterator pIter;
188 float dedxPos= -1000;
190 for( pIter= EventCut->TrkV0MatchCollection()->begin(); pIter!= EventCut->TrkV0MatchCollection()->end(); pIter++){
193 if( TheMatch->TrkId() == V0->idPos() && !TheMatch->Used()){
194 dedxPos= TheMatch->dEdx();
195 TheMatch->SetUsed(1);
197 if( TheMatch->TrkId() == V0->idNeg() && !TheMatch->Used()){
198 dedxNeg=TheMatch->dEdx();
199 TheMatch->SetUsed(1);
204 goodPID = ( (dedxNeg > (mdEdx[0]*V0->ptNeg()+mdEdx[1])) &&
205 (dedxNeg > (mdEdx[2]*V0->ptNeg()+mdEdx[3])));
207 if( mChargedEdx > 0){
208 goodPID = ( (dedxPos > (mdEdx[0]*V0->ptPos()+mdEdx[1])) &&
209 (dedxPos > (mdEdx[2]*V0->ptPos()+mdEdx[3])));
216 float TEnergy = ::sqrt((V0->ptotV0())*(V0->ptotV0())+mMass*mMass);
217 float TRapidity = 0.5*::log((TEnergy+V0->momV0().z())/
218 (TEnergy-V0->momV0().z()));
220 float Pt = V0->ptV0();
225 cout <<
" * Pt " << Pt;
226 cout <<
" * mPt[0] " << mPt[0];
227 cout <<
" * mPt[1] " << mPt[1];
228 cout <<
" * TRapidity " << TRapidity;
229 cout <<
" * mRapidity[0] " << mRapidity[0];
230 cout <<
" * mRapidity[1] " << mRapidity[1];
231 cout <<
" * Pt " << (Pt > mPt[0]) && (Pt < mPt[1]);
232 cout <<
" * y " << (TRapidity > mRapidity[0]) && (TRapidity < mRapidity[1]);
239 (TRapidity > mRapidity[0]) &&
240 (TRapidity < mRapidity[1]));
242 goodV0 ? mNV0sPassed++ : mNV0sFailed++;
251 StHbtString helensLaPV0Cut::Report(){
254 sprintf(Ctemp,
"--helensLaPV0Cut--\n Particle mass:\t%E\n",this->Mass());
256 sprintf(Ctemp,
"V0 mass range:\t%E - %E\n",mV0MassRange[0],
259 sprintf(Ctemp,
"dcaV0daughters:\t%E - %E\n",mdcaV0daughters[0],
262 sprintf(Ctemp,
"dcaV0ToPrimVertex:\t%E - %E\n",mdcaV0ToPrimVertex[0],
263 mdcaV0ToPrimVertex[1]);
265 sprintf(Ctemp,
"decayLengthV0:\t%E - %E\n",mdecayLengthV0[0],
268 sprintf(Ctemp,
"tpcHitsPos:\t%d - %d\n",mtpcHitsPos[0],mtpcHitsPos[1]);
270 sprintf(Ctemp,
"tpcHitsNeg:\t%d - %d\n",mtpcHitsNeg[0],mtpcHitsNeg[1]);
272 sprintf(Ctemp,
"dcaPosToPrimVertex:\t%E - %E\n",mdcaPosToPrimVertex[0],
273 mdcaPosToPrimVertex[1]);
275 sprintf(Ctemp,
"dcaNegToPrimVertex:\t%E - %E\n",mdcaNegToPrimVertex[0],
276 mdcaNegToPrimVertex[1]);
278 sprintf(Ctemp,
"dedx>:\t%E pt+%E and \t%E pt+ %E for Charge%E\n ",mdEdx[0],mdEdx[1],mdEdx[2],mdEdx[3],mChargedEdx);
280 sprintf(Ctemp,
"ptArmV0:\t%E - %E\n",mptArmV0[0],mptArmV0[1]);
282 sprintf(Ctemp,
"alphaV0:\t%E - %E\n",malphaV0[0],malphaV0[1]);
284 sprintf(Ctemp,
"Particle pT:\t%E - %E\n",mPt[0],mPt[1]);
286 sprintf(Ctemp,
"Particle rapidity:\t%E - %E\n",mRapidity[0],mRapidity[1]);
288 sprintf(Ctemp,
"Number of V0s which passed:\t%ld Number which failed:\t%ld\n",mNV0sPassed,mNV0sFailed);
290 StHbtString returnThis = Stemp;