2 ***************************************************************************
4 * $Id: AliFemtoKKTrackCut.cxx 60781 2013-02-08 16:24:10Z akisiel $
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 "AliFemtoKKTrackCut.h"
51 ClassImp(AliFemtoKKTrackCut)
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 AliFemtoKKTrackCut::AliFemtoKKTrackCut() :
94 fMaxITSchiNdof(1000.0),
95 fMaxTPCchiNdof(1000.0),
96 fMaxSigmaToVertex(1000.0),
100 fRemoveITSFake(kFALSE),
102 fMaxImpactXY(1000.0),
104 fMaxImpactXYPtOff(1000.0),
105 fMaxImpactXYPtNrm(1000.0),
106 fMaxImpactXYPtPow(1000.0),
108 fMaxPforTOFpid(10000.0),
110 fMaxPforTPCpid(10000.0),
112 fMaxPforITSpid(10000.0)
114 // Default constructor
115 fNTracksPassed = fNTracksFailed = 0;
116 fCharge = 0; // takes both charges 0
117 fPt[0]=0.0; fPt[1] = 100.0;//100
118 fRapidity[0]=-2; fRapidity[1]=2;//-2 2
119 fEta[0]=-2; fEta[1]=2;//-2 2
120 fPidProbElectron[0]=-1;fPidProbElectron[1]=2;
121 fPidProbPion[0]=-1; fPidProbPion[1]=2;
122 fPidProbKaon[0]=-1;fPidProbKaon[1]=2;
123 fPidProbProton[0]=-1;fPidProbProton[1]=2;
124 fPidProbMuon[0]=-1;fPidProbMuon[1]=2;
125 for (Int_t i = 0; i < 3; i++)
126 fCutClusterRequirementITS[i] = AliESDtrackCuts::kOff;
133 //------------------------------
134 AliFemtoKKTrackCut::~AliFemtoKKTrackCut(){
137 //------------------------------
138 bool AliFemtoKKTrackCut::Pass(const AliFemtoTrack* track)
140 //cout<<"AliFemtoKKTrackCut::Pass"<<endl;
142 // test the particle and return
143 // true if it meets all the criteria
144 // false if it doesn't meet at least one of the criteria
147 //cout<<"AliKK cut"<<endl;
148 //cout<<fPidProbPion[0]<<" < pi ="<<track->PidProbPion()<<" <"<<fPidProbPion[1]<<endl;
151 //cout<<" status "<<track->Label()<<" "<<track->Flags()<<" "<<track->TPCnclsF()<<" "<<track->ITSncls()<<endl;
152 if ((track->Flags()&fStatus)!=fStatus)
154 // cout<<track->Flags()<<" "<<fStatus<<" no go through status"<<endl;
160 if ((track->KinkIndex(0)) || (track->KinkIndex(1)) || (track->KinkIndex(2)))
163 if (fRemoveITSFake) {
164 if (track->ITSncls() < 0)
167 if (fminTPCclsF>track->TPCnclsF())
169 //cout<<" No go because TPC Number of ClsF"<<fminTPCclsF<< " "<<track->TPCnclsF()<<endl;
172 if (fminTPCncls>track->TPCncls())
174 //cout<<" No go because TPC Number of ClsF"<<fminTPCclsF<< " "<<track->TPCnclsF()<<endl;
177 if (fminITScls>track->ITSncls())
179 //cout<<" No go because ITS Number of Cls"<<fminITScls<< " "<<track->ITSncls()<<endl;
183 if (fMaxImpactXY < TMath::Abs(track->ImpactD()))
186 if (fMaxImpactZ < TMath::Abs(track->ImpactZ()))
189 if (fMaxSigmaToVertex < track->SigmaToVertex()) {
193 if (track->ITSncls() > 0)
194 if ((track->ITSchi2()/track->ITSncls()) > fMaxITSchiNdof) {
198 if (track->TPCncls() > 0)
199 if ((track->TPCchi2()/track->TPCncls()) > fMaxTPCchiNdof) {
202 //ITS cluster requirenments
203 for (Int_t i = 0; i < 3; i++)
204 if(!CheckITSClusterRequirement(fCutClusterRequirementITS[i], track->HasPointOnITSLayer(i*2), track->HasPointOnITSLayer(i*2+1)))
209 //cout<<"labels"<<endl;
213 // cout<<"No Go Through the cut"<<endl;
214 // cout<<fLabel<<" Label="<<track->Label()<<endl;
220 //cout<<"AliKK cut ch "<<endl;
221 //cout<<fCharge<<" Charge="<<track->Charge()<<endl;
222 if (track->Charge()!= fCharge)
225 // cout<<"No Go Through the cut"<<endl;
226 // cout<<fCharge<<" Charge="<<track->Charge()<<endl;
234 Bool_t tTPCPidIn = (track->Flags()&AliFemtoTrack::kTPCpid)>0;
235 Bool_t tITSPidIn = (track->Flags()&AliFemtoTrack::kITSpid)>0;
236 Bool_t tTOFPidIn = (track->Flags()&AliFemtoTrack::kTOFpid)>0;
238 if(fMinPforTOFpid > 0 && track->P().Mag() > fMinPforTOFpid &&
239 track->P().Mag() < fMaxPforTOFpid && !tTOFPidIn)
245 if(fMinPforTPCpid > 0 && track->P().Mag() > fMinPforTPCpid &&
246 track->P().Mag() < fMaxPforTPCpid && !tTPCPidIn)
252 if(fMinPforITSpid > 0 && track->P().Mag() > fMinPforITSpid &&
253 track->P().Mag() < fMaxPforITSpid && !tITSPidIn)
260 float tEnergy = ::sqrt(track->P().Mag2()+fMass*fMass);
261 float tRapidity = 0.5*::log((tEnergy+track->P().z())/(tEnergy-track->P().z()));
262 float tPt = ::sqrt((track->P().x())*(track->P().x())+(track->P().y())*(track->P().y()));
263 float tEta = track->P().PseudoRapidity();
265 if (fMaxImpactXYPtOff < 999.0) {
266 if ((fMaxImpactXYPtOff + fMaxImpactXYPtNrm*TMath::Power(tPt, fMaxImpactXYPtPow)) < TMath::Abs(track->ImpactD())) {
272 if ((tRapidity<fRapidity[0])||(tRapidity>fRapidity[1]))
275 //cout<<"No Go Through the cut"<<endl;
276 //cout<<fRapidity[0]<<" < Rapidity ="<<tRapidity<<" <"<<fRapidity[1]<<endl;
279 if ((tEta<fEta[0])||(tEta>fEta[1]))
282 //cout<<"No Go Through the cut"<<endl;
283 //cout<<fEta[0]<<" < Eta ="<<tEta<<" <"<<fEta[1]<<endl;
286 if ((tPt<fPt[0])||(tPt>fPt[1]))
289 //cout<<"No Go Through the cut"<<endl;
290 //cout<<fPt[0]<<" < Pt ="<<Pt<<" <"<<fPt[1]<<endl;
297 // cout << "Track has pids: "
298 // << track->PidProbElectron() << " "
299 // << track->PidProbMuon() << " "
300 // << track->PidProbPion() << " "
301 // << track->PidProbKaon() << " "
302 // << track->PidProbProton() << " "
303 // << track->PidProbElectron()+track->PidProbMuon()+track->PidProbPion()+track->PidProbKaon()+track->PidProbProton() << endl;
306 if ((track->PidProbElectron()<fPidProbElectron[0])||(track->PidProbElectron()>fPidProbElectron[1]))
309 //cout<<"No Go Through the cut"<<endl;
310 //cout<<fPidProbElectron[0]<<" < e ="<<track->PidProbElectron()<<" <"<<fPidProbElectron[1]<<endl;
313 if ((track->PidProbPion()<fPidProbPion[0])||(track->PidProbPion()>fPidProbPion[1]))
316 //cout<<"No Go Through the cut"<<endl;
317 //cout<<fPidProbPion[0]<<" < pi ="<<track->PidProbPion()<<" <"<<fPidProbPion[1]<<endl;
320 if ((track->PidProbKaon()<fPidProbKaon[0])||(track->PidProbKaon()>fPidProbKaon[1]))
323 //cout<<"No Go Through the cut"<<endl;
324 //cout<<fPidProbKaon[0]<<" < k ="<<track->PidProbKaon()<<" <"<<fPidProbKaon[1]<<endl;
327 if ((track->PidProbProton()<fPidProbProton[0])||(track->PidProbProton()>fPidProbProton[1]))
330 //cout<<"No Go Through the cut"<<endl;
331 //cout<<fPidProbProton[0]<<" < p ="<<track->PidProbProton()<<" <"<<fPidProbProton[1]<<endl;
334 if ((track->PidProbMuon()<fPidProbMuon[0])||(track->PidProbMuon()>fPidProbMuon[1]))
337 //cout<<"No Go Through the cut"<<endl;
338 //cout<<fPidProbMuon[0]<<" < mi="<<track->PidProbMuon()<<" <"<<fPidProbMuon[1]<<endl;
345 tMost[0] = track->PidProbElectron()*PidFractionElectron(track->P().Mag());
347 tMost[2] = track->PidProbPion()*PidFractionPion(track->P().Mag());
348 tMost[3] = track->PidProbKaon()*PidFractionKaon(track->P().Mag());
349 tMost[4] = track->PidProbProton()*PidFractionProton(track->P().Mag());
353 //****N Sigma Method****
356 if (fMostProbable == 2) {
357 if (IsPionNSigma(track->P().Mag(), track->NSigmaTPCPi(), track->NSigmaTOFPi()))
361 else if (fMostProbable == 3) {
364 if (IsKaonNSigma(track->P().Mag(), track->NSigmaTPCK(), track->NSigmaTOFK())){
370 else if (fMostProbable == 4) { // proton nsigma-PID required contour adjusting
371 if (IsProtonNSigma(track->P().Mag(), track->NSigmaTPCP(), track->NSigmaTOFP()) // && IsProtonTPCdEdx(track->P().Mag(), track->TPCsignal())
380 //****Contour Method****
382 for (int ip=0; ip<5; ip++)
383 if (tMost[ip] > ipidmax) { ipidmax = tMost[ip]; imost = ip; };
386 if (fMostProbable == 2) {
388 // Using the TPC to reject non-pions
389 if (!(IsPionTPCdEdx(track->P().Mag(), track->TPCsignal())))
392 // Using the TOF to reject non-pions
393 if (track->P().Mag() < 0.6) {
395 if (!IsPionTOFTime(track->P().Mag(), track->TOFpionTime()))
400 if (!IsPionTOFTime(track->P().Mag(), track->TOFpionTime()))
412 else if (fMostProbable == 3) {
414 // Using the TPC to reject non-kaons
415 if (track->P().Mag() < 0.6) {
416 if (!(IsKaonTPCdEdx(track->P().Mag(), track->TPCsignal())))
420 // Using the TOF to reject non-kaons
422 if (!IsKaonTOFTime(track->P().Mag(), track->TOFkaonTime()))
429 if (!IsKaonTOFTime(track->P().Mag(), track->TOFkaonTime()))
435 if (!(IsKaonTPCdEdx(track->P().Mag(), track->TPCsignal())))
445 // Looking for protons
446 else if (fMostProbable == 4) {
448 // Using the TPC to reject non-kaons
449 if (track->P().Mag() < 0.8) {
450 if (!(IsProtonTPCdEdx(track->P().Mag(), track->TPCsignal())))
454 // Using the TOF to reject non-kaons
456 if (!IsKaonTOFTime(track->P().Mag(), track->TOFkaonTime()))
463 if (!IsKaonTOFTime(track->P().Mag(), track->TOFkaonTime()))
469 if (!(IsKaonTPCdEdx(track->P().Mag(), track->TPCsignal())))
479 if (imost != fMostProbable) return false;
483 //cout<<"****** Go Through the cut ******"<<endl;
484 // cout<<fLabel<<" Label="<<track->Label()<<endl;
485 // cout<<fCharge<<" Charge="<<track->Charge()<<endl;
486 // cout<<fPt[0]<<" < Pt ="<<Pt<<" <"<<fPt[1]<<endl;
487 //cout<<fRapidity[0]<<" < Rapidity ="<<tRapidity<<" <"<<fRapidity[1]<<endl;
488 //cout<<fPidProbElectron[0]<<" < e="<<track->PidProbElectron()<<" <"<<fPidProbElectron[1]<<endl;
489 //cout<<fPidProbPion[0]<<" < pi="<<track->PidProbPion()<<" <"<<fPidProbPion[1]<<endl;
490 //cout<<fPidProbKaon[0]<<" < k="<<track->PidProbKaon()<<" <"<<fPidProbKaon[1]<<endl;
491 //cout<<fPidProbProton[0]<<" < p="<<track->PidProbProton()<<" <"<<fPidProbProton[1]<<endl;
492 //cout<<fPidProbMuon[0]<<" < mi="<<track->PidProbMuon()<<" <"<<fPidProbMuon[1]<<endl;
498 //------------------------------
499 AliFemtoString AliFemtoKKTrackCut::Report()
501 // Prepare report from the execution
504 snprintf(tCtemp , 100, "Particle mass:\t%E\n",this->Mass());
506 snprintf(tCtemp , 100, "Particle charge:\t%d\n",fCharge);
508 snprintf(tCtemp , 100, "Particle pT:\t%E - %E\n",fPt[0],fPt[1]);
510 snprintf(tCtemp , 100, "Particle rapidity:\t%E - %E\n",fRapidity[0],fRapidity[1]);
512 snprintf(tCtemp , 100, "Particle eta:\t%E - %E\n",fEta[0],fEta[1]);
514 snprintf(tCtemp , 100, "Number of tracks which passed:\t%ld Number which failed:\t%ld\n",fNTracksPassed,fNTracksFailed);
516 AliFemtoString returnThis = tStemp;
519 TList *AliFemtoKKTrackCut::ListSettings()
521 // return a list of settings in a writable form
522 TList *tListSetttings = new TList();
524 snprintf(buf, 200, "AliFemtoKKTrackCut.mass=%f", this->Mass());
525 tListSetttings->AddLast(new TObjString(buf));
527 snprintf(buf, 200, "AliFemtoKKTrackCut.charge=%i", fCharge);
528 tListSetttings->AddLast(new TObjString(buf));
529 snprintf(buf, 200, "AliFemtoKKTrackCut.pidprobpion.minimum=%f", fPidProbPion[0]);
530 tListSetttings->AddLast(new TObjString(buf));
531 snprintf(buf, 200, "AliFemtoKKTrackCut.pidprobpion.maximum=%f", fPidProbPion[1]);
532 tListSetttings->AddLast(new TObjString(buf));
533 snprintf(buf, 200, "AliFemtoKKTrackCut.pidprobkaon.minimum=%f", fPidProbKaon[0]);
534 tListSetttings->AddLast(new TObjString(buf));
535 snprintf(buf, 200, "AliFemtoKKTrackCut.pidprobkaon.maximum=%f", fPidProbKaon[1]);
536 tListSetttings->AddLast(new TObjString(buf));
537 snprintf(buf, 200, "AliFemtoKKTrackCut.pidprobproton.minimum=%f", fPidProbProton[0]);
538 tListSetttings->AddLast(new TObjString(buf));
539 snprintf(buf, 200, "AliFemtoKKTrackCut.pidprobproton.maximum=%f", fPidProbProton[1]);
540 tListSetttings->AddLast(new TObjString(buf));
541 snprintf(buf, 200, "AliFemtoKKTrackCut.pidprobelectron.minimum=%f", fPidProbElectron[0]);
542 tListSetttings->AddLast(new TObjString(buf));
543 snprintf(buf, 200, "AliFemtoKKTrackCut.pidprobelectron.maximum=%f", fPidProbElectron[1]);
544 tListSetttings->AddLast(new TObjString(buf));
545 snprintf(buf, 200, "AliFemtoKKTrackCut.pidprobMuon.minimum=%f", fPidProbMuon[0]);
546 tListSetttings->AddLast(new TObjString(buf));
547 snprintf(buf, 200, "AliFemtoKKTrackCut.pidprobMuon.maximum=%f", fPidProbMuon[1]);
548 tListSetttings->AddLast(new TObjString(buf));
549 snprintf(buf, 200, "AliFemtoKKTrackCut.minimumtpcclusters=%i", fminTPCclsF);
550 tListSetttings->AddLast(new TObjString(buf));
551 snprintf(buf, 200, "AliFemtoKKTrackCut.minimumitsclusters=%i", fminTPCclsF);
552 tListSetttings->AddLast(new TObjString(buf));
553 snprintf(buf, 200, "AliFemtoKKTrackCut.pt.minimum=%f", fPt[0]);
554 tListSetttings->AddLast(new TObjString(buf));
555 snprintf(buf, 200, "AliFemtoKKTrackCut.pt.maximum=%f", fPt[1]);
556 tListSetttings->AddLast(new TObjString(buf));
557 snprintf(buf, 200, "AliFemtoKKTrackCut.rapidity.minimum=%f", fRapidity[0]);
558 tListSetttings->AddLast(new TObjString(buf));
559 snprintf(buf, 200, "AliFemtoKKTrackCut.rapidity.maximum=%f", fRapidity[1]);
560 tListSetttings->AddLast(new TObjString(buf));
561 snprintf(buf, 200, "AliFemtoKKTrackCut.removekinks=%i", fRemoveKinks);
562 tListSetttings->AddLast(new TObjString(buf));
563 snprintf(buf, 200, "AliFemtoKKTrackCut.maxitschindof=%f", fMaxITSchiNdof);
564 tListSetttings->AddLast(new TObjString(buf));
565 snprintf(buf, 200, "AliFemtoKKTrackCut.maxtpcchindof=%f", fMaxTPCchiNdof);
566 tListSetttings->AddLast(new TObjString(buf));
567 snprintf(buf, 200, "AliFemtoKKTrackCut.maxsigmatovertex=%f", fMaxSigmaToVertex);
568 tListSetttings->AddLast(new TObjString(buf));
569 snprintf(buf, 200, "AliFemtoKKTrackCut.maximpactxy=%f", fMaxImpactXY);
570 tListSetttings->AddLast(new TObjString(buf));
571 snprintf(buf, 200, "AliFemtoKKTrackCut.maximpactz=%f", fMaxImpactZ);
572 tListSetttings->AddLast(new TObjString(buf));
574 if (fMostProbable == 2)
575 snprintf(buf, 200, "AliFemtoKKTrackCut.mostprobable=%s", "Pion");
576 if (fMostProbable == 3)
577 snprintf(buf, 200, "AliFemtoKKTrackCut.mostprobable=%s", "Kaon");
578 if (fMostProbable == 4)
579 snprintf(buf, 200, "AliFemtoKKTrackCut.mostprobable=%s", "Proton");
580 tListSetttings->AddLast(new TObjString(buf));
582 return tListSetttings;
584 void AliFemtoKKTrackCut::SetRemoveKinks(const bool& flag)
589 void AliFemtoKKTrackCut::SetRemoveITSFake(const bool& flag)
591 fRemoveITSFake = flag;
596 // 0 7.594129e-02 8.256141e-03
597 // 1 -5.535827e-01 8.170825e-02
598 // 2 1.728591e+00 3.104210e-01
599 // 3 -2.827893e+00 5.827802e-01
600 // 4 2.503553e+00 5.736207e-01
601 // 5 -1.125965e+00 2.821170e-01
602 // 6 2.009036e-01 5.438876e-02
603 float AliFemtoKKTrackCut::PidFractionElectron(float mom) const
605 // Provide a parameterized fraction of electrons dependent on momentum
609 +1.728591e+00*0.13*0.13
610 -2.827893e+00*0.13*0.13*0.13
611 +2.503553e+00*0.13*0.13*0.13*0.13
612 -1.125965e+00*0.13*0.13*0.13*0.13*0.13
613 +2.009036e-01*0.13*0.13*0.13*0.13*0.13*0.13);
618 +1.728591e+00*1.8*1.8
619 -2.827893e+00*1.8*1.8*1.8
620 +2.503553e+00*1.8*1.8*1.8*1.8
621 -1.125965e+00*1.8*1.8*1.8*1.8*1.8
622 +2.009036e-01*1.8*1.8*1.8*1.8*1.8*1.8);
625 +1.728591e+00*mom*mom
626 -2.827893e+00*mom*mom*mom
627 +2.503553e+00*mom*mom*mom*mom
628 -1.125965e+00*mom*mom*mom*mom*mom
629 +2.009036e-01*mom*mom*mom*mom*mom*mom);
634 // 0 1.063457e+00 8.872043e-03
635 // 1 -4.222208e-01 2.534402e-02
636 // 2 1.042004e-01 1.503945e-02
637 float AliFemtoKKTrackCut::PidFractionPion(float mom) const
639 // Provide a parameterized fraction of pions dependent on momentum
641 return ( 1.063457e+00
643 +1.042004e-01*0.0169);
645 return ( 1.063457e+00
648 return ( 1.063457e+00
650 +1.042004e-01*mom*mom);
655 // 0 -7.289406e-02 1.686074e-03
656 // 1 4.415666e-01 1.143939e-02
657 // 2 -2.996790e-01 1.840964e-02
658 // 3 6.704652e-02 7.783990e-03
659 float AliFemtoKKTrackCut::PidFractionKaon(float mom) const
661 // Provide a parameterized fraction of kaons dependent on momentum
663 return (-7.289406e-02
665 -2.996790e-01*0.18*0.18
666 +6.704652e-02*0.18*0.18*0.18);
668 return (-7.289406e-02
670 -2.996790e-01*2.0*2.0
671 +6.704652e-02*2.0*2.0*2.0);
672 return (-7.289406e-02
674 -2.996790e-01*mom*mom
675 +6.704652e-02*mom*mom*mom);
680 // 0 -3.730200e-02 2.347311e-03
681 // 1 1.163684e-01 1.319316e-02
682 // 2 8.354116e-02 1.997948e-02
683 // 3 -4.608098e-02 8.336400e-03
684 float AliFemtoKKTrackCut::PidFractionProton(float mom) const
686 // Provide a parameterized fraction of protons dependent on momentum
687 if (mom<0.26) return 0.0;
689 return (-3.730200e-02
691 +8.354116e-02*2.0*2.0
692 -4.608098e-02*2.0*2.0*2.0);
693 return (-3.730200e-02
695 +8.354116e-02*mom*mom
696 -4.608098e-02*mom*mom*mom);
699 void AliFemtoKKTrackCut::SetMomRangeTOFpidIs(const float& minp, const float& maxp)
701 fMinPforTOFpid = minp;
702 fMaxPforTOFpid = maxp;
705 void AliFemtoKKTrackCut::SetMomRangeTPCpidIs(const float& minp, const float& maxp)
707 fMinPforTPCpid = minp;
708 fMaxPforTPCpid = maxp;
711 void AliFemtoKKTrackCut::SetMomRangeITSpidIs(const float& minp, const float& maxp)
713 fMinPforITSpid = minp;
714 fMaxPforITSpid = maxp;
717 bool AliFemtoKKTrackCut::IsPionTPCdEdx(float mom, float dEdx)
719 // double a1 = -95.4545, b1 = 86.5455;
720 // double a2 = 0.0, b2 = 56.0;
721 double a1 = -343.75, b1 = 168.125;
722 double a2 = 0.0, b2 = 65.0;
725 if (dEdx < a1*mom+b1) return true;
727 if (dEdx < a2*mom+b2) return true;
732 bool AliFemtoKKTrackCut::IsKaonTPCdEdx(float mom, float dEdx)
735 // double a1 = -547.0; double b1 = 297.0;
736 // double a2 = -125.0; double b2 = 145.0;
737 // double a3 = -420.0; double b3 = 357.0;
738 // double a4 = -110.0; double b4 = 171.0;
741 // if (mom<0.2) return false;
744 // if (dEdx < a1*mom+b1) return false;
745 // if (dEdx > a3*mom+b3) return false;
747 // else if (mom<0.6) {
748 // if (dEdx < a2*mom+b2) return false;
749 // if (dEdx > a3*mom+b3) return false;
751 // else if (mom<0.9) {
752 // if (dEdx > a4*mom+b4) return false;
753 // if (dEdx < b5) return false;
758 // // if (dEdx > b5) return false;
763 double a1 = -268.896; double b1 = 198.669;
764 double a2 = -49.0012; double b2 = 88.7214;
766 if (mom<0.2) return false;
768 if (mom>0.3 && mom<0.5) {
769 if (dEdx < a1*mom+b1) return false;
772 if (dEdx < a2*mom+b2) return false;
779 bool AliFemtoKKTrackCut::IsProtonTPCdEdx(float mom, float dEdx)
781 double a1 = -1800.0; double b1 = 940.0;
782 double a2 = -500.0; double b2 = 420.0;
783 double a3 = -216.7; double b3 = 250.0;
785 if (mom<0.2) return false;
787 if (mom>0.3 && mom<0.4) {
788 if (dEdx < a1*mom+b1) return false;
791 if (dEdx < a2*mom+b2) return false;
794 if (dEdx < a3*mom+b3) return false;
801 bool AliFemtoKKTrackCut::IsPionTOFTime(float mom, float ttof)
803 double a1 = -427.0; double b1 = 916.0;
804 double a2 = 327.0; double b2 = -888.0;
805 if (mom<0.3) return kFALSE;
806 if (mom>2.0) return kFALSE;
807 if (ttof > a1*mom+b1) return kFALSE;
808 if (ttof < a2*mom+b2) return kFALSE;
813 bool AliFemtoKKTrackCut::IsKaonTOFTime(float mom, float ttof)
815 double a1 = 000.0; double b1 = -500.0;
816 double a2 = 000.0; double b2 = 500.0;
817 double a3 = 850.0; double b3 = -1503.0;
818 double a4 = -1637.0; double b4 = 3621.0;
820 if (mom<0.3) return kFALSE;
821 if (mom>2.06) return kFALSE;
823 if (ttof > a2*mom+b2) return kFALSE;
824 if (ttof < a1*mom+b1) return kFALSE;
827 if (ttof > a2*mom+b2) return kFALSE;
828 if (ttof < a3*mom+b3) return kFALSE;
831 if (ttof > a4*mom+b4) return kFALSE;
832 if (ttof < a3*mom+b3) return kFALSE;
837 bool AliFemtoKKTrackCut::IsProtonTOFTime(float mom, float ttof)
839 double a1 = 000.0; double b1 = -915.0;
840 double a2 = 000.0; double b2 = 600.0;
841 double a3 = 572.0; double b3 = -1715.0;
843 if (mom<0.3) return kFALSE;
844 if (mom>3.0) return kFALSE;
846 if (ttof > a2*mom+b2) return kFALSE;
847 if (ttof < a1*mom+b1) return kFALSE;
850 if (ttof > a2*mom+b2) return kFALSE;
851 if (ttof < a3*mom+b3) return kFALSE;
859 bool AliFemtoKKTrackCut::IsKaonTPCdEdxNSigma(float mom, float nsigmaK)
861 // cout<<" AliFemtoKKTrackCut::IsKaonTPCdEdxNSigma "<<mom<<" "<<nsigmaK<<endl;
864 if(mom<0.35 && TMath::Abs(nsigmaK)<5.0)return true;
865 if(mom>=0.35 && mom<0.5 && TMath::Abs(nsigmaK)<3.0)return true;
866 if(mom>=0.5 && mom<0.7 && TMath::Abs(nsigmaK)<2.0)return true;
871 bool AliFemtoKKTrackCut::IsKaonTOFNSigma(float mom, float nsigmaK)
873 // cout<<" AliFemtoKKTrackCut::IsKaonTPCdEdxNSigma "<<mom<<" "<<nsigmaK<<endl;
875 // if(mom<1.5 && TMath::Abs(nsigmaK)<3.0)return true;
876 if(mom>=1.5 && TMath::Abs(nsigmaK)<2.0)return true;
881 bool AliFemtoKKTrackCut::IsKaonNSigma(float mom, float nsigmaTPCK, float nsigmaTOFK)
887 if(TMath::Abs(nsigmaTPCK)<2.0)
900 if(TMath::Abs(nsigmaTOFK)<3.0 && TMath::Abs(nsigmaTPCK)<3.0)
910 // if(mom>1.5 || mom<0.15)return false;
918 bool AliFemtoKKTrackCut::IsKaonNSigma(float mom, float nsigmaTPCK, float nsigmaTOFK)
925 if(TMath::Abs(nsigmaTPCK)<2.0) return true;
927 else if(TMath::Abs(nsigmaTOFK)<3.0 && TMath::Abs(nsigmaTPCK)<3.0) return true;
929 else if(mom>=0.4 && mom<=0.6)
933 if(TMath::Abs(nsigmaTPCK)<2.0) return true;
935 else if(TMath::Abs(nsigmaTOFK)<3.0 && TMath::Abs(nsigmaTPCK)<3.0) return true;
937 else if(nsigmaTOFK<-999.)
941 else if(TMath::Abs(nsigmaTOFK)<3.0 && TMath::Abs(nsigmaTPCK)<3.0) return true;
948 bool AliFemtoKKTrackCut::IsPionNSigma(float mom, float nsigmaTPCPi, float nsigmaTOFPi)
952 if(nsigmaTOFPi<-999.)
954 if(mom<0.35 && TMath::Abs(nsigmaTPCPi)<3.0) return true;
955 else if(mom<0.5 && mom>=0.35 && TMath::Abs(nsigmaTPCPi)<3.0) return true;
956 else if(mom>=0.5 && TMath::Abs(nsigmaTPCPi)<2.0) return true;
959 else if(TMath::Abs(nsigmaTOFPi)<3.0 && TMath::Abs(nsigmaTPCPi)<3.0) return true;
961 else if(nsigmaTOFPi<-999.)
965 else if(mom<1.5 && TMath::Abs(nsigmaTOFPi)<3.0 && TMath::Abs(nsigmaTPCPi)<5.0) return true;
966 else if(mom>=1.5 && TMath::Abs(nsigmaTOFPi)<2.0 && TMath::Abs(nsigmaTPCPi)<5.0) return true;
972 bool AliFemtoKKTrackCut::IsProtonNSigma(float mom, float nsigmaTPCP, float nsigmaTOFP)
975 if (TMath::Hypot( nsigmaTOFP, nsigmaTPCP )/TMath::Sqrt(2) < 3.0)
979 if (TMath::Abs(nsigmaTPCP) < 3.0)
987 void AliFemtoKKTrackCut::SetPIDMethod(ReadPIDMethodType newMethod)
989 fPIDMethod = newMethod;
993 void AliFemtoKKTrackCut::SetClusterRequirementITS(AliESDtrackCuts::Detector det, AliESDtrackCuts::ITSClusterRequirement req)
995 fCutClusterRequirementITS[det] = req;
998 Bool_t AliFemtoKKTrackCut::CheckITSClusterRequirement(AliESDtrackCuts::ITSClusterRequirement req, Bool_t clusterL1, Bool_t clusterL2)
1000 // checks if the cluster requirement is fullfilled (in this case: return kTRUE)
1004 case AliESDtrackCuts::kOff: return kTRUE;
1005 case AliESDtrackCuts::kNone: return !clusterL1 && !clusterL2;
1006 case AliESDtrackCuts::kAny: return clusterL1 || clusterL2;
1007 case AliESDtrackCuts::kFirst: return clusterL1;
1008 case AliESDtrackCuts::kOnlyFirst: return clusterL1 && !clusterL2;
1009 case AliESDtrackCuts::kSecond: return clusterL2;
1010 case AliESDtrackCuts::kOnlySecond: return clusterL2 && !clusterL1;
1011 case AliESDtrackCuts::kBoth: return clusterL1 && clusterL2;