]>
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 | |
e156c3bb | 369 | // Connect the event cuts |
370 | SetEventCutList(kEventStepGenerated); | |
371 | SetEventCutList(kEventStepReconstructed); | |
372 | ||
373 | ||
809a4336 | 374 | } |
375 | ||
0792aa82 | 376 | //__________________________________________________________________ |
377 | void AliHFEcuts::SetEventCutList(Int_t istep){ | |
378 | // | |
379 | // Cuts for Event Selection | |
380 | // | |
faee3b18 | 381 | AliDebug(2, "Called\n"); |
0792aa82 | 382 | TObjArray *arr = new TObjArray; |
383 | if(istep == kEventStepGenerated){ | |
faee3b18 | 384 | AliCFEventGenCuts *evGenCuts = new AliCFEventGenCuts((Char_t *)"fCutsEvGen", (Char_t *)"Event Generated cuts"); |
3a72645a | 385 | //evGenCuts->SetNTracksCut(1); |
0792aa82 | 386 | evGenCuts->SetRequireVtxCuts(kTRUE); |
3a72645a | 387 | //evGenCuts->SetVertexXCut(-1, 1); |
388 | //evGenCuts->SetVertexYCut(-1, 1); | |
389 | evGenCuts->SetVertexZCut(-fVertexRangeZ, fVertexRangeZ); | |
69ac0e6f | 390 | if(IsQAOn()) evGenCuts->SetQAOn(fHistQA); |
0792aa82 | 391 | |
392 | arr->SetName("fEvGenCuts"); | |
393 | arr->AddLast(evGenCuts); | |
394 | } else { | |
c2690925 | 395 | |
396 | if(!fUseMixedVertex) { | |
397 | AliCFEventRecCuts *evRecCuts = new AliCFEventRecCuts((Char_t *)"fCutsEvRec", (Char_t *)"Event Reconstructed cuts"); | |
398 | //evRecCuts->SetNTracksCut(1); | |
399 | evRecCuts->SetRequireVtxCuts(kTRUE); | |
400 | //evRecCuts->SetVertexXCut(-1, 1); | |
401 | //evRecCuts->SetVertexYCut(-1, 1); | |
402 | //evRecCuts->SetVertexZCut(-30, 30); | |
403 | evRecCuts->SetVertexZCut(-fVertexRangeZ, fVertexRangeZ); | |
404 | evRecCuts->SetVertexNContributors(1,(Int_t)1.e9); | |
405 | if(IsQAOn()) evRecCuts->SetQAOn(fHistQA); | |
406 | arr->SetName("fEvRecCuts"); | |
407 | arr->AddLast(evRecCuts); | |
408 | } else { | |
409 | AliHFEextraEventCuts *evRecCuts = new AliHFEextraEventCuts((Char_t *)"fCutsEvRec", (Char_t *)"Event Reconstructed cuts"); | |
410 | evRecCuts->SetRequireVtxCuts(kTRUE); | |
411 | evRecCuts->SetUseMixedVertex(); | |
412 | evRecCuts->SetVertexZCut(-fVertexRangeZ, fVertexRangeZ); | |
413 | //evRecCuts->SetVertexNContributors(1,(Int_t)1.e9); | |
414 | if(IsQAOn()) evRecCuts->SetQAOn(fHistQA); | |
415 | arr->SetName("fEvRecCuts"); | |
416 | arr->AddLast(evRecCuts); | |
417 | } | |
0792aa82 | 418 | } |
419 | fCutList->AddLast(arr); | |
420 | } | |
421 | ||
809a4336 | 422 | //__________________________________________________________________ |
423 | void AliHFEcuts::SetParticleGenCutList(){ | |
424 | // | |
425 | // Initialize Particle Cuts for Monte Carlo Tracks | |
e156c3bb | 426 | // Production Vertex Radius: < 3cm |
809a4336 | 427 | // Particle Species: Electrons |
e156c3bb | 428 | // Eta: < 0.8 |
809a4336 | 429 | // |
faee3b18 | 430 | |
431 | TObjArray *mcCuts = new TObjArray; | |
432 | mcCuts->SetName("fPartGenCuts"); | |
433 | ||
434 | // | |
435 | AliDebug(2, "Called\n"); | |
809a4336 | 436 | AliCFParticleGenCuts *genCuts = new AliCFParticleGenCuts("fCutsGenMC", "Particle Generation Cuts"); |
437 | genCuts->SetRequireIsCharged(); | |
faee3b18 | 438 | if(IsRequirePrimary()) { |
439 | genCuts->SetRequireIsPrimary(); | |
440 | } | |
809a4336 | 441 | if(IsRequireProdVertex()){ |
faee3b18 | 442 | 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 | 443 | genCuts->SetProdVtxRangeX(fProdVtx[0], fProdVtx[1]); |
444 | genCuts->SetProdVtxRangeY(fProdVtx[2], fProdVtx[3]); | |
70da6c5a | 445 | genCuts->SetProdVtxRange2D(kTRUE); // Use ellipse |
809a4336 | 446 | } |
722347d8 | 447 | genCuts->SetRequirePdgCode(11, kTRUE); |
e3fc062d | 448 | if(IsQAOn()) genCuts->SetQAOn(fHistQA); |
809a4336 | 449 | |
faee3b18 | 450 | // Add |
809a4336 | 451 | mcCuts->AddLast(genCuts); |
faee3b18 | 452 | |
453 | // | |
454 | if(IsRequireKineMCCuts()) { | |
455 | AliCFTrackKineCuts *kineMCcuts = new AliCFTrackKineCuts((Char_t *)"fCutsKineMC", (Char_t *)"MC Kine Cuts"); | |
456 | kineMCcuts->SetPtRange(fPtRange[0], fPtRange[1]); | |
457 | kineMCcuts->SetEtaRange(-0.8, 0.8); | |
e3fc062d | 458 | if(IsQAOn()) kineMCcuts->SetQAOn(fHistQA); |
faee3b18 | 459 | mcCuts->AddLast(kineMCcuts); |
460 | } | |
461 | ||
809a4336 | 462 | fCutList->AddLast(mcCuts); |
463 | } | |
464 | ||
465 | //__________________________________________________________________ | |
466 | void AliHFEcuts::SetAcceptanceCutList(){ | |
467 | // | |
468 | // Initialize Particle (Monte Carlo) acceptance cuts | |
469 | // Min. Required Hist for Detectors: | |
470 | // ITS [3] | |
471 | // TPC [2] | |
722347d8 | 472 | // TRD [2*nTracklets] |
809a4336 | 473 | // TOF [0] |
474 | // | |
faee3b18 | 475 | AliDebug(2, "Called\n"); |
809a4336 | 476 | AliCFAcceptanceCuts *accCuts = new AliCFAcceptanceCuts("fCutsAccMC", "MC Acceptance Cuts"); |
477 | accCuts->SetMinNHitITS(3); | |
478 | accCuts->SetMinNHitTPC(2); | |
722347d8 | 479 | accCuts->SetMinNHitTRD(2*fMinTrackletsTRD); |
e3fc062d | 480 | if(IsQAOn()) accCuts->SetQAOn(fHistQA); |
809a4336 | 481 | |
75d81601 | 482 | TObjArray *partAccCuts = new TObjArray(); |
483 | partAccCuts->SetName("fPartAccCuts"); | |
484 | partAccCuts->AddLast(accCuts); | |
485 | fCutList->AddLast(partAccCuts); | |
809a4336 | 486 | } |
487 | ||
488 | //__________________________________________________________________ | |
722347d8 | 489 | void AliHFEcuts::SetRecKineITSTPCCutList(){ |
809a4336 | 490 | // |
491 | // Track Kinematics and Quality cuts (Based on the Standard cuts from PWG0) | |
492 | // | |
722347d8 | 493 | // ITS refit |
809a4336 | 494 | // Variances: |
495 | // y: 2 | |
496 | // z: 2 | |
497 | // sin(phi): 0.5 | |
498 | // tan(theta): 0.5 | |
499 | // 1/pt: 2 | |
500 | // Min. Number of Clusters: | |
501 | // TPC: 50 | |
502 | // RefitRequired: | |
809a4336 | 503 | // TPC |
504 | // Chi2 per TPC cluster: 3.5 | |
505 | // | |
506 | // Kinematics: | |
507 | // Momentum Range: 100MeV - 20GeV | |
508 | // Eta: < 0.9 (TRD-TOF acceptance) | |
509 | // | |
faee3b18 | 510 | AliDebug(2, "Called\n"); |
511 | AliCFTrackQualityCuts *trackQuality = new AliCFTrackQualityCuts((Char_t *)"fCutsQualityRec", (Char_t *)"REC Track Quality Cuts"); | |
3a72645a | 512 | trackQuality->SetMinNClusterITS(fMinClustersITS); |
809a4336 | 513 | trackQuality->SetMaxChi2PerClusterTPC(fMaxChi2clusterTPC); |
722347d8 | 514 | trackQuality->SetStatus(AliESDtrack::kTPCrefit | AliESDtrack::kITSrefit); |
3a72645a | 515 | //trackQuality->SetMaxCovDiagonalElements(2., 2., 0.5, 0.5, 2); |
809a4336 | 516 | |
722347d8 | 517 | AliHFEextraCuts *hfecuts = new AliHFEextraCuts("fCutsHFElectronGroupTPC","Extra cuts from the HFE group"); |
722347d8 | 518 | hfecuts->SetDebugLevel(fDebugLevel); |
3a72645a | 519 | |
520 | // Set the cut in the TPC number of clusters | |
e3ae862b | 521 | hfecuts->SetMinNClustersTPC(fMinClustersTPC, fTPCclusterDef); |
522 | hfecuts->SetClusterRatioTPC(fMinClusterRatioTPC, fTPCratioDef); | |
9250ffbf | 523 | if(fFractionOfSharedTPCClusters > 0.0) hfecuts->SetFractionOfTPCSharedClusters(fFractionOfSharedTPCClusters); |
722347d8 | 524 | |
faee3b18 | 525 | AliCFTrackKineCuts *kineCuts = new AliCFTrackKineCuts((Char_t *)"fCutsKineRec", (Char_t *)"REC Kine Cuts"); |
809a4336 | 526 | kineCuts->SetPtRange(fPtRange[0], fPtRange[1]); |
70da6c5a | 527 | kineCuts->SetEtaRange(-0.8, 0.8); |
809a4336 | 528 | |
e3fc062d | 529 | if(IsQAOn()){ |
809a4336 | 530 | trackQuality->SetQAOn(fHistQA); |
722347d8 | 531 | hfecuts->SetQAOn(fHistQA); |
809a4336 | 532 | kineCuts->SetQAOn(fHistQA); |
533 | } | |
534 | ||
535 | TObjArray *recCuts = new TObjArray; | |
722347d8 | 536 | recCuts->SetName("fPartRecKineITSTPCCuts"); |
809a4336 | 537 | recCuts->AddLast(trackQuality); |
722347d8 | 538 | recCuts->AddLast(hfecuts); |
809a4336 | 539 | recCuts->AddLast(kineCuts); |
540 | fCutList->AddLast(recCuts); | |
541 | } | |
542 | ||
543 | //__________________________________________________________________ | |
544 | void AliHFEcuts::SetRecPrimaryCutList(){ | |
545 | // | |
546 | // Primary cuts (based on standard cuts from PWG0): | |
547 | // DCA to Vertex: | |
548 | // XY: 3. cm | |
549 | // Z: 10. cm | |
550 | // No Kink daughters | |
551 | // | |
faee3b18 | 552 | AliDebug(2, "Called\n"); |
553 | AliCFTrackIsPrimaryCuts *primaryCut = new AliCFTrackIsPrimaryCuts((Char_t *)"fCutsPrimaryCuts", (Char_t *)"REC Primary Cuts"); | |
809a4336 | 554 | if(IsRequireDCAToVertex()){ |
78ea5ef4 | 555 | //primaryCut->SetDCAToVertex2D(kTRUE); |
809a4336 | 556 | primaryCut->SetMaxDCAToVertexXY(fDCAtoVtx[0]); |
557 | primaryCut->SetMaxDCAToVertexZ(fDCAtoVtx[1]); | |
558 | } | |
559 | if(IsRequireSigmaToVertex()){ | |
560 | primaryCut->SetRequireSigmaToVertex(kTRUE); | |
561 | primaryCut->SetMaxNSigmaToVertex(fSigmaToVtx); | |
562 | } | |
563 | primaryCut->SetAcceptKinkDaughters(kFALSE); | |
e3fc062d | 564 | if(IsQAOn()) primaryCut->SetQAOn(fHistQA); |
809a4336 | 565 | |
9250ffbf | 566 | AliHFEextraCuts *hfecuts = new AliHFEextraCuts("fCutsPrimaryCutsextra","Extra cuts from the HFE group"); |
567 | hfecuts->SetMaxImpactParameterRpar(fMaxImpactParameterRpar); | |
568 | ||
809a4336 | 569 | TObjArray *primCuts = new TObjArray; |
570 | primCuts->SetName("fPartPrimCuts"); | |
571 | primCuts->AddLast(primaryCut); | |
9250ffbf | 572 | if(fMaxImpactParameterRpar){ |
573 | primCuts->AddLast(hfecuts); | |
574 | } | |
809a4336 | 575 | fCutList->AddLast(primCuts); |
576 | } | |
577 | ||
578 | //__________________________________________________________________ | |
dbe3abbe | 579 | void AliHFEcuts::SetHFElectronITSCuts(){ |
809a4336 | 580 | // |
dbe3abbe | 581 | // Special Cuts introduced by the HFElectron Group: ITS |
809a4336 | 582 | // |
faee3b18 | 583 | AliDebug(2, "Called\n"); |
dbe3abbe | 584 | AliHFEextraCuts *hfecuts = new AliHFEextraCuts("fCutsHFElectronGroupPixels","Extra cuts from the HFE group"); |
809a4336 | 585 | if(IsRequireITSpixel()){ |
586 | hfecuts->SetRequireITSpixel(AliHFEextraCuts::ITSPixel_t(fCutITSPixel)); | |
0792aa82 | 587 | hfecuts->SetCheckITSstatus(fCheckITSLayerStatus); |
809a4336 | 588 | } |
dbe3abbe | 589 | |
e3fc062d | 590 | if(IsQAOn()) hfecuts->SetQAOn(fHistQA); |
78ea5ef4 | 591 | hfecuts->SetDebugLevel(fDebugLevel); |
592 | ||
dbe3abbe | 593 | TObjArray *hfeCuts = new TObjArray; |
594 | hfeCuts->SetName("fPartHFECutsITS"); | |
595 | hfeCuts->AddLast(hfecuts); | |
596 | fCutList->AddLast(hfeCuts); | |
597 | } | |
598 | ||
dbe3abbe | 599 | //__________________________________________________________________ |
9250ffbf | 600 | void AliHFEcuts::SetHFElectronTOFCuts(){ |
dbe3abbe | 601 | // |
602 | // Special Cuts introduced by the HFElectron Group: TRD | |
603 | // | |
faee3b18 | 604 | AliDebug(2, "Called\n"); |
9250ffbf | 605 | AliHFEextraCuts *hfecuts = new AliHFEextraCuts("fCutsHFElectronGroupTOF","Extra cuts from the HFE group on TOF PID"); |
e3ae862b | 606 | if(fTOFPIDStep) hfecuts->SetTOFPID(kTRUE); |
c2690925 | 607 | if(fTOFMISMATCHStep) hfecuts->SetTOFMISMATCH(kTRUE); |
e3fc062d | 608 | if(IsQAOn()) hfecuts->SetQAOn(fHistQA); |
78ea5ef4 | 609 | hfecuts->SetDebugLevel(fDebugLevel); |
dbe3abbe | 610 | |
9250ffbf | 611 | TObjArray *hfeCuts = new TObjArray; |
612 | hfeCuts->SetName("fPartHFECutsTOF"); | |
613 | hfeCuts->AddLast(hfecuts); | |
614 | fCutList->AddLast(hfeCuts); | |
615 | } | |
616 | ||
617 | //__________________________________________________________________ | |
618 | void AliHFEcuts::SetHFElectronTRDCuts(){ | |
619 | // | |
620 | // Special Cuts introduced by the HFElectron Group: TRD | |
621 | // | |
622 | AliDebug(2, "Called\n"); | |
623 | AliHFEextraCuts *hfecuts = new AliHFEextraCuts("fCutsHFElectronGroupTRD","Extra cuts from the HFE group on TRD PID"); | |
624 | if(fMinTrackletsTRD > 0.) hfecuts->SetMinTrackletsTRD(fMinTrackletsTRD); | |
625 | if(IsQAOn()) hfecuts->SetQAOn(fHistQA); | |
626 | hfecuts->SetDebugLevel(fDebugLevel); | |
627 | ||
dbe3abbe | 628 | TObjArray *hfeCuts = new TObjArray; |
629 | hfeCuts->SetName("fPartHFECutsTRD"); | |
809a4336 | 630 | hfeCuts->AddLast(hfecuts); |
631 | fCutList->AddLast(hfeCuts); | |
632 | } | |
633 | ||
809a4336 | 634 | //__________________________________________________________________ |
3a72645a | 635 | void AliHFEcuts::SetHFElectronDcaCuts(){ |
636 | // | |
637 | // Special Cuts introduced by the HFElectron Group: minimum of impact parameter | |
638 | // | |
639 | AliDebug(2, "Called\n"); | |
640 | AliHFEextraCuts *hfecuts = new AliHFEextraCuts("fCutsHFElectronGroupDCA","Extra cuts from the HFE group"); | |
c2690925 | 641 | hfecuts->SetMinHFEImpactParamR(fIPCutParams,fIsIPSigmacut); |
3a72645a | 642 | if(IsQAOn()) hfecuts->SetQAOn(fHistQA); |
643 | hfecuts->SetDebugLevel(fDebugLevel); | |
644 | ||
645 | TObjArray *hfeCuts = new TObjArray; | |
646 | hfeCuts->SetName("fPartHFECutsDca"); | |
647 | hfeCuts->AddLast(hfecuts); | |
648 | fCutList->AddLast(hfeCuts); | |
649 | } | |
650 | ||
651 | //__________________________________________________________________ | |
652 | Bool_t AliHFEcuts::CheckParticleCuts(UInt_t step, TObject *o){ | |
809a4336 | 653 | // |
654 | // Checks the cuts without using the correction framework manager | |
655 | // | |
faee3b18 | 656 | AliDebug(2, "Called\n"); |
e156c3bb | 657 | TString stepnames[kNcutStepsMCTrack + kNcutStepsRecTrack + kNcutStepsDETrack + kNcutStepsSecvtxTrack + 1] = {"fPartGenCuts","fPartEvCutPileupZ","fPartEvCut","fPartAccCuts","fPartRecNoCuts","fPartRecKineITSTPCCuts", "fPartPrimCuts", "fPartHFECutsITS","fPartHFECutsTOF","fPartHFECutsTRD","fPartHFECutsDca", "fPartHFECutsSecvtx"}; |
3a72645a | 658 | AliDebug(2, Form("Doing cut %s", stepnames[step].Data())); |
e3fc062d | 659 | TObjArray *cuts = dynamic_cast<TObjArray *>(fCutList->FindObject(stepnames[step].Data())); |
809a4336 | 660 | if(!cuts) return kTRUE; |
3a72645a | 661 | TIter it(cuts); |
809a4336 | 662 | AliCFCutBase *mycut; |
663 | Bool_t status = kTRUE; | |
3a72645a | 664 | while((mycut = dynamic_cast<AliCFCutBase *>(it()))){ |
809a4336 | 665 | status &= mycut->IsSelected(o); |
666 | } | |
809a4336 | 667 | return status; |
668 | } | |
e156c3bb | 669 | |
670 | ||
671 | //__________________________________________________________________ | |
672 | Bool_t AliHFEcuts::CheckEventCuts(const char*namestep, TObject *o){ | |
673 | // | |
674 | // Checks the cuts without using the correction framework manager | |
675 | // | |
676 | AliDebug(2, "Called\n"); | |
677 | TObjArray *cuts = dynamic_cast<TObjArray *>(fCutList->FindObject(namestep)); | |
678 | if(!cuts) return kTRUE; | |
679 | TIter it(cuts); | |
680 | AliCFCutBase *mycut; | |
681 | Bool_t status = kTRUE; | |
682 | while((mycut = dynamic_cast<AliCFCutBase *>(it()))){ | |
683 | status &= mycut->IsSelected(o); | |
684 | } | |
685 | return status; | |
686 | } |