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() :
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;
131 //------------------------------
132 AliFemtoESDTrackCut::~AliFemtoESDTrackCut(){
135 //------------------------------
136 bool AliFemtoESDTrackCut::Pass(const AliFemtoTrack* track)
138 // test the particle and return
139 // true if it meets all the criteria
140 // false if it doesn't meet at least one of the criteria
143 //cout<<"AliFemtoESD cut"<<endl;
144 //cout<<fPidProbPion[0]<<" < pi ="<<track->PidProbPion()<<" <"<<fPidProbPion[1]<<endl;
147 //cout<<" status "<<track->Label()<<" "<<track->Flags()<<" "<<track->TPCnclsF()<<" "<<track->ITSncls()<<endl;
148 if ((track->Flags()&fStatus)!=fStatus)
150 // cout<<track->Flags()<<" "<<fStatus<<" no go through status"<<endl;
156 if ((track->KinkIndex(0)) || (track->KinkIndex(1)) || (track->KinkIndex(2)))
159 if (fRemoveITSFake) {
160 if (track->ITSncls() < 0)
163 if (fminTPCclsF>track->TPCnclsF())
165 //cout<<" No go because TPC Number of ClsF"<<fminTPCclsF<< " "<<track->TPCnclsF()<<endl;
168 if (fminTPCncls>track->TPCncls())
170 //cout<<" No go because TPC Number of ClsF"<<fminTPCclsF<< " "<<track->TPCnclsF()<<endl;
173 if (fminITScls>track->ITSncls())
175 //cout<<" No go because ITS Number of Cls"<<fminITScls<< " "<<track->ITSncls()<<endl;
179 if (fMaxImpactXY < TMath::Abs(track->ImpactD()))
182 if (fMaxImpactZ < TMath::Abs(track->ImpactZ()))
185 if (fMaxSigmaToVertex < track->SigmaToVertex()) {
189 if (track->ITSncls() > 0)
190 if ((track->ITSchi2()/track->ITSncls()) > fMaxITSchiNdof) {
194 if (track->TPCncls() > 0)
195 if ((track->TPCchi2()/track->TPCncls()) > fMaxTPCchiNdof) {
201 //cout<<"labels"<<endl;
205 // cout<<"No Go Through the cut"<<endl;
206 // cout<<fLabel<<" Label="<<track->Label()<<endl;
212 //cout<<"AliFemtoESD cut ch "<<endl;
213 //cout<<fCharge<<" Charge="<<track->Charge()<<endl;
214 if (track->Charge()!= fCharge)
217 // cout<<"No Go Through the cut"<<endl;
218 // cout<<fCharge<<" Charge="<<track->Charge()<<endl;
222 Bool_t tTPCPidIn = (track->Flags()&AliFemtoTrack::kTPCpid)>0;
223 Bool_t tITSPidIn = (track->Flags()&AliFemtoTrack::kITSpid)>0;
224 Bool_t tTOFPidIn = (track->Flags()&AliFemtoTrack::kTOFpid)>0;
226 if(fMinPforTOFpid > 0 && track->P().Mag() > fMinPforTOFpid &&
227 track->P().Mag() < fMaxPforTOFpid && !tTOFPidIn)
233 if(fMinPforTPCpid > 0 && track->P().Mag() > fMinPforTPCpid &&
234 track->P().Mag() < fMaxPforTPCpid && !tTPCPidIn)
240 if(fMinPforITSpid > 0 && track->P().Mag() > fMinPforITSpid &&
241 track->P().Mag() < fMaxPforITSpid && !tITSPidIn)
248 float tEnergy = ::sqrt(track->P().Mag2()+fMass*fMass);
249 float tRapidity = 0.5*::log((tEnergy+track->P().z())/(tEnergy-track->P().z()));
250 float tPt = ::sqrt((track->P().x())*(track->P().x())+(track->P().y())*(track->P().y()));
251 float tEta = track->P().PseudoRapidity();
253 if (fMaxImpactXYPtOff < 999.0) {
254 if ((fMaxImpactXYPtOff + fMaxImpactXYPtNrm*TMath::Power(tPt, fMaxImpactXYPtPow)) < TMath::Abs(track->ImpactD())) {
260 if ((tRapidity<fRapidity[0])||(tRapidity>fRapidity[1]))
263 //cout<<"No Go Through the cut"<<endl;
264 //cout<<fRapidity[0]<<" < Rapidity ="<<tRapidity<<" <"<<fRapidity[1]<<endl;
267 if ((tEta<fEta[0])||(tEta>fEta[1]))
270 //cout<<"No Go Through the cut"<<endl;
271 //cout<<fEta[0]<<" < Eta ="<<tEta<<" <"<<fEta[1]<<endl;
274 if ((tPt<fPt[0])||(tPt>fPt[1]))
277 //cout<<"No Go Through the cut"<<endl;
278 //cout<<fPt[0]<<" < Pt ="<<Pt<<" <"<<fPt[1]<<endl;
281 // cout << "Track has pids: "
282 // << track->PidProbElectron() << " "
283 // << track->PidProbMuon() << " "
284 // << track->PidProbPion() << " "
285 // << track->PidProbKaon() << " "
286 // << track->PidProbProton() << " "
287 // << track->PidProbElectron()+track->PidProbMuon()+track->PidProbPion()+track->PidProbKaon()+track->PidProbProton() << endl;
290 if ((track->PidProbElectron()<fPidProbElectron[0])||(track->PidProbElectron()>fPidProbElectron[1]))
293 //cout<<"No Go Through the cut"<<endl;
294 //cout<<fPidProbElectron[0]<<" < e ="<<track->PidProbElectron()<<" <"<<fPidProbElectron[1]<<endl;
297 if ((track->PidProbPion()<fPidProbPion[0])||(track->PidProbPion()>fPidProbPion[1]))
300 //cout<<"No Go Through the cut"<<endl;
301 //cout<<fPidProbPion[0]<<" < pi ="<<track->PidProbPion()<<" <"<<fPidProbPion[1]<<endl;
304 if ((track->PidProbKaon()<fPidProbKaon[0])||(track->PidProbKaon()>fPidProbKaon[1]))
307 //cout<<"No Go Through the cut"<<endl;
308 //cout<<fPidProbKaon[0]<<" < k ="<<track->PidProbKaon()<<" <"<<fPidProbKaon[1]<<endl;
311 if ((track->PidProbProton()<fPidProbProton[0])||(track->PidProbProton()>fPidProbProton[1]))
314 //cout<<"No Go Through the cut"<<endl;
315 //cout<<fPidProbProton[0]<<" < p ="<<track->PidProbProton()<<" <"<<fPidProbProton[1]<<endl;
318 if ((track->PidProbMuon()<fPidProbMuon[0])||(track->PidProbMuon()>fPidProbMuon[1]))
321 //cout<<"No Go Through the cut"<<endl;
322 //cout<<fPidProbMuon[0]<<" < mi="<<track->PidProbMuon()<<" <"<<fPidProbMuon[1]<<endl;
328 tMost[0] = track->PidProbElectron()*PidFractionElectron(track->P().Mag());
330 tMost[2] = track->PidProbPion()*PidFractionPion(track->P().Mag());
331 tMost[3] = track->PidProbKaon()*PidFractionKaon(track->P().Mag());
332 tMost[4] = track->PidProbProton()*PidFractionProton(track->P().Mag());
336 //****N Sigma Method****
339 if (fMostProbable == 2) {
340 if (IsPionNSigma(track->P().Mag(), track->NSigmaTPCPi(), track->NSigmaTOFPi()))
344 else if (fMostProbable == 3) {
345 if (IsKaonNSigma(track->P().Mag(), track->NSigmaTPCK(), track->NSigmaTOFK())){
350 else if (fMostProbable == 4) { // proton nsigma-PID required contour adjusting
351 if (IsProtonNSigma(track->P().Mag(), track->NSigmaTPCP(), track->NSigmaTOFP()) && IsProtonTPCdEdx(track->P().Mag(), track->TPCsignal()))
357 //****Contour Method****
359 for (int ip=0; ip<5; ip++)
360 if (tMost[ip] > ipidmax) { ipidmax = tMost[ip]; imost = ip; };
363 if (fMostProbable == 2) {
365 // Using the TPC to reject non-pions
366 if (!(IsPionTPCdEdx(track->P().Mag(), track->TPCsignal())))
369 // Using the TOF to reject non-pions
370 if (track->P().Mag() < 0.6) {
372 if (!IsPionTOFTime(track->P().Mag(), track->TOFpionTime()))
377 if (!IsPionTOFTime(track->P().Mag(), track->TOFpionTime()))
389 else if (fMostProbable == 3) {
391 // Using the TPC to reject non-kaons
392 if (track->P().Mag() < 0.6) {
393 if (!(IsKaonTPCdEdx(track->P().Mag(), track->TPCsignal())))
397 // Using the TOF to reject non-kaons
399 if (!IsKaonTOFTime(track->P().Mag(), track->TOFkaonTime()))
406 if (!IsKaonTOFTime(track->P().Mag(), track->TOFkaonTime()))
412 if (!(IsKaonTPCdEdx(track->P().Mag(), track->TPCsignal())))
422 // Looking for protons
423 else if (fMostProbable == 4) {
425 // Using the TPC to reject non-kaons
426 if (track->P().Mag() < 0.8) {
427 if (!(IsProtonTPCdEdx(track->P().Mag(), track->TPCsignal())))
431 // Using the TOF to reject non-kaons
433 if (!IsKaonTOFTime(track->P().Mag(), track->TOFkaonTime()))
440 if (!IsKaonTOFTime(track->P().Mag(), track->TOFkaonTime()))
446 if (!(IsKaonTPCdEdx(track->P().Mag(), track->TPCsignal())))
456 if (imost != fMostProbable) return false;
460 //cout<<"****** Go Through the cut ******"<<endl;
461 // cout<<fLabel<<" Label="<<track->Label()<<endl;
462 // cout<<fCharge<<" Charge="<<track->Charge()<<endl;
463 // cout<<fPt[0]<<" < Pt ="<<Pt<<" <"<<fPt[1]<<endl;
464 //cout<<fRapidity[0]<<" < Rapidity ="<<tRapidity<<" <"<<fRapidity[1]<<endl;
465 //cout<<fPidProbElectron[0]<<" < e="<<track->PidProbElectron()<<" <"<<fPidProbElectron[1]<<endl;
466 //cout<<fPidProbPion[0]<<" < pi="<<track->PidProbPion()<<" <"<<fPidProbPion[1]<<endl;
467 //cout<<fPidProbKaon[0]<<" < k="<<track->PidProbKaon()<<" <"<<fPidProbKaon[1]<<endl;
468 //cout<<fPidProbProton[0]<<" < p="<<track->PidProbProton()<<" <"<<fPidProbProton[1]<<endl;
469 //cout<<fPidProbMuon[0]<<" < mi="<<track->PidProbMuon()<<" <"<<fPidProbMuon[1]<<endl;
475 //------------------------------
476 AliFemtoString AliFemtoESDTrackCut::Report()
478 // Prepare report from the execution
481 snprintf(tCtemp , 100, "Particle mass:\t%E\n",this->Mass());
483 snprintf(tCtemp , 100, "Particle charge:\t%d\n",fCharge);
485 snprintf(tCtemp , 100, "Particle pT:\t%E - %E\n",fPt[0],fPt[1]);
487 snprintf(tCtemp , 100, "Particle rapidity:\t%E - %E\n",fRapidity[0],fRapidity[1]);
489 snprintf(tCtemp , 100, "Particle eta:\t%E - %E\n",fEta[0],fEta[1]);
491 snprintf(tCtemp , 100, "Number of tracks which passed:\t%ld Number which failed:\t%ld\n",fNTracksPassed,fNTracksFailed);
493 AliFemtoString returnThis = tStemp;
496 TList *AliFemtoESDTrackCut::ListSettings()
498 // return a list of settings in a writable form
499 TList *tListSetttings = new TList();
501 snprintf(buf, 200, "AliFemtoESDTrackCut.mass=%f", this->Mass());
502 tListSetttings->AddLast(new TObjString(buf));
504 snprintf(buf, 200, "AliFemtoESDTrackCut.charge=%i", fCharge);
505 tListSetttings->AddLast(new TObjString(buf));
506 snprintf(buf, 200, "AliFemtoESDTrackCut.pidprobpion.minimum=%f", fPidProbPion[0]);
507 tListSetttings->AddLast(new TObjString(buf));
508 snprintf(buf, 200, "AliFemtoESDTrackCut.pidprobpion.maximum=%f", fPidProbPion[1]);
509 tListSetttings->AddLast(new TObjString(buf));
510 snprintf(buf, 200, "AliFemtoESDTrackCut.pidprobkaon.minimum=%f", fPidProbKaon[0]);
511 tListSetttings->AddLast(new TObjString(buf));
512 snprintf(buf, 200, "AliFemtoESDTrackCut.pidprobkaon.maximum=%f", fPidProbKaon[1]);
513 tListSetttings->AddLast(new TObjString(buf));
514 snprintf(buf, 200, "AliFemtoESDTrackCut.pidprobproton.minimum=%f", fPidProbProton[0]);
515 tListSetttings->AddLast(new TObjString(buf));
516 snprintf(buf, 200, "AliFemtoESDTrackCut.pidprobproton.maximum=%f", fPidProbProton[1]);
517 tListSetttings->AddLast(new TObjString(buf));
518 snprintf(buf, 200, "AliFemtoESDTrackCut.pidprobelectron.minimum=%f", fPidProbElectron[0]);
519 tListSetttings->AddLast(new TObjString(buf));
520 snprintf(buf, 200, "AliFemtoESDTrackCut.pidprobelectron.maximum=%f", fPidProbElectron[1]);
521 tListSetttings->AddLast(new TObjString(buf));
522 snprintf(buf, 200, "AliFemtoESDTrackCut.pidprobMuon.minimum=%f", fPidProbMuon[0]);
523 tListSetttings->AddLast(new TObjString(buf));
524 snprintf(buf, 200, "AliFemtoESDTrackCut.pidprobMuon.maximum=%f", fPidProbMuon[1]);
525 tListSetttings->AddLast(new TObjString(buf));
526 snprintf(buf, 200, "AliFemtoESDTrackCut.minimumtpcclusters=%i", fminTPCclsF);
527 tListSetttings->AddLast(new TObjString(buf));
528 snprintf(buf, 200, "AliFemtoESDTrackCut.minimumitsclusters=%i", fminTPCclsF);
529 tListSetttings->AddLast(new TObjString(buf));
530 snprintf(buf, 200, "AliFemtoESDTrackCut.pt.minimum=%f", fPt[0]);
531 tListSetttings->AddLast(new TObjString(buf));
532 snprintf(buf, 200, "AliFemtoESDTrackCut.pt.maximum=%f", fPt[1]);
533 tListSetttings->AddLast(new TObjString(buf));
534 snprintf(buf, 200, "AliFemtoESDTrackCut.rapidity.minimum=%f", fRapidity[0]);
535 tListSetttings->AddLast(new TObjString(buf));
536 snprintf(buf, 200, "AliFemtoESDTrackCut.rapidity.maximum=%f", fRapidity[1]);
537 tListSetttings->AddLast(new TObjString(buf));
538 snprintf(buf, 200, "AliFemtoESDTrackCut.removekinks=%i", fRemoveKinks);
539 tListSetttings->AddLast(new TObjString(buf));
540 snprintf(buf, 200, "AliFemtoESDTrackCut.maxitschindof=%f", fMaxITSchiNdof);
541 tListSetttings->AddLast(new TObjString(buf));
542 snprintf(buf, 200, "AliFemtoESDTrackCut.maxtpcchindof=%f", fMaxTPCchiNdof);
543 tListSetttings->AddLast(new TObjString(buf));
544 snprintf(buf, 200, "AliFemtoESDTrackCut.maxsigmatovertex=%f", fMaxSigmaToVertex);
545 tListSetttings->AddLast(new TObjString(buf));
546 snprintf(buf, 200, "AliFemtoESDTrackCut.maximpactxy=%f", fMaxImpactXY);
547 tListSetttings->AddLast(new TObjString(buf));
548 snprintf(buf, 200, "AliFemtoESDTrackCut.maximpactz=%f", fMaxImpactZ);
549 tListSetttings->AddLast(new TObjString(buf));
551 if (fMostProbable == 2)
552 snprintf(buf, 200, "AliFemtoESDTrackCut.mostprobable=%s", "Pion");
553 if (fMostProbable == 3)
554 snprintf(buf, 200, "AliFemtoESDTrackCut.mostprobable=%s", "Kaon");
555 if (fMostProbable == 4)
556 snprintf(buf, 200, "AliFemtoESDTrackCut.mostprobable=%s", "Proton");
557 tListSetttings->AddLast(new TObjString(buf));
559 return tListSetttings;
561 void AliFemtoESDTrackCut::SetRemoveKinks(const bool& flag)
566 void AliFemtoESDTrackCut::SetRemoveITSFake(const bool& flag)
568 fRemoveITSFake = flag;
573 // 0 7.594129e-02 8.256141e-03
574 // 1 -5.535827e-01 8.170825e-02
575 // 2 1.728591e+00 3.104210e-01
576 // 3 -2.827893e+00 5.827802e-01
577 // 4 2.503553e+00 5.736207e-01
578 // 5 -1.125965e+00 2.821170e-01
579 // 6 2.009036e-01 5.438876e-02
580 float AliFemtoESDTrackCut::PidFractionElectron(float mom) const
582 // Provide a parameterized fraction of electrons dependent on momentum
586 +1.728591e+00*0.13*0.13
587 -2.827893e+00*0.13*0.13*0.13
588 +2.503553e+00*0.13*0.13*0.13*0.13
589 -1.125965e+00*0.13*0.13*0.13*0.13*0.13
590 +2.009036e-01*0.13*0.13*0.13*0.13*0.13*0.13);
595 +1.728591e+00*1.8*1.8
596 -2.827893e+00*1.8*1.8*1.8
597 +2.503553e+00*1.8*1.8*1.8*1.8
598 -1.125965e+00*1.8*1.8*1.8*1.8*1.8
599 +2.009036e-01*1.8*1.8*1.8*1.8*1.8*1.8);
602 +1.728591e+00*mom*mom
603 -2.827893e+00*mom*mom*mom
604 +2.503553e+00*mom*mom*mom*mom
605 -1.125965e+00*mom*mom*mom*mom*mom
606 +2.009036e-01*mom*mom*mom*mom*mom*mom);
611 // 0 1.063457e+00 8.872043e-03
612 // 1 -4.222208e-01 2.534402e-02
613 // 2 1.042004e-01 1.503945e-02
614 float AliFemtoESDTrackCut::PidFractionPion(float mom) const
616 // Provide a parameterized fraction of pions dependent on momentum
618 return ( 1.063457e+00
620 +1.042004e-01*0.0169);
622 return ( 1.063457e+00
625 return ( 1.063457e+00
627 +1.042004e-01*mom*mom);
632 // 0 -7.289406e-02 1.686074e-03
633 // 1 4.415666e-01 1.143939e-02
634 // 2 -2.996790e-01 1.840964e-02
635 // 3 6.704652e-02 7.783990e-03
636 float AliFemtoESDTrackCut::PidFractionKaon(float mom) const
638 // Provide a parameterized fraction of kaons dependent on momentum
640 return (-7.289406e-02
642 -2.996790e-01*0.18*0.18
643 +6.704652e-02*0.18*0.18*0.18);
645 return (-7.289406e-02
647 -2.996790e-01*2.0*2.0
648 +6.704652e-02*2.0*2.0*2.0);
649 return (-7.289406e-02
651 -2.996790e-01*mom*mom
652 +6.704652e-02*mom*mom*mom);
657 // 0 -3.730200e-02 2.347311e-03
658 // 1 1.163684e-01 1.319316e-02
659 // 2 8.354116e-02 1.997948e-02
660 // 3 -4.608098e-02 8.336400e-03
661 float AliFemtoESDTrackCut::PidFractionProton(float mom) const
663 // Provide a parameterized fraction of protons dependent on momentum
664 if (mom<0.26) return 0.0;
666 return (-3.730200e-02
668 +8.354116e-02*2.0*2.0
669 -4.608098e-02*2.0*2.0*2.0);
670 return (-3.730200e-02
672 +8.354116e-02*mom*mom
673 -4.608098e-02*mom*mom*mom);
676 void AliFemtoESDTrackCut::SetMomRangeTOFpidIs(const float& minp, const float& maxp)
678 fMinPforTOFpid = minp;
679 fMaxPforTOFpid = maxp;
682 void AliFemtoESDTrackCut::SetMomRangeTPCpidIs(const float& minp, const float& maxp)
684 fMinPforTPCpid = minp;
685 fMaxPforTPCpid = maxp;
688 void AliFemtoESDTrackCut::SetMomRangeITSpidIs(const float& minp, const float& maxp)
690 fMinPforITSpid = minp;
691 fMaxPforITSpid = maxp;
694 bool AliFemtoESDTrackCut::IsPionTPCdEdx(float mom, float dEdx)
696 // double a1 = -95.4545, b1 = 86.5455;
697 // double a2 = 0.0, b2 = 56.0;
698 double a1 = -343.75, b1 = 168.125;
699 double a2 = 0.0, b2 = 65.0;
702 if (dEdx < a1*mom+b1) return true;
704 if (dEdx < a2*mom+b2) return true;
709 bool AliFemtoESDTrackCut::IsKaonTPCdEdx(float mom, float dEdx)
712 // double a1 = -547.0; double b1 = 297.0;
713 // double a2 = -125.0; double b2 = 145.0;
714 // double a3 = -420.0; double b3 = 357.0;
715 // double a4 = -110.0; double b4 = 171.0;
718 // if (mom<0.2) return false;
721 // if (dEdx < a1*mom+b1) return false;
722 // if (dEdx > a3*mom+b3) return false;
724 // else if (mom<0.6) {
725 // if (dEdx < a2*mom+b2) return false;
726 // if (dEdx > a3*mom+b3) return false;
728 // else if (mom<0.9) {
729 // if (dEdx > a4*mom+b4) return false;
730 // if (dEdx < b5) return false;
735 // // if (dEdx > b5) return false;
740 double a1 = -268.896; double b1 = 198.669;
741 double a2 = -49.0012; double b2 = 88.7214;
743 if (mom<0.2) return false;
745 if (mom>0.3 && mom<0.5) {
746 if (dEdx < a1*mom+b1) return false;
749 if (dEdx < a2*mom+b2) return false;
756 bool AliFemtoESDTrackCut::IsProtonTPCdEdx(float mom, float dEdx)
758 double a1 = -1800.0; double b1 = 940.0;
759 double a2 = -500.0; double b2 = 420.0;
760 double a3 = -216.7; double b3 = 250.0;
762 if (mom<0.2) return false;
764 if (mom>0.3 && mom<0.4) {
765 if (dEdx < a1*mom+b1) return false;
768 if (dEdx < a2*mom+b2) return false;
771 if (dEdx < a3*mom+b3) return false;
778 bool AliFemtoESDTrackCut::IsPionTOFTime(float mom, float ttof)
780 double a1 = -427.0; double b1 = 916.0;
781 double a2 = 327.0; double b2 = -888.0;
782 if (mom<0.3) return kFALSE;
783 if (mom>2.0) return kFALSE;
784 if (ttof > a1*mom+b1) return kFALSE;
785 if (ttof < a2*mom+b2) return kFALSE;
790 bool AliFemtoESDTrackCut::IsKaonTOFTime(float mom, float ttof)
792 double a1 = 000.0; double b1 = -500.0;
793 double a2 = 000.0; double b2 = 500.0;
794 double a3 = 850.0; double b3 = -1503.0;
795 double a4 = -1637.0; double b4 = 3621.0;
797 if (mom<0.3) return kFALSE;
798 if (mom>2.06) return kFALSE;
800 if (ttof > a2*mom+b2) return kFALSE;
801 if (ttof < a1*mom+b1) return kFALSE;
804 if (ttof > a2*mom+b2) return kFALSE;
805 if (ttof < a3*mom+b3) return kFALSE;
808 if (ttof > a4*mom+b4) return kFALSE;
809 if (ttof < a3*mom+b3) return kFALSE;
814 bool AliFemtoESDTrackCut::IsProtonTOFTime(float mom, float ttof)
816 double a1 = 000.0; double b1 = -915.0;
817 double a2 = 000.0; double b2 = 600.0;
818 double a3 = 572.0; double b3 = -1715.0;
820 if (mom<0.3) return kFALSE;
821 if (mom>3.0) 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;
836 bool AliFemtoESDTrackCut::IsKaonTPCdEdxNSigma(float mom, float nsigmaK)
838 cout<<" AliFemtoESDTrackCut::IsKaonTPCdEdxNSigma "<<mom<<" "<<nsigmaK<<endl;
841 if(mom<0.35 && TMath::Abs(nsigmaK)<5.0)return true;
842 if(mom>=0.35 && mom<0.5 && TMath::Abs(nsigmaK)<3.0)return true;
843 if(mom>=0.5 && mom<0.7 && TMath::Abs(nsigmaK)<2.0)return true;
849 bool AliFemtoESDTrackCut::IsKaonTOFNSigma(float mom, float nsigmaK)
851 cout<<" AliFemtoESDTrackCut::IsKaonTPCdEdxNSigma "<<mom<<" "<<nsigmaK<<endl;
853 // if(mom<1.5 && TMath::Abs(nsigmaK)<3.0)return true;
854 if(mom>=1.5 && TMath::Abs(nsigmaK)<2.0)return true;
858 //ML according with Roberto Preghenella talk
860 bool AliFemtoESDTrackCut::IsKaonNSigma(float mom, float nsigmaTPCK, float nsigmaTOFK)
862 //cout<<"//////// AliFemtoESDTrackCut::IsKaonNSigma "<<mom<<" tpc "<<nsigmaTPCK<<" tof "<<nsigmaTOFK<<endl;
865 if(TMath::Abs(nsigmaTOFK)<3.0 && mom<1.5 && TMath::Abs(nsigmaTPCK)<3.0)return true;
866 if(TMath::Abs(nsigmaTOFK)<2.0 && mom>1.5 && TMath::Abs(nsigmaTPCK)<3.0)return true;
871 if(nsigmaTOFK<=-1000.){
872 //cout<<"//////// AliFemtoESDTrackCut::IsKaonNSigma P= "<<mom<<" tpc "<<nsigmaTPCK<<" tof "<<nsigmaTOFK<<endl;
873 //cout <<"/////////////// AliFemtoESDTrackCut::IsKaonNSigma NO TOF SIGNAL ////////////" <<endl;
874 if(mom<0.4 && TMath::Abs(nsigmaTPCK)<1.0)return true;
875 if(mom>=0.4 && mom<0.5 && TMath::Abs(nsigmaTPCK)<2.0)return true;
876 if(mom>=0.5 && mom<0.6 && TMath::Abs(nsigmaTPCK)<2.0)return true;
884 bool AliFemtoESDTrackCut::IsPionNSigma(float mom, float nsigmaTPCPi, float nsigmaTOFPi)
886 // cout<<" AliFemtoESDTrackCut::IsKaonNSigma "<<mom<<" tpc "<<nsigmaTPCK<<" tof "<<nsigmaTOFK<<endl;
888 if(TMath::Abs(nsigmaTOFPi)<3.0 && mom<1.5 && TMath::Abs(nsigmaTPCPi)<5.0)return true;
889 if(TMath::Abs(nsigmaTOFPi)<2.0 && mom>1.5 && TMath::Abs(nsigmaTPCPi)<5.0)return true;
893 if(nsigmaTOFPi<-999.){
894 if(mom<0.35 && TMath::Abs(nsigmaTPCPi)<5.0)return true;
895 if(mom>=0.35 && mom<0.5 && TMath::Abs(nsigmaTPCPi)<3.0)return true;
896 if(mom>=0.5 && TMath::Abs(nsigmaTPCPi)<2.0)return true;
902 bool AliFemtoESDTrackCut::IsProtonNSigma(float mom, float nsigmaTPCP, float nsigmaTOFP)
904 // cout<<" AliFemtoESDTrackCut::IsKaonNSigma "<<mom<<" tpc "<<nsigmaTPCK<<" tof "<<nsigmaTOFK<<endl;
907 if(TMath::Abs(nsigmaTOFP)<3.0 && mom<1.5 && TMath::Abs(nsigmaTPCP)<3.0)return true;
908 if(TMath::Abs(nsigmaTOFP)<2.0 && mom>1.5 && TMath::Abs(nsigmaTPCP)<3.0)return true;
911 if(nsigmaTOFP<-999.){
912 if(mom<0.5 && TMath::Abs(nsigmaTPCP)<3.0)return true;
913 if(mom>=0.5 && mom<0.8 && TMath::Abs(nsigmaTPCP)<2.0)return true;
920 void AliFemtoESDTrackCut::SetPIDMethod(ReadPIDMethodType newMethod)
922 fPIDMethod = newMethod;