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() :
93 fNsigmaTPC250_400(3.),
94 fNsigmaTPC400_450(3.),
95 fNsigmaTPC450_500(3.),
97 fNsigmaTOF500_800(3.),
98 fNsigmaTOF800_1000(3.),
103 fMaxITSchiNdof(1000.0),
104 fMaxTPCchiNdof(1000.0),
105 fMaxSigmaToVertex(1000.0),
108 fRemoveKinks(kFALSE),
109 fRemoveITSFake(kFALSE),
111 fMaxImpactXY(1000.0),
113 fMaxImpactXYPtOff(1000.0),
114 fMaxImpactXYPtNrm(1000.0),
115 fMaxImpactXYPtPow(1000.0),
117 fMaxPforTOFpid(10000.0),
119 fMaxPforTPCpid(10000.0),
121 fMaxPforITSpid(10000.0)
123 // Default constructor
124 fNTracksPassed = fNTracksFailed = 0;
125 fCharge = 0; // takes both charges 0
126 fPt[0]=0.0; fPt[1] = 100.0;//100
127 fRapidity[0]=-2; fRapidity[1]=2;//-2 2
128 fEta[0]=-2; fEta[1]=2;//-2 2
129 fPidProbElectron[0]=-1;fPidProbElectron[1]=2;
130 fPidProbPion[0]=-1; fPidProbPion[1]=2;
131 fPidProbKaon[0]=-1;fPidProbKaon[1]=2;
132 fPidProbProton[0]=-1;fPidProbProton[1]=2;
133 fPidProbMuon[0]=-1;fPidProbMuon[1]=2;
134 for (Int_t i = 0; i < 3; i++)
135 fCutClusterRequirementITS[i] = AliESDtrackCuts::kOff;
143 fNsigmaTPC250_400=3.0;
144 fNsigmaTPC400_450=3.0;
145 fNsigmaTPC450_500=3.0;
148 fNsigmaTOF500_800=3.0;
149 fNsigmaTOF800_1000=3.0;
150 fNsigmaTOFge1000=3.0;
155 //------------------------------
156 AliFemtoKKTrackCut::~AliFemtoKKTrackCut(){
159 //------------------------------
160 bool AliFemtoKKTrackCut::Pass(const AliFemtoTrack* track)
162 //cout<<"AliFemtoKKTrackCut::Pass"<<endl;
164 // test the particle and return
165 // true if it meets all the criteria
166 // false if it doesn't meet at least one of the criteria
169 //cout<<"AliKK cut"<<endl;
170 //cout<<fPidProbPion[0]<<" < pi ="<<track->PidProbPion()<<" <"<<fPidProbPion[1]<<endl;
173 //cout<<" status "<<track->Label()<<" "<<track->Flags()<<" "<<track->TPCnclsF()<<" "<<track->ITSncls()<<endl;
174 if ((track->Flags()&fStatus)!=fStatus)
176 // cout<<track->Flags()<<" "<<fStatus<<" no go through status"<<endl;
182 if ((track->KinkIndex(0)) || (track->KinkIndex(1)) || (track->KinkIndex(2)))
185 if (fRemoveITSFake) {
186 if (track->ITSncls() < 0)
189 if (fminTPCclsF>track->TPCnclsF())
191 //cout<<" No go because TPC Number of ClsF"<<fminTPCclsF<< " "<<track->TPCnclsF()<<endl;
194 if (fminTPCncls>track->TPCncls())
196 //cout<<" No go because TPC Number of ClsF"<<fminTPCclsF<< " "<<track->TPCnclsF()<<endl;
199 if (fminITScls>track->ITSncls())
201 //cout<<" No go because ITS Number of Cls"<<fminITScls<< " "<<track->ITSncls()<<endl;
205 if (fMaxImpactXY < TMath::Abs(track->ImpactD()))
208 if (fMaxImpactZ < TMath::Abs(track->ImpactZ()))
211 if (fMaxSigmaToVertex < track->SigmaToVertex()) {
215 if (track->ITSncls() > 0)
216 if ((track->ITSchi2()/track->ITSncls()) > fMaxITSchiNdof) {
220 if (track->TPCncls() > 0)
221 if ((track->TPCchi2()/track->TPCncls()) > fMaxTPCchiNdof) {
224 //ITS cluster requirenments
225 for (Int_t i = 0; i < 3; i++)
226 if(!CheckITSClusterRequirement(fCutClusterRequirementITS[i], track->HasPointOnITSLayer(i*2), track->HasPointOnITSLayer(i*2+1)))
231 //cout<<"labels"<<endl;
235 // cout<<"No Go Through the cut"<<endl;
236 // cout<<fLabel<<" Label="<<track->Label()<<endl;
242 //cout<<"AliKK cut ch "<<endl;
243 //cout<<fCharge<<" Charge="<<track->Charge()<<endl;
244 if (track->Charge()!= fCharge)
247 // cout<<"No Go Through the cut"<<endl;
248 // cout<<fCharge<<" Charge="<<track->Charge()<<endl;
256 Bool_t tTPCPidIn = (track->Flags()&AliFemtoTrack::kTPCpid)>0;
257 Bool_t tITSPidIn = (track->Flags()&AliFemtoTrack::kITSpid)>0;
258 Bool_t tTOFPidIn = (track->Flags()&AliFemtoTrack::kTOFpid)>0;
260 if(fMinPforTOFpid > 0 && track->P().Mag() > fMinPforTOFpid &&
261 track->P().Mag() < fMaxPforTOFpid && !tTOFPidIn)
267 if(fMinPforTPCpid > 0 && track->P().Mag() > fMinPforTPCpid &&
268 track->P().Mag() < fMaxPforTPCpid && !tTPCPidIn)
274 if(fMinPforITSpid > 0 && track->P().Mag() > fMinPforITSpid &&
275 track->P().Mag() < fMaxPforITSpid && !tITSPidIn)
282 float tEnergy = ::sqrt(track->P().Mag2()+fMass*fMass);
283 float tRapidity = 0.5*::log((tEnergy+track->P().z())/(tEnergy-track->P().z()));
284 float tPt = ::sqrt((track->P().x())*(track->P().x())+(track->P().y())*(track->P().y()));
285 float tEta = track->P().PseudoRapidity();
287 if (fMaxImpactXYPtOff < 999.0) {
288 if ((fMaxImpactXYPtOff + fMaxImpactXYPtNrm*TMath::Power(tPt, fMaxImpactXYPtPow)) < TMath::Abs(track->ImpactD())) {
294 if ((tRapidity<fRapidity[0])||(tRapidity>fRapidity[1]))
297 //cout<<"No Go Through the cut"<<endl;
298 //cout<<fRapidity[0]<<" < Rapidity ="<<tRapidity<<" <"<<fRapidity[1]<<endl;
301 if ((tEta<fEta[0])||(tEta>fEta[1]))
304 //cout<<"No Go Through the cut"<<endl;
305 //cout<<fEta[0]<<" < Eta ="<<tEta<<" <"<<fEta[1]<<endl;
308 if ((tPt<fPt[0])||(tPt>fPt[1]))
311 //cout<<"No Go Through the cut"<<endl;
312 //cout<<fPt[0]<<" < Pt ="<<Pt<<" <"<<fPt[1]<<endl;
319 // cout << "Track has pids: "
320 // << track->PidProbElectron() << " "
321 // << track->PidProbMuon() << " "
322 // << track->PidProbPion() << " "
323 // << track->PidProbKaon() << " "
324 // << track->PidProbProton() << " "
325 // << track->PidProbElectron()+track->PidProbMuon()+track->PidProbPion()+track->PidProbKaon()+track->PidProbProton() << endl;
328 if ((track->PidProbElectron()<fPidProbElectron[0])||(track->PidProbElectron()>fPidProbElectron[1]))
331 //cout<<"No Go Through the cut"<<endl;
332 //cout<<fPidProbElectron[0]<<" < e ="<<track->PidProbElectron()<<" <"<<fPidProbElectron[1]<<endl;
335 if ((track->PidProbPion()<fPidProbPion[0])||(track->PidProbPion()>fPidProbPion[1]))
338 //cout<<"No Go Through the cut"<<endl;
339 //cout<<fPidProbPion[0]<<" < pi ="<<track->PidProbPion()<<" <"<<fPidProbPion[1]<<endl;
342 if ((track->PidProbKaon()<fPidProbKaon[0])||(track->PidProbKaon()>fPidProbKaon[1]))
345 //cout<<"No Go Through the cut"<<endl;
346 //cout<<fPidProbKaon[0]<<" < k ="<<track->PidProbKaon()<<" <"<<fPidProbKaon[1]<<endl;
349 if ((track->PidProbProton()<fPidProbProton[0])||(track->PidProbProton()>fPidProbProton[1]))
352 //cout<<"No Go Through the cut"<<endl;
353 //cout<<fPidProbProton[0]<<" < p ="<<track->PidProbProton()<<" <"<<fPidProbProton[1]<<endl;
356 if ((track->PidProbMuon()<fPidProbMuon[0])||(track->PidProbMuon()>fPidProbMuon[1]))
359 //cout<<"No Go Through the cut"<<endl;
360 //cout<<fPidProbMuon[0]<<" < mi="<<track->PidProbMuon()<<" <"<<fPidProbMuon[1]<<endl;
367 tMost[0] = track->PidProbElectron()*PidFractionElectron(track->P().Mag());
369 tMost[2] = track->PidProbPion()*PidFractionPion(track->P().Mag());
370 tMost[3] = track->PidProbKaon()*PidFractionKaon(track->P().Mag());
371 tMost[4] = track->PidProbProton()*PidFractionProton(track->P().Mag());
375 //****N Sigma Method****
378 if (fMostProbable == 2) {
379 if (IsPionNSigma(track->P().Mag(), track->NSigmaTPCPi(), track->NSigmaTOFPi()))
383 else if (fMostProbable == 3) {
386 if (IsKaonNSigma(track->P().Mag(), track->NSigmaTPCK(), track->NSigmaTOFK())){
392 else if (fMostProbable == 4) { // proton nsigma-PID required contour adjusting
393 if (IsProtonNSigma(track->P().Mag(), track->NSigmaTPCP(), track->NSigmaTOFP()) // && IsProtonTPCdEdx(track->P().Mag(), track->TPCsignal())
402 //****Contour Method****
404 for (int ip=0; ip<5; ip++)
405 if (tMost[ip] > ipidmax) { ipidmax = tMost[ip]; imost = ip; };
408 if (fMostProbable == 2) {
410 // Using the TPC to reject non-pions
411 if (!(IsPionTPCdEdx(track->P().Mag(), track->TPCsignal())))
414 // Using the TOF to reject non-pions
415 if (track->P().Mag() < 0.6) {
417 if (!IsPionTOFTime(track->P().Mag(), track->TOFpionTime()))
422 if (!IsPionTOFTime(track->P().Mag(), track->TOFpionTime()))
434 else if (fMostProbable == 3) {
436 // Using the TPC to reject non-kaons
437 if (track->P().Mag() < 0.6) {
438 if (!(IsKaonTPCdEdx(track->P().Mag(), track->TPCsignal())))
442 // Using the TOF to reject non-kaons
444 if (!IsKaonTOFTime(track->P().Mag(), track->TOFkaonTime()))
451 if (!IsKaonTOFTime(track->P().Mag(), track->TOFkaonTime()))
457 if (!(IsKaonTPCdEdx(track->P().Mag(), track->TPCsignal())))
467 // Looking for protons
468 else if (fMostProbable == 4) {
470 // Using the TPC to reject non-kaons
471 if (track->P().Mag() < 0.8) {
472 if (!(IsProtonTPCdEdx(track->P().Mag(), track->TPCsignal())))
476 // Using the TOF to reject non-kaons
478 if (!IsKaonTOFTime(track->P().Mag(), track->TOFkaonTime()))
485 if (!IsKaonTOFTime(track->P().Mag(), track->TOFkaonTime()))
491 if (!(IsKaonTPCdEdx(track->P().Mag(), track->TPCsignal())))
501 if (imost != fMostProbable) return false;
505 //cout<<"****** Go Through the cut ******"<<endl;
506 // cout<<fLabel<<" Label="<<track->Label()<<endl;
507 // cout<<fCharge<<" Charge="<<track->Charge()<<endl;
508 // cout<<fPt[0]<<" < Pt ="<<Pt<<" <"<<fPt[1]<<endl;
509 //cout<<fRapidity[0]<<" < Rapidity ="<<tRapidity<<" <"<<fRapidity[1]<<endl;
510 //cout<<fPidProbElectron[0]<<" < e="<<track->PidProbElectron()<<" <"<<fPidProbElectron[1]<<endl;
511 //cout<<fPidProbPion[0]<<" < pi="<<track->PidProbPion()<<" <"<<fPidProbPion[1]<<endl;
512 //cout<<fPidProbKaon[0]<<" < k="<<track->PidProbKaon()<<" <"<<fPidProbKaon[1]<<endl;
513 //cout<<fPidProbProton[0]<<" < p="<<track->PidProbProton()<<" <"<<fPidProbProton[1]<<endl;
514 //cout<<fPidProbMuon[0]<<" < mi="<<track->PidProbMuon()<<" <"<<fPidProbMuon[1]<<endl;
520 //------------------------------
521 AliFemtoString AliFemtoKKTrackCut::Report()
523 // Prepare report from the execution
526 snprintf(tCtemp , 100, "Particle mass:\t%E\n",this->Mass());
528 snprintf(tCtemp , 100, "Particle charge:\t%d\n",fCharge);
530 snprintf(tCtemp , 100, "Particle pT:\t%E - %E\n",fPt[0],fPt[1]);
532 snprintf(tCtemp , 100, "Particle rapidity:\t%E - %E\n",fRapidity[0],fRapidity[1]);
534 snprintf(tCtemp , 100, "Particle eta:\t%E - %E\n",fEta[0],fEta[1]);
536 snprintf(tCtemp , 100, "Number of tracks which passed:\t%ld Number which failed:\t%ld\n",fNTracksPassed,fNTracksFailed);
538 AliFemtoString returnThis = tStemp;
541 TList *AliFemtoKKTrackCut::ListSettings()
543 // return a list of settings in a writable form
544 TList *tListSetttings = new TList();
546 snprintf(buf, 200, "AliFemtoKKTrackCut.mass=%f", this->Mass());
547 tListSetttings->AddLast(new TObjString(buf));
549 snprintf(buf, 200, "AliFemtoKKTrackCut.charge=%i", fCharge);
550 tListSetttings->AddLast(new TObjString(buf));
551 snprintf(buf, 200, "AliFemtoKKTrackCut.pidprobpion.minimum=%f", fPidProbPion[0]);
552 tListSetttings->AddLast(new TObjString(buf));
553 snprintf(buf, 200, "AliFemtoKKTrackCut.pidprobpion.maximum=%f", fPidProbPion[1]);
554 tListSetttings->AddLast(new TObjString(buf));
555 snprintf(buf, 200, "AliFemtoKKTrackCut.pidprobkaon.minimum=%f", fPidProbKaon[0]);
556 tListSetttings->AddLast(new TObjString(buf));
557 snprintf(buf, 200, "AliFemtoKKTrackCut.pidprobkaon.maximum=%f", fPidProbKaon[1]);
558 tListSetttings->AddLast(new TObjString(buf));
559 snprintf(buf, 200, "AliFemtoKKTrackCut.pidprobproton.minimum=%f", fPidProbProton[0]);
560 tListSetttings->AddLast(new TObjString(buf));
561 snprintf(buf, 200, "AliFemtoKKTrackCut.pidprobproton.maximum=%f", fPidProbProton[1]);
562 tListSetttings->AddLast(new TObjString(buf));
563 snprintf(buf, 200, "AliFemtoKKTrackCut.pidprobelectron.minimum=%f", fPidProbElectron[0]);
564 tListSetttings->AddLast(new TObjString(buf));
565 snprintf(buf, 200, "AliFemtoKKTrackCut.pidprobelectron.maximum=%f", fPidProbElectron[1]);
566 tListSetttings->AddLast(new TObjString(buf));
567 snprintf(buf, 200, "AliFemtoKKTrackCut.pidprobMuon.minimum=%f", fPidProbMuon[0]);
568 tListSetttings->AddLast(new TObjString(buf));
569 snprintf(buf, 200, "AliFemtoKKTrackCut.pidprobMuon.maximum=%f", fPidProbMuon[1]);
570 tListSetttings->AddLast(new TObjString(buf));
571 snprintf(buf, 200, "AliFemtoKKTrackCut.minimumtpcclusters=%i", fminTPCclsF);
572 tListSetttings->AddLast(new TObjString(buf));
573 snprintf(buf, 200, "AliFemtoKKTrackCut.minimumitsclusters=%i", fminTPCclsF);
574 tListSetttings->AddLast(new TObjString(buf));
575 snprintf(buf, 200, "AliFemtoKKTrackCut.pt.minimum=%f", fPt[0]);
576 tListSetttings->AddLast(new TObjString(buf));
577 snprintf(buf, 200, "AliFemtoKKTrackCut.pt.maximum=%f", fPt[1]);
578 tListSetttings->AddLast(new TObjString(buf));
579 snprintf(buf, 200, "AliFemtoKKTrackCut.rapidity.minimum=%f", fRapidity[0]);
580 tListSetttings->AddLast(new TObjString(buf));
581 snprintf(buf, 200, "AliFemtoKKTrackCut.rapidity.maximum=%f", fRapidity[1]);
582 tListSetttings->AddLast(new TObjString(buf));
583 snprintf(buf, 200, "AliFemtoKKTrackCut.removekinks=%i", fRemoveKinks);
584 tListSetttings->AddLast(new TObjString(buf));
585 snprintf(buf, 200, "AliFemtoKKTrackCut.maxitschindof=%f", fMaxITSchiNdof);
586 tListSetttings->AddLast(new TObjString(buf));
587 snprintf(buf, 200, "AliFemtoKKTrackCut.maxtpcchindof=%f", fMaxTPCchiNdof);
588 tListSetttings->AddLast(new TObjString(buf));
589 snprintf(buf, 200, "AliFemtoKKTrackCut.maxsigmatovertex=%f", fMaxSigmaToVertex);
590 tListSetttings->AddLast(new TObjString(buf));
591 snprintf(buf, 200, "AliFemtoKKTrackCut.maximpactxy=%f", fMaxImpactXY);
592 tListSetttings->AddLast(new TObjString(buf));
593 snprintf(buf, 200, "AliFemtoKKTrackCut.maximpactz=%f", fMaxImpactZ);
594 tListSetttings->AddLast(new TObjString(buf));
596 if (fMostProbable == 2)
597 snprintf(buf, 200, "AliFemtoKKTrackCut.mostprobable=%s", "Pion");
598 if (fMostProbable == 3)
599 snprintf(buf, 200, "AliFemtoKKTrackCut.mostprobable=%s", "Kaon");
600 if (fMostProbable == 4)
601 snprintf(buf, 200, "AliFemtoKKTrackCut.mostprobable=%s", "Proton");
602 tListSetttings->AddLast(new TObjString(buf));
604 return tListSetttings;
606 void AliFemtoKKTrackCut::SetRemoveKinks(const bool& flag)
611 void AliFemtoKKTrackCut::SetRemoveITSFake(const bool& flag)
613 fRemoveITSFake = flag;
618 // 0 7.594129e-02 8.256141e-03
619 // 1 -5.535827e-01 8.170825e-02
620 // 2 1.728591e+00 3.104210e-01
621 // 3 -2.827893e+00 5.827802e-01
622 // 4 2.503553e+00 5.736207e-01
623 // 5 -1.125965e+00 2.821170e-01
624 // 6 2.009036e-01 5.438876e-02
625 float AliFemtoKKTrackCut::PidFractionElectron(float mom) const
627 // Provide a parameterized fraction of electrons dependent on momentum
631 +1.728591e+00*0.13*0.13
632 -2.827893e+00*0.13*0.13*0.13
633 +2.503553e+00*0.13*0.13*0.13*0.13
634 -1.125965e+00*0.13*0.13*0.13*0.13*0.13
635 +2.009036e-01*0.13*0.13*0.13*0.13*0.13*0.13);
640 +1.728591e+00*1.8*1.8
641 -2.827893e+00*1.8*1.8*1.8
642 +2.503553e+00*1.8*1.8*1.8*1.8
643 -1.125965e+00*1.8*1.8*1.8*1.8*1.8
644 +2.009036e-01*1.8*1.8*1.8*1.8*1.8*1.8);
647 +1.728591e+00*mom*mom
648 -2.827893e+00*mom*mom*mom
649 +2.503553e+00*mom*mom*mom*mom
650 -1.125965e+00*mom*mom*mom*mom*mom
651 +2.009036e-01*mom*mom*mom*mom*mom*mom);
656 // 0 1.063457e+00 8.872043e-03
657 // 1 -4.222208e-01 2.534402e-02
658 // 2 1.042004e-01 1.503945e-02
659 float AliFemtoKKTrackCut::PidFractionPion(float mom) const
661 // Provide a parameterized fraction of pions dependent on momentum
663 return ( 1.063457e+00
665 +1.042004e-01*0.0169);
667 return ( 1.063457e+00
670 return ( 1.063457e+00
672 +1.042004e-01*mom*mom);
677 // 0 -7.289406e-02 1.686074e-03
678 // 1 4.415666e-01 1.143939e-02
679 // 2 -2.996790e-01 1.840964e-02
680 // 3 6.704652e-02 7.783990e-03
681 float AliFemtoKKTrackCut::PidFractionKaon(float mom) const
683 // Provide a parameterized fraction of kaons dependent on momentum
685 return (-7.289406e-02
687 -2.996790e-01*0.18*0.18
688 +6.704652e-02*0.18*0.18*0.18);
690 return (-7.289406e-02
692 -2.996790e-01*2.0*2.0
693 +6.704652e-02*2.0*2.0*2.0);
694 return (-7.289406e-02
696 -2.996790e-01*mom*mom
697 +6.704652e-02*mom*mom*mom);
702 // 0 -3.730200e-02 2.347311e-03
703 // 1 1.163684e-01 1.319316e-02
704 // 2 8.354116e-02 1.997948e-02
705 // 3 -4.608098e-02 8.336400e-03
706 float AliFemtoKKTrackCut::PidFractionProton(float mom) const
708 // Provide a parameterized fraction of protons dependent on momentum
709 if (mom<0.26) return 0.0;
711 return (-3.730200e-02
713 +8.354116e-02*2.0*2.0
714 -4.608098e-02*2.0*2.0*2.0);
715 return (-3.730200e-02
717 +8.354116e-02*mom*mom
718 -4.608098e-02*mom*mom*mom);
721 void AliFemtoKKTrackCut::SetMomRangeTOFpidIs(const float& minp, const float& maxp)
723 fMinPforTOFpid = minp;
724 fMaxPforTOFpid = maxp;
727 void AliFemtoKKTrackCut::SetMomRangeTPCpidIs(const float& minp, const float& maxp)
729 fMinPforTPCpid = minp;
730 fMaxPforTPCpid = maxp;
733 void AliFemtoKKTrackCut::SetMomRangeITSpidIs(const float& minp, const float& maxp)
735 fMinPforITSpid = minp;
736 fMaxPforITSpid = maxp;
739 bool AliFemtoKKTrackCut::IsPionTPCdEdx(float mom, float dEdx)
741 // double a1 = -95.4545, b1 = 86.5455;
742 // double a2 = 0.0, b2 = 56.0;
743 double a1 = -343.75, b1 = 168.125;
744 double a2 = 0.0, b2 = 65.0;
747 if (dEdx < a1*mom+b1) return true;
749 if (dEdx < a2*mom+b2) return true;
754 bool AliFemtoKKTrackCut::IsKaonTPCdEdx(float mom, float dEdx)
757 // double a1 = -547.0; double b1 = 297.0;
758 // double a2 = -125.0; double b2 = 145.0;
759 // double a3 = -420.0; double b3 = 357.0;
760 // double a4 = -110.0; double b4 = 171.0;
763 // if (mom<0.2) return false;
766 // if (dEdx < a1*mom+b1) return false;
767 // if (dEdx > a3*mom+b3) return false;
769 // else if (mom<0.6) {
770 // if (dEdx < a2*mom+b2) return false;
771 // if (dEdx > a3*mom+b3) return false;
773 // else if (mom<0.9) {
774 // if (dEdx > a4*mom+b4) return false;
775 // if (dEdx < b5) return false;
780 // // if (dEdx > b5) return false;
785 double a1 = -268.896; double b1 = 198.669;
786 double a2 = -49.0012; double b2 = 88.7214;
788 if (mom<0.2) return false;
790 if (mom>0.3 && mom<0.5) {
791 if (dEdx < a1*mom+b1) return false;
794 if (dEdx < a2*mom+b2) return false;
801 bool AliFemtoKKTrackCut::IsProtonTPCdEdx(float mom, float dEdx)
803 double a1 = -1800.0; double b1 = 940.0;
804 double a2 = -500.0; double b2 = 420.0;
805 double a3 = -216.7; double b3 = 250.0;
807 if (mom<0.2) return false;
809 if (mom>0.3 && mom<0.4) {
810 if (dEdx < a1*mom+b1) return false;
813 if (dEdx < a2*mom+b2) return false;
816 if (dEdx < a3*mom+b3) return false;
823 bool AliFemtoKKTrackCut::IsPionTOFTime(float mom, float ttof)
825 double a1 = -427.0; double b1 = 916.0;
826 double a2 = 327.0; double b2 = -888.0;
827 if (mom<0.3) return kFALSE;
828 if (mom>2.0) return kFALSE;
829 if (ttof > a1*mom+b1) return kFALSE;
830 if (ttof < a2*mom+b2) return kFALSE;
835 bool AliFemtoKKTrackCut::IsKaonTOFTime(float mom, float ttof)
837 double a1 = 000.0; double b1 = -500.0;
838 double a2 = 000.0; double b2 = 500.0;
839 double a3 = 850.0; double b3 = -1503.0;
840 double a4 = -1637.0; double b4 = 3621.0;
842 if (mom<0.3) return kFALSE;
843 if (mom>2.06) return kFALSE;
845 if (ttof > a2*mom+b2) return kFALSE;
846 if (ttof < a1*mom+b1) return kFALSE;
849 if (ttof > a2*mom+b2) return kFALSE;
850 if (ttof < a3*mom+b3) return kFALSE;
853 if (ttof > a4*mom+b4) return kFALSE;
854 if (ttof < a3*mom+b3) return kFALSE;
859 bool AliFemtoKKTrackCut::IsProtonTOFTime(float mom, float ttof)
861 double a1 = 000.0; double b1 = -915.0;
862 double a2 = 000.0; double b2 = 600.0;
863 double a3 = 572.0; double b3 = -1715.0;
865 if (mom<0.3) return kFALSE;
866 if (mom>3.0) return kFALSE;
868 if (ttof > a2*mom+b2) return kFALSE;
869 if (ttof < a1*mom+b1) return kFALSE;
872 if (ttof > a2*mom+b2) return kFALSE;
873 if (ttof < a3*mom+b3) return kFALSE;
881 bool AliFemtoKKTrackCut::IsKaonTPCdEdxNSigma(float mom, float nsigmaK)
883 // cout<<" AliFemtoKKTrackCut::IsKaonTPCdEdxNSigma "<<mom<<" "<<nsigmaK<<endl;
886 if(mom<0.35 && TMath::Abs(nsigmaK)<5.0)return true;
887 if(mom>=0.35 && mom<0.5 && TMath::Abs(nsigmaK)<3.0)return true;
888 if(mom>=0.5 && mom<0.7 && TMath::Abs(nsigmaK)<2.0)return true;
893 bool AliFemtoKKTrackCut::IsKaonTOFNSigma(float mom, float nsigmaK)
895 // cout<<" AliFemtoKKTrackCut::IsKaonTPCdEdxNSigma "<<mom<<" "<<nsigmaK<<endl;
897 // if(mom<1.5 && TMath::Abs(nsigmaK)<3.0)return true;
898 if(mom>=1.5 && TMath::Abs(nsigmaK)<2.0)return true;
903 bool AliFemtoKKTrackCut::IsKaonNSigma(float mom, float nsigmaTPCK, float nsigmaTOFK)
908 if(TMath::Abs(nsigmaTPCK)<fNsigmaTPCle250)
918 if(mom>=0.25 && mom<0.4)
920 if(TMath::Abs(nsigmaTPCK)<fNsigmaTPC250_400)
930 if(mom>=0.4 && mom<0.45)
932 if(TMath::Abs(nsigmaTPCK)<fNsigmaTPC400_450)
942 if(mom>=0.45 && mom<0.5)
944 if(TMath::Abs(nsigmaTPCK)<fNsigmaTPC450_500)
958 if(mom>=0.5 && mom<0.8)
960 if(TMath::Abs(nsigmaTOFK)<fNsigmaTOF500_800 && TMath::Abs(nsigmaTPCK)<fNsigmaTPCge500)
962 // cout<<"500-800 "<<fNsigmaTOF500_800<<" "<<nsigmaTOFK<<endl;
971 if(mom>=0.8 && mom<1.0)
973 if(TMath::Abs(nsigmaTOFK)<fNsigmaTOF800_1000 && TMath::Abs(nsigmaTPCK)<fNsigmaTPCge500)
975 // cout<<"800-1000 "<<fNsigmaTOF800_1000<<" "<<nsigmaTOFK<<endl;
986 if(TMath::Abs(nsigmaTOFK)<fNsigmaTOFge1000 && TMath::Abs(nsigmaTPCK)<fNsigmaTPCge500)
988 // cout<<">1000 "<<fNsigmaTOFge1000<<" "<<nsigmaTOFK<<endl;
999 // if(mom>1.5 || mom<0.15)return false;
1007 bool AliFemtoKKTrackCut::IsKaonNSigma(float mom, float nsigmaTPCK, float nsigmaTOFK)
1012 if(nsigmaTOFK<-999.)
1014 if(TMath::Abs(nsigmaTPCK)<2.0) return true;
1016 else if(TMath::Abs(nsigmaTOFK)<3.0 && TMath::Abs(nsigmaTPCK)<3.0) return true;
1018 else if(mom>=0.4 && mom<=0.6)
1020 if(nsigmaTOFK<-999.)
1022 if(TMath::Abs(nsigmaTPCK)<2.0) return true;
1024 else if(TMath::Abs(nsigmaTOFK)<3.0 && TMath::Abs(nsigmaTPCK)<3.0) return true;
1026 else if(nsigmaTOFK<-999.)
1030 else if(TMath::Abs(nsigmaTOFK)<3.0 && TMath::Abs(nsigmaTPCK)<3.0) return true;
1037 bool AliFemtoKKTrackCut::IsPionNSigma(float mom, float nsigmaTPCPi, float nsigmaTOFPi)
1041 if(nsigmaTOFPi<-999.)
1043 if(mom<0.35 && TMath::Abs(nsigmaTPCPi)<3.0) return true;
1044 else if(mom<0.5 && mom>=0.35 && TMath::Abs(nsigmaTPCPi)<3.0) return true;
1045 else if(mom>=0.5 && TMath::Abs(nsigmaTPCPi)<2.0) return true;
1048 else if(TMath::Abs(nsigmaTOFPi)<3.0 && TMath::Abs(nsigmaTPCPi)<3.0) return true;
1050 else if(nsigmaTOFPi<-999.)
1054 else if(mom<1.5 && TMath::Abs(nsigmaTOFPi)<3.0 && TMath::Abs(nsigmaTPCPi)<5.0) return true;
1055 else if(mom>=1.5 && TMath::Abs(nsigmaTOFPi)<2.0 && TMath::Abs(nsigmaTPCPi)<5.0) return true;
1061 bool AliFemtoKKTrackCut::IsProtonNSigma(float mom, float nsigmaTPCP, float nsigmaTOFP)
1064 if (TMath::Hypot( nsigmaTOFP, nsigmaTPCP )/TMath::Sqrt(2) < 3.0)
1068 if (TMath::Abs(nsigmaTPCP) < 3.0)
1076 void AliFemtoKKTrackCut::SetPIDMethod(ReadPIDMethodType newMethod)
1078 fPIDMethod = newMethod;
1082 void AliFemtoKKTrackCut::SetClusterRequirementITS(AliESDtrackCuts::Detector det, AliESDtrackCuts::ITSClusterRequirement req)
1084 fCutClusterRequirementITS[det] = req;
1087 Bool_t AliFemtoKKTrackCut::CheckITSClusterRequirement(AliESDtrackCuts::ITSClusterRequirement req, Bool_t clusterL1, Bool_t clusterL2)
1089 // checks if the cluster requirement is fullfilled (in this case: return kTRUE)
1093 case AliESDtrackCuts::kOff: return kTRUE;
1094 case AliESDtrackCuts::kNone: return !clusterL1 && !clusterL2;
1095 case AliESDtrackCuts::kAny: return clusterL1 || clusterL2;
1096 case AliESDtrackCuts::kFirst: return clusterL1;
1097 case AliESDtrackCuts::kOnlyFirst: return clusterL1 && !clusterL2;
1098 case AliESDtrackCuts::kSecond: return clusterL2;
1099 case AliESDtrackCuts::kOnlySecond: return clusterL2 && !clusterL1;
1100 case AliESDtrackCuts::kBoth: return clusterL1 && clusterL2;
1107 void AliFemtoKKTrackCut::SetNsigmaTPCle250(Double_t nsigma)
1109 fNsigmaTPCle250 = nsigma;
1112 void AliFemtoKKTrackCut::SetNsigmaTPC250_400(Double_t nsigma)
1114 fNsigmaTPC250_400 = nsigma;
1117 void AliFemtoKKTrackCut::SetNsigmaTPC400_450(Double_t nsigma)
1119 fNsigmaTPC400_450 = nsigma;
1122 void AliFemtoKKTrackCut::SetNsigmaTPC450_500(Double_t nsigma)
1124 fNsigmaTPC450_500 = nsigma;
1127 void AliFemtoKKTrackCut::SetNsigmaTPCge500(Double_t nsigma)
1129 fNsigmaTPCge500 = nsigma;
1134 void AliFemtoKKTrackCut::SetNsigmaTOF500_800(Double_t nsigma)
1136 fNsigmaTOF500_800 = nsigma;
1140 void AliFemtoKKTrackCut::SetNsigmaTOF800_1000(Double_t nsigma)
1142 fNsigmaTOF800_1000 = nsigma;
1145 void AliFemtoKKTrackCut::SetNsigmaTOFge1000(Double_t nsigma)
1147 fNsigmaTOFge1000 = nsigma;