2 // This cut implements all the checks done to accept a track as a Kaon
3 // for the PbPb analysis using 2010 runs.
4 // It is based on standard cuts on track quality and nsigma cuts
5 // with respect to the TPC and TOF signals for the PID.
12 #include "AliPIDResponse.h"
13 #include "AliESDpid.h"
14 #include "AliAODpidUtil.h"
15 #include "AliRsnCutKaonForPhi2010.h"
17 ClassImp(AliRsnCutKaonForPhi2010)
19 //__________________________________________________________________________________________________
20 AliRsnCutKaonForPhi2010::AliRsnCutKaonForPhi2010
21 (const char *name, Double_t nSigmaTPC, Double_t nSigmaTOF, Double_t tofLimit) :
22 AliRsnCut(name, AliRsnTarget::kDaughter),
26 fTOFthreshold(tofLimit),
28 fCutQuality(Form("%s_quality", name))
32 // Initialize the contained cuts and sets defaults
36 //fCutQuality.AddStatusFlag(AliESDtrack::kTPCin , kTRUE);
37 //fCutQuality.AddStatusFlag(AliESDtrack::kTPCrefit, kTRUE);
38 //fCutQuality.AddStatusFlag(AliESDtrack::kITSrefit, kTRUE);
39 fCutQuality.SetPtRange(0.15, 1E+20);
40 fCutQuality.SetEtaRange(-0.8, 0.8);
41 fCutQuality.SetDCARPtFormula("0.0182+0.0350/pt^1.01");
42 fCutQuality.SetDCAZmax(2.0);
43 fCutQuality.SetSPDminNClusters(1);
44 fCutQuality.SetITSminNClusters(0);
45 fCutQuality.SetITSmaxChi2(1E+20);
46 fCutQuality.SetTPCminNClusters(70);
47 fCutQuality.SetTPCmaxChi2(4.0);
48 fCutQuality.SetRejectKinkDaughters();
49 fCutQuality.SetAODTestFilterBit(5);
52 //__________________________________________________________________________________________________
53 AliRsnCutKaonForPhi2010::AliRsnCutKaonForPhi2010(const AliRsnCutKaonForPhi2010 ©) :
56 fCutTPC(copy.fCutTPC),
57 fCutTOF(copy.fCutTOF),
58 fTOFthreshold(copy.fTOFthreshold),
60 fCutQuality(copy.fCutQuality)
67 //__________________________________________________________________________________________________
68 AliRsnCutKaonForPhi2010 &AliRsnCutKaonForPhi2010::operator=(const AliRsnCutKaonForPhi2010 ©)
71 // Assignment operator
74 AliRsnCut::operator=(copy);
78 fCutTPC = copy.fCutTPC;
79 fCutTOF = copy.fCutTOF;
80 fTOFthreshold = copy.fTOFthreshold;
82 fCutQuality = copy.fCutQuality;
87 //__________________________________________________________________________________________________
88 void AliRsnCutKaonForPhi2010::InitMyPID(Bool_t isMC, Bool_t isESD)
91 // Initialize manual PID object
95 fMyPID = new AliESDpid(isMC);
97 fMyPID = new AliAODpidUtil(isMC);
100 //__________________________________________________________________________________________________
101 Bool_t AliRsnCutKaonForPhi2010::IsSelected(TObject *obj)
108 if (!TargetOK(obj)) return kFALSE;
111 AliVTrack *track = fDaughter->Ref2Vtrack();
113 if (!fDaughter->GetRef()) AliWarning("NULL ref");
118 if ((track->GetStatus() & AliESDtrack::kTPCin ) == 0) return kFALSE;
119 if ((track->GetStatus() & AliESDtrack::kTPCrefit) == 0) return kFALSE;
120 if ((track->GetStatus() & AliESDtrack::kITSrefit) == 0) return kFALSE;
122 // check quality and reject always bad quality tracks
123 if (!fCutQuality.IsSelected(obj)) {
124 AliDebugClass(1, Form("[%s] Track quality is bad", GetName()));
128 // initialize check variables
129 Bool_t accept = kFALSE;
130 Bool_t isTOF = MatchTOF(track);
131 Double_t nsTPC = 1E20;
132 Double_t nsTOF = 1E20;
134 // if PID is required, compute it check initialization of PID object
135 if (fMode >= kOnlyTPC && fMode <= kDefaultPID) {
136 AliPIDResponse *pid = fEvent->GetPIDResponse();
138 AliFatal("NULL PID response");
143 nsTPC = TMath::Abs(fMyPID->NumberOfSigmasTPC(track, AliPID::kKaon));
145 nsTPC = TMath::Abs(pid->NumberOfSigmasTPC(track, AliPID::kKaon));
147 nsTOF = TMath::Abs(pid->NumberOfSigmasTOF(track, AliPID::kKaon));
150 // decide cut result depending on mode
153 // in this case, since bad quality tracks are rejected above,
154 // all tracks arrived here can be accepted
155 AliDebugClass(1, Form("[%s] Required only track quality", GetName()));
159 // in this case, only TPC PID is checked
160 // all tracks have one, so nothing additional is checked
161 AliDebugClass(1, Form("[%s] Checking only TPC: nsigma = %f - cut = %f", GetName(), nsTPC, fCutTPC));
162 accept = (nsTPC <= fCutTPC);
165 // in this case, only TOF PID is checked
166 // additional check: we want that TOF is matched
167 AliDebugClass(1, Form("[%s] Checking only TOF: nsigma = %f - cut = %f", GetName(), nsTOF, fCutTOF));
169 accept = (nsTOF <= fCutTOF);
171 AliDebugClass(1, Form("[%s] TOF not matched", GetName()));
176 // in this case, default PID check is done
177 // TPC PID is checked and tracks are rejected if it is not passed
178 // if their momentum is below the TOF threshold, they are required
179 // to be matched in TOF, otherwise TPC only is OK
180 AliDebugClass(1, Form("[%s] Default PID TPC: nsigma = %f - cut = %f", GetName(), nsTPC, fCutTPC));
181 AliDebugClass(1, Form("[%s] Default PID TOF: nsigma = %f - cut = %f", GetName(), nsTOF, fCutTOF));
183 if (nsTPC > fCutTPC) {
184 AliDebugClass(1, Form("[%s] TPC PID cut not passed", GetName()));
188 accept = (nsTOF <= fCutTOF);
190 if (track->P() >= fTOFthreshold) {
191 AliDebugClass(1, Form("[%s] p = %f above threshold: TOF is required but missing", GetName(), track->P()));
194 AliDebugClass(1, Form("[%s] p = %f below threshold: TOF is not required", GetName(), track->P()));
201 AliDebugClass(1, Form("[%s] Wrong mode", GetName()));
205 AliDebugClass(1, Form("[%s] Track %s", GetName(), (accept ? "accepted" : "rejected")));