2 // All cuts for single track in D0 analysis,
3 // based on track quality and particle identification
5 // Author: Massimo Venaruzzo
12 #include "AliPIDResponse.h"
13 #include "AliRsnCutDaughterD0.h"
15 ClassImp(AliRsnCutDaughterD0)
17 //__________________________________________________________________________________________________
18 AliRsnCutDaughterD0::AliRsnCutDaughterD0(const char *name, AliPID::EParticleType pid) :
19 AliRsnCut(name, AliRsnTarget::kDaughter),
21 //fIsCheckOnMother(kFALSE),
23 fCutQuality(Form("%sQuality", name)),
34 fCutQuality.SetPtRange(0.15, 1E+20);
35 fCutQuality.SetEtaRange(-0.8, 0.8);
36 fCutQuality.SetDCARPtFormula("");
37 fCutQuality.SetDCARmin(0.0);
38 fCutQuality.SetDCAZmax(2.0);
39 fCutQuality.SetSPDminNClusters(0);
40 fCutQuality.SetITSminNClusters(0);
41 fCutQuality.SetITSmaxChi2(1E+20);
42 fCutQuality.SetTPCminNClusters(0);
43 fCutQuality.SetMinNCrossedRowsTPC(0,kTRUE);
44 fCutQuality.SetMinNCrossedRowsOverFindableClsTPC(0.00,kTRUE);
45 fCutQuality.SetTPCmaxChi2(1E20);
46 fCutQuality.SetRejectKinkDaughters();
47 fCutQuality.SetAODTestFilterBit(-1);
50 //__________________________________________________________________________________________________
51 Bool_t AliRsnCutDaughterD0::IsSelected(TObject *obj)
58 if (!TargetOK(obj)) return kFALSE;
60 // if this class is used to check the mothers in the acceptance, accept (will be applied only selection on min pt and eta)
61 //if (fIsCheckOnMother) return kTRUE;
64 AliVTrack *track = dynamic_cast<AliVTrack *>(fDaughter->GetRef());
65 if (!track) return kFALSE;
67 AliDebugClass(2, "Checking status...");
69 if ((track->GetStatus() & AliESDtrack::kTPCin ) == 0) return kFALSE;
70 if ((track->GetStatus() & AliESDtrack::kTPCrefit) == 0) return kFALSE;
71 if ((track->GetStatus() & AliESDtrack::kITSrefit) == 0) return kFALSE;
72 AliDebugClass(2, "...passed");
75 AliDebugClass(2, "Checking quality cuts...");
76 if (!fCutQuality.IsSelected(obj)) return kFALSE;
77 AliDebugClass(2, "...passed");
79 // if no PID is required, accept
80 if (fNoPID) return kTRUE;
83 // check initialization of PID object
84 AliPIDResponse *pid = fEvent->GetPIDResponse();
86 AliFatal("NULL PID response");
90 AliDebugClass(2, "Checking TPC and TOF Matching...");
91 // check if TPC and TOF are matched
92 // and computes all values used in the PID cut
93 Bool_t isTPC = MatchTPC(track);
94 Bool_t isTOF = MatchTOF(track);
95 AliDebugClass(2, "...passed");
97 Double_t pTPC = track->GetTPCmomentum();
98 Double_t p = track->P();
99 Double_t nsTPC = TMath::Abs(pid->NumberOfSigmasTPC(track, fPID));
100 Double_t nsTOF = isTOF ? TMath::Abs(pid->NumberOfSigmasTOF(track, fPID)) : 1E20;
101 Double_t maxTPC = 1E20;
102 Double_t maxTOF = 1E20;
103 AliDebugClass(2, "Checking PID...");
106 // applies the cut differently depending on the PID and the momentum
107 if (isTPC && isTOF) {
108 if (fPID == AliPID::kPion) {maxTPC = fPionTPCPIDCut; maxTOF = fPionTOFPIDCut;}
109 if (fPID == AliPID::kKaon) {maxTPC = fKaonTPCPIDCut; maxTOF = fKaonTOFPIDCut;}
110 return (nsTPC <= maxTPC && nsTOF <= maxTOF);
112 if (fPID == AliPID::kPion) maxTPC = fPionTPCPIDCut;
113 if (fPID == AliPID::kKaon) maxTPC = fKaonTPCPIDCut;
114 return (nsTPC <= maxTPC);
118 // applies the cut differently depending on the PID and the momentum
119 if (isTPC && isTOF) {
120 // TPC: 5sigma cut for all
121 if (nsTPC > 5.0) return kFALSE;
122 // TOF: 3sigma below 1.5 GeV, 2sigma above
123 if (p < 1.5) maxTOF = 3.0; else maxTOF = 2.0;
124 return (nsTOF <= maxTOF);
127 // all below 350 MeV: 5sigma
128 // all between 350 and 500 MeV: 3sigma
129 // pions above 500 MeV: 2sigma
130 // kaons between 500 and 700 MeV: 2sigma
131 // kaons above 700 MeV: rejected
134 else if (pTPC > 0.35 && pTPC <= 0.5)
137 if (fPID == AliPID::kPion)
139 else if (fPID == AliPID::kKaon) {
146 return (nsTPC <= maxTPC);
151 AliDebugClass(2, "...passed");
152 // if we reach this point, all checks were successful
153 AliDebugClass(2, "Good Pion/Kaon Candidate Found!!");