]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWGCF/FEMTOSCOPY/AliFemtoUser/AliFemtoESDTrackCut.cxx
Merge branch 'feature-movesplit'
[u/mrichter/AliRoot.git] / PWGCF / FEMTOSCOPY / AliFemtoUser / AliFemtoESDTrackCut.cxx
CommitLineData
76ce4b5b 1/*
2***************************************************************************
3*
87ede832 4* $Id$
5*
76ce4b5b 6*
76ce4b5b 7***************************************************************************
8*
87ede832 9*
10*
76ce4b5b 11*
12***************************************************************************
13*
14* $Log$
15* Revision 1.3 2007/05/22 09:01:42 akisiel
16* Add the possibiloity to save cut settings in the ROOT file
17*
18* Revision 1.2 2007/05/21 10:38:25 akisiel
19* More coding rule conformance
20*
21* Revision 1.1 2007/05/16 10:25:06 akisiel
22* Making the directory structure of AliFemtoUser flat. All files go into one common directory
23*
24* Revision 1.4 2007/05/03 09:46:10 akisiel
25* Fixing Effective C++ warnings
26*
27* Revision 1.3 2007/04/27 07:25:59 akisiel
28* Make revisions needed for compilation from the main AliRoot tree
29*
30* Revision 1.1.1.1 2007/04/25 15:38:41 panos
31* Importing the HBT code dir
32*
33* Revision 1.4 2007-04-03 16:00:08 mchojnacki
34* Changes to iprove memory managing
35*
36* Revision 1.3 2007/03/13 15:30:03 mchojnacki
37* adding reader for simulated data
38*
39* Revision 1.2 2007/03/08 14:58:03 mchojnacki
40* adding some alice stuff
41*
42* Revision 1.1.1.1 2007/03/07 10:14:49 mchojnacki
43* First version on CVS
44*
45**************************************************************************/
46
47#include "AliFemtoESDTrackCut.h"
48#include <cstdio>
49
87ede832 50#ifdef __ROOT__
76ce4b5b 51ClassImp(AliFemtoESDTrackCut)
52#endif
53
54
55// electron
56// 0.13 - 1.8
57// 0 7.594129e-02 8.256141e-03
58// 1 -5.535827e-01 8.170825e-02
59// 2 1.728591e+00 3.104210e-01
60// 3 -2.827893e+00 5.827802e-01
61// 4 2.503553e+00 5.736207e-01
62// 5 -1.125965e+00 2.821170e-01
63// 6 2.009036e-01 5.438876e-02
64
65// pion
66// 0.13 - 2.0
67// 0 1.063457e+00 8.872043e-03
68// 1 -4.222208e-01 2.534402e-02
69// 2 1.042004e-01 1.503945e-02
70
71// kaon
72// 0.18 - 2.0
73// 0 -7.289406e-02 1.686074e-03
74// 1 4.415666e-01 1.143939e-02
75// 2 -2.996790e-01 1.840964e-02
76// 3 6.704652e-02 7.783990e-03
77
78// proton
79// 0.26 - 2.0
80// 0 -3.730200e-02 2.347311e-03
81// 1 1.163684e-01 1.319316e-02
82// 2 8.354116e-02 1.997948e-02
83// 3 -4.608098e-02 8.336400e-03
84
85
86 AliFemtoESDTrackCut::AliFemtoESDTrackCut() :
87 fCharge(0),
88 fLabel(0),
89 fStatus(0),
90 fPIDMethod(knSigma),
12a3e650 91 fNsigmaTPCTOF(kFALSE),
87ede832 92 fNsigmaTPConly(kFALSE),
93 fNsigma(3.),
76ce4b5b 94 fminTPCclsF(0),
95 fminTPCncls(0),
96 fminITScls(0),
97 fMaxITSchiNdof(1000.0),
98 fMaxTPCchiNdof(1000.0),
99 fMaxSigmaToVertex(1000.0),
100 fNTracksPassed(0),
101 fNTracksFailed(0),
102 fRemoveKinks(kFALSE),
103 fRemoveITSFake(kFALSE),
87ede832 104 fMostProbable(0),
76ce4b5b 105 fMaxImpactXY(1000.0),
c53b8e2c 106 fMinImpactXY(-1000.0),
76ce4b5b 107 fMaxImpactZ(1000.0),
108 fMaxImpactXYPtOff(1000.0),
109 fMaxImpactXYPtNrm(1000.0),
110 fMaxImpactXYPtPow(1000.0),
111 fMinPforTOFpid(0.0),
112 fMaxPforTOFpid(10000.0),
113 fMinPforTPCpid(0.0),
114 fMaxPforTPCpid(10000.0),
115 fMinPforITSpid(0.0),
2e04885f 116 fMaxPforITSpid(10000.0),
117 fElectronRejection(0)
76ce4b5b 118{
119 // Default constructor
120 fNTracksPassed = fNTracksFailed = 0;
121 fCharge = 0; // takes both charges 0
122 fPt[0]=0.0; fPt[1] = 100.0;//100
123 fRapidity[0]=-2; fRapidity[1]=2;//-2 2
124 fEta[0]=-2; fEta[1]=2;//-2 2
125 fPidProbElectron[0]=-1;fPidProbElectron[1]=2;
126 fPidProbPion[0]=-1; fPidProbPion[1]=2;
127 fPidProbKaon[0]=-1;fPidProbKaon[1]=2;
128 fPidProbProton[0]=-1;fPidProbProton[1]=2;
129 fPidProbMuon[0]=-1;fPidProbMuon[1]=2;
4eac0b05 130 for (Int_t i = 0; i < 3; i++)
131 fCutClusterRequirementITS[i] = AliESDtrackCuts::kOff;
76ce4b5b 132 fLabel=false;
133 fStatus=0;
134 fminTPCclsF=0;
135 fminITScls=0;
136 fPIDMethod=knSigma;
12a3e650 137 fNsigmaTPCTOF=kFALSE;
87ede832 138 fNsigmaTPConly=kFALSE;
139 fNsigma=3.;
76ce4b5b 140}
141//------------------------------
142AliFemtoESDTrackCut::~AliFemtoESDTrackCut(){
143 /* noop */
144}
145//------------------------------
146bool AliFemtoESDTrackCut::Pass(const AliFemtoTrack* track)
147{
4eac0b05 148 //cout<<"AliFemtoESDTrackCut::Pass"<<endl;
c9b0c11d 149
87ede832 150 // test the particle and return
76ce4b5b 151 // true if it meets all the criteria
152 // false if it doesn't meet at least one of the criteria
153 float tMost[5];
87ede832 154
76ce4b5b 155 //cout<<"AliFemtoESD cut"<<endl;
156 //cout<<fPidProbPion[0]<<" < pi ="<<track->PidProbPion()<<" <"<<fPidProbPion[1]<<endl;
157 if (fStatus!=0)
158 {
159 //cout<<" status "<<track->Label()<<" "<<track->Flags()<<" "<<track->TPCnclsF()<<" "<<track->ITSncls()<<endl;
160 if ((track->Flags()&fStatus)!=fStatus)
161 {
162 // cout<<track->Flags()<<" "<<fStatus<<" no go through status"<<endl;
163 return false;
164 }
87ede832 165
76ce4b5b 166 }
167 if (fRemoveKinks) {
168 if ((track->KinkIndex(0)) || (track->KinkIndex(1)) || (track->KinkIndex(2)))
169 return false;
170 }
171 if (fRemoveITSFake) {
172 if (track->ITSncls() < 0)
173 return false;
174 }
175 if (fminTPCclsF>track->TPCnclsF())
176 {
177 //cout<<" No go because TPC Number of ClsF"<<fminTPCclsF<< " "<<track->TPCnclsF()<<endl;
178 return false;
179 }
180 if (fminTPCncls>track->TPCncls())
181 {
182 //cout<<" No go because TPC Number of ClsF"<<fminTPCclsF<< " "<<track->TPCnclsF()<<endl;
183 return false;
184 }
185 if (fminITScls>track->ITSncls())
186 {
187 //cout<<" No go because ITS Number of Cls"<<fminITScls<< " "<<track->ITSncls()<<endl;
188 return false;
189 }
190
191 if (fMaxImpactXY < TMath::Abs(track->ImpactD()))
192 return false;
193
c53b8e2c 194 if (fMinImpactXY > TMath::Abs(track->ImpactD()))
195 return false;
196
76ce4b5b 197 if (fMaxImpactZ < TMath::Abs(track->ImpactZ()))
198 return false;
87ede832 199
76ce4b5b 200 if (fMaxSigmaToVertex < track->SigmaToVertex()) {
201 return false;
202 }
87ede832 203
204 if (track->ITSncls() > 0)
76ce4b5b 205 if ((track->ITSchi2()/track->ITSncls()) > fMaxITSchiNdof) {
206 return false;
207 }
208
209 if (track->TPCncls() > 0)
210 if ((track->TPCchi2()/track->TPCncls()) > fMaxTPCchiNdof) {
211 return false;
212 }
4eac0b05 213 //ITS cluster requirenments
214 for (Int_t i = 0; i < 3; i++)
215 if(!CheckITSClusterRequirement(fCutClusterRequirementITS[i], track->HasPointOnITSLayer(i*2), track->HasPointOnITSLayer(i*2+1)))
216 return false;
76ce4b5b 217
218 if (fLabel)
219 {
220 //cout<<"labels"<<endl;
221 if(track->Label()<0)
222 {
223 fNTracksFailed++;
224 // cout<<"No Go Through the cut"<<endl;
225 // cout<<fLabel<<" Label="<<track->Label()<<endl;
226 return false;
87ede832 227 }
76ce4b5b 228 }
229 if (fCharge!=0)
87ede832 230 {
76ce4b5b 231 //cout<<"AliFemtoESD cut ch "<<endl;
232 //cout<<fCharge<<" Charge="<<track->Charge()<<endl;
87ede832 233 if (track->Charge()!= fCharge)
76ce4b5b 234 {
235 fNTracksFailed++;
236 // cout<<"No Go Through the cut"<<endl;
237 // cout<<fCharge<<" Charge="<<track->Charge()<<endl;
238 return false;
239 }
240 }
4eac0b05 241
242
87ede832 243
4eac0b05 244
76ce4b5b 245 Bool_t tTPCPidIn = (track->Flags()&AliFemtoTrack::kTPCpid)>0;
246 Bool_t tITSPidIn = (track->Flags()&AliFemtoTrack::kITSpid)>0;
247 Bool_t tTOFPidIn = (track->Flags()&AliFemtoTrack::kTOFpid)>0;
87ede832 248
76ce4b5b 249 if(fMinPforTOFpid > 0 && track->P().Mag() > fMinPforTOFpid &&
250 track->P().Mag() < fMaxPforTOFpid && !tTOFPidIn)
251 {
252 fNTracksFailed++;
253 return false;
254 }
87ede832 255
76ce4b5b 256 if(fMinPforTPCpid > 0 && track->P().Mag() > fMinPforTPCpid &&
257 track->P().Mag() < fMaxPforTPCpid && !tTPCPidIn)
258 {
259 fNTracksFailed++;
260 return false;
261 }
87ede832 262
76ce4b5b 263 if(fMinPforITSpid > 0 && track->P().Mag() > fMinPforITSpid &&
264 track->P().Mag() < fMaxPforITSpid && !tITSPidIn)
265 {
266 fNTracksFailed++;
267 return false;
268 }
87ede832 269
76ce4b5b 270
271 float tEnergy = ::sqrt(track->P().Mag2()+fMass*fMass);
e52a5f82 272 float tRapidity = 0;
273 if(tEnergy-track->P().z()!=0 && (tEnergy+track->P().z())/(tEnergy-track->P().z())>0)
274 tRapidity = 0.5*::log((tEnergy+track->P().z())/(tEnergy-track->P().z()));
76ce4b5b 275 float tPt = ::sqrt((track->P().x())*(track->P().x())+(track->P().y())*(track->P().y()));
276 float tEta = track->P().PseudoRapidity();
87ede832 277
76ce4b5b 278 if (fMaxImpactXYPtOff < 999.0) {
279 if ((fMaxImpactXYPtOff + fMaxImpactXYPtNrm*TMath::Power(tPt, fMaxImpactXYPtPow)) < TMath::Abs(track->ImpactD())) {
280 fNTracksFailed++;
281 return false;
282 }
283 }
284
285 if ((tRapidity<fRapidity[0])||(tRapidity>fRapidity[1]))
286 {
287 fNTracksFailed++;
87ede832 288 //cout<<"No Go Through the cut"<<endl;
76ce4b5b 289 //cout<<fRapidity[0]<<" < Rapidity ="<<tRapidity<<" <"<<fRapidity[1]<<endl;
290 return false;
291 }
292 if ((tEta<fEta[0])||(tEta>fEta[1]))
293 {
294 fNTracksFailed++;
87ede832 295 //cout<<"No Go Through the cut"<<endl;
76ce4b5b 296 //cout<<fEta[0]<<" < Eta ="<<tEta<<" <"<<fEta[1]<<endl;
297 return false;
298 }
299 if ((tPt<fPt[0])||(tPt>fPt[1]))
300 {
301 fNTracksFailed++;
302 //cout<<"No Go Through the cut"<<endl;
303 //cout<<fPt[0]<<" < Pt ="<<Pt<<" <"<<fPt[1]<<endl;
304 return false;
305 }
4eac0b05 306
307
308
309
87ede832 310 // cout << "Track has pids: "
311 // << track->PidProbElectron() << " "
312 // << track->PidProbMuon() << " "
313 // << track->PidProbPion() << " "
314 // << track->PidProbKaon() << " "
315 // << track->PidProbProton() << " "
76ce4b5b 316 // << track->PidProbElectron()+track->PidProbMuon()+track->PidProbPion()+track->PidProbKaon()+track->PidProbProton() << endl;
317
87ede832 318
76ce4b5b 319 if ((track->PidProbElectron()<fPidProbElectron[0])||(track->PidProbElectron()>fPidProbElectron[1]))
320 {
321 fNTracksFailed++;
322 //cout<<"No Go Through the cut"<<endl;
323 //cout<<fPidProbElectron[0]<<" < e ="<<track->PidProbElectron()<<" <"<<fPidProbElectron[1]<<endl;
324 return false;
325 }
326 if ((track->PidProbPion()<fPidProbPion[0])||(track->PidProbPion()>fPidProbPion[1]))
327 {
328 fNTracksFailed++;
329 //cout<<"No Go Through the cut"<<endl;
330 //cout<<fPidProbPion[0]<<" < pi ="<<track->PidProbPion()<<" <"<<fPidProbPion[1]<<endl;
331 return false;
332 }
333 if ((track->PidProbKaon()<fPidProbKaon[0])||(track->PidProbKaon()>fPidProbKaon[1]))
334 {
335 fNTracksFailed++;
336 //cout<<"No Go Through the cut"<<endl;
337 //cout<<fPidProbKaon[0]<<" < k ="<<track->PidProbKaon()<<" <"<<fPidProbKaon[1]<<endl;
338 return false;
339 }
340 if ((track->PidProbProton()<fPidProbProton[0])||(track->PidProbProton()>fPidProbProton[1]))
341 {
342 fNTracksFailed++;
343 //cout<<"No Go Through the cut"<<endl;
344 //cout<<fPidProbProton[0]<<" < p ="<<track->PidProbProton()<<" <"<<fPidProbProton[1]<<endl;
345 return false;
346 }
347 if ((track->PidProbMuon()<fPidProbMuon[0])||(track->PidProbMuon()>fPidProbMuon[1]))
348 {
349 fNTracksFailed++;
350 //cout<<"No Go Through the cut"<<endl;
351 //cout<<fPidProbMuon[0]<<" < mi="<<track->PidProbMuon()<<" <"<<fPidProbMuon[1]<<endl;
352 return false;
353 }
354
a8521c0f 355 //****N Sigma Method -- electron rejection****
356 if(fElectronRejection)
357 if(!IsElectron(track->NSigmaTPCE(),track->NSigmaTPCPi(),track->NSigmaTPCK(), track->NSigmaTPCP()))
358 return false;
359
360
76ce4b5b 361 if (fMostProbable) {
87ede832 362
76ce4b5b 363 int imost=0;
364 tMost[0] = track->PidProbElectron()*PidFractionElectron(track->P().Mag());
365 tMost[1] = 0.0;
366 tMost[2] = track->PidProbPion()*PidFractionPion(track->P().Mag());
367 tMost[3] = track->PidProbKaon()*PidFractionKaon(track->P().Mag());
368 tMost[4] = track->PidProbProton()*PidFractionProton(track->P().Mag());
369 float ipidmax = 0.0;
370
76ce4b5b 371 //****N Sigma Method****
372 if(fPIDMethod==0){
373 // Looking for pions
374 if (fMostProbable == 2) {
c9b0c11d 375 if (IsPionNSigma(track->P().Mag(), track->NSigmaTPCPi(), track->NSigmaTOFPi()))
76ce4b5b 376 imost = 2;
377
378 }
87ede832 379 else if (fMostProbable == 3) {
380
c9b0c11d 381
e52a5f82 382 if (IsKaonNSigma(track->P().Mag(), track->NSigmaTPCK(), track->NSigmaTOFK())){
87ede832 383
76ce4b5b 384 imost = 3;
385 }
76ce4b5b 386 }
e52a5f82 387 else if (fMostProbable == 4) { // proton nsigma-PID required contour adjusting (in LHC10h)
388 if ( IsProtonNSigma(track->P().Mag(), track->NSigmaTPCP(), track->NSigmaTOFP()) // && (TMath::Abs(track->NSigmaTPCP()) < TMath::Abs(track->NSigmaTPCPi())) && (TMath::Abs(track->NSigmaTPCP()) < TMath::Abs(track->NSigmaTPCK())) && (TMath::Abs(track->NSigmaTOFP()) < TMath::Abs(track->NSigmaTOFPi())) && (TMath::Abs(track->NSigmaTOFP()) < TMath::Abs(track->NSigmaTOFK()))
389 // && IsProtonTPCdEdx(track->P().Mag(), track->TPCsignal())
390 )
76ce4b5b 391 imost = 4;
392 }
e52a5f82 393 else if (fMostProbable == 5) { // no-protons
394 if ( !IsProtonNSigma(track->P().Mag(), track->NSigmaTPCP(), track->NSigmaTOFP()) )
af797f5b 395 imost = 5;
396 }
e52a5f82 397 else if (fMostProbable == 6) { //pions OR kaons OR protons
398 if (IsPionNSigma(track->P().Mag(), track->NSigmaTPCPi(), track->NSigmaTOFPi()))
399 imost = 6;
400 else if (IsKaonNSigma(track->P().Mag(), track->NSigmaTPCK(), track->NSigmaTOFK()))
401 imost = 6;
402 else if (IsProtonNSigma(track->P().Mag(), track->NSigmaTPCP(), track->NSigmaTOFP()) )
403 imost = 6;
404 }
405 else if (fMostProbable == 7) { // pions OR kaons OR protons OR electrons
406 if (IsPionNSigma(track->P().Mag(), track->NSigmaTPCPi(), track->NSigmaTOFPi()))
407 imost = 7;
408 else if (IsKaonNSigma(track->P().Mag(), track->NSigmaTPCK(), track->NSigmaTOFK()))
409 imost = 7;
410 else if (IsProtonNSigma(track->P().Mag(), track->NSigmaTPCP(), track->NSigmaTOFP()) )
411 imost = 7;
412 else if (TMath::Abs(track->NSigmaTPCE())<3)
413 imost = 7;
76ce4b5b 414
e52a5f82 415 }
54141117 416 else if (fMostProbable == 8) { // TOF matching
417 if(track->NSigmaTOFPi() != -1000 || track->Pt()<0.5){
418 imost = 8;
419 }
420 }
421 else if (fMostProbable == 9) { // Other: no kaons, no pions, no protons
422 if (IsPionNSigma(track->P().Mag(), track->NSigmaTPCPi(), track->NSigmaTOFPi()))
423 imost = -1;
424 else if (IsKaonNSigma(track->P().Mag(), track->NSigmaTPCK(), track->NSigmaTOFK()))
425 imost = -1;
426 else if (IsProtonNSigma(track->P().Mag(), track->NSigmaTPCP(), track->NSigmaTOFP()) )
427 imost = -1;
428 else if(track->NSigmaTOFPi() != -1000 || track->Pt()<0.5){
429 imost = 9;
430 }
431 }
c477a4c1 432 if (fMostProbable == 10) {//cut on Nsigma in pT not p
b51395b5 433 if (IsPionNSigma(track->Pt(), track->NSigmaTPCPi(), track->NSigmaTOFPi()))
434 imost = 10;
435 }
c477a4c1 436 else if (fMostProbable == 11) {//cut on Nsigma in pT not p
b51395b5 437 if (IsKaonNSigma(track->Pt(), track->NSigmaTPCK(), track->NSigmaTOFK())){
438 imost = 11;
439 }
440 }
c477a4c1 441 else if (fMostProbable == 12) { //cut on Nsigma in pT not p
b51395b5 442 if ( IsProtonNSigma(track->Pt(), track->NSigmaTPCP(), track->NSigmaTOFP()) )
443 imost = 12;
444 }
445
446
76ce4b5b 447 }
87ede832 448
449
76ce4b5b 450
451 //****Contour Method****
452 if(fPIDMethod==1){
453 for (int ip=0; ip<5; ip++)
454 if (tMost[ip] > ipidmax) { ipidmax = tMost[ip]; imost = ip; };
455
456 // Looking for pions
457 if (fMostProbable == 2) {
458 if (imost == 2) {
459 // Using the TPC to reject non-pions
460 if (!(IsPionTPCdEdx(track->P().Mag(), track->TPCsignal())))
461 imost = 0;
462 if (0) {
463 // Using the TOF to reject non-pions
464 if (track->P().Mag() < 0.6) {
465 if (tTOFPidIn)
466 if (!IsPionTOFTime(track->P().Mag(), track->TOFpionTime()))
467 imost = 0;
468 }
469 else {
470 if (tTOFPidIn) {
471 if (!IsPionTOFTime(track->P().Mag(), track->TOFpionTime()))
472 imost = 0;
473 }
474 else {
475 imost = 0;
476 }
477 }
478 }
479 }
480 }
481
482 // Looking for kaons
483 else if (fMostProbable == 3) {
484 // if (imost == 3) {
485 // Using the TPC to reject non-kaons
486 if (track->P().Mag() < 0.6) {
487 if (!(IsKaonTPCdEdx(track->P().Mag(), track->TPCsignal())))
488 imost = 0;
489 else imost = 3;
490 if (1) {
491 // Using the TOF to reject non-kaons
492 if (tTOFPidIn)
493 if (!IsKaonTOFTime(track->P().Mag(), track->TOFkaonTime()))
494 imost = 0;
495 }
496 }
497 else {
498 if (1) {
499 if (tTOFPidIn) {
500 if (!IsKaonTOFTime(track->P().Mag(), track->TOFkaonTime()))
501 imost = 0;
502 else
503 imost = 3;
504 }
505 else {
506 if (!(IsKaonTPCdEdx(track->P().Mag(), track->TPCsignal())))
507 imost = 0;
87ede832 508 else
76ce4b5b 509 imost = 3;
510 }
511 }
512 }
513 // }
514 }
87ede832 515
76ce4b5b 516 // Looking for protons
517 else if (fMostProbable == 4) {
518 // if (imost == 3) {
519 // Using the TPC to reject non-kaons
520 if (track->P().Mag() < 0.8) {
521 if (!(IsProtonTPCdEdx(track->P().Mag(), track->TPCsignal())))
522 imost = 0;
523 else imost = 4;
524 if (0) {
525 // Using the TOF to reject non-kaons
526 if (tTOFPidIn)
527 if (!IsKaonTOFTime(track->P().Mag(), track->TOFkaonTime()))
528 imost = 0;
529 }
530 }
531 else {
532 if (0) {
533 if (tTOFPidIn) {
534 if (!IsKaonTOFTime(track->P().Mag(), track->TOFkaonTime()))
535 imost = 0;
536 else
537 imost = 3;
538 }
539 else {
540 if (!(IsKaonTPCdEdx(track->P().Mag(), track->TPCsignal())))
541 imost = 0;
87ede832 542 else
76ce4b5b 543 imost = 3;
544 }
545 }
546 }
547 // }
548 }
549 }
550 if (imost != fMostProbable) return false;
551 }
87ede832 552
76ce4b5b 553 //fan
554 //cout<<"****** Go Through the cut ******"<<endl;
555 // cout<<fLabel<<" Label="<<track->Label()<<endl;
556 // cout<<fCharge<<" Charge="<<track->Charge()<<endl;
557 // cout<<fPt[0]<<" < Pt ="<<Pt<<" <"<<fPt[1]<<endl;
558 //cout<<fRapidity[0]<<" < Rapidity ="<<tRapidity<<" <"<<fRapidity[1]<<endl;
559 //cout<<fPidProbElectron[0]<<" < e="<<track->PidProbElectron()<<" <"<<fPidProbElectron[1]<<endl;
560 //cout<<fPidProbPion[0]<<" < pi="<<track->PidProbPion()<<" <"<<fPidProbPion[1]<<endl;
561 //cout<<fPidProbKaon[0]<<" < k="<<track->PidProbKaon()<<" <"<<fPidProbKaon[1]<<endl;
562 //cout<<fPidProbProton[0]<<" < p="<<track->PidProbProton()<<" <"<<fPidProbProton[1]<<endl;
563 //cout<<fPidProbMuon[0]<<" < mi="<<track->PidProbMuon()<<" <"<<fPidProbMuon[1]<<endl;
564 fNTracksPassed++ ;
565 return true;
87ede832 566
567
76ce4b5b 568}
569//------------------------------
570AliFemtoString AliFemtoESDTrackCut::Report()
571{
572 // Prepare report from the execution
573 string tStemp;
574 char tCtemp[100];
575 snprintf(tCtemp , 100, "Particle mass:\t%E\n",this->Mass());
576 tStemp=tCtemp;
577 snprintf(tCtemp , 100, "Particle charge:\t%d\n",fCharge);
578 tStemp+=tCtemp;
579 snprintf(tCtemp , 100, "Particle pT:\t%E - %E\n",fPt[0],fPt[1]);
580 tStemp+=tCtemp;
581 snprintf(tCtemp , 100, "Particle rapidity:\t%E - %E\n",fRapidity[0],fRapidity[1]);
87ede832 582 tStemp+=tCtemp;
76ce4b5b 583 snprintf(tCtemp , 100, "Particle eta:\t%E - %E\n",fEta[0],fEta[1]);
584 tStemp+=tCtemp;
585 snprintf(tCtemp , 100, "Number of tracks which passed:\t%ld Number which failed:\t%ld\n",fNTracksPassed,fNTracksFailed);
586 tStemp += tCtemp;
587 AliFemtoString returnThis = tStemp;
588 return returnThis;
589}
590TList *AliFemtoESDTrackCut::ListSettings()
591{
592 // return a list of settings in a writable form
593 TList *tListSetttings = new TList();
594 char buf[200];
595 snprintf(buf, 200, "AliFemtoESDTrackCut.mass=%f", this->Mass());
596 tListSetttings->AddLast(new TObjString(buf));
597
598 snprintf(buf, 200, "AliFemtoESDTrackCut.charge=%i", fCharge);
599 tListSetttings->AddLast(new TObjString(buf));
600 snprintf(buf, 200, "AliFemtoESDTrackCut.pidprobpion.minimum=%f", fPidProbPion[0]);
601 tListSetttings->AddLast(new TObjString(buf));
602 snprintf(buf, 200, "AliFemtoESDTrackCut.pidprobpion.maximum=%f", fPidProbPion[1]);
603 tListSetttings->AddLast(new TObjString(buf));
604 snprintf(buf, 200, "AliFemtoESDTrackCut.pidprobkaon.minimum=%f", fPidProbKaon[0]);
605 tListSetttings->AddLast(new TObjString(buf));
606 snprintf(buf, 200, "AliFemtoESDTrackCut.pidprobkaon.maximum=%f", fPidProbKaon[1]);
607 tListSetttings->AddLast(new TObjString(buf));
608 snprintf(buf, 200, "AliFemtoESDTrackCut.pidprobproton.minimum=%f", fPidProbProton[0]);
609 tListSetttings->AddLast(new TObjString(buf));
610 snprintf(buf, 200, "AliFemtoESDTrackCut.pidprobproton.maximum=%f", fPidProbProton[1]);
611 tListSetttings->AddLast(new TObjString(buf));
612 snprintf(buf, 200, "AliFemtoESDTrackCut.pidprobelectron.minimum=%f", fPidProbElectron[0]);
613 tListSetttings->AddLast(new TObjString(buf));
614 snprintf(buf, 200, "AliFemtoESDTrackCut.pidprobelectron.maximum=%f", fPidProbElectron[1]);
615 tListSetttings->AddLast(new TObjString(buf));
616 snprintf(buf, 200, "AliFemtoESDTrackCut.pidprobMuon.minimum=%f", fPidProbMuon[0]);
617 tListSetttings->AddLast(new TObjString(buf));
618 snprintf(buf, 200, "AliFemtoESDTrackCut.pidprobMuon.maximum=%f", fPidProbMuon[1]);
619 tListSetttings->AddLast(new TObjString(buf));
620 snprintf(buf, 200, "AliFemtoESDTrackCut.minimumtpcclusters=%i", fminTPCclsF);
621 tListSetttings->AddLast(new TObjString(buf));
622 snprintf(buf, 200, "AliFemtoESDTrackCut.minimumitsclusters=%i", fminTPCclsF);
623 tListSetttings->AddLast(new TObjString(buf));
624 snprintf(buf, 200, "AliFemtoESDTrackCut.pt.minimum=%f", fPt[0]);
625 tListSetttings->AddLast(new TObjString(buf));
626 snprintf(buf, 200, "AliFemtoESDTrackCut.pt.maximum=%f", fPt[1]);
627 tListSetttings->AddLast(new TObjString(buf));
628 snprintf(buf, 200, "AliFemtoESDTrackCut.rapidity.minimum=%f", fRapidity[0]);
629 tListSetttings->AddLast(new TObjString(buf));
630 snprintf(buf, 200, "AliFemtoESDTrackCut.rapidity.maximum=%f", fRapidity[1]);
631 tListSetttings->AddLast(new TObjString(buf));
632 snprintf(buf, 200, "AliFemtoESDTrackCut.removekinks=%i", fRemoveKinks);
633 tListSetttings->AddLast(new TObjString(buf));
634 snprintf(buf, 200, "AliFemtoESDTrackCut.maxitschindof=%f", fMaxITSchiNdof);
635 tListSetttings->AddLast(new TObjString(buf));
636 snprintf(buf, 200, "AliFemtoESDTrackCut.maxtpcchindof=%f", fMaxTPCchiNdof);
637 tListSetttings->AddLast(new TObjString(buf));
638 snprintf(buf, 200, "AliFemtoESDTrackCut.maxsigmatovertex=%f", fMaxSigmaToVertex);
639 tListSetttings->AddLast(new TObjString(buf));
640 snprintf(buf, 200, "AliFemtoESDTrackCut.maximpactxy=%f", fMaxImpactXY);
641 tListSetttings->AddLast(new TObjString(buf));
642 snprintf(buf, 200, "AliFemtoESDTrackCut.maximpactz=%f", fMaxImpactZ);
643 tListSetttings->AddLast(new TObjString(buf));
644 if (fMostProbable) {
645 if (fMostProbable == 2)
646 snprintf(buf, 200, "AliFemtoESDTrackCut.mostprobable=%s", "Pion");
647 if (fMostProbable == 3)
648 snprintf(buf, 200, "AliFemtoESDTrackCut.mostprobable=%s", "Kaon");
649 if (fMostProbable == 4)
650 snprintf(buf, 200, "AliFemtoESDTrackCut.mostprobable=%s", "Proton");
651 tListSetttings->AddLast(new TObjString(buf));
652 }
653 return tListSetttings;
654}
655void AliFemtoESDTrackCut::SetRemoveKinks(const bool& flag)
656{
657 fRemoveKinks = flag;
658}
87ede832 659
76ce4b5b 660void AliFemtoESDTrackCut::SetRemoveITSFake(const bool& flag)
661{
662 fRemoveITSFake = flag;
663}
87ede832 664
76ce4b5b 665// electron
666// 0.13 - 1.8
667// 0 7.594129e-02 8.256141e-03
668// 1 -5.535827e-01 8.170825e-02
669// 2 1.728591e+00 3.104210e-01
670// 3 -2.827893e+00 5.827802e-01
671// 4 2.503553e+00 5.736207e-01
672// 5 -1.125965e+00 2.821170e-01
673// 6 2.009036e-01 5.438876e-02
674float AliFemtoESDTrackCut::PidFractionElectron(float mom) const
675{
676 // Provide a parameterized fraction of electrons dependent on momentum
87ede832 677 if (mom<0.13)
678 return (7.594129e-02
679 -5.535827e-01*0.13
680 +1.728591e+00*0.13*0.13
681 -2.827893e+00*0.13*0.13*0.13
682 +2.503553e+00*0.13*0.13*0.13*0.13
683 -1.125965e+00*0.13*0.13*0.13*0.13*0.13
684 +2.009036e-01*0.13*0.13*0.13*0.13*0.13*0.13);
76ce4b5b 685
686 if (mom>1.8)
87ede832 687 return (7.594129e-02
688 -5.535827e-01*1.8
689 +1.728591e+00*1.8*1.8
690 -2.827893e+00*1.8*1.8*1.8
691 +2.503553e+00*1.8*1.8*1.8*1.8
692 -1.125965e+00*1.8*1.8*1.8*1.8*1.8
693 +2.009036e-01*1.8*1.8*1.8*1.8*1.8*1.8);
694 return (7.594129e-02
695 -5.535827e-01*mom
696 +1.728591e+00*mom*mom
697 -2.827893e+00*mom*mom*mom
698 +2.503553e+00*mom*mom*mom*mom
699 -1.125965e+00*mom*mom*mom*mom*mom
700 +2.009036e-01*mom*mom*mom*mom*mom*mom);
76ce4b5b 701}
702
703// pion
704// 0.13 - 2.0
705// 0 1.063457e+00 8.872043e-03
706// 1 -4.222208e-01 2.534402e-02
707// 2 1.042004e-01 1.503945e-02
708float AliFemtoESDTrackCut::PidFractionPion(float mom) const
709{
710 // Provide a parameterized fraction of pions dependent on momentum
87ede832 711 if (mom<0.13)
76ce4b5b 712 return ( 1.063457e+00
713 -4.222208e-01*0.13
714 +1.042004e-01*0.0169);
87ede832 715 if (mom>2.0)
76ce4b5b 716 return ( 1.063457e+00
717 -4.222208e-01*2.0
718 +1.042004e-01*4.0);
719 return ( 1.063457e+00
720 -4.222208e-01*mom
721 +1.042004e-01*mom*mom);
722}
723
724// kaon
725// 0.18 - 2.0
726// 0 -7.289406e-02 1.686074e-03
727// 1 4.415666e-01 1.143939e-02
728// 2 -2.996790e-01 1.840964e-02
729// 3 6.704652e-02 7.783990e-03
730float AliFemtoESDTrackCut::PidFractionKaon(float mom) const
731{
732 // Provide a parameterized fraction of kaons dependent on momentum
87ede832 733 if (mom<0.18)
76ce4b5b 734 return (-7.289406e-02
87ede832 735 +4.415666e-01*0.18
736 -2.996790e-01*0.18*0.18
76ce4b5b 737 +6.704652e-02*0.18*0.18*0.18);
87ede832 738 if (mom>2.0)
76ce4b5b 739 return (-7.289406e-02
87ede832 740 +4.415666e-01*2.0
741 -2.996790e-01*2.0*2.0
76ce4b5b 742 +6.704652e-02*2.0*2.0*2.0);
743 return (-7.289406e-02
87ede832 744 +4.415666e-01*mom
745 -2.996790e-01*mom*mom
76ce4b5b 746 +6.704652e-02*mom*mom*mom);
747}
748
749// proton
750// 0.26 - 2.0
751// 0 -3.730200e-02 2.347311e-03
752// 1 1.163684e-01 1.319316e-02
753// 2 8.354116e-02 1.997948e-02
754// 3 -4.608098e-02 8.336400e-03
755float AliFemtoESDTrackCut::PidFractionProton(float mom) const
756{
757 // Provide a parameterized fraction of protons dependent on momentum
758 if (mom<0.26) return 0.0;
87ede832 759 if (mom>2.0)
760 return (-3.730200e-02
761 +1.163684e-01*2.0
762 +8.354116e-02*2.0*2.0
76ce4b5b 763 -4.608098e-02*2.0*2.0*2.0);
87ede832 764 return (-3.730200e-02
765 +1.163684e-01*mom
766 +8.354116e-02*mom*mom
767 -4.608098e-02*mom*mom*mom);
76ce4b5b 768}
769
770void AliFemtoESDTrackCut::SetMomRangeTOFpidIs(const float& minp, const float& maxp)
771{
772 fMinPforTOFpid = minp;
773 fMaxPforTOFpid = maxp;
774}
775
776void AliFemtoESDTrackCut::SetMomRangeTPCpidIs(const float& minp, const float& maxp)
777{
778 fMinPforTPCpid = minp;
779 fMaxPforTPCpid = maxp;
780}
781
782void AliFemtoESDTrackCut::SetMomRangeITSpidIs(const float& minp, const float& maxp)
783{
784 fMinPforITSpid = minp;
785 fMaxPforITSpid = maxp;
786}
787
788bool AliFemtoESDTrackCut::IsPionTPCdEdx(float mom, float dEdx)
789{
790 // double a1 = -95.4545, b1 = 86.5455;
791 // double a2 = 0.0, b2 = 56.0;
792 double a1 = -343.75, b1 = 168.125;
793 double a2 = 0.0, b2 = 65.0;
794
795 if (mom < 0.32) {
796 if (dEdx < a1*mom+b1) return true;
797 }
798 if (dEdx < a2*mom+b2) return true;
799
800 return false;
801}
802
803bool AliFemtoESDTrackCut::IsKaonTPCdEdx(float mom, float dEdx)
804{
805
806// double a1 = -547.0; double b1 = 297.0;
807// double a2 = -125.0; double b2 = 145.0;
808// double a3 = -420.0; double b3 = 357.0;
809// double a4 = -110.0; double b4 = 171.0;
810// double b5 = 72.0;
811
812// if (mom<0.2) return false;
813
814// if (mom<0.36) {
815// if (dEdx < a1*mom+b1) return false;
816// if (dEdx > a3*mom+b3) return false;
817// }
818// else if (mom<0.6) {
819// if (dEdx < a2*mom+b2) return false;
820// if (dEdx > a3*mom+b3) return false;
821// }
822// else if (mom<0.9) {
823// if (dEdx > a4*mom+b4) return false;
824// if (dEdx < b5) return false;
825// }
87ede832 826// else
76ce4b5b 827// return false;
828// // else {
829// // if (dEdx > b5) return false;
830// // }
87ede832 831
76ce4b5b 832// return true;
833
834 double a1 = -268.896; double b1 = 198.669;
835 double a2 = -49.0012; double b2 = 88.7214;
836
837 if (mom<0.2) return false;
838
839 if (mom>0.3 && mom<0.5) {
840 if (dEdx < a1*mom+b1) return false;
841 }
842 else if (mom<1.2) {
843 if (dEdx < a2*mom+b2) return false;
844 }
845
846 return true;
847
848}
849
850bool AliFemtoESDTrackCut::IsProtonTPCdEdx(float mom, float dEdx)
851{
852 double a1 = -1800.0; double b1 = 940.0;
853 double a2 = -500.0; double b2 = 420.0;
854 double a3 = -216.7; double b3 = 250.0;
855
856 if (mom<0.2) return false;
857
858 if (mom>0.3 && mom<0.4) {
859 if (dEdx < a1*mom+b1) return false;
860 }
861 else if (mom<0.6) {
862 if (dEdx < a2*mom+b2) return false;
863 }
864 else if (mom<0.9) {
865 if (dEdx < a3*mom+b3) return false;
866 }
867
868 return true;
87ede832 869
76ce4b5b 870}
871
872bool AliFemtoESDTrackCut::IsPionTOFTime(float mom, float ttof)
873{
874 double a1 = -427.0; double b1 = 916.0;
875 double a2 = 327.0; double b2 = -888.0;
876 if (mom<0.3) return kFALSE;
877 if (mom>2.0) return kFALSE;
878 if (ttof > a1*mom+b1) return kFALSE;
879 if (ttof < a2*mom+b2) return kFALSE;
880
881 return kTRUE;
882}
883
884bool AliFemtoESDTrackCut::IsKaonTOFTime(float mom, float ttof)
885{
886 double a1 = 000.0; double b1 = -500.0;
887 double a2 = 000.0; double b2 = 500.0;
888 double a3 = 850.0; double b3 = -1503.0;
889 double a4 = -1637.0; double b4 = 3621.0;
890
891 if (mom<0.3) return kFALSE;
892 if (mom>2.06) return kFALSE;
893 if (mom<1.2) {
894 if (ttof > a2*mom+b2) return kFALSE;
895 if (ttof < a1*mom+b1) return kFALSE;
896 }
897 if (mom<1.9) {
898 if (ttof > a2*mom+b2) return kFALSE;
899 if (ttof < a3*mom+b3) return kFALSE;
900 }
901 if (mom<2.06) {
902 if (ttof > a4*mom+b4) return kFALSE;
903 if (ttof < a3*mom+b3) return kFALSE;
904 }
905 return kTRUE;
906}
907
908bool AliFemtoESDTrackCut::IsProtonTOFTime(float mom, float ttof)
909{
910 double a1 = 000.0; double b1 = -915.0;
911 double a2 = 000.0; double b2 = 600.0;
912 double a3 = 572.0; double b3 = -1715.0;
913
914 if (mom<0.3) return kFALSE;
915 if (mom>3.0) return kFALSE;
916 if (mom<1.4) {
917 if (ttof > a2*mom+b2) return kFALSE;
918 if (ttof < a1*mom+b1) return kFALSE;
919 }
920 if (mom<3.0) {
921 if (ttof > a2*mom+b2) return kFALSE;
922 if (ttof < a3*mom+b3) return kFALSE;
923 }
924 return kTRUE;
925}
926
927
928
929
930bool AliFemtoESDTrackCut::IsKaonTPCdEdxNSigma(float mom, float nsigmaK)
931{
c9b0c11d 932// cout<<" AliFemtoESDTrackCut::IsKaonTPCdEdxNSigma "<<mom<<" "<<nsigmaK<<endl;
76ce4b5b 933
934
935 if(mom<0.35 && TMath::Abs(nsigmaK)<5.0)return true;
87ede832 936 if(mom>=0.35 && mom<0.5 && TMath::Abs(nsigmaK)<3.0)return true;
76ce4b5b 937 if(mom>=0.5 && mom<0.7 && TMath::Abs(nsigmaK)<2.0)return true;
938
939 return false;
940}
941
76ce4b5b 942bool AliFemtoESDTrackCut::IsKaonTOFNSigma(float mom, float nsigmaK)
943{
c9b0c11d 944// cout<<" AliFemtoESDTrackCut::IsKaonTPCdEdxNSigma "<<mom<<" "<<nsigmaK<<endl;
76ce4b5b 945 //fan
946 // if(mom<1.5 && TMath::Abs(nsigmaK)<3.0)return true;
87ede832 947 if(mom>=1.5 && TMath::Abs(nsigmaK)<2.0)return true;
76ce4b5b 948 return false;
949}
950
c9b0c11d 951/*
cbc2bfd8 952bool AliFemtoESDTrackCut::IsKaonNSigma(float mom, float nsigmaTPCK, float nsigmaTOFK)
953{
954
955
956 if(mom<0.5)
957 {
958 if(TMath::Abs(nsigmaTPCK)<2.0)
87ede832 959 {
cbc2bfd8 960 return true;
87ede832 961 }
962 else
cbc2bfd8 963 {
964 return false;
965 }
966 }
87ede832 967
968
cbc2bfd8 969 if(mom>=0.5)
970 {
87ede832 971 if(TMath::Abs(nsigmaTOFK)<3.0 && TMath::Abs(nsigmaTPCK)<3.0)
cbc2bfd8 972 {
973 return true;
974 }
975 else
976 {
977 return false;
978 }
979 }
87ede832 980
cbc2bfd8 981// if(mom>1.5 || mom<0.15)return false;
87ede832 982
c9b0c11d 983
cbc2bfd8 984}
985
c9b0c11d 986*/
987
988//old
76ce4b5b 989bool AliFemtoESDTrackCut::IsKaonNSigma(float mom, float nsigmaTPCK, float nsigmaTOFK)
990{
5b39ee58 991 if (fNsigmaTPCTOF) {
992 if (mom > 0.5) {
993 // if (TMath::Hypot( nsigmaTOFP, nsigmaTPCP )/TMath::Sqrt(2) < 3.0)
994 if (TMath::Hypot( nsigmaTOFK, nsigmaTPCK ) < fNsigma)
995 return true;
ce7b3d98 996 }
5b39ee58 997 else {
998 if (TMath::Abs(nsigmaTPCK) < fNsigma)
999 return true;
ce7b3d98 1000 }
5b39ee58 1001 }
1002 else {
76ce4b5b 1003
5b39ee58 1004 if(mom<0.4)
1005 {
1006 if(nsigmaTOFK<-999.)
1007 {
1008 if(TMath::Abs(nsigmaTPCK)<2.0) return true;
1009 }
1010 else if(TMath::Abs(nsigmaTOFK)<3.0 && TMath::Abs(nsigmaTPCK)<3.0) return true;
1011 }
1012 else if(mom>=0.4 && mom<=0.6)
1013 {
1014 if(nsigmaTOFK<-999.)
1015 {
1016 if(TMath::Abs(nsigmaTPCK)<2.0) return true;
1017 }
1018 else if(TMath::Abs(nsigmaTOFK)<3.0 && TMath::Abs(nsigmaTPCK)<3.0) return true;
1019 }
1020 else if(nsigmaTOFK<-999.)
1021 {
1022 return false;
1023 }
1024 else if(TMath::Abs(nsigmaTOFK)<3.0 && TMath::Abs(nsigmaTPCK)<3.0) return true;
1025 }
76ce4b5b 1026 return false;
1027}
c9b0c11d 1028
76ce4b5b 1029
1030
76ce4b5b 1031bool AliFemtoESDTrackCut::IsPionNSigma(float mom, float nsigmaTPCPi, float nsigmaTOFPi)
1032{
5b39ee58 1033 if (fNsigmaTPCTOF) {
1034 if (mom > 0.5) {
1035 // if (TMath::Hypot( nsigmaTOFP, nsigmaTPCP )/TMath::Sqrt(2) < 3.0)
1036 if (TMath::Hypot( nsigmaTOFPi, nsigmaTPCPi ) < fNsigma)
1037 return true;
ce7b3d98 1038 }
5b39ee58 1039 else {
1040 if (TMath::Abs(nsigmaTPCPi) < fNsigma)
1041 return true;
ce7b3d98 1042 }
5b39ee58 1043 }
1044 else {
1045 if(mom<0.65)
1046 {
1047 if(nsigmaTOFPi<-999.)
1048 {
1049 if(mom<0.35 && TMath::Abs(nsigmaTPCPi)<3.0) return true;
1050 else if(mom<0.5 && mom>=0.35 && TMath::Abs(nsigmaTPCPi)<3.0) return true;
1051 else if(mom>=0.5 && TMath::Abs(nsigmaTPCPi)<2.0) return true;
1052 else return false;
1053 }
1054 else if(TMath::Abs(nsigmaTOFPi)<3.0 && TMath::Abs(nsigmaTPCPi)<3.0) return true;
1055 }
1056 else if(nsigmaTOFPi<-999.)
1057 {
1058 return false;
1059 }
1060 else if(mom<1.5 && TMath::Abs(nsigmaTOFPi)<3.0 && TMath::Abs(nsigmaTPCPi)<5.0) return true;
1061 else if(mom>=1.5 && TMath::Abs(nsigmaTOFPi)<2.0 && TMath::Abs(nsigmaTPCPi)<5.0) return true;
1062 }
76ce4b5b 1063 return false;
1064}
1065
1066
1067bool AliFemtoESDTrackCut::IsProtonNSigma(float mom, float nsigmaTPCP, float nsigmaTOFP)
1068{
12a3e650 1069
1070 if (fNsigmaTPCTOF) {
5b39ee58 1071 if (mom > 0.5) {
87ede832 1072// if (TMath::Hypot( nsigmaTOFP, nsigmaTPCP )/TMath::Sqrt(2) < 3.0)
1073 if (TMath::Hypot( nsigmaTOFP, nsigmaTPCP ) < fNsigma)
ceeb8ab7 1074 return true;
ce7b3d98 1075 }
ceeb8ab7 1076 else {
87ede832 1077 if (TMath::Abs(nsigmaTPCP) < fNsigma)
ceeb8ab7 1078 return true;
ce7b3d98 1079 }
12a3e650 1080 }
87ede832 1081 else if (fNsigmaTPConly) {
1082 if (TMath::Abs(nsigmaTPCP) < fNsigma)
1083 return true;
1084 }
12a3e650 1085 else {
1086 if (mom > 0.8 && mom < 2.5) {
1087 if ( TMath::Abs(nsigmaTPCP) < 3.0 && TMath::Abs(nsigmaTOFP) < 3.0)
1088 return true;
1089 }
1090 else if (mom > 2.5) {
1091 if ( TMath::Abs(nsigmaTPCP) < 3.0 && TMath::Abs(nsigmaTOFP) < 2.0)
1092 return true;
1093 }
1094 else {
1095 if (TMath::Abs(nsigmaTPCP) < 3.0)
1096 return true;
1097 }
1098 }
76ce4b5b 1099
1100 return false;
1101}
1102
1103
1104void AliFemtoESDTrackCut::SetPIDMethod(ReadPIDMethodType newMethod)
1105{
1106 fPIDMethod = newMethod;
1107}
4eac0b05 1108
1109
12a3e650 1110void AliFemtoESDTrackCut::SetNsigmaTPCTOF(Bool_t nsigma)
1111{
1112 fNsigmaTPCTOF = nsigma;
1113}
87ede832 1114
1115void AliFemtoESDTrackCut::SetNsigmaTPConly(Bool_t nsigma)
1116{
1117 fNsigmaTPConly = nsigma;
1118}
1119
1120void AliFemtoESDTrackCut::SetNsigma(Double_t nsigma)
1121{
1122 fNsigma = nsigma;
1123}
1124
2e04885f 1125
87ede832 1126void AliFemtoESDTrackCut::SetClusterRequirementITS(AliESDtrackCuts::Detector det, AliESDtrackCuts::ITSClusterRequirement req)
1127{
1128 fCutClusterRequirementITS[det] = req;
4eac0b05 1129}
1130
1131Bool_t AliFemtoESDTrackCut::CheckITSClusterRequirement(AliESDtrackCuts::ITSClusterRequirement req, Bool_t clusterL1, Bool_t clusterL2)
1132{
1133 // checks if the cluster requirement is fullfilled (in this case: return kTRUE)
87ede832 1134
4eac0b05 1135 switch (req)
1136 {
1137 case AliESDtrackCuts::kOff: return kTRUE;
1138 case AliESDtrackCuts::kNone: return !clusterL1 && !clusterL2;
1139 case AliESDtrackCuts::kAny: return clusterL1 || clusterL2;
1140 case AliESDtrackCuts::kFirst: return clusterL1;
1141 case AliESDtrackCuts::kOnlyFirst: return clusterL1 && !clusterL2;
1142 case AliESDtrackCuts::kSecond: return clusterL2;
1143 case AliESDtrackCuts::kOnlySecond: return clusterL2 && !clusterL1;
1144 case AliESDtrackCuts::kBoth: return clusterL1 && clusterL2;
1145 }
87ede832 1146
4eac0b05 1147 return kFALSE;
1148}
2e04885f 1149
1150bool AliFemtoESDTrackCut::IsElectron(float nsigmaTPCE, float nsigmaTPCPi,float nsigmaTPCK, float nsigmaTPCP)
1151{
5ee52df3 1152 if(TMath::Abs(nsigmaTPCE)<3 && TMath::Abs(nsigmaTPCPi)>3 && TMath::Abs(nsigmaTPCK)>3 && TMath::Abs(nsigmaTPCP)>3)
2e04885f 1153 return false;
1154 else
1155 return true;
1156}