]>
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 | // | |
809a4336 | 27 | #include <TClass.h> |
28 | #include <TList.h> | |
29 | #include <TObjArray.h> | |
30 | #include <TString.h> | |
31 | ||
32 | #include "AliCFAcceptanceCuts.h" | |
33 | #include "AliCFCutBase.h" | |
0792aa82 | 34 | #include "AliCFEventGenCuts.h" |
35 | #include "AliCFEventRecCuts.h" | |
809a4336 | 36 | #include "AliCFManager.h" |
37 | #include "AliCFParticleGenCuts.h" | |
38 | #include "AliCFTrackIsPrimaryCuts.h" | |
39 | #include "AliCFTrackKineCuts.h" | |
40 | #include "AliCFTrackQualityCuts.h" | |
41 | #include "AliESDtrack.h" | |
809a4336 | 42 | |
43 | #include "AliHFEcuts.h" | |
44 | ||
45 | ClassImp(AliHFEcuts) | |
46 | ||
809a4336 | 47 | //__________________________________________________________________ |
48 | AliHFEcuts::AliHFEcuts(): | |
49 | fRequirements(0), | |
50 | fMinClustersTPC(0), | |
51 | fMinTrackletsTRD(0), | |
52 | fCutITSPixel(0), | |
0792aa82 | 53 | fCheckITSLayerStatus(kTRUE), |
809a4336 | 54 | fMaxChi2clusterTPC(0.), |
55 | fMinClusterRatioTPC(0.), | |
56 | fSigmaToVtx(0.), | |
809a4336 | 57 | fHistQA(0x0), |
dbe3abbe | 58 | fCutList(0x0), |
59 | fDebugLevel(0) | |
809a4336 | 60 | { |
61 | // | |
62 | // Default Constructor | |
63 | // | |
64 | memset(fProdVtx, 0, sizeof(Double_t) * 4); | |
65 | memset(fDCAtoVtx, 0, sizeof(Double_t) * 2); | |
66 | memset(fPtRange, 0, sizeof(Double_t) * 2); | |
67 | fCutList = new TObjArray(); | |
68 | fCutList->SetOwner(); | |
69 | } | |
70 | ||
71 | //__________________________________________________________________ | |
72 | AliHFEcuts::AliHFEcuts(const AliHFEcuts &c): | |
73 | TObject(c), | |
74 | fRequirements(c.fRequirements), | |
75 | fMinClustersTPC(c.fMinClustersTPC), | |
76 | fMinTrackletsTRD(c.fMinTrackletsTRD), | |
77 | fCutITSPixel(c.fCutITSPixel), | |
0792aa82 | 78 | fCheckITSLayerStatus(c.fCheckITSLayerStatus), |
809a4336 | 79 | fMaxChi2clusterTPC(c.fMaxChi2clusterTPC), |
80 | fMinClusterRatioTPC(c.fMinClusterRatioTPC), | |
81 | fSigmaToVtx(c.fSigmaToVtx), | |
809a4336 | 82 | fHistQA(0x0), |
dbe3abbe | 83 | fCutList(0x0), |
84 | fDebugLevel(0) | |
809a4336 | 85 | { |
86 | // | |
87 | // Copy Constructor | |
88 | // | |
89 | memcpy(fProdVtx, c.fProdVtx, sizeof(Double_t) * 4); | |
90 | memcpy(fDCAtoVtx, c.fDCAtoVtx, sizeof(Double_t) * 4); | |
91 | memcpy(fPtRange, c.fPtRange, sizeof(Double_t) *2); | |
92 | fCutList = dynamic_cast<TObjArray *>(c.fCutList->Clone()); | |
93 | fCutList->SetOwner(); | |
94 | } | |
95 | ||
96 | //__________________________________________________________________ | |
97 | AliHFEcuts::~AliHFEcuts(){ | |
98 | // | |
99 | // Destruktor | |
100 | // | |
101 | if(fCutList){ | |
102 | fCutList->Delete(); | |
103 | delete fCutList; | |
104 | } | |
105 | fCutList = 0x0; | |
106 | if(fHistQA) fHistQA->Clear(); | |
107 | delete fHistQA; | |
108 | } | |
109 | ||
110 | //__________________________________________________________________ | |
111 | void AliHFEcuts::Initialize(AliCFManager *cfm){ | |
50685501 | 112 | // |
113 | // Initializes the cut objects from the correction framework | |
114 | // Publishes the cuts to the correction framework manager | |
115 | // | |
722347d8 | 116 | if(IsInDebugMode()){ |
117 | fHistQA = new TList; | |
118 | fHistQA->SetName("CutQAhistograms"); | |
119 | fHistQA->SetOwner(kFALSE); | |
120 | } | |
121 | ||
809a4336 | 122 | // Call all the setters for the cuts |
123 | SetParticleGenCutList(); | |
124 | SetAcceptanceCutList(); | |
722347d8 | 125 | SetRecKineITSTPCCutList(); |
809a4336 | 126 | SetRecPrimaryCutList(); |
dbe3abbe | 127 | SetHFElectronITSCuts(); |
dbe3abbe | 128 | SetHFElectronTRDCuts(); |
129 | ||
9bcfd1ab | 130 | // Publish to the cuts which analysis type they are (ESD Analysis by default) |
131 | if(IsAOD()){ | |
132 | AliInfo("Setting AOD Analysis"); | |
133 | TObjArray *genCuts = dynamic_cast<TObjArray *>(fCutList->FindObject("fPartGenCuts")); | |
134 | if(genCuts){ | |
135 | AliCFParticleGenCuts *myGenCut = dynamic_cast<AliCFParticleGenCuts *>(genCuts->FindObject("fCutsGenMC")); | |
136 | if(myGenCut) myGenCut->SetAODMC(kTRUE); | |
137 | } | |
138 | } | |
139 | ||
0792aa82 | 140 | // Connect the event cuts |
9bcfd1ab | 141 | /*SetEventCutList(kEventStepGenerated); |
0792aa82 | 142 | SetEventCutList(kEventStepReconstructed); |
143 | cfm->SetEventCutsList(kEventStepGenerated, dynamic_cast<TObjArray *>(fCutList->FindObject("fEvGenCuts"))); | |
9bcfd1ab | 144 | cfm->SetEventCutsList(kEventStepReconstructed, dynamic_cast<TObjArray *>(fCutList->FindObject("fEvRecCuts")));*/ |
809a4336 | 145 | |
0792aa82 | 146 | // Connect the particle cuts |
809a4336 | 147 | cfm->SetParticleCutsList(kStepMCGenerated, dynamic_cast<TObjArray *>(fCutList->FindObject("fPartGenCuts"))); |
148 | cfm->SetParticleCutsList(kStepMCInAcceptance, dynamic_cast<TObjArray *>(fCutList->FindObject("fPartAccCuts"))); | |
722347d8 | 149 | cfm->SetParticleCutsList(kStepRecKineITSTPC, dynamic_cast<TObjArray *>(fCutList->FindObject("fPartRecKineITSTPCCuts"))); |
809a4336 | 150 | cfm->SetParticleCutsList(kStepRecPrim, dynamic_cast<TObjArray *>(fCutList->FindObject("fPartPrimCuts"))); |
dbe3abbe | 151 | cfm->SetParticleCutsList(kStepHFEcutsITS, dynamic_cast<TObjArray *>(fCutList->FindObject("fPartHFECutsITS"))); |
dbe3abbe | 152 | cfm->SetParticleCutsList(kStepHFEcutsTRD, dynamic_cast<TObjArray *>(fCutList->FindObject("fPartHFECutsTRD"))); |
153 | ||
809a4336 | 154 | } |
155 | ||
156 | //__________________________________________________________________ | |
157 | void AliHFEcuts::Initialize(){ | |
158 | // Call all the setters for the cuts | |
159 | SetParticleGenCutList(); | |
160 | SetAcceptanceCutList(); | |
722347d8 | 161 | SetRecKineITSTPCCutList(); |
809a4336 | 162 | SetRecPrimaryCutList(); |
dbe3abbe | 163 | SetHFElectronITSCuts(); |
dbe3abbe | 164 | SetHFElectronTRDCuts(); |
165 | ||
809a4336 | 166 | } |
167 | ||
0792aa82 | 168 | //__________________________________________________________________ |
169 | void AliHFEcuts::SetEventCutList(Int_t istep){ | |
170 | // | |
171 | // Cuts for Event Selection | |
172 | // | |
173 | TObjArray *arr = new TObjArray; | |
174 | if(istep == kEventStepGenerated){ | |
175 | AliCFEventGenCuts *evGenCuts = new AliCFEventGenCuts("fCutsEvGen", "Event Generated cuts"); | |
176 | evGenCuts->SetNTracksCut(1); | |
177 | evGenCuts->SetRequireVtxCuts(kTRUE); | |
178 | evGenCuts->SetVertexXCut(-1, 1); | |
179 | evGenCuts->SetVertexYCut(-1, 1); | |
180 | evGenCuts->SetVertexZCut(-30, 30); | |
181 | ||
182 | arr->SetName("fEvGenCuts"); | |
183 | arr->AddLast(evGenCuts); | |
184 | } else { | |
185 | AliCFEventRecCuts *evRecCuts = new AliCFEventRecCuts("fCutsEvRec", "Event Reconstructed cuts"); | |
186 | evRecCuts->SetUseSPDVertex(); | |
187 | evRecCuts->SetNTracksCut(1); | |
188 | evRecCuts->SetRequireVtxCuts(kTRUE); | |
189 | evRecCuts->SetVertexXCut(-1, 1); | |
190 | evRecCuts->SetVertexYCut(-1, 1); | |
191 | evRecCuts->SetVertexZCut(-30, 30); | |
192 | ||
193 | ||
194 | arr->SetName("fEvRecCuts"); | |
195 | arr->AddLast(evRecCuts); | |
196 | } | |
197 | fCutList->AddLast(arr); | |
198 | } | |
199 | ||
809a4336 | 200 | //__________________________________________________________________ |
201 | void AliHFEcuts::SetParticleGenCutList(){ | |
202 | // | |
203 | // Initialize Particle Cuts for Monte Carlo Tracks | |
204 | // Production Vertex: < 1cm (Beampipe) | |
205 | // Particle Species: Electrons | |
206 | // Eta: < 0.9 (TRD-TOF acceptance) | |
207 | // | |
208 | AliCFParticleGenCuts *genCuts = new AliCFParticleGenCuts("fCutsGenMC", "Particle Generation Cuts"); | |
209 | genCuts->SetRequireIsCharged(); | |
210 | if(IsRequirePrimary()) genCuts->SetRequireIsPrimary(); | |
211 | if(IsRequireProdVertex()){ | |
212 | genCuts->SetProdVtxRangeX(fProdVtx[0], fProdVtx[1]); | |
213 | genCuts->SetProdVtxRangeY(fProdVtx[2], fProdVtx[3]); | |
214 | } | |
722347d8 | 215 | genCuts->SetRequirePdgCode(11, kTRUE); |
809a4336 | 216 | |
217 | AliCFTrackKineCuts *kineMCcuts = new AliCFTrackKineCuts("fCutsKineMC","MC Kine Cuts"); | |
218 | kineMCcuts->SetPtRange(fPtRange[0], fPtRange[1]); | |
219 | kineMCcuts->SetEtaRange(-0.9, 0.9); | |
220 | ||
221 | if(IsInDebugMode()){ | |
222 | genCuts->SetQAOn(fHistQA); | |
223 | kineMCcuts->SetQAOn(fHistQA); | |
224 | } | |
225 | ||
226 | TObjArray *mcCuts = new TObjArray; | |
227 | mcCuts->SetName("fPartGenCuts"); | |
228 | mcCuts->AddLast(genCuts); | |
229 | mcCuts->AddLast(kineMCcuts); | |
230 | fCutList->AddLast(mcCuts); | |
231 | } | |
232 | ||
233 | //__________________________________________________________________ | |
234 | void AliHFEcuts::SetAcceptanceCutList(){ | |
235 | // | |
236 | // Initialize Particle (Monte Carlo) acceptance cuts | |
237 | // Min. Required Hist for Detectors: | |
238 | // ITS [3] | |
239 | // TPC [2] | |
722347d8 | 240 | // TRD [2*nTracklets] |
809a4336 | 241 | // TOF [0] |
242 | // | |
243 | AliCFAcceptanceCuts *accCuts = new AliCFAcceptanceCuts("fCutsAccMC", "MC Acceptance Cuts"); | |
244 | accCuts->SetMinNHitITS(3); | |
245 | accCuts->SetMinNHitTPC(2); | |
722347d8 | 246 | accCuts->SetMinNHitTRD(2*fMinTrackletsTRD); |
809a4336 | 247 | if(IsInDebugMode()) accCuts->SetQAOn(fHistQA); |
248 | ||
75d81601 | 249 | TObjArray *partAccCuts = new TObjArray(); |
250 | partAccCuts->SetName("fPartAccCuts"); | |
251 | partAccCuts->AddLast(accCuts); | |
252 | fCutList->AddLast(partAccCuts); | |
809a4336 | 253 | } |
254 | ||
255 | //__________________________________________________________________ | |
722347d8 | 256 | void AliHFEcuts::SetRecKineITSTPCCutList(){ |
809a4336 | 257 | // |
258 | // Track Kinematics and Quality cuts (Based on the Standard cuts from PWG0) | |
259 | // | |
722347d8 | 260 | // ITS refit |
809a4336 | 261 | // Variances: |
262 | // y: 2 | |
263 | // z: 2 | |
264 | // sin(phi): 0.5 | |
265 | // tan(theta): 0.5 | |
266 | // 1/pt: 2 | |
267 | // Min. Number of Clusters: | |
268 | // TPC: 50 | |
269 | // RefitRequired: | |
809a4336 | 270 | // TPC |
271 | // Chi2 per TPC cluster: 3.5 | |
272 | // | |
273 | // Kinematics: | |
274 | // Momentum Range: 100MeV - 20GeV | |
275 | // Eta: < 0.9 (TRD-TOF acceptance) | |
276 | // | |
277 | AliCFTrackQualityCuts *trackQuality = new AliCFTrackQualityCuts("fCutsQualityRec","REC Track Quality Cuts"); | |
278 | trackQuality->SetMinNClusterTPC(fMinClustersTPC); | |
279 | trackQuality->SetMaxChi2PerClusterTPC(fMaxChi2clusterTPC); | |
722347d8 | 280 | trackQuality->SetStatus(AliESDtrack::kTPCrefit | AliESDtrack::kITSrefit); |
809a4336 | 281 | trackQuality->SetMaxCovDiagonalElements(2., 2., 0.5, 0.5, 2); |
282 | ||
722347d8 | 283 | AliHFEextraCuts *hfecuts = new AliHFEextraCuts("fCutsHFElectronGroupTPC","Extra cuts from the HFE group"); |
284 | if(fMinClusterRatioTPC > 0.) hfecuts->SetClusterRatioTPC(fMinClusterRatioTPC); | |
285 | hfecuts->SetDebugLevel(fDebugLevel); | |
286 | ||
809a4336 | 287 | AliCFTrackKineCuts *kineCuts = new AliCFTrackKineCuts("fCutsKineRec", "REC Kine Cuts"); |
288 | kineCuts->SetPtRange(fPtRange[0], fPtRange[1]); | |
289 | kineCuts->SetEtaRange(-0.9, 0.9); | |
290 | ||
291 | if(IsInDebugMode()){ | |
292 | trackQuality->SetQAOn(fHistQA); | |
722347d8 | 293 | hfecuts->SetQAOn(fHistQA); |
809a4336 | 294 | kineCuts->SetQAOn(fHistQA); |
295 | } | |
296 | ||
297 | TObjArray *recCuts = new TObjArray; | |
722347d8 | 298 | recCuts->SetName("fPartRecKineITSTPCCuts"); |
809a4336 | 299 | recCuts->AddLast(trackQuality); |
722347d8 | 300 | recCuts->AddLast(hfecuts); |
809a4336 | 301 | recCuts->AddLast(kineCuts); |
302 | fCutList->AddLast(recCuts); | |
303 | } | |
304 | ||
305 | //__________________________________________________________________ | |
306 | void AliHFEcuts::SetRecPrimaryCutList(){ | |
307 | // | |
308 | // Primary cuts (based on standard cuts from PWG0): | |
309 | // DCA to Vertex: | |
310 | // XY: 3. cm | |
311 | // Z: 10. cm | |
312 | // No Kink daughters | |
313 | // | |
314 | AliCFTrackIsPrimaryCuts *primaryCut = new AliCFTrackIsPrimaryCuts("fCutsPrimaryCuts", "REC Primary Cuts"); | |
315 | if(IsRequireDCAToVertex()){ | |
78ea5ef4 | 316 | //primaryCut->SetDCAToVertex2D(kTRUE); |
809a4336 | 317 | primaryCut->SetMaxDCAToVertexXY(fDCAtoVtx[0]); |
318 | primaryCut->SetMaxDCAToVertexZ(fDCAtoVtx[1]); | |
319 | } | |
320 | if(IsRequireSigmaToVertex()){ | |
321 | primaryCut->SetRequireSigmaToVertex(kTRUE); | |
322 | primaryCut->SetMaxNSigmaToVertex(fSigmaToVtx); | |
323 | } | |
324 | primaryCut->SetAcceptKinkDaughters(kFALSE); | |
325 | if(IsInDebugMode()) primaryCut->SetQAOn(fHistQA); | |
326 | ||
327 | TObjArray *primCuts = new TObjArray; | |
328 | primCuts->SetName("fPartPrimCuts"); | |
329 | primCuts->AddLast(primaryCut); | |
330 | fCutList->AddLast(primCuts); | |
331 | } | |
332 | ||
333 | //__________________________________________________________________ | |
dbe3abbe | 334 | void AliHFEcuts::SetHFElectronITSCuts(){ |
809a4336 | 335 | // |
dbe3abbe | 336 | // Special Cuts introduced by the HFElectron Group: ITS |
809a4336 | 337 | // |
dbe3abbe | 338 | AliHFEextraCuts *hfecuts = new AliHFEextraCuts("fCutsHFElectronGroupPixels","Extra cuts from the HFE group"); |
809a4336 | 339 | if(IsRequireITSpixel()){ |
340 | hfecuts->SetRequireITSpixel(AliHFEextraCuts::ITSPixel_t(fCutITSPixel)); | |
0792aa82 | 341 | hfecuts->SetCheckITSstatus(fCheckITSLayerStatus); |
809a4336 | 342 | } |
dbe3abbe | 343 | |
344 | if(IsInDebugMode()) hfecuts->SetQAOn(fHistQA); | |
78ea5ef4 | 345 | hfecuts->SetDebugLevel(fDebugLevel); |
346 | ||
dbe3abbe | 347 | TObjArray *hfeCuts = new TObjArray; |
348 | hfeCuts->SetName("fPartHFECutsITS"); | |
349 | hfeCuts->AddLast(hfecuts); | |
350 | fCutList->AddLast(hfeCuts); | |
351 | } | |
352 | ||
dbe3abbe | 353 | //__________________________________________________________________ |
354 | void AliHFEcuts::SetHFElectronTRDCuts(){ | |
355 | // | |
356 | // Special Cuts introduced by the HFElectron Group: TRD | |
357 | // | |
358 | AliHFEextraCuts *hfecuts = new AliHFEextraCuts("fCutsHFElectronGroupTRD","Extra cuts from the HFE group"); | |
359 | if(fMinTrackletsTRD > 0.) hfecuts->SetMinTrackletsTRD(fMinTrackletsTRD); | |
360 | if(IsInDebugMode()) hfecuts->SetQAOn(fHistQA); | |
78ea5ef4 | 361 | hfecuts->SetDebugLevel(fDebugLevel); |
dbe3abbe | 362 | |
363 | TObjArray *hfeCuts = new TObjArray; | |
364 | hfeCuts->SetName("fPartHFECutsTRD"); | |
809a4336 | 365 | hfeCuts->AddLast(hfecuts); |
366 | fCutList->AddLast(hfeCuts); | |
367 | } | |
368 | ||
369 | //__________________________________________________________________ | |
370 | void AliHFEcuts::SetDebugMode(){ | |
371 | // | |
372 | // Switch on QA | |
373 | // | |
374 | SetBit(kDebugMode, kTRUE); | |
809a4336 | 375 | } |
376 | ||
377 | //__________________________________________________________________ | |
378 | Bool_t AliHFEcuts::CheckParticleCuts(CutStep_t step, TObject *o){ | |
379 | // | |
380 | // Checks the cuts without using the correction framework manager | |
381 | // | |
382 | TString stepnames[kNcutSteps] = {"fPartGenCuts", "fPartAccCuts", "fPartRecCuts", "fPartPrimCuts", "fPartHFECuts"}; | |
383 | TObjArray *cuts = dynamic_cast<TObjArray *>(fCutList->FindObject(stepnames[step].Data())); | |
384 | if(!cuts) return kTRUE; | |
385 | TIterator *it = cuts->MakeIterator(); | |
386 | AliCFCutBase *mycut; | |
387 | Bool_t status = kTRUE; | |
388 | while((mycut = dynamic_cast<AliCFCutBase *>(it->Next()))){ | |
389 | status &= mycut->IsSelected(o); | |
390 | } | |
391 | delete it; | |
392 | return status; | |
393 | } |