]>
Commit | Line | Data |
---|---|---|
01745870 | 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 | **************************************************************************/ | |
15 | // | |
16 | // The analysis task: | |
17 | // Filling an AliCFContainer with the quantities pt, eta and phi | |
18 | // for tracks which survivied the particle cuts (MC resp. ESD tracks) | |
19 | // Track selection is done using the AliHFE package | |
20 | // | |
21 | // Author: | |
22 | // Raphaelle Bailhache <R.Bailhache@gsi.de> | |
23 | // Markus Fasel <M.Fasel@gsi.de> | |
24 | // Matus Kalisky <matus.kalisky@cern.ch> | |
25 | // MinJung Kweon <minjung@physi.uni-heidelberg.de> | |
26 | // | |
27 | #include <TAxis.h> | |
28 | #include <TBits.h> | |
29 | #include <TCanvas.h> | |
30 | #include <TChain.h> | |
31 | #include <TDirectory.h> | |
32 | #include <TFile.h> | |
33 | #include <TH3D.h> | |
34 | #include <TIterator.h> | |
35 | #include <TList.h> | |
36 | #include <TLegend.h> | |
37 | #include <TMath.h> | |
38 | #include <TObjArray.h> | |
39 | #include <TObjString.h> | |
40 | #include <TParticle.h> | |
41 | #include <TProfile.h> | |
42 | #include <TString.h> | |
43 | #include <TF1.h> | |
44 | #include <TTree.h> | |
45 | ||
46 | #include "AliESDtrackCuts.h" | |
47 | #include "AliAnalysisManager.h" | |
48 | #include "AliAnalysisUtils.h" | |
49 | #include "AliAODInputHandler.h" | |
50 | #include "AliAODMCParticle.h" | |
51 | #include "AliAODTrack.h" | |
52 | #include "AliAODVertex.h" | |
53 | #include "AliCentrality.h" | |
54 | #include "AliCFContainer.h" | |
55 | #include "AliCFManager.h" | |
56 | #include "AliESDEvent.h" | |
57 | #include "AliESDInputHandler.h" | |
58 | #include "AliESDtrack.h" | |
59 | #include "AliLog.h" | |
60 | #include "AliMCEvent.h" | |
61 | #include "AliMCEventHandler.h" | |
62 | #include "AliMCParticle.h" | |
63 | #include "AliMultiplicity.h" | |
64 | #include "AliPID.h" | |
65 | #include "AliPIDResponse.h" | |
66 | #include "AliOADBContainer.h" | |
67 | #include "AliStack.h" | |
68 | #include "AliTriggerAnalysis.h" | |
4437a0d2 | 69 | #include "AliTRDTriggerAnalysis.h" |
01745870 | 70 | #include "AliVVertex.h" |
71 | ||
72 | #include "AliHFEcollection.h" | |
73 | #include "AliHFEcontainer.h" | |
74 | #include "AliHFEcuts.h" | |
75 | #include "AliHFEelecbackground.h" | |
76 | #include "AliHFENonPhotonicElectron.h" | |
77 | #include "AliHFEmcQA.h" | |
78 | #include "AliHFEpairs.h" | |
79 | #include "AliHFEpid.h" | |
80 | #include "AliHFEpidQAmanager.h" | |
81 | #include "AliHFEsecVtxs.h" | |
82 | #include "AliHFEsecVtx.h" | |
83 | #include "AliHFEsignalCuts.h" | |
84 | #include "AliHFEtaggedTrackAnalysis.h" | |
85 | #include "AliHFEtools.h" | |
7986e54e | 86 | #include "AliHFEV0taginfo.h" |
01745870 | 87 | #include "AliHFEvarManager.h" |
88 | #include "AliAnalysisTaskHFE.h" | |
89 | #include "AliAODMCHeader.h" | |
90 | #include "TClonesArray.h" | |
91 | ||
92 | ClassImp(AliAnalysisTaskHFE) | |
93 | ||
94 | //____________________________________________________________ | |
95 | AliAnalysisTaskHFE::AliAnalysisTaskHFE(): | |
96 | AliAnalysisTaskSE("PID efficiency Analysis") | |
97 | , fAODMCHeader(NULL) | |
98 | , fAODArrayMCInfo(NULL) | |
99 | , fQAlevel(0) | |
100 | , fPlugins(0) | |
101 | , fCollisionSystem(3) | |
102 | , fFillSignalOnly(kTRUE) | |
2e4ed823 | 103 | , fRejectMCFakeTracks(kFALSE) |
01745870 | 104 | , fFillNoCuts(kFALSE) |
01745870 | 105 | , fBackGroundFactorApply(kFALSE) |
106 | , fRemovePileUp(kFALSE) | |
107 | , fIdentifiedAsPileUp(kFALSE) | |
108 | , fIdentifiedAsOutInz(kFALSE) | |
109 | , fPassTheEventCut(kFALSE) | |
110 | , fRejectKinkMother(kTRUE) | |
111 | , fisppMultiBin(kFALSE) | |
112 | , fPbPbUserCentralityBinning(kFALSE) | |
113 | , fRemoveFirstEvent(kFALSE) | |
114 | , fisNonHFEsystematics(kFALSE) | |
115 | , fSpecialTrigger(NULL) | |
116 | , fCentralityF(-1) | |
117 | , fCentralityPercent(-1) | |
118 | , fCentralityEstimator("V0M") | |
119 | , fContributors(0.5) | |
120 | , fWeightBackGround(0.) | |
121 | , fVz(0.0) | |
122 | , fContainer(NULL) | |
123 | , fVarManager(NULL) | |
124 | , fSignalCuts(NULL) | |
125 | , fCFM(NULL) | |
126 | , fTriggerAnalysis(NULL) | |
127 | , fPID(NULL) | |
128 | , fPIDqa(NULL) | |
618038b6 | 129 | , fTRDTriggerAnalysis(NULL) |
01745870 | 130 | , fPIDpreselect(NULL) |
131 | , fCuts(NULL) | |
132 | , fTaggedTrackCuts(NULL) | |
133 | , fCleanTaggedTrack(kFALSE) | |
134 | , fVariablesTRDTaggedTrack(kFALSE) | |
135 | , fAnalysisUtils(NULL) | |
136 | , fCutspreselect(NULL) | |
137 | , fSecVtx(NULL) | |
138 | , fElecBackGround(NULL) | |
139 | , fMCQA(NULL) | |
140 | , fTaggedTrackAnalysis(NULL) | |
141 | , fExtraCuts(NULL) | |
142 | , fBackgroundSubtraction(NULL) | |
143 | , fTRDTrigger(kFALSE) | |
144 | , fWhichTRDTrigger(0) | |
7986e54e | 145 | , fV0Tagger(NULL) |
01745870 | 146 | , fQA(NULL) |
147 | , fOutput(NULL) | |
148 | , fHistMCQA(NULL) | |
149 | , fHistSECVTX(NULL) | |
150 | , fHistELECBACKGROUND(NULL) | |
151 | , fQACollection(NULL) | |
152 | { | |
153 | // | |
154 | // Dummy constructor | |
155 | // | |
156 | memset(fElecBackgroundFactor, 0, sizeof(Double_t) * kElecBgSpecies * kBgPtBins * kCentBins * kBgLevels); | |
157 | memset(fkBackGroundFactorArray, 0, sizeof(TF1 *) * 12); | |
158 | memset(fBinLimit, 0, sizeof(Double_t) * (kBgPtBins+1)); | |
159 | memset(&fisppMultiBin, kFALSE, sizeof(fisppMultiBin)); | |
160 | memset(fCentralityLimits, 0, sizeof(Float_t) * 12); | |
161 | ||
162 | SetppAnalysis(); | |
163 | } | |
164 | ||
165 | //____________________________________________________________ | |
166 | AliAnalysisTaskHFE::AliAnalysisTaskHFE(const char * name): | |
167 | AliAnalysisTaskSE(name) | |
168 | , fAODMCHeader(NULL) | |
169 | , fAODArrayMCInfo(NULL) | |
170 | , fQAlevel(0) | |
171 | , fPlugins(0) | |
172 | , fCollisionSystem(3) | |
173 | , fFillSignalOnly(kTRUE) | |
2e4ed823 | 174 | , fRejectMCFakeTracks(kFALSE) |
01745870 | 175 | , fFillNoCuts(kFALSE) |
01745870 | 176 | , fBackGroundFactorApply(kFALSE) |
177 | , fRemovePileUp(kFALSE) | |
178 | , fIdentifiedAsPileUp(kFALSE) | |
179 | , fIdentifiedAsOutInz(kFALSE) | |
180 | , fPassTheEventCut(kFALSE) | |
181 | , fRejectKinkMother(kTRUE) | |
182 | , fisppMultiBin(kFALSE) | |
183 | , fPbPbUserCentralityBinning(kFALSE) | |
184 | , fRemoveFirstEvent(kFALSE) | |
185 | , fisNonHFEsystematics(kFALSE) | |
186 | , fSpecialTrigger(NULL) | |
187 | , fCentralityF(-1) | |
188 | , fCentralityPercent(-1) | |
189 | , fCentralityEstimator("V0M") | |
190 | , fContributors(0.5) | |
191 | , fWeightBackGround(0.) | |
192 | , fVz(0.0) | |
193 | , fContainer(NULL) | |
194 | , fVarManager(NULL) | |
195 | , fSignalCuts(NULL) | |
196 | , fCFM(NULL) | |
197 | , fTriggerAnalysis(NULL) | |
198 | , fPID(NULL) | |
199 | , fPIDqa(NULL) | |
618038b6 | 200 | , fTRDTriggerAnalysis(NULL) |
01745870 | 201 | , fPIDpreselect(NULL) |
202 | , fCuts(NULL) | |
203 | , fTaggedTrackCuts(NULL) | |
204 | , fCleanTaggedTrack(kFALSE) | |
205 | , fVariablesTRDTaggedTrack(kFALSE) | |
206 | , fAnalysisUtils(NULL) | |
207 | , fCutspreselect(NULL) | |
208 | , fSecVtx(NULL) | |
209 | , fElecBackGround(NULL) | |
210 | , fMCQA(NULL) | |
211 | , fTaggedTrackAnalysis(NULL) | |
212 | , fExtraCuts(NULL) | |
213 | , fBackgroundSubtraction(NULL) | |
214 | , fTRDTrigger(kFALSE) | |
215 | , fWhichTRDTrigger(0) | |
7986e54e | 216 | , fV0Tagger(NULL) |
01745870 | 217 | , fQA(NULL) |
218 | , fOutput(NULL) | |
219 | , fHistMCQA(NULL) | |
220 | , fHistSECVTX(NULL) | |
221 | , fHistELECBACKGROUND(NULL) | |
222 | , fQACollection(0x0) | |
223 | { | |
224 | // | |
225 | // Default constructor | |
226 | // | |
227 | DefineOutput(1, TList::Class()); | |
228 | DefineOutput(2, TList::Class()); | |
229 | ||
7986e54e | 230 | fV0Tagger = new AliHFEV0taginfo("Tagger"); |
01745870 | 231 | fPID = new AliHFEpid("hfePid"); |
232 | fPIDqa = new AliHFEpidQAmanager; | |
233 | fVarManager = new AliHFEvarManager("hfeVarManager"); | |
234 | fAnalysisUtils = new AliAnalysisUtils; | |
618038b6 | 235 | fTRDTriggerAnalysis = new AliTRDTriggerAnalysis(); |
01745870 | 236 | |
237 | memset(fElecBackgroundFactor, 0, sizeof(Double_t) * kElecBgSpecies * kBgPtBins * kCentBins * kBgLevels); | |
238 | memset(fkBackGroundFactorArray, 0, sizeof(TF1 *) * 12); | |
239 | memset(fBinLimit, 0, sizeof(Double_t) * (kBgPtBins+1)); | |
240 | memset(&fisppMultiBin, kFALSE, sizeof(fisppMultiBin)); | |
241 | memset(fCentralityLimits, 0, sizeof(Float_t) * 12); | |
242 | ||
243 | SetppAnalysis(); | |
244 | } | |
245 | ||
246 | //____________________________________________________________ | |
247 | AliAnalysisTaskHFE::AliAnalysisTaskHFE(const AliAnalysisTaskHFE &ref): | |
248 | AliAnalysisTaskSE(ref) | |
249 | , fAODMCHeader(NULL) | |
250 | , fAODArrayMCInfo(NULL) | |
251 | , fQAlevel(0) | |
252 | , fPlugins(0) | |
253 | , fCollisionSystem(ref.fCollisionSystem) | |
254 | , fFillSignalOnly(ref.fFillSignalOnly) | |
2e4ed823 | 255 | , fRejectMCFakeTracks(ref.fRejectMCFakeTracks) |
01745870 | 256 | , fFillNoCuts(ref.fFillNoCuts) |
01745870 | 257 | , fBackGroundFactorApply(ref.fBackGroundFactorApply) |
258 | , fRemovePileUp(ref.fRemovePileUp) | |
259 | , fIdentifiedAsPileUp(ref.fIdentifiedAsPileUp) | |
260 | , fIdentifiedAsOutInz(ref.fIdentifiedAsOutInz) | |
261 | , fPassTheEventCut(ref.fPassTheEventCut) | |
262 | , fRejectKinkMother(ref.fRejectKinkMother) | |
263 | , fisppMultiBin(ref.fisppMultiBin) | |
264 | , fPbPbUserCentralityBinning(ref.fPbPbUserCentralityBinning) | |
265 | , fRemoveFirstEvent(ref.fRemoveFirstEvent) | |
266 | , fisNonHFEsystematics(ref.fisNonHFEsystematics) | |
267 | , fSpecialTrigger(ref.fSpecialTrigger) | |
268 | , fCentralityF(ref.fCentralityF) | |
269 | , fCentralityPercent(ref.fCentralityPercent) | |
270 | , fCentralityEstimator(ref.fCentralityEstimator) | |
271 | , fContributors(ref.fContributors) | |
272 | , fWeightBackGround(ref.fWeightBackGround) | |
273 | , fVz(ref.fVz) | |
274 | , fContainer(NULL) | |
275 | , fVarManager(NULL) | |
276 | , fSignalCuts(NULL) | |
277 | , fCFM(NULL) | |
278 | , fTriggerAnalysis(NULL) | |
279 | , fPID(NULL) | |
280 | , fPIDqa(NULL) | |
618038b6 | 281 | , fTRDTriggerAnalysis(NULL) |
01745870 | 282 | , fPIDpreselect(NULL) |
283 | , fCuts(NULL) | |
284 | , fTaggedTrackCuts(NULL) | |
285 | , fCleanTaggedTrack(ref.fCleanTaggedTrack) | |
286 | , fVariablesTRDTaggedTrack(ref.fVariablesTRDTaggedTrack) | |
287 | , fAnalysisUtils(NULL) | |
288 | , fCutspreselect(NULL) | |
289 | , fSecVtx(NULL) | |
290 | , fElecBackGround(NULL) | |
291 | , fMCQA(NULL) | |
292 | , fTaggedTrackAnalysis(NULL) | |
293 | , fExtraCuts(NULL) | |
294 | , fBackgroundSubtraction(NULL) | |
295 | , fTRDTrigger(ref.fTRDTrigger) | |
296 | , fWhichTRDTrigger(ref.fWhichTRDTrigger) | |
7986e54e | 297 | , fV0Tagger(NULL) |
01745870 | 298 | , fQA(NULL) |
299 | , fOutput(NULL) | |
300 | , fHistMCQA(NULL) | |
301 | , fHistSECVTX(NULL) | |
302 | , fHistELECBACKGROUND(NULL) | |
303 | , fQACollection(NULL) | |
304 | { | |
305 | // | |
306 | // Copy Constructor | |
307 | // | |
308 | ref.Copy(*this); | |
309 | } | |
310 | ||
311 | //____________________________________________________________ | |
312 | AliAnalysisTaskHFE &AliAnalysisTaskHFE::operator=(const AliAnalysisTaskHFE &ref){ | |
313 | // | |
314 | // Assignment operator | |
315 | // | |
316 | if(this == &ref) | |
317 | ref.Copy(*this); | |
318 | return *this; | |
319 | } | |
320 | ||
321 | //____________________________________________________________ | |
322 | void AliAnalysisTaskHFE::Copy(TObject &o) const { | |
323 | // | |
324 | // Copy into object o | |
325 | // | |
326 | AliAnalysisTaskHFE &target = dynamic_cast<AliAnalysisTaskHFE &>(o); | |
327 | target.fAODMCHeader = fAODMCHeader; | |
328 | target.fAODArrayMCInfo = fAODArrayMCInfo; | |
329 | target.fQAlevel = fQAlevel; | |
330 | target.fPlugins = fPlugins; | |
331 | target.fCollisionSystem = fCollisionSystem; | |
332 | target.fFillSignalOnly = fFillSignalOnly; | |
2e4ed823 | 333 | target.fRejectMCFakeTracks = fRejectMCFakeTracks; |
01745870 | 334 | target.fFillNoCuts = fFillNoCuts; |
01745870 | 335 | target.fBackGroundFactorApply = fBackGroundFactorApply; |
336 | target.fRemovePileUp = fRemovePileUp; | |
337 | target.fIdentifiedAsPileUp = fIdentifiedAsPileUp; | |
338 | target.fIdentifiedAsOutInz = fIdentifiedAsOutInz; | |
339 | target.fPassTheEventCut = fPassTheEventCut; | |
340 | target.fRejectKinkMother = fRejectKinkMother; | |
341 | target.fisppMultiBin = fisppMultiBin; | |
342 | target.fPbPbUserCentralityBinning = fPbPbUserCentralityBinning; | |
343 | target.fRemoveFirstEvent = fRemoveFirstEvent; | |
344 | target.fisNonHFEsystematics = fisNonHFEsystematics; | |
345 | target.fSpecialTrigger = fSpecialTrigger; | |
346 | target.fCentralityF = fCentralityF; | |
347 | target.fCentralityPercent = fCentralityPercent; | |
348 | target.fCentralityEstimator = fCentralityEstimator; | |
349 | target.fContributors = fContributors; | |
350 | target.fWeightBackGround = fWeightBackGround; | |
351 | target.fVz = fVz; | |
352 | target.fContainer = fContainer; | |
353 | target.fVarManager = fVarManager; | |
354 | target.fSignalCuts = fSignalCuts; | |
355 | target.fCFM = fCFM; | |
356 | target.fTriggerAnalysis = fTriggerAnalysis; | |
357 | target.fPID = fPID; | |
358 | target.fPIDqa = fPIDqa; | |
618038b6 | 359 | target.fTRDTriggerAnalysis = fTRDTriggerAnalysis; |
01745870 | 360 | target.fPIDpreselect = fPIDpreselect; |
361 | target.fCuts = fCuts; | |
362 | target.fTaggedTrackCuts = fTaggedTrackCuts; | |
363 | target.fCleanTaggedTrack = fCleanTaggedTrack; | |
364 | target.fVariablesTRDTaggedTrack = fVariablesTRDTaggedTrack; | |
365 | target.fAnalysisUtils = fAnalysisUtils; | |
366 | target.fCutspreselect = fCutspreselect; | |
367 | target.fSecVtx = fSecVtx; | |
368 | target.fElecBackGround = fElecBackGround; | |
369 | target.fMCQA = fMCQA; | |
370 | target.fTaggedTrackAnalysis = fTaggedTrackAnalysis; | |
371 | target.fExtraCuts = fExtraCuts; | |
372 | target.fBackgroundSubtraction = fBackgroundSubtraction; | |
373 | target.fTRDTrigger = fTRDTrigger; | |
374 | target.fWhichTRDTrigger = fWhichTRDTrigger; | |
7986e54e | 375 | target.fV0Tagger = fV0Tagger; |
01745870 | 376 | target.fQA = fQA; |
377 | target.fOutput = fOutput; | |
378 | target.fHistMCQA = fHistMCQA; | |
379 | target.fHistSECVTX = fHistSECVTX; | |
380 | target.fHistELECBACKGROUND = fHistELECBACKGROUND; | |
381 | target.fQACollection = fQACollection; | |
382 | } | |
383 | ||
384 | //____________________________________________________________ | |
385 | AliAnalysisTaskHFE::~AliAnalysisTaskHFE(){ | |
386 | // | |
387 | // Destructor | |
388 | // | |
389 | if(fPID) delete fPID; | |
390 | if(fPIDpreselect) delete fPIDpreselect; | |
391 | if(fVarManager) delete fVarManager; | |
618038b6 | 392 | if(fTRDTriggerAnalysis) delete fTRDTriggerAnalysis; |
01745870 | 393 | if(fCFM) delete fCFM; |
394 | if(fTriggerAnalysis) delete fTriggerAnalysis; | |
395 | if(fSignalCuts) delete fSignalCuts; | |
396 | if(fSecVtx) delete fSecVtx; | |
397 | if(fMCQA) delete fMCQA; | |
398 | if(fElecBackGround) delete fElecBackGround; | |
399 | if(fBackgroundSubtraction) delete fBackgroundSubtraction; | |
400 | if(fSpecialTrigger) delete fSpecialTrigger; | |
401 | if(fAnalysisUtils) delete fAnalysisUtils; | |
7986e54e | 402 | if(fV0Tagger) delete fV0Tagger; |
01745870 | 403 | // Delete output objects only if we are not running in PROOF mode because otherwise this produces a crash during merging |
404 | AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager(); | |
405 | if(mgr && mgr->GetAnalysisType() != AliAnalysisManager::kProofAnalysis){ | |
406 | if(fPIDqa) delete fPIDqa; | |
407 | if(fOutput) delete fOutput; | |
408 | if(fQA) delete fQA; | |
409 | } | |
410 | } | |
411 | ||
412 | //____________________________________________________________ | |
413 | void AliAnalysisTaskHFE::UserCreateOutputObjects(){ | |
414 | // | |
415 | // Creating output container and output objects | |
416 | // Here we also Initialize the correction framework container and | |
417 | // the objects for | |
418 | // - PID | |
419 | // - MC QA | |
420 | // - SecVtx | |
421 | // QA histograms are created if requested | |
422 | // Called once per worker | |
423 | // | |
424 | AliDebug(3, "Creating Output Objects"); | |
425 | ||
426 | // Make lists for Output | |
427 | if(!fQA) fQA = new TList; | |
428 | fQA->SetOwner(); | |
429 | if(!fOutput) fOutput = new TList; | |
430 | fOutput->SetOwner(); | |
431 | ||
432 | // Automatic determination of the analysis mode | |
433 | AliVEventHandler *inputHandler = dynamic_cast<AliVEventHandler *>(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()); | |
434 | if(!TString(inputHandler->IsA()->GetName()).CompareTo("AliAODInputHandler")){ | |
435 | SetAODAnalysis(); | |
436 | } else { | |
437 | SetESDAnalysis(); | |
438 | if(AliAnalysisManager::GetAnalysisManager()->GetMCtruthEventHandler()) | |
439 | SetHasMCData(); | |
440 | } | |
441 | printf("Analysis Mode: %s Analysis\n", IsAODanalysis() ? "AOD" : "ESD"); | |
442 | printf("MC Data available %s\n", HasMCData() ? "Yes" : "No"); | |
443 | ||
444 | // Enable Trigger Analysis | |
445 | fTriggerAnalysis = new AliTriggerAnalysis; | |
446 | fTriggerAnalysis->EnableHistograms(); | |
447 | fTriggerAnalysis->SetAnalyzeMC(HasMCData()); | |
448 | ||
449 | // First Part: Make QA histograms | |
450 | fQACollection = new AliHFEcollection("TaskQA", "QA histos from the Electron Task"); | |
451 | fQACollection->CreateTH1F("nElectronTracksEvent", "Number of Electron Candidates", 100, 0, 100); | |
452 | fQACollection->CreateTH1F("nElectron", "Number of electrons", 100, 0, 100); | |
453 | fQACollection->CreateTH2F("radius", "Production Vertex", 100, 0.0, 5.0, 100, 0.0, 5.0); | |
454 | fQACollection->CreateTH1F("nTriggerBit", "Histo Trigger Bit", 22, 0, 22); | |
e2861c1a | 455 | fQACollection->CreateTH1F("Filterbegin", "AOD filter of tracks after all cuts", 21, -1, 20); |
47faab26 | 456 | fQACollection->CreateTH1F("Filterend", "AOD filter of tracks after all cuts", 21, -1, 20); |
2e4ed823 | 457 | fQACollection->CreateTH2F("Kinkbefore", "Kink status before filter; p_{T} (GeV/c); kink status", 100, 0., 20., 3, -0.5, 2.5); |
458 | fQACollection->CreateTH2F("Kinkafter", "Kink status after filter; p_{T} (GeV/c); kink status", 100, 0., 20., 3, -0.5, 2.5); | |
459 | fQACollection->CreateTH1F("HFPuzzle", "Source definition for electrons from HF", 11, -0.5, 10.5); | |
01745870 | 460 | |
461 | InitHistoITScluster(); | |
462 | InitContaminationQA(); | |
463 | fQA->Add(fQACollection); | |
464 | ||
465 | // Initialize PID | |
466 | fPID->SetHasMCData(HasMCData()); | |
467 | if(!fPID->GetNumberOfPIDdetectors()) fPID->AddDetector("TPC", 0); | |
468 | if(IsQAOn(kPIDqa)){ | |
469 | AliInfo("PID QA switched on"); | |
470 | fPIDqa->Initialize(fPID); | |
471 | fQA->Add(fPIDqa->MakeList("HFEpidQA")); | |
472 | } | |
473 | fPID->SortDetectors(); | |
474 | ||
475 | // Background subtraction------------------------------------------------------------------- | |
476 | if (GetPlugin(kNonPhotonicElectron)) { | |
477 | if(!fBackgroundSubtraction) fBackgroundSubtraction = new AliHFENonPhotonicElectron(); | |
478 | if(IsAODanalysis()) fBackgroundSubtraction->SetAOD(kTRUE); | |
479 | fBackgroundSubtraction->Init(); | |
480 | fOutput->Add(fBackgroundSubtraction->GetListOutput()); | |
481 | } | |
482 | //------------------------------------------------------------------------------------------ | |
483 | ||
484 | ||
485 | // Initialize correction Framework and Cuts | |
486 | const Int_t kNcutSteps = AliHFEcuts::kNcutStepsMCTrack + AliHFEcuts::kNcutStepsRecTrack + AliHFEcuts::kNcutStepsDETrack + AliHFEcuts::kNcutStepsSecvtxTrack; | |
487 | fCFM = new AliCFManager; | |
488 | fCFM->SetNStepParticle(kNcutSteps); | |
489 | MakeParticleContainer(); | |
490 | MakeEventContainer(); | |
491 | // Temporary fix: Initialize particle cuts with NULL | |
492 | for(Int_t istep = 0; istep < kNcutSteps; istep++) | |
493 | fCFM->SetParticleCutsList(istep, NULL); | |
494 | if(!fCuts){ | |
495 | AliWarning("Cuts not available. Default cuts will be used"); | |
496 | fCuts = new AliHFEcuts; | |
497 | fCuts->CreateStandardCuts(); | |
498 | } | |
499 | if(IsAODanalysis()) fCuts->SetAOD(); | |
500 | // Make clone for V0 tagging step | |
501 | fCuts->Initialize(fCFM); | |
502 | if(fCuts->IsQAOn()) fQA->Add(fCuts->GetQAhistograms()); | |
503 | fSignalCuts = new AliHFEsignalCuts("HFEsignalCuts", "HFE MC Signal definition"); | |
504 | fVarManager->SetSignalCuts(fSignalCuts); | |
505 | ||
506 | // add output objects to the List | |
507 | fOutput->AddAt(fContainer, 0); | |
508 | fOutput->AddAt(fCFM->GetEventContainer(), 1); | |
509 | ||
510 | // mcQA---------------------------------- | |
511 | if (HasMCData() && IsQAOn(kMCqa)) { | |
512 | AliInfo("MC QA on"); | |
513 | if(!fMCQA) fMCQA = new AliHFEmcQA; | |
514 | if(!fHistMCQA) fHistMCQA = new TList(); | |
515 | fHistMCQA->SetOwner(); | |
516 | if(IsPbPb()) fMCQA->SetPbPb(); | |
517 | if(fisppMultiBin) fMCQA->SetPPMultiBin(); | |
518 | if(TestBit(kTreeStream)){ | |
519 | fMCQA->EnableDebugStreamer(); | |
520 | } | |
521 | fMCQA->CreatDefaultHistograms(fHistMCQA); | |
522 | fMCQA->SetBackgroundWeightFactor(fElecBackgroundFactor[0][0][0],fBinLimit); | |
523 | fQA->Add(fHistMCQA); | |
524 | } | |
525 | ||
526 | // secvtx---------------------------------- | |
527 | if (GetPlugin(kSecVtx)) { | |
528 | AliInfo("Secondary Vertex Analysis on"); | |
529 | if(!fSecVtx) fSecVtx = new AliHFEsecVtx; | |
530 | fSecVtx->SetHasMCData(HasMCData()); | |
531 | ||
532 | if(!fHistSECVTX) fHistSECVTX = new TList(); | |
533 | fHistSECVTX->SetOwner(); | |
534 | fSecVtx->CreateHistograms(fHistSECVTX); | |
535 | fOutput->Add(fHistSECVTX); | |
536 | } | |
537 | ||
538 | // background---------------------------------- | |
539 | if (GetPlugin(kIsElecBackGround)) { | |
540 | AliInfo("Electron BackGround Analysis on"); | |
541 | if(!fElecBackGround){ | |
542 | AliWarning("ElecBackGround not available. Default elecbackground will be used"); | |
543 | fElecBackGround = new AliHFEelecbackground; | |
544 | } | |
545 | fElecBackGround->SetHasMCData(HasMCData()); | |
546 | ||
547 | if(!fHistELECBACKGROUND) fHistELECBACKGROUND = new TList(); | |
548 | fHistELECBACKGROUND->SetOwner(); | |
549 | fElecBackGround->CreateHistograms(fHistELECBACKGROUND); | |
550 | fOutput->Add(fHistELECBACKGROUND); | |
551 | } | |
552 | ||
553 | // tagged tracks | |
554 | if(GetPlugin(kTaggedTrackAnalysis)){ | |
555 | AliInfo("Analysis on V0-tagged tracks enabled"); | |
556 | fTaggedTrackAnalysis = new AliHFEtaggedTrackAnalysis(Form("taggedTrackAnalysis%s", GetName())); | |
557 | fTaggedTrackAnalysis->SetCuts(fTaggedTrackCuts); | |
558 | fTaggedTrackAnalysis->SetClean(fCleanTaggedTrack); | |
58d0bf42 | 559 | if(IsAODanalysis()) fTaggedTrackAnalysis->SetAOD(); |
01745870 | 560 | AliHFEvarManager *varManager = fTaggedTrackAnalysis->GetVarManager(); |
561 | TObjArray *array = fVarManager->GetVariables(); | |
562 | Int_t nvars = array->GetEntriesFast(); | |
563 | TString namee; | |
564 | for(Int_t v = 0; v < nvars; v++) { | |
565 | AliHFEvarManager::AliHFEvariable *variable = (AliHFEvarManager::AliHFEvariable *) array->At(v); | |
566 | if(!variable) continue; | |
567 | TString name(((AliHFEvarManager::AliHFEvariable *)variable)->GetName()); | |
568 | if(!name.CompareTo("source")) namee = TString("species"); | |
569 | else namee = TString(name); | |
570 | Int_t nbins = variable->GetNumberOfBins(); | |
571 | if(variable->HasUserDefinedBinning()){ | |
572 | varManager->AddVariable(namee, nbins, variable->GetBinning()); | |
573 | } else { | |
574 | varManager->AddVariable(namee, nbins, variable->GetMinimum(), variable->GetMaximum()); | |
575 | } | |
576 | //printf("For AliTaggedTrackAnalysis, had the variable %s and the one used %s\n",(const char*)variable->GetName(),(const char*) namee); | |
577 | } | |
578 | if(fPIDqa->HasHighResolutionHistos()) | |
579 | fTaggedTrackAnalysis->GetPIDqa()->SetHighResolutionHistos(); | |
580 | fTaggedTrackAnalysis->SetPID(fPID); | |
581 | fTaggedTrackAnalysis->SetVariablesTRD(fVariablesTRDTaggedTrack); | |
582 | fTaggedTrackAnalysis->InitContainer(); | |
583 | fOutput->Add(fTaggedTrackAnalysis->GetContainer()); | |
584 | fQA->Add(fTaggedTrackAnalysis->GetPIDQA()); | |
585 | fQA->Add(fTaggedTrackAnalysis->GetCutQA()); | |
586 | fQA->Add(fTaggedTrackAnalysis->GetQAcollection()); | |
587 | } | |
588 | ||
589 | //fQA->Print(); | |
590 | ||
591 | PrintStatus(); | |
592 | // Done!!! | |
593 | PostData(1, fOutput); | |
594 | PostData(2, fQA); | |
595 | } | |
596 | ||
597 | //____________________________________________________________ | |
598 | void AliAnalysisTaskHFE::UserExec(Option_t *){ | |
599 | // | |
600 | // Run the analysis | |
601 | // | |
602 | ||
603 | //printf("test00\n"); | |
604 | ||
605 | AliDebug(3, "Starting Single Event Analysis"); | |
606 | if(!fInputEvent){ | |
607 | AliError("Reconstructed Event not available"); | |
608 | //printf("Reconstructed Event not available"); | |
609 | return; | |
610 | } | |
611 | if(HasMCData() && IsESDanalysis()){ | |
612 | AliDebug(4, Form("MC Event: %p", fMCEvent)); | |
613 | if(!fMCEvent){ | |
614 | AliError("No MC Event, but MC Data required"); | |
615 | //printf("No MC Event, but MC Data required"); | |
616 | return; | |
617 | } | |
618 | } | |
619 | if(!fCuts){ | |
620 | AliError("HFE cuts not available"); | |
621 | //printf("HFE cuts not available"); | |
622 | return; | |
623 | } | |
624 | if(!fPID->IsInitialized()){ | |
625 | // Initialize PID with the given run number | |
626 | fPID->InitializePID(fInputEvent->GetRunNumber()); | |
627 | } | |
628 | ||
629 | if(fRemoveFirstEvent){ | |
630 | if(fAnalysisUtils->IsFirstEventInChunk(fInputEvent)) return; | |
631 | } | |
632 | ||
633 | AliESDEvent *ev = dynamic_cast<AliESDEvent *>(fInputEvent); | |
4437a0d2 | 634 | if(ev && fTRDTrigger && (fWhichTRDTrigger<6)) |
01745870 | 635 | { |
4437a0d2 | 636 | if(!CheckTRDTriggerESD(ev)) return; |
637 | } | |
638 | if(fInputEvent && fTRDTrigger && (fWhichTRDTrigger>5)) | |
639 | { | |
640 | if(!CheckTRDTrigger(fInputEvent)) return; | |
01745870 | 641 | } |
01745870 | 642 | |
643 | if(IsESDanalysis() && HasMCData()){ | |
644 | // Protect against missing MC trees | |
645 | AliMCEventHandler *mcH = dynamic_cast<AliMCEventHandler *>(AliAnalysisManager::GetAnalysisManager()->GetMCtruthEventHandler()); | |
646 | if(!mcH){ | |
647 | AliError("No MC Event Handler available"); | |
648 | return; | |
649 | } | |
650 | if(!mcH->InitOk()) return; | |
651 | if(!mcH->TreeK()) return; | |
652 | if(!mcH->TreeTR()) return; | |
653 | ||
654 | // Background subtraction------------------------------------------------------------------- | |
655 | if(GetPlugin(kNonPhotonicElectron)) fBackgroundSubtraction->SetMCEvent(fMCEvent); | |
656 | //------------------------------------------------------------------------------------------ | |
657 | } | |
658 | ||
659 | if(IsAODanalysis() && HasMCData()){ | |
660 | // take MC info | |
661 | AliAODEvent *aodE = dynamic_cast<AliAODEvent *>(fInputEvent); | |
662 | if(!aodE){ | |
663 | AliError("No AOD Event"); | |
664 | return; | |
665 | } | |
666 | fAODMCHeader = dynamic_cast<AliAODMCHeader *>(fInputEvent->FindListObject(AliAODMCHeader::StdBranchName())); | |
667 | if(!fAODMCHeader){ | |
668 | AliError("No AliAODMCHeader"); | |
669 | //printf("No AliAODMCHeader"); | |
670 | return; | |
671 | } | |
672 | fAODArrayMCInfo = dynamic_cast<TClonesArray *>(fInputEvent->FindListObject(AliAODMCParticle::StdBranchName())); | |
673 | if(!fAODArrayMCInfo){ | |
674 | AliError("No AOD MC particles"); | |
675 | //printf("No AOD MC particles"); | |
676 | return; | |
677 | } | |
678 | fSignalCuts->SetMCAODInfo(fAODArrayMCInfo); | |
679 | // Background subtraction------------------------------------------------------------------- | |
680 | if (GetPlugin(kNonPhotonicElectron)) fBackgroundSubtraction->SetAODArrayMCInfo(fAODArrayMCInfo); | |
681 | //------------------------------------------------------------------------------------------ | |
682 | } | |
683 | ||
684 | //printf("test2\n"); | |
685 | ||
686 | // need the centrality for everything (MC also) | |
687 | fCentralityF = -1; | |
688 | if(!ReadCentrality()) fCentralityF = -1; | |
689 | //printf("pass centrality\n"); | |
690 | //printf("Reading fCentralityF %d\n",fCentralityF); | |
691 | ||
692 | // See if pile up and z in the range | |
693 | RejectionPileUpVertexRangeEventCut(); | |
694 | ||
695 | //printf("test3\n"); | |
696 | ||
697 | // Protect agains missing | |
698 | if(HasMCData()){ | |
699 | //printf("Has MC data\n"); | |
700 | fSignalCuts->SetMCEvent(fMCEvent); | |
701 | ProcessMC(); // Run the MC loop + MC QA in case MC Data are available | |
702 | } | |
703 | ||
704 | AliPIDResponse *pidResponse = fInputHandler->GetPIDResponse(); | |
705 | if(!pidResponse){ | |
706 | AliDebug(1, "Using default PID Response"); | |
707 | pidResponse = AliHFEtools::GetDefaultPID(HasMCData(), fInputEvent->IsA() == AliESDEvent::Class()); | |
708 | } | |
709 | fPID->SetPIDResponse(pidResponse); | |
710 | if(fPIDpreselect) fPIDpreselect->SetPIDResponse(pidResponse); | |
711 | ||
712 | // Background subtraction------------------------------------------------------------------- | |
713 | if(GetPlugin(kNonPhotonicElectron)) fBackgroundSubtraction->InitRun(fInputEvent,pidResponse); | |
714 | //------------------------------------------------------------------------------------------ | |
715 | ||
716 | // Event loop | |
717 | if(IsAODanalysis()){ | |
718 | //printf("test4\n"); | |
719 | ProcessAOD(); | |
720 | } else { | |
721 | const char *specialTrigger = GetSpecialTrigger(fInputEvent->GetRunNumber()); | |
722 | // Check Trigger selection | |
723 | if(specialTrigger){ | |
724 | AliDebug(2, Form("Special Trigger requested: %s", specialTrigger)); | |
725 | if(!(ev && ev->IsTriggerClassFired(specialTrigger))){ | |
726 | AliDebug(2, "Event not selected"); | |
727 | return; | |
728 | } else AliDebug(2, "Event Selected"); | |
729 | } else AliDebug(2, "No Special Trigger requested"); | |
730 | ||
731 | ProcessESD(); | |
732 | } | |
733 | // Done!!! | |
734 | PostData(1, fOutput); | |
735 | PostData(2, fQA); | |
736 | } | |
737 | ||
738 | //____________________________________________________________ | |
739 | void AliAnalysisTaskHFE::Terminate(Option_t *){ | |
740 | // | |
741 | // Terminate not implemented at the moment | |
742 | // | |
743 | } | |
744 | ||
745 | //_______________________________________________________________ | |
746 | Bool_t AliAnalysisTaskHFE::IsEventInBinZero() { | |
747 | // | |
748 | // | |
749 | // | |
750 | ||
751 | //printf("test in IsEventInBinZero\n"); | |
752 | if(!fInputEvent){ | |
753 | AliError("Reconstructed Event not available"); | |
754 | return kFALSE; | |
755 | } | |
756 | ||
757 | // check vertex | |
758 | const AliVVertex *vertex = fInputEvent->GetPrimaryVertex(); | |
759 | if(!vertex) return kTRUE; | |
760 | //if(vertex) return kTRUE; | |
761 | ||
762 | // check tracks | |
763 | if(fInputEvent->GetNumberOfTracks()<=0) return kTRUE; | |
764 | //if(fInputEvent->GetNumberOfTracks()>0) return kTRUE; | |
765 | ||
766 | ||
767 | return kFALSE; | |
768 | ||
769 | } | |
770 | //____________________________________________________________ | |
771 | void AliAnalysisTaskHFE::ProcessMC(){ | |
772 | // | |
773 | // Runs the MC Loop (filling the container for the MC Cut Steps with the observables pt, eta and phi) | |
774 | // In case MC QA is on also MC QA loop is done | |
775 | // | |
776 | AliDebug(3, "Processing MC Information"); | |
777 | Double_t eventContainer [4] = {0., 0., 0., 0.}; | |
778 | if(IsESDanalysis()) eventContainer[0] = fMCEvent->GetPrimaryVertex()->GetZ(); | |
779 | else eventContainer[0] = fAODMCHeader->GetVtxZ(); | |
780 | eventContainer[2] = fCentralityF; | |
781 | eventContainer[3] = fContributors; | |
782 | fVz = eventContainer[0]; | |
783 | //printf("z position is %f\n",eventContainer[0]); | |
784 | //if(fCFM->CheckEventCuts(AliHFEcuts::kEventStepGenerated, fMCEvent)) | |
785 | fCFM->GetEventContainer()->Fill(eventContainer,AliHFEcuts::kEventStepGenerated); | |
786 | Int_t nElectrons = 0; | |
787 | if(IsESDanalysis()){ | |
788 | if(!((fIdentifiedAsPileUp) || (TMath::Abs(fVz) > fCuts->GetVertexRange()) || (fCentralityF < 0))){ //kStepMCGeneratedZOutNoPileUpCentralityFine | |
789 | if (HasMCData() && IsQAOn(kMCqa)) { | |
790 | AliDebug(2, "Running MC QA"); | |
791 | ||
792 | if(fMCEvent->Stack()){ | |
793 | fMCQA->SetMCEvent(fMCEvent); | |
794 | fMCQA->SetGenEventHeader(fMCEvent->GenEventHeader()); | |
795 | fMCQA->SetCentrality(fCentralityF); | |
796 | fMCQA->SetPercentrality(static_cast<Int_t>(fCentralityPercent)); | |
797 | if(IsPbPb()) { fMCQA->SetPbPb();} | |
798 | else | |
799 | { | |
800 | if(fisppMultiBin) fMCQA->SetPPMultiBin(); | |
801 | else fMCQA->SetPP(); | |
802 | } | |
803 | fMCQA->Init(); | |
804 | ||
805 | fMCQA->GetMesonKine(); | |
806 | ||
807 | // loop over all tracks for decayed electrons | |
808 | for (Int_t igen = 0; igen < fMCEvent->GetNumberOfTracks(); igen++){ | |
809 | TParticle* mcpart = fMCEvent->Stack()->Particle(igen); | |
810 | if(!mcpart) continue; | |
811 | fMCQA->GetQuarkKine(mcpart, igen, AliHFEmcQA::kCharm); | |
812 | fMCQA->GetQuarkKine(mcpart, igen, AliHFEmcQA::kBeauty); | |
813 | fMCQA->GetHadronKine(mcpart, AliHFEmcQA::kCharm); | |
814 | fMCQA->GetHadronKine(mcpart, AliHFEmcQA::kBeauty); | |
815 | fMCQA->GetDecayedKine(mcpart, AliHFEmcQA::kCharm, AliHFEmcQA::kElectronPDG); // no accept cut | |
816 | fMCQA->GetDecayedKine(mcpart, AliHFEmcQA::kBeauty, AliHFEmcQA::kElectronPDG); // no accept cut | |
817 | fMCQA->GetDecayedKine(mcpart, AliHFEmcQA::kOthers, AliHFEmcQA::kElectronPDG); // no accept cut | |
818 | } | |
819 | //fMCQA->EndOfEventAna(AliHFEmcQA::kCharm); | |
820 | //fMCQA->EndOfEventAna(AliHFEmcQA::kBeauty); | |
821 | } | |
822 | ||
823 | } // end of MC QA loop | |
824 | } | |
825 | // ----------------------------------------------------------------- | |
826 | fCFM->SetMCEventInfo(fMCEvent); | |
827 | // fCFM->CheckEventCuts(AliCFManager::kEvtRecCuts, fESD); | |
828 | } else { | |
2e4ed823 | 829 | fMCQA->SetMCArray(fAODArrayMCInfo); |
01745870 | 830 | fCFM->SetMCEventInfo(fInputEvent); |
831 | } | |
832 | // Run MC loop | |
833 | AliVParticle *mctrack = NULL; | |
834 | Int_t numberofmctracks = 0; | |
835 | if(IsESDanalysis()){ | |
836 | numberofmctracks = fMCEvent->GetNumberOfTracks(); | |
837 | } | |
838 | else { | |
839 | numberofmctracks = fAODArrayMCInfo->GetEntriesFast(); | |
840 | } | |
841 | AliDebug(3, Form("Number of Tracks: %d",numberofmctracks)); | |
842 | //printf("Number of MC track %d\n",numberofmctracks); | |
843 | for(Int_t imc = 0; imc <numberofmctracks; imc++){ | |
844 | if(IsESDanalysis()) { | |
845 | if(!(mctrack = fMCEvent->GetTrack(imc))) continue; | |
846 | } | |
847 | else { | |
848 | if(!(mctrack = (AliVParticle *) fAODArrayMCInfo->At(imc))) continue; | |
849 | } | |
850 | //printf("Test in ProcessMC\n"); | |
851 | AliDebug(4, "Next MC Track"); | |
852 | if(ProcessMCtrack(mctrack)) nElectrons++; | |
853 | } | |
854 | ||
855 | // fCFM->CheckEventCuts(AliCFManager::kEvtRecCuts, fESD); | |
856 | fQACollection->Fill("nElectron", nElectrons); | |
857 | } | |
858 | ||
859 | //____________________________________________________________ | |
860 | void AliAnalysisTaskHFE::ProcessESD(){ | |
861 | // | |
862 | // Run Analysis of reconstructed event in ESD Mode | |
863 | // Loop over Tracks, filter according cut steps defined in AliHFEcuts | |
864 | // | |
865 | AliDebug(1, Form("Task %s", GetName())); | |
866 | AliDebug(3, "Processing ESD Event"); | |
867 | AliESDEvent *fESD = dynamic_cast<AliESDEvent *>(fInputEvent); | |
868 | if(!fESD){ | |
869 | AliError("ESD Event required for ESD Analysis"); | |
870 | return; | |
871 | } | |
872 | ||
873 | // Set magnetic field if V0 task on | |
874 | if(fTaggedTrackAnalysis) { | |
2e4ed823 | 875 | // Tag all v0s in current event |
876 | if(fV0Tagger){ | |
877 | fV0Tagger->Reset(); | |
878 | fV0Tagger->TagV0Tracks(fESD); | |
879 | } | |
01745870 | 880 | fTaggedTrackAnalysis->SetMagneticField(fESD->GetMagneticField()); |
881 | fTaggedTrackAnalysis->SetCentrality(fCentralityF); | |
4437a0d2 | 882 | if(IsPbPb()) fTaggedTrackAnalysis->SetPbPb(); |
883 | else { | |
2e4ed823 | 884 | if(IspPb()) fTaggedTrackAnalysis->SetpPb(); |
885 | else fTaggedTrackAnalysis->SetPP(); | |
4437a0d2 | 886 | } |
01745870 | 887 | } |
888 | ||
889 | // Do event Normalization | |
890 | Double_t eventContainer[4]; | |
891 | eventContainer[0] = 0.; | |
892 | if(HasMCData()) eventContainer[0] = fVz; | |
893 | else { | |
894 | const AliESDVertex* vtxESD = fESD->GetPrimaryVertex(); | |
895 | if(vtxESD) eventContainer[0] = vtxESD->GetZ(); | |
896 | } | |
897 | eventContainer[1] = 0.; | |
898 | eventContainer[2] = fCentralityF; | |
899 | eventContainer[3] = fContributors; | |
900 | if(fTriggerAnalysis->IsOfflineTriggerFired(fESD, AliTriggerAnalysis::kV0AND)) | |
901 | eventContainer[1] = 1.; | |
902 | ||
903 | // | |
904 | fCFM->GetEventContainer()->Fill(eventContainer, AliHFEcuts::kEventStepRecNoCut); | |
905 | ||
906 | // | |
907 | if(fIdentifiedAsPileUp) return; | |
908 | fCFM->GetEventContainer()->Fill(eventContainer, AliHFEcuts::kEventStepRecNoPileUp); | |
909 | ||
910 | // | |
911 | if(TMath::Abs(fCentralityF) < 0) return; | |
912 | fCFM->GetEventContainer()->Fill(eventContainer, AliHFEcuts::kEventStepRecCentralityOk); | |
913 | //printf("In ProcessESD %f\n",fCentralityF); | |
914 | ||
915 | // | |
916 | if(fIdentifiedAsOutInz) return; | |
917 | fCFM->GetEventContainer()->Fill(eventContainer, AliHFEcuts::kEventStepZRange); | |
918 | ||
919 | // | |
920 | if(!fPassTheEventCut) return; | |
921 | fCFM->GetEventContainer()->Fill(eventContainer, AliHFEcuts::kEventStepReconstructed); | |
922 | ||
923 | ||
924 | fContainer->NewEvent(); | |
925 | ||
926 | if (GetPlugin(kIsElecBackGround)) { | |
927 | fElecBackGround->SetEvent(fESD); | |
928 | } | |
929 | if (GetPlugin(kSecVtx)) { | |
930 | fSecVtx->SetEvent(fESD); | |
931 | fSecVtx->GetPrimaryCondition(); | |
932 | } | |
933 | ||
934 | if(HasMCData()){ | |
935 | if (GetPlugin(kSecVtx)) { | |
936 | fSecVtx->SetMCEvent(fMCEvent); | |
937 | fSecVtx->SetMCQA(fMCQA); | |
938 | } | |
939 | if (GetPlugin(kIsElecBackGround)) { | |
940 | fElecBackGround->SetMCEvent(fMCEvent); | |
941 | } | |
942 | } | |
943 | ||
944 | Double_t container[10]; | |
945 | memset(container, 0, sizeof(Double_t) * 10); | |
946 | // container for the output THnSparse | |
947 | Double_t dataDca[6]; // [source, pT, dca, centrality] | |
948 | Int_t nElectronCandidates = 0; | |
949 | AliESDtrack *track = NULL, *htrack = NULL; | |
950 | AliMCParticle *mctrack = NULL; | |
951 | AliMCParticle *mctrackmother = NULL; | |
952 | ||
953 | Bool_t signal = kTRUE; | |
954 | ||
955 | fCFM->SetRecEventInfo(fESD); | |
956 | ||
957 | // Get Number of contributors to the primary vertex for multiplicity-dependent correction | |
958 | Int_t ncontribVtx = 0; | |
959 | const AliESDVertex *priVtx = fESD->GetPrimaryVertexTracks(); | |
960 | if(priVtx){ | |
961 | ncontribVtx = priVtx->GetNContributors(); | |
962 | } | |
963 | ||
964 | // minjung for IP QA(temporary ~ 2weeks) | |
965 | if(!fExtraCuts){ | |
966 | fExtraCuts = new AliHFEextraCuts("hfetmpCuts","HFE tmp Cuts"); | |
967 | } | |
968 | fExtraCuts->SetRecEventInfo(fESD); | |
969 | ||
970 | // Electron background analysis | |
971 | if (GetPlugin(kIsElecBackGround)) { | |
972 | ||
973 | AliDebug(2, "Running BackGround Analysis"); | |
974 | ||
975 | fElecBackGround->Reset(); | |
976 | ||
977 | } // end of electron background analysis | |
978 | ||
979 | ||
980 | // Background subtraction------------------------------------------------------------------- | |
981 | if (GetPlugin(kNonPhotonicElectron)) fBackgroundSubtraction->FillPoolAssociatedTracks(fInputEvent, fCentralityF); | |
982 | //------------------------------------------------------------------------------------------ | |
983 | ||
984 | // | |
985 | // Loop ESD | |
986 | // | |
987 | AliDebug(3, Form("Number of Tracks: %d", fESD->GetNumberOfTracks())); | |
2e4ed823 | 988 | Bool_t kinkmother(kFALSE), kinkdaughter(kFALSE); Double_t kinkstatus(0); |
01745870 | 989 | for(Int_t itrack = 0; itrack < fESD->GetNumberOfTracks(); itrack++){ |
990 | AliDebug(4, "New ESD track"); | |
991 | track = fESD->GetTrack(itrack); | |
992 | track->SetESDEvent(fESD); | |
2e4ed823 | 993 | kinkmother = track->GetKinkIndex(0) < 0; kinkdaughter = track->GetKinkIndex(0) > 0; |
994 | kinkstatus = 0.; | |
995 | if(kinkmother) kinkstatus = 1.; | |
996 | else if(kinkdaughter) kinkstatus = 2.; | |
4437a0d2 | 997 | |
01745870 | 998 | // fill counts of v0-identified particles |
dab4f95d | 999 | AliPID::EParticleType v0pid = fV0Tagger ? fV0Tagger->GetV0Info(track->GetID()) : AliPID::kUnknown; |
01745870 | 1000 | // here the tagged track analysis will run |
7986e54e | 1001 | if(fTaggedTrackAnalysis && v0pid != AliPID::kUnknown){ |
01745870 | 1002 | AliDebug(1, Form("Track identified as %s", AliPID::ParticleName(v0pid))); |
1003 | fTaggedTrackAnalysis->ProcessTrack(track, v0pid); | |
1004 | AliDebug(1, "V0 PID done"); | |
1005 | } | |
1006 | ||
1007 | ||
1008 | //Fill non-HFE source containers at reconstructed events cut step | |
1009 | AliDebug(3, Form("Doing track %d, %p", itrack, track)); | |
1010 | ||
1011 | ||
1012 | ////////////////////////////////////// | |
1013 | // preselect | |
1014 | ////////////////////////////////////// | |
1015 | if(fPIDpreselect || fCutspreselect) { | |
1016 | if(!PreSelectTrack(track)) continue; | |
1017 | } | |
1018 | ||
1019 | signal = kTRUE; | |
1020 | ||
1021 | // Fill step without any cut | |
1022 | ||
1023 | if(HasMCData()){ | |
1024 | // Check if it is electrons near the vertex | |
1025 | if(!(mctrack = dynamic_cast<AliMCParticle *>(fMCEvent->GetTrack(TMath::Abs(track->GetLabel()))))) continue; | |
1026 | ||
1027 | if(fFillSignalOnly && !fCFM->CheckParticleCuts(AliHFEcuts::kStepMCGenerated, mctrack)) signal = kFALSE; | |
2e4ed823 | 1028 | if(fRejectMCFakeTracks && IsMCFakeTrack(track)) signal = kFALSE; |
01745870 | 1029 | else AliDebug(3, "Signal Electron"); |
1030 | ||
1031 | // Fill K pt for Ke3 contributions | |
1032 | if(mctrack && (TMath::Abs(mctrack->Particle()->GetPdgCode())==321)) fQACollection->Fill("Kptspectra",mctrack->Pt()); | |
1033 | else if(mctrack && (TMath::Abs(mctrack->Particle()->GetPdgCode())==130)) fQACollection->Fill("K0Lptspectra",mctrack->Pt()); | |
1034 | } | |
1035 | // Cache new Track information inside the var manager | |
1036 | fVarManager->NewTrack(track, mctrack, fCentralityF, -1, signal); | |
1037 | ||
1038 | if(fFillNoCuts) { | |
1039 | if(signal || !fFillSignalOnly){ | |
1040 | fVarManager->FillContainer(fContainer, "recTrackContReco", AliHFEcuts::kStepRecNoCut, kFALSE); | |
1041 | fVarManager->FillContainer(fContainer, "recTrackContMC", AliHFEcuts::kStepRecNoCut, kTRUE); | |
1042 | } | |
1043 | } | |
1044 | ||
1045 | // RecKine: ITSTPC cuts | |
1046 | if(!ProcessCutStep(AliHFEcuts::kStepRecKineITSTPC, track)) continue; | |
1047 | ||
2e4ed823 | 1048 | fQACollection->Fill("Kinkbefore", track->Pt(), kinkstatus); |
01745870 | 1049 | // RecPrim |
1050 | if(fRejectKinkMother) { | |
1051 | if(track->GetKinkIndex(0) != 0) continue; } // Quick and dirty fix to reject both kink mothers and daughters | |
1052 | if(!ProcessCutStep(AliHFEcuts::kStepRecPrim, track)) continue; | |
2e4ed823 | 1053 | fQACollection->Fill("Kinkafter", track->Pt(), kinkstatus); |
01745870 | 1054 | |
1055 | // HFEcuts: ITS layers cuts | |
1056 | if(!ProcessCutStep(AliHFEcuts::kStepHFEcutsITS, track)) continue; | |
1057 | ||
1058 | // HFE cuts: TOF PID and mismatch flag | |
1059 | if(!ProcessCutStep(AliHFEcuts::kStepHFEcutsTOF, track)) continue; | |
1060 | ||
1061 | // HFE cuts: TPC PID cleanup | |
1062 | if(!ProcessCutStep(AliHFEcuts::kStepHFEcutsTPC, track)) continue; | |
1063 | ||
1064 | // HFEcuts: Nb of tracklets TRD0 | |
1065 | if(!ProcessCutStep(AliHFEcuts::kStepHFEcutsTRD, track)) continue; | |
1066 | ||
1067 | // Fill correlation maps before PID | |
1068 | if(signal && fContainer->GetCorrelationMatrix("correlationstepbeforePID")) { | |
1069 | //printf("Fill correlation maps before PID\n"); | |
1070 | fVarManager->FillCorrelationMatrix(fContainer->GetCorrelationMatrix("correlationstepbeforePID")); | |
1071 | } | |
1072 | ||
1073 | if(HasMCData()){ | |
1074 | FillProductionVertex(track); | |
1075 | ||
1076 | if(fMCQA && signal){ | |
1077 | fMCQA->SetCentrality(fCentralityF); | |
1078 | if(mctrack && (TMath::Abs(mctrack->Particle()->GetPdgCode()) == 11)){ | |
1079 | Double_t weightElecBgV0[kBgLevels] = {0.,0.,0.}; | |
1080 | Double_t hfeimpactRtmp=0., hfeimpactnsigmaRtmp=0.; | |
1081 | fExtraCuts->GetHFEImpactParameters(track, hfeimpactRtmp, hfeimpactnsigmaRtmp); | |
1082 | UChar_t itsPixel = track->GetITSClusterMap(); | |
1083 | Double_t ilyrhit=0, ilyrstat=0; | |
1084 | for(Int_t ilyr=0; ilyr<6; ilyr++){ | |
1085 | if(TESTBIT(itsPixel, ilyr)) ilyrhit += TMath::Power(2,ilyr); | |
1086 | if(fExtraCuts->CheckITSstatus(fExtraCuts->GetITSstatus(track,ilyr))) ilyrstat += TMath::Power(2,ilyr); | |
1087 | } | |
1088 | fMCQA->SetITSInfo(ilyrhit,ilyrstat); | |
1089 | fMCQA->SetHFEImpactParameters(hfeimpactRtmp, hfeimpactnsigmaRtmp); | |
1090 | fMCQA->SetTrkKine(track->Pt(),track->Eta(), track->Phi()); | |
1091 | fMCQA->SetContainerStep(3); | |
1092 | for(Int_t iLevel = 0; iLevel < kBgLevels; iLevel++){ | |
1093 | weightElecBgV0[iLevel] = fMCQA->GetWeightFactor(mctrack, iLevel); // positive:conversion e, negative: nonHFE | |
1094 | if(!fisNonHFEsystematics || IsPbPb())break; | |
1095 | } | |
1096 | ||
1097 | if(fisNonHFEsystematics){ | |
1098 | //Fill additional containers for electron source distinction | |
1099 | Int_t elecSource = 0; | |
1100 | elecSource = fMCQA->GetElecSource(mctrack->Particle()); | |
1101 | const Char_t *sourceName[kElecBgSpecies]={"Pion","Eta","Omega","Phi","EtaPrime","Rho"}; | |
1102 | const Char_t *levelName[kBgLevels]={"Best","Lower","Upper"}; | |
1103 | Int_t iName = 0; | |
1104 | for(Int_t iSource = AliHFEmcQA::kPi0; iSource <= AliHFEmcQA::kGammaRho0; iSource++){ | |
1105 | if((iSource == AliHFEmcQA::kElse)||(iSource == AliHFEmcQA::kMisID)) continue; | |
1106 | if(elecSource == iSource){ | |
1107 | for(Int_t iLevel = 0; iLevel < kBgLevels; iLevel++){ | |
1108 | if(weightElecBgV0[iLevel]>0){ | |
1109 | fVarManager->FillContainer(fContainer, Form("conversionElecs%s%s",sourceName[iName], levelName[iLevel]), 3, kFALSE, weightElecBgV0[iLevel]); | |
1110 | } | |
1111 | else if(weightElecBgV0[iLevel]<0){ | |
1112 | fVarManager->FillContainer(fContainer, Form("mesonElecs%s%s",sourceName[iName], levelName[iLevel]), 3, kFALSE, -1*weightElecBgV0[iLevel]); | |
1113 | } | |
1114 | if(IsPbPb())break; | |
1115 | } | |
1116 | break; | |
1117 | } | |
1118 | iName++; | |
1119 | if(iName == kElecBgSpecies)iName = 0; | |
1120 | } | |
1121 | } | |
1122 | //else{ | |
1123 | if(weightElecBgV0[0]>0) { | |
1124 | fVarManager->FillContainer(fContainer, "conversionElecs", 3, kFALSE, weightElecBgV0[0]); | |
1125 | fVarManager->FillContainer(fContainer, "conversionElecs", 4, kTRUE, weightElecBgV0[0]); | |
1126 | } | |
1127 | else if(weightElecBgV0[0]<0) { | |
1128 | fVarManager->FillContainer(fContainer, "mesonElecs", 3, kFALSE, -1*weightElecBgV0[0]); | |
1129 | fVarManager->FillContainer(fContainer, "mesonElecs", 4, kTRUE, -1*weightElecBgV0[0]); | |
1130 | } | |
1131 | //} | |
1132 | } | |
1133 | } | |
1134 | ||
1135 | Double_t hfeimpactR4all=0., hfeimpactnsigmaR4all=0.; | |
1136 | Int_t sourceDca =-1; | |
1137 | if(mctrack && (TMath::Abs(mctrack->Particle()->GetPdgCode()) == 211)){ | |
1138 | if(track->Pt()>4.){ | |
1139 | fExtraCuts->GetHFEImpactParameters(track, hfeimpactR4all, hfeimpactnsigmaR4all); | |
1140 | dataDca[0]=0; //pion | |
1141 | dataDca[1]=track->Pt(); | |
1142 | dataDca[2]=hfeimpactR4all; | |
1143 | dataDca[3]=fCentralityF; | |
1144 | dataDca[4] = v0pid; | |
1145 | dataDca[5] = double(track->Charge()); | |
1146 | fQACollection->Fill("Dca", dataDca); | |
1147 | } | |
1148 | } | |
1149 | else if(mctrack && (TMath::Abs(mctrack->Particle()->GetPdgCode()) == 11)){ // to increas statistics for Martin | |
1150 | if(signal){ | |
1151 | fExtraCuts->GetHFEImpactParameters(track, hfeimpactR4all, hfeimpactnsigmaR4all); | |
1152 | if(fSignalCuts->IsCharmElectron(track)){ | |
1153 | sourceDca=1; | |
1154 | } | |
1155 | else if(fSignalCuts->IsBeautyElectron(track)){ | |
1156 | sourceDca=2; | |
1157 | } | |
1158 | else if(fSignalCuts->IsGammaElectron(track)){ | |
1159 | sourceDca=3; | |
1160 | } | |
1161 | else if(fSignalCuts->IsNonHFElectron(track)){ | |
1162 | sourceDca=4; | |
1163 | } | |
1164 | else if(fSignalCuts->IsJpsiElectron(track)){ | |
1165 | sourceDca=5; | |
1166 | } | |
1167 | else { | |
1168 | sourceDca=6; | |
1169 | } | |
1170 | dataDca[0]=sourceDca; | |
1171 | dataDca[1]=track->Pt(); | |
1172 | dataDca[2]=hfeimpactR4all; | |
1173 | dataDca[3]=fCentralityF; | |
1174 | dataDca[4] = v0pid; | |
1175 | dataDca[5] = double(track->Charge()); | |
1176 | if(signal) fQACollection->Fill("Dca", dataDca); | |
1177 | } | |
1178 | } | |
1179 | } | |
1180 | ||
1181 | AliHFEpidObject hfetrack; | |
1182 | hfetrack.SetAnalysisType(AliHFEpidObject::kESDanalysis); | |
1183 | hfetrack.SetRecTrack(track); | |
1184 | if(HasMCData()) hfetrack.SetMCTrack(mctrack); | |
1185 | hfetrack.SetCentrality(fCentralityF); | |
1186 | hfetrack.SetMulitplicity(ncontribVtx); | |
4437a0d2 | 1187 | if(IsPbPb()) hfetrack.SetPbPb(); |
1188 | else { | |
1189 | if(IspPb()) hfetrack.SetpPb(); | |
1190 | else hfetrack.SetPP(); | |
1191 | } | |
01745870 | 1192 | fPID->SetVarManager(fVarManager); |
1193 | if(!fPID->IsSelected(&hfetrack, fContainer, "recTrackCont", fPIDqa)) continue; | |
1194 | nElectronCandidates++; | |
1195 | ||
1196 | // Background subtraction------------------------------------------------------------------------------------------ | |
1197 | if (GetPlugin(kNonPhotonicElectron)) { | |
1198 | Int_t indexmother = -1; | |
1199 | Int_t mcsource = -1; | |
1200 | if(HasMCData()){ | |
1201 | mcsource = fBackgroundSubtraction->FindMother(mctrack->GetLabel(),indexmother); | |
1202 | } | |
1203 | fBackgroundSubtraction->LookAtNonHFE(itrack, track, fInputEvent, 1, fCentralityF, -1, mcsource, indexmother); | |
1204 | } | |
1205 | //----------------------------------------------------------------------------------------------------------------- | |
1206 | ||
1207 | // Temporary histogram for chi2/ITS cluster | |
1208 | if(IsPbPb()) { | |
1209 | TBits shared = track->GetTPCSharedMap(); | |
1210 | Int_t sharebit=0; | |
1211 | if(shared.CountBits() >= 2) sharebit=1; | |
1212 | ||
1213 | Double_t itschi2percluster = 0.0; | |
1214 | Double_t itsnbcls = static_cast<Double_t>(track->GetNcls(0)); | |
1215 | if(itsnbcls > 0) itschi2percluster = track->GetITSchi2()/itsnbcls; | |
1216 | ||
1217 | Double_t itsChi2[7] = {track->Pt(),track->Eta(), track->Phi(), | |
1218 | static_cast<Double_t>(fCentralityF),static_cast<Double_t>(track->GetTPCsignalN()), static_cast<Double_t>(sharebit),itschi2percluster}; | |
1219 | fQACollection->Fill("fChi2perITScluster", itsChi2); | |
1220 | } | |
1221 | else{ | |
1222 | ||
1223 | Double_t itschi2percluster = 0.0; | |
1224 | Double_t itsnbcls = static_cast<Double_t>(track->GetNcls(0)); | |
1225 | if(itsnbcls > 0) itschi2percluster = track->GetITSchi2()/itsnbcls; | |
1226 | ||
1227 | Double_t itsChi2[3] = {track->Pt(), static_cast<Double_t>(fCentralityF), itschi2percluster}; | |
1228 | fQACollection->Fill("fChi2perITScluster", itsChi2); | |
1229 | } | |
1230 | ||
1231 | // Fill Histogram for Hadronic Background | |
1232 | if(HasMCData()){ | |
1233 | if(mctrack && (TMath::Abs(mctrack->Particle()->GetPdgCode()) != 11)) | |
1234 | fVarManager->FillContainer(fContainer, "hadronicBackground", UInt_t(0), kFALSE); | |
1235 | else if(mctrack){ | |
1236 | // Fill Ke3 contributions | |
1237 | Int_t glabel=TMath::Abs(mctrack->GetMother()); | |
1238 | if((mctrackmother = dynamic_cast<AliMCParticle *>(fMCEvent->GetTrack(glabel)))){ | |
1239 | if(TMath::Abs(mctrackmother->Particle()->GetPdgCode())==321) | |
1240 | fQACollection->Fill("Ke3Kecorr",mctrack->Pt(),mctrackmother->Pt()); | |
1241 | else if(TMath::Abs(mctrackmother->Particle()->GetPdgCode())==130) | |
1242 | fQACollection->Fill("Ke3K0Lecorr",mctrack->Pt(),mctrackmother->Pt()); | |
1243 | } | |
1244 | } | |
1245 | } | |
1246 | ||
1247 | // Fill Containers | |
1248 | if(signal) { | |
1249 | // Apply weight for background contamination | |
1250 | if(fBackGroundFactorApply) { | |
4437a0d2 | 1251 | if(IsPbPb() && fCentralityF >= 0) fWeightBackGround = fkBackGroundFactorArray[fCentralityF >= 0 ? fCentralityF : 0]->Eval(TMath::Abs(track->P())); |
1252 | else fWeightBackGround = fkBackGroundFactorArray[0]->Eval(TMath::Abs(track->P())); // for pp and pPb | |
01745870 | 1253 | |
1254 | if(fWeightBackGround < 0.0) fWeightBackGround = 0.0; | |
1255 | else if(fWeightBackGround > 1.0) fWeightBackGround = 1.0; | |
1256 | // weightBackGround as special weight | |
1257 | fVarManager->FillContainer(fContainer, "hadronicBackground", 1, kFALSE, fWeightBackGround); | |
1258 | } | |
1259 | fVarManager->FillCorrelationMatrix(fContainer->GetCorrelationMatrix("correlationstepafterPID")); | |
1260 | } | |
1261 | ||
1262 | Bool_t bTagged=kFALSE; | |
1263 | if(GetPlugin(kSecVtx)) { | |
1264 | AliDebug(2, "Running Secondary Vertex Analysis"); | |
1265 | if(fSecVtx->Process(track) && signal) { | |
1266 | fVarManager->FillContainer(fContainer, "recTrackContSecvtxReco", AliHFEcuts::kStepHFEcutsSecvtx, kFALSE); | |
1267 | fVarManager->FillContainer(fContainer, "recTrackContSecvtxMC", AliHFEcuts::kStepHFEcutsSecvtx, kTRUE); | |
1268 | bTagged=kTRUE; | |
1269 | } | |
1270 | } | |
1271 | ||
1272 | // Electron background analysis | |
1273 | if (GetPlugin(kIsElecBackGround)) { | |
1274 | ||
1275 | AliDebug(2, "Running BackGround Analysis"); | |
1276 | ||
1277 | for(Int_t jtrack = 0; jtrack < fESD->GetNumberOfTracks(); jtrack++){ | |
1278 | htrack = fESD->GetTrack(jtrack); | |
1279 | if ( itrack == jtrack ) continue; | |
1280 | fElecBackGround->PairAnalysis(track, htrack); | |
1281 | } | |
1282 | } // end of electron background analysis | |
1283 | ||
1284 | if (GetPlugin(kDEstep)) { | |
1285 | Double_t weightElecBgV0[kBgLevels] = {0.,0.,0.,}; | |
1286 | Int_t elecSource = 0; | |
1287 | Double_t hfeimpactR=0., hfeimpactnsigmaR=0.; | |
1288 | fExtraCuts->GetHFEImpactParameters(track, hfeimpactR, hfeimpactnsigmaR); | |
1289 | if(HasMCData()) | |
1290 | { | |
1291 | if(mctrack && (TMath::Abs(mctrack->Particle()->GetPdgCode()) != 11)){ | |
1292 | fQACollection->Fill("hadronsBeforeIPcut",track->Pt()); | |
1293 | } | |
1294 | if(fMCQA && signal) { | |
1295 | ||
1296 | fMCQA->SetContainerStep(0); | |
1297 | for(Int_t iLevel = 0; iLevel < kBgLevels; iLevel++){ | |
1298 | weightElecBgV0[iLevel] = fMCQA->GetWeightFactor(mctrack, iLevel); // positive:conversion e, negative: nonHFE | |
1299 | if(!fisNonHFEsystematics || IsPbPb())break; | |
1300 | } | |
1301 | ||
1302 | if(fisNonHFEsystematics){ | |
1303 | //Fill additional containers for electron source distinction | |
1304 | elecSource = fMCQA->GetElecSource(mctrack->Particle()); | |
1305 | const Char_t *sourceName[kElecBgSpecies]={"Pion","Eta","Omega","Phi","EtaPrime","Rho"}; | |
1306 | const Char_t *levelName[kBgLevels]={"Best","Lower","Upper"}; | |
1307 | Int_t iName = 0; | |
1308 | for(Int_t iSource = AliHFEmcQA::kPi0; iSource <= AliHFEmcQA::kGammaRho0; iSource++){ | |
1309 | if((iSource == AliHFEmcQA::kElse)||(iSource == AliHFEmcQA::kMisID)) continue; | |
1310 | if(elecSource == iSource){ | |
1311 | for(Int_t iLevel = 0; iLevel < kBgLevels; iLevel++){ | |
1312 | if(weightElecBgV0[iLevel]>0) fVarManager->FillContainer(fContainer, Form("conversionElecs%s%s",sourceName[iName], levelName[iLevel]), 0, kFALSE, weightElecBgV0[iLevel]); | |
1313 | else if(weightElecBgV0[iLevel]<0) fVarManager->FillContainer(fContainer, Form("mesonElecs%s%s",sourceName[iName], levelName[iLevel]), 0, kFALSE, -1*weightElecBgV0[iLevel]); | |
1314 | if(IsPbPb())break; | |
1315 | } | |
1316 | break; | |
1317 | } | |
1318 | iName++; | |
1319 | if(iName == kElecBgSpecies)iName = 0; | |
1320 | } | |
1321 | } | |
1322 | //else{ | |
1323 | if(weightElecBgV0[0]>0) { | |
1324 | fVarManager->FillContainer(fContainer, "conversionElecs", 0, kFALSE, weightElecBgV0[0]); | |
1325 | fVarManager->FillContainer(fContainer, "conversionElecs", 5, kTRUE, weightElecBgV0[0]); | |
1326 | } | |
1327 | else if(weightElecBgV0[0]<0) { | |
1328 | fVarManager->FillContainer(fContainer, "mesonElecs", 0, kFALSE, -1*weightElecBgV0[0]); | |
1329 | fVarManager->FillContainer(fContainer, "mesonElecs", 5, kTRUE, -1*weightElecBgV0[0]); | |
1330 | } | |
1331 | //} | |
1332 | if(bTagged){ // bg estimation for the secondary vertex tagged signals | |
1333 | if(weightElecBgV0[0]>0) fVarManager->FillContainer(fContainer, "conversionElecs", 2, kFALSE, weightElecBgV0[0]); | |
1334 | else if(weightElecBgV0[0]<0) fVarManager->FillContainer(fContainer, "mesonElecs", 2, kFALSE, -1*weightElecBgV0[0]); | |
1335 | } | |
1336 | } | |
1337 | } // end of MC | |
1338 | ||
1339 | dataDca[0]=-1; //for data, don't know the origin | |
1340 | dataDca[1]=track->Pt(); | |
1341 | dataDca[2]=hfeimpactR; | |
1342 | dataDca[3]=fCentralityF; | |
1343 | dataDca[4] = v0pid; | |
1344 | dataDca[5] = double(track->Charge()); | |
1345 | if (!HasMCData()) fQACollection->Fill("Dca", dataDca); | |
1346 | ||
1347 | // Fill Containers for impact parameter analysis | |
1348 | if(!fCFM->CheckParticleCuts(AliHFEcuts::kStepHFEcutsDca + AliHFEcuts::kNcutStepsMCTrack + AliHFEcuts::kNcutStepsRecTrack,track)) continue; | |
1349 | if(signal) { | |
1350 | // Apply weight for background contamination after ip cut | |
1351 | if(fBackGroundFactorApply) { | |
1352 | fWeightBackGround = fkBackGroundFactorArray[0]->Eval(TMath::Abs(track->P())); // pp case | |
1353 | if(fWeightBackGround < 0.0) fWeightBackGround = 0.0; | |
1354 | else if(fWeightBackGround > 1.0) fWeightBackGround = 1.0; | |
1355 | // weightBackGround as special weight | |
1356 | fVarManager->FillContainer(fContainer, "hadronicBackground", 2, kFALSE, fWeightBackGround); | |
1357 | } | |
1358 | } | |
1359 | ||
1360 | if(HasMCData()){ | |
1361 | if(fMCQA && signal) { | |
1362 | fMCQA->SetContainerStep(1); | |
1363 | for(Int_t iLevel = 0; iLevel < kBgLevels; iLevel++){ | |
1364 | weightElecBgV0[iLevel] = fMCQA->GetWeightFactor(mctrack, iLevel); // positive:conversion e, negative: nonHFE | |
1365 | if(!fisNonHFEsystematics || IsPbPb())break; | |
1366 | } | |
1367 | if(fisNonHFEsystematics){ | |
1368 | //Fill additional containers for electron source distinction | |
1369 | elecSource = fMCQA->GetElecSource(mctrack->Particle()); | |
1370 | const Char_t *sourceName[kElecBgSpecies]={"Pion","Eta","Omega","Phi","EtaPrime","Rho"}; | |
1371 | const Char_t *levelName[kBgLevels]={"Best","Lower","Upper"}; | |
1372 | Int_t iName = 0; | |
1373 | for(Int_t iSource = AliHFEmcQA::kPi0; iSource <= AliHFEmcQA::kGammaRho0; iSource++){ | |
1374 | if((iSource == AliHFEmcQA::kElse)||(iSource == AliHFEmcQA::kMisID)) continue; | |
1375 | if(elecSource == iSource){ | |
1376 | for(Int_t iLevel = 0; iLevel < kBgLevels; iLevel++){ | |
1377 | if(weightElecBgV0[iLevel]>0) fVarManager->FillContainer(fContainer, Form("conversionElecs%s%s",sourceName[iName], levelName[iLevel]), 1, kFALSE, weightElecBgV0[iLevel]); | |
1378 | else if(weightElecBgV0[iLevel]<0) fVarManager->FillContainer(fContainer, Form("mesonElecs%s%s",sourceName[iName], levelName[iLevel]), 1, kFALSE, -1*weightElecBgV0[iLevel]); | |
1379 | if(IsPbPb())break; | |
1380 | } | |
1381 | break; | |
1382 | } | |
1383 | iName++; | |
1384 | if(iName == kElecBgSpecies)iName = 0; | |
1385 | } | |
1386 | } | |
1387 | // else{ | |
1388 | if(weightElecBgV0[0]>0) { | |
1389 | fVarManager->FillContainer(fContainer, "conversionElecs", 1, kFALSE, weightElecBgV0[0]); | |
1390 | fVarManager->FillContainer(fContainer, "conversionElecs", 6, kTRUE, weightElecBgV0[0]); | |
1391 | } | |
1392 | else if(weightElecBgV0[0]<0) { | |
1393 | fVarManager->FillContainer(fContainer, "mesonElecs", 1, kFALSE, -1*weightElecBgV0[0]); | |
1394 | fVarManager->FillContainer(fContainer, "mesonElecs", 6, kTRUE, -1*weightElecBgV0[0]); | |
1395 | } | |
1396 | //} | |
1397 | } | |
1398 | } | |
1399 | if(signal) { | |
1400 | fVarManager->FillContainer(fContainer, "recTrackContDEReco", AliHFEcuts::kStepHFEcutsDca, kFALSE); | |
1401 | fVarManager->FillContainer(fContainer, "recTrackContDEMC", AliHFEcuts::kStepHFEcutsDca, kTRUE); | |
1402 | fVarManager->FillCorrelationMatrix(fContainer->GetCorrelationMatrix("correlationstepafterDE")); | |
1403 | } | |
1404 | if(HasMCData()){ | |
1405 | if(mctrack && (TMath::Abs(mctrack->Particle()->GetPdgCode()) != 11)){ | |
1406 | fQACollection->Fill("hadronsAfterIPcut",track->Pt()); | |
1407 | } | |
1408 | } | |
1409 | } | |
1410 | ||
1411 | } | |
1412 | ||
1413 | // Background subtraction------------------------------------------------------------------- | |
1414 | if (GetPlugin(kNonPhotonicElectron)) fBackgroundSubtraction->CountPoolAssociated(fInputEvent, fCentralityF); | |
1415 | //------------------------------------------------------------------------------------------ | |
1416 | ||
1417 | fQACollection->Fill("nElectronTracksEvent", nElectronCandidates); | |
1418 | } | |
1419 | ||
1420 | //____________________________________________________________ | |
1421 | void AliAnalysisTaskHFE::ProcessAOD(){ | |
1422 | // | |
1423 | // Run Analysis in AOD Mode | |
1424 | // Function is still in development | |
1425 | // | |
1426 | //printf("Process AOD\n"); | |
1427 | AliDebug(3, "Processing AOD Event"); | |
1428 | Double_t eventContainer[4]; | |
1429 | eventContainer[0] = 0.0; | |
1430 | if(HasMCData()) eventContainer[0] = fVz; | |
1431 | else { | |
1432 | if(fInputEvent->GetPrimaryVertex()) eventContainer[0] = fInputEvent->GetPrimaryVertex()->GetZ(); | |
1433 | } | |
1434 | eventContainer[1] = 1.; // No Information available in AOD analysis, assume all events have V0AND | |
1435 | eventContainer[2] = fCentralityF; | |
1436 | eventContainer[3] = fContributors; | |
1437 | ||
1438 | //printf("value event container %f, %f, %f, %f\n",eventContainer[0],eventContainer[1],eventContainer[2],eventContainer[3]); | |
1439 | ||
1440 | AliAODEvent *fAOD = dynamic_cast<AliAODEvent *>(fInputEvent); | |
1441 | if(!fAOD){ | |
1442 | AliError("AOD Event required for AOD Analysis"); | |
1443 | return; | |
1444 | } | |
e2861c1a | 1445 | |
e2861c1a | 1446 | // Set magnetic field if V0 task on |
1447 | if(fTaggedTrackAnalysis) { | |
2e4ed823 | 1448 | // Tag all v0s in current event |
1449 | if(fV0Tagger){ | |
1450 | fV0Tagger->Reset(); | |
1451 | fV0Tagger->TagV0Tracks(fAOD); | |
1452 | } | |
e2861c1a | 1453 | fTaggedTrackAnalysis->SetMagneticField(fAOD->GetMagneticField()); |
1454 | fTaggedTrackAnalysis->SetCentrality(fCentralityF); | |
1455 | if(IsPbPb()) fTaggedTrackAnalysis->SetPbPb(); | |
1456 | else { | |
dab4f95d | 1457 | if(IspPb()) fTaggedTrackAnalysis->SetpPb(); |
1458 | else fTaggedTrackAnalysis->SetPP(); | |
e2861c1a | 1459 | } |
1460 | } | |
01745870 | 1461 | |
1462 | //printf("Will fill\n"); | |
1463 | // | |
1464 | fCFM->GetEventContainer()->Fill(eventContainer, AliHFEcuts::kEventStepRecNoCut); | |
1465 | //printf("Fill\n"); | |
1466 | // | |
1467 | if(fIdentifiedAsPileUp) return; | |
1468 | fCFM->GetEventContainer()->Fill(eventContainer, AliHFEcuts::kEventStepRecNoPileUp); | |
1469 | ||
1470 | // | |
1471 | if(fIdentifiedAsOutInz) return; | |
1472 | fCFM->GetEventContainer()->Fill(eventContainer, AliHFEcuts::kEventStepZRange); | |
1473 | ||
1474 | // | |
1475 | if(!fPassTheEventCut) return; | |
1476 | fCFM->GetEventContainer()->Fill(eventContainer, AliHFEcuts::kEventStepReconstructed); | |
1477 | //printf("pass\n"); | |
1478 | ||
1479 | fContainer->NewEvent(); | |
1480 | ||
1481 | fCFM->SetRecEventInfo(fAOD); | |
1482 | ||
1483 | if(!fExtraCuts){ | |
1484 | fExtraCuts = new AliHFEextraCuts("hfeExtraCuts","HFE Extra Cuts"); | |
1485 | } | |
1486 | fExtraCuts->SetRecEventInfo(fAOD); | |
1487 | ||
1488 | // Get Number of contributors to the primary vertex for multiplicity-dependent correction | |
1489 | Int_t ncontribVtx = 0; | |
1490 | AliAODVertex *priVtx = fAOD->GetPrimaryVertex(); | |
1491 | if(priVtx){ | |
1492 | ncontribVtx = priVtx->GetNContributors(); | |
1493 | } | |
1494 | ||
1495 | // Look for kink mother | |
1496 | Int_t numberofvertices = fAOD->GetNumberOfVertices(); | |
1497 | Double_t listofmotherkink[numberofvertices]; | |
1498 | Int_t numberofmotherkink = 0; | |
1499 | for(Int_t ivertex=0; ivertex < numberofvertices; ivertex++) { | |
1500 | AliAODVertex *aodvertex = fAOD->GetVertex(ivertex); | |
1501 | if(!aodvertex) continue; | |
1502 | if(aodvertex->GetType()==AliAODVertex::kKink) { | |
1503 | AliAODTrack *mother = (AliAODTrack *) aodvertex->GetParent(); | |
1504 | if(!mother) continue; | |
1505 | Int_t idmother = mother->GetID(); | |
1506 | listofmotherkink[numberofmotherkink] = idmother; | |
1507 | //printf("ID %d\n",idmother); | |
1508 | numberofmotherkink++; | |
1509 | } | |
1510 | } | |
1511 | //printf("Number of kink mother in the events %d\n",numberofmotherkink); | |
1512 | ||
1513 | // Background subtraction------------------------------------------------------------------- | |
1514 | if (GetPlugin(kNonPhotonicElectron)) fBackgroundSubtraction->FillPoolAssociatedTracks(fInputEvent, fCentralityF); | |
1515 | //------------------------------------------------------------------------------------------ | |
1516 | ||
1517 | // Loop over tracks | |
1518 | AliAODTrack *track = NULL; | |
1519 | AliAODMCParticle *mctrack = NULL; | |
1520 | Double_t dataDca[6]; // [source, pT, dca, centrality] | |
1521 | Int_t nElectronCandidates = 0; | |
1522 | Bool_t signal; | |
1523 | ||
1524 | //printf("Number of track %d\n",(Int_t) fAOD->GetNumberOfTracks()); | |
2e4ed823 | 1525 | Bool_t kinkmother(kFALSE), kinkdaughter(kFALSE); Double_t kinkstatus(0); |
01745870 | 1526 | for(Int_t itrack = 0; itrack < fAOD->GetNumberOfTracks(); itrack++){ |
2e4ed823 | 1527 | kinkmother=kFALSE; |
1528 | kinkdaughter=kFALSE; | |
1529 | kinkstatus = 0.; | |
01745870 | 1530 | track = fAOD->GetTrack(itrack); mctrack = NULL; |
1531 | if(!track) continue; | |
e2861c1a | 1532 | |
2e4ed823 | 1533 | for(int ivx = 0; ivx < numberofmotherkink; ivx++){ |
1534 | if(track->GetID() == listofmotherkink[ivx]){ | |
1535 | kinkmother = kTRUE; | |
1536 | break; | |
1537 | } | |
1538 | } | |
1539 | AliAODVertex *pvx = track->GetProdVertex(); | |
1540 | if(pvx && (pvx->GetType() == AliAODVertex::kKink)) kinkdaughter = kTRUE; | |
1541 | kinkstatus = 0.; | |
1542 | if(kinkmother) kinkstatus = 1.; | |
1543 | else if(kinkdaughter) kinkstatus = 2.; | |
1544 | ||
e2861c1a | 1545 | // fill counts of v0-identified particles |
dab4f95d | 1546 | AliPID::EParticleType v0pid = fV0Tagger ? fV0Tagger->GetV0Info(track->GetID()) : AliPID::kUnknown; |
e2861c1a | 1547 | // here the tagged track analysis will run |
1548 | if(fTaggedTrackAnalysis && v0pid != AliPID::kUnknown){ | |
1549 | AliDebug(1, Form("Track identified as %s", AliPID::ParticleName(v0pid))); | |
1550 | fTaggedTrackAnalysis->ProcessTrack(track, v0pid); | |
1551 | AliDebug(1, "V0 PID done"); | |
1552 | } | |
01745870 | 1553 | |
1554 | signal = kTRUE; | |
1555 | if(HasMCData()){ | |
01745870 | 1556 | Int_t label = TMath::Abs(track->GetLabel()); |
1557 | if(label && label < fAODArrayMCInfo->GetEntriesFast()) | |
1558 | mctrack = dynamic_cast<AliAODMCParticle *>(fAODArrayMCInfo->At(label)); | |
1559 | if(fFillSignalOnly && !fCFM->CheckParticleCuts(AliHFEcuts::kStepMCGenerated, mctrack)) signal = kFALSE; | |
2e4ed823 | 1560 | if(fRejectMCFakeTracks && IsMCFakeTrack(track)) signal = kFALSE; |
01745870 | 1561 | } |
1562 | ||
1563 | fVarManager->NewTrack(track, mctrack, fCentralityF, -1, signal); | |
1564 | ||
1565 | if(fFillNoCuts) { | |
1566 | if(signal || !fFillSignalOnly){ | |
1567 | fVarManager->FillContainer(fContainer, "recTrackContReco", AliHFEcuts::kStepRecNoCut, kFALSE); | |
1568 | fVarManager->FillContainer(fContainer, "recTrackContMC", AliHFEcuts::kStepRecNoCut, kTRUE); | |
1569 | } | |
1570 | } | |
1571 | ||
e2861c1a | 1572 | // begin AOD QA |
1573 | fQACollection->Fill("Filterbegin", -1); | |
1574 | for(Int_t k=0; k<20; k++) { | |
1575 | Int_t u = 1<<k; | |
1576 | if((track->TestFilterBit(u))) { | |
2e4ed823 | 1577 | fQACollection->Fill("Filterbegin", k); |
e2861c1a | 1578 | } |
1579 | } | |
1580 | ||
2e4ed823 | 1581 | // RecKine: ITSTPC cuts |
1582 | if(!ProcessCutStep(AliHFEcuts::kStepRecKineITSTPC, track)) continue; | |
1583 | ||
1584 | fQACollection->Fill("Kinkbefore", track->Pt(), kinkstatus); | |
1585 | // Reject kink mother | |
1586 | if(fRejectKinkMother) { | |
1587 | Bool_t kinkmotherpass = kTRUE; | |
1588 | for(Int_t ikinkmother = 0; ikinkmother < numberofmotherkink; ikinkmother++) { | |
1589 | if(track->GetID() == listofmotherkink[ikinkmother]) { | |
1590 | kinkmotherpass = kFALSE; | |
1591 | continue; | |
1592 | } | |
01745870 | 1593 | } |
2e4ed823 | 1594 | if(!kinkmotherpass) continue; |
1595 | } | |
1596 | ||
1597 | // RecPrim | |
1598 | if(!ProcessCutStep(AliHFEcuts::kStepRecPrim, track)) continue; | |
1599 | fQACollection->Fill("Kinkafter", track->Pt(), kinkstatus); | |
1600 | ||
1601 | // HFEcuts: ITS layers cuts | |
1602 | if(!ProcessCutStep(AliHFEcuts::kStepHFEcutsITS, track)) continue; | |
01745870 | 1603 | |
2e4ed823 | 1604 | // HFE cuts: TOF PID and mismatch flag |
1605 | if(!ProcessCutStep(AliHFEcuts::kStepHFEcutsTOF, track)) continue; | |
01745870 | 1606 | |
2e4ed823 | 1607 | // HFE cuts: TPC PID cleanup |
1608 | if(!ProcessCutStep(AliHFEcuts::kStepHFEcutsTPC, track)) continue; | |
1609 | ||
1610 | // HFEcuts: Nb of tracklets TRD0 | |
1611 | if(!ProcessCutStep(AliHFEcuts::kStepHFEcutsTRD, track)) continue; | |
01745870 | 1612 | |
1613 | // Fill correlation maps before PID | |
1614 | if(signal && fContainer->GetCorrelationMatrix("correlationstepbeforePID")) { | |
1615 | //printf("Fill correlation maps before PID\n"); | |
1616 | fVarManager->FillCorrelationMatrix(fContainer->GetCorrelationMatrix("correlationstepbeforePID")); | |
1617 | } | |
1618 | ||
1619 | if(HasMCData()){ | |
1620 | Double_t hfeimpactR4all=0., hfeimpactnsigmaR4all=0.; | |
1621 | Int_t sourceDca =-1; | |
1622 | if(mctrack && (TMath::Abs(mctrack->GetPdgCode()) == 211)){ | |
1623 | if(track->Pt()>4.){ | |
1624 | fExtraCuts->GetHFEImpactParameters(track, hfeimpactR4all, hfeimpactnsigmaR4all); | |
1625 | dataDca[0]=0; //pion | |
1626 | dataDca[1]=track->Pt(); | |
1627 | dataDca[2]=hfeimpactR4all; | |
1628 | dataDca[3]=fCentralityF; | |
1629 | dataDca[4] = -1; // not store V0 for the moment | |
1630 | dataDca[5] = double(track->Charge()); | |
1631 | fQACollection->Fill("Dca", dataDca); | |
1632 | } | |
1633 | } | |
1634 | else if(mctrack && (TMath::Abs(mctrack->GetPdgCode()) == 11)){ // to increas statistics for Martin | |
1635 | if(signal){ | |
1636 | fExtraCuts->GetHFEImpactParameters(track, hfeimpactR4all, hfeimpactnsigmaR4all); | |
1637 | if(fSignalCuts->IsCharmElectron(track)){ | |
1638 | sourceDca=1; | |
1639 | } | |
1640 | else if(fSignalCuts->IsBeautyElectron(track)){ | |
1641 | sourceDca=2; | |
1642 | } | |
1643 | else if(fSignalCuts->IsGammaElectron(track)){ | |
1644 | sourceDca=3; | |
1645 | } | |
1646 | else if(fSignalCuts->IsNonHFElectron(track)){ | |
1647 | sourceDca=4; | |
1648 | } | |
1649 | else if(fSignalCuts->IsJpsiElectron(track)){ | |
1650 | sourceDca=5; | |
1651 | } | |
1652 | else { | |
1653 | sourceDca=6; | |
1654 | } | |
1655 | dataDca[0]=sourceDca; | |
1656 | dataDca[1]=track->Pt(); | |
1657 | dataDca[2]=hfeimpactR4all; | |
1658 | dataDca[3]=fCentralityF; | |
1659 | dataDca[4] = -1; // not store V0 for the moment | |
1660 | dataDca[5] = double(track->Charge()); | |
1661 | if(signal) fQACollection->Fill("Dca", dataDca); | |
1662 | } | |
1663 | } | |
1664 | } | |
1665 | ||
1666 | //printf("Will process to PID\n"); | |
1667 | ||
1668 | // track accepted, do PID | |
1669 | AliHFEpidObject hfetrack; | |
1670 | hfetrack.SetAnalysisType(AliHFEpidObject::kAODanalysis); | |
1671 | hfetrack.SetRecTrack(track); | |
1672 | if(HasMCData()) hfetrack.SetMCTrack(mctrack); | |
1673 | hfetrack.SetCentrality(fCentralityF); | |
1674 | hfetrack.SetMulitplicity(ncontribVtx); // for correction | |
4437a0d2 | 1675 | if(IsPbPb()) hfetrack.SetPbPb(); |
1676 | else{ | |
1677 | if(IspPb()) hfetrack.SetpPb(); | |
1678 | else hfetrack.SetPP(); | |
1679 | } | |
01745870 | 1680 | fPID->SetVarManager(fVarManager); |
1681 | if(!fPID->IsSelected(&hfetrack, fContainer, "recTrackCont", fPIDqa)) continue; | |
1682 | // we will do PID here as soon as possible | |
1683 | ||
1684 | // Background subtraction---------------------------------------------------------------------------------------------- | |
1685 | if (GetPlugin(kNonPhotonicElectron)) { | |
1686 | Int_t indexmother = -1; | |
1687 | Int_t mcsource = -1; | |
2e4ed823 | 1688 | if(HasMCData() && mctrack){ |
1689 | mcsource = fBackgroundSubtraction->FindMother(TMath::Abs(track->GetLabel()),indexmother); | |
1690 | if(mcsource == AliHFENonPhotonicElectron::kElectronfromC || mcsource == AliHFENonPhotonicElectron::kElectronfromB){ | |
1691 | int svalue = 0; | |
1692 | if(fSignalCuts){ | |
1693 | if(fSignalCuts->IsCharmElectron(track)) svalue = 0; | |
1694 | else if(fSignalCuts->IsBeautyElectron(track)) svalue = 1; | |
1695 | else if(fSignalCuts->IsGammaElectron(track)) svalue = 2; | |
1696 | else if(fSignalCuts->IsNonHFElectron(track)) svalue = 3; | |
1697 | else if(fSignalCuts->IsJpsiElectron(track)) svalue = 4; | |
1698 | else if(fSignalCuts->IsB2JpsiElectron(track)) svalue = 5; | |
1699 | else if(fSignalCuts->IsKe3Electron(track)) svalue = 6; | |
1700 | else svalue = 7; | |
1701 | fQACollection->Fill("HFPuzzle",svalue); | |
1702 | } | |
1703 | } | |
1704 | } | |
01745870 | 1705 | fBackgroundSubtraction->LookAtNonHFE(itrack, track, fInputEvent, 1, fCentralityF, -1,mcsource, indexmother); |
1706 | } | |
1707 | //--------------------------------------------------------------------------------------------------------------------- | |
1708 | ||
1709 | // end AOD QA | |
1710 | fQACollection->Fill("Filterend", -1); | |
1711 | for(Int_t k=0; k<20; k++) { | |
1712 | Int_t u = 1<<k; | |
1713 | if((track->TestFilterBit(u))) { | |
1714 | fQACollection->Fill("Filterend", k); | |
1715 | } | |
1716 | } | |
1717 | ||
1718 | // Apply weight for background contamination | |
1719 | //Double_t weightBackGround = 1.0; | |
1720 | if(signal) { | |
1721 | // Apply weight for background contamination | |
1722 | if(fBackGroundFactorApply) { | |
4437a0d2 | 1723 | if(IsPbPb() && fCentralityF >= 0) fWeightBackGround = fkBackGroundFactorArray[fCentralityF >= 0 ? fCentralityF : 0]->Eval(TMath::Abs(track->P())); |
01745870 | 1724 | else fWeightBackGround = fkBackGroundFactorArray[0]->Eval(TMath::Abs(track->P())); // pp case |
1725 | ||
1726 | if(fWeightBackGround < 0.0) fWeightBackGround = 0.0; | |
1727 | else if(fWeightBackGround > 1.0) fWeightBackGround = 1.0; | |
1728 | // weightBackGround as special weight | |
1729 | fVarManager->FillContainer(fContainer, "hadronicBackground", 1, kFALSE, fWeightBackGround); | |
1730 | } | |
1731 | fVarManager->FillCorrelationMatrix(fContainer->GetCorrelationMatrix("correlationstepafterPID")); | |
1732 | } | |
1733 | ||
1734 | nElectronCandidates++; | |
1735 | ||
1736 | if (GetPlugin(kDEstep)) { | |
1737 | if (!HasMCData()){ | |
1738 | Double_t hfeimpactR=0., hfeimpactnsigmaR=0.; | |
1739 | fExtraCuts->GetHFEImpactParameters(track, hfeimpactR, hfeimpactnsigmaR); | |
1740 | dataDca[0]=-1; //for data, don't know the origin | |
1741 | dataDca[1]=track->Pt(); | |
1742 | dataDca[2]=hfeimpactR; | |
1743 | dataDca[3]=fCentralityF; | |
1744 | dataDca[4] = -1; // not store V0 for the moment | |
1745 | dataDca[5] = double(track->Charge()); | |
1746 | fQACollection->Fill("Dca", dataDca); | |
1747 | } | |
1748 | ||
1749 | // Fill Containers for impact parameter analysis | |
1750 | if(!fCFM->CheckParticleCuts(AliHFEcuts::kStepHFEcutsDca + AliHFEcuts::kNcutStepsMCTrack + AliHFEcuts::kNcutStepsRecTrack,track)) continue; | |
1751 | if(signal) { | |
1752 | // Apply weight for background contamination after ip cut | |
1753 | if(fBackGroundFactorApply) { | |
1754 | fWeightBackGround = fkBackGroundFactorArray[0]->Eval(TMath::Abs(track->P())); // pp case | |
1755 | if(fWeightBackGround < 0.0) fWeightBackGround = 0.0; | |
1756 | else if(fWeightBackGround > 1.0) fWeightBackGround = 1.0; | |
1757 | // weightBackGround as special weight | |
1758 | fVarManager->FillContainer(fContainer, "hadronicBackground", 2, kFALSE, fWeightBackGround); | |
1759 | } | |
1760 | } | |
1761 | } | |
1762 | } | |
1763 | ||
1764 | // Background subtraction------------------------------------------------------------------- | |
1765 | if (GetPlugin(kNonPhotonicElectron)) fBackgroundSubtraction->CountPoolAssociated(fInputEvent, fCentralityF); | |
1766 | //------------------------------------------------------------------------------------------ | |
1767 | ||
1768 | fQACollection->Fill("nElectronTracksEvent", nElectronCandidates); | |
1769 | } | |
1770 | ||
1771 | //____________________________________________________________ | |
1772 | Bool_t AliAnalysisTaskHFE::ProcessMCtrack(AliVParticle *track){ | |
1773 | // | |
1774 | // Filter the Monte Carlo Track | |
1775 | // Additionally Fill a THnSparse for Signal To Background Studies | |
1776 | // Works for AOD and MC analysis Type | |
1777 | // | |
1778 | fVarManager->NewTrack(track, NULL, fCentralityF, -1, kTRUE); | |
1779 | ||
1780 | ||
1781 | Double_t vertex[3] = {0.,0.,0.}; // Production vertex cut to mask gammas which are NOT supposed to have hits in the first ITS layer(s) | |
1782 | if(IsESDanalysis()){ | |
1783 | AliMCParticle *mctrack = dynamic_cast<AliMCParticle *>(track); | |
1784 | if(mctrack){ | |
1785 | vertex[0] = mctrack->Particle()->Vx(); | |
1786 | vertex[1] = mctrack->Particle()->Vy(); | |
1787 | } | |
1788 | } else { | |
1789 | AliAODMCParticle *aodmctrack = dynamic_cast<AliAODMCParticle *>(track); | |
1790 | if(aodmctrack) aodmctrack->XvYvZv(vertex); | |
1791 | } | |
1792 | ||
1793 | //printf("MC Generated\n"); | |
1794 | if(!fCFM->CheckParticleCuts(AliHFEcuts::kStepMCGenerated, track)) return kFALSE; | |
1795 | //printf("MC Generated pass\n"); | |
1796 | fVarManager->FillContainer(fContainer, "MCTrackCont", AliHFEcuts::kStepMCGenerated, kFALSE); | |
1797 | ||
1798 | // Step GeneratedZOutNoPileUp | |
1799 | if((fIdentifiedAsPileUp) || (TMath::Abs(fVz) > fCuts->GetVertexRange()) || (fCentralityF < 0)) return kFALSE; | |
1800 | fVarManager->FillContainer(fContainer, "MCTrackCont", AliHFEcuts::kStepMCGeneratedZOutNoPileUpCentralityFine, kFALSE); | |
1801 | //printf("In ProcessMCtrack %f\n",fCentralityF); | |
1802 | ||
1803 | // Step Generated Event Cut | |
1804 | if(!fPassTheEventCut) return kFALSE; | |
1805 | fVarManager->FillContainer(fContainer, "MCTrackCont", AliHFEcuts::kStepMCGeneratedEventCut, kFALSE); | |
1806 | ||
e2861c1a | 1807 | if(IsESDanalysis()){ |
1808 | if(!fCFM->CheckParticleCuts(AliHFEcuts::kStepMCInAcceptance, track)) return kFALSE; | |
1809 | fVarManager->FillContainer(fContainer, "MCTrackCont", AliHFEcuts::kStepMCInAcceptance, kFALSE); | |
1810 | } | |
01745870 | 1811 | return kTRUE; |
1812 | } | |
1813 | ||
1814 | //____________________________________________________________ | |
1815 | Bool_t AliAnalysisTaskHFE::PreSelectTrack(AliESDtrack *track) const { | |
1816 | // | |
1817 | // Preselect tracks | |
1818 | // | |
1819 | ||
1820 | ||
1821 | Bool_t survived = kTRUE; | |
1822 | ||
1823 | if(fCutspreselect) { | |
1824 | //printf("test preselect\n"); | |
1825 | if(!fCutspreselect->IsSelected(track)) survived=kFALSE; | |
1826 | } | |
1827 | //printf("survived %d\n",(Int_t)survived); | |
1828 | ||
1829 | if(survived && fPIDpreselect){ | |
1830 | // Apply PID | |
1831 | AliHFEpidObject hfetrack; | |
1832 | hfetrack.SetAnalysisType(AliHFEpidObject::kESDanalysis); | |
1833 | hfetrack.SetRecTrack(track); | |
1834 | if(!fPIDpreselect->IsSelected(&hfetrack)) { | |
1835 | //printf("Did not pass AliHFEcuts::kPID\n"); | |
1836 | survived = kFALSE; | |
1837 | } | |
1838 | //else printf("Pass AliHFEcuts::kPID\n"); | |
1839 | } | |
1840 | ||
1841 | return survived; | |
1842 | ||
1843 | } | |
1844 | //____________________________________________________________ | |
1845 | void AliAnalysisTaskHFE::MakeEventContainer(){ | |
1846 | // | |
1847 | // Create the event container for the correction framework and link it | |
1848 | // 1st bin: Vertex z-position | |
1849 | // 2nd bin: V0AND decision (normalization to sigma_inel) | |
1850 | // 3rd bin: Centrality class (for pp defined as number of contributors in vertex.) | |
1851 | // 4th bin: Number of contributors > 0 | |
1852 | // | |
1853 | ||
1854 | const Int_t kNvar = 4; // number of variables on the grid: | |
1855 | Int_t nBins[kNvar] = {120, 2, 11, 2}; | |
1856 | Double_t binMin[kNvar] = {-30. , 0., 0.0, 0.}; | |
1857 | Double_t binMax[kNvar] = {30., 2., 11.0, 2.}; | |
1858 | ||
1859 | AliCFContainer *evCont = new AliCFContainer("eventContainer", "Container for events", AliHFEcuts::kNcutStepsEvent, kNvar, nBins); | |
1860 | ||
1861 | Double_t *vertexBins = AliHFEtools::MakeLinearBinning(nBins[0], binMin[0], binMax[0]); | |
1862 | Double_t *v0andBins = AliHFEtools::MakeLinearBinning(nBins[1], binMin[1], binMax[1]); | |
1863 | Double_t *centralityBins = AliHFEtools::MakeLinearBinning(nBins[2], binMin[2], binMax[2]); | |
1864 | Double_t *contributorsBins = AliHFEtools::MakeLinearBinning(nBins[3], binMin[3], binMax[3]); | |
1865 | evCont->SetBinLimits(0, vertexBins); | |
1866 | evCont->SetBinLimits(1, v0andBins); | |
1867 | evCont->SetBinLimits(2, centralityBins); | |
1868 | evCont->SetBinLimits(3, contributorsBins); | |
1869 | delete[] vertexBins; delete[] v0andBins; delete[] centralityBins; delete[] contributorsBins; | |
1870 | ||
1871 | fCFM->SetEventContainer(evCont); | |
1872 | } | |
1873 | ||
1874 | //____________________________________________________________ | |
1875 | void AliAnalysisTaskHFE::MakeParticleContainer(){ | |
1876 | // | |
1877 | // Create the particle container for the correction framework manager and | |
1878 | // link it | |
1879 | // | |
1880 | if(!fContainer) fContainer = new AliHFEcontainer("trackContainer"); | |
1881 | fVarManager->DefineVariables(fContainer); | |
1882 | ||
1883 | // Create Correction Framework containers | |
1884 | fContainer->CreateContainer("MCTrackCont", "Track Container filled with MC information", AliHFEcuts::kNcutStepsMCTrack); | |
1885 | fContainer->CreateContainer("recTrackContReco", "Track Container filled with MC information", AliHFEcuts::kNcutStepsRecTrack + fPID->GetNumberOfPIDdetectors()); | |
1886 | fContainer->CreateContainer("recTrackContMC", "Track Container filled with MC information", AliHFEcuts::kNcutStepsRecTrack + fPID->GetNumberOfPIDdetectors()); | |
1887 | ||
1888 | fContainer->CreateContainer("hadronicBackground", "Container for Hadronic Background", 3); | |
1889 | fContainer->CreateContainer("recTrackContDEReco", "Container for displaced electron analysis with Reco information", 1); | |
1890 | fContainer->CreateContainer("recTrackContDEMC", "Container for displaced electron analysis with MC information", 1); | |
1891 | fContainer->CreateContainer("recTrackContSecvtxReco", "Container for secondary vertexing analysis with Reco information", 1); | |
1892 | fContainer->CreateContainer("recTrackContSecvtxMC", "Container for secondary vertexing analysis with MC information", 1); | |
1893 | ||
1894 | if(HasMCData()){ | |
1895 | fContainer->CreateContainer("conversionElecs", "Container for weighted conversion electrons",7); | |
1896 | fContainer->CreateContainer("mesonElecs", "Container for weighted electrons from meson decays",7); | |
1897 | fContainer->Sumw2("conversionElecs"); | |
1898 | fContainer->Sumw2("mesonElecs"); | |
1899 | ||
1900 | if(fisNonHFEsystematics){ | |
1901 | const Char_t *sourceName[kElecBgSpecies]={"Pion","Eta","Omega","Phi","EtaPrime","Rho"}; | |
1902 | const Char_t *levelName[kBgLevels]={"Best","Lower","Upper"}; | |
1903 | for(Int_t iSource = 0; iSource < kElecBgSpecies; iSource++){ | |
1904 | for(Int_t iLevel = 0; iLevel < kBgLevels; iLevel++){ | |
1905 | fContainer->CreateContainer(Form("conversionElecs%s%s",sourceName[iSource],levelName[iLevel]), Form("Container for weighted conversion electrons from %s grandm., %s level",sourceName[iSource],levelName[iLevel]),5); | |
1906 | fContainer->CreateContainer(Form("mesonElecs%s%s",sourceName[iSource],levelName[iLevel]), Form("Container for weighted electrons from %s decays, %s level",sourceName[iSource],levelName[iLevel]),5); | |
1907 | fContainer->Sumw2(Form("conversionElecs%s%s",sourceName[iSource],levelName[iLevel])); | |
1908 | fContainer->Sumw2(Form("mesonElecs%s%s",sourceName[iSource],levelName[iLevel])); | |
1909 | if(IsPbPb())break; | |
1910 | } | |
1911 | } | |
1912 | } | |
1913 | //fContainer->CreateContainer("charmElecs", "Container for weighted charm electrons",2); | |
1914 | } | |
1915 | ||
1916 | fContainer->CreateCorrelationMatrix("correlationstepafterPID","THnSparse with correlations"); | |
1917 | fContainer->CreateCorrelationMatrix("correlationstepafterDE","THnSparse with correlations"); | |
1918 | if(!fVarManager->IsVariableDefined("centrality")) { | |
1919 | //printf("Create the two other correlation maps\n"); | |
1920 | fContainer->CreateCorrelationMatrix("correlationstepbeforePID","THnSparse with correlations"); | |
1921 | fContainer->CreateCorrelationMatrix("correlationstepafterTOF","THnSparse with correlations"); | |
1922 | } | |
1923 | ||
1924 | // Define the step names | |
1925 | for(UInt_t istep = 0; istep < AliHFEcuts::kNcutStepsMCTrack; istep++){ | |
1926 | fContainer->SetStepTitle("MCTrackCont", AliHFEcuts::MCCutName(istep), istep); | |
1927 | } | |
1928 | for(UInt_t istep = 0; istep < AliHFEcuts::kNcutStepsRecTrack; istep++){ | |
1929 | fContainer->SetStepTitle("recTrackContReco", AliHFEcuts::RecoCutName(istep), istep); | |
1930 | fContainer->SetStepTitle("recTrackContMC", AliHFEcuts::RecoCutName(istep), istep); | |
1931 | } | |
1932 | for(UInt_t ipid = 0; ipid < fPID->GetNumberOfPIDdetectors(); ipid++){ | |
1933 | fContainer->SetStepTitle("recTrackContReco", fPID->SortedDetectorName(ipid), AliHFEcuts::kNcutStepsRecTrack + ipid); | |
1934 | fContainer->SetStepTitle("recTrackContMC", fPID->SortedDetectorName(ipid), AliHFEcuts::kNcutStepsRecTrack + ipid); | |
1935 | } | |
1936 | } | |
1937 | //____________________________________________________________ | |
1938 | void AliAnalysisTaskHFE::InitContaminationQA(){ | |
1939 | // | |
1940 | // Add QA for Impact Parameter cut | |
1941 | // | |
1942 | ||
1943 | TObjArray *array = fVarManager->GetVariables(); | |
1944 | Int_t nvars = array->GetEntriesFast(); | |
1945 | for(Int_t v = 0; v < nvars; v++) { | |
1946 | AliHFEvarManager::AliHFEvariable *variable = (AliHFEvarManager::AliHFEvariable *) array->At(v); | |
1947 | if(!variable) continue; | |
1948 | TString name(((AliHFEvarManager::AliHFEvariable *)variable)->GetName()); | |
1949 | if(!name.CompareTo("pt")) { | |
1950 | const Int_t nBinPt = variable->GetNumberOfBins(); | |
1951 | const Double_t *kPtRange = variable->GetBinning(); | |
1952 | ||
1953 | fQACollection->CreateTH1Farray("hadronsBeforeIPcut", "Hadrons before IP cut", nBinPt, kPtRange); | |
1954 | fQACollection->CreateTH1Farray("hadronsAfterIPcut", "Hadrons after IP cut", nBinPt, kPtRange); | |
1955 | ||
1956 | fQACollection->CreateTH2Farray("Ke3Kecorr", "Ke3 decay e and K correlation; Ke3K p_{t}; Ke3e p_{t}; ", nBinPt, kPtRange, 20,0.,20.); | |
1957 | fQACollection->CreateTH2Farray("Ke3K0Lecorr", "Ke3 decay e and K0L correlation; Ke3K0L p_{t}; Ke3e p_{t}; ", nBinPt, kPtRange, 20,0.,20.); | |
1958 | fQACollection->CreateTH1Farray("Kptspectra", "Charged Kaons: MC p_{t} ", nBinPt, kPtRange); | |
1959 | fQACollection->CreateTH1Farray("K0Lptspectra", "K0L: MC p_{t} ", nBinPt, kPtRange); | |
1960 | ||
1961 | const Double_t kDCAbound[2] = {-0.2, 0.2}; | |
1962 | ||
1963 | const Int_t nDimDca=6; | |
1964 | const Int_t nBinDca[nDimDca] = { 8, nBinPt, 800, 12, 6, 2}; | |
1965 | Double_t minimaDca[nDimDca] = { -1., 0., kDCAbound[0], -1., -1, -1.1}; | |
1966 | Double_t maximaDca[nDimDca] = { 7., 20., kDCAbound[1], 11., 5, 1.1}; | |
1967 | ||
1968 | Double_t *sourceBins = AliHFEtools::MakeLinearBinning(nBinDca[0], minimaDca[0], maximaDca[0]); | |
1969 | Double_t *dcaBins = AliHFEtools::MakeLinearBinning(nBinDca[2], minimaDca[2], maximaDca[2]); | |
1970 | Double_t *centralityBins = AliHFEtools::MakeLinearBinning(nBinDca[3], minimaDca[3], maximaDca[3]); | |
1971 | Double_t *v0PIDBins = AliHFEtools::MakeLinearBinning(nBinDca[4], minimaDca[4], maximaDca[4]); | |
1972 | Double_t *chargeBins = AliHFEtools::MakeLinearBinning(nBinDca[5], minimaDca[5], maximaDca[5]); | |
1973 | ||
1974 | fQACollection->CreateTHnSparseNoLimits("Dca", "Dca; source (0-all, 1-charm,etc); pT [GeV/c]; dca; centrality bin; v0pid; charge", nDimDca, nBinDca); | |
1975 | ((THnSparse*)(fQACollection->Get("Dca")))->SetBinEdges(0, sourceBins); | |
1976 | ((THnSparse*)(fQACollection->Get("Dca")))->SetBinEdges(1, kPtRange); | |
1977 | ((THnSparse*)(fQACollection->Get("Dca")))->SetBinEdges(2, dcaBins); | |
1978 | ((THnSparse*)(fQACollection->Get("Dca")))->SetBinEdges(3, centralityBins); | |
1979 | ((THnSparse*)(fQACollection->Get("Dca")))->SetBinEdges(4, v0PIDBins); | |
1980 | ((THnSparse*)(fQACollection->Get("Dca")))->SetBinEdges(5, chargeBins); | |
1981 | ||
1982 | break; | |
1983 | } | |
1984 | } | |
1985 | ||
1986 | } | |
1987 | ||
1988 | //____________________________________________________________ | |
1989 | void AliAnalysisTaskHFE::InitHistoITScluster(){ | |
1990 | // | |
1991 | // Initialize a temporary histogram to monitor the chi2/ITS cluster | |
1992 | if(IsPbPb()) { | |
1993 | const Int_t kNDim = 7; | |
1994 | const Int_t kNBins[kNDim] = {88, 20,90,11, 160, 2, 1000}; | |
1995 | const Double_t kMin[kNDim] = {0.1, -1,0, 0.,0., 0, 0.}; | |
1996 | const Double_t kMax[kNDim] = {20., 1, 2.*TMath::Pi(), 11.,160, 2, 100.}; | |
1997 | fQACollection->CreateTHnSparse("fChi2perITScluster", "chi2/ITS cluster; p_{T} (GeV/c);eta;phi; centrality class;nclus;sharebit; #chi^{2}/ITS cluster", kNDim, kNBins, kMin, kMax); | |
1998 | fQACollection->BinLogAxis("fChi2perITScluster", 0); | |
1999 | } | |
2000 | else | |
2001 | { | |
2002 | const Int_t kNDim = 3; | |
2003 | const Int_t kNBins[kNDim] = {44, 11, 1000}; | |
2004 | const Double_t kMin[kNDim] = {0.1, 0., 0.}; | |
2005 | const Double_t kMax[kNDim] = {20., 11., 100.}; | |
2006 | fQACollection->CreateTHnSparse("fChi2perITScluster", "chi2/ITS cluster; p_{T} (GeV/c); centrality class; #chi^{2}/ITS cluster", kNDim, kNBins, kMin, kMax); | |
2007 | fQACollection->BinLogAxis("fChi2perITScluster", 0); | |
2008 | } | |
2009 | } | |
2010 | ||
2011 | //____________________________________________________________ | |
2012 | void AliAnalysisTaskHFE::SelectSpecialTrigger(const Char_t *trgclust, Int_t runMin, Int_t runMax){ | |
2013 | // | |
2014 | // Select only events triggered by a special trigeer cluster | |
2015 | // | |
2016 | if(!fSpecialTrigger) fSpecialTrigger = new AliOADBContainer("SpecialTrigger"); | |
2017 | fSpecialTrigger->AppendObject(new TObjString(trgclust), runMin, runMax); | |
2018 | } | |
2019 | ||
2020 | //____________________________________________________________ | |
2021 | const Char_t * AliAnalysisTaskHFE::GetSpecialTrigger(Int_t run){ | |
2022 | // | |
2023 | // Derive selected trigger string for given run | |
2024 | // | |
2025 | if(!fSpecialTrigger) return NULL; | |
2026 | TObjString *trg = dynamic_cast<TObjString *>(fSpecialTrigger->GetObject(run)); | |
2027 | if(!trg) return NULL; | |
2028 | return trg->String().Data(); | |
2029 | } | |
2030 | ||
2031 | //____________________________________________________________ | |
2032 | void AliAnalysisTaskHFE::PrintStatus() const { | |
2033 | // | |
2034 | // Print Analysis status | |
2035 | // | |
2036 | printf("\n\tAnalysis Settings\n\t========================================\n\n"); | |
2037 | printf("\tSecondary Vertex finding: %s\n", GetPlugin(kSecVtx) ? "YES" : "NO"); | |
2038 | printf("\tPrimary Vertex resolution: %s\n", GetPlugin(kPriVtx) ? "YES" : "NO"); | |
2039 | printf("\tDisplaced electron analysis step: %s\n", GetPlugin(kDEstep) ? "YES" : "NO"); | |
2040 | printf("\tTagged Track Analysis: %s\n", GetPlugin(kTaggedTrackAnalysis) ? "YES" : "NO"); | |
2041 | printf("\n"); | |
2042 | printf("\tParticle Identification Detectors:\n"); | |
2043 | fPID->PrintStatus(); | |
2044 | printf("\n"); | |
2045 | printf("\tQA: \n"); | |
2046 | printf("\t\tPID: %s\n", IsQAOn(kPIDqa) ? "YES" : "NO"); | |
2047 | printf("\t\tCUTS: %s\n", (fCuts != NULL && fCuts->IsQAOn()) ? "YES" : "NO"); | |
2048 | printf("\t\tMC: %s\n", IsQAOn(kMCqa) ? "YES" : "NO"); | |
2049 | printf("\n"); | |
2050 | } | |
2051 | ||
2052 | //____________________________________________________________ | |
2053 | Bool_t AliAnalysisTaskHFE::FillProductionVertex(const AliVParticle * const track) const{ | |
2054 | // | |
2055 | // Find the production vertex of the associated MC track | |
2056 | // | |
2057 | if(!fMCEvent) return kFALSE; | |
2058 | const AliVParticle *mctrack = NULL; | |
2059 | TString objectType = track->IsA()->GetName(); | |
2060 | if(objectType.CompareTo("AliESDtrack") == 0 || objectType.CompareTo("AliAODTrack") == 0){ | |
2061 | // Reconstructed track | |
2062 | mctrack = fMCEvent->GetTrack(TMath::Abs(track->GetLabel())); | |
2063 | } else { | |
2064 | // MCParticle | |
2065 | mctrack = track; | |
2066 | } | |
2067 | ||
2068 | if(!mctrack) return kFALSE; | |
2069 | ||
2070 | Double_t xv = 0.0; | |
2071 | Double_t yv = 0.0; | |
2072 | ||
2073 | if(TString(mctrack->IsA()->GetName()).CompareTo("AliMCParticle") == 0){ | |
2074 | // case MCParticle | |
2075 | const AliMCParticle *mcpart = dynamic_cast<const AliMCParticle *>(mctrack); | |
2076 | if(mcpart){ | |
2077 | xv = mcpart->Xv(); | |
2078 | yv = mcpart->Yv(); | |
2079 | } | |
2080 | } else { | |
2081 | // case AODMCParticle | |
2082 | const AliAODMCParticle *mcpart = dynamic_cast<const AliAODMCParticle *>(mctrack); | |
2083 | if(mcpart){ | |
2084 | xv = mcpart->Xv(); | |
2085 | yv = mcpart->Yv(); | |
2086 | } | |
2087 | } | |
2088 | ||
2089 | //printf("xv %f, yv %f\n",xv,yv); | |
2090 | fQACollection->Fill("radius", TMath::Abs(xv),TMath::Abs(yv)); | |
2091 | ||
2092 | return kTRUE; | |
2093 | ||
2094 | } | |
2095 | //__________________________________________ | |
2096 | void AliAnalysisTaskHFE::SwitchOnPlugin(Int_t plug){ | |
2097 | // | |
2098 | // Switch on Plugin | |
2099 | // Available: | |
2100 | // - Primary vertex studies | |
2101 | // - Secondary vertex Studies | |
2102 | // - Post Processing | |
2103 | // | |
2104 | switch(plug){ | |
2105 | case kPriVtx: SETBIT(fPlugins, plug); break; | |
2106 | case kSecVtx: SETBIT(fPlugins, plug); break; | |
2107 | case kIsElecBackGround: SETBIT(fPlugins, plug); break; | |
2108 | case kPostProcess: SETBIT(fPlugins, plug); break; | |
2109 | case kDEstep: SETBIT(fPlugins, plug); break; | |
2110 | case kTaggedTrackAnalysis: SETBIT(fPlugins, plug); break; | |
2111 | case kNonPhotonicElectron: SETBIT(fPlugins, plug); break; | |
2112 | default: AliError("Unknown Plugin"); | |
2113 | }; | |
2114 | } | |
2115 | //__________________________________________ | |
2116 | Bool_t AliAnalysisTaskHFE::ProcessCutStep(Int_t cutStep, AliVParticle *track){ | |
2117 | // | |
2118 | // Check single track cuts for a given cut step | |
2119 | // Fill the particle container | |
2120 | // | |
2121 | const Int_t kMCOffset = AliHFEcuts::kNcutStepsMCTrack; | |
2122 | if(!fCFM->CheckParticleCuts(cutStep + kMCOffset, track)) return kFALSE; | |
2123 | if(fVarManager->IsSignalTrack()) { | |
2124 | fVarManager->FillContainer(fContainer, "recTrackContReco", cutStep, kFALSE); | |
2125 | fVarManager->FillContainer(fContainer, "recTrackContMC", cutStep, kTRUE); | |
2126 | } | |
2127 | return kTRUE; | |
2128 | } | |
2129 | //___________________________________________________ | |
2130 | Bool_t AliAnalysisTaskHFE::ReadCentrality() { | |
2131 | // | |
2132 | // Recover the centrality of the event from ESD or AOD | |
2133 | // | |
2134 | ||
2135 | Float_t fCentralityLimitstemp[12]; | |
2e4ed823 | 2136 | Float_t fCentralityLimitsdefault[12]= {0.,5.,10., 20., 30., 40., 50., 60.,70.,80., 90., 100.00001}; |
01745870 | 2137 | if(!fPbPbUserCentralityBinning) memcpy(fCentralityLimitstemp,fCentralityLimitsdefault,sizeof(fCentralityLimitsdefault)); |
2138 | else memcpy(fCentralityLimitstemp,fCentralityLimits,sizeof(fCentralityLimitsdefault)); | |
2139 | ||
2140 | ||
2141 | Int_t bin = -1; | |
4437a0d2 | 2142 | if(IsPbPb()||IspPb()) { |
01745870 | 2143 | // Centrality |
2144 | AliCentrality *centrality = fInputEvent->GetCentrality(); | |
2145 | fCentralityPercent = centrality->GetCentralityPercentile(fCentralityEstimator.Data()); | |
2146 | //printf("centrality %f\n",fCentralityPercent); | |
2147 | ||
2148 | for(Int_t ibin = 0; ibin < 11; ibin++){ | |
2149 | if(fCentralityPercent >= fCentralityLimitstemp[ibin] && fCentralityPercent < fCentralityLimitstemp[ibin+1]){ | |
2150 | bin = ibin; | |
2151 | //printf("test bin %f, low %f, high %f, %d\n",fCentralityPercent,fCentralityLimitstemp[ibin],fCentralityLimitstemp[ibin+1],ibin); | |
2152 | break; | |
2153 | } | |
2154 | } | |
2155 | ||
2156 | if(bin == -1) bin = 11; // Overflow | |
2157 | } else { | |
2158 | // PP: Tracklet multiplicity, use common definition | |
2159 | Int_t itsMultiplicity = GetITSMultiplicity(fInputEvent); | |
2160 | Int_t multiplicityLimits[8] = {0, 1, 9, 17, 25, 36, 60, 500}; | |
2161 | for(Int_t ibin = 0; ibin < 7; ibin++){ | |
2162 | if(itsMultiplicity >= multiplicityLimits[ibin] && itsMultiplicity < multiplicityLimits[ibin + 1]){ | |
2163 | bin = ibin; | |
2164 | break; | |
2165 | } | |
2166 | } | |
2167 | if(bin == -1) bin = 7; // Overflow | |
2168 | } | |
2169 | fCentralityF = bin; | |
2170 | AliDebug(2, Form("Centrality class %d\n", fCentralityF)); | |
2171 | ||
2172 | ||
2173 | // contributors, to be outsourced | |
2174 | const AliVVertex *vtx; | |
2175 | if(IsAODanalysis()){ | |
2176 | AliAODEvent *fAOD = dynamic_cast<AliAODEvent *>(fInputEvent); | |
2177 | if(!fAOD){ | |
2178 | AliError("AOD Event required for AOD Analysis"); | |
2179 | return kFALSE; | |
2180 | } | |
2181 | vtx = fAOD->GetPrimaryVertex(); | |
2182 | } else { | |
2183 | AliESDEvent *fESD = dynamic_cast<AliESDEvent *>(fInputEvent); | |
2184 | if(!fESD){ | |
2185 | AliError("ESD Event required for ESD Analysis"); | |
2186 | return kFALSE; | |
2187 | } | |
2188 | vtx = fESD->GetPrimaryVertex() ; | |
2189 | } | |
2190 | if(!vtx){ | |
2191 | fContributors = 0.5; | |
2192 | return kFALSE; | |
2193 | } | |
2194 | else { | |
2195 | Int_t contributorstemp = vtx->GetNContributors(); | |
2196 | if( contributorstemp <= 0) { | |
2197 | fContributors = 0.5; | |
2198 | //printf("Number of contributors %d and vz %f\n",contributorstemp,vtx->GetZ()); | |
2199 | } | |
2200 | else fContributors = 1.5; | |
2201 | //printf("Number of contributors %d\n",contributorstemp); | |
2202 | } | |
2203 | return kTRUE; | |
2204 | } | |
2205 | ||
2206 | //___________________________________________________ | |
2207 | Int_t AliAnalysisTaskHFE::GetITSMultiplicity(AliVEvent *ev){ | |
2208 | // | |
2209 | // Definition of the Multiplicity according to the JPSI group (F. Kramer) | |
2210 | // | |
2211 | Int_t nTracklets = 0; | |
2212 | Int_t nAcc = 0; | |
2213 | Double_t etaRange = 1.6; | |
2214 | ||
2215 | if (ev->IsA() == AliAODEvent::Class()) { | |
2216 | AliAODTracklets *tracklets = ((AliAODEvent*)ev)->GetTracklets(); | |
2217 | nTracklets = tracklets->GetNumberOfTracklets(); | |
2218 | for (Int_t nn = 0; nn < nTracklets; nn++) { | |
2219 | Double_t theta = tracklets->GetTheta(nn); | |
2220 | Double_t eta = -TMath::Log(TMath::Tan(theta/2.0)); | |
2221 | if (TMath::Abs(eta) < etaRange) nAcc++; | |
2222 | } | |
2223 | } else if (ev->IsA() == AliESDEvent::Class()) { | |
2224 | nTracklets = ((AliESDEvent*)ev)->GetMultiplicity()->GetNumberOfTracklets(); | |
2225 | for (Int_t nn = 0; nn < nTracklets; nn++) { | |
2226 | Double_t eta = ((AliESDEvent*)ev)->GetMultiplicity()->GetEta(nn); | |
2227 | if (TMath::Abs(eta) < etaRange) nAcc++; | |
2228 | } | |
2229 | } else return -1; | |
2230 | ||
2231 | return nAcc; | |
2232 | } | |
2233 | ||
2234 | //___________________________________________________ | |
2235 | void AliAnalysisTaskHFE::RejectionPileUpVertexRangeEventCut() { | |
2236 | // | |
2237 | // Recover the centrality of the event from ESD or AOD | |
2238 | // | |
2239 | if(IsAODanalysis()){ | |
2240 | ||
2241 | AliAODEvent *fAOD = dynamic_cast<AliAODEvent *>(fInputEvent); | |
2242 | if(!fAOD){ | |
2243 | AliError("AOD Event required for AOD Analysis"); | |
2244 | return; | |
2245 | } | |
2246 | // PileUp | |
2247 | fIdentifiedAsPileUp = kFALSE; | |
2248 | if(fRemovePileUp && fAOD->IsPileupFromSPD()) fIdentifiedAsPileUp = kTRUE; | |
2249 | // Z vertex | |
2250 | fIdentifiedAsOutInz = kFALSE; | |
2251 | //printf("Z vertex %f and out %f\n",fAOD->GetPrimaryVertex()->GetZ(),fCuts->GetVertexRange()); | |
2252 | if(TMath::Abs(fAOD->GetPrimaryVertex()->GetZ()) > fCuts->GetVertexRange()) fIdentifiedAsOutInz = kTRUE; | |
2253 | // Event Cut | |
2254 | fPassTheEventCut = kTRUE; | |
2255 | if(!fCFM->CheckEventCuts(AliHFEcuts::kEventStepReconstructed, fAOD)) fPassTheEventCut = kFALSE; | |
2256 | ||
2257 | ||
2258 | } else { | |
2259 | ||
2260 | AliDebug(3, "Processing ESD Centrality"); | |
2261 | AliESDEvent *fESD = dynamic_cast<AliESDEvent *>(fInputEvent); | |
2262 | if(!fESD){ | |
2263 | AliError("ESD Event required for ESD Analysis"); | |
2264 | return; | |
2265 | } | |
2266 | // PileUp | |
2267 | fIdentifiedAsPileUp = kFALSE; | |
2268 | if(fRemovePileUp && fESD->IsPileupFromSPD()) fIdentifiedAsPileUp = kTRUE; | |
2269 | ||
2270 | ||
2271 | ||
2272 | // Z vertex | |
2273 | fIdentifiedAsOutInz = kFALSE; | |
2274 | Bool_t findvertex = kTRUE; | |
2275 | const AliESDVertex* vtxESD = fESD->GetPrimaryVertex(); | |
2276 | if((!vtxESD) || (vtxESD->GetNContributors() <= 0)) findvertex = kFALSE; | |
2277 | if(findvertex) { | |
2278 | if(TMath::Abs(vtxESD->GetZ()) > fCuts->GetVertexRange()) fIdentifiedAsOutInz = kTRUE; | |
2279 | } | |
2280 | ||
2281 | //Event Cut | |
2282 | fPassTheEventCut = kTRUE; | |
2283 | if(!fCFM->CheckEventCuts(AliHFEcuts::kEventStepReconstructed, fESD)) fPassTheEventCut = kFALSE; | |
2284 | ||
2285 | } | |
2286 | ||
2287 | } | |
8c07fb0d | 2288 | |
2289 | //___________________________________________________ | |
4437a0d2 | 2290 | Bool_t AliAnalysisTaskHFE::CheckTRDTriggerESD(AliESDEvent *ev) { |
8c07fb0d | 2291 | // |
2292 | // Check TRD trigger; pPb settings | |
2293 | // | |
2294 | Bool_t cint8=kFALSE; | |
2295 | Bool_t cint7=kFALSE; | |
2296 | Bool_t cint5=kFALSE; | |
2e4ed823 | 2297 | Bool_t cint8s=kFALSE; |
2298 | Bool_t cint7s=kFALSE; | |
2299 | Bool_t cint7ppb=kFALSE; | |
8c07fb0d | 2300 | Bool_t trdtrgevent=kFALSE; |
2301 | ||
2e4ed823 | 2302 | // printf("TRIGGERS %s \n",ev->GetFiredTriggerClasses().Data()); |
4437a0d2 | 2303 | |
2304 | // mb selection of WU events | |
8c07fb0d | 2305 | if(fWhichTRDTrigger==1) |
2306 | { | |
4437a0d2 | 2307 | if(ev->IsTriggerClassFired("CINT7WU-B-NOPF-ALL")) |
8c07fb0d | 2308 | { |
2309 | DrawTRDTrigger(ev); | |
2310 | return kTRUE; | |
2311 | } | |
4437a0d2 | 2312 | else return kFALSE; |
8c07fb0d | 2313 | } |
618038b6 | 2314 | |
4437a0d2 | 2315 | |
2316 | // HSE no cleanup | |
8c07fb0d | 2317 | if(fWhichTRDTrigger==2) |
2318 | { | |
4437a0d2 | 2319 | cint8= ev->IsTriggerClassFired("CINT8WUHSE-B-NOPF-CENT"); |
2e4ed823 | 2320 | cint7= ev->IsTriggerClassFired("CINT7WUHSE-B-NOPF-CENT"); // pPb rare |
2321 | cint7ppb= ev->IsTriggerClassFired("CINT7WUHSE-B-NOPF-ALL"); // pPb mb | |
2322 | cint8s= ev->IsTriggerClassFired("CINT7WUHSE-S-NOPF-CENT"); | |
2323 | cint7s= ev->IsTriggerClassFired("CINT8WUHSE-S-NOPF-CENT"); | |
4437a0d2 | 2324 | cint5= (ev->IsTriggerClassFired("CINT5WU-B-NOPF-ALL")) && |
2325 | (ev->GetHeader()->GetL1TriggerInputs() & (1 << 10)); | |
2e4ed823 | 2326 | // printf("hse trigger %i %i %i %i %i \n",cint7,cint7ppb,cint8,cint7s,cint8s); |
2327 | if((cint7==kFALSE)&&(cint7ppb==kFALSE)&&(cint8==kFALSE)&&(cint7s==kFALSE)&&(cint8s==kFALSE)&&(cint5==kFALSE)) return kFALSE; | |
8c07fb0d | 2328 | else |
2329 | { | |
2330 | DrawTRDTrigger(ev); | |
2331 | return kTRUE; | |
2332 | } | |
2333 | } | |
2334 | ||
4437a0d2 | 2335 | |
2336 | ||
618038b6 | 2337 | //HQU no cleanup |
8c07fb0d | 2338 | if(fWhichTRDTrigger==3) |
2339 | { | |
8c07fb0d | 2340 | cint8= ev->IsTriggerClassFired("CINT8WUHQU-B-NOPF-CENT"); |
2e4ed823 | 2341 | cint7= ev->IsTriggerClassFired("CINT7WUHQU-B-NOPF-CENT"); // pPb rare |
2342 | cint7ppb= ev->IsTriggerClassFired("CINT7WUHQU-B-NOPF-ALL"); // pPb mb | |
2343 | cint8s= ev->IsTriggerClassFired("CINT7WUHQU-S-NOPF-CENT"); | |
2344 | cint7s= ev->IsTriggerClassFired("CINT8WUHQU-S-NOPF-CENT"); | |
8c07fb0d | 2345 | cint5= (ev->IsTriggerClassFired("CINT5WU-B-NOPF-ALL")) && |
2346 | (ev->GetHeader()->GetL1TriggerInputs() & (1 << 12)); | |
2e4ed823 | 2347 | // printf("hqu trigger %i %i %i %i %i \n",cint7,cint7ppb,cint8,cint7s,cint8s); |
2348 | if((cint7==kFALSE)&&(cint7ppb==kFALSE)&&(cint8==kFALSE)&&(cint7s==kFALSE)&&(cint8s==kFALSE)&&(cint5==kFALSE)) return kFALSE; | |
8c07fb0d | 2349 | else |
2350 | { | |
2351 | DrawTRDTrigger(ev); | |
2352 | return kTRUE; | |
2353 | } | |
8c07fb0d | 2354 | } |
618038b6 | 2355 | |
2e4ed823 | 2356 | if(fWhichTRDTrigger==4) |
2357 | { | |
2358 | // printf("trigger %i %i \n", ev->GetHeader()->IsTriggerInputFired("1HSE"),(ev->GetHeader()->GetL1TriggerInputs() & (1 << 10))); // bug in IsTriggerInputFired; reported in savannah | |
2359 | ||
2360 | if(ev->IsTriggerClassFired("CINT7WU-B-NOPF-ALL")) | |
2361 | { | |
2362 | Int_t trginput=0; | |
2363 | trginput=ev->GetHeader()->GetL1TriggerInputs() & (1 << 10); // HSE | |
2364 | if(trginput==1024) | |
2365 | { | |
2366 | DrawTRDTrigger(ev); | |
2367 | return kTRUE; | |
2368 | } else return kFALSE; | |
2369 | } else return kFALSE; | |
2370 | } | |
2371 | if(fWhichTRDTrigger==5) | |
2372 | { | |
2373 | // printf("trigger %i %i \n", ev->GetHeader()->IsTriggerInputFired("1HQU"),(ev->GetHeader()->GetL1TriggerInputs() & (1 << 12))); // bug in IsTriggerInputFired; reported in savannah | |
2374 | if(ev->IsTriggerClassFired("CINT7WU-B-NOPF-ALL")) | |
2375 | { | |
2376 | ||
2377 | Int_t trginput=0; | |
2378 | trginput=ev->GetHeader()->GetL1TriggerInputs() & (1 << 12); //HQU | |
2379 | // printf("triggerinput %i \n",trginput); | |
2380 | if(trginput==4096) | |
2381 | { | |
2382 | DrawTRDTrigger(ev); | |
2383 | return kTRUE; | |
2384 | } else return kFALSE; | |
2385 | } else return kFALSE; | |
2386 | } | |
4437a0d2 | 2387 | |
2388 | ||
2389 | return trdtrgevent; | |
2390 | ||
2391 | } | |
2392 | ||
2393 | ||
2394 | //___________________________________________________ | |
2395 | Bool_t AliAnalysisTaskHFE::CheckTRDTrigger(AliVEvent *ev) { | |
2396 | // | |
2397 | // Check TRD trigger; pPb settings | |
2398 | // | |
2399 | ||
2400 | fTRDTriggerAnalysis->CalcTriggers(ev); | |
2401 | ||
2402 | // HSE cleanup | |
2403 | if(fWhichTRDTrigger==6) | |
2404 | { | |
2405 | if(!fTRDTriggerAnalysis->IsFired(AliTRDTriggerAnalysis::kHSE)) | |
2406 | { | |
2407 | return kFALSE; | |
2408 | } | |
2409 | else | |
2410 | { | |
2411 | // DrawTRDTrigger(ev); | |
2412 | return kTRUE; | |
2413 | } | |
2414 | } | |
2415 | ||
2416 | ||
2417 | ||
618038b6 | 2418 | // HQU cleanup |
4437a0d2 | 2419 | if(fWhichTRDTrigger==7) |
8c07fb0d | 2420 | { |
618038b6 | 2421 | |
2422 | if(!fTRDTriggerAnalysis->IsFired(AliTRDTriggerAnalysis::kHQU)) | |
2423 | { | |
2424 | return kFALSE; | |
2425 | } | |
8c07fb0d | 2426 | else |
2427 | { | |
4437a0d2 | 2428 | // DrawTRDTrigger(ev); |
8c07fb0d | 2429 | return kTRUE; |
2430 | } | |
2431 | } | |
4437a0d2 | 2432 | |
2433 | // HSE or HQU cleanup | |
2434 | if(fWhichTRDTrigger==8) | |
2435 | { | |
2436 | if((fTRDTriggerAnalysis->IsFired(AliTRDTriggerAnalysis::kHSE))||(fTRDTriggerAnalysis->IsFired(AliTRDTriggerAnalysis::kHQU))) | |
2437 | { | |
2438 | // DrawTRDTrigger(ev); | |
2439 | return kTRUE; | |
2440 | } | |
2441 | else | |
2442 | { | |
2443 | return kFALSE; | |
2444 | } | |
2445 | } | |
2446 | ||
2447 | return kFALSE; | |
8c07fb0d | 2448 | |
2449 | } | |
2450 | ||
2e4ed823 | 2451 | //___________________________________________________ |
8c07fb0d | 2452 | void AliAnalysisTaskHFE::DrawTRDTrigger(AliESDEvent *ev) { |
2453 | ||
2454 | Int_t ntriggerbit=0; | |
2455 | fQACollection->Fill("nTriggerBit",ntriggerbit); | |
2456 | if(ev->IsTriggerClassFired("CINT7-B-NOPF-ALLNOTRD")) | |
2457 | { | |
2458 | ntriggerbit=2; | |
2459 | fQACollection->Fill("nTriggerBit",ntriggerbit); | |
2460 | } | |
2461 | if(ev->IsTriggerClassFired("CINT7WU-B-NOPF-ALL")) | |
2462 | { | |
2463 | ntriggerbit=3; | |
2464 | fQACollection->Fill("nTriggerBit",ntriggerbit); | |
2465 | if(ev->IsTriggerClassFired("CINT7WUHSE-B-NOPF-CENT")) { | |
2466 | ntriggerbit=18; | |
2467 | fQACollection->Fill("nTriggerBit",ntriggerbit); | |
2468 | } | |
2469 | if(ev->IsTriggerClassFired("CINT7WUHQU-B-NOPF-CENT")) { | |
2470 | ntriggerbit=19; | |
2471 | fQACollection->Fill("nTriggerBit",ntriggerbit); | |
2472 | } | |
2473 | } | |
2474 | if(ev->IsTriggerClassFired("CINT7WUHJT-B-NOPF-CENT")) | |
2475 | { | |
2476 | ntriggerbit=4; | |
2477 | fQACollection->Fill("nTriggerBit",ntriggerbit); | |
2478 | ||
2479 | if(ev->IsTriggerClassFired("CINT7WUHSE-B-NOPF-CENT")) { | |
2480 | ntriggerbit=13; | |
2481 | fQACollection->Fill("nTriggerBit",ntriggerbit); | |
2482 | } | |
2483 | if(ev->IsTriggerClassFired("CINT7WUHQU-B-NOPF-CENT")) { | |
2484 | ntriggerbit=14; | |
2485 | fQACollection->Fill("nTriggerBit",ntriggerbit); | |
2486 | if(ev->IsTriggerClassFired("CINT7WUHSE-B-NOPF-CENT")) { | |
2487 | ntriggerbit=17; | |
2488 | fQACollection->Fill("nTriggerBit",ntriggerbit); | |
2489 | } | |
2490 | } | |
2491 | } | |
2492 | if(ev->IsTriggerClassFired("CINT7WUHQU-B-NOPF-CENT")) | |
2493 | { | |
2494 | ntriggerbit=5; | |
2495 | fQACollection->Fill("nTriggerBit",ntriggerbit); | |
2496 | if(ev->IsTriggerClassFired("CINT7WUHSE-B-NOPF-CENT")) { | |
2497 | ntriggerbit=11; | |
2498 | fQACollection->Fill("nTriggerBit",ntriggerbit); | |
2499 | } | |
2500 | if((!(ev->IsTriggerClassFired("CINT7WUHSE-B-NOPF-CENT")))&&(!(ev->IsTriggerClassFired("CINT7WUHJT-B-NOPF-CENT")))) { | |
2501 | ntriggerbit=21; | |
2502 | fQACollection->Fill("nTriggerBit",ntriggerbit); | |
2503 | ||
2504 | /* | |
2505 | Int_t nTrdTracks = ev->GetNumberOfTrdTracks(); | |
2506 | for (Int_t iTrack = 0; iTrack < nTrdTracks; ++iTrack) { | |
2507 | AliESDTrdTrack* trdTrack = ev->GetTrdTrack(iTrack); | |
2508 | printf("GTU track %3i: pt = %5.1f, PID = %3i\n", iTrack, trdTrack->Pt(), trdTrack->GetPID()); | |
2509 | }*/ | |
2510 | ||
2511 | ||
2512 | } | |
2513 | ||
2514 | } | |
2515 | if(ev->IsTriggerClassFired("CINT7WUHSE-B-NOPF-CENT")) | |
2516 | { | |
2517 | ntriggerbit=6; | |
2518 | fQACollection->Fill("nTriggerBit",ntriggerbit); | |
2519 | if(ev->IsTriggerClassFired("CINT7WUHQU-B-NOPF-CENT")) { | |
2520 | ntriggerbit=12; | |
2521 | fQACollection->Fill("nTriggerBit",ntriggerbit); | |
2522 | } | |
2523 | if(ev->IsTriggerClassFired("CINT7WUHSE-B-NOPF-FAST")){ | |
2524 | ntriggerbit=15; | |
2525 | fQACollection->Fill("nTriggerBit",ntriggerbit); | |
2526 | ||
2527 | if((!(ev->IsTriggerClassFired("CINT7WUHQU-B-NOPF-CENT")))&&(!(ev->IsTriggerClassFired("CINT7WUHJT-B-NOPF-CENT")))) { | |
2528 | ntriggerbit=20; | |
2529 | fQACollection->Fill("nTriggerBit",ntriggerbit); | |
2530 | /* | |
2531 | Int_t nTrdTracks = ev->GetNumberOfTrdTracks(); | |
2532 | for (Int_t iTrack = 0; iTrack < nTrdTracks; ++iTrack) { | |
2533 | AliESDTrdTrack* trdTrack = ev->GetTrdTrack(iTrack); | |
2534 | printf("HSE GTU track %3i: pt = %5.1f, PID = %3i\n", iTrack, trdTrack->Pt(), trdTrack->GetPID()); | |
2535 | } */ | |
2536 | ||
2537 | } | |
2538 | ||
2539 | } | |
2540 | ||
2541 | } | |
2542 | if(ev->IsTriggerClassFired("CEMC7WUHEE-B-NOPF-CENT")) { | |
2543 | ntriggerbit=7; | |
2544 | fQACollection->Fill("nTriggerBit",ntriggerbit); | |
2545 | } | |
2546 | if(ev->IsTriggerClassFired("CINT7WUHJT-B-NOPF-FAST")){ | |
2547 | ntriggerbit=8; | |
2548 | fQACollection->Fill("nTriggerBit",ntriggerbit); | |
2549 | } | |
2550 | if(ev->IsTriggerClassFired("CINT7WUHQU-B-NOPF-FAST")){ | |
2551 | ntriggerbit=9; | |
2552 | fQACollection->Fill("nTriggerBit",ntriggerbit); | |
2553 | } | |
2554 | if(ev->IsTriggerClassFired("CINT7WUHSE-B-NOPF-FAST")){ | |
2555 | ntriggerbit=10; | |
2556 | fQACollection->Fill("nTriggerBit",ntriggerbit); | |
2557 | if(ev->IsTriggerClassFired("CINT7WUHSE-B-NOPF-CENT")) { | |
2558 | ntriggerbit=16; | |
2559 | fQACollection->Fill("nTriggerBit",ntriggerbit); | |
2560 | } | |
2561 | } | |
2562 | if(ntriggerbit==0) fQACollection->Fill("nTriggerBit",1); | |
2563 | ||
01745870 | 2564 | } |
2e4ed823 | 2565 | |
2566 | //___________________________________________________ | |
2567 | Bool_t AliAnalysisTaskHFE::IsMCFakeTrack(const AliVTrack *const trk) const { | |
2568 | // | |
2569 | // Check whether track is MC Fake track using the sign of the track label | |
2570 | // | |
2571 | return trk->GetLabel() < 0; | |
2572 | } |