2 ***************************************************************************
7 ***************************************************************************
12 ***************************************************************************
15 * Revision 1.3 2007/05/22 09:01:42 akisiel
16 * Add the possibiloity to save cut settings in the ROOT file
18 * Revision 1.2 2007/05/21 10:38:25 akisiel
19 * More coding rule conformance
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
24 * Revision 1.4 2007/05/03 09:46:10 akisiel
25 * Fixing Effective C++ warnings
27 * Revision 1.3 2007/04/27 07:25:59 akisiel
28 * Make revisions needed for compilation from the main AliRoot tree
30 * Revision 1.1.1.1 2007/04/25 15:38:41 panos
31 * Importing the HBT code dir
33 * Revision 1.4 2007-04-03 16:00:08 mchojnacki
34 * Changes to iprove memory managing
36 * Revision 1.3 2007/03/13 15:30:03 mchojnacki
37 * adding reader for simulated data
39 * Revision 1.2 2007/03/08 14:58:03 mchojnacki
40 * adding some alice stuff
42 * Revision 1.1.1.1 2007/03/07 10:14:49 mchojnacki
43 * First version on CVS
45 **************************************************************************/
47 #include "AliFemtoESDTrackCut.h"
51 ClassImp(AliFemtoESDTrackCut)
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
67 // 0 1.063457e+00 8.872043e-03
68 // 1 -4.222208e-01 2.534402e-02
69 // 2 1.042004e-01 1.503945e-02
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
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
86 AliFemtoESDTrackCut::AliFemtoESDTrackCut() :
91 fNsigmaTPCTOF(kFALSE),
95 fMaxITSchiNdof(1000.0),
96 fMaxTPCchiNdof(1000.0),
97 fMaxSigmaToVertex(1000.0),
100 fRemoveKinks(kFALSE),
101 fRemoveITSFake(kFALSE),
103 fMaxImpactXY(1000.0),
104 fMinImpactXY(-1000.0),
106 fMaxImpactXYPtOff(1000.0),
107 fMaxImpactXYPtNrm(1000.0),
108 fMaxImpactXYPtPow(1000.0),
110 fMaxPforTOFpid(10000.0),
112 fMaxPforTPCpid(10000.0),
114 fMaxPforITSpid(10000.0)
116 // Default constructor
117 fNTracksPassed = fNTracksFailed = 0;
118 fCharge = 0; // takes both charges 0
119 fPt[0]=0.0; fPt[1] = 100.0;//100
120 fRapidity[0]=-2; fRapidity[1]=2;//-2 2
121 fEta[0]=-2; fEta[1]=2;//-2 2
122 fPidProbElectron[0]=-1;fPidProbElectron[1]=2;
123 fPidProbPion[0]=-1; fPidProbPion[1]=2;
124 fPidProbKaon[0]=-1;fPidProbKaon[1]=2;
125 fPidProbProton[0]=-1;fPidProbProton[1]=2;
126 fPidProbMuon[0]=-1;fPidProbMuon[1]=2;
127 for (Int_t i = 0; i < 3; i++)
128 fCutClusterRequirementITS[i] = AliESDtrackCuts::kOff;
134 fNsigmaTPCTOF=kFALSE;
136 //------------------------------
137 AliFemtoESDTrackCut::~AliFemtoESDTrackCut(){
140 //------------------------------
141 bool AliFemtoESDTrackCut::Pass(const AliFemtoTrack* track)
143 //cout<<"AliFemtoESDTrackCut::Pass"<<endl;
145 // test the particle and return
146 // true if it meets all the criteria
147 // false if it doesn't meet at least one of the criteria
150 //cout<<"AliFemtoESD cut"<<endl;
151 //cout<<fPidProbPion[0]<<" < pi ="<<track->PidProbPion()<<" <"<<fPidProbPion[1]<<endl;
154 //cout<<" status "<<track->Label()<<" "<<track->Flags()<<" "<<track->TPCnclsF()<<" "<<track->ITSncls()<<endl;
155 if ((track->Flags()&fStatus)!=fStatus)
157 // cout<<track->Flags()<<" "<<fStatus<<" no go through status"<<endl;
163 if ((track->KinkIndex(0)) || (track->KinkIndex(1)) || (track->KinkIndex(2)))
166 if (fRemoveITSFake) {
167 if (track->ITSncls() < 0)
170 if (fminTPCclsF>track->TPCnclsF())
172 //cout<<" No go because TPC Number of ClsF"<<fminTPCclsF<< " "<<track->TPCnclsF()<<endl;
175 if (fminTPCncls>track->TPCncls())
177 //cout<<" No go because TPC Number of ClsF"<<fminTPCclsF<< " "<<track->TPCnclsF()<<endl;
180 if (fminITScls>track->ITSncls())
182 //cout<<" No go because ITS Number of Cls"<<fminITScls<< " "<<track->ITSncls()<<endl;
186 if (fMaxImpactXY < TMath::Abs(track->ImpactD()))
189 if (fMinImpactXY > TMath::Abs(track->ImpactD()))
192 if (fMaxImpactZ < TMath::Abs(track->ImpactZ()))
195 if (fMaxSigmaToVertex < track->SigmaToVertex()) {
199 if (track->ITSncls() > 0)
200 if ((track->ITSchi2()/track->ITSncls()) > fMaxITSchiNdof) {
204 if (track->TPCncls() > 0)
205 if ((track->TPCchi2()/track->TPCncls()) > fMaxTPCchiNdof) {
208 //ITS cluster requirenments
209 for (Int_t i = 0; i < 3; i++)
210 if(!CheckITSClusterRequirement(fCutClusterRequirementITS[i], track->HasPointOnITSLayer(i*2), track->HasPointOnITSLayer(i*2+1)))
215 //cout<<"labels"<<endl;
219 // cout<<"No Go Through the cut"<<endl;
220 // cout<<fLabel<<" Label="<<track->Label()<<endl;
226 //cout<<"AliFemtoESD cut ch "<<endl;
227 //cout<<fCharge<<" Charge="<<track->Charge()<<endl;
228 if (track->Charge()!= fCharge)
231 // cout<<"No Go Through the cut"<<endl;
232 // cout<<fCharge<<" Charge="<<track->Charge()<<endl;
240 Bool_t tTPCPidIn = (track->Flags()&AliFemtoTrack::kTPCpid)>0;
241 Bool_t tITSPidIn = (track->Flags()&AliFemtoTrack::kITSpid)>0;
242 Bool_t tTOFPidIn = (track->Flags()&AliFemtoTrack::kTOFpid)>0;
244 if(fMinPforTOFpid > 0 && track->P().Mag() > fMinPforTOFpid &&
245 track->P().Mag() < fMaxPforTOFpid && !tTOFPidIn)
251 if(fMinPforTPCpid > 0 && track->P().Mag() > fMinPforTPCpid &&
252 track->P().Mag() < fMaxPforTPCpid && !tTPCPidIn)
258 if(fMinPforITSpid > 0 && track->P().Mag() > fMinPforITSpid &&
259 track->P().Mag() < fMaxPforITSpid && !tITSPidIn)
266 float tEnergy = ::sqrt(track->P().Mag2()+fMass*fMass);
267 float tRapidity = 0.5*::log((tEnergy+track->P().z())/(tEnergy-track->P().z()));
268 float tPt = ::sqrt((track->P().x())*(track->P().x())+(track->P().y())*(track->P().y()));
269 float tEta = track->P().PseudoRapidity();
271 if (fMaxImpactXYPtOff < 999.0) {
272 if ((fMaxImpactXYPtOff + fMaxImpactXYPtNrm*TMath::Power(tPt, fMaxImpactXYPtPow)) < TMath::Abs(track->ImpactD())) {
278 if ((tRapidity<fRapidity[0])||(tRapidity>fRapidity[1]))
281 //cout<<"No Go Through the cut"<<endl;
282 //cout<<fRapidity[0]<<" < Rapidity ="<<tRapidity<<" <"<<fRapidity[1]<<endl;
285 if ((tEta<fEta[0])||(tEta>fEta[1]))
288 //cout<<"No Go Through the cut"<<endl;
289 //cout<<fEta[0]<<" < Eta ="<<tEta<<" <"<<fEta[1]<<endl;
292 if ((tPt<fPt[0])||(tPt>fPt[1]))
295 //cout<<"No Go Through the cut"<<endl;
296 //cout<<fPt[0]<<" < Pt ="<<Pt<<" <"<<fPt[1]<<endl;
303 // cout << "Track has pids: "
304 // << track->PidProbElectron() << " "
305 // << track->PidProbMuon() << " "
306 // << track->PidProbPion() << " "
307 // << track->PidProbKaon() << " "
308 // << track->PidProbProton() << " "
309 // << track->PidProbElectron()+track->PidProbMuon()+track->PidProbPion()+track->PidProbKaon()+track->PidProbProton() << endl;
312 if ((track->PidProbElectron()<fPidProbElectron[0])||(track->PidProbElectron()>fPidProbElectron[1]))
315 //cout<<"No Go Through the cut"<<endl;
316 //cout<<fPidProbElectron[0]<<" < e ="<<track->PidProbElectron()<<" <"<<fPidProbElectron[1]<<endl;
319 if ((track->PidProbPion()<fPidProbPion[0])||(track->PidProbPion()>fPidProbPion[1]))
322 //cout<<"No Go Through the cut"<<endl;
323 //cout<<fPidProbPion[0]<<" < pi ="<<track->PidProbPion()<<" <"<<fPidProbPion[1]<<endl;
326 if ((track->PidProbKaon()<fPidProbKaon[0])||(track->PidProbKaon()>fPidProbKaon[1]))
329 //cout<<"No Go Through the cut"<<endl;
330 //cout<<fPidProbKaon[0]<<" < k ="<<track->PidProbKaon()<<" <"<<fPidProbKaon[1]<<endl;
333 if ((track->PidProbProton()<fPidProbProton[0])||(track->PidProbProton()>fPidProbProton[1]))
336 //cout<<"No Go Through the cut"<<endl;
337 //cout<<fPidProbProton[0]<<" < p ="<<track->PidProbProton()<<" <"<<fPidProbProton[1]<<endl;
340 if ((track->PidProbMuon()<fPidProbMuon[0])||(track->PidProbMuon()>fPidProbMuon[1]))
343 //cout<<"No Go Through the cut"<<endl;
344 //cout<<fPidProbMuon[0]<<" < mi="<<track->PidProbMuon()<<" <"<<fPidProbMuon[1]<<endl;
351 tMost[0] = track->PidProbElectron()*PidFractionElectron(track->P().Mag());
353 tMost[2] = track->PidProbPion()*PidFractionPion(track->P().Mag());
354 tMost[3] = track->PidProbKaon()*PidFractionKaon(track->P().Mag());
355 tMost[4] = track->PidProbProton()*PidFractionProton(track->P().Mag());
359 //****N Sigma Method****
362 if (fMostProbable == 2) {
363 if (IsPionNSigma(track->P().Mag(), track->NSigmaTPCPi(), track->NSigmaTOFPi()))
367 else if (fMostProbable == 3) {
370 if (IsKaonNSigma(track->P().Mag(), track->NSigmaTPCK(), track->NSigmaTOFK())){
376 else if (fMostProbable == 4) { // proton nsigma-PID required contour adjusting (in LHC10h)
377 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()))
378 // && IsProtonTPCdEdx(track->P().Mag(), track->TPCsignal())
387 //****Contour Method****
389 for (int ip=0; ip<5; ip++)
390 if (tMost[ip] > ipidmax) { ipidmax = tMost[ip]; imost = ip; };
393 if (fMostProbable == 2) {
395 // Using the TPC to reject non-pions
396 if (!(IsPionTPCdEdx(track->P().Mag(), track->TPCsignal())))
399 // Using the TOF to reject non-pions
400 if (track->P().Mag() < 0.6) {
402 if (!IsPionTOFTime(track->P().Mag(), track->TOFpionTime()))
407 if (!IsPionTOFTime(track->P().Mag(), track->TOFpionTime()))
419 else if (fMostProbable == 3) {
421 // Using the TPC to reject non-kaons
422 if (track->P().Mag() < 0.6) {
423 if (!(IsKaonTPCdEdx(track->P().Mag(), track->TPCsignal())))
427 // Using the TOF to reject non-kaons
429 if (!IsKaonTOFTime(track->P().Mag(), track->TOFkaonTime()))
436 if (!IsKaonTOFTime(track->P().Mag(), track->TOFkaonTime()))
442 if (!(IsKaonTPCdEdx(track->P().Mag(), track->TPCsignal())))
452 // Looking for protons
453 else if (fMostProbable == 4) {
455 // Using the TPC to reject non-kaons
456 if (track->P().Mag() < 0.8) {
457 if (!(IsProtonTPCdEdx(track->P().Mag(), track->TPCsignal())))
461 // Using the TOF to reject non-kaons
463 if (!IsKaonTOFTime(track->P().Mag(), track->TOFkaonTime()))
470 if (!IsKaonTOFTime(track->P().Mag(), track->TOFkaonTime()))
476 if (!(IsKaonTPCdEdx(track->P().Mag(), track->TPCsignal())))
486 if (imost != fMostProbable) return false;
490 //cout<<"****** Go Through the cut ******"<<endl;
491 // cout<<fLabel<<" Label="<<track->Label()<<endl;
492 // cout<<fCharge<<" Charge="<<track->Charge()<<endl;
493 // cout<<fPt[0]<<" < Pt ="<<Pt<<" <"<<fPt[1]<<endl;
494 //cout<<fRapidity[0]<<" < Rapidity ="<<tRapidity<<" <"<<fRapidity[1]<<endl;
495 //cout<<fPidProbElectron[0]<<" < e="<<track->PidProbElectron()<<" <"<<fPidProbElectron[1]<<endl;
496 //cout<<fPidProbPion[0]<<" < pi="<<track->PidProbPion()<<" <"<<fPidProbPion[1]<<endl;
497 //cout<<fPidProbKaon[0]<<" < k="<<track->PidProbKaon()<<" <"<<fPidProbKaon[1]<<endl;
498 //cout<<fPidProbProton[0]<<" < p="<<track->PidProbProton()<<" <"<<fPidProbProton[1]<<endl;
499 //cout<<fPidProbMuon[0]<<" < mi="<<track->PidProbMuon()<<" <"<<fPidProbMuon[1]<<endl;
505 //------------------------------
506 AliFemtoString AliFemtoESDTrackCut::Report()
508 // Prepare report from the execution
511 snprintf(tCtemp , 100, "Particle mass:\t%E\n",this->Mass());
513 snprintf(tCtemp , 100, "Particle charge:\t%d\n",fCharge);
515 snprintf(tCtemp , 100, "Particle pT:\t%E - %E\n",fPt[0],fPt[1]);
517 snprintf(tCtemp , 100, "Particle rapidity:\t%E - %E\n",fRapidity[0],fRapidity[1]);
519 snprintf(tCtemp , 100, "Particle eta:\t%E - %E\n",fEta[0],fEta[1]);
521 snprintf(tCtemp , 100, "Number of tracks which passed:\t%ld Number which failed:\t%ld\n",fNTracksPassed,fNTracksFailed);
523 AliFemtoString returnThis = tStemp;
526 TList *AliFemtoESDTrackCut::ListSettings()
528 // return a list of settings in a writable form
529 TList *tListSetttings = new TList();
531 snprintf(buf, 200, "AliFemtoESDTrackCut.mass=%f", this->Mass());
532 tListSetttings->AddLast(new TObjString(buf));
534 snprintf(buf, 200, "AliFemtoESDTrackCut.charge=%i", fCharge);
535 tListSetttings->AddLast(new TObjString(buf));
536 snprintf(buf, 200, "AliFemtoESDTrackCut.pidprobpion.minimum=%f", fPidProbPion[0]);
537 tListSetttings->AddLast(new TObjString(buf));
538 snprintf(buf, 200, "AliFemtoESDTrackCut.pidprobpion.maximum=%f", fPidProbPion[1]);
539 tListSetttings->AddLast(new TObjString(buf));
540 snprintf(buf, 200, "AliFemtoESDTrackCut.pidprobkaon.minimum=%f", fPidProbKaon[0]);
541 tListSetttings->AddLast(new TObjString(buf));
542 snprintf(buf, 200, "AliFemtoESDTrackCut.pidprobkaon.maximum=%f", fPidProbKaon[1]);
543 tListSetttings->AddLast(new TObjString(buf));
544 snprintf(buf, 200, "AliFemtoESDTrackCut.pidprobproton.minimum=%f", fPidProbProton[0]);
545 tListSetttings->AddLast(new TObjString(buf));
546 snprintf(buf, 200, "AliFemtoESDTrackCut.pidprobproton.maximum=%f", fPidProbProton[1]);
547 tListSetttings->AddLast(new TObjString(buf));
548 snprintf(buf, 200, "AliFemtoESDTrackCut.pidprobelectron.minimum=%f", fPidProbElectron[0]);
549 tListSetttings->AddLast(new TObjString(buf));
550 snprintf(buf, 200, "AliFemtoESDTrackCut.pidprobelectron.maximum=%f", fPidProbElectron[1]);
551 tListSetttings->AddLast(new TObjString(buf));
552 snprintf(buf, 200, "AliFemtoESDTrackCut.pidprobMuon.minimum=%f", fPidProbMuon[0]);
553 tListSetttings->AddLast(new TObjString(buf));
554 snprintf(buf, 200, "AliFemtoESDTrackCut.pidprobMuon.maximum=%f", fPidProbMuon[1]);
555 tListSetttings->AddLast(new TObjString(buf));
556 snprintf(buf, 200, "AliFemtoESDTrackCut.minimumtpcclusters=%i", fminTPCclsF);
557 tListSetttings->AddLast(new TObjString(buf));
558 snprintf(buf, 200, "AliFemtoESDTrackCut.minimumitsclusters=%i", fminTPCclsF);
559 tListSetttings->AddLast(new TObjString(buf));
560 snprintf(buf, 200, "AliFemtoESDTrackCut.pt.minimum=%f", fPt[0]);
561 tListSetttings->AddLast(new TObjString(buf));
562 snprintf(buf, 200, "AliFemtoESDTrackCut.pt.maximum=%f", fPt[1]);
563 tListSetttings->AddLast(new TObjString(buf));
564 snprintf(buf, 200, "AliFemtoESDTrackCut.rapidity.minimum=%f", fRapidity[0]);
565 tListSetttings->AddLast(new TObjString(buf));
566 snprintf(buf, 200, "AliFemtoESDTrackCut.rapidity.maximum=%f", fRapidity[1]);
567 tListSetttings->AddLast(new TObjString(buf));
568 snprintf(buf, 200, "AliFemtoESDTrackCut.removekinks=%i", fRemoveKinks);
569 tListSetttings->AddLast(new TObjString(buf));
570 snprintf(buf, 200, "AliFemtoESDTrackCut.maxitschindof=%f", fMaxITSchiNdof);
571 tListSetttings->AddLast(new TObjString(buf));
572 snprintf(buf, 200, "AliFemtoESDTrackCut.maxtpcchindof=%f", fMaxTPCchiNdof);
573 tListSetttings->AddLast(new TObjString(buf));
574 snprintf(buf, 200, "AliFemtoESDTrackCut.maxsigmatovertex=%f", fMaxSigmaToVertex);
575 tListSetttings->AddLast(new TObjString(buf));
576 snprintf(buf, 200, "AliFemtoESDTrackCut.maximpactxy=%f", fMaxImpactXY);
577 tListSetttings->AddLast(new TObjString(buf));
578 snprintf(buf, 200, "AliFemtoESDTrackCut.maximpactz=%f", fMaxImpactZ);
579 tListSetttings->AddLast(new TObjString(buf));
581 if (fMostProbable == 2)
582 snprintf(buf, 200, "AliFemtoESDTrackCut.mostprobable=%s", "Pion");
583 if (fMostProbable == 3)
584 snprintf(buf, 200, "AliFemtoESDTrackCut.mostprobable=%s", "Kaon");
585 if (fMostProbable == 4)
586 snprintf(buf, 200, "AliFemtoESDTrackCut.mostprobable=%s", "Proton");
587 tListSetttings->AddLast(new TObjString(buf));
589 return tListSetttings;
591 void AliFemtoESDTrackCut::SetRemoveKinks(const bool& flag)
596 void AliFemtoESDTrackCut::SetRemoveITSFake(const bool& flag)
598 fRemoveITSFake = flag;
603 // 0 7.594129e-02 8.256141e-03
604 // 1 -5.535827e-01 8.170825e-02
605 // 2 1.728591e+00 3.104210e-01
606 // 3 -2.827893e+00 5.827802e-01
607 // 4 2.503553e+00 5.736207e-01
608 // 5 -1.125965e+00 2.821170e-01
609 // 6 2.009036e-01 5.438876e-02
610 float AliFemtoESDTrackCut::PidFractionElectron(float mom) const
612 // Provide a parameterized fraction of electrons dependent on momentum
616 +1.728591e+00*0.13*0.13
617 -2.827893e+00*0.13*0.13*0.13
618 +2.503553e+00*0.13*0.13*0.13*0.13
619 -1.125965e+00*0.13*0.13*0.13*0.13*0.13
620 +2.009036e-01*0.13*0.13*0.13*0.13*0.13*0.13);
625 +1.728591e+00*1.8*1.8
626 -2.827893e+00*1.8*1.8*1.8
627 +2.503553e+00*1.8*1.8*1.8*1.8
628 -1.125965e+00*1.8*1.8*1.8*1.8*1.8
629 +2.009036e-01*1.8*1.8*1.8*1.8*1.8*1.8);
632 +1.728591e+00*mom*mom
633 -2.827893e+00*mom*mom*mom
634 +2.503553e+00*mom*mom*mom*mom
635 -1.125965e+00*mom*mom*mom*mom*mom
636 +2.009036e-01*mom*mom*mom*mom*mom*mom);
641 // 0 1.063457e+00 8.872043e-03
642 // 1 -4.222208e-01 2.534402e-02
643 // 2 1.042004e-01 1.503945e-02
644 float AliFemtoESDTrackCut::PidFractionPion(float mom) const
646 // Provide a parameterized fraction of pions dependent on momentum
648 return ( 1.063457e+00
650 +1.042004e-01*0.0169);
652 return ( 1.063457e+00
655 return ( 1.063457e+00
657 +1.042004e-01*mom*mom);
662 // 0 -7.289406e-02 1.686074e-03
663 // 1 4.415666e-01 1.143939e-02
664 // 2 -2.996790e-01 1.840964e-02
665 // 3 6.704652e-02 7.783990e-03
666 float AliFemtoESDTrackCut::PidFractionKaon(float mom) const
668 // Provide a parameterized fraction of kaons dependent on momentum
670 return (-7.289406e-02
672 -2.996790e-01*0.18*0.18
673 +6.704652e-02*0.18*0.18*0.18);
675 return (-7.289406e-02
677 -2.996790e-01*2.0*2.0
678 +6.704652e-02*2.0*2.0*2.0);
679 return (-7.289406e-02
681 -2.996790e-01*mom*mom
682 +6.704652e-02*mom*mom*mom);
687 // 0 -3.730200e-02 2.347311e-03
688 // 1 1.163684e-01 1.319316e-02
689 // 2 8.354116e-02 1.997948e-02
690 // 3 -4.608098e-02 8.336400e-03
691 float AliFemtoESDTrackCut::PidFractionProton(float mom) const
693 // Provide a parameterized fraction of protons dependent on momentum
694 if (mom<0.26) return 0.0;
696 return (-3.730200e-02
698 +8.354116e-02*2.0*2.0
699 -4.608098e-02*2.0*2.0*2.0);
700 return (-3.730200e-02
702 +8.354116e-02*mom*mom
703 -4.608098e-02*mom*mom*mom);
706 void AliFemtoESDTrackCut::SetMomRangeTOFpidIs(const float& minp, const float& maxp)
708 fMinPforTOFpid = minp;
709 fMaxPforTOFpid = maxp;
712 void AliFemtoESDTrackCut::SetMomRangeTPCpidIs(const float& minp, const float& maxp)
714 fMinPforTPCpid = minp;
715 fMaxPforTPCpid = maxp;
718 void AliFemtoESDTrackCut::SetMomRangeITSpidIs(const float& minp, const float& maxp)
720 fMinPforITSpid = minp;
721 fMaxPforITSpid = maxp;
724 bool AliFemtoESDTrackCut::IsPionTPCdEdx(float mom, float dEdx)
726 // double a1 = -95.4545, b1 = 86.5455;
727 // double a2 = 0.0, b2 = 56.0;
728 double a1 = -343.75, b1 = 168.125;
729 double a2 = 0.0, b2 = 65.0;
732 if (dEdx < a1*mom+b1) return true;
734 if (dEdx < a2*mom+b2) return true;
739 bool AliFemtoESDTrackCut::IsKaonTPCdEdx(float mom, float dEdx)
742 // double a1 = -547.0; double b1 = 297.0;
743 // double a2 = -125.0; double b2 = 145.0;
744 // double a3 = -420.0; double b3 = 357.0;
745 // double a4 = -110.0; double b4 = 171.0;
748 // if (mom<0.2) return false;
751 // if (dEdx < a1*mom+b1) return false;
752 // if (dEdx > a3*mom+b3) return false;
754 // else if (mom<0.6) {
755 // if (dEdx < a2*mom+b2) return false;
756 // if (dEdx > a3*mom+b3) return false;
758 // else if (mom<0.9) {
759 // if (dEdx > a4*mom+b4) return false;
760 // if (dEdx < b5) return false;
765 // // if (dEdx > b5) return false;
770 double a1 = -268.896; double b1 = 198.669;
771 double a2 = -49.0012; double b2 = 88.7214;
773 if (mom<0.2) return false;
775 if (mom>0.3 && mom<0.5) {
776 if (dEdx < a1*mom+b1) return false;
779 if (dEdx < a2*mom+b2) return false;
786 bool AliFemtoESDTrackCut::IsProtonTPCdEdx(float mom, float dEdx)
788 double a1 = -1800.0; double b1 = 940.0;
789 double a2 = -500.0; double b2 = 420.0;
790 double a3 = -216.7; double b3 = 250.0;
792 if (mom<0.2) return false;
794 if (mom>0.3 && mom<0.4) {
795 if (dEdx < a1*mom+b1) return false;
798 if (dEdx < a2*mom+b2) return false;
801 if (dEdx < a3*mom+b3) return false;
808 bool AliFemtoESDTrackCut::IsPionTOFTime(float mom, float ttof)
810 double a1 = -427.0; double b1 = 916.0;
811 double a2 = 327.0; double b2 = -888.0;
812 if (mom<0.3) return kFALSE;
813 if (mom>2.0) return kFALSE;
814 if (ttof > a1*mom+b1) return kFALSE;
815 if (ttof < a2*mom+b2) return kFALSE;
820 bool AliFemtoESDTrackCut::IsKaonTOFTime(float mom, float ttof)
822 double a1 = 000.0; double b1 = -500.0;
823 double a2 = 000.0; double b2 = 500.0;
824 double a3 = 850.0; double b3 = -1503.0;
825 double a4 = -1637.0; double b4 = 3621.0;
827 if (mom<0.3) return kFALSE;
828 if (mom>2.06) return kFALSE;
830 if (ttof > a2*mom+b2) return kFALSE;
831 if (ttof < a1*mom+b1) return kFALSE;
834 if (ttof > a2*mom+b2) return kFALSE;
835 if (ttof < a3*mom+b3) return kFALSE;
838 if (ttof > a4*mom+b4) return kFALSE;
839 if (ttof < a3*mom+b3) return kFALSE;
844 bool AliFemtoESDTrackCut::IsProtonTOFTime(float mom, float ttof)
846 double a1 = 000.0; double b1 = -915.0;
847 double a2 = 000.0; double b2 = 600.0;
848 double a3 = 572.0; double b3 = -1715.0;
850 if (mom<0.3) return kFALSE;
851 if (mom>3.0) return kFALSE;
853 if (ttof > a2*mom+b2) return kFALSE;
854 if (ttof < a1*mom+b1) return kFALSE;
857 if (ttof > a2*mom+b2) return kFALSE;
858 if (ttof < a3*mom+b3) return kFALSE;
866 bool AliFemtoESDTrackCut::IsKaonTPCdEdxNSigma(float mom, float nsigmaK)
868 // cout<<" AliFemtoESDTrackCut::IsKaonTPCdEdxNSigma "<<mom<<" "<<nsigmaK<<endl;
871 if(mom<0.35 && TMath::Abs(nsigmaK)<5.0)return true;
872 if(mom>=0.35 && mom<0.5 && TMath::Abs(nsigmaK)<3.0)return true;
873 if(mom>=0.5 && mom<0.7 && TMath::Abs(nsigmaK)<2.0)return true;
878 bool AliFemtoESDTrackCut::IsKaonTOFNSigma(float mom, float nsigmaK)
880 // cout<<" AliFemtoESDTrackCut::IsKaonTPCdEdxNSigma "<<mom<<" "<<nsigmaK<<endl;
882 // if(mom<1.5 && TMath::Abs(nsigmaK)<3.0)return true;
883 if(mom>=1.5 && TMath::Abs(nsigmaK)<2.0)return true;
888 bool AliFemtoESDTrackCut::IsKaonNSigma(float mom, float nsigmaTPCK, float nsigmaTOFK)
894 if(TMath::Abs(nsigmaTPCK)<2.0)
907 if(TMath::Abs(nsigmaTOFK)<3.0 && TMath::Abs(nsigmaTPCK)<3.0)
917 // if(mom>1.5 || mom<0.15)return false;
925 bool AliFemtoESDTrackCut::IsKaonNSigma(float mom, float nsigmaTPCK, float nsigmaTOFK)
932 if(TMath::Abs(nsigmaTPCK)<2.0) return true;
934 else if(TMath::Abs(nsigmaTOFK)<3.0 && TMath::Abs(nsigmaTPCK)<3.0) return true;
936 else if(mom>=0.4 && mom<=0.6)
940 if(TMath::Abs(nsigmaTPCK)<2.0) return true;
942 else if(TMath::Abs(nsigmaTOFK)<3.0 && TMath::Abs(nsigmaTPCK)<3.0) return true;
944 else if(nsigmaTOFK<-999.)
948 else if(TMath::Abs(nsigmaTOFK)<3.0 && TMath::Abs(nsigmaTPCK)<3.0) return true;
955 bool AliFemtoESDTrackCut::IsPionNSigma(float mom, float nsigmaTPCPi, float nsigmaTOFPi)
959 if(nsigmaTOFPi<-999.)
961 if(mom<0.35 && TMath::Abs(nsigmaTPCPi)<3.0) return true;
962 else if(mom<0.5 && mom>=0.35 && TMath::Abs(nsigmaTPCPi)<3.0) return true;
963 else if(mom>=0.5 && TMath::Abs(nsigmaTPCPi)<2.0) return true;
966 else if(TMath::Abs(nsigmaTOFPi)<3.0 && TMath::Abs(nsigmaTPCPi)<3.0) return true;
968 else if(nsigmaTOFPi<-999.)
972 else if(mom<1.5 && TMath::Abs(nsigmaTOFPi)<3.0 && TMath::Abs(nsigmaTPCPi)<5.0) return true;
973 else if(mom>=1.5 && TMath::Abs(nsigmaTOFPi)<2.0 && TMath::Abs(nsigmaTPCPi)<5.0) return true;
979 bool AliFemtoESDTrackCut::IsProtonNSigma(float mom, float nsigmaTPCP, float nsigmaTOFP)
984 if (TMath::Hypot( nsigmaTOFP, nsigmaTPCP )/TMath::Sqrt(2) < 3.0)
988 if (TMath::Abs(nsigmaTPCP) < 3.0)
993 if (mom > 0.8 && mom < 2.5) {
994 if ( TMath::Abs(nsigmaTPCP) < 3.0 && TMath::Abs(nsigmaTOFP) < 3.0)
997 else if (mom > 2.5) {
998 if ( TMath::Abs(nsigmaTPCP) < 3.0 && TMath::Abs(nsigmaTOFP) < 2.0)
1002 if (TMath::Abs(nsigmaTPCP) < 3.0)
1011 void AliFemtoESDTrackCut::SetPIDMethod(ReadPIDMethodType newMethod)
1013 fPIDMethod = newMethod;
1017 void AliFemtoESDTrackCut::SetNsigmaTPCTOF(Bool_t nsigma)
1019 fNsigmaTPCTOF = nsigma;
1022 void AliFemtoESDTrackCut::SetClusterRequirementITS(AliESDtrackCuts::Detector det, AliESDtrackCuts::ITSClusterRequirement req)
1024 fCutClusterRequirementITS[det] = req;
1027 Bool_t AliFemtoESDTrackCut::CheckITSClusterRequirement(AliESDtrackCuts::ITSClusterRequirement req, Bool_t clusterL1, Bool_t clusterL2)
1029 // checks if the cluster requirement is fullfilled (in this case: return kTRUE)
1033 case AliESDtrackCuts::kOff: return kTRUE;
1034 case AliESDtrackCuts::kNone: return !clusterL1 && !clusterL2;
1035 case AliESDtrackCuts::kAny: return clusterL1 || clusterL2;
1036 case AliESDtrackCuts::kFirst: return clusterL1;
1037 case AliESDtrackCuts::kOnlyFirst: return clusterL1 && !clusterL2;
1038 case AliESDtrackCuts::kSecond: return clusterL2;
1039 case AliESDtrackCuts::kOnlySecond: return clusterL2 && !clusterL1;
1040 case AliESDtrackCuts::kBoth: return clusterL1 && clusterL2;