]>
Commit | Line | Data |
---|---|---|
809a4336 | 1 | /************************************************************************** |
2 | * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * | |
3 | * * | |
4 | * Author: The ALICE Off-line Project. * | |
5 | * Contributors are mentioned in the code where appropriate. * | |
6 | * * | |
7 | * Permission to use, copy, modify and distribute this software and its * | |
8 | * documentation strictly for non-commercial purposes is hereby granted * | |
9 | * without fee, provided that the above copyright notice appears in all * | |
10 | * copies and that both the copyright notice and this permission notice * | |
11 | * appear in the supporting documentation. The authors make no claims * | |
12 | * about the suitability of this software for any purpose. It is * | |
13 | * provided "as is" without express or implied warranty. * | |
14 | **************************************************************************/ | |
50685501 | 15 | // |
16 | // Cut menagement class implemented by the | |
17 | // ALICE Heavy Flavour Electron Group | |
18 | // Interface to the correction framework | |
19 | // Provides a set of standard cuts | |
20 | // | |
21 | // Authors: | |
22 | // Raphaelle Bailhache <R.Bailhache@gsi.de> | |
23 | // Markus Fasel <M.Fasel@gsi.de> | |
24 | // Markus Heide <mheide@uni-muenster.de> | |
25 | // Matus Kalisky <m.kalisky@uni-muenster.de> | |
26 | // | |
70da6c5a | 27 | // Overview over the 18 steps in the correction Framework |
28 | // 0. Generated Electrons | |
29 | // 1. Signal Electrons | |
30 | // 2. Electron in Acceptance | |
31 | // ------------------------------------------------------------ | |
32 | // 3. Rec without cuts (MC information) | |
33 | // 4. Rec Kine ITS/TPC (MC Information) | |
34 | // 5. Rec Primary (MC Information) | |
35 | // 6. HFE ITS (MC Information) | |
36 | // 7. HFE TRD (MC Information) | |
37 | // 8. PID (MC Information) | |
38 | // ............................................................ | |
39 | // 9. Rec without cuts(MC Information for tracks which are already registered) | |
40 | // 10. Rec Kine ITS/TPC (MC Information for tracks which are already registered) | |
41 | // 11. RecPrimary (MC Information for tracks which are already registered) | |
42 | // 12. HFE ITS (MC Information for tracks which are already registered) | |
43 | // 13. HFE TPC (MC Information for tracks which are already registered) | |
44 | // 14. PID (MC Information for tracks which are already registered) | |
45 | // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
46 | // 15. Rec without cuts | |
47 | // 16. Rec Kine ITS/TPC | |
48 | // 17. Rec Primary | |
49 | // 18. HFE ITS | |
50 | // 19. HFE TRD | |
51 | // 20. PID | |
52 | // | |
809a4336 | 53 | #include <TClass.h> |
54 | #include <TList.h> | |
55 | #include <TObjArray.h> | |
56 | #include <TString.h> | |
57 | ||
58 | #include "AliCFAcceptanceCuts.h" | |
59 | #include "AliCFCutBase.h" | |
0792aa82 | 60 | #include "AliCFEventGenCuts.h" |
61 | #include "AliCFEventRecCuts.h" | |
809a4336 | 62 | #include "AliCFManager.h" |
63 | #include "AliCFParticleGenCuts.h" | |
64 | #include "AliCFTrackIsPrimaryCuts.h" | |
65 | #include "AliCFTrackKineCuts.h" | |
66 | #include "AliCFTrackQualityCuts.h" | |
67 | #include "AliESDtrack.h" | |
c2690925 | 68 | #include "AliHFEextraEventCuts.h" |
809a4336 | 69 | |
70 | #include "AliHFEcuts.h" | |
71 | ||
72 | ClassImp(AliHFEcuts) | |
73 | ||
3a72645a | 74 | const Char_t *AliHFEcuts::fgkMCCutName[AliHFEcuts::kNcutStepsMCTrack] = { |
75 | "MCGenerated", | |
c2690925 | 76 | "MCGeneratedZOutNoPileUpCentralityFine", |
3a72645a | 77 | "MCGeneratedEventCut", |
78 | "MCInAcceptance" | |
79 | }; | |
80 | ||
81 | const Char_t * AliHFEcuts::fgkRecoCutName[AliHFEcuts::kNcutStepsRecTrack] = { | |
82 | "NoCuts", | |
83 | "RecKineITSTPC", | |
84 | "Primary", | |
85 | "HFEITS", | |
9250ffbf | 86 | "HFETOF", |
3a72645a | 87 | "HFETRD" |
88 | }; | |
89 | ||
90 | const Char_t * AliHFEcuts::fgkDECutName[AliHFEcuts::kNcutStepsDETrack] = { | |
91 | "HFEDCA" | |
92 | }; | |
93 | ||
c2690925 | 94 | const Char_t * AliHFEcuts::fgkSecvtxCutName[AliHFEcuts::kNcutStepsSecvtxTrack] = { |
95 | "HFESecvtx" | |
96 | }; | |
97 | ||
3a72645a | 98 | const Char_t * AliHFEcuts::fgkEventCutName[AliHFEcuts::kNcutStepsEvent] = { |
99 | "EventStepGenerated", | |
100 | "EventStepRecNoCut", | |
101 | "EventStepRecNoPileUp", | |
102 | "EventStepZRange", | |
103 | "EventStepReconstructed" | |
104 | }; | |
105 | ||
106 | const Char_t * AliHFEcuts::fgkUndefined = "Undefined"; | |
107 | ||
809a4336 | 108 | //__________________________________________________________________ |
109 | AliHFEcuts::AliHFEcuts(): | |
e3fc062d | 110 | TNamed(), |
111 | fRequirements(0), | |
e3ae862b | 112 | fTPCclusterDef(AliHFEextraCuts::kFound), |
113 | fTPCratioDef(AliHFEextraCuts::kFoundOverFindable), | |
e3fc062d | 114 | fMinClustersTPC(0), |
3a72645a | 115 | fMinClustersITS(0), |
e3fc062d | 116 | fMinTrackletsTRD(0), |
117 | fCutITSPixel(0), | |
118 | fCheckITSLayerStatus(kTRUE), | |
119 | fMaxChi2clusterTPC(0.), | |
120 | fMinClusterRatioTPC(0.), | |
121 | fSigmaToVtx(0.), | |
3a72645a | 122 | fVertexRangeZ(20.), |
e3ae862b | 123 | fTOFPIDStep(kFALSE), |
c2690925 | 124 | fTOFMISMATCHStep(kFALSE), |
125 | fUseMixedVertex(kTRUE), | |
126 | fIsIPSigmacut(kFALSE), | |
9250ffbf | 127 | fFractionOfSharedTPCClusters(-1.0), |
128 | fMaxImpactParameterRpar(kFALSE), | |
e3fc062d | 129 | fHistQA(0x0), |
130 | fCutList(0x0), | |
131 | fDebugLevel(0) | |
132 | { | |
133 | // | |
134 | // Dummy Constructor | |
135 | // | |
136 | } | |
137 | ||
138 | //__________________________________________________________________ | |
139 | AliHFEcuts::AliHFEcuts(const Char_t *name, const Char_t *title): | |
140 | TNamed(name, title), | |
809a4336 | 141 | fRequirements(0), |
e3ae862b | 142 | fTPCclusterDef(AliHFEextraCuts::kFound), |
143 | fTPCratioDef(AliHFEextraCuts::kFoundOverFindable), | |
809a4336 | 144 | fMinClustersTPC(0), |
3a72645a | 145 | fMinClustersITS(0), |
809a4336 | 146 | fMinTrackletsTRD(0), |
147 | fCutITSPixel(0), | |
0792aa82 | 148 | fCheckITSLayerStatus(kTRUE), |
809a4336 | 149 | fMaxChi2clusterTPC(0.), |
150 | fMinClusterRatioTPC(0.), | |
151 | fSigmaToVtx(0.), | |
3a72645a | 152 | fVertexRangeZ(20.), |
e3ae862b | 153 | fTOFPIDStep(kFALSE), |
c2690925 | 154 | fTOFMISMATCHStep(kFALSE), |
155 | fUseMixedVertex(kTRUE), | |
156 | fIsIPSigmacut(kFALSE), | |
9250ffbf | 157 | fFractionOfSharedTPCClusters(-1.0), |
158 | fMaxImpactParameterRpar(kFALSE), | |
809a4336 | 159 | fHistQA(0x0), |
dbe3abbe | 160 | fCutList(0x0), |
161 | fDebugLevel(0) | |
809a4336 | 162 | { |
163 | // | |
164 | // Default Constructor | |
165 | // | |
166 | memset(fProdVtx, 0, sizeof(Double_t) * 4); | |
167 | memset(fDCAtoVtx, 0, sizeof(Double_t) * 2); | |
168 | memset(fPtRange, 0, sizeof(Double_t) * 2); | |
c2690925 | 169 | memset(fIPCutParams, 0, sizeof(Float_t) * 4); |
809a4336 | 170 | } |
171 | ||
172 | //__________________________________________________________________ | |
173 | AliHFEcuts::AliHFEcuts(const AliHFEcuts &c): | |
e3fc062d | 174 | TNamed(c), |
809a4336 | 175 | fRequirements(c.fRequirements), |
e3ae862b | 176 | fTPCclusterDef(c.fTPCclusterDef), |
177 | fTPCratioDef(c.fTPCratioDef), | |
e3fc062d | 178 | fMinClustersTPC(0), |
3a72645a | 179 | fMinClustersITS(0), |
e3fc062d | 180 | fMinTrackletsTRD(0), |
181 | fCutITSPixel(0), | |
182 | fCheckITSLayerStatus(0), | |
183 | fMaxChi2clusterTPC(0), | |
184 | fMinClusterRatioTPC(0), | |
185 | fSigmaToVtx(0), | |
3a72645a | 186 | fVertexRangeZ(20.), |
e3ae862b | 187 | fTOFPIDStep(kFALSE), |
c2690925 | 188 | fTOFMISMATCHStep(kFALSE), |
189 | fUseMixedVertex(kTRUE), | |
190 | fIsIPSigmacut(kFALSE), | |
9250ffbf | 191 | fFractionOfSharedTPCClusters(-1.0), |
192 | fMaxImpactParameterRpar(kFALSE), | |
809a4336 | 193 | fHistQA(0x0), |
dbe3abbe | 194 | fCutList(0x0), |
195 | fDebugLevel(0) | |
809a4336 | 196 | { |
197 | // | |
198 | // Copy Constructor | |
199 | // | |
e3fc062d | 200 | c.Copy(*this); |
201 | } | |
202 | ||
203 | //__________________________________________________________________ | |
204 | AliHFEcuts &AliHFEcuts::operator=(const AliHFEcuts &c){ | |
205 | // | |
206 | // Make assignment | |
207 | // | |
208 | if(&c != this) c.Copy(*this); | |
209 | return *this; | |
210 | } | |
211 | ||
212 | //__________________________________________________________________ | |
213 | void AliHFEcuts::Copy(TObject &c) const { | |
214 | // | |
215 | // Performing copy | |
216 | // | |
217 | AliHFEcuts &target = dynamic_cast<AliHFEcuts &>(c); | |
218 | ||
219 | target.fRequirements = fRequirements; | |
e3ae862b | 220 | target.fTPCclusterDef = fTPCclusterDef; |
221 | target.fTPCratioDef = fTPCratioDef; | |
e3fc062d | 222 | target.fMinClustersTPC = fMinClustersTPC; |
3a72645a | 223 | target.fMinClustersITS = fMinClustersITS; |
e3fc062d | 224 | target.fMinTrackletsTRD = fMinTrackletsTRD; |
225 | target.fCutITSPixel = fCutITSPixel; | |
226 | target.fCheckITSLayerStatus = fCheckITSLayerStatus; | |
227 | target.fMaxChi2clusterTPC = fMaxChi2clusterTPC; | |
228 | target.fMinClusterRatioTPC = fMinClusterRatioTPC; | |
229 | target.fSigmaToVtx = fSigmaToVtx; | |
3a72645a | 230 | target.fVertexRangeZ = fVertexRangeZ; |
e3ae862b | 231 | target.fTOFPIDStep = fTOFPIDStep; |
c2690925 | 232 | target.fTOFMISMATCHStep = fTOFMISMATCHStep; |
233 | target.fUseMixedVertex = fUseMixedVertex; | |
234 | target.fIsIPSigmacut = fIsIPSigmacut; | |
9250ffbf | 235 | target.fFractionOfSharedTPCClusters = fFractionOfSharedTPCClusters; |
236 | target.fMaxImpactParameterRpar = fMaxImpactParameterRpar; | |
e3fc062d | 237 | target.fDebugLevel = 0; |
238 | ||
239 | memcpy(target.fProdVtx, fProdVtx, sizeof(Double_t) * 4); | |
240 | memcpy(target.fDCAtoVtx, fDCAtoVtx, sizeof(Double_t) * 2); | |
241 | memcpy(target.fPtRange, fPtRange, sizeof(Double_t) *2); | |
c2690925 | 242 | memcpy(target.fIPCutParams, fIPCutParams, sizeof(Float_t) * 4); |
e3fc062d | 243 | |
244 | // Copy cut List | |
245 | if(target.fCutList){ | |
246 | target.fCutList->Clear(); | |
247 | delete target.fCutList; | |
248 | } | |
249 | if(fCutList){ | |
250 | target.fCutList = dynamic_cast<TObjArray *>(fCutList->Clone()); | |
bf892a6a | 251 | if(target.fCutList) target.fCutList->SetOwner(); // Coverity |
e3fc062d | 252 | } |
253 | if(target.fHistQA){ | |
e3fc062d | 254 | delete target.fHistQA; |
e3fc062d | 255 | } |
256 | if(fHistQA){ | |
257 | // If the QA list was already produced, then we create it new, loop over the cuts and connect all the histos with this list | |
258 | target.fHistQA = new TList; | |
259 | target.fHistQA->SetName(Form("%s_CutQAhistograms", GetName())); | |
c2690925 | 260 | fHistQA->SetOwner(kTRUE); |
e3fc062d | 261 | TIter cit(target.fCutList); |
262 | TObjArray *clist = NULL; | |
263 | AliCFCutBase *co = NULL; | |
264 | while((clist = dynamic_cast<TObjArray *>(cit()))){ | |
265 | TIter cit1(clist); | |
266 | while((co = dynamic_cast<AliCFCutBase *>(cit1()))) co->SetQAOn(target.fHistQA); | |
267 | } | |
268 | } | |
809a4336 | 269 | } |
270 | ||
271 | //__________________________________________________________________ | |
272 | AliHFEcuts::~AliHFEcuts(){ | |
273 | // | |
274 | // Destruktor | |
275 | // | |
276 | if(fCutList){ | |
277 | fCutList->Delete(); | |
278 | delete fCutList; | |
279 | } | |
280 | fCutList = 0x0; | |
c2690925 | 281 | if(fHistQA) delete fHistQA; |
809a4336 | 282 | } |
283 | ||
284 | //__________________________________________________________________ | |
285 | void AliHFEcuts::Initialize(AliCFManager *cfm){ | |
50685501 | 286 | // |
287 | // Initializes the cut objects from the correction framework | |
288 | // Publishes the cuts to the correction framework manager | |
289 | // | |
faee3b18 | 290 | AliDebug(2, "Called"); |
3a72645a | 291 | const Int_t kMCOffset = kNcutStepsMCTrack; |
292 | const Int_t kRecOffset = kNcutStepsRecTrack; | |
e3fc062d | 293 | if(fCutList) |
294 | fCutList->Delete(); | |
295 | else{ | |
296 | fCutList = new TObjArray; | |
297 | fCutList->SetOwner(); | |
298 | } | |
299 | if(IsQAOn()){ | |
300 | fHistQA = new TList; | |
301 | fHistQA->SetName(Form("%s_CutQAhistograms", GetName())); | |
c2690925 | 302 | fHistQA->SetOwner(kTRUE); |
722347d8 | 303 | } |
304 | ||
809a4336 | 305 | // Call all the setters for the cuts |
306 | SetParticleGenCutList(); | |
307 | SetAcceptanceCutList(); | |
722347d8 | 308 | SetRecKineITSTPCCutList(); |
809a4336 | 309 | SetRecPrimaryCutList(); |
dbe3abbe | 310 | SetHFElectronITSCuts(); |
9250ffbf | 311 | SetHFElectronTOFCuts(); |
dbe3abbe | 312 | SetHFElectronTRDCuts(); |
3a72645a | 313 | SetHFElectronDcaCuts(); |
dbe3abbe | 314 | |
9bcfd1ab | 315 | // Publish to the cuts which analysis type they are (ESD Analysis by default) |
316 | if(IsAOD()){ | |
317 | AliInfo("Setting AOD Analysis"); | |
318 | TObjArray *genCuts = dynamic_cast<TObjArray *>(fCutList->FindObject("fPartGenCuts")); | |
319 | if(genCuts){ | |
320 | AliCFParticleGenCuts *myGenCut = dynamic_cast<AliCFParticleGenCuts *>(genCuts->FindObject("fCutsGenMC")); | |
321 | if(myGenCut) myGenCut->SetAODMC(kTRUE); | |
322 | } | |
323 | } | |
324 | ||
0792aa82 | 325 | // Connect the event cuts |
70da6c5a | 326 | SetEventCutList(kEventStepGenerated); |
0792aa82 | 327 | SetEventCutList(kEventStepReconstructed); |
328 | cfm->SetEventCutsList(kEventStepGenerated, dynamic_cast<TObjArray *>(fCutList->FindObject("fEvGenCuts"))); | |
70da6c5a | 329 | cfm->SetEventCutsList(kEventStepReconstructed, dynamic_cast<TObjArray *>(fCutList->FindObject("fEvRecCuts"))); |
809a4336 | 330 | |
0792aa82 | 331 | // Connect the particle cuts |
3a72645a | 332 | // 1st MC |
809a4336 | 333 | cfm->SetParticleCutsList(kStepMCGenerated, dynamic_cast<TObjArray *>(fCutList->FindObject("fPartGenCuts"))); |
334 | cfm->SetParticleCutsList(kStepMCInAcceptance, dynamic_cast<TObjArray *>(fCutList->FindObject("fPartAccCuts"))); | |
3a72645a | 335 | // 2nd Reco |
336 | cfm->SetParticleCutsList(kStepRecKineITSTPC + kMCOffset, dynamic_cast<TObjArray *>(fCutList->FindObject("fPartRecKineITSTPCCuts"))); | |
337 | cfm->SetParticleCutsList(kStepRecPrim + kMCOffset, dynamic_cast<TObjArray *>(fCutList->FindObject("fPartPrimCuts"))); | |
338 | cfm->SetParticleCutsList(kStepHFEcutsITS + kMCOffset, dynamic_cast<TObjArray *>(fCutList->FindObject("fPartHFECutsITS"))); | |
9250ffbf | 339 | cfm->SetParticleCutsList(kStepHFEcutsTOF+ kMCOffset, dynamic_cast<TObjArray *>(fCutList->FindObject("fPartHFECutsTOF"))); |
3a72645a | 340 | cfm->SetParticleCutsList(kStepHFEcutsTRD + kMCOffset, dynamic_cast<TObjArray *>(fCutList->FindObject("fPartHFECutsTRD"))); |
341 | cfm->SetParticleCutsList(kStepHFEcutsDca + kRecOffset + kMCOffset, dynamic_cast<TObjArray *>(fCutList->FindObject("fPartHFECutsDca"))); | |
dbe3abbe | 342 | |
809a4336 | 343 | } |
344 | ||
345 | //__________________________________________________________________ | |
346 | void AliHFEcuts::Initialize(){ | |
347 | // Call all the setters for the cuts | |
faee3b18 | 348 | AliDebug(2, "Called\n"); |
e3fc062d | 349 | if(fCutList) |
350 | fCutList->Delete(); | |
351 | else{ | |
352 | fCutList = new TObjArray; | |
353 | fCutList->SetOwner(); | |
354 | } | |
355 | if(IsQAOn()){ | |
356 | fHistQA = new TList; | |
357 | fHistQA->SetName(Form("%s_CutQAhistograms", GetName())); | |
358 | fHistQA->SetOwner(kFALSE); | |
359 | } | |
809a4336 | 360 | SetParticleGenCutList(); |
361 | SetAcceptanceCutList(); | |
722347d8 | 362 | SetRecKineITSTPCCutList(); |
809a4336 | 363 | SetRecPrimaryCutList(); |
dbe3abbe | 364 | SetHFElectronITSCuts(); |
9250ffbf | 365 | SetHFElectronTOFCuts(); |
dbe3abbe | 366 | SetHFElectronTRDCuts(); |
3a72645a | 367 | SetHFElectronDcaCuts(); |
dbe3abbe | 368 | |
809a4336 | 369 | } |
370 | ||
0792aa82 | 371 | //__________________________________________________________________ |
372 | void AliHFEcuts::SetEventCutList(Int_t istep){ | |
373 | // | |
374 | // Cuts for Event Selection | |
375 | // | |
faee3b18 | 376 | AliDebug(2, "Called\n"); |
0792aa82 | 377 | TObjArray *arr = new TObjArray; |
378 | if(istep == kEventStepGenerated){ | |
faee3b18 | 379 | AliCFEventGenCuts *evGenCuts = new AliCFEventGenCuts((Char_t *)"fCutsEvGen", (Char_t *)"Event Generated cuts"); |
3a72645a | 380 | //evGenCuts->SetNTracksCut(1); |
0792aa82 | 381 | evGenCuts->SetRequireVtxCuts(kTRUE); |
3a72645a | 382 | //evGenCuts->SetVertexXCut(-1, 1); |
383 | //evGenCuts->SetVertexYCut(-1, 1); | |
384 | evGenCuts->SetVertexZCut(-fVertexRangeZ, fVertexRangeZ); | |
69ac0e6f | 385 | if(IsQAOn()) evGenCuts->SetQAOn(fHistQA); |
0792aa82 | 386 | |
387 | arr->SetName("fEvGenCuts"); | |
388 | arr->AddLast(evGenCuts); | |
389 | } else { | |
c2690925 | 390 | |
391 | if(!fUseMixedVertex) { | |
392 | AliCFEventRecCuts *evRecCuts = new AliCFEventRecCuts((Char_t *)"fCutsEvRec", (Char_t *)"Event Reconstructed cuts"); | |
393 | //evRecCuts->SetNTracksCut(1); | |
394 | evRecCuts->SetRequireVtxCuts(kTRUE); | |
395 | //evRecCuts->SetVertexXCut(-1, 1); | |
396 | //evRecCuts->SetVertexYCut(-1, 1); | |
397 | //evRecCuts->SetVertexZCut(-30, 30); | |
398 | evRecCuts->SetVertexZCut(-fVertexRangeZ, fVertexRangeZ); | |
399 | evRecCuts->SetVertexNContributors(1,(Int_t)1.e9); | |
400 | if(IsQAOn()) evRecCuts->SetQAOn(fHistQA); | |
401 | arr->SetName("fEvRecCuts"); | |
402 | arr->AddLast(evRecCuts); | |
403 | } else { | |
404 | AliHFEextraEventCuts *evRecCuts = new AliHFEextraEventCuts((Char_t *)"fCutsEvRec", (Char_t *)"Event Reconstructed cuts"); | |
405 | evRecCuts->SetRequireVtxCuts(kTRUE); | |
406 | evRecCuts->SetUseMixedVertex(); | |
407 | evRecCuts->SetVertexZCut(-fVertexRangeZ, fVertexRangeZ); | |
408 | //evRecCuts->SetVertexNContributors(1,(Int_t)1.e9); | |
409 | if(IsQAOn()) evRecCuts->SetQAOn(fHistQA); | |
410 | arr->SetName("fEvRecCuts"); | |
411 | arr->AddLast(evRecCuts); | |
412 | } | |
0792aa82 | 413 | } |
414 | fCutList->AddLast(arr); | |
415 | } | |
416 | ||
809a4336 | 417 | //__________________________________________________________________ |
418 | void AliHFEcuts::SetParticleGenCutList(){ | |
419 | // | |
420 | // Initialize Particle Cuts for Monte Carlo Tracks | |
421 | // Production Vertex: < 1cm (Beampipe) | |
422 | // Particle Species: Electrons | |
423 | // Eta: < 0.9 (TRD-TOF acceptance) | |
424 | // | |
faee3b18 | 425 | |
426 | TObjArray *mcCuts = new TObjArray; | |
427 | mcCuts->SetName("fPartGenCuts"); | |
428 | ||
429 | // | |
430 | AliDebug(2, "Called\n"); | |
809a4336 | 431 | AliCFParticleGenCuts *genCuts = new AliCFParticleGenCuts("fCutsGenMC", "Particle Generation Cuts"); |
432 | genCuts->SetRequireIsCharged(); | |
faee3b18 | 433 | if(IsRequirePrimary()) { |
434 | genCuts->SetRequireIsPrimary(); | |
435 | } | |
809a4336 | 436 | if(IsRequireProdVertex()){ |
faee3b18 | 437 | AliDebug(3, Form("Vertex Range: fProdVtx[0] %f, fProdVtx[1] %f, fProdVtx[2] %f, fProdVtx[3] %f", fProdVtx[0], fProdVtx[1], fProdVtx[2], fProdVtx[3])); |
809a4336 | 438 | genCuts->SetProdVtxRangeX(fProdVtx[0], fProdVtx[1]); |
439 | genCuts->SetProdVtxRangeY(fProdVtx[2], fProdVtx[3]); | |
70da6c5a | 440 | genCuts->SetProdVtxRange2D(kTRUE); // Use ellipse |
809a4336 | 441 | } |
722347d8 | 442 | genCuts->SetRequirePdgCode(11, kTRUE); |
e3fc062d | 443 | if(IsQAOn()) genCuts->SetQAOn(fHistQA); |
809a4336 | 444 | |
faee3b18 | 445 | // Add |
809a4336 | 446 | mcCuts->AddLast(genCuts); |
faee3b18 | 447 | |
448 | // | |
449 | if(IsRequireKineMCCuts()) { | |
450 | AliCFTrackKineCuts *kineMCcuts = new AliCFTrackKineCuts((Char_t *)"fCutsKineMC", (Char_t *)"MC Kine Cuts"); | |
451 | kineMCcuts->SetPtRange(fPtRange[0], fPtRange[1]); | |
452 | kineMCcuts->SetEtaRange(-0.8, 0.8); | |
e3fc062d | 453 | if(IsQAOn()) kineMCcuts->SetQAOn(fHistQA); |
faee3b18 | 454 | mcCuts->AddLast(kineMCcuts); |
455 | } | |
456 | ||
809a4336 | 457 | fCutList->AddLast(mcCuts); |
458 | } | |
459 | ||
460 | //__________________________________________________________________ | |
461 | void AliHFEcuts::SetAcceptanceCutList(){ | |
462 | // | |
463 | // Initialize Particle (Monte Carlo) acceptance cuts | |
464 | // Min. Required Hist for Detectors: | |
465 | // ITS [3] | |
466 | // TPC [2] | |
722347d8 | 467 | // TRD [2*nTracklets] |
809a4336 | 468 | // TOF [0] |
469 | // | |
faee3b18 | 470 | AliDebug(2, "Called\n"); |
809a4336 | 471 | AliCFAcceptanceCuts *accCuts = new AliCFAcceptanceCuts("fCutsAccMC", "MC Acceptance Cuts"); |
472 | accCuts->SetMinNHitITS(3); | |
473 | accCuts->SetMinNHitTPC(2); | |
722347d8 | 474 | accCuts->SetMinNHitTRD(2*fMinTrackletsTRD); |
e3fc062d | 475 | if(IsQAOn()) accCuts->SetQAOn(fHistQA); |
809a4336 | 476 | |
75d81601 | 477 | TObjArray *partAccCuts = new TObjArray(); |
478 | partAccCuts->SetName("fPartAccCuts"); | |
479 | partAccCuts->AddLast(accCuts); | |
480 | fCutList->AddLast(partAccCuts); | |
809a4336 | 481 | } |
482 | ||
483 | //__________________________________________________________________ | |
722347d8 | 484 | void AliHFEcuts::SetRecKineITSTPCCutList(){ |
809a4336 | 485 | // |
486 | // Track Kinematics and Quality cuts (Based on the Standard cuts from PWG0) | |
487 | // | |
722347d8 | 488 | // ITS refit |
809a4336 | 489 | // Variances: |
490 | // y: 2 | |
491 | // z: 2 | |
492 | // sin(phi): 0.5 | |
493 | // tan(theta): 0.5 | |
494 | // 1/pt: 2 | |
495 | // Min. Number of Clusters: | |
496 | // TPC: 50 | |
497 | // RefitRequired: | |
809a4336 | 498 | // TPC |
499 | // Chi2 per TPC cluster: 3.5 | |
500 | // | |
501 | // Kinematics: | |
502 | // Momentum Range: 100MeV - 20GeV | |
503 | // Eta: < 0.9 (TRD-TOF acceptance) | |
504 | // | |
faee3b18 | 505 | AliDebug(2, "Called\n"); |
506 | AliCFTrackQualityCuts *trackQuality = new AliCFTrackQualityCuts((Char_t *)"fCutsQualityRec", (Char_t *)"REC Track Quality Cuts"); | |
3a72645a | 507 | trackQuality->SetMinNClusterITS(fMinClustersITS); |
809a4336 | 508 | trackQuality->SetMaxChi2PerClusterTPC(fMaxChi2clusterTPC); |
722347d8 | 509 | trackQuality->SetStatus(AliESDtrack::kTPCrefit | AliESDtrack::kITSrefit); |
3a72645a | 510 | //trackQuality->SetMaxCovDiagonalElements(2., 2., 0.5, 0.5, 2); |
809a4336 | 511 | |
722347d8 | 512 | AliHFEextraCuts *hfecuts = new AliHFEextraCuts("fCutsHFElectronGroupTPC","Extra cuts from the HFE group"); |
722347d8 | 513 | hfecuts->SetDebugLevel(fDebugLevel); |
3a72645a | 514 | |
515 | // Set the cut in the TPC number of clusters | |
e3ae862b | 516 | hfecuts->SetMinNClustersTPC(fMinClustersTPC, fTPCclusterDef); |
517 | hfecuts->SetClusterRatioTPC(fMinClusterRatioTPC, fTPCratioDef); | |
9250ffbf | 518 | if(fFractionOfSharedTPCClusters > 0.0) hfecuts->SetFractionOfTPCSharedClusters(fFractionOfSharedTPCClusters); |
722347d8 | 519 | |
faee3b18 | 520 | AliCFTrackKineCuts *kineCuts = new AliCFTrackKineCuts((Char_t *)"fCutsKineRec", (Char_t *)"REC Kine Cuts"); |
809a4336 | 521 | kineCuts->SetPtRange(fPtRange[0], fPtRange[1]); |
70da6c5a | 522 | kineCuts->SetEtaRange(-0.8, 0.8); |
809a4336 | 523 | |
e3fc062d | 524 | if(IsQAOn()){ |
809a4336 | 525 | trackQuality->SetQAOn(fHistQA); |
722347d8 | 526 | hfecuts->SetQAOn(fHistQA); |
809a4336 | 527 | kineCuts->SetQAOn(fHistQA); |
528 | } | |
529 | ||
530 | TObjArray *recCuts = new TObjArray; | |
722347d8 | 531 | recCuts->SetName("fPartRecKineITSTPCCuts"); |
809a4336 | 532 | recCuts->AddLast(trackQuality); |
722347d8 | 533 | recCuts->AddLast(hfecuts); |
809a4336 | 534 | recCuts->AddLast(kineCuts); |
535 | fCutList->AddLast(recCuts); | |
536 | } | |
537 | ||
538 | //__________________________________________________________________ | |
539 | void AliHFEcuts::SetRecPrimaryCutList(){ | |
540 | // | |
541 | // Primary cuts (based on standard cuts from PWG0): | |
542 | // DCA to Vertex: | |
543 | // XY: 3. cm | |
544 | // Z: 10. cm | |
545 | // No Kink daughters | |
546 | // | |
faee3b18 | 547 | AliDebug(2, "Called\n"); |
548 | AliCFTrackIsPrimaryCuts *primaryCut = new AliCFTrackIsPrimaryCuts((Char_t *)"fCutsPrimaryCuts", (Char_t *)"REC Primary Cuts"); | |
809a4336 | 549 | if(IsRequireDCAToVertex()){ |
78ea5ef4 | 550 | //primaryCut->SetDCAToVertex2D(kTRUE); |
809a4336 | 551 | primaryCut->SetMaxDCAToVertexXY(fDCAtoVtx[0]); |
552 | primaryCut->SetMaxDCAToVertexZ(fDCAtoVtx[1]); | |
553 | } | |
554 | if(IsRequireSigmaToVertex()){ | |
555 | primaryCut->SetRequireSigmaToVertex(kTRUE); | |
556 | primaryCut->SetMaxNSigmaToVertex(fSigmaToVtx); | |
557 | } | |
558 | primaryCut->SetAcceptKinkDaughters(kFALSE); | |
e3fc062d | 559 | if(IsQAOn()) primaryCut->SetQAOn(fHistQA); |
809a4336 | 560 | |
9250ffbf | 561 | AliHFEextraCuts *hfecuts = new AliHFEextraCuts("fCutsPrimaryCutsextra","Extra cuts from the HFE group"); |
562 | hfecuts->SetMaxImpactParameterRpar(fMaxImpactParameterRpar); | |
563 | ||
809a4336 | 564 | TObjArray *primCuts = new TObjArray; |
565 | primCuts->SetName("fPartPrimCuts"); | |
566 | primCuts->AddLast(primaryCut); | |
9250ffbf | 567 | if(fMaxImpactParameterRpar){ |
568 | primCuts->AddLast(hfecuts); | |
569 | } | |
809a4336 | 570 | fCutList->AddLast(primCuts); |
571 | } | |
572 | ||
573 | //__________________________________________________________________ | |
dbe3abbe | 574 | void AliHFEcuts::SetHFElectronITSCuts(){ |
809a4336 | 575 | // |
dbe3abbe | 576 | // Special Cuts introduced by the HFElectron Group: ITS |
809a4336 | 577 | // |
faee3b18 | 578 | AliDebug(2, "Called\n"); |
dbe3abbe | 579 | AliHFEextraCuts *hfecuts = new AliHFEextraCuts("fCutsHFElectronGroupPixels","Extra cuts from the HFE group"); |
809a4336 | 580 | if(IsRequireITSpixel()){ |
581 | hfecuts->SetRequireITSpixel(AliHFEextraCuts::ITSPixel_t(fCutITSPixel)); | |
0792aa82 | 582 | hfecuts->SetCheckITSstatus(fCheckITSLayerStatus); |
809a4336 | 583 | } |
dbe3abbe | 584 | |
e3fc062d | 585 | if(IsQAOn()) hfecuts->SetQAOn(fHistQA); |
78ea5ef4 | 586 | hfecuts->SetDebugLevel(fDebugLevel); |
587 | ||
dbe3abbe | 588 | TObjArray *hfeCuts = new TObjArray; |
589 | hfeCuts->SetName("fPartHFECutsITS"); | |
590 | hfeCuts->AddLast(hfecuts); | |
591 | fCutList->AddLast(hfeCuts); | |
592 | } | |
593 | ||
dbe3abbe | 594 | //__________________________________________________________________ |
9250ffbf | 595 | void AliHFEcuts::SetHFElectronTOFCuts(){ |
dbe3abbe | 596 | // |
597 | // Special Cuts introduced by the HFElectron Group: TRD | |
598 | // | |
faee3b18 | 599 | AliDebug(2, "Called\n"); |
9250ffbf | 600 | AliHFEextraCuts *hfecuts = new AliHFEextraCuts("fCutsHFElectronGroupTOF","Extra cuts from the HFE group on TOF PID"); |
e3ae862b | 601 | if(fTOFPIDStep) hfecuts->SetTOFPID(kTRUE); |
c2690925 | 602 | if(fTOFMISMATCHStep) hfecuts->SetTOFMISMATCH(kTRUE); |
e3fc062d | 603 | if(IsQAOn()) hfecuts->SetQAOn(fHistQA); |
78ea5ef4 | 604 | hfecuts->SetDebugLevel(fDebugLevel); |
dbe3abbe | 605 | |
9250ffbf | 606 | TObjArray *hfeCuts = new TObjArray; |
607 | hfeCuts->SetName("fPartHFECutsTOF"); | |
608 | hfeCuts->AddLast(hfecuts); | |
609 | fCutList->AddLast(hfeCuts); | |
610 | } | |
611 | ||
612 | //__________________________________________________________________ | |
613 | void AliHFEcuts::SetHFElectronTRDCuts(){ | |
614 | // | |
615 | // Special Cuts introduced by the HFElectron Group: TRD | |
616 | // | |
617 | AliDebug(2, "Called\n"); | |
618 | AliHFEextraCuts *hfecuts = new AliHFEextraCuts("fCutsHFElectronGroupTRD","Extra cuts from the HFE group on TRD PID"); | |
619 | if(fMinTrackletsTRD > 0.) hfecuts->SetMinTrackletsTRD(fMinTrackletsTRD); | |
620 | if(IsQAOn()) hfecuts->SetQAOn(fHistQA); | |
621 | hfecuts->SetDebugLevel(fDebugLevel); | |
622 | ||
dbe3abbe | 623 | TObjArray *hfeCuts = new TObjArray; |
624 | hfeCuts->SetName("fPartHFECutsTRD"); | |
809a4336 | 625 | hfeCuts->AddLast(hfecuts); |
626 | fCutList->AddLast(hfeCuts); | |
627 | } | |
628 | ||
809a4336 | 629 | //__________________________________________________________________ |
3a72645a | 630 | void AliHFEcuts::SetHFElectronDcaCuts(){ |
631 | // | |
632 | // Special Cuts introduced by the HFElectron Group: minimum of impact parameter | |
633 | // | |
634 | AliDebug(2, "Called\n"); | |
635 | AliHFEextraCuts *hfecuts = new AliHFEextraCuts("fCutsHFElectronGroupDCA","Extra cuts from the HFE group"); | |
c2690925 | 636 | hfecuts->SetMinHFEImpactParamR(fIPCutParams,fIsIPSigmacut); |
3a72645a | 637 | if(IsQAOn()) hfecuts->SetQAOn(fHistQA); |
638 | hfecuts->SetDebugLevel(fDebugLevel); | |
639 | ||
640 | TObjArray *hfeCuts = new TObjArray; | |
641 | hfeCuts->SetName("fPartHFECutsDca"); | |
642 | hfeCuts->AddLast(hfecuts); | |
643 | fCutList->AddLast(hfeCuts); | |
644 | } | |
645 | ||
646 | //__________________________________________________________________ | |
647 | Bool_t AliHFEcuts::CheckParticleCuts(UInt_t step, TObject *o){ | |
809a4336 | 648 | // |
649 | // Checks the cuts without using the correction framework manager | |
650 | // | |
faee3b18 | 651 | AliDebug(2, "Called\n"); |
c2690925 | 652 | TString stepnames[kNcutStepsMCTrack + kNcutStepsRecTrack + kNcutStepsDETrack + kNcutStepsSecvtxTrack + 1] = {"fPartGenCuts","fPartEvCutPileupZ","fPartEvCut","fPartAccCuts","fPartRecNoCuts","fPartRecKineITSTPCCuts", "fPartPrimCuts", "fPartHFECutsITS","fPartHFECutsTRD","fPartHFECutsDca", "fPartHFECutsSecvtx"}; |
3a72645a | 653 | AliDebug(2, Form("Doing cut %s", stepnames[step].Data())); |
e3fc062d | 654 | TObjArray *cuts = dynamic_cast<TObjArray *>(fCutList->FindObject(stepnames[step].Data())); |
809a4336 | 655 | if(!cuts) return kTRUE; |
3a72645a | 656 | TIter it(cuts); |
809a4336 | 657 | AliCFCutBase *mycut; |
658 | Bool_t status = kTRUE; | |
3a72645a | 659 | while((mycut = dynamic_cast<AliCFCutBase *>(it()))){ |
809a4336 | 660 | status &= mycut->IsSelected(o); |
661 | } | |
809a4336 | 662 | return status; |
663 | } |