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 "AliFemtoMJTrackCut.h"
51 ClassImp(AliFemtoMJTrackCut)
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 AliFemtoMJTrackCut::AliFemtoMJTrackCut() :
91 fNsigmaTPCTOF(kFALSE),
92 fNsigmaTPConly(kFALSE),
97 fMaxITSchiNdof(1000.0),
98 fMaxTPCchiNdof(1000.0),
99 fMaxSigmaToVertex(1000.0),
102 fRemoveKinks(kFALSE),
103 fRemoveITSFake(kFALSE),
105 fMaxImpactXY(1000.0),
106 fMinImpactXY(-1000.0),
108 fMaxImpactXYPtOff(1000.0),
109 fMaxImpactXYPtNrm(1000.0),
110 fMaxImpactXYPtPow(1000.0),
112 fMaxPforTOFpid(10000.0),
114 fMaxPforTPCpid(10000.0),
116 fMaxPforITSpid(10000.0),
117 fElectronRejection(0)
119 // Default constructor
120 fNTracksPassed = fNTracksFailed = 0;
121 fCharge = 0; // takes both charges 0
122 fPt[0]=0.0; fPt[1] = 100.0;//100
123 fRapidity[0]=-2; fRapidity[1]=2;//-2 2
124 fEta[0]=-2; fEta[1]=2;//-2 2
125 fPidProbElectron[0]=-1;fPidProbElectron[1]=2;
126 fPidProbPion[0]=-1; fPidProbPion[1]=2;
127 fPidProbKaon[0]=-1;fPidProbKaon[1]=2;
128 fPidProbProton[0]=-1;fPidProbProton[1]=2;
129 fPidProbMuon[0]=-1;fPidProbMuon[1]=2;
130 for (Int_t i = 0; i < 3; i++)
131 fCutClusterRequirementITS[i] = AliESDtrackCuts::kOff;
137 fNsigmaTPCTOF=kFALSE;
138 fNsigmaTPConly=kFALSE;
141 //------------------------------
142 AliFemtoMJTrackCut::~AliFemtoMJTrackCut(){
145 //------------------------------
146 bool AliFemtoMJTrackCut::Pass(const AliFemtoTrack* track)
148 //cout<<"AliFemtoMJTrackCut::Pass"<<endl;
150 // test the particle and return
151 // true if it meets all the criteria
152 // false if it doesn't meet at least one of the criteria
155 //cout<<"AliFemtoESD cut"<<endl;
156 //cout<<fPidProbPion[0]<<" < pi ="<<track->PidProbPion()<<" <"<<fPidProbPion[1]<<endl;
159 //cout<<" status "<<track->Label()<<" "<<track->Flags()<<" "<<track->TPCnclsF()<<" "<<track->ITSncls()<<endl;
160 if ((track->Flags()&fStatus)!=fStatus)
162 // cout<<track->Flags()<<" "<<fStatus<<" no go through status"<<endl;
168 if ((track->KinkIndex(0)) || (track->KinkIndex(1)) || (track->KinkIndex(2)))
171 if (fRemoveITSFake) {
172 if (track->ITSncls() < 0)
175 if (fminTPCclsF>track->TPCnclsF())
177 //cout<<" No go because TPC Number of ClsF"<<fminTPCclsF<< " "<<track->TPCnclsF()<<endl;
180 if (fminTPCncls>track->TPCncls())
182 //cout<<" No go because TPC Number of ClsF"<<fminTPCclsF<< " "<<track->TPCnclsF()<<endl;
185 if (fminITScls>track->ITSncls())
187 //cout<<" No go because ITS Number of Cls"<<fminITScls<< " "<<track->ITSncls()<<endl;
191 if (fMaxImpactXY < TMath::Abs(track->ImpactD()))
194 if (fMinImpactXY > TMath::Abs(track->ImpactD()))
197 if (fMaxImpactZ < TMath::Abs(track->ImpactZ()))
200 if (fMaxSigmaToVertex < track->SigmaToVertex()) {
204 if (track->ITSncls() > 0)
205 if ((track->ITSchi2()/track->ITSncls()) > fMaxITSchiNdof) {
209 if (track->TPCncls() > 0)
210 if ((track->TPCchi2()/track->TPCncls()) > fMaxTPCchiNdof) {
213 //ITS cluster requirenments
214 for (Int_t i = 0; i < 3; i++)
215 if(!CheckITSClusterRequirement(fCutClusterRequirementITS[i], track->HasPointOnITSLayer(i*2), track->HasPointOnITSLayer(i*2+1)))
220 //cout<<"labels"<<endl;
224 // cout<<"No Go Through the cut"<<endl;
225 // cout<<fLabel<<" Label="<<track->Label()<<endl;
231 //cout<<"AliFemtoESD cut ch "<<endl;
232 //cout<<fCharge<<" Charge="<<track->Charge()<<endl;
233 if (track->Charge()!= fCharge)
236 // cout<<"No Go Through the cut"<<endl;
237 // cout<<fCharge<<" Charge="<<track->Charge()<<endl;
245 Bool_t tTPCPidIn = (track->Flags()&AliFemtoTrack::kTPCpid)>0;
246 Bool_t tITSPidIn = (track->Flags()&AliFemtoTrack::kITSpid)>0;
247 Bool_t tTOFPidIn = (track->Flags()&AliFemtoTrack::kTOFpid)>0;
249 if(fMinPforTOFpid > 0 && track->P().Mag() > fMinPforTOFpid &&
250 track->P().Mag() < fMaxPforTOFpid && !tTOFPidIn)
256 if(fMinPforTPCpid > 0 && track->P().Mag() > fMinPforTPCpid &&
257 track->P().Mag() < fMaxPforTPCpid && !tTPCPidIn)
263 if(fMinPforITSpid > 0 && track->P().Mag() > fMinPforITSpid &&
264 track->P().Mag() < fMaxPforITSpid && !tITSPidIn)
271 float tEnergy = ::sqrt(track->P().Mag2()+fMass*fMass);
273 if(tEnergy-track->P().z()!=0 && (tEnergy+track->P().z())/(tEnergy-track->P().z())>0)
274 tRapidity = 0.5*::log((tEnergy+track->P().z())/(tEnergy-track->P().z()));
275 float tPt = ::sqrt((track->P().x())*(track->P().x())+(track->P().y())*(track->P().y()));
276 float tEta = track->P().PseudoRapidity();
278 if (fMaxImpactXYPtOff < 999.0) {
279 if ((fMaxImpactXYPtOff + fMaxImpactXYPtNrm*TMath::Power(tPt, fMaxImpactXYPtPow)) < TMath::Abs(track->ImpactD())) {
285 if ((tRapidity<fRapidity[0])||(tRapidity>fRapidity[1]))
288 //cout<<"No Go Through the cut"<<endl;
289 //cout<<fRapidity[0]<<" < Rapidity ="<<tRapidity<<" <"<<fRapidity[1]<<endl;
292 if ((tEta<fEta[0])||(tEta>fEta[1]))
295 //cout<<"No Go Through the cut"<<endl;
296 //cout<<fEta[0]<<" < Eta ="<<tEta<<" <"<<fEta[1]<<endl;
299 if ((tPt<fPt[0])||(tPt>fPt[1]))
302 //cout<<"No Go Through the cut"<<endl;
303 //cout<<fPt[0]<<" < Pt ="<<Pt<<" <"<<fPt[1]<<endl;
310 // cout << "Track has pids: "
311 // << track->PidProbElectron() << " "
312 // << track->PidProbMuon() << " "
313 // << track->PidProbPion() << " "
314 // << track->PidProbKaon() << " "
315 // << track->PidProbProton() << " "
316 // << track->PidProbElectron()+track->PidProbMuon()+track->PidProbPion()+track->PidProbKaon()+track->PidProbProton() << endl;
319 if ((track->PidProbElectron()<fPidProbElectron[0])||(track->PidProbElectron()>fPidProbElectron[1]))
322 //cout<<"No Go Through the cut"<<endl;
323 //cout<<fPidProbElectron[0]<<" < e ="<<track->PidProbElectron()<<" <"<<fPidProbElectron[1]<<endl;
326 if ((track->PidProbPion()<fPidProbPion[0])||(track->PidProbPion()>fPidProbPion[1]))
329 //cout<<"No Go Through the cut"<<endl;
330 //cout<<fPidProbPion[0]<<" < pi ="<<track->PidProbPion()<<" <"<<fPidProbPion[1]<<endl;
333 if ((track->PidProbKaon()<fPidProbKaon[0])||(track->PidProbKaon()>fPidProbKaon[1]))
336 //cout<<"No Go Through the cut"<<endl;
337 //cout<<fPidProbKaon[0]<<" < k ="<<track->PidProbKaon()<<" <"<<fPidProbKaon[1]<<endl;
340 if ((track->PidProbProton()<fPidProbProton[0])||(track->PidProbProton()>fPidProbProton[1]))
343 //cout<<"No Go Through the cut"<<endl;
344 //cout<<fPidProbProton[0]<<" < p ="<<track->PidProbProton()<<" <"<<fPidProbProton[1]<<endl;
347 if ((track->PidProbMuon()<fPidProbMuon[0])||(track->PidProbMuon()>fPidProbMuon[1]))
350 //cout<<"No Go Through the cut"<<endl;
351 //cout<<fPidProbMuon[0]<<" < mi="<<track->PidProbMuon()<<" <"<<fPidProbMuon[1]<<endl;
355 //****N Sigma Method -- electron rejection****
356 if(fElectronRejection)
357 if(!IsElectron(track->NSigmaTPCE(),track->NSigmaTPCPi(),track->NSigmaTPCK(), track->NSigmaTPCP()))
364 tMost[0] = track->PidProbElectron()*PidFractionElectron(track->P().Mag());
366 tMost[2] = track->PidProbPion()*PidFractionPion(track->P().Mag());
367 tMost[3] = track->PidProbKaon()*PidFractionKaon(track->P().Mag());
368 tMost[4] = track->PidProbProton()*PidFractionProton(track->P().Mag());
371 //****N Sigma Method****
374 if (fMostProbable == 2) {
375 if (IsPionNSigma(track->P().Mag(), track->NSigmaTPCPi(), track->NSigmaTOFPi()))
379 else if (fMostProbable == 3) {
382 if (IsKaonNSigma(track->P().Mag(), track->NSigmaTPCK(), track->NSigmaTOFK())){
387 else if (fMostProbable == 4) { // proton nsigma-PID required contour adjusting (in LHC10h)
388 if ( IsProtonNSigma(track->P().Mag(), track->NSigmaTPCP(), track->NSigmaTOFP()) // && (TMath::Abs(track->NSigmaTPCP()) < TMath::Abs(track->NSigmaTPCPi())) && (TMath::Abs(track->NSigmaTPCP()) < TMath::Abs(track->NSigmaTPCK())) && (TMath::Abs(track->NSigmaTOFP()) < TMath::Abs(track->NSigmaTOFPi())) && (TMath::Abs(track->NSigmaTOFP()) < TMath::Abs(track->NSigmaTOFK()))
389 // && IsProtonTPCdEdx(track->P().Mag(), track->TPCsignal())
393 else if (fMostProbable == 5) { // no-protons
394 if ( !IsProtonNSigma(track->P().Mag(), track->NSigmaTPCP(), track->NSigmaTOFP()) )
397 else if (fMostProbable == 6) { //pions OR kaons OR protons
398 if (IsPionNSigma(track->P().Mag(), track->NSigmaTPCPi(), track->NSigmaTOFPi()))
400 else if (IsKaonNSigma(track->P().Mag(), track->NSigmaTPCK(), track->NSigmaTOFK()))
402 else if (IsProtonNSigma(track->P().Mag(), track->NSigmaTPCP(), track->NSigmaTOFP()) )
405 else if (fMostProbable == 7) { // pions OR kaons OR protons OR electrons
406 if (IsPionNSigma(track->P().Mag(), track->NSigmaTPCPi(), track->NSigmaTOFPi()))
408 else if (IsKaonNSigma(track->P().Mag(), track->NSigmaTPCK(), track->NSigmaTOFK()))
410 else if (IsProtonNSigma(track->P().Mag(), track->NSigmaTPCP(), track->NSigmaTOFP()) )
412 else if (TMath::Abs(track->NSigmaTPCE())<3)
416 else if (fMostProbable == 8) { // TOF matching
417 if(track->NSigmaTOFPi() != -1000 || track->Pt()<0.5){
421 else if (fMostProbable == 9) { // Other: no kaons, no pions, no protons
422 if (IsPionNSigma(track->P().Mag(), track->NSigmaTPCPi(), track->NSigmaTOFPi()))
424 else if (IsKaonNSigma(track->P().Mag(), track->NSigmaTPCK(), track->NSigmaTOFK()))
426 else if (IsProtonNSigma(track->P().Mag(), track->NSigmaTPCP(), track->NSigmaTOFP()) )
428 else if(track->NSigmaTOFPi() != -1000 || track->Pt()<0.5){
432 if (fMostProbable == 10) {//cut on Nsigma in pT not p
433 if (IsPionNSigma(track->Pt(), track->NSigmaTPCPi(), track->NSigmaTOFPi()))
436 else if (fMostProbable == 11) {//cut on Nsigma in pT not p
437 if (IsKaonNSigma(track->Pt(), track->NSigmaTPCK(), track->NSigmaTOFK())){
441 else if (fMostProbable == 12) { //cut on Nsigma in pT not p
442 if ( IsProtonNSigma(track->Pt(), track->NSigmaTPCP(), track->NSigmaTOFP()) )
445 else if (fMostProbable == 13) { //cut on Nsigma in pT not p, EXCLUSIVE PID
446 if ((IsPionNSigma(track->Pt(),track->NSigmaTPCPi(), track->NSigmaTOFPi()) && !IsKaonNSigma(track->Pt(),track->NSigmaTPCK(), track->NSigmaTOFK()) && !IsProtonNSigma(track->Pt(),track->NSigmaTPCP(), track->NSigmaTOFP())))
449 else if (fMostProbable == 14) { //cut on Nsigma in pT not p, EXCLUSIVE PID
450 bool isPionNsigma = (IsPionNSigma(track->Pt(),track->NSigmaTPCPi(), track->NSigmaTOFPi()) && !IsKaonNSigma(track->Pt(),track->NSigmaTPCK(), track->NSigmaTOFK()) && !IsProtonNSigma(track->Pt(),track->NSigmaTPCP(), track->NSigmaTOFP()));
451 if ( !isPionNsigma && IsKaonNSigma(track->Pt(),track->NSigmaTPCK(), track->NSigmaTOFK()) && !IsProtonNSigma(track->Pt(),track->NSigmaTPCP(), track->NSigmaTOFP()))
454 else if (fMostProbable == 15) { //cut on Nsigma in pT not p, EXCLUSIVE PID
455 bool isPionNsigma = (IsPionNSigma(track->Pt(),track->NSigmaTPCPi(), track->NSigmaTOFPi()) && !IsKaonNSigma(track->Pt(),track->NSigmaTPCK(), track->NSigmaTOFK()) && !IsProtonNSigma(track->Pt(),track->NSigmaTPCP(), track->NSigmaTOFP()));
456 bool isKaonNsigma = (!isPionNsigma && IsKaonNSigma(track->Pt(),track->NSigmaTPCK(), track->NSigmaTOFK()) && !IsProtonNSigma(track->Pt(),track->NSigmaTPCP(), track->NSigmaTOFP()));
457 if (!isPionNsigma && !isKaonNsigma && IsProtonNSigma(track->Pt(),track->NSigmaTPCP(), track->NSigmaTOFP()))
460 //*************** Without double counting, pions ************************
461 else if (fMostProbable == 16) { //cut on Nsigma in pT not p, without double counting
462 double nSigmaPIDPi = 0, nSigmaPIDK = 0, nSigmaPIDP = 0;
464 nSigmaPIDPi = abs(track->NSigmaTPCPi());
465 nSigmaPIDK = abs(track->NSigmaTPCK());
466 nSigmaPIDP = abs(track->NSigmaTPCP());
469 nSigmaPIDPi = TMath::Hypot(track->NSigmaTOFPi(), track->NSigmaTPCPi());
470 nSigmaPIDK= TMath::Hypot(track->NSigmaTOFK(), track->NSigmaTPCK());
471 nSigmaPIDP= TMath::Hypot(track->NSigmaTOFP(), track->NSigmaTPCP());
473 bool isPionNsigma = 0;
475 if(nSigmaPIDPi<nSigmaPIDK && nSigmaPIDPi<nSigmaPIDP){
476 isPionNsigma = (IsPionNSigma(track->Pt(),track->NSigmaTPCPi(), track->NSigmaTOFPi()));
477 if(isPionNsigma) imost=16;
481 else if (fMostProbable == 17) { //cut on Nsigma in pT not p, without double counting
482 double nSigmaPIDPi = 0, nSigmaPIDK = 0, nSigmaPIDP = 0;
484 nSigmaPIDPi = abs(track->NSigmaTPCPi());
485 nSigmaPIDK = abs(track->NSigmaTPCK());
486 nSigmaPIDP = abs(track->NSigmaTPCP());
489 nSigmaPIDPi = TMath::Hypot(track->NSigmaTOFPi(), track->NSigmaTPCPi());
490 nSigmaPIDK= TMath::Hypot(track->NSigmaTOFK(), track->NSigmaTPCK());
491 nSigmaPIDP= TMath::Hypot(track->NSigmaTOFP(), track->NSigmaTPCP());
494 bool isKaonNsigma = 0;
495 if(nSigmaPIDK<nSigmaPIDPi && nSigmaPIDK<nSigmaPIDP){
496 isKaonNsigma = (IsKaonNSigma(track->Pt(),track->NSigmaTPCK(), track->NSigmaTOFK()));
497 if(isKaonNsigma) imost=17;
501 else if (fMostProbable == 18) { //cut on Nsigma in pT not p, without double counting
502 double nSigmaPIDPi = 0, nSigmaPIDK = 0, nSigmaPIDP = 0;
504 nSigmaPIDPi = abs(track->NSigmaTPCPi());
505 nSigmaPIDK = abs(track->NSigmaTPCK());
506 nSigmaPIDP = abs(track->NSigmaTPCP());
509 nSigmaPIDPi = TMath::Hypot(track->NSigmaTOFPi(), track->NSigmaTPCPi());
510 nSigmaPIDK= TMath::Hypot(track->NSigmaTOFK(), track->NSigmaTPCK());
511 nSigmaPIDP= TMath::Hypot(track->NSigmaTOFP(), track->NSigmaTPCP());
513 bool isProtonNsigma = 0;
515 if(nSigmaPIDP<nSigmaPIDPi && nSigmaPIDP<nSigmaPIDK){
516 isProtonNsigma = (IsProtonNSigma(track->Pt(),track->NSigmaTPCP(), track->NSigmaTOFP()));
518 if(isProtonNsigma) imost=18;
525 //****Contour Method****
527 for (int ip=0; ip<5; ip++)
528 if (tMost[ip] > ipidmax) { ipidmax = tMost[ip]; imost = ip; };
531 if (fMostProbable == 2) {
533 // Using the TPC to reject non-pions
534 if (!(IsPionTPCdEdx(track->P().Mag(), track->TPCsignal())))
537 // Using the TOF to reject non-pions
538 if (track->P().Mag() < 0.6) {
540 if (!IsPionTOFTime(track->P().Mag(), track->TOFpionTime()))
545 if (!IsPionTOFTime(track->P().Mag(), track->TOFpionTime()))
557 else if (fMostProbable == 3) {
559 // Using the TPC to reject non-kaons
560 if (track->P().Mag() < 0.6) {
561 if (!(IsKaonTPCdEdx(track->P().Mag(), track->TPCsignal())))
565 // Using the TOF to reject non-kaons
567 if (!IsKaonTOFTime(track->P().Mag(), track->TOFkaonTime()))
574 if (!IsKaonTOFTime(track->P().Mag(), track->TOFkaonTime()))
580 if (!(IsKaonTPCdEdx(track->P().Mag(), track->TPCsignal())))
590 // Looking for protons
591 else if (fMostProbable == 4) {
593 // Using the TPC to reject non-kaons
594 if (track->P().Mag() < 0.8) {
595 if (!(IsProtonTPCdEdx(track->P().Mag(), track->TPCsignal())))
599 // Using the TOF to reject non-kaons
601 if (!IsKaonTOFTime(track->P().Mag(), track->TOFkaonTime()))
608 if (!IsKaonTOFTime(track->P().Mag(), track->TOFkaonTime()))
614 if (!(IsKaonTPCdEdx(track->P().Mag(), track->TPCsignal())))
624 if (imost != fMostProbable) return false;
628 //cout<<"****** Go Through the cut ******"<<endl;
629 // cout<<fLabel<<" Label="<<track->Label()<<endl;
630 // cout<<fCharge<<" Charge="<<track->Charge()<<endl;
631 // cout<<fPt[0]<<" < Pt ="<<Pt<<" <"<<fPt[1]<<endl;
632 //cout<<fRapidity[0]<<" < Rapidity ="<<tRapidity<<" <"<<fRapidity[1]<<endl;
633 //cout<<fPidProbElectron[0]<<" < e="<<track->PidProbElectron()<<" <"<<fPidProbElectron[1]<<endl;
634 //cout<<fPidProbPion[0]<<" < pi="<<track->PidProbPion()<<" <"<<fPidProbPion[1]<<endl;
635 //cout<<fPidProbKaon[0]<<" < k="<<track->PidProbKaon()<<" <"<<fPidProbKaon[1]<<endl;
636 //cout<<fPidProbProton[0]<<" < p="<<track->PidProbProton()<<" <"<<fPidProbProton[1]<<endl;
637 //cout<<fPidProbMuon[0]<<" < mi="<<track->PidProbMuon()<<" <"<<fPidProbMuon[1]<<endl;
643 //------------------------------
644 AliFemtoString AliFemtoMJTrackCut::Report()
646 // Prepare report from the execution
649 snprintf(tCtemp , 100, "Particle mass:\t%E\n",this->Mass());
651 snprintf(tCtemp , 100, "Particle charge:\t%d\n",fCharge);
653 snprintf(tCtemp , 100, "Particle pT:\t%E - %E\n",fPt[0],fPt[1]);
655 snprintf(tCtemp , 100, "Particle rapidity:\t%E - %E\n",fRapidity[0],fRapidity[1]);
657 snprintf(tCtemp , 100, "Particle eta:\t%E - %E\n",fEta[0],fEta[1]);
659 snprintf(tCtemp , 100, "Number of tracks which passed:\t%ld Number which failed:\t%ld\n",fNTracksPassed,fNTracksFailed);
661 AliFemtoString returnThis = tStemp;
664 TList *AliFemtoMJTrackCut::ListSettings()
666 // return a list of settings in a writable form
667 TList *tListSetttings = new TList();
669 snprintf(buf, 200, "AliFemtoMJTrackCut.mass=%f", this->Mass());
670 tListSetttings->AddLast(new TObjString(buf));
672 snprintf(buf, 200, "AliFemtoMJTrackCut.charge=%i", fCharge);
673 tListSetttings->AddLast(new TObjString(buf));
674 snprintf(buf, 200, "AliFemtoMJTrackCut.pidprobpion.minimum=%f", fPidProbPion[0]);
675 tListSetttings->AddLast(new TObjString(buf));
676 snprintf(buf, 200, "AliFemtoMJTrackCut.pidprobpion.maximum=%f", fPidProbPion[1]);
677 tListSetttings->AddLast(new TObjString(buf));
678 snprintf(buf, 200, "AliFemtoMJTrackCut.pidprobkaon.minimum=%f", fPidProbKaon[0]);
679 tListSetttings->AddLast(new TObjString(buf));
680 snprintf(buf, 200, "AliFemtoMJTrackCut.pidprobkaon.maximum=%f", fPidProbKaon[1]);
681 tListSetttings->AddLast(new TObjString(buf));
682 snprintf(buf, 200, "AliFemtoMJTrackCut.pidprobproton.minimum=%f", fPidProbProton[0]);
683 tListSetttings->AddLast(new TObjString(buf));
684 snprintf(buf, 200, "AliFemtoMJTrackCut.pidprobproton.maximum=%f", fPidProbProton[1]);
685 tListSetttings->AddLast(new TObjString(buf));
686 snprintf(buf, 200, "AliFemtoMJTrackCut.pidprobelectron.minimum=%f", fPidProbElectron[0]);
687 tListSetttings->AddLast(new TObjString(buf));
688 snprintf(buf, 200, "AliFemtoMJTrackCut.pidprobelectron.maximum=%f", fPidProbElectron[1]);
689 tListSetttings->AddLast(new TObjString(buf));
690 snprintf(buf, 200, "AliFemtoMJTrackCut.pidprobMuon.minimum=%f", fPidProbMuon[0]);
691 tListSetttings->AddLast(new TObjString(buf));
692 snprintf(buf, 200, "AliFemtoMJTrackCut.pidprobMuon.maximum=%f", fPidProbMuon[1]);
693 tListSetttings->AddLast(new TObjString(buf));
694 snprintf(buf, 200, "AliFemtoMJTrackCut.minimumtpcclusters=%i", fminTPCclsF);
695 tListSetttings->AddLast(new TObjString(buf));
696 snprintf(buf, 200, "AliFemtoMJTrackCut.minimumitsclusters=%i", fminTPCclsF);
697 tListSetttings->AddLast(new TObjString(buf));
698 snprintf(buf, 200, "AliFemtoMJTrackCut.pt.minimum=%f", fPt[0]);
699 tListSetttings->AddLast(new TObjString(buf));
700 snprintf(buf, 200, "AliFemtoMJTrackCut.pt.maximum=%f", fPt[1]);
701 tListSetttings->AddLast(new TObjString(buf));
702 snprintf(buf, 200, "AliFemtoMJTrackCut.rapidity.minimum=%f", fRapidity[0]);
703 tListSetttings->AddLast(new TObjString(buf));
704 snprintf(buf, 200, "AliFemtoMJTrackCut.rapidity.maximum=%f", fRapidity[1]);
705 tListSetttings->AddLast(new TObjString(buf));
706 snprintf(buf, 200, "AliFemtoMJTrackCut.removekinks=%i", fRemoveKinks);
707 tListSetttings->AddLast(new TObjString(buf));
708 snprintf(buf, 200, "AliFemtoMJTrackCut.maxitschindof=%f", fMaxITSchiNdof);
709 tListSetttings->AddLast(new TObjString(buf));
710 snprintf(buf, 200, "AliFemtoMJTrackCut.maxtpcchindof=%f", fMaxTPCchiNdof);
711 tListSetttings->AddLast(new TObjString(buf));
712 snprintf(buf, 200, "AliFemtoMJTrackCut.maxsigmatovertex=%f", fMaxSigmaToVertex);
713 tListSetttings->AddLast(new TObjString(buf));
714 snprintf(buf, 200, "AliFemtoMJTrackCut.maximpactxy=%f", fMaxImpactXY);
715 tListSetttings->AddLast(new TObjString(buf));
716 snprintf(buf, 200, "AliFemtoMJTrackCut.maximpactz=%f", fMaxImpactZ);
717 tListSetttings->AddLast(new TObjString(buf));
719 if (fMostProbable == 2)
720 snprintf(buf, 200, "AliFemtoMJTrackCut.mostprobable=%s", "Pion");
721 if (fMostProbable == 3)
722 snprintf(buf, 200, "AliFemtoMJTrackCut.mostprobable=%s", "Kaon");
723 if (fMostProbable == 4)
724 snprintf(buf, 200, "AliFemtoMJTrackCut.mostprobable=%s", "Proton");
725 tListSetttings->AddLast(new TObjString(buf));
727 return tListSetttings;
729 void AliFemtoMJTrackCut::SetRemoveKinks(const bool& flag)
734 void AliFemtoMJTrackCut::SetRemoveITSFake(const bool& flag)
736 fRemoveITSFake = flag;
741 // 0 7.594129e-02 8.256141e-03
742 // 1 -5.535827e-01 8.170825e-02
743 // 2 1.728591e+00 3.104210e-01
744 // 3 -2.827893e+00 5.827802e-01
745 // 4 2.503553e+00 5.736207e-01
746 // 5 -1.125965e+00 2.821170e-01
747 // 6 2.009036e-01 5.438876e-02
748 float AliFemtoMJTrackCut::PidFractionElectron(float mom) const
750 // Provide a parameterized fraction of electrons dependent on momentum
754 +1.728591e+00*0.13*0.13
755 -2.827893e+00*0.13*0.13*0.13
756 +2.503553e+00*0.13*0.13*0.13*0.13
757 -1.125965e+00*0.13*0.13*0.13*0.13*0.13
758 +2.009036e-01*0.13*0.13*0.13*0.13*0.13*0.13);
763 +1.728591e+00*1.8*1.8
764 -2.827893e+00*1.8*1.8*1.8
765 +2.503553e+00*1.8*1.8*1.8*1.8
766 -1.125965e+00*1.8*1.8*1.8*1.8*1.8
767 +2.009036e-01*1.8*1.8*1.8*1.8*1.8*1.8);
770 +1.728591e+00*mom*mom
771 -2.827893e+00*mom*mom*mom
772 +2.503553e+00*mom*mom*mom*mom
773 -1.125965e+00*mom*mom*mom*mom*mom
774 +2.009036e-01*mom*mom*mom*mom*mom*mom);
779 // 0 1.063457e+00 8.872043e-03
780 // 1 -4.222208e-01 2.534402e-02
781 // 2 1.042004e-01 1.503945e-02
782 float AliFemtoMJTrackCut::PidFractionPion(float mom) const
784 // Provide a parameterized fraction of pions dependent on momentum
786 return ( 1.063457e+00
788 +1.042004e-01*0.0169);
790 return ( 1.063457e+00
793 return ( 1.063457e+00
795 +1.042004e-01*mom*mom);
800 // 0 -7.289406e-02 1.686074e-03
801 // 1 4.415666e-01 1.143939e-02
802 // 2 -2.996790e-01 1.840964e-02
803 // 3 6.704652e-02 7.783990e-03
804 float AliFemtoMJTrackCut::PidFractionKaon(float mom) const
806 // Provide a parameterized fraction of kaons dependent on momentum
808 return (-7.289406e-02
810 -2.996790e-01*0.18*0.18
811 +6.704652e-02*0.18*0.18*0.18);
813 return (-7.289406e-02
815 -2.996790e-01*2.0*2.0
816 +6.704652e-02*2.0*2.0*2.0);
817 return (-7.289406e-02
819 -2.996790e-01*mom*mom
820 +6.704652e-02*mom*mom*mom);
825 // 0 -3.730200e-02 2.347311e-03
826 // 1 1.163684e-01 1.319316e-02
827 // 2 8.354116e-02 1.997948e-02
828 // 3 -4.608098e-02 8.336400e-03
829 float AliFemtoMJTrackCut::PidFractionProton(float mom) const
831 // Provide a parameterized fraction of protons dependent on momentum
832 if (mom<0.26) return 0.0;
834 return (-3.730200e-02
836 +8.354116e-02*2.0*2.0
837 -4.608098e-02*2.0*2.0*2.0);
838 return (-3.730200e-02
840 +8.354116e-02*mom*mom
841 -4.608098e-02*mom*mom*mom);
844 void AliFemtoMJTrackCut::SetMomRangeTOFpidIs(const float& minp, const float& maxp)
846 fMinPforTOFpid = minp;
847 fMaxPforTOFpid = maxp;
850 void AliFemtoMJTrackCut::SetMomRangeTPCpidIs(const float& minp, const float& maxp)
852 fMinPforTPCpid = minp;
853 fMaxPforTPCpid = maxp;
856 void AliFemtoMJTrackCut::SetMomRangeITSpidIs(const float& minp, const float& maxp)
858 fMinPforITSpid = minp;
859 fMaxPforITSpid = maxp;
862 bool AliFemtoMJTrackCut::IsPionTPCdEdx(float mom, float dEdx)
864 // double a1 = -95.4545, b1 = 86.5455;
865 // double a2 = 0.0, b2 = 56.0;
866 double a1 = -343.75, b1 = 168.125;
867 double a2 = 0.0, b2 = 65.0;
870 if (dEdx < a1*mom+b1) return true;
872 if (dEdx < a2*mom+b2) return true;
877 bool AliFemtoMJTrackCut::IsKaonTPCdEdx(float mom, float dEdx)
880 // double a1 = -547.0; double b1 = 297.0;
881 // double a2 = -125.0; double b2 = 145.0;
882 // double a3 = -420.0; double b3 = 357.0;
883 // double a4 = -110.0; double b4 = 171.0;
886 // if (mom<0.2) return false;
889 // if (dEdx < a1*mom+b1) return false;
890 // if (dEdx > a3*mom+b3) return false;
892 // else if (mom<0.6) {
893 // if (dEdx < a2*mom+b2) return false;
894 // if (dEdx > a3*mom+b3) return false;
896 // else if (mom<0.9) {
897 // if (dEdx > a4*mom+b4) return false;
898 // if (dEdx < b5) return false;
903 // // if (dEdx > b5) return false;
908 double a1 = -268.896; double b1 = 198.669;
909 double a2 = -49.0012; double b2 = 88.7214;
911 if (mom<0.2) return false;
913 if (mom>0.3 && mom<0.5) {
914 if (dEdx < a1*mom+b1) return false;
917 if (dEdx < a2*mom+b2) return false;
924 bool AliFemtoMJTrackCut::IsProtonTPCdEdx(float mom, float dEdx)
926 double a1 = -1800.0; double b1 = 940.0;
927 double a2 = -500.0; double b2 = 420.0;
928 double a3 = -216.7; double b3 = 250.0;
930 if (mom<0.2) return false;
932 if (mom>0.3 && mom<0.4) {
933 if (dEdx < a1*mom+b1) return false;
936 if (dEdx < a2*mom+b2) return false;
939 if (dEdx < a3*mom+b3) return false;
946 bool AliFemtoMJTrackCut::IsPionTOFTime(float mom, float ttof)
948 double a1 = -427.0; double b1 = 916.0;
949 double a2 = 327.0; double b2 = -888.0;
950 if (mom<0.3) return kFALSE;
951 if (mom>2.0) return kFALSE;
952 if (ttof > a1*mom+b1) return kFALSE;
953 if (ttof < a2*mom+b2) return kFALSE;
958 bool AliFemtoMJTrackCut::IsKaonTOFTime(float mom, float ttof)
960 double a1 = 000.0; double b1 = -500.0;
961 double a2 = 000.0; double b2 = 500.0;
962 double a3 = 850.0; double b3 = -1503.0;
963 double a4 = -1637.0; double b4 = 3621.0;
965 if (mom<0.3) return kFALSE;
966 if (mom>2.06) return kFALSE;
968 if (ttof > a2*mom+b2) return kFALSE;
969 if (ttof < a1*mom+b1) return kFALSE;
972 if (ttof > a2*mom+b2) return kFALSE;
973 if (ttof < a3*mom+b3) return kFALSE;
976 if (ttof > a4*mom+b4) return kFALSE;
977 if (ttof < a3*mom+b3) return kFALSE;
982 bool AliFemtoMJTrackCut::IsProtonTOFTime(float mom, float ttof)
984 double a1 = 000.0; double b1 = -915.0;
985 double a2 = 000.0; double b2 = 600.0;
986 double a3 = 572.0; double b3 = -1715.0;
988 if (mom<0.3) return kFALSE;
989 if (mom>3.0) return kFALSE;
991 if (ttof > a2*mom+b2) return kFALSE;
992 if (ttof < a1*mom+b1) return kFALSE;
995 if (ttof > a2*mom+b2) return kFALSE;
996 if (ttof < a3*mom+b3) return kFALSE;
1004 bool AliFemtoMJTrackCut::IsKaonTPCdEdxNSigma(float mom, float nsigmaK)
1006 // cout<<" AliFemtoMJTrackCut::IsKaonTPCdEdxNSigma "<<mom<<" "<<nsigmaK<<endl;
1009 if(mom<0.35 && TMath::Abs(nsigmaK)<5.0)return true;
1010 if(mom>=0.35 && mom<0.5 && TMath::Abs(nsigmaK)<3.0)return true;
1011 if(mom>=0.5 && mom<0.7 && TMath::Abs(nsigmaK)<2.0)return true;
1016 bool AliFemtoMJTrackCut::IsKaonTOFNSigma(float mom, float nsigmaK)
1018 // cout<<" AliFemtoMJTrackCut::IsKaonTPCdEdxNSigma "<<mom<<" "<<nsigmaK<<endl;
1020 // if(mom<1.5 && TMath::Abs(nsigmaK)<3.0)return true;
1021 if(mom>=1.5 && TMath::Abs(nsigmaK)<2.0)return true;
1026 bool AliFemtoMJTrackCut::IsKaonNSigma(float mom, float nsigmaTPCK, float nsigmaTOFK)
1032 if(TMath::Abs(nsigmaTPCK)<2.0)
1045 if(TMath::Abs(nsigmaTOFK)<3.0 && TMath::Abs(nsigmaTPCK)<3.0)
1055 // if(mom>1.5 || mom<0.15)return false;
1063 bool AliFemtoMJTrackCut::IsKaonNSigma(float mom, float nsigmaTPCK, float nsigmaTOFK)
1065 if (fNsigmaTPCTOF) {
1067 // if (TMath::Hypot( nsigmaTOFP, nsigmaTPCP )/TMath::Sqrt(2) < 3.0)
1068 if (TMath::Hypot( nsigmaTOFK, nsigmaTPCK ) < fNsigma)
1072 if (TMath::Abs(nsigmaTPCK) < fNsigma)
1080 if(nsigmaTOFK<-999.)
1082 if(TMath::Abs(nsigmaTPCK)<2.0) return true;
1084 else if(TMath::Abs(nsigmaTOFK)<3.0 && TMath::Abs(nsigmaTPCK)<3.0) return true;
1086 else if(mom>=0.4 && mom<=0.6)
1088 if(nsigmaTOFK<-999.)
1090 if(TMath::Abs(nsigmaTPCK)<2.0) return true;
1092 else if(TMath::Abs(nsigmaTOFK)<3.0 && TMath::Abs(nsigmaTPCK)<3.0) return true;
1094 else if(nsigmaTOFK<-999.)
1098 else if(TMath::Abs(nsigmaTOFK)<3.0 && TMath::Abs(nsigmaTPCK)<3.0) return true;
1105 bool AliFemtoMJTrackCut::IsPionNSigma(float mom, float nsigmaTPCPi, float nsigmaTOFPi)
1107 if (fNsigmaTPCTOF) {
1109 // if (TMath::Hypot( nsigmaTOFP, nsigmaTPCP )/TMath::Sqrt(2) < 3.0)
1110 if (TMath::Hypot( nsigmaTOFPi, nsigmaTPCPi ) < fNsigma)
1114 if (TMath::Abs(nsigmaTPCPi) < fNsigma)
1121 if(nsigmaTOFPi<-999.)
1123 if(mom<0.35 && TMath::Abs(nsigmaTPCPi)<3.0) return true;
1124 else if(mom<0.5 && mom>=0.35 && TMath::Abs(nsigmaTPCPi)<3.0) return true;
1125 else if(mom>=0.5 && TMath::Abs(nsigmaTPCPi)<2.0) return true;
1128 else if(TMath::Abs(nsigmaTOFPi)<3.0 && TMath::Abs(nsigmaTPCPi)<3.0) return true;
1130 else if(nsigmaTOFPi<-999.)
1134 else if(mom<1.5 && TMath::Abs(nsigmaTOFPi)<3.0 && TMath::Abs(nsigmaTPCPi)<5.0) return true;
1135 else if(mom>=1.5 && TMath::Abs(nsigmaTOFPi)<2.0 && TMath::Abs(nsigmaTPCPi)<5.0) return true;
1141 bool AliFemtoMJTrackCut::IsProtonNSigma(float mom, float nsigmaTPCP, float nsigmaTOFP)
1144 if (fNsigmaTPCTOF) {
1146 // if (TMath::Hypot( nsigmaTOFP, nsigmaTPCP )/TMath::Sqrt(2) < 3.0)
1147 if (TMath::Hypot( nsigmaTOFP, nsigmaTPCP ) < fNsigma)
1151 if (TMath::Abs(nsigmaTPCP) < fNsigma)
1155 else if (fNsigmaTPConly) {
1156 if (TMath::Abs(nsigmaTPCP) < fNsigma)
1160 if (mom > 0.8 && mom < 2.5) {
1161 if ( TMath::Abs(nsigmaTPCP) < 3.0 && TMath::Abs(nsigmaTOFP) < 3.0)
1164 else if (mom > 2.5) {
1165 if ( TMath::Abs(nsigmaTPCP) < 3.0 && TMath::Abs(nsigmaTOFP) < 2.0)
1169 if (TMath::Abs(nsigmaTPCP) < 3.0)
1178 void AliFemtoMJTrackCut::SetPIDMethod(ReadPIDMethodType newMethod)
1180 fPIDMethod = newMethod;
1184 void AliFemtoMJTrackCut::SetNsigmaTPCTOF(Bool_t nsigma)
1186 fNsigmaTPCTOF = nsigma;
1189 void AliFemtoMJTrackCut::SetNsigmaTPConly(Bool_t nsigma)
1191 fNsigmaTPConly = nsigma;
1194 void AliFemtoMJTrackCut::SetNsigma(Double_t nsigma)
1200 void AliFemtoMJTrackCut::SetClusterRequirementITS(AliESDtrackCuts::Detector det, AliESDtrackCuts::ITSClusterRequirement req)
1202 fCutClusterRequirementITS[det] = req;
1205 Bool_t AliFemtoMJTrackCut::CheckITSClusterRequirement(AliESDtrackCuts::ITSClusterRequirement req, Bool_t clusterL1, Bool_t clusterL2)
1207 // checks if the cluster requirement is fullfilled (in this case: return kTRUE)
1211 case AliESDtrackCuts::kOff: return kTRUE;
1212 case AliESDtrackCuts::kNone: return !clusterL1 && !clusterL2;
1213 case AliESDtrackCuts::kAny: return clusterL1 || clusterL2;
1214 case AliESDtrackCuts::kFirst: return clusterL1;
1215 case AliESDtrackCuts::kOnlyFirst: return clusterL1 && !clusterL2;
1216 case AliESDtrackCuts::kSecond: return clusterL2;
1217 case AliESDtrackCuts::kOnlySecond: return clusterL2 && !clusterL1;
1218 case AliESDtrackCuts::kBoth: return clusterL1 && clusterL2;
1224 bool AliFemtoMJTrackCut::IsElectron(float nsigmaTPCE, float nsigmaTPCPi,float nsigmaTPCK, float nsigmaTPCP)
1226 if(TMath::Abs(nsigmaTPCE)<3 && TMath::Abs(nsigmaTPCPi)>3 && TMath::Abs(nsigmaTPCK)>3 && TMath::Abs(nsigmaTPCP)>3)