23 #include "StHbtMaker/Cut/franksV0Cut.h"
24 #include "StarClassLibrary/SystemOfUnits.h"
32 franksV0Cut::franksV0Cut() : mNV0sPassed(0), mNV0sFailed(0) {
41 void franksV0Cut::EventBegin(
const StHbtEvent* ev) {
42 mPrimaryVertex = ev->PrimVertPos();
47 bool franksV0Cut::Pass(
const StHbtV0* V0){
48 double degree=3.1415927/180.;
53 cout <<
" v0 " << V0 << endl;
54 cout <<
" * dcaV0Daughters " << V0->dcaV0Daughters();
55 cout <<
" * dcaV0ToPrimVertex " << V0->dcaV0ToPrimVertex();
56 cout <<
" * pV0ToPrimVertexAngle " << V0->pV0ToPrimVertexAngle();
57 cout <<
" * decayLengthV0 " << V0->decayLengthV0();
58 cout <<
" * tpcHitsPos " << V0->tpcHitsPos();
59 cout <<
" * tpcHitsNeg " << V0->tpcHitsNeg();
60 cout <<
" * dcaPosToPrimVertex " << V0->dcaPosToPrimVertex();
61 cout <<
" * dcaNegToPrimVertex " << V0->dcaNegToPrimVertex();
62 cout <<
" * ptArmV0 " << V0->ptArmV0();
63 cout <<
" * alphaV0 " << V0->alphaV0();
70 if( strstr(V0Type,
"k") || strstr(V0Type,
"K")){
71 if( V0->massK0Short() < (mMass+mV0MassRange[1]) &&
72 V0->massK0Short() > (mMass+mV0MassRange[0]) ) inMassRange=1;
74 else if( (strstr(V0Type,
"anti") || strstr(V0Type,
"ANTI"))){
75 if( V0->massAntiLambda() < (mMass+mV0MassRange[1]) &&
76 V0->massAntiLambda() > (mMass+mV0MassRange[0]) ) inMassRange=1;
78 else if( (strstr(V0Type,
"ambda") || strstr(V0Type,
"AMBDA"))){
79 if( V0->massLambda() < (mMass+mV0MassRange[1]) &&
80 V0->massLambda() > (mMass+mV0MassRange[0]) ) inMassRange=1;
84 cout <<
" inMassRange " << inMassRange << endl;
87 double angle = (V0->decayVertexV0() - mPrimaryVertex).angle(V0->momV0()) / degree;
89 cout <<
" decayVertexV0 " << V0->decayVertexV0() << endl;
90 cout <<
" mPrimaryVertex " << mPrimaryVertex << endl;
91 cout <<
" angle " << angle << endl;
94 bool goodPID = ( inMassRange &&
95 (V0->dcaV0Daughters() > mdcaV0daughters[0]) &&
96 (V0->dcaV0Daughters() < mdcaV0daughters[1]) &&
97 (V0->dcaV0ToPrimVertex() > mdcaV0ToPrimVertex[0]) &&
98 (V0->dcaV0ToPrimVertex() < mdcaV0ToPrimVertex[1]) &&
99 (angle > mpV0ToPrimVertexAngle[0]) &&
100 (angle < mpV0ToPrimVertexAngle[1]) &&
101 (V0->decayLengthV0() > mdecayLengthV0[0]) &&
102 (V0->decayLengthV0() < mdecayLengthV0[1]) &&
103 (V0->tpcHitsPos() > mtpcHitsPos[0]) &&
104 (V0->tpcHitsPos() < mtpcHitsPos[1]) &&
105 (V0->tpcHitsNeg() > mtpcHitsNeg[0]) &&
106 (V0->tpcHitsNeg() < mtpcHitsNeg[1]) &&
107 (V0->dcaPosToPrimVertex() > mdcaPosToPrimVertex[0]) &&
108 (V0->dcaPosToPrimVertex() < mdcaPosToPrimVertex[1]) &&
109 (V0->dcaNegToPrimVertex() > mdcaNegToPrimVertex[0]) &&
110 (V0->dcaNegToPrimVertex() < mdcaNegToPrimVertex[1]) &&
111 (V0->ptArmV0() > mptArmV0[0]) &&
112 (V0->ptArmV0() < mptArmV0[1]) &&
113 (V0->alphaV0() > malphaV0[0]) &&
114 (V0->alphaV0() < malphaV0[1]));
118 cout <<
" goodPID " << goodPID << endl;
123 cout <<
"now calculate rapidity" << endl;
125 float TEnergy = ::sqrt((V0->ptotV0())*(V0->ptotV0())+mMass*mMass);
126 float TRapidity = 0.5*::log((TEnergy+V0->momV0().z())/
127 (TEnergy-V0->momV0().z()));
128 float Pt = V0->ptV0();
133 cout <<
" * Pt " << Pt;
134 cout <<
" * mPt[0] " << mPt[0];
135 cout <<
" * mPt[1] " << mPt[1];
136 cout <<
" * TRapidity " << TRapidity;
137 cout <<
" * mRapidity[0] " << mRapidity[0];
138 cout <<
" * mRapidity[1] " << mRapidity[1];
139 cout <<
" * Pt " << (Pt > mPt[0]) && (Pt < mPt[1]);
140 cout <<
" * y " << (TRapidity > mRapidity[0]) && (TRapidity < mRapidity[1]);
147 (TRapidity > mRapidity[0]) &&
148 (TRapidity < mRapidity[1]));
150 goodV0 ? mNV0sPassed++ : mNV0sFailed++;
159 StHbtString franksV0Cut::Report(){
162 sprintf(Ctemp,
"--franksV0Cut--\n Particle mass:\t%E\n",this->Mass());
164 sprintf(Ctemp,
"dcaV0daughters:\t%E - %E\n",mdcaV0daughters[0],
167 sprintf(Ctemp,
"dcaV0ToPrimVertex:\t%E - %E\n",mdcaV0ToPrimVertex[0],
168 mdcaV0ToPrimVertex[1]);
170 sprintf(Ctemp,
"pV0ToPrimVertexAngle:\t%E - %E\n",mpV0ToPrimVertexAngle[0],mpV0ToPrimVertexAngle[1]);
172 sprintf(Ctemp,
"decayLengthV0:\t%E - %E\n",mdecayLengthV0[0],
175 sprintf(Ctemp,
"tpcHitsPos:\t%d - %d\n",mtpcHitsPos[0],mtpcHitsPos[1]);
177 sprintf(Ctemp,
"tpcHitsNeg:\t%d - %d\n",mtpcHitsNeg[0],mtpcHitsNeg[1]);
179 sprintf(Ctemp,
"dcaPosToPrimVertex:\t%E - %E\n",mdcaPosToPrimVertex[0],
180 mdcaPosToPrimVertex[1]);
182 sprintf(Ctemp,
"dcaNegToPrimVertex:\t%E - %E\n",mdcaNegToPrimVertex[0],
183 mdcaNegToPrimVertex[1]);
185 sprintf(Ctemp,
"ptArmV0:\t%E - %E\n",mptArmV0[0],mptArmV0[1]);
187 sprintf(Ctemp,
"alphaV0:\t%E - %E\n",malphaV0[0],malphaV0[1]);
189 sprintf(Ctemp,
"Particle pT:\t%E - %E\n",mPt[0],mPt[1]);
191 sprintf(Ctemp,
"Particle rapidity:\t%E - %E\n",mRapidity[0],mRapidity[1]);
193 sprintf(Ctemp,
"Number of V0s which passed:\t%ld Number which failed:\t%ld\n",mNV0sPassed,mNV0sFailed);
195 StHbtString returnThis = Stemp;