56 #include "StHbtMaker/Cut/helensV0Cut.h"
64 helensV0Cut::helensV0Cut(){
65 mNV0sPassed = mNV0sFailed = 0;
68 mV0MassRange[1]=10000;
71 mdcaV0daughters[1]=1000;
73 mdcaV0ToPrimVertex[0]=0;
74 mdcaV0ToPrimVertex[1]=1000;
77 mdecayLengthV0[1]=10000;
86 mdcaPosToPrimVertex[0]=0;
87 mdcaPosToPrimVertex[1]=1000;
89 mdcaNegToPrimVertex[0]=0;
90 mdcaNegToPrimVertex[1]=10000;
107 mRapidity[0]=-100000;
120 bool helensV0Cut::Pass(
const StHbtV0* V0){
125 cout <<
" * dcaV0Daughters " << V0->dcaV0Daughters();
126 cout <<
" * dcaV0ToPrimVertex " << V0->dcaV0ToPrimVertex();
127 cout <<
" * decayLengthV0 " << V0->decayLengthV0();
128 cout <<
" * tpcHitsPos " << V0->tpcHitsPos();
129 cout <<
" * tpcHitsNeg " << V0->tpcHitsNeg();
130 cout <<
" * dcaPosToPrimVertex " << V0->dcaPosToPrimVertex();
131 cout <<
" * dcaNegToPrimVertex " << V0->dcaNegToPrimVertex();
132 cout <<
" * ptArmV0 " << V0->ptArmV0();
133 cout <<
" * alphaV0 " << V0->alphaV0();
134 cout <<
" * dEdxPos " << V0->dedxPos();
135 cout <<
" * dEdxNeg " << V0->dedxNeg();
143 if( strstr(V0Type,
"k") || strstr(V0Type,
"K")){
144 if( V0->massK0Short() < (mV0MassRange[1]) &&
145 V0->massK0Short() > (mV0MassRange[0]) ) inMassRange=1;
147 else if( (strstr(V0Type,
"anti") || strstr(V0Type,
"ANTI"))){
148 if( V0->massAntiLambda() < (mV0MassRange[1]) &&
149 V0->massAntiLambda() > (mV0MassRange[0]) ) inMassRange=1;
151 else if( (strstr(V0Type,
"ambda") || strstr(V0Type,
"AMBDA"))){
152 if( V0->massLambda() < (mV0MassRange[1]) &&
153 V0->massLambda() > (mV0MassRange[0]) ) inMassRange=1;
158 bool goodPID = ( inMassRange &&
159 (V0->dcaV0Daughters() > mdcaV0daughters[0]) &&
160 (V0->dcaV0Daughters() < mdcaV0daughters[1]) &&
161 (V0->dcaV0ToPrimVertex() > mdcaV0ToPrimVertex[0]) &&
162 (V0->dcaV0ToPrimVertex() < mdcaV0ToPrimVertex[1]) &&
163 (V0->decayLengthV0() > mdecayLengthV0[0]) &&
164 (V0->decayLengthV0() < mdecayLengthV0[1]) &&
165 (V0->tpcHitsPos() > mtpcHitsPos[0]) &&
166 (V0->tpcHitsPos() < mtpcHitsPos[1]) &&
167 (V0->tpcHitsNeg() > mtpcHitsNeg[0]) &&
168 (V0->tpcHitsNeg() < mtpcHitsNeg[1]) &&
169 (V0->dcaPosToPrimVertex() > mdcaPosToPrimVertex[0]) &&
170 (V0->dcaPosToPrimVertex() < mdcaPosToPrimVertex[1]) &&
171 (V0->dcaNegToPrimVertex() > mdcaNegToPrimVertex[0]) &&
172 (V0->dcaNegToPrimVertex() < mdcaNegToPrimVertex[1]) &&
173 (V0->ptArmV0() > mptArmV0[0]) &&
174 (V0->ptArmV0() < mptArmV0[1]) &&
175 (V0->alphaV0() > malphaV0[0]) &&
176 (V0->alphaV0() < malphaV0[1]));
178 if(goodPID && mChargedEdx){
180 goodPID = ( (V0->dedxNeg() > (mdEdx[0]*V0->ptNeg()+mdEdx[1])) &&
181 (V0->dedxNeg() > (mdEdx[2]*V0->ptNeg()+mdEdx[3])));
183 if( mChargedEdx > 0){
184 goodPID = ( (V0->dedxPos() > (mdEdx[0]*V0->ptPos()+mdEdx[1])) &&
185 (V0->dedxPos() > (mdEdx[2]*V0->ptPos()+mdEdx[3])));
190 float TEnergy = ::sqrt((V0->ptotV0())*(V0->ptotV0())+mMass*mMass);
191 float TRapidity = 0.5*::log((TEnergy+V0->momV0().z())/
192 (TEnergy-V0->momV0().z()));
194 float Pt = V0->ptV0();
199 cout <<
" * Pt " << Pt;
200 cout <<
" * mPt[0] " << mPt[0];
201 cout <<
" * mPt[1] " << mPt[1];
202 cout <<
" * TRapidity " << TRapidity;
203 cout <<
" * mRapidity[0] " << mRapidity[0];
204 cout <<
" * mRapidity[1] " << mRapidity[1];
205 cout <<
" * Pt " << (Pt > mPt[0]) && (Pt < mPt[1]);
206 cout <<
" * y " << (TRapidity > mRapidity[0]) && (TRapidity < mRapidity[1]);
213 (TRapidity > mRapidity[0]) &&
214 (TRapidity < mRapidity[1]));
216 goodV0 ? mNV0sPassed++ : mNV0sFailed++;
225 StHbtString helensV0Cut::Report(){
228 sprintf(Ctemp,
"--helensV0Cut--\n Particle mass:\t%E\n",this->Mass());
230 sprintf(Ctemp,
"V0 mass range:\t%E - %E\n",mV0MassRange[0],
233 sprintf(Ctemp,
"dcaV0daughters:\t%E - %E\n",mdcaV0daughters[0],
236 sprintf(Ctemp,
"dcaV0ToPrimVertex:\t%E - %E\n",mdcaV0ToPrimVertex[0],
237 mdcaV0ToPrimVertex[1]);
239 sprintf(Ctemp,
"decayLengthV0:\t%E - %E\n",mdecayLengthV0[0],
242 sprintf(Ctemp,
"tpcHitsPos:\t%d - %d\n",mtpcHitsPos[0],mtpcHitsPos[1]);
244 sprintf(Ctemp,
"tpcHitsNeg:\t%d - %d\n",mtpcHitsNeg[0],mtpcHitsNeg[1]);
246 sprintf(Ctemp,
"dcaPosToPrimVertex:\t%E - %E\n",mdcaPosToPrimVertex[0],
247 mdcaPosToPrimVertex[1]);
249 sprintf(Ctemp,
"dcaNegToPrimVertex:\t%E - %E\n",mdcaNegToPrimVertex[0],
250 mdcaNegToPrimVertex[1]);
252 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);
254 sprintf(Ctemp,
"ptArmV0:\t%E - %E\n",mptArmV0[0],mptArmV0[1]);
256 sprintf(Ctemp,
"alphaV0:\t%E - %E\n",malphaV0[0],malphaV0[1]);
258 sprintf(Ctemp,
"Particle pT:\t%E - %E\n",mPt[0],mPt[1]);
260 sprintf(Ctemp,
"Particle rapidity:\t%E - %E\n",mRapidity[0],mRapidity[1]);
262 sprintf(Ctemp,
"Number of V0s which passed:\t%ld Number which failed:\t%ld\n",mNV0sPassed,mNV0sFailed);
264 StHbtString returnThis = Stemp;