StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
franksXiCut.cxx
1 #include "StHbtMaker/Cut/franksXiCut.h"
2 #include <cstdio>
3 
4 #ifdef __ROOT__
5 ClassImp(franksXiCut)
6 #endif
7 
8 
9 franksXiCut::franksXiCut(){
10  mNXisPassed = mNXisFailed = 0;
11 
12  mXiMassRange[0] =0;
13  mXiMassRange[1]=10000;
14 
15  mOmegaMassRange[0] =0;
16  mOmegaMassRange[1]=10000;
17 
18  mdcaXidaughters[0]=0;
19  mdcaXidaughters[1]=1000;
20 
21  mdcaXiToPrimVertex[0]=0;
22  mdcaXiToPrimVertex[1]=1000;
23 
24  mdecayLengthXi[0]=0;
25  mdecayLengthXi[1]=10000;
26 
27  mtpcHitsBac[0]=0;
28  mtpcHitsBac[1]=1000;
29 
30  mdcaBacToPrimVertex[0]=0;
31  mdcaBacToPrimVertex[1]=10000;
32 
33  mptArmXi[0]=0;
34  mptArmXi[1]=100;
35 
36  malphaXi[0]=-10;
37  malphaXi[1]=10;
38 
39  mChargedEdx=0;
40  mdEdx[0]=0;
41  mdEdx[1]=-10;
42  mdEdx[0]=0;
43  mdEdx[1]=-10;
44 
45  mPt[0]=0;
46  mPt[1]=100000;
47 
48  mRapidity[0]=-100000;
49  mRapidity[1]=100000;
50 
51  mMass = 1.32131;
52 
53 
54 }
55 //------------------------------
56 //franksXiCut::~franksXiCut(){
57 // /* noop */
58 //}
59 //------------------------------
60 bool franksXiCut::Pass(const StHbtXi* Xi){
61  int inMassRange;
62 
63 #ifdef STHBTDEBUG
64  cout << endl;
65  cout << " * dcaXiDaughters " << Xi->dcaXiDaughters();
66  cout << " * dcaXiToPrimVertex " << Xi->dcaXiToPrimVertex();
67  cout << " * decayLengthXi " << Xi->decayLengthXi();
68  cout << " * tpcHitsBac " << Xi->tpcHitsBac();
69  cout << " * dcaNegToPrimVertex " << Xi->dcaBacToPrimVertex();
70  cout << " * ptArmXi " << Xi->ptArmXi();
71  cout << " * alphaXi " << Xi->alphaXi();
72  cout << " * dEdxBac " << Xi->dedxBac();
73  cout << endl;
74 #endif
75 
76 
77  inMassRange=0;
78  // Find out what particle is desired
79 
80  if ( (Xi->massXi() > mXiMassRange[0]) && (Xi->massXi() < mXiMassRange[1]) ) inMassRange=1;
81  if ( (Xi->massOmega() > mOmegaMassRange[0]) && (Xi->massOmega() < mOmegaMassRange[1]) ) inMassRange=1;
82 
83 
84  bool goodPID = ( inMassRange &&
85  (Xi->dcaXiDaughters() > mdcaXidaughters[0]) &&
86  (Xi->dcaXiDaughters() < mdcaXidaughters[1]) &&
87  (Xi->dcaXiToPrimVertex() > mdcaXiToPrimVertex[0]) &&
88  (Xi->dcaXiToPrimVertex() < mdcaXiToPrimVertex[1]) &&
89  (Xi->decayLengthXi() > mdecayLengthXi[0]) &&
90  (Xi->decayLengthXi() < mdecayLengthXi[1]) &&
91  (Xi->tpcHitsBac() > mtpcHitsBac[0]) &&
92  (Xi->tpcHitsBac() < mtpcHitsBac[1]) &&
93  (Xi->dcaBacToPrimVertex() > mdcaBacToPrimVertex[0]) &&
94  (Xi->dcaBacToPrimVertex() < mdcaBacToPrimVertex[1]) &&
95  (Xi->ptArmXi() > mptArmXi[0]) &&
96  (Xi->ptArmXi() < mptArmXi[1]) &&
97  (Xi->alphaXi() > malphaXi[0]) &&
98  (Xi->alphaXi() < malphaXi[1]));
99 
100  if(goodPID){
101  if( mChargedEdx <0){
102  goodPID = (Xi->dedxNeg() > (mdEdx[0]*Xi->ptNeg()+mdEdx[1]));
103  }
104  if( mChargedEdx > 0){
105  goodPID = (Xi->dedxPos() > (mdEdx[0]*Xi->ptPos()+mdEdx[1]));
106  }
107  }
108 
109  if (goodPID){
110  float TEnergy = ::sqrt((Xi->ptotXi())*(Xi->ptotXi())+mMass*mMass);
111  float TRapidity = 0.5*::log((TEnergy+Xi->momXi().z())/
112  (TEnergy-Xi->momXi().z()));
113 
114  float Pt = Xi->ptXi();
115 
116 
117 
118 #ifdef STHBTDEBUG
119  cout << " * Pt " << Pt;
120  cout << " * mPt[0] " << mPt[0];
121  cout << " * mPt[1] " << mPt[1];
122  cout << " * TRapidity " << TRapidity;
123  cout << " * mRapidity[0] " << mRapidity[0];
124  cout << " * mRapidity[1] " << mRapidity[1];
125  cout << " * Pt " << (Pt > mPt[0]) && (Pt < mPt[1]);
126  cout << " * y " << (TRapidity > mRapidity[0]) && (TRapidity < mRapidity[1]);
127  cout << endl;
128 #endif
129 
130  bool goodXi=
131  ((Pt > mPt[0]) &&
132  (Pt < mPt[1]) &&
133  (TRapidity > mRapidity[0]) &&
134  (TRapidity < mRapidity[1]));
135 
136  goodXi ? mNXisPassed++ : mNXisFailed++;
137  return (goodXi);
138  }
139  else{
140  mNXisFailed++;
141  return (goodPID);
142  }
143 }
144 //------------------------------
145 StHbtString franksXiCut::Report(){
146  string Stemp;
147  char Ctemp[100];
148  sprintf(Ctemp,"--franksXiCut--\n Particle mass:\t%E\n",this->Mass());
149  Stemp=Ctemp;
150  sprintf(Ctemp,"Xi mass range:\t%E - %E\n",mXiMassRange[0],
151  mXiMassRange[1]);
152  Stemp+=Ctemp;
153  sprintf(Ctemp,"dcaXidaughters:\t%E - %E\n",mdcaXidaughters[0],
154 mdcaXidaughters[1]);
155  Stemp+=Ctemp;
156  sprintf(Ctemp,"dcaXiToPrimVertex:\t%E - %E\n",mdcaXiToPrimVertex[0],
157 mdcaXiToPrimVertex[1]);
158  Stemp+=Ctemp;
159  sprintf(Ctemp,"decayLengthXi:\t%E - %E\n",mdecayLengthXi[0],
160 mdecayLengthXi[1]);
161  Stemp+=Ctemp;
162  sprintf(Ctemp,"tpcHitsBac:\t%d - %d\n",mtpcHitsBac[0],mtpcHitsBac[1]);
163  Stemp+=Ctemp;
164  sprintf(Ctemp,"dcaBacToPrimVertex:\t%E - %E\n",mdcaBacToPrimVertex[0],
165 mdcaBacToPrimVertex[1]);
166  Stemp+=Ctemp;
167  sprintf(Ctemp,"dedx>:\t%E pt+%E for Charge %E\n ",mdEdx[0],mdEdx[1],mChargedEdx);
168  Stemp+=Ctemp;
169  sprintf(Ctemp,"ptArmXi:\t%E - %E\n",mptArmXi[0],mptArmXi[1]);
170  Stemp+=Ctemp;
171  sprintf(Ctemp,"alphaXi:\t%E - %E\n",malphaXi[0],malphaXi[1]);
172  Stemp+=Ctemp;
173  sprintf(Ctemp,"Particle pT:\t%E - %E\n",mPt[0],mPt[1]);
174  Stemp+=Ctemp;
175  sprintf(Ctemp,"Particle rapidity:\t%E - %E\n",mRapidity[0],mRapidity[1]);
176  Stemp+=Ctemp;
177  sprintf(Ctemp,"Number of Xis which passed:\t%ld Number which failed:\t%ld\n",mNXisPassed,mNXisFailed);
178  Stemp += Ctemp;
179  StHbtString returnThis = Stemp;
180  return returnThis;
181 }