]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWGCF/FEMTOSCOPY/AliFemto/AliFemtoV0TrackCut.cxx
update in Kaon Femto train
[u/mrichter/AliRoot.git] / PWGCF / FEMTOSCOPY / AliFemto / AliFemtoV0TrackCut.cxx
CommitLineData
973a91f8 1#include "AliFemtoV0TrackCut.h"
2#include "AliESDtrack.h"
3#include <cstdio>
4
5#ifdef __ROOT__
6ClassImp(AliFemtoV0TrackCut)
7#endif
8
9
10
11AliFemtoV0TrackCut::AliFemtoV0TrackCut() :
fcf522b3 12fInvMassLambdaMin(0),fInvMassLambdaMax(99),fMinDcaDaughterPosToVert(0),fMinDcaDaughterNegToVert(0),fMaxDcaV0Daughters(99),fMaxDcaV0(99), fMaxCosPointingAngle(0), fParticleType(99), fEta(0.8), fPtMin(0), fPtMax(100), fOnFlyStatus(kFALSE), fMaxEtaDaughters(100), fTPCNclsDaughters(0), fNdofDaughters(10), fStatusDaughters(0), fPtMinPosDaughter(0), fPtMaxPosDaughter(99), fPtMinNegDaughter(0), fPtMaxNegDaughter(99),fMinAvgSepDaughters(0)
973a91f8 13{
14 // Default constructor
15 }
16 //------------------------------
17AliFemtoV0TrackCut::~AliFemtoV0TrackCut(){
18 /* noop */
19}
20//------------------------------
21bool AliFemtoV0TrackCut::Pass(const AliFemtoV0* aV0)
22{
23 // test the particle and return
24 // true if it meets all the criteria
25 // false if it doesn't meet at least one of the criteria
ce7b3d98 26
27 Float_t pt = aV0->PtV0();
28 Float_t eta = aV0->EtaV0();
29
973a91f8 30 //kinematic cuts
31 if(TMath::Abs(eta) > fEta) return false; //put in kinematic cuts by hand
32 if(pt < fPtMin) return false;
33 if(pt > fPtMax) return false;
34 if(TMath::Abs(aV0->EtaPos()) > fMaxEtaDaughters) return false;
35 if(TMath::Abs(aV0->EtaNeg()) > fMaxEtaDaughters) return false;
36
ce7b3d98 37 if(aV0->PtPos()< fPtMinPosDaughter) return false;
38 if(aV0->PtNeg()< fPtMinNegDaughter) return false;
39 if(aV0->PtPos()> fPtMaxPosDaughter) return false;
40 if(aV0->PtNeg()> fPtMaxNegDaughter) return false;
41
973a91f8 42 //V0 from kinematics information
43 if (fParticleType == kLambdaMC ) {
44 if(!(aV0->MassLambda()>fInvMassLambdaMin && aV0->MassLambda()<fInvMassLambdaMax) || !(aV0->PosNSigmaTPCP()==0))
45 return false;
46 else
47 {
48 return true;
49 }
50 }
51 else if (fParticleType == kAntiLambdaMC) {
52 if(!(aV0->MassLambda()>fInvMassLambdaMin &&aV0->MassLambda()<fInvMassLambdaMax) || !(aV0->NegNSigmaTPCP()==0))
53 return false;
54 else
55 {
56 return true;
57 }
58 }
ce7b3d98 59
973a91f8 60 //quality cuts
ce7b3d98 61 if(aV0->OnFlyStatusV0()!=fOnFlyStatus) return false;
973a91f8 62 if(aV0->StatusNeg() == 999 || aV0->StatusPos() == 999) return false;
63 if(aV0->TPCNclsPos()<fTPCNclsDaughters) return false;
64 if(aV0->TPCNclsNeg()<fTPCNclsDaughters) return false;
65 if(aV0->NdofPos()>fNdofDaughters) return false;
66 if(aV0->NdofNeg()>fNdofDaughters) return false;
67 if(!(aV0->StatusNeg()&fStatusDaughters)) return false;
68 if(!(aV0->StatusPos()&fStatusDaughters)) return false;
69
ce7b3d98 70
71
973a91f8 72 //DCA between daughter particles
73 if(TMath::Abs(aV0->DcaV0Daughters())>fMaxDcaV0Daughters)
74 return false;
75
76 //DCA of daughters to primary vertex
fcf522b3 77 if(TMath::Abs(aV0->DcaPosToPrimVertex())<fMinDcaDaughterPosToVert || TMath::Abs(aV0->DcaNegToPrimVertex())<fMinDcaDaughterNegToVert)
973a91f8 78 return false;
79
80 //DCA V0 to prim vertex
81 if(TMath::Abs(aV0->DcaV0ToPrimVertex())>fMaxDcaV0)
82 return false;
83
84 //cos pointing angle
85 if(aV0->CosPointingAngle()<fMaxCosPointingAngle)
86 return false;
87
868faa19 88 //decay length
89 if(aV0->DecayLengthV0()>fMaxDecayLength)
90 return false;
91
92
973a91f8 93 if(fParticleType == kAll)
94 return true;
ce7b3d98 95
973a91f8 96
97 bool pid_check=false;
98 // Looking for lambdas = proton + pim
99 if (fParticleType == 0 ) {
ce7b3d98 100 if (IsProtonNSigma(aV0->PtPos(), aV0->PosNSigmaTPCP(), aV0->PosNSigmaTOFP())) //proton
101 if (IsPionNSigma(aV0->PtNeg(), aV0->NegNSigmaTPCPi(), aV0->NegNSigmaTOFPi())) //pion
973a91f8 102 {
103 pid_check=true;
104 //invariant mass lambda
105 if(aV0->MassLambda()<fInvMassLambdaMin || aV0->MassLambda()>fInvMassLambdaMax)
106 return false;
107 }
108
109 }//Looking for antilambdas = antiproton + pip
110 else if (fParticleType == 1) {
ce7b3d98 111 if (IsProtonNSigma(aV0->PtNeg(), aV0->NegNSigmaTPCP(), aV0->NegNSigmaTOFP())) //proton
112 if (IsPionNSigma(aV0->PtPos(), aV0->PosNSigmaTPCPi(), aV0->PosNSigmaTOFPi())) //pion
973a91f8 113 {
114 pid_check=true;
115 //invariant mass antilambda
116 if(aV0->MassAntiLambda()<fInvMassLambdaMin || aV0->MassAntiLambda()>fInvMassLambdaMax)
117 return false;
118 }
119 }
973a91f8 120 if(!pid_check) return false;
973a91f8 121
ce7b3d98 122
973a91f8 123 return true;
124
125
126}
127//------------------------------
128AliFemtoString AliFemtoV0TrackCut::Report()
129{
130 // Prepare report from the execution
131 string tStemp;
132 char tCtemp[100];
133 snprintf(tCtemp , 100, "Minimum of Invariant Mass assuming Lambda:\t%lf\n",fInvMassLambdaMin);
134 tStemp+=tCtemp;
135 snprintf(tCtemp , 100, "Maximum of Invariant Mass assuming Lambda:\t%lf\n",fInvMassLambdaMax);
136 tStemp+=tCtemp;
fcf522b3 137 snprintf(tCtemp , 100, "Minimum DCA of positive daughter to primary vertex:\t%lf\n",fMinDcaDaughterPosToVert);
138 tStemp+=tCtemp;
139 snprintf(tCtemp , 100, "Minimum DCA of negative daughter to primary vertex:\t%lf\n",fMinDcaDaughterNegToVert);
140 tStemp+=tCtemp;
973a91f8 141 snprintf(tCtemp , 100, "Max DCA of daughters:\t%lf\n",fMaxDcaV0Daughters);
142 tStemp+=tCtemp;
143
144
145
146 AliFemtoString returnThis = tStemp;
147 return returnThis;
148}
149TList *AliFemtoV0TrackCut::ListSettings()
150{
151 // return a list of settings in a writable form
152 TList *tListSetttings = new TList();
153 char buf[200];
154 snprintf(buf, 200, "AliFemtoV0TrackCut.InvMassLambdaMin=%lf", fInvMassLambdaMin);
155 tListSetttings->AddLast(new TObjString(buf));
156 return tListSetttings;
157}
158
fcf522b3 159void AliFemtoV0TrackCut::SetMinDaughtersToPrimVertex(double minPos, double minNeg)
973a91f8 160{
fcf522b3 161 fMinDcaDaughterPosToVert=minPos;
162 fMinDcaDaughterNegToVert=minNeg;
973a91f8 163}
164
165void AliFemtoV0TrackCut::SetMaxDcaV0Daughters(double max)
166{
167 fMaxDcaV0Daughters=max;
168};
868faa19 169void AliFemtoV0TrackCut::SetMaxV0DecayLength(double max)
170{
171 fMaxDecayLength=max;
172};
973a91f8 173
174void AliFemtoV0TrackCut::SetMaxDcaV0(double max)
175{
176 fMaxDcaV0=max;
177};
178
179void AliFemtoV0TrackCut::SetMaxCosPointingAngle(double max)
180{
181 fMaxCosPointingAngle = max;
182}
183
184void AliFemtoV0TrackCut::SetParticleType(short x)
185{
186 fParticleType = x;
187}
188
189void AliFemtoV0TrackCut::SetEta(double x){
190 fEta = x;
191}
192
193void AliFemtoV0TrackCut::SetPt(double min, double max){
194 fPtMin = min;
195 fPtMax = max;
196}
197
198void AliFemtoV0TrackCut::SetEtaDaughters(float x)
199{
200 fMaxEtaDaughters = x;
201}
202void AliFemtoV0TrackCut::SetTPCnclsDaughters(int x)
203{
204 fTPCNclsDaughters = x;
205}
206void AliFemtoV0TrackCut::SetNdofDaughters(int x)
207{
208 fNdofDaughters=x;
209}
210void AliFemtoV0TrackCut::SetStatusDaughters(unsigned long x)
211{
212 fStatusDaughters=x;
213}
ce7b3d98 214void AliFemtoV0TrackCut::SetPtPosDaughter(float min,float max)
973a91f8 215{
ce7b3d98 216 fPtMinPosDaughter = min;
217 fPtMaxPosDaughter = max;
218}
219
220void AliFemtoV0TrackCut::SetPtNegDaughter(float min,float max)
221{
222 fPtMinNegDaughter = min;
223 fPtMaxNegDaughter = max;
973a91f8 224}
225
226void AliFemtoV0TrackCut::SetOnFlyStatus(bool x)
227{
228 fOnFlyStatus = x;
229}
230
231void AliFemtoV0TrackCut::SetInvariantMassLambda(double min, double max)
232{
233 fInvMassLambdaMin = min;
234 fInvMassLambdaMax = max;
235
236}
237
ce7b3d98 238void AliFemtoV0TrackCut::SetMinAvgSeparation(double minSep)
239{
240 fMinAvgSepDaughters = minSep;
241}
242
973a91f8 243//---------------------PID n Sigma ---------------------------------//
244bool AliFemtoV0TrackCut::IsKaonTPCdEdxNSigma(float mom, float nsigmaK)
245{
973a91f8 246 if(mom<0.35 && TMath::Abs(nsigmaK)<5.0)return true;
247 if(mom>=0.35 && mom<0.5 && TMath::Abs(nsigmaK)<3.0)return true;
248 if(mom>=0.5 && mom<0.7 && TMath::Abs(nsigmaK)<2.0)return true;
249
250 return false;
251}
252
253
254bool AliFemtoV0TrackCut::IsKaonTOFNSigma(float mom, float nsigmaK)
255{
973a91f8 256 if(mom>=1.5 && TMath::Abs(nsigmaK)<2.0)return true;
257 return false;
258}
259
260bool AliFemtoV0TrackCut::IsKaonNSigma(float mom, float nsigmaTPCK, float nsigmaTOFK)
261{
ce7b3d98 262 if(mom<0.4)
263 {
264 if(nsigmaTOFK<-999.)
265 {
266 if(TMath::Abs(nsigmaTPCK)<1.0) return true;
267 }
268 else if(TMath::Abs(nsigmaTOFK)<3.0 && TMath::Abs(nsigmaTPCK)<3.0) return true;
269 }
270 else if(mom>=0.4 && mom<=0.6)
271 {
272 if(nsigmaTOFK<-999.)
273 {
274 if(TMath::Abs(nsigmaTPCK)<2.0) return true;
275 }
276 else if(TMath::Abs(nsigmaTOFK)<3.0 && TMath::Abs(nsigmaTPCK)<3.0) return true;
277 }
278 else if(nsigmaTOFK<-999.)
279 {
280 return false;
281 }
282 else if(TMath::Abs(nsigmaTOFK)<3.0 && TMath::Abs(nsigmaTPCK)<3.0) return true;
973a91f8 283
973a91f8 284 return false;
285}
286
287
288
289bool AliFemtoV0TrackCut::IsPionNSigma(float mom, float nsigmaTPCPi, float nsigmaTOFPi)
290{
ce7b3d98 291 if(TMath::Abs(nsigmaTPCPi)<3.0) return true;
973a91f8 292
ce7b3d98 293 /*if(nsigmaTOFPi<-999.)
294 {
295 if(TMath::Abs(nsigmaTPCPi)<3.0) return true;
296 }
297 else
298 {
299 if(TMath::Abs(nsigmaTPCPi)<3.0 && TMath::Abs(nsigmaTOFPi)<4.0) return true;
300 }*/
301
302 /*if(mom<0.65)
303 {
304 if(nsigmaTOFPi<-999.)
305 {
306 if(mom<0.35 && TMath::Abs(nsigmaTPCPi)<3.0) return true;
307 else if(mom<0.5 && mom>=0.35 && TMath::Abs(nsigmaTPCPi)<3.0) return true;
308 else if(mom>=0.5 && TMath::Abs(nsigmaTPCPi)<2.0) return true;
309 else return false;
310 }
311 else if(TMath::Abs(nsigmaTOFPi)<3.0 && TMath::Abs(nsigmaTPCPi)<3.0) return true;
312 if(TMath::Abs(nsigmaTPCPi)<3.0) return true;
313 else return false;
314 }
315 else if(nsigmaTOFPi<-999.)
316 {
317 return false;
318 }
319 else if(mom<1.5 && TMath::Abs(nsigmaTOFPi)<3.0 && TMath::Abs(nsigmaTPCPi)<5.0) return true;
320 else if(mom>=1.5 && TMath::Abs(nsigmaTOFPi)<2.0 && TMath::Abs(nsigmaTPCPi)<5.0) return true;*/
973a91f8 321
322 return false;
323}
324
973a91f8 325bool AliFemtoV0TrackCut::IsProtonNSigma(float mom, float nsigmaTPCP, float nsigmaTOFP)
326{
ce7b3d98 327 if(mom<0.8)
328 {
329 if(TMath::Abs(nsigmaTPCP)<3.0) return true;
330 }
331 else
332 {
333 if(nsigmaTOFP<-999.)
334 {
335 if(TMath::Abs(nsigmaTPCP)<3.0) return true;
336 }
337 else
338 {
339 if(TMath::Abs(nsigmaTPCP)<3.0 && TMath::Abs(nsigmaTOFP)<3.0) return true;
340 }
341 }
973a91f8 342
973a91f8 343
ce7b3d98 344 /*if(nsigmaTOFP<-999.)
345 {
346 if(TMath::Abs(nsigmaTPCP)<3.0) return true;
347 }
348 else
349 {
350 if(TMath::Abs(nsigmaTPCP)<3.0 && TMath::Abs(nsigmaTOFP)<3.0) return true;
351 }*/
973a91f8 352
973a91f8 353
ce7b3d98 354 /*if(mom<0.8)
355 {
356 if(nsigmaTOFP<-999.)
357 {
358 if(TMath::Abs(nsigmaTPCP)<3.0) return true;
359 else return false;
360 }
361 else if(TMath::Abs(nsigmaTOFP)<3.0 && TMath::Abs(nsigmaTPCP)<3.0) return true;
362 if(TMath::Abs(nsigmaTPCP)<3.0) return true;
363 else return false;
364 }
365 else if(nsigmaTOFP<-999.)
366 {
367 return false;
368 }
369 else if(TMath::Abs(nsigmaTOFP)<3.0 && TMath::Abs(nsigmaTPCP)<3.0) return true;*/
1b30f876 370
973a91f8 371 return false;
372}