]>
Commit | Line | Data |
---|---|---|
2bb2434e | 1 | /************************************************************************** |
2 | * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * | |
3 | * * | |
0a2b2b4b | 4 | * Author: Martin Wilde, Daniel Lohner, Friederike Bock * |
2bb2434e | 5 | * Version 1.0 * |
6 | * * | |
0a2b2b4b | 7 | * based on: on older version (see aliroot up to v5-04-42-AN) * |
8 | * AliAnalysisTaskGammaConversion.cxx * | |
9 | * Authors: Kathrin Koch, Kenneth Aamodt, Ana Marin * | |
10 | * * | |
2bb2434e | 11 | * Permission to use, copy, modify and distribute this software and its * |
12 | * documentation strictly for non-commercial purposes is hereby granted * | |
13 | * without fee, provided that the above copyright notice appears in all * | |
14 | * copies and that both the copyright notice and this permission notice * | |
15 | * appear in the supporting documentation. The authors make no claims * | |
16 | * about the suitability of this software for any purpose. It is * | |
17 | * provided "as is" without express or implied warranty. * | |
18 | **************************************************************************/ | |
19 | ||
20 | //////////////////////////////////////////////// | |
21 | //--------------------------------------------- | |
ae947965 | 22 | |
2bb2434e | 23 | // Class used to do analysis on conversion pairs |
24 | //--------------------------------------------- | |
25 | /////////////////////////////////////////////// | |
26 | #include "TChain.h" | |
27 | #include "TTree.h" | |
4803eb1f | 28 | #include "TBranch.h" |
29 | #include "TFile.h" | |
2bb2434e | 30 | #include "TH1F.h" |
31 | #include "TH2F.h" | |
32 | #include "TH3F.h" | |
33 | #include "THnSparse.h" | |
34 | #include "TCanvas.h" | |
35 | #include "TNtuple.h" | |
36 | #include "AliAnalysisTask.h" | |
37 | #include "AliAnalysisManager.h" | |
38 | #include "AliESDEvent.h" | |
39 | #include "AliESDInputHandler.h" | |
40 | #include "AliMCEventHandler.h" | |
41 | #include "AliMCEvent.h" | |
42 | #include "AliMCParticle.h" | |
43 | #include "AliCentrality.h" | |
44 | #include "AliESDVZERO.h" | |
45 | #include "AliESDpid.h" | |
46 | #include "AliAnalysisTaskGammaConvV1.h" | |
47 | #include "AliVParticle.h" | |
1390f698 | 48 | #include "AliESDtrack.h" |
2bb2434e | 49 | #include "AliESDtrackCuts.h" |
50 | #include "AliKFVertex.h" | |
51 | #include "AliV0ReaderV1.h" | |
ca91a3e1 | 52 | #include "AliGenCocktailEventHeader.h" |
e5b6e8a6 | 53 | #include "AliConversionAODBGHandlerRP.h" |
ae947965 | 54 | #include "AliAODMCParticle.h" |
55 | #include "AliAODMCHeader.h" | |
ae4f2cfb | 56 | #include "AliEventplane.h" |
2bb2434e | 57 | |
58 | ClassImp(AliAnalysisTaskGammaConvV1) | |
59 | ||
60 | //________________________________________________________________________ | |
61 | AliAnalysisTaskGammaConvV1::AliAnalysisTaskGammaConvV1(): AliAnalysisTaskSE(), | |
344100c4 | 62 | fV0Reader(NULL), |
63 | fBGHandler(NULL), | |
64 | fBGHandlerRP(NULL), | |
65 | fInputEvent(NULL), | |
66 | fMCEvent(NULL), | |
67 | fMCStack(NULL), | |
68 | fCutFolder(NULL), | |
69 | fESDList(NULL), | |
70 | fBackList(NULL), | |
71 | fMotherList(NULL), | |
72 | fPhotonDCAList(NULL), | |
73 | fMesonDCAList(NULL), | |
74 | fTrueList(NULL), | |
75 | fMCList(NULL), | |
76 | fHeaderNameList(NULL), | |
77 | fOutputContainer(0), | |
78 | fReaderGammas(NULL), | |
79 | fGammaCandidates(NULL), | |
80 | fEventCutArray(NULL), | |
81 | fEventCuts(NULL), | |
82 | fCutArray(NULL), | |
83 | fConversionCuts(NULL), | |
84 | fMesonCutArray(NULL), | |
85 | fMesonCuts(NULL), | |
86 | hESDConvGammaPt(NULL), | |
87 | hESDConvGammaR(NULL), | |
88 | hESDConvGammaEta(NULL), | |
89 | tESDConvGammaPtDcazCat(NULL), | |
90 | fPtGamma(0), | |
91 | fDCAzPhoton(0), | |
92 | fRConvPhoton(0), | |
93 | fEtaPhoton(0), | |
94 | iCatPhoton(0), | |
95 | iPhotonMCInfo(0), | |
96 | hESDMotherInvMassPt(NULL), | |
97 | sESDMotherInvMassPtZM(NULL), | |
98 | hESDMotherBackInvMassPt(NULL), | |
99 | sESDMotherBackInvMassPtZM(NULL), | |
100 | hESDMotherInvMassEalpha(NULL), | |
101 | hESDMotherPi0PtY(NULL), | |
102 | hESDMotherEtaPtY(NULL), | |
103 | hESDMotherPi0PtAlpha(NULL), | |
104 | hESDMotherEtaPtAlpha(NULL), | |
105 | hESDMotherPi0PtOpenAngle(NULL), | |
106 | hESDMotherEtaPtOpenAngle(NULL), | |
107 | hMCHeaders(NULL), | |
108 | hMCAllGammaPt(NULL), | |
109 | hMCDecayGammaPi0Pt(NULL), | |
110 | hMCDecayGammaRhoPt(NULL), | |
111 | hMCDecayGammaEtaPt(NULL), | |
112 | hMCDecayGammaOmegaPt(NULL), | |
113 | hMCDecayGammaEtapPt(NULL), | |
114 | hMCDecayGammaPhiPt(NULL), | |
115 | hMCDecayGammaSigmaPt(NULL), | |
116 | hMCConvGammaPt(NULL), | |
117 | hMCConvGammaR(NULL), | |
118 | hMCConvGammaEta(NULL), | |
119 | hMCPi0Pt(NULL), | |
120 | hMCPi0WOWeightPt(NULL), | |
121 | hMCEtaPt(NULL), | |
122 | hMCEtaWOWeightPt(NULL), | |
123 | hMCPi0InAccPt(NULL), | |
124 | hMCEtaInAccPt(NULL), | |
125 | hMCPi0PtY(NULL), | |
126 | hMCEtaPtY(NULL), | |
de752898 | 127 | hMCPi0PtAlpha(NULL), |
128 | hMCEtaPtAlpha(NULL), | |
344100c4 | 129 | hMCK0sPt(NULL), |
130 | hMCK0sWOWeightPt(NULL), | |
131 | hMCK0sPtY(NULL), | |
132 | hMCSecPi0PtvsSource(NULL), | |
133 | hMCSecPi0Source(NULL), | |
134 | hMCSecEtaPt(NULL), | |
135 | hMCSecEtaSource(NULL), | |
136 | hESDTrueMotherInvMassPt(NULL), | |
137 | hESDTruePrimaryMotherInvMassPt(NULL), | |
138 | hESDTruePrimaryMotherW0WeightingInvMassPt(NULL), | |
139 | pESDTruePrimaryMotherWeightsInvMassPt(NULL), | |
140 | hESDTruePrimaryPi0MCPtResolPt(NULL), | |
141 | hESDTruePrimaryEtaMCPtResolPt(NULL), | |
142 | hESDTrueSecondaryMotherInvMassPt(NULL), | |
143 | hESDTrueSecondaryMotherFromK0sInvMassPt(NULL), | |
144 | hESDTrueK0sWithPi0DaughterMCPt(NULL), | |
145 | hESDTrueSecondaryMotherFromEtaInvMassPt(NULL), | |
146 | hESDTrueEtaWithPi0DaughterMCPt(NULL), | |
147 | hESDTrueSecondaryMotherFromLambdaInvMassPt(NULL), | |
148 | hESDTrueLambdaWithPi0DaughterMCPt(NULL), | |
149 | hESDTrueBckGGInvMassPt(NULL), | |
150 | hESDTrueBckContInvMassPt(NULL), | |
151 | hESDTruePi0PtY(NULL), | |
152 | hESDTrueEtaPtY(NULL), | |
153 | hESDTruePi0PtAlpha(NULL), | |
154 | hESDTrueEtaPtAlpha(NULL), | |
155 | hESDTruePi0PtOpenAngle(NULL), | |
156 | hESDTrueEtaPtOpenAngle(NULL), | |
157 | hESDTrueMotherDalitzInvMassPt(NULL), | |
158 | hESDTrueConvGammaPt(NULL), | |
159 | hESDTrueConvGammaEta(NULL), | |
160 | hESDCombinatorialPt(NULL), | |
161 | hESDTruePrimaryConvGammaPt(NULL), | |
162 | hESDTruePrimaryConvGammaESDPtMCPt(NULL), | |
163 | hESDTrueSecondaryConvGammaPt(NULL), | |
164 | hESDTrueSecondaryConvGammaFromXFromK0sPt(NULL), | |
165 | hESDTrueSecondaryConvGammaFromXFromLambdaPt(NULL), | |
166 | hESDTrueDalitzPsiPairDeltaPhi(NULL), | |
167 | hESDTrueGammaPsiPairDeltaPhi(NULL), | |
168 | hNEvents(NULL), | |
169 | hNGoodESDTracks(NULL), | |
170 | hNGammaCandidates(NULL), | |
171 | hNGoodESDTracksVsNGammaCanditates(NULL), | |
172 | hNV0Tracks(NULL), | |
173 | hEtaShift(NULL), | |
174 | tESDMesonsInvMassPtDcazMinDcazMaxFlag(NULL), | |
175 | fInvMass(0), | |
176 | fPt(0), | |
177 | fDCAzGammaMin(0), | |
178 | fDCAzGammaMax(0), | |
179 | iFlag(0), | |
180 | iMesonMCInfo(0), | |
181 | fEventPlaneAngle(-100), | |
182 | fRandom(0), | |
183 | fnGammaCandidates(0), | |
184 | fUnsmearedPx(NULL), | |
185 | fUnsmearedPy(NULL), | |
186 | fUnsmearedPz(NULL), | |
187 | fUnsmearedE(NULL), | |
188 | fMCStackPos(NULL), | |
189 | fMCStackNeg(NULL), | |
190 | fESDArrayPos(NULL), | |
191 | fESDArrayNeg(NULL), | |
192 | fnCuts(0), | |
193 | fiCut(0), | |
194 | fMoveParticleAccordingToVertex(kTRUE), | |
195 | fIsHeavyIon(0), | |
196 | fDoMesonAnalysis(kTRUE), | |
197 | fDoMesonQA(0), | |
198 | fDoPhotonQA(0), | |
199 | fIsFromMBHeader(kTRUE), | |
200 | fIsMC(kFALSE) | |
2bb2434e | 201 | { |
a280ac15 | 202 | |
2bb2434e | 203 | } |
204 | ||
205 | //________________________________________________________________________ | |
206 | AliAnalysisTaskGammaConvV1::AliAnalysisTaskGammaConvV1(const char *name): | |
344100c4 | 207 | AliAnalysisTaskSE(name), |
208 | fV0Reader(NULL), | |
209 | fBGHandler(NULL), | |
210 | fBGHandlerRP(NULL), | |
211 | fInputEvent(NULL), | |
212 | fMCEvent(NULL), | |
213 | fMCStack(NULL), | |
214 | fCutFolder(NULL), | |
215 | fESDList(NULL), | |
216 | fBackList(NULL), | |
217 | fMotherList(NULL), | |
218 | fPhotonDCAList(NULL), | |
219 | fMesonDCAList(NULL), | |
220 | fTrueList(NULL), | |
221 | fMCList(NULL), | |
222 | fHeaderNameList(NULL), | |
223 | fOutputContainer(0), | |
224 | fReaderGammas(NULL), | |
225 | fGammaCandidates(NULL), | |
226 | fEventCutArray(NULL), | |
227 | fEventCuts(NULL), | |
228 | fCutArray(NULL), | |
229 | fConversionCuts(NULL), | |
230 | fMesonCutArray(NULL), | |
231 | fMesonCuts(NULL), | |
232 | hESDConvGammaPt(NULL), | |
233 | hESDConvGammaR(NULL), | |
234 | hESDConvGammaEta(NULL), | |
235 | tESDConvGammaPtDcazCat(NULL), | |
236 | fPtGamma(0), | |
237 | fDCAzPhoton(0), | |
238 | fRConvPhoton(0), | |
239 | fEtaPhoton(0), | |
240 | iCatPhoton(0), | |
241 | iPhotonMCInfo(0), | |
242 | hESDMotherInvMassPt(NULL), | |
243 | sESDMotherInvMassPtZM(NULL), | |
244 | hESDMotherBackInvMassPt(NULL), | |
245 | sESDMotherBackInvMassPtZM(NULL), | |
246 | hESDMotherInvMassEalpha(NULL), | |
247 | hESDMotherPi0PtY(NULL), | |
248 | hESDMotherEtaPtY(NULL), | |
249 | hESDMotherPi0PtAlpha(NULL), | |
250 | hESDMotherEtaPtAlpha(NULL), | |
251 | hESDMotherPi0PtOpenAngle(NULL), | |
252 | hESDMotherEtaPtOpenAngle(NULL), | |
253 | hMCHeaders(NULL), | |
254 | hMCAllGammaPt(NULL), | |
255 | hMCDecayGammaPi0Pt(NULL), | |
256 | hMCDecayGammaRhoPt(NULL), | |
257 | hMCDecayGammaEtaPt(NULL), | |
258 | hMCDecayGammaOmegaPt(NULL), | |
259 | hMCDecayGammaEtapPt(NULL), | |
260 | hMCDecayGammaPhiPt(NULL), | |
261 | hMCDecayGammaSigmaPt(NULL), | |
262 | hMCConvGammaPt(NULL), | |
263 | hMCConvGammaR(NULL), | |
264 | hMCConvGammaEta(NULL), | |
265 | hMCPi0Pt(NULL), | |
266 | hMCPi0WOWeightPt(NULL), | |
267 | hMCEtaPt(NULL), | |
268 | hMCEtaWOWeightPt(NULL), | |
269 | hMCPi0InAccPt(NULL), | |
270 | hMCEtaInAccPt(NULL), | |
271 | hMCPi0PtY(NULL), | |
272 | hMCEtaPtY(NULL), | |
de752898 | 273 | hMCPi0PtAlpha(NULL), |
274 | hMCEtaPtAlpha(NULL), | |
344100c4 | 275 | hMCK0sPt(NULL), |
276 | hMCK0sWOWeightPt(NULL), | |
277 | hMCK0sPtY(NULL), | |
278 | hMCSecPi0PtvsSource(NULL), | |
279 | hMCSecPi0Source(NULL), | |
280 | hMCSecEtaPt(NULL), | |
281 | hMCSecEtaSource(NULL), | |
282 | hESDTrueMotherInvMassPt(NULL), | |
283 | hESDTruePrimaryMotherInvMassPt(NULL), | |
284 | hESDTruePrimaryMotherW0WeightingInvMassPt(NULL), | |
285 | pESDTruePrimaryMotherWeightsInvMassPt(NULL), | |
286 | hESDTruePrimaryPi0MCPtResolPt(NULL), | |
287 | hESDTruePrimaryEtaMCPtResolPt(NULL), | |
288 | hESDTrueSecondaryMotherInvMassPt(NULL), | |
289 | hESDTrueSecondaryMotherFromK0sInvMassPt(NULL), | |
290 | hESDTrueK0sWithPi0DaughterMCPt(NULL), | |
291 | hESDTrueSecondaryMotherFromEtaInvMassPt(NULL), | |
292 | hESDTrueEtaWithPi0DaughterMCPt(NULL), | |
293 | hESDTrueSecondaryMotherFromLambdaInvMassPt(NULL), | |
294 | hESDTrueLambdaWithPi0DaughterMCPt(NULL), | |
295 | hESDTrueBckGGInvMassPt(NULL), | |
296 | hESDTrueBckContInvMassPt(NULL), | |
297 | hESDTruePi0PtY(NULL), | |
298 | hESDTrueEtaPtY(NULL), | |
299 | hESDTruePi0PtAlpha(NULL), | |
300 | hESDTrueEtaPtAlpha(NULL), | |
301 | hESDTruePi0PtOpenAngle(NULL), | |
302 | hESDTrueEtaPtOpenAngle(NULL), | |
303 | hESDTrueMotherDalitzInvMassPt(NULL), | |
304 | hESDTrueConvGammaPt(NULL), | |
305 | hESDTrueConvGammaEta(NULL), | |
306 | hESDCombinatorialPt(NULL), | |
307 | hESDTruePrimaryConvGammaPt(NULL), | |
308 | hESDTruePrimaryConvGammaESDPtMCPt(NULL), | |
309 | hESDTrueSecondaryConvGammaPt(NULL), | |
310 | hESDTrueSecondaryConvGammaFromXFromK0sPt(NULL), | |
311 | hESDTrueSecondaryConvGammaFromXFromLambdaPt(NULL), | |
312 | hESDTrueDalitzPsiPairDeltaPhi(NULL), | |
313 | hESDTrueGammaPsiPairDeltaPhi(NULL), | |
314 | hNEvents(NULL), | |
315 | hNGoodESDTracks(NULL), | |
316 | hNGammaCandidates(NULL), | |
317 | hNGoodESDTracksVsNGammaCanditates(NULL), | |
318 | hNV0Tracks(NULL), | |
319 | hEtaShift(NULL), | |
320 | tESDMesonsInvMassPtDcazMinDcazMaxFlag(NULL), | |
321 | fInvMass(0), | |
322 | fPt(0), | |
323 | fDCAzGammaMin(0), | |
324 | fDCAzGammaMax(0), | |
325 | iFlag(0), | |
326 | iMesonMCInfo(0), | |
327 | fEventPlaneAngle(-100), | |
328 | fRandom(0), | |
329 | fnGammaCandidates(0), | |
330 | fUnsmearedPx(NULL), | |
331 | fUnsmearedPy(NULL), | |
332 | fUnsmearedPz(NULL), | |
333 | fUnsmearedE(NULL), | |
334 | fMCStackPos(NULL), | |
335 | fMCStackNeg(NULL), | |
336 | fESDArrayPos(NULL), | |
337 | fESDArrayNeg(NULL), | |
338 | fnCuts(0), | |
339 | fiCut(0), | |
340 | fMoveParticleAccordingToVertex(kTRUE), | |
341 | fIsHeavyIon(0), | |
342 | fDoMesonAnalysis(kTRUE), | |
343 | fDoMesonQA(0), | |
344 | fDoPhotonQA(0), | |
345 | fIsFromMBHeader(kTRUE), | |
346 | fIsMC(kFALSE) | |
2bb2434e | 347 | { |
a280ac15 | 348 | // Define output slots here |
344100c4 | 349 | DefineOutput(1, TList::Class()); |
2bb2434e | 350 | } |
351 | ||
352 | AliAnalysisTaskGammaConvV1::~AliAnalysisTaskGammaConvV1() | |
353 | { | |
344100c4 | 354 | if(fGammaCandidates){ |
355 | delete fGammaCandidates; | |
356 | fGammaCandidates = 0x0; | |
357 | } | |
358 | if(fBGHandler){ | |
359 | delete[] fBGHandler; | |
360 | fBGHandler = 0x0; | |
361 | } | |
362 | if(fBGHandlerRP){ | |
363 | delete[] fBGHandlerRP; | |
364 | fBGHandlerRP = 0x0; | |
365 | } | |
2bb2434e | 366 | } |
367 | //___________________________________________________________ | |
368 | void AliAnalysisTaskGammaConvV1::InitBack(){ | |
369 | ||
344100c4 | 370 | const Int_t nDim = 4; |
371 | Int_t nBins[nDim] = {800,250,7,4}; | |
372 | Double_t xMin[nDim] = {0,0, 0,0}; | |
373 | Double_t xMax[nDim] = {0.8,25,7,4}; | |
374 | ||
375 | sESDMotherInvMassPtZM = new THnSparseF*[fnCuts]; | |
376 | sESDMotherBackInvMassPtZM = new THnSparseF*[fnCuts]; | |
377 | ||
378 | fBGHandler = new AliGammaConversionAODBGHandler*[fnCuts]; | |
379 | fBGHandlerRP = new AliConversionAODBGHandlerRP*[fnCuts]; | |
380 | for(Int_t iCut = 0; iCut<fnCuts;iCut++){ | |
381 | if (((AliConversionMesonCuts*)fMesonCutArray->At(iCut))->DoBGCalculation()){ | |
382 | TString cutstringEvent = ((AliConvEventCuts*)fEventCutArray->At(iCut))->GetCutNumber(); | |
383 | TString cutstringPhoton = ((AliConversionPhotonCuts*)fCutArray->At(iCut))->GetCutNumber(); | |
384 | TString cutstringMeson = ((AliConversionMesonCuts*)fMesonCutArray->At(iCut))->GetCutNumber(); | |
385 | ||
386 | Int_t collisionSystem = atoi((TString)(((AliConvEventCuts*)fEventCutArray->At(iCut))->GetCutNumber())(0,1)); | |
387 | Int_t centMin = atoi((TString)(((AliConvEventCuts*)fEventCutArray->At(iCut))->GetCutNumber())(1,1)); | |
388 | Int_t centMax = atoi((TString)(((AliConvEventCuts*)fEventCutArray->At(iCut))->GetCutNumber())(2,1)); | |
389 | ||
390 | if(collisionSystem == 1 || collisionSystem == 2 || | |
391 | collisionSystem == 5 || collisionSystem == 8 || | |
392 | collisionSystem == 9){ | |
393 | centMin = centMin*10; | |
394 | centMax = centMax*10; | |
395 | if(centMax ==0 && centMax!=centMin) centMax=100; | |
396 | } else if(collisionSystem == 3 || collisionSystem == 6) { | |
397 | centMin = centMin*5; | |
398 | centMax = centMax*5; | |
399 | } else if(collisionSystem == 4 || collisionSystem == 7) { | |
400 | centMin = ((centMin*5)+45); | |
401 | centMax = ((centMax*5)+45); | |
402 | } | |
403 | ||
404 | fBackList[iCut] = new TList(); | |
405 | fBackList[iCut]->SetName(Form("%s_%s_%s Back histograms",cutstringEvent.Data(), cutstringPhoton.Data(),cutstringMeson.Data())); | |
406 | fBackList[iCut]->SetOwner(kTRUE); | |
407 | fCutFolder[iCut]->Add(fBackList[iCut]); | |
408 | ||
409 | sESDMotherBackInvMassPtZM[iCut] = new THnSparseF("Back_Back_InvMass_Pt_z_m","Back_Back_InvMass_Pt_z_m",nDim,nBins,xMin,xMax); | |
410 | fBackList[iCut]->Add(sESDMotherBackInvMassPtZM[iCut]); | |
411 | ||
412 | fMotherList[iCut] = new TList(); | |
413 | fMotherList[iCut]->SetName(Form("%s_%s_%s Mother histograms",cutstringEvent.Data() ,cutstringPhoton.Data(),cutstringMeson.Data())); | |
414 | fMotherList[iCut]->SetOwner(kTRUE); | |
415 | fCutFolder[iCut]->Add(fMotherList[iCut]); | |
416 | ||
417 | sESDMotherInvMassPtZM[iCut] = new THnSparseF("Back_Mother_InvMass_Pt_z_m","Back_Mother_InvMass_Pt_z_m",nDim,nBins,xMin,xMax); | |
418 | fMotherList[iCut]->Add(sESDMotherInvMassPtZM[iCut]); | |
419 | ||
420 | if(((AliConversionMesonCuts*)fMesonCutArray->At(iCut))->BackgroundHandlerType() == 0){ | |
421 | fBGHandler[iCut] = new AliGammaConversionAODBGHandler( | |
422 | collisionSystem,centMin,centMax, | |
423 | ((AliConversionMesonCuts*)fMesonCutArray->At(iCut))->GetNumberOfBGEvents(), | |
424 | ((AliConversionMesonCuts*)fMesonCutArray->At(iCut))->UseTrackMultiplicity()); | |
425 | fBGHandlerRP[iCut] = NULL; | |
426 | } else { | |
427 | fBGHandlerRP[iCut] = new AliConversionAODBGHandlerRP( | |
428 | ((AliConvEventCuts*)fEventCutArray->At(fiCut))->IsHeavyIon(), | |
429 | ((AliConversionMesonCuts*)fMesonCutArray->At(fiCut))->UseTrackMultiplicity(), | |
430 | ((AliConversionMesonCuts*)fMesonCutArray->At(iCut))->GetNumberOfBGEvents()); | |
431 | fBGHandler[iCut] = NULL; | |
432 | } | |
433 | } | |
434 | } | |
2bb2434e | 435 | } |
436 | //________________________________________________________________________ | |
d9d6352b | 437 | void AliAnalysisTaskGammaConvV1::UserCreateOutputObjects(){ |
438 | ||
439 | // Create histograms | |
440 | if(fOutputContainer != NULL){ | |
441 | delete fOutputContainer; | |
442 | fOutputContainer = NULL; | |
443 | } | |
444 | if(fOutputContainer == NULL){ | |
445 | fOutputContainer = new TList(); | |
446 | fOutputContainer->SetOwner(kTRUE); | |
447 | } | |
448 | ||
449 | // Array of current cut's gammas | |
450 | fGammaCandidates = new TList(); | |
451 | ||
452 | fCutFolder = new TList*[fnCuts]; | |
453 | fESDList = new TList*[fnCuts]; | |
454 | fBackList = new TList*[fnCuts]; | |
455 | fMotherList = new TList*[fnCuts]; | |
456 | hNEvents = new TH1I*[fnCuts]; | |
457 | hNGoodESDTracks = new TH1I*[fnCuts]; | |
458 | hNGammaCandidates = new TH1I*[fnCuts]; | |
7e6c9796 | 459 | hNGoodESDTracksVsNGammaCanditates = new TH2F*[fnCuts]; |
d9d6352b | 460 | hNV0Tracks = new TH1I*[fnCuts]; |
461 | hEtaShift = new TProfile*[fnCuts]; | |
462 | hESDConvGammaPt = new TH1F*[fnCuts]; | |
463 | ||
464 | if (fDoPhotonQA == 2){ | |
465 | fPhotonDCAList = new TList*[fnCuts]; | |
466 | tESDConvGammaPtDcazCat = new TTree*[fnCuts]; | |
467 | } | |
468 | if (fDoPhotonQA > 0){ | |
469 | hESDConvGammaR = new TH1F*[fnCuts]; | |
470 | hESDConvGammaEta = new TH1F*[fnCuts]; | |
471 | } | |
472 | ||
473 | if(fDoMesonAnalysis){ | |
474 | hESDMotherInvMassPt = new TH2F*[fnCuts]; | |
475 | hESDMotherBackInvMassPt = new TH2F*[fnCuts]; | |
476 | hESDMotherInvMassEalpha = new TH2F*[fnCuts]; | |
477 | if (fDoMesonQA == 2){ | |
478 | fMesonDCAList = new TList*[fnCuts]; | |
479 | tESDMesonsInvMassPtDcazMinDcazMaxFlag = new TTree*[fnCuts]; | |
480 | } | |
481 | if (fDoMesonQA > 0){ | |
482 | hESDMotherPi0PtY = new TH2F*[fnCuts]; | |
483 | hESDMotherEtaPtY = new TH2F*[fnCuts]; | |
484 | hESDMotherPi0PtAlpha = new TH2F*[fnCuts]; | |
485 | hESDMotherEtaPtAlpha = new TH2F*[fnCuts]; | |
486 | hESDMotherPi0PtOpenAngle = new TH2F*[fnCuts]; | |
487 | hESDMotherEtaPtOpenAngle = new TH2F*[fnCuts]; | |
488 | } | |
489 | } | |
490 | ||
491 | for(Int_t iCut = 0; iCut<fnCuts;iCut++){ | |
492 | ||
344100c4 | 493 | TString cutstringEvent = ((AliConvEventCuts*)fEventCutArray->At(iCut))->GetCutNumber(); |
494 | TString cutstringPhoton = ((AliConversionPhotonCuts*)fCutArray->At(iCut))->GetCutNumber(); | |
d9d6352b | 495 | TString cutstringMeson = "NoMesonCut"; |
496 | if(fDoMesonAnalysis)cutstringMeson = ((AliConversionMesonCuts*)fMesonCutArray->At(iCut))->GetCutNumber(); | |
497 | ||
498 | fCutFolder[iCut] = new TList(); | |
344100c4 | 499 | fCutFolder[iCut]->SetName(Form("Cut Number %s_%s_%s",cutstringEvent.Data() ,cutstringPhoton.Data(),cutstringMeson.Data())); |
d9d6352b | 500 | fCutFolder[iCut]->SetOwner(kTRUE); |
501 | fOutputContainer->Add(fCutFolder[iCut]); | |
502 | fESDList[iCut] = new TList(); | |
344100c4 | 503 | fESDList[iCut]->SetName(Form("%s_%s_%s ESD histograms",cutstringEvent.Data() ,cutstringPhoton.Data(),cutstringMeson.Data())); |
d9d6352b | 504 | fESDList[iCut]->SetOwner(kTRUE); |
505 | fCutFolder[iCut]->Add(fESDList[iCut]); | |
506 | ||
507 | hNEvents[iCut] = new TH1I("NEvents","NEvents",9,-0.5,8.5); | |
508 | hNEvents[iCut]->GetXaxis()->SetBinLabel(1,"Accepted"); | |
509 | hNEvents[iCut]->GetXaxis()->SetBinLabel(2,"Centrality"); | |
510 | hNEvents[iCut]->GetXaxis()->SetBinLabel(3,"Missing MC"); | |
344100c4 | 511 | if (((AliConvEventCuts*)fEventCutArray->At(iCut))->IsSpecialTrigger() > 3 ){ |
d9d6352b | 512 | TString TriggerNames = "Not Trigger: "; |
344100c4 | 513 | TriggerNames = TriggerNames+ ( (AliConvEventCuts*)fEventCutArray->At(iCut))->GetSpecialTriggerName(); |
d9d6352b | 514 | hNEvents[iCut]->GetXaxis()->SetBinLabel(4,TriggerNames.Data()); |
515 | } else { | |
516 | hNEvents[iCut]->GetXaxis()->SetBinLabel(4,"Trigger"); | |
517 | } | |
518 | hNEvents[iCut]->GetXaxis()->SetBinLabel(5,"Vertex Z"); | |
519 | hNEvents[iCut]->GetXaxis()->SetBinLabel(6,"Cont. Vertex"); | |
520 | hNEvents[iCut]->GetXaxis()->SetBinLabel(7,"Pile-Up"); | |
521 | hNEvents[iCut]->GetXaxis()->SetBinLabel(8,"no SDD"); | |
522 | hNEvents[iCut]->GetXaxis()->SetBinLabel(9,"no V0AND"); | |
523 | fESDList[iCut]->Add(hNEvents[iCut]); | |
524 | ||
525 | if(fIsHeavyIon == 1) hNGoodESDTracks[iCut] = new TH1I("GoodESDTracks","GoodESDTracks",4000,0,4000); | |
526 | else if(fIsHeavyIon == 2) hNGoodESDTracks[iCut] = new TH1I("GoodESDTracks","GoodESDTracks",400,0,400); | |
527 | else hNGoodESDTracks[iCut] = new TH1I("GoodESDTracks","GoodESDTracks",200,0,200); | |
528 | fESDList[iCut]->Add(hNGoodESDTracks[iCut]); | |
529 | if(fIsHeavyIon == 1) hNGammaCandidates[iCut] = new TH1I("GammaCandidates","GammaCandidates",100,0,100); | |
530 | else if(fIsHeavyIon == 2) hNGammaCandidates[iCut] = new TH1I("GammaCandidates","GammaCandidates",50,0,50); | |
531 | else hNGammaCandidates[iCut] = new TH1I("GammaCandidates","GammaCandidates",50,0,50); | |
532 | fESDList[iCut]->Add(hNGammaCandidates[iCut]); | |
7e6c9796 | 533 | if(fIsHeavyIon == 1) hNGoodESDTracksVsNGammaCanditates[iCut] = new TH2F("GoodESDTracksVsGammaCandidates","GoodESDTracksVsGammaCandidates",4000,0,4000,100,0,100); |
534 | else if(fIsHeavyIon == 2) hNGoodESDTracksVsNGammaCanditates[iCut] = new TH2F("GoodESDTracksVsGammaCandidates","GoodESDTracksVsGammaCandidates",400,0,400,50,0,50); | |
535 | else hNGoodESDTracksVsNGammaCanditates[iCut] = new TH2F("GoodESDTracksVsGammaCandidates","GoodESDTracksVsGammaCandidates",200,0,200,50,0,50); | |
536 | fESDList[iCut]->Add(hNGoodESDTracksVsNGammaCanditates[iCut]); | |
537 | ||
538 | ||
d9d6352b | 539 | if(fIsHeavyIon == 1) hNV0Tracks[iCut] = new TH1I("V0 Multiplicity","V0 Multiplicity",30000,0,30000); |
540 | else if(fIsHeavyIon == 2) hNV0Tracks[iCut] = new TH1I("V0 Multiplicity","V0 Multiplicity",2500,0,2500); | |
541 | else hNV0Tracks[iCut] = new TH1I("V0 Multiplicity","V0 Multiplicity",1500,0,1500); | |
542 | fESDList[iCut]->Add(hNV0Tracks[iCut]); | |
543 | hEtaShift[iCut] = new TProfile("Eta Shift","Eta Shift",1, -0.5,0.5); | |
544 | fESDList[iCut]->Add(hEtaShift[iCut]); | |
545 | hESDConvGammaPt[iCut] = new TH1F("ESD_ConvGamma_Pt","ESD_ConvGamma_Pt",250,0,25); | |
546 | fESDList[iCut]->Add(hESDConvGammaPt[iCut]); | |
547 | ||
548 | if (fDoPhotonQA == 2){ | |
549 | fPhotonDCAList[iCut] = new TList(); | |
344100c4 | 550 | fPhotonDCAList[iCut]->SetName(Form("%s_%s_%s Photon DCA tree",cutstringEvent.Data(),cutstringPhoton.Data(),cutstringMeson.Data())); |
d9d6352b | 551 | fPhotonDCAList[iCut]->SetOwner(kTRUE); |
552 | fCutFolder[iCut]->Add(fPhotonDCAList[iCut]); | |
553 | ||
554 | tESDConvGammaPtDcazCat[iCut] = new TTree("ESD_ConvGamma_Pt_Dcaz_R_Eta","ESD_ConvGamma_Pt_Dcaz_R_Eta_Cat"); | |
555 | tESDConvGammaPtDcazCat[iCut]->Branch("Pt",&fPtGamma,"fPtGamma/F"); | |
556 | tESDConvGammaPtDcazCat[iCut]->Branch("DcaZPhoton",&fDCAzPhoton,"fDCAzPhoton/F"); | |
557 | // tESDConvGammaPtDcazCat[iCut]->Branch("R",&fRConvPhoton,"fRConvPhoton/F"); | |
558 | // tESDConvGammaPtDcazCat[iCut]->Branch("Eta",&fEtaPhoton,"fEtaPhoton/F"); | |
559 | ||
560 | tESDConvGammaPtDcazCat[iCut]->Branch("cat",&iCatPhoton,"iCatPhoton/b"); | |
561 | if(fIsMC){ | |
562 | tESDConvGammaPtDcazCat[iCut]->Branch("photonMCInfo",&iPhotonMCInfo,"iPhotonMCInfo/b"); | |
563 | } | |
564 | fPhotonDCAList[iCut]->Add(tESDConvGammaPtDcazCat[iCut]); | |
565 | } | |
566 | ||
567 | if (fDoPhotonQA > 0){ | |
568 | hESDConvGammaR[iCut] = new TH1F("ESD_ConvGamma_R","ESD_ConvGamma_R",800,0,200); | |
569 | fESDList[iCut]->Add(hESDConvGammaR[iCut]); | |
570 | hESDConvGammaEta[iCut] = new TH1F("ESD_ConvGamma_Eta","ESD_ConvGamma_Eta",2000,-2,2); | |
571 | fESDList[iCut]->Add(hESDConvGammaEta[iCut]); | |
572 | } | |
573 | ||
574 | if(fDoMesonAnalysis){ | |
575 | hESDMotherInvMassPt[iCut] = new TH2F("ESD_Mother_InvMass_Pt","ESD_Mother_InvMass_Pt",800,0,0.8,250,0,25); | |
576 | fESDList[iCut]->Add(hESDMotherInvMassPt[iCut]); | |
577 | hESDMotherBackInvMassPt[iCut] = new TH2F("ESD_Background_InvMass_Pt","ESD_Background_InvMass_Pt",800,0,0.8,250,0,25); | |
578 | fESDList[iCut]->Add(hESDMotherBackInvMassPt[iCut]); | |
579 | hESDMotherInvMassEalpha[iCut] = new TH2F("ESD_Mother_InvMass_vs_E_alpha","ESD_Mother_InvMass_vs_E_alpha",800,0,0.8,250,0,25); | |
580 | fESDList[iCut]->Add(hESDMotherInvMassEalpha[iCut]); | |
581 | if (fDoMesonQA == 2){ | |
582 | fMesonDCAList[iCut] = new TList(); | |
344100c4 | 583 | fMesonDCAList[iCut]->SetName(Form("%s_%s_%s Meson DCA tree",cutstringEvent.Data() ,cutstringPhoton.Data(),cutstringMeson.Data())); |
d9d6352b | 584 | fMesonDCAList[iCut]->SetOwner(kTRUE); |
585 | fCutFolder[iCut]->Add(fMesonDCAList[iCut]); | |
586 | ||
587 | tESDMesonsInvMassPtDcazMinDcazMaxFlag[iCut] = new TTree("ESD_Mesons_InvMass_Pt_DcazMin_DcazMax_Flag","ESD_Mesons_InvMass_Pt_DcazMin_DcazMax_Flag"); | |
588 | tESDMesonsInvMassPtDcazMinDcazMaxFlag[iCut]->Branch("InvMass",&fInvMass,"fInvMass/F"); | |
589 | tESDMesonsInvMassPtDcazMinDcazMaxFlag[iCut]->Branch("Pt",&fPt,"fPt/F"); | |
590 | tESDMesonsInvMassPtDcazMinDcazMaxFlag[iCut]->Branch("DcaZMin",&fDCAzGammaMin,"fDCAzGammaMin/F"); | |
591 | tESDMesonsInvMassPtDcazMinDcazMaxFlag[iCut]->Branch("DcaZMax",&fDCAzGammaMax,"fDCAzGammaMax/F"); | |
592 | tESDMesonsInvMassPtDcazMinDcazMaxFlag[iCut]->Branch("kind",&iFlag,"iFlag/b"); | |
593 | if(fIsMC){ | |
594 | tESDMesonsInvMassPtDcazMinDcazMaxFlag[iCut]->Branch("mesonMCInfo",&iMesonMCInfo,"iMesonMCInfo/b"); | |
595 | } | |
596 | fMesonDCAList[iCut]->Add(tESDMesonsInvMassPtDcazMinDcazMaxFlag[iCut]); | |
597 | ||
598 | } | |
599 | if (fDoMesonQA > 0 ){ | |
600 | hESDMotherPi0PtY[iCut] = new TH2F("ESD_MotherPi0_Pt_Y","ESD_MotherPi0_Pt_Y",150,0.03,15.,150,-1.5,1.5); | |
601 | SetLogBinningXTH2(hESDMotherPi0PtY[iCut]); | |
602 | fESDList[iCut]->Add(hESDMotherPi0PtY[iCut]); | |
603 | hESDMotherEtaPtY[iCut] = new TH2F("ESD_MotherEta_Pt_Y","ESD_MotherEta_Pt_Y",150,0.03,15.,150,-1.5,1.5); | |
604 | SetLogBinningXTH2(hESDMotherEtaPtY[iCut]); | |
605 | fESDList[iCut]->Add(hESDMotherEtaPtY[iCut]); | |
606 | hESDMotherPi0PtAlpha[iCut] = new TH2F("ESD_MotherPi0_Pt_Alpha","ESD_MotherPi0_Pt_Alpha",150,0.03,15.,100,0,1); | |
607 | SetLogBinningXTH2(hESDMotherPi0PtAlpha[iCut]); | |
608 | fESDList[iCut]->Add(hESDMotherPi0PtAlpha[iCut]); | |
609 | hESDMotherEtaPtAlpha[iCut] = new TH2F("ESD_MotherEta_Pt_Alpha","ESD_MotherEta_Pt_Alpha",150,0.03,15.,100,0,1); | |
610 | SetLogBinningXTH2(hESDMotherEtaPtAlpha[iCut]); | |
611 | fESDList[iCut]->Add(hESDMotherEtaPtAlpha[iCut]); | |
612 | hESDMotherPi0PtOpenAngle[iCut] = new TH2F("ESD_MotherPi0_Pt_OpenAngle","ESD_MotherPi0_Pt_OpenAngle",150,0.03,15.,200,0,2*TMath::Pi()); | |
613 | SetLogBinningXTH2(hESDMotherPi0PtOpenAngle[iCut]); | |
614 | fESDList[iCut]->Add(hESDMotherPi0PtOpenAngle[iCut]); | |
615 | hESDMotherEtaPtOpenAngle[iCut] = new TH2F("ESD_MotherEta_Pt_OpenAngle","ESD_MotherEta_Pt_OpenAngle",150,0.03,15.,200,0,2*TMath::Pi()); | |
616 | SetLogBinningXTH2(hESDMotherEtaPtOpenAngle[iCut]); | |
617 | fESDList[iCut]->Add(hESDMotherEtaPtOpenAngle[iCut]); | |
618 | } | |
619 | ||
620 | ||
621 | } | |
622 | ||
623 | ||
624 | } | |
625 | if(fDoMesonAnalysis){ | |
626 | InitBack(); // Init Background Handler | |
627 | } | |
628 | ||
629 | if(fIsMC){ | |
630 | // MC Histogramms | |
631 | fMCList = new TList*[fnCuts]; | |
632 | // True Histogramms | |
633 | fTrueList = new TList*[fnCuts]; | |
634 | // Selected Header List | |
635 | fHeaderNameList = new TList*[fnCuts]; | |
636 | hMCHeaders = new TH1I*[fnCuts]; | |
637 | hMCAllGammaPt = new TH1F*[fnCuts]; | |
638 | hMCDecayGammaPi0Pt = new TH1F*[fnCuts]; | |
639 | hMCDecayGammaRhoPt = new TH1F*[fnCuts]; | |
640 | hMCDecayGammaEtaPt = new TH1F*[fnCuts]; | |
641 | hMCDecayGammaOmegaPt = new TH1F*[fnCuts]; | |
642 | hMCDecayGammaEtapPt = new TH1F*[fnCuts]; | |
643 | hMCDecayGammaPhiPt = new TH1F*[fnCuts]; | |
644 | hMCDecayGammaSigmaPt = new TH1F*[fnCuts]; | |
645 | hMCConvGammaPt = new TH1F*[fnCuts]; | |
646 | hESDTrueConvGammaPt = new TH1F*[fnCuts]; | |
647 | ||
648 | hESDCombinatorialPt = new TH2F*[fnCuts]; | |
649 | hESDTruePrimaryConvGammaPt = new TH1F*[fnCuts]; | |
650 | hESDTruePrimaryConvGammaESDPtMCPt = new TH2F*[fnCuts]; | |
651 | hESDTrueSecondaryConvGammaPt = new TH1F*[fnCuts]; | |
652 | hESDTrueSecondaryConvGammaFromXFromK0sPt = new TH1F*[fnCuts]; | |
653 | hESDTrueSecondaryConvGammaFromXFromLambdaPt = new TH1F*[fnCuts]; | |
654 | ||
655 | hESDTrueDalitzPsiPairDeltaPhi= new TH2F*[fnCuts]; | |
656 | hESDTrueGammaPsiPairDeltaPhi= new TH2F*[fnCuts]; | |
657 | ||
658 | if (fDoPhotonQA > 0){ | |
659 | hMCConvGammaR = new TH1F*[fnCuts]; | |
660 | hMCConvGammaEta = new TH1F*[fnCuts]; | |
661 | hESDTrueConvGammaEta = new TH1F*[fnCuts]; | |
662 | } | |
663 | ||
664 | if(fDoMesonAnalysis){ | |
665 | hMCPi0Pt = new TH1F*[fnCuts]; | |
666 | hMCPi0WOWeightPt = new TH1F*[fnCuts]; | |
667 | hMCEtaPt = new TH1F*[fnCuts]; | |
668 | hMCEtaWOWeightPt = new TH1F*[fnCuts]; | |
669 | hMCPi0InAccPt = new TH1F*[fnCuts]; | |
670 | hMCEtaInAccPt = new TH1F*[fnCuts]; | |
671 | ||
672 | hESDTrueMotherInvMassPt = new TH2F*[fnCuts]; | |
673 | hESDTruePrimaryMotherInvMassPt = new TH2F*[fnCuts]; | |
674 | hESDTruePrimaryMotherW0WeightingInvMassPt = new TH2F*[fnCuts]; | |
675 | pESDTruePrimaryMotherWeightsInvMassPt = new TProfile2D*[fnCuts]; | |
676 | hESDTrueSecondaryMotherInvMassPt = new TH2F*[fnCuts]; | |
677 | hESDTrueSecondaryMotherFromK0sInvMassPt = new TH2F*[fnCuts]; | |
678 | hESDTrueSecondaryMotherFromEtaInvMassPt = new TH2F*[fnCuts]; | |
679 | hESDTrueSecondaryMotherFromLambdaInvMassPt = new TH2F*[fnCuts]; | |
680 | hESDTrueMotherDalitzInvMassPt = new TH2F*[fnCuts]; | |
681 | if (fDoMesonQA > 0){ | |
682 | hMCPi0PtY = new TH2F*[fnCuts]; | |
683 | hMCEtaPtY = new TH2F*[fnCuts]; | |
de752898 | 684 | hMCPi0PtAlpha = new TH2F*[fnCuts]; |
685 | hMCEtaPtAlpha = new TH2F*[fnCuts]; | |
d9d6352b | 686 | hMCK0sPt = new TH1F*[fnCuts]; |
687 | hMCK0sWOWeightPt = new TH1F*[fnCuts]; | |
688 | hMCK0sPtY = new TH2F*[fnCuts]; | |
689 | hMCSecPi0PtvsSource= new TH2F*[fnCuts]; | |
690 | hMCSecPi0Source = new TH1F*[fnCuts]; | |
691 | hMCSecEtaPt = new TH1F*[fnCuts]; | |
692 | hMCSecEtaSource = new TH1F*[fnCuts]; | |
693 | hESDTruePrimaryPi0MCPtResolPt = new TH2F*[fnCuts]; | |
694 | hESDTruePrimaryEtaMCPtResolPt = new TH2F*[fnCuts]; | |
695 | hESDTrueK0sWithPi0DaughterMCPt = new TH1F*[fnCuts]; | |
696 | hESDTrueEtaWithPi0DaughterMCPt = new TH1F*[fnCuts]; | |
697 | hESDTrueLambdaWithPi0DaughterMCPt = new TH1F*[fnCuts]; | |
698 | hESDTrueBckGGInvMassPt = new TH2F*[fnCuts]; | |
699 | hESDTrueBckContInvMassPt = new TH2F*[fnCuts]; | |
700 | hESDTruePi0PtY = new TH2F*[fnCuts]; | |
701 | hESDTrueEtaPtY = new TH2F*[fnCuts]; | |
702 | hESDTruePi0PtAlpha = new TH2F*[fnCuts]; | |
703 | hESDTrueEtaPtAlpha = new TH2F*[fnCuts]; | |
704 | hESDTruePi0PtOpenAngle = new TH2F*[fnCuts]; | |
705 | hESDTrueEtaPtOpenAngle = new TH2F*[fnCuts]; | |
706 | } | |
707 | } | |
708 | ||
709 | for(Int_t iCut = 0; iCut<fnCuts;iCut++){ | |
344100c4 | 710 | TString cutstringEvent = ((AliConvEventCuts*)fEventCutArray->At(iCut))->GetCutNumber(); |
711 | TString cutstringPhoton = ((AliConversionPhotonCuts*)fCutArray->At(iCut))->GetCutNumber(); | |
d9d6352b | 712 | TString cutstringMeson = "NoMesonCut"; |
713 | if(fDoMesonAnalysis)cutstringMeson = ((AliConversionMesonCuts*)fMesonCutArray->At(iCut))->GetCutNumber(); | |
714 | ||
715 | fMCList[iCut] = new TList(); | |
344100c4 | 716 | fMCList[iCut]->SetName(Form("%s_%s_%s MC histograms",cutstringEvent.Data() ,cutstringPhoton.Data(),cutstringMeson.Data())); |
d9d6352b | 717 | fMCList[iCut]->SetOwner(kTRUE); |
718 | fCutFolder[iCut]->Add(fMCList[iCut]); | |
719 | hMCHeaders[iCut] = new TH1I("MC_Headers","MC_Headers",20,0,20); | |
720 | fMCList[iCut]->Add(hMCHeaders[iCut]); | |
721 | hMCAllGammaPt[iCut] = new TH1F("MC_AllGamma_Pt","MC_AllGamma_Pt",250,0,25); | |
722 | fMCList[iCut]->Add(hMCAllGammaPt[iCut]); | |
723 | hMCDecayGammaPi0Pt[iCut] = new TH1F("MC_DecayGammaPi0_Pt","MC_DecayGammaPi0_Pt",250,0,25); | |
724 | fMCList[iCut]->Add(hMCDecayGammaPi0Pt[iCut]); | |
725 | hMCDecayGammaRhoPt[iCut] = new TH1F("MC_DecayGammaRho_Pt","MC_DecayGammaRho_Pt",250,0,25); | |
726 | fMCList[iCut]->Add(hMCDecayGammaRhoPt[iCut]); | |
727 | hMCDecayGammaEtaPt[iCut] = new TH1F("MC_DecayGammaEta_Pt","MC_DecayGammaEta_Pt",250,0,25); | |
728 | fMCList[iCut]->Add(hMCDecayGammaEtaPt[iCut]); | |
729 | hMCDecayGammaOmegaPt[iCut] = new TH1F("MC_DecayGammaOmega_Pt","MC_DecayGammaOmmega_Pt",250,0,25); | |
730 | fMCList[iCut]->Add(hMCDecayGammaOmegaPt[iCut]); | |
731 | hMCDecayGammaEtapPt[iCut] = new TH1F("MC_DecayGammaEtap_Pt","MC_DecayGammaEtap_Pt",250,0,25); | |
732 | fMCList[iCut]->Add(hMCDecayGammaEtapPt[iCut]); | |
733 | hMCDecayGammaPhiPt[iCut] = new TH1F("MC_DecayGammaPhi_Pt","MC_DecayGammaPhi_Pt",250,0,25); | |
734 | fMCList[iCut]->Add(hMCDecayGammaPhiPt[iCut]); | |
735 | hMCDecayGammaSigmaPt[iCut] = new TH1F("MC_DecayGammaSigma_Pt","MC_DecayGammaSigma_Pt",250,0,25); | |
736 | fMCList[iCut]->Add(hMCDecayGammaSigmaPt[iCut]); | |
737 | hMCConvGammaPt[iCut] = new TH1F("MC_ConvGamma_Pt","MC_ConvGamma_Pt",250,0,25); | |
738 | fMCList[iCut]->Add(hMCConvGammaPt[iCut]); | |
739 | ||
740 | if (fDoPhotonQA > 0){ | |
741 | hMCConvGammaR[iCut] = new TH1F("MC_ConvGamma_R","MC_ConvGamma_R",800,0,200); | |
742 | fMCList[iCut]->Add(hMCConvGammaR[iCut]); | |
743 | hMCConvGammaEta[iCut] = new TH1F("MC_ConvGamma_Eta","MC_ConvGamma_Eta",2000,-2,2); | |
744 | fMCList[iCut]->Add(hMCConvGammaEta[iCut]); | |
745 | } | |
746 | ||
747 | if(fDoMesonAnalysis){ | |
748 | hMCPi0Pt[iCut] = new TH1F("MC_Pi0_Pt","MC_Pi0_Pt",250,0,25); | |
749 | hMCPi0Pt[iCut]->Sumw2(); | |
750 | fMCList[iCut]->Add(hMCPi0Pt[iCut]); | |
751 | hMCPi0WOWeightPt[iCut] = new TH1F("MC_Pi0_WOWeights_Pt","MC_Pi0_WOWeights_Pt",250,0,25); | |
752 | hMCPi0WOWeightPt[iCut]->Sumw2(); | |
753 | fMCList[iCut]->Add(hMCPi0WOWeightPt[iCut]); | |
754 | ||
755 | hMCEtaPt[iCut] = new TH1F("MC_Eta_Pt","MC_Eta_Pt",250,0,25); | |
756 | hMCEtaPt[iCut]->Sumw2(); | |
757 | fMCList[iCut]->Add(hMCEtaPt[iCut]); | |
758 | hMCEtaWOWeightPt[iCut] = new TH1F("MC_Eta_WOWeights_Pt","MC_Eta_WOWeights_Pt",250,0,25); | |
759 | hMCEtaWOWeightPt[iCut]->Sumw2(); | |
760 | fMCList[iCut]->Add(hMCEtaWOWeightPt[iCut]); | |
761 | hMCPi0InAccPt[iCut] = new TH1F("MC_Pi0InAcc_Pt","MC_Pi0InAcc_Pt",250,0,25); | |
762 | hMCPi0InAccPt[iCut]->Sumw2(); | |
763 | fMCList[iCut]->Add(hMCPi0InAccPt[iCut]); | |
764 | hMCEtaInAccPt[iCut] = new TH1F("MC_EtaInAcc_Pt","MC_EtaInAcc_Pt",250,0,25); | |
765 | hMCEtaInAccPt[iCut]->Sumw2(); | |
766 | fMCList[iCut]->Add(hMCEtaInAccPt[iCut]); | |
767 | if (fDoMesonQA > 0){ | |
768 | hMCPi0PtY[iCut] = new TH2F("MC_Pi0_Pt_Y","MC_Pi0_Pt_Y",150,0.03,15.,150,-1.5,1.5); | |
769 | hMCPi0PtY[iCut]->Sumw2(); | |
770 | SetLogBinningXTH2(hMCPi0PtY[iCut]); | |
771 | fMCList[iCut]->Add(hMCPi0PtY[iCut]); | |
772 | hMCEtaPtY[iCut] = new TH2F("MC_Eta_Pt_Y","MC_Eta_Pt_Y",150,0.03,15.,150,-1.5,1.5); | |
773 | hMCEtaPtY[iCut]->Sumw2(); | |
774 | SetLogBinningXTH2(hMCEtaPtY[iCut]); | |
775 | fMCList[iCut]->Add(hMCEtaPtY[iCut]); | |
de752898 | 776 | hMCPi0PtAlpha[iCut] = new TH2F("MC_Pi0_Pt_Alpha","MC_Pi0_Pt_Alpha",150,0.03,15.,100,0,1); |
777 | SetLogBinningXTH2(hMCPi0PtAlpha[iCut]); | |
778 | fMCList[iCut]->Add(hMCPi0PtAlpha[iCut]); | |
779 | hMCEtaPtAlpha[iCut] = new TH2F("MC_Eta_Pt_Alpha","MC_Eta_Pt_Alpha",150,0.03,15.,100,0,1); | |
780 | SetLogBinningXTH2(hMCEtaPtAlpha[iCut]); | |
781 | fMCList[iCut]->Add(hMCEtaPtAlpha[iCut]); | |
782 | ||
d9d6352b | 783 | hMCK0sPt[iCut] = new TH1F("MC_K0s_Pt","MC_K0s_Pt",150,0,15); |
784 | hMCK0sPt[iCut]->Sumw2(); | |
785 | fMCList[iCut]->Add(hMCK0sPt[iCut]); | |
786 | hMCK0sWOWeightPt[iCut] = new TH1F("MC_K0s_WOWeights_Pt","MC_K0s_WOWeights_Pt",150,0,15); | |
787 | hMCK0sWOWeightPt[iCut]->Sumw2(); | |
788 | fMCList[iCut]->Add(hMCK0sWOWeightPt[iCut]); | |
789 | hMCK0sPtY[iCut] = new TH2F("MC_K0s_Pt_Y","MC_K0s_Pt_Y",150,0.03,15.,150,-1.5,1.5); | |
790 | hMCK0sPtY[iCut]->Sumw2(); | |
791 | SetLogBinningXTH2(hMCK0sPtY[iCut]); | |
792 | fMCList[iCut]->Add(hMCK0sPtY[iCut]); | |
793 | ||
794 | hMCSecPi0Source[iCut] = new TH1F("MC_SecPi0_Source","MC_SecPi0_Source",5000,0.,5000); | |
795 | fMCList[iCut]->Add(hMCSecPi0Source[iCut]); | |
796 | hMCSecEtaSource[iCut] = new TH1F("MC_SecEta_Source","MC_SecEta_Source",5000,0,5000); | |
797 | fMCList[iCut]->Add(hMCSecEtaSource[iCut]); | |
798 | hMCSecPi0PtvsSource[iCut] = new TH2F("MC_SecPi0_Pt_Source","MC_SecPi0_Pt_Source",250,0.0,25.,16,-0.5,15.5); | |
799 | hMCSecPi0PtvsSource[iCut]->Sumw2(); | |
800 | fMCList[iCut]->Add(hMCSecPi0PtvsSource[iCut]); | |
801 | hMCSecEtaPt[iCut] = new TH1F("MC_SecEta_Pt","MC_SecEta_Pt",250,0,25); | |
802 | hMCSecEtaPt[iCut]->Sumw2(); | |
803 | fMCList[iCut]->Add(hMCSecEtaPt[iCut]); | |
804 | } | |
805 | ||
806 | } | |
807 | fTrueList[iCut] = new TList(); | |
344100c4 | 808 | fTrueList[iCut]->SetName(Form("%s_%s_%s True histograms",cutstringEvent.Data() ,cutstringPhoton.Data(),cutstringMeson.Data())); |
d9d6352b | 809 | fTrueList[iCut]->SetOwner(kTRUE); |
810 | fCutFolder[iCut]->Add(fTrueList[iCut]); | |
811 | ||
812 | hESDTrueConvGammaPt[iCut] = new TH1F("ESD_TrueConvGamma_Pt","ESD_TrueConvGamma_Pt",250,0,25); | |
813 | fTrueList[iCut]->Add(hESDTrueConvGammaPt[iCut]); | |
814 | ||
815 | hESDCombinatorialPt[iCut] = new TH2F("ESD_TrueCombinatorial_Pt","ESD_TrueCombinatorial_Pt",250,0,25,16,-0.5,15.5); | |
816 | hESDCombinatorialPt[iCut]->GetYaxis()->SetBinLabel( 1,"Elec+Elec"); | |
817 | hESDCombinatorialPt[iCut]->GetYaxis()->SetBinLabel( 2,"Elec+Pion"); | |
818 | hESDCombinatorialPt[iCut]->GetYaxis()->SetBinLabel( 3,"Elec+Kaon"); | |
819 | hESDCombinatorialPt[iCut]->GetYaxis()->SetBinLabel( 4,"Elec+Proton"); | |
820 | hESDCombinatorialPt[iCut]->GetYaxis()->SetBinLabel( 5,"Elec+Muon"); | |
821 | hESDCombinatorialPt[iCut]->GetYaxis()->SetBinLabel( 6,"Pion+Pion"); | |
822 | hESDCombinatorialPt[iCut]->GetYaxis()->SetBinLabel( 7,"Pion+Kaon"); | |
823 | hESDCombinatorialPt[iCut]->GetYaxis()->SetBinLabel( 8,"Pion+Proton"); | |
824 | hESDCombinatorialPt[iCut]->GetYaxis()->SetBinLabel( 9,"Pion+Muon"); | |
825 | hESDCombinatorialPt[iCut]->GetYaxis()->SetBinLabel(10,"Kaon+Kaon"); | |
826 | hESDCombinatorialPt[iCut]->GetYaxis()->SetBinLabel(11,"Kaon+Proton"); | |
827 | hESDCombinatorialPt[iCut]->GetYaxis()->SetBinLabel(12,"Kaon+Muon"); | |
828 | hESDCombinatorialPt[iCut]->GetYaxis()->SetBinLabel(13,"Proton+Proton"); | |
829 | hESDCombinatorialPt[iCut]->GetYaxis()->SetBinLabel(14,"Proton+Muon"); | |
830 | hESDCombinatorialPt[iCut]->GetYaxis()->SetBinLabel(15,"Muon+Muon"); | |
831 | hESDCombinatorialPt[iCut]->GetYaxis()->SetBinLabel(16,"Rest"); | |
832 | fTrueList[iCut]->Add(hESDCombinatorialPt[iCut]); | |
833 | hESDTruePrimaryConvGammaPt[iCut] = new TH1F("ESD_TruePrimaryConvGamma_Pt","ESD_TruePrimaryConvGamma_Pt",250,0,25); | |
834 | fTrueList[iCut]->Add(hESDTruePrimaryConvGammaPt[iCut]); | |
835 | hESDTrueSecondaryConvGammaPt[iCut] = new TH1F("ESD_TrueSecondaryConvGamma_Pt","ESD_TrueSecondaryConvGamma_Pt",250,0,25); | |
836 | fTrueList[iCut]->Add(hESDTrueSecondaryConvGammaPt[iCut]); | |
837 | ||
838 | hESDTrueSecondaryConvGammaFromXFromK0sPt[iCut] | |
839 | = new TH1F("ESD_TrueSecondaryConvGammaFromXFromK0s_Pt", "ESD_TrueSecondaryConvGammaFromXFromK0s_Pt",250,0,25); | |
840 | fTrueList[iCut]->Add(hESDTrueSecondaryConvGammaFromXFromK0sPt[iCut]); | |
841 | hESDTrueSecondaryConvGammaFromXFromLambdaPt[iCut] | |
842 | = new TH1F("ESD_TrueSecondaryConvGammaFromXFromLambda_Pt", "ESD_TrueSecondaryConvGammaFromXFromLambda_Pt",250,0,25); | |
843 | fTrueList[iCut]->Add(hESDTrueSecondaryConvGammaFromXFromLambdaPt[iCut]); | |
844 | ||
845 | hESDTrueDalitzPsiPairDeltaPhi[iCut] | |
846 | = new TH2F("ESD_TrueDalitzPsiPairDeltaPhi_Pt", "ESD_TrueDalitzPsiPairDeltaPhi_Pt",100,-0.5,2,100,-0.5,0.5); | |
847 | fTrueList[iCut]->Add(hESDTrueDalitzPsiPairDeltaPhi[iCut]); | |
848 | ||
849 | hESDTrueGammaPsiPairDeltaPhi[iCut] | |
850 | = new TH2F("ESD_TrueGammaPsiPairDeltaPhi_Pt", "ESD_TrueGammaPsiPairDeltaPhi_Pt",100,-0.5,2,100,-0.5,0.5); | |
851 | fTrueList[iCut]->Add(hESDTrueGammaPsiPairDeltaPhi[iCut]); | |
852 | ||
853 | hESDTruePrimaryConvGammaESDPtMCPt[iCut] = new TH2F("ESD_TruePrimaryConvGammaESD_PtMCPt", "ESD_TruePrimaryConvGammaESD_PtMCPt",250,0,25,250,0,25); | |
854 | fTrueList[iCut]->Add(hESDTruePrimaryConvGammaESDPtMCPt[iCut]); | |
855 | ||
856 | if(fDoMesonAnalysis){ | |
857 | hESDTrueMotherInvMassPt[iCut] = new TH2F("ESD_TrueMother_InvMass_Pt","ESD_TrueMother_InvMass_Pt",800,0,0.8,250,0,25); | |
858 | fTrueList[iCut]->Add(hESDTrueMotherInvMassPt[iCut]); | |
859 | hESDTruePrimaryMotherInvMassPt[iCut] | |
860 | = new TH2F("ESD_TruePrimaryMother_InvMass_Pt", "ESD_TruePrimaryMother_InvMass_Pt", 800,0,0.8,250,0,25); | |
861 | hESDTruePrimaryMotherInvMassPt[iCut]->Sumw2(); | |
862 | fTrueList[iCut]->Add(hESDTruePrimaryMotherInvMassPt[iCut]); | |
863 | hESDTruePrimaryMotherW0WeightingInvMassPt[iCut] | |
864 | = new TH2F("ESD_TruePrimaryMotherW0Weights_InvMass_Pt", "ESD_TruePrimaryMotherW0Weights_InvMass_Pt", 800,0,0.8,250,0,25); | |
865 | hESDTruePrimaryMotherW0WeightingInvMassPt[iCut]->Sumw2(); | |
866 | fTrueList[iCut]->Add(hESDTruePrimaryMotherW0WeightingInvMassPt[iCut]); | |
867 | pESDTruePrimaryMotherWeightsInvMassPt[iCut] | |
868 | = new TProfile2D("ESD_TruePrimaryMotherWeights_InvMass_Pt", "ESD_TruePrimaryMotherWeights_InvMass_Pt", 800,0,0.8,250,0,25); | |
869 | pESDTruePrimaryMotherWeightsInvMassPt[iCut]->Sumw2(); | |
870 | fTrueList[iCut]->Add(pESDTruePrimaryMotherWeightsInvMassPt[iCut]); | |
871 | hESDTrueSecondaryMotherInvMassPt[iCut] | |
872 | = new TH2F("ESD_TrueSecondaryMother_InvMass_Pt", "ESD_TrueSecondaryMother_InvMass_Pt", 800,0,0.8,250,0,25); | |
873 | hESDTrueSecondaryMotherInvMassPt[iCut]->Sumw2(); | |
874 | fTrueList[iCut]->Add(hESDTrueSecondaryMotherInvMassPt[iCut]); | |
875 | hESDTrueSecondaryMotherFromK0sInvMassPt[iCut] | |
876 | = new TH2F("ESD_TrueSecondaryMotherFromK0s_InvMass_Pt","ESD_TrueSecondaryMotherFromK0s_InvMass_Pt",800,0,0.8,250,0,25); | |
877 | hESDTrueSecondaryMotherFromK0sInvMassPt[iCut]->Sumw2(); | |
878 | fTrueList[iCut]->Add(hESDTrueSecondaryMotherFromK0sInvMassPt[iCut]); | |
879 | hESDTrueSecondaryMotherFromEtaInvMassPt[iCut] | |
880 | = new TH2F("ESD_TrueSecondaryMotherFromEta_InvMass_Pt","ESD_TrueSecondaryMotherFromEta_InvMass_Pt",800,0,0.8,250,0,25); | |
881 | fTrueList[iCut]->Add(hESDTrueSecondaryMotherFromEtaInvMassPt[iCut]); | |
882 | hESDTrueSecondaryMotherFromLambdaInvMassPt[iCut] | |
883 | = new TH2F("ESD_TrueSecondaryMotherFromLambda_InvMass_Pt","ESD_TrueSecondaryMotherFromLambda_InvMass_Pt",800,0,0.8,250,0,25); | |
884 | fTrueList[iCut]->Add(hESDTrueSecondaryMotherFromLambdaInvMassPt[iCut]); | |
885 | hESDTrueMotherDalitzInvMassPt[iCut] = new TH2F("ESD_TrueDalitz_InvMass_Pt","ESD_TrueDalitz_InvMass_Pt",800,0,0.8,250,0,25); | |
886 | fTrueList[iCut]->Add(hESDTrueMotherDalitzInvMassPt[iCut]); | |
887 | if (fDoMesonQA > 0){ | |
888 | hESDTruePrimaryPi0MCPtResolPt[iCut] = new TH2F("ESD_TruePrimaryPi0_MCPt_ResolPt","ESD_TruePrimaryPi0_ResolPt_MCPt",500,0.03,25,1000,-1.,1.); | |
889 | hESDTruePrimaryPi0MCPtResolPt[iCut]->Sumw2(); | |
890 | SetLogBinningXTH2(hESDTruePrimaryPi0MCPtResolPt[iCut]); | |
891 | fTrueList[iCut]->Add(hESDTruePrimaryPi0MCPtResolPt[iCut]); | |
892 | hESDTruePrimaryEtaMCPtResolPt[iCut] = new TH2F("ESD_TruePrimaryEta_MCPt_ResolPt","ESD_TruePrimaryEta_ResolPt_MCPt",500,0.03,25,1000,-1.,1.); | |
893 | hESDTruePrimaryEtaMCPtResolPt[iCut]->Sumw2(); | |
894 | SetLogBinningXTH2(hESDTruePrimaryEtaMCPtResolPt[iCut]); | |
895 | fTrueList[iCut]->Add(hESDTruePrimaryEtaMCPtResolPt[iCut]); | |
896 | hESDTrueBckGGInvMassPt[iCut] = new TH2F("ESD_TrueBckGG_InvMass_Pt","ESD_TrueBckGG_InvMass_Pt",800,0,0.8,250,0,25); | |
897 | fTrueList[iCut]->Add(hESDTrueBckGGInvMassPt[iCut]); | |
898 | hESDTrueBckContInvMassPt[iCut] = new TH2F("ESD_TrueBckCont_InvMass_Pt","ESD_TrueBckCont_InvMass_Pt",800,0,0.8,250,0,25); | |
899 | fTrueList[iCut]->Add(hESDTrueBckContInvMassPt[iCut]); | |
900 | hESDTrueK0sWithPi0DaughterMCPt[iCut] = new TH1F("ESD_TrueK0sWithPi0Daughter_MCPt","ESD_TrueK0sWithPi0Daughter_MCPt",250,0,25); | |
901 | fTrueList[iCut]->Add(hESDTrueK0sWithPi0DaughterMCPt[iCut]); | |
902 | hESDTrueEtaWithPi0DaughterMCPt[iCut] = new TH1F("ESD_TrueEtaWithPi0Daughter_MCPt","ESD_TrueEtaWithPi0Daughter_MCPt",250,0,25); | |
903 | fTrueList[iCut]->Add(hESDTrueEtaWithPi0DaughterMCPt[iCut]); | |
904 | hESDTrueLambdaWithPi0DaughterMCPt[iCut] = new TH1F("ESD_TrueLambdaWithPi0Daughter_MCPt","ESD_TrueLambdaWithPi0Daughter_MCPt",250,0,25); | |
905 | fTrueList[iCut]->Add(hESDTrueLambdaWithPi0DaughterMCPt[iCut]); | |
906 | ||
907 | hESDTruePi0PtY[iCut] = new TH2F("ESD_TruePi0_Pt_Y","ESD_TruePi0_Pt_Y",150,0.03,15.,150,-1.5,1.5); | |
908 | SetLogBinningXTH2(hESDTruePi0PtY[iCut]); | |
909 | fTrueList[iCut]->Add(hESDTruePi0PtY[iCut]); | |
910 | hESDTrueEtaPtY[iCut] = new TH2F("ESD_TrueEta_Pt_Y","ESD_TrueEta_Pt_Y",150,0.03,15.,150,-1.5,1.5); | |
911 | SetLogBinningXTH2(hESDTrueEtaPtY[iCut]); | |
912 | fTrueList[iCut]->Add(hESDTrueEtaPtY[iCut]); | |
913 | hESDTruePi0PtAlpha[iCut] = new TH2F("ESD_TruePi0_Pt_Alpha","ESD_TruePi0_Pt_Alpha",150,0.03,15.,100,0,1); | |
914 | SetLogBinningXTH2(hESDTruePi0PtAlpha[iCut]); | |
915 | fTrueList[iCut]->Add(hESDTruePi0PtAlpha[iCut]); | |
916 | hESDTrueEtaPtAlpha[iCut] = new TH2F("ESD_TrueEta_Pt_Alpha","ESD_TrueEta_Pt_Alpha",150,0.03,15.,100,0,1); | |
917 | SetLogBinningXTH2(hESDTrueEtaPtAlpha[iCut]); | |
918 | fTrueList[iCut]->Add(hESDTrueEtaPtAlpha[iCut]); | |
919 | ||
920 | hESDTruePi0PtOpenAngle[iCut] = new TH2F("ESD_TruePi0_Pt_OpenAngle","ESD_TruePi0_Pt_OpenAngle",150,0.03,15.,200,0,2*TMath::Pi()); | |
921 | SetLogBinningXTH2(hESDTruePi0PtOpenAngle[iCut]); | |
922 | fTrueList[iCut]->Add(hESDTruePi0PtOpenAngle[iCut]); | |
923 | hESDTrueEtaPtOpenAngle[iCut] = new TH2F("ESD_TrueEta_Pt_OpenAngle","ESD_TrueEta_Pt_OpenAngle",150,0.03,15.,200,0,2*TMath::Pi()); | |
924 | SetLogBinningXTH2(hESDTrueEtaPtOpenAngle[iCut]); | |
925 | fTrueList[iCut]->Add(hESDTrueEtaPtOpenAngle[iCut]); | |
926 | ||
927 | hESDTrueConvGammaEta[iCut] = new TH1F("ESD_TrueConvGamma_Eta","ESD_TrueConvGamma_Eta",2000,-2,2); | |
928 | fTrueList[iCut]->Add(hESDTrueConvGammaEta[iCut]); | |
929 | ||
930 | } | |
931 | } | |
932 | } | |
933 | } | |
934 | ||
935 | fV0Reader=(AliV0ReaderV1*)AliAnalysisManager::GetAnalysisManager()->GetTask("V0ReaderV1"); | |
936 | if(!fV0Reader){printf("Error: No V0 Reader");return;} // GetV0Reader | |
937 | ||
938 | if(fV0Reader) | |
344100c4 | 939 | if((AliConvEventCuts*)fV0Reader->GetEventCuts()) |
940 | if(((AliConvEventCuts*)fV0Reader->GetEventCuts())->GetCutHistograms()) | |
941 | fOutputContainer->Add(((AliConvEventCuts*)fV0Reader->GetEventCuts())->GetCutHistograms()); | |
942 | ||
943 | if(fV0Reader) | |
944 | if((AliConversionPhotonCuts*)fV0Reader->GetConversionCuts()) | |
945 | if(((AliConversionPhotonCuts*)fV0Reader->GetConversionCuts())->GetCutHistograms()) | |
946 | fOutputContainer->Add(((AliConversionPhotonCuts*)fV0Reader->GetConversionCuts())->GetCutHistograms()); | |
d9d6352b | 947 | |
948 | for(Int_t iCut = 0; iCut<fnCuts;iCut++){ | |
344100c4 | 949 | if(!((AliConvEventCuts*)fEventCutArray->At(iCut))) continue; |
950 | if(((AliConvEventCuts*)fEventCutArray->At(iCut))->GetCutHistograms()){ | |
951 | fCutFolder[iCut]->Add(((AliConvEventCuts*)fEventCutArray->At(iCut))->GetCutHistograms()); | |
952 | } | |
953 | if(!((AliConversionPhotonCuts*)fCutArray->At(iCut))) continue; | |
954 | if(((AliConversionPhotonCuts*)fCutArray->At(iCut))->GetCutHistograms()){ | |
955 | fCutFolder[iCut]->Add(((AliConversionPhotonCuts*)fCutArray->At(iCut))->GetCutHistograms()); | |
d9d6352b | 956 | } |
957 | if(fDoMesonAnalysis){ | |
958 | if(!((AliConversionMesonCuts*)fMesonCutArray->At(iCut))) continue; | |
959 | if(((AliConversionMesonCuts*)fMesonCutArray->At(iCut))->GetCutHistograms()){ | |
960 | fCutFolder[iCut]->Add(((AliConversionMesonCuts*)fMesonCutArray->At(iCut))->GetCutHistograms()); | |
961 | } | |
962 | } | |
963 | } | |
964 | PostData(1, fOutputContainer); | |
2bb2434e | 965 | } |
11c1e680 | 966 | //_____________________________________________________________________________ |
967 | Bool_t AliAnalysisTaskGammaConvV1::Notify() | |
968 | { | |
344100c4 | 969 | for(Int_t iCut = 0; iCut<fnCuts;iCut++){ |
970 | if(!((AliConvEventCuts*)fEventCutArray->At(iCut))->GetDoEtaShift()){ | |
971 | hEtaShift[iCut]->Fill(0.,(((AliConvEventCuts*)fEventCutArray->At(iCut))->GetEtaShift())); | |
972 | continue; // No Eta Shift requested, continue | |
973 | } | |
974 | if(((AliConvEventCuts*)fEventCutArray->At(iCut))->GetEtaShift() == 0.0){ // Eta Shift requested but not set, get shift automatically | |
975 | ((AliConvEventCuts*)fEventCutArray->At(iCut))->GetCorrectEtaShiftFromPeriod(fV0Reader->GetPeriodName()); | |
976 | hEtaShift[iCut]->Fill(0.,(((AliConvEventCuts*)fEventCutArray->At(iCut))->GetEtaShift())); | |
977 | ((AliConvEventCuts*)fEventCutArray->At(iCut))->DoEtaShift(kFALSE); // Eta Shift Set, make sure that it is called only once | |
978 | continue; | |
979 | } | |
980 | else{ | |
981 | printf(" Gamma Conversion Task %s :: Eta Shift Manually Set to %f \n\n", | |
982 | (((AliConvEventCuts*)fEventCutArray->At(iCut))->GetCutNumber()).Data(),((AliConvEventCuts*)fEventCutArray->At(iCut))->GetEtaShift()); | |
983 | hEtaShift[iCut]->Fill(0.,(((AliConvEventCuts*)fEventCutArray->At(iCut))->GetEtaShift())); | |
984 | ((AliConvEventCuts*)fEventCutArray->At(iCut))->DoEtaShift(kFALSE); // Eta Shift Set, make sure that it is called only once | |
985 | } | |
986 | } | |
987 | return kTRUE; | |
11c1e680 | 988 | } |
2bb2434e | 989 | //_____________________________________________________________________________ |
990 | void AliAnalysisTaskGammaConvV1::UserExec(Option_t *) | |
991 | { | |
344100c4 | 992 | // |
993 | // Called for each event | |
994 | // | |
995 | Int_t eventQuality = ((AliConvEventCuts*)fV0Reader->GetEventCuts())->GetEventQuality(); | |
996 | if(eventQuality == 2 || eventQuality == 3){// Event Not Accepted due to MC event missing or wrong trigger for V0ReaderV1 | |
997 | for(Int_t iCut = 0; iCut<fnCuts; iCut++){ | |
998 | hNEvents[iCut]->Fill(eventQuality); | |
999 | } | |
1000 | return; | |
1001 | } | |
ae947965 | 1002 | |
344100c4 | 1003 | if(fIsMC) fMCEvent = MCEvent(); |
1004 | if(fMCEvent == NULL) fIsMC = kFALSE; | |
1005 | ||
1006 | fInputEvent = InputEvent(); | |
e5b6e8a6 | 1007 | |
344100c4 | 1008 | if(fIsMC && fInputEvent->IsA()==AliESDEvent::Class()){ |
1009 | fMCStack = fMCEvent->Stack(); | |
1010 | if(fMCStack == NULL) fIsMC = kFALSE; | |
1011 | } | |
e5b6e8a6 | 1012 | |
344100c4 | 1013 | fReaderGammas = fV0Reader->GetReconstructedGammas(); // Gammas from default Cut |
1014 | ||
1015 | // ------------------- BeginEvent ---------------------------- | |
1016 | ||
1017 | AliEventplane *EventPlane = fInputEvent->GetEventplane(); | |
1018 | if(fIsHeavyIon ==1)fEventPlaneAngle = EventPlane->GetEventplane("V0",fInputEvent,2); | |
1019 | else fEventPlaneAngle=0.0; | |
1020 | ||
1021 | if(fIsMC && fInputEvent->IsA()==AliAODEvent::Class() && !(fV0Reader->AreAODsRelabeled())){ | |
1022 | RelabelAODPhotonCandidates(kTRUE); // In case of AODMC relabeling MC | |
1023 | fV0Reader->RelabelAODs(kTRUE); | |
1024 | } | |
1025 | for(Int_t iCut = 0; iCut<fnCuts; iCut++){ | |
1026 | fiCut = iCut; | |
1027 | Int_t eventNotAccepted = | |
1028 | ((AliConvEventCuts*)fEventCutArray->At(iCut)) | |
1029 | ->IsEventAcceptedByCut(fV0Reader->GetEventCuts(),fInputEvent,fMCEvent,fIsHeavyIon); | |
1030 | if(eventNotAccepted){ | |
1031 | // cout << "event rejected due to wrong trigger: " <<eventNotAccepted << endl; | |
1032 | hNEvents[iCut]->Fill(eventNotAccepted); // Check Centrality, PileUp, SDD and V0AND --> Not Accepted => eventQuality = 1 | |
1033 | continue; | |
1034 | } | |
1035 | ||
1036 | if(eventQuality != 0){// Event Not Accepted | |
1037 | // cout << "event rejected due to: " <<eventQuality << endl; | |
1038 | hNEvents[iCut]->Fill(eventQuality); | |
1039 | continue; | |
1040 | } | |
1041 | ||
1042 | hNEvents[iCut]->Fill(eventQuality); // Should be 0 here | |
1043 | hNGoodESDTracks[iCut]->Fill(fV0Reader->GetNumberOfPrimaryTracks()); | |
1044 | if(((AliConvEventCuts*)fEventCutArray->At(iCut))->IsHeavyIon() == 2) hNV0Tracks[iCut]->Fill(fInputEvent->GetVZEROData()->GetMTotV0A()); | |
1045 | else hNV0Tracks[iCut]->Fill(fInputEvent->GetVZEROData()->GetMTotV0A()+fInputEvent->GetVZEROData()->GetMTotV0C()); | |
1046 | ||
1047 | if(fIsMC){ | |
1048 | // Process MC Particle | |
1049 | if(((AliConvEventCuts*)fEventCutArray->At(iCut))->GetSignalRejection() != 0){ | |
1050 | if(fInputEvent->IsA()==AliESDEvent::Class()){ | |
1051 | ((AliConvEventCuts*)fEventCutArray->At(iCut))->GetNotRejectedParticles(((AliConvEventCuts*)fEventCutArray->At(iCut))->GetSignalRejection(), | |
1052 | ((AliConvEventCuts*)fEventCutArray->At(iCut))->GetAcceptedHeader(), | |
1053 | fMCEvent); | |
1054 | } | |
1055 | else if(fInputEvent->IsA()==AliAODEvent::Class()){ | |
1056 | ((AliConvEventCuts*)fEventCutArray->At(iCut))->GetNotRejectedParticles(((AliConvEventCuts*)fEventCutArray->At(iCut))->GetSignalRejection(), | |
1057 | ((AliConvEventCuts*)fEventCutArray->At(iCut))->GetAcceptedHeader(), | |
1058 | fInputEvent); | |
1059 | } | |
1060 | ||
1061 | if(((AliConvEventCuts*)fEventCutArray->At(iCut))->GetAcceptedHeader()){ | |
1062 | for(Int_t i = 0;i<(((AliConvEventCuts*)fEventCutArray->At(iCut))->GetAcceptedHeader())->GetEntries();i++){ | |
1063 | TString nameBin= hMCHeaders[iCut]->GetXaxis()->GetBinLabel(i+1); | |
1064 | if (nameBin.CompareTo("")== 0){ | |
1065 | TString nameHeader = ((TObjString*)((TList*)((AliConvEventCuts*)fEventCutArray->At(iCut)) | |
1066 | ->GetAcceptedHeader())->At(i))->GetString(); | |
b5d519c0 | 1067 | // cout << nameHeader << endl; |
344100c4 | 1068 | hMCHeaders[iCut]->GetXaxis()->SetBinLabel(i+1,nameHeader.Data()); |
1069 | } | |
1070 | } | |
1071 | } | |
1072 | } | |
1073 | } | |
1074 | if(fIsMC){ | |
1075 | if(fInputEvent->IsA()==AliESDEvent::Class()) | |
1076 | ProcessMCParticles(); | |
1077 | if(fInputEvent->IsA()==AliAODEvent::Class()) | |
1078 | ProcessAODMCParticles(); | |
1079 | } | |
1080 | ||
1081 | ProcessPhotonCandidates(); // Process this cuts gammas | |
1082 | ||
1083 | hNGammaCandidates[iCut]->Fill(fGammaCandidates->GetEntries()); | |
1084 | hNGoodESDTracksVsNGammaCanditates[iCut]->Fill(fV0Reader->GetNumberOfPrimaryTracks(),fGammaCandidates->GetEntries()); | |
1085 | if(fDoMesonAnalysis){ // Meson Analysis | |
1086 | if(((AliConversionMesonCuts*)fMesonCutArray->At(iCut))->UseMCPSmearing() && fIsMC){ | |
1087 | fUnsmearedPx = new Double_t[fGammaCandidates->GetEntries()]; // Store unsmeared Momenta | |
1088 | fUnsmearedPy = new Double_t[fGammaCandidates->GetEntries()]; | |
1089 | fUnsmearedPz = new Double_t[fGammaCandidates->GetEntries()]; | |
1090 | fUnsmearedE = new Double_t[fGammaCandidates->GetEntries()]; | |
1091 | ||
1092 | for(Int_t gamma=0;gamma<fGammaCandidates->GetEntries();gamma++){ // Smear the AODPhotons in MC | |
1093 | fUnsmearedPx[gamma] = ((AliAODConversionPhoton*)fGammaCandidates->At(gamma))->Px(); | |
1094 | fUnsmearedPy[gamma] = ((AliAODConversionPhoton*)fGammaCandidates->At(gamma))->Py(); | |
1095 | fUnsmearedPz[gamma] = ((AliAODConversionPhoton*)fGammaCandidates->At(gamma))->Pz(); | |
1096 | fUnsmearedE[gamma] = ((AliAODConversionPhoton*)fGammaCandidates->At(gamma))->E(); | |
1097 | ((AliConversionMesonCuts*)fMesonCutArray->At(iCut))->SmearParticle(dynamic_cast<AliAODConversionPhoton*>(fGammaCandidates->At(gamma))); | |
1098 | } | |
1099 | } | |
1100 | ||
1101 | CalculatePi0Candidates(); // Combine Gammas | |
1102 | if(((AliConversionMesonCuts*)fMesonCutArray->At(iCut))->DoBGCalculation()){ | |
1103 | if(((AliConversionMesonCuts*)fMesonCutArray->At(iCut))->BackgroundHandlerType() == 0){ | |
1104 | CalculateBackground(); // Combinatorial Background | |
1105 | UpdateEventByEventData(); // Store Event for mixed Events | |
1106 | } | |
1107 | else{ | |
1108 | CalculateBackgroundRP(); // Combinatorial Background | |
1109 | fBGHandlerRP[iCut]->AddEvent(fGammaCandidates,fInputEvent); // Store Event for mixed Events | |
1110 | } | |
1111 | } | |
1112 | if(((AliConversionMesonCuts*)fMesonCutArray->At(iCut))->UseMCPSmearing() && fIsMC){ | |
1113 | for(Int_t gamma=0;gamma<fGammaCandidates->GetEntries();gamma++){ // Smear the AODPhotons in MC | |
1114 | ((AliAODConversionPhoton*)fGammaCandidates->At(gamma))->SetPx(fUnsmearedPx[gamma]); // Reset Unsmeared Momenta | |
1115 | ((AliAODConversionPhoton*)fGammaCandidates->At(gamma))->SetPy(fUnsmearedPy[gamma]); | |
1116 | ((AliAODConversionPhoton*)fGammaCandidates->At(gamma))->SetPz(fUnsmearedPz[gamma]); | |
1117 | ((AliAODConversionPhoton*)fGammaCandidates->At(gamma))->SetE(fUnsmearedE[gamma]); | |
1118 | } | |
1119 | delete[] fUnsmearedPx; fUnsmearedPx = 0x0; | |
1120 | delete[] fUnsmearedPy; fUnsmearedPy = 0x0; | |
1121 | delete[] fUnsmearedPz; fUnsmearedPz = 0x0; | |
1122 | delete[] fUnsmearedE; fUnsmearedE = 0x0; | |
1123 | } | |
1124 | } | |
1125 | fGammaCandidates->Clear(); // delete this cuts good gammas | |
1126 | } | |
1127 | ||
1128 | if(fIsMC && fInputEvent->IsA()==AliAODEvent::Class() && !(fV0Reader->AreAODsRelabeled())){ | |
1129 | RelabelAODPhotonCandidates(kFALSE); // Back to ESDMC Label | |
1130 | fV0Reader->RelabelAODs(kFALSE); | |
1131 | } | |
1132 | ||
1133 | PostData(1, fOutputContainer); | |
2bb2434e | 1134 | } |
1135 | //________________________________________________________________________ | |
1136 | void AliAnalysisTaskGammaConvV1::ProcessPhotonCandidates() | |
1137 | { | |
344100c4 | 1138 | Int_t nV0 = 0; |
1139 | TList *GammaCandidatesStepOne = new TList(); | |
1140 | TList *GammaCandidatesStepTwo = new TList(); | |
1141 | // Loop over Photon Candidates allocated by ReaderV1 | |
1142 | for(Int_t i = 0; i < fReaderGammas->GetEntriesFast(); i++){ | |
1143 | AliAODConversionPhoton* PhotonCandidate = (AliAODConversionPhoton*) fReaderGammas->At(i); | |
1144 | if(!PhotonCandidate) continue; | |
1145 | fIsFromMBHeader = kTRUE; | |
1146 | if(fIsMC && ((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetSignalRejection() != 0){ | |
1147 | Int_t isPosFromMBHeader | |
1148 | = ((AliConvEventCuts*)fEventCutArray->At(fiCut))->IsParticleFromBGEvent(PhotonCandidate->GetMCLabelPositive(), fMCStack, fInputEvent); | |
1149 | if(isPosFromMBHeader == 0 && ((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetSignalRejection() != 3) continue; | |
1150 | Int_t isNegFromMBHeader | |
1151 | = ((AliConvEventCuts*)fEventCutArray->At(fiCut))->IsParticleFromBGEvent(PhotonCandidate->GetMCLabelNegative(), fMCStack, fInputEvent); | |
1152 | if(isNegFromMBHeader == 0 && ((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetSignalRejection() != 3) continue; | |
1153 | ||
1154 | if( (isNegFromMBHeader+isPosFromMBHeader) != 4) fIsFromMBHeader = kFALSE; | |
1155 | } | |
1156 | ||
1157 | if(!((AliConversionPhotonCuts*)fCutArray->At(fiCut))->PhotonIsSelected(PhotonCandidate,fInputEvent)) continue; | |
1158 | if(!((AliConversionPhotonCuts*)fCutArray->At(fiCut))->InPlaneOutOfPlaneCut(PhotonCandidate->GetPhotonPhi(),fEventPlaneAngle)) continue; | |
1159 | if(!((AliConversionPhotonCuts*)fCutArray->At(fiCut))->UseElecSharingCut() && | |
1160 | !((AliConversionPhotonCuts*)fCutArray->At(fiCut))->UseToCloseV0sCut()){ | |
1161 | fGammaCandidates->Add(PhotonCandidate); // if no second loop is required add to events good gammas | |
1162 | ||
1163 | if(fIsFromMBHeader){ | |
1164 | hESDConvGammaPt[fiCut]->Fill(PhotonCandidate->Pt()); | |
1165 | if (fDoPhotonQA > 0){ | |
1166 | hESDConvGammaR[fiCut]->Fill(PhotonCandidate->GetConversionRadius()); | |
1167 | hESDConvGammaEta[fiCut]->Fill(PhotonCandidate->Eta()); | |
1168 | } | |
1169 | } | |
1170 | if(fIsMC){ | |
1171 | if(fInputEvent->IsA()==AliESDEvent::Class()) | |
1172 | ProcessTruePhotonCandidates(PhotonCandidate); | |
1173 | if(fInputEvent->IsA()==AliAODEvent::Class()) | |
1174 | ProcessTruePhotonCandidatesAOD(PhotonCandidate); | |
1175 | } | |
1176 | if (fIsFromMBHeader && fDoPhotonQA == 2){ | |
1177 | if (fIsHeavyIon == 1 && PhotonCandidate->Pt() > 0.399 && PhotonCandidate->Pt() < 12.){ | |
1178 | fPtGamma = PhotonCandidate->Pt(); | |
1179 | fDCAzPhoton = PhotonCandidate->GetDCAzToPrimVtx(); | |
1180 | fRConvPhoton = PhotonCandidate->GetConversionRadius(); | |
1181 | fEtaPhoton = PhotonCandidate->GetPhotonEta(); | |
1182 | iCatPhoton = PhotonCandidate->GetPhotonQuality(); | |
1183 | tESDConvGammaPtDcazCat[fiCut]->Fill(); | |
1184 | } else if ( PhotonCandidate->Pt() > 0.299 && PhotonCandidate->Pt() < 16.){ | |
1185 | fPtGamma = PhotonCandidate->Pt(); | |
1186 | fDCAzPhoton = PhotonCandidate->GetDCAzToPrimVtx(); | |
1187 | fRConvPhoton = PhotonCandidate->GetConversionRadius(); | |
1188 | fEtaPhoton = PhotonCandidate->GetPhotonEta(); | |
1189 | iCatPhoton = PhotonCandidate->GetPhotonQuality(); | |
1190 | tESDConvGammaPtDcazCat[fiCut]->Fill(); | |
1191 | } | |
1192 | } | |
1193 | } else if(((AliConversionPhotonCuts*)fCutArray->At(fiCut))->UseElecSharingCut()){ // if Shared Electron cut is enabled, Fill array, add to step one | |
1194 | ((AliConversionPhotonCuts*)fCutArray->At(fiCut))->FillElectonLabelArray(PhotonCandidate,nV0); | |
1195 | nV0++; | |
1196 | GammaCandidatesStepOne->Add(PhotonCandidate); | |
1197 | } else if(!((AliConversionPhotonCuts*)fCutArray->At(fiCut))->UseElecSharingCut() && | |
1198 | ((AliConversionPhotonCuts*)fCutArray->At(fiCut))->UseToCloseV0sCut()){ // shared electron is disabled, step one not needed -> step two | |
1199 | GammaCandidatesStepTwo->Add(PhotonCandidate); | |
1200 | } | |
1201 | } | |
1202 | if(((AliConversionPhotonCuts*)fCutArray->At(fiCut))->UseElecSharingCut()){ | |
1203 | for(Int_t i = 0;i<GammaCandidatesStepOne->GetEntries();i++){ | |
1204 | AliAODConversionPhoton *PhotonCandidate= (AliAODConversionPhoton*) GammaCandidatesStepOne->At(i); | |
1205 | if(!PhotonCandidate) continue; | |
1206 | fIsFromMBHeader = kTRUE; | |
1207 | if(fMCStack && ((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetSignalRejection() != 0){ | |
1208 | Int_t isPosFromMBHeader | |
1209 | = ((AliConvEventCuts*)fEventCutArray->At(fiCut))->IsParticleFromBGEvent(PhotonCandidate->GetMCLabelPositive(), fMCStack, fInputEvent); | |
1210 | Int_t isNegFromMBHeader | |
1211 | = ((AliConvEventCuts*)fEventCutArray->At(fiCut))->IsParticleFromBGEvent(PhotonCandidate->GetMCLabelNegative(), fMCStack, fInputEvent); | |
1212 | if( (isNegFromMBHeader+isPosFromMBHeader) != 4) fIsFromMBHeader = kFALSE; | |
1213 | } | |
1214 | if(!((AliConversionPhotonCuts*)fCutArray->At(fiCut))->RejectSharedElectronV0s(PhotonCandidate,i,GammaCandidatesStepOne->GetEntries())) continue; | |
1215 | if(!((AliConversionPhotonCuts*)fCutArray->At(fiCut))->UseToCloseV0sCut()){ // To Colse v0s cut diabled, step two not needed | |
1216 | fGammaCandidates->Add(PhotonCandidate); | |
1217 | if(fIsFromMBHeader){ | |
1218 | hESDConvGammaPt[fiCut]->Fill(PhotonCandidate->Pt()); | |
1219 | if (fDoPhotonQA > 0){ | |
1220 | hESDConvGammaR[fiCut]->Fill(PhotonCandidate->GetConversionRadius()); | |
1221 | hESDConvGammaEta[fiCut]->Fill(PhotonCandidate->Eta()); | |
1222 | } | |
1223 | } | |
1224 | } | |
1225 | if(fIsMC){ | |
1226 | if(fInputEvent->IsA()==AliESDEvent::Class()) | |
1227 | ProcessTruePhotonCandidates(PhotonCandidate); | |
1228 | if(fInputEvent->IsA()==AliAODEvent::Class()) | |
1229 | ProcessTruePhotonCandidatesAOD(PhotonCandidate); | |
1230 | } else GammaCandidatesStepTwo->Add(PhotonCandidate); // Close v0s cut enabled -> add to list two | |
1231 | ||
1232 | if (fIsFromMBHeader && fDoPhotonQA == 2){ | |
1233 | if (fIsHeavyIon ==1 && PhotonCandidate->Pt() > 0.399 && PhotonCandidate->Pt() < 12.){ | |
1234 | fPtGamma = PhotonCandidate->Pt(); | |
1235 | fDCAzPhoton = PhotonCandidate->GetDCAzToPrimVtx(); | |
1236 | fRConvPhoton = PhotonCandidate->GetConversionRadius(); | |
1237 | fEtaPhoton = PhotonCandidate->GetPhotonEta(); | |
1238 | iCatPhoton = PhotonCandidate->GetPhotonQuality(); | |
1239 | tESDConvGammaPtDcazCat[fiCut]->Fill(); | |
1240 | } else if ( PhotonCandidate->Pt() > 0.299 && PhotonCandidate->Pt() < 16.){ | |
1241 | fPtGamma = PhotonCandidate->Pt(); | |
1242 | fDCAzPhoton = PhotonCandidate->GetDCAzToPrimVtx(); | |
1243 | fRConvPhoton = PhotonCandidate->GetConversionRadius(); | |
1244 | fEtaPhoton = PhotonCandidate->GetPhotonEta(); | |
1245 | iCatPhoton = PhotonCandidate->GetPhotonQuality(); | |
1246 | tESDConvGammaPtDcazCat[fiCut]->Fill(); | |
1247 | } | |
1248 | } | |
1249 | } | |
1250 | } | |
1251 | if(((AliConversionPhotonCuts*)fCutArray->At(fiCut))->UseToCloseV0sCut()){ | |
1252 | for(Int_t i = 0;i<GammaCandidatesStepTwo->GetEntries();i++){ | |
1253 | AliAODConversionPhoton* PhotonCandidate = (AliAODConversionPhoton*) GammaCandidatesStepTwo->At(i); | |
1254 | if(!PhotonCandidate) continue; | |
1255 | fIsFromMBHeader = kTRUE; | |
1256 | if(fMCStack && ((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetSignalRejection() != 0){ | |
1257 | Int_t isPosFromMBHeader | |
1258 | = ((AliConvEventCuts*)fEventCutArray->At(fiCut))->IsParticleFromBGEvent(PhotonCandidate->GetMCLabelPositive(), fMCStack, fInputEvent); | |
1259 | Int_t isNegFromMBHeader | |
1260 | = ((AliConvEventCuts*)fEventCutArray->At(fiCut))->IsParticleFromBGEvent(PhotonCandidate->GetMCLabelNegative(), fMCStack, fInputEvent); | |
1261 | if( (isNegFromMBHeader+isPosFromMBHeader) != 4) fIsFromMBHeader = kFALSE; | |
1262 | } | |
1263 | if(!((AliConversionPhotonCuts*)fCutArray->At(fiCut))->RejectToCloseV0s(PhotonCandidate,GammaCandidatesStepTwo,i)) continue; | |
1264 | fGammaCandidates->Add(PhotonCandidate); // Add gamma to current cut TList | |
1265 | if(fIsFromMBHeader){ | |
1266 | hESDConvGammaPt[fiCut]->Fill(PhotonCandidate->Pt()); | |
1267 | if (fDoPhotonQA > 0){ | |
1268 | hESDConvGammaR[fiCut]->Fill(PhotonCandidate->GetConversionRadius()); | |
1269 | hESDConvGammaEta[fiCut]->Fill(PhotonCandidate->Eta()); | |
1270 | } | |
1271 | } | |
1272 | if(fIsMC){ | |
1273 | if(fInputEvent->IsA()==AliESDEvent::Class()) | |
1274 | ProcessTruePhotonCandidates(PhotonCandidate); | |
1275 | if(fInputEvent->IsA()==AliAODEvent::Class()) | |
1276 | ProcessTruePhotonCandidatesAOD(PhotonCandidate); | |
1277 | } | |
1278 | if (fIsFromMBHeader){ | |
1279 | if (fIsHeavyIon == 1 && PhotonCandidate->Pt() > 0.399 && PhotonCandidate->Pt() < 12.){ | |
1280 | fPtGamma = PhotonCandidate->Pt(); | |
1281 | fDCAzPhoton = PhotonCandidate->GetDCAzToPrimVtx(); | |
1282 | fRConvPhoton = PhotonCandidate->GetConversionRadius(); | |
1283 | fEtaPhoton = PhotonCandidate->GetPhotonEta(); | |
1284 | iCatPhoton = PhotonCandidate->GetPhotonQuality(); | |
1285 | tESDConvGammaPtDcazCat[fiCut]->Fill(); | |
1286 | } else if ( PhotonCandidate->Pt() > 0.299 && PhotonCandidate->Pt() < 16.){ | |
1287 | fPtGamma = PhotonCandidate->Pt(); | |
1288 | fDCAzPhoton = PhotonCandidate->GetDCAzToPrimVtx(); | |
1289 | fRConvPhoton = PhotonCandidate->GetConversionRadius(); | |
1290 | fEtaPhoton = PhotonCandidate->GetPhotonEta(); | |
1291 | iCatPhoton = PhotonCandidate->GetPhotonQuality(); | |
1292 | tESDConvGammaPtDcazCat[fiCut]->Fill(); | |
1293 | } | |
1294 | } | |
1295 | } | |
1296 | } | |
1297 | ||
1298 | delete GammaCandidatesStepOne; | |
1299 | GammaCandidatesStepOne = 0x0; | |
1300 | delete GammaCandidatesStepTwo; | |
1301 | GammaCandidatesStepTwo = 0x0; | |
2bb2434e | 1302 | |
ae947965 | 1303 | } |
1304 | //________________________________________________________________________ | |
1305 | void AliAnalysisTaskGammaConvV1::ProcessTruePhotonCandidatesAOD(AliAODConversionPhoton *TruePhotonCandidate) | |
1306 | { | |
85b56575 | 1307 | Double_t magField = fInputEvent->GetMagneticField(); |
1308 | if( magField < 0.0 ){ | |
1309 | magField = 1.0; | |
1310 | } | |
1311 | else { | |
1312 | magField = -1.0; | |
1313 | } | |
ae947965 | 1314 | |
85b56575 | 1315 | TClonesArray *AODMCTrackArray = dynamic_cast<TClonesArray*>(fInputEvent->FindListObject(AliAODMCParticle::StdBranchName())); |
1316 | if (AODMCTrackArray != NULL && TruePhotonCandidate != NULL){ | |
ae947965 | 1317 | |
85b56575 | 1318 | AliAODMCParticle *posDaughter = (AliAODMCParticle*) AODMCTrackArray->At(TruePhotonCandidate->GetMCLabelPositive()); |
1319 | AliAODMCParticle *negDaughter = (AliAODMCParticle*) AODMCTrackArray->At(TruePhotonCandidate->GetMCLabelNegative()); | |
1320 | iPhotonMCInfo = 0; | |
1321 | ||
1322 | if(posDaughter == NULL || negDaughter == NULL) return; // One particle does not exist | |
1323 | Int_t pdgCode[2] = {abs(posDaughter->GetPdgCode()),abs(negDaughter->GetPdgCode())}; | |
ae947965 | 1324 | |
85b56575 | 1325 | if(posDaughter->GetMother() != negDaughter->GetMother()){ |
1326 | FillPhotonCombinatorialBackgroundHist(TruePhotonCandidate, pdgCode); | |
1327 | iPhotonMCInfo = 1; | |
1328 | return; | |
1329 | } | |
1330 | else if(posDaughter->GetMother() == -1){ | |
1331 | FillPhotonCombinatorialBackgroundHist(TruePhotonCandidate, pdgCode); | |
1332 | iPhotonMCInfo = 1; | |
1333 | return; | |
1334 | } | |
1390f698 | 1335 | |
85b56575 | 1336 | if(pdgCode[0]!=11 || pdgCode[1]!=11){ |
1337 | iPhotonMCInfo = 1; | |
1338 | return; //One Particle is not a electron | |
1339 | } | |
1340 | if(posDaughter->GetPdgCode()==negDaughter->GetPdgCode()){ | |
1341 | iPhotonMCInfo = 1; | |
1342 | return; // Same Charge | |
1343 | } | |
1344 | ||
1345 | AliAODMCParticle *Photon = (AliAODMCParticle*) AODMCTrackArray->At(posDaughter->GetMother()); | |
344100c4 | 1346 | AliVTrack * electronCandidate = ((AliConversionPhotonCuts*)fCutArray->At(fiCut))->GetTrack(fInputEvent,TruePhotonCandidate->GetTrackLabelNegative() ); |
1347 | AliVTrack * positronCandidate = ((AliConversionPhotonCuts*)fCutArray->At(fiCut))->GetTrack(fInputEvent,TruePhotonCandidate->GetTrackLabelPositive() ); | |
85b56575 | 1348 | Double_t deltaPhi = magField * TVector2::Phi_mpi_pi( electronCandidate->Phi()-positronCandidate->Phi()); |
1349 | ||
1350 | if(Photon->GetPdgCode() != 22){ | |
1351 | hESDTrueDalitzPsiPairDeltaPhi[fiCut]->Fill(deltaPhi,TruePhotonCandidate->GetPsiPair()); | |
1352 | iPhotonMCInfo = 1; | |
1353 | return; // Mother is no Photon | |
1354 | } | |
1355 | ||
1356 | if(((posDaughter->GetMCProcessCode())) != 5 || ((negDaughter->GetMCProcessCode())) != 5){ | |
1357 | iPhotonMCInfo = 1; | |
1358 | return;// check if the daughters come from a conversion | |
1359 | } | |
1360 | // STILL A BUG IN ALIROOT >>8 HAS TPO BE REMOVED AFTER FIX | |
1361 | ||
1362 | ||
1363 | ||
1364 | // True Photon | |
1365 | if(fIsFromMBHeader){ | |
1366 | hESDTrueConvGammaPt[fiCut]->Fill(TruePhotonCandidate->Pt()); | |
1367 | if (fDoPhotonQA > 0) hESDTrueConvGammaEta[fiCut]->Fill(TruePhotonCandidate->Eta()); | |
1368 | } | |
1369 | hESDTrueGammaPsiPairDeltaPhi[fiCut]->Fill(deltaPhi,TruePhotonCandidate->GetPsiPair()); | |
1370 | if(Photon->IsPrimary()){ | |
1371 | // Count just primary MC Gammas as true --> For Ratio esdtruegamma / mcconvgamma | |
1372 | if(fIsFromMBHeader){ | |
1373 | iPhotonMCInfo = 6; | |
1374 | hESDTruePrimaryConvGammaPt[fiCut]->Fill(TruePhotonCandidate->Pt()); | |
1375 | hESDTruePrimaryConvGammaESDPtMCPt[fiCut]->Fill(TruePhotonCandidate->Pt(),Photon->Pt()); // Allways Filled | |
1376 | } | |
1377 | // (Not Filled for i6, Extra Signal Gamma (parambox) are secondary) | |
1378 | } | |
1379 | else{ | |
1380 | if(fIsFromMBHeader){ | |
1381 | hESDTrueSecondaryConvGammaPt[fiCut]->Fill(TruePhotonCandidate->Pt()); | |
1382 | iPhotonMCInfo = 2; | |
1383 | if(((AliAODMCParticle*)AODMCTrackArray->At(Photon->GetMother()))->GetMother() > -1 && | |
1384 | ((AliAODMCParticle*)AODMCTrackArray->At(((AliAODMCParticle*)AODMCTrackArray->At(Photon->GetMother()))->GetMother()))->GetPdgCode() == 3122){ | |
1385 | iPhotonMCInfo = 5; | |
1386 | hESDTrueSecondaryConvGammaFromXFromLambdaPt[fiCut]->Fill(TruePhotonCandidate->Pt()); | |
1387 | } | |
1388 | if(((AliAODMCParticle*)AODMCTrackArray->At(Photon->GetMother()))->GetMother() > -1 && | |
1389 | ((AliAODMCParticle*)AODMCTrackArray->At(((AliAODMCParticle*)AODMCTrackArray->At(Photon->GetMother()))->GetMother()))->GetPdgCode() == 310){ | |
1390 | iPhotonMCInfo = 4; | |
1391 | hESDTrueSecondaryConvGammaFromXFromK0sPt[fiCut]->Fill(TruePhotonCandidate->Pt()); | |
1392 | } | |
1393 | if(((AliAODMCParticle*)AODMCTrackArray->At(Photon->GetMother()))->GetMother() > -1 && | |
1394 | ((AliAODMCParticle*)AODMCTrackArray->At(((AliAODMCParticle*)AODMCTrackArray->At(Photon->GetMother()))->GetMother()))->GetPdgCode() == 221){ | |
1395 | iPhotonMCInfo = 3; | |
1396 | } | |
1397 | } | |
1398 | } | |
1399 | } | |
1400 | return; | |
2bb2434e | 1401 | } |
1402 | //________________________________________________________________________ | |
1403 | void AliAnalysisTaskGammaConvV1::ProcessTruePhotonCandidates(AliAODConversionPhoton *TruePhotonCandidate) | |
1404 | { | |
344100c4 | 1405 | |
1406 | Double_t magField = fInputEvent->GetMagneticField(); | |
1407 | if( magField < 0.0 ){ | |
1408 | magField = 1.0; | |
1409 | } | |
1410 | else { | |
1411 | magField = -1.0; | |
1412 | } | |
e5b6e8a6 | 1413 | |
344100c4 | 1414 | // Process True Photons |
1415 | TParticle *posDaughter = TruePhotonCandidate->GetPositiveMCDaughter(fMCStack); | |
1416 | TParticle *negDaughter = TruePhotonCandidate->GetNegativeMCDaughter(fMCStack); | |
2bb2434e | 1417 | |
344100c4 | 1418 | iPhotonMCInfo = 0; |
1419 | ||
1420 | if(posDaughter == NULL || negDaughter == NULL) return; // One particle does not exist | |
1421 | Int_t pdgCode[2] = {abs(posDaughter->GetPdgCode()),abs(negDaughter->GetPdgCode())}; | |
1422 | iPhotonMCInfo = 1; | |
1423 | if(posDaughter->GetMother(0) != negDaughter->GetMother(0)){ | |
1424 | FillPhotonCombinatorialBackgroundHist(TruePhotonCandidate, pdgCode); | |
1425 | return; | |
1426 | } else if(posDaughter->GetMother(0) == -1){ | |
1427 | FillPhotonCombinatorialBackgroundHist(TruePhotonCandidate, pdgCode); | |
1428 | return; | |
1429 | } | |
1430 | ||
1431 | if(pdgCode[0]!=11 || pdgCode[1]!=11) return; //One Particle is not a electron | |
1432 | ||
1433 | if(posDaughter->GetPdgCode()==negDaughter->GetPdgCode()) return; // Same Charge | |
1434 | ||
1435 | TParticle *Photon = TruePhotonCandidate->GetMCParticle(fMCStack); | |
1436 | AliVTrack * electronCandidate = ((AliConversionPhotonCuts*)fCutArray->At(fiCut))->GetTrack(fInputEvent,TruePhotonCandidate->GetTrackLabelNegative() ); | |
1437 | AliVTrack * positronCandidate = ((AliConversionPhotonCuts*)fCutArray->At(fiCut))->GetTrack(fInputEvent,TruePhotonCandidate->GetTrackLabelPositive() ); | |
1438 | Double_t deltaPhi = magField * TVector2::Phi_mpi_pi( electronCandidate->Phi()-positronCandidate->Phi()); | |
1439 | ||
1440 | if(Photon->GetPdgCode() != 22){ | |
1441 | hESDTrueDalitzPsiPairDeltaPhi[fiCut]->Fill(deltaPhi,TruePhotonCandidate->GetPsiPair()); | |
1442 | return; // Mother is no Photon | |
1443 | } | |
1444 | ||
1445 | if(posDaughter->GetUniqueID() != 5 || negDaughter->GetUniqueID() !=5) return;// check if the daughters come from a conversion | |
1446 | ||
1447 | ||
1448 | ||
1449 | // True Photon | |
1450 | if(fIsFromMBHeader){ | |
1451 | hESDTrueConvGammaPt[fiCut]->Fill(TruePhotonCandidate->Pt()); | |
1452 | if (fDoPhotonQA > 0) hESDTrueConvGammaEta[fiCut]->Fill(TruePhotonCandidate->Eta()); | |
1453 | } | |
1454 | hESDTrueGammaPsiPairDeltaPhi[fiCut]->Fill(deltaPhi,TruePhotonCandidate->GetPsiPair()); | |
1455 | if(posDaughter->GetMother(0) <= fMCStack->GetNprimary()){ | |
1456 | // Count just primary MC Gammas as true --> For Ratio esdtruegamma / mcconvgamma | |
1457 | if(fIsFromMBHeader){ | |
1458 | iPhotonMCInfo = 6; | |
1459 | hESDTruePrimaryConvGammaPt[fiCut]->Fill(TruePhotonCandidate->Pt()); | |
1460 | hESDTruePrimaryConvGammaESDPtMCPt[fiCut]->Fill(TruePhotonCandidate->Pt(),Photon->Pt()); // Allways Filled | |
1461 | ||
1462 | } | |
1463 | // (Not Filled for i6, Extra Signal Gamma (parambox) are secondary) | |
1464 | } else { | |
1465 | if(fIsFromMBHeader){ | |
1466 | iPhotonMCInfo = 2; | |
1467 | hESDTrueSecondaryConvGammaPt[fiCut]->Fill(TruePhotonCandidate->Pt()); | |
1468 | if(fMCStack->Particle(Photon->GetMother(0))->GetMother(0) > -1 && | |
1469 | fMCStack->Particle(fMCStack->Particle(Photon->GetMother(0))->GetMother(0))->GetPdgCode() == 3122){ | |
1470 | hESDTrueSecondaryConvGammaFromXFromLambdaPt[fiCut]->Fill(TruePhotonCandidate->Pt()); | |
1471 | iPhotonMCInfo = 5; | |
1472 | } | |
1473 | if(fMCStack->Particle(Photon->GetMother(0))->GetMother(0) > -1 && | |
1474 | fMCStack->Particle(fMCStack->Particle(Photon->GetMother(0))->GetMother(0))->GetPdgCode() == 310){ | |
1475 | hESDTrueSecondaryConvGammaFromXFromK0sPt[fiCut]->Fill(TruePhotonCandidate->Pt()); | |
1476 | iPhotonMCInfo = 4; | |
1477 | } | |
1478 | if(fMCStack->Particle(Photon->GetMother(0))->GetMother(0) > -1 && | |
1479 | fMCStack->Particle(fMCStack->Particle(Photon->GetMother(0))->GetMother(0))->GetPdgCode() == 221){ | |
1480 | iPhotonMCInfo = 3; | |
1481 | } | |
1482 | } | |
1483 | } | |
2bb2434e | 1484 | } |
1485 | //________________________________________________________________________ | |
ae947965 | 1486 | void AliAnalysisTaskGammaConvV1::ProcessAODMCParticles() |
1487 | { | |
1488 | ||
85b56575 | 1489 | TClonesArray *AODMCTrackArray = dynamic_cast<TClonesArray*>(fInputEvent->FindListObject(AliAODMCParticle::StdBranchName())); |
ae947965 | 1490 | |
85b56575 | 1491 | if (AODMCTrackArray){ |
1492 | // Loop over all primary MC particle | |
1493 | for(Int_t i = 0; i < AODMCTrackArray->GetEntriesFast(); i++) { | |
ae947965 | 1494 | |
85b56575 | 1495 | AliAODMCParticle* particle = static_cast<AliAODMCParticle*>(AODMCTrackArray->At(i)); |
1496 | if (!particle) continue; | |
1497 | if (!particle->IsPrimary()) continue; | |
ae947965 | 1498 | |
85b56575 | 1499 | Int_t isMCFromMBHeader = -1; |
344100c4 | 1500 | if(((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetSignalRejection() != 0){ |
85b56575 | 1501 | isMCFromMBHeader |
344100c4 | 1502 | = ((AliConvEventCuts*)fEventCutArray->At(fiCut))->IsParticleFromBGEvent(i, fMCStack, fInputEvent); |
1503 | if(isMCFromMBHeader == 0 && ((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetSignalRejection() != 3) continue; | |
85b56575 | 1504 | } |
1505 | ||
344100c4 | 1506 | if(!((AliConversionPhotonCuts*)fCutArray->At(fiCut))->InPlaneOutOfPlaneCut(particle->Phi(),fEventPlaneAngle,kFALSE)) continue; |
1507 | if(((AliConversionPhotonCuts*)fCutArray->At(fiCut))->PhotonIsSelectedAODMC(particle,AODMCTrackArray,kFALSE)){ | |
85b56575 | 1508 | hMCAllGammaPt[fiCut]->Fill(particle->Pt()); // All MC Gamma |
1509 | if(particle->GetMother() >-1){ // Meson Decay Gamma | |
1510 | switch((static_cast<AliAODMCParticle*>(AODMCTrackArray->At(particle->GetMother())))->GetPdgCode()){ | |
1511 | case 111: // Pi0 | |
1512 | hMCDecayGammaPi0Pt[fiCut]->Fill(particle->Pt()); | |
1513 | break; | |
1514 | case 113: // Rho0 | |
1515 | hMCDecayGammaRhoPt[fiCut]->Fill(particle->Pt()); | |
1516 | break; | |
1517 | case 221: // Eta | |
1518 | hMCDecayGammaEtaPt[fiCut]->Fill(particle->Pt()); | |
1519 | break; | |
1520 | case 223: // Omega | |
1521 | hMCDecayGammaOmegaPt[fiCut]->Fill(particle->Pt()); | |
1522 | break; | |
1523 | case 331: // Eta' | |
1524 | hMCDecayGammaEtapPt[fiCut]->Fill(particle->Pt()); | |
1525 | break; | |
1526 | case 333: // Phi | |
1527 | hMCDecayGammaPhiPt[fiCut]->Fill(particle->Pt()); | |
1528 | break; | |
1529 | case 3212: // Sigma | |
1530 | hMCDecayGammaSigmaPt[fiCut]->Fill(particle->Pt()); | |
1531 | break; | |
1532 | } | |
1533 | } | |
1534 | } | |
344100c4 | 1535 | if(((AliConversionPhotonCuts*)fCutArray->At(fiCut))->PhotonIsSelectedAODMC(particle,AODMCTrackArray,kTRUE)){ |
85b56575 | 1536 | Double_t rConv = 0; |
1537 | for(Int_t daughterIndex=particle->GetDaughter(0);daughterIndex<=particle->GetDaughter(1);daughterIndex++){ | |
1538 | AliAODMCParticle *tmpDaughter = static_cast<AliAODMCParticle*>(AODMCTrackArray->At(daughterIndex)); | |
1539 | if(!tmpDaughter) continue; | |
1540 | if(abs(tmpDaughter->GetPdgCode()) == 11){ | |
d404157c | 1541 | rConv = sqrt( (tmpDaughter->Xv()*tmpDaughter->Xv()) + (tmpDaughter->Yv()*tmpDaughter->Yv()) ); |
85b56575 | 1542 | } |
1543 | } | |
1544 | hMCConvGammaPt[fiCut]->Fill(particle->Pt()); | |
1545 | if (fDoPhotonQA > 0){ | |
1546 | hMCConvGammaR[fiCut]->Fill(rConv); | |
1547 | hMCConvGammaEta[fiCut]->Fill(particle->Eta()); | |
1548 | } | |
1549 | } | |
1550 | // Converted MC Gamma | |
1551 | if(fDoMesonAnalysis){ | |
1552 | if(particle->GetPdgCode() == 310 && fDoMesonQA > 0){ | |
1553 | Double_t mesonY = 10.; | |
1554 | if(particle->E() - particle->Pz() == 0 || particle->E() + particle->Pz() == 0){ | |
344100c4 | 1555 | mesonY=10.-((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetEtaShift(); |
85b56575 | 1556 | } else{ |
344100c4 | 1557 | mesonY = 0.5*(TMath::Log((particle->E()+particle->Pz()) / (particle->E()-particle->Pz()))) |
1558 | -((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetEtaShift(); | |
85b56575 | 1559 | } |
1560 | Float_t weightedK0s= 1; | |
344100c4 | 1561 | if(((AliConvEventCuts*)fEventCutArray->At(fiCut))->IsParticleFromBGEvent(i, fMCStack, fInputEvent)){ |
1562 | if (particle->Pt()>0.005){ | |
1563 | weightedK0s= ((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetWeightForMeson(fV0Reader->GetPeriodName(),i, 0x0, fInputEvent); | |
1564 | //cout << "MC input \t"<<i << "\t" << particle->Pt()<<"\t"<<weighted << endl; | |
1565 | } | |
85b56575 | 1566 | } |
1567 | hMCK0sPt[fiCut]->Fill(particle->Pt(),weightedK0s); | |
1568 | hMCK0sWOWeightPt[fiCut]->Fill(particle->Pt()); | |
1569 | hMCK0sPtY[fiCut]->Fill(particle->Pt(),mesonY,weightedK0s); | |
1570 | } | |
344100c4 | 1571 | if(((AliConversionMesonCuts*)fMesonCutArray->At(fiCut))->MesonIsSelectedAODMC(particle,AODMCTrackArray,((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetEtaShift())){ |
85b56575 | 1572 | AliAODMCParticle* daughter0 = static_cast<AliAODMCParticle*>(AODMCTrackArray->At(particle->GetDaughter(0))); |
1573 | AliAODMCParticle* daughter1 = static_cast<AliAODMCParticle*>(AODMCTrackArray->At(particle->GetDaughter(1))); | |
1574 | Float_t weighted= 1; | |
344100c4 | 1575 | if(((AliConvEventCuts*)fEventCutArray->At(fiCut))->IsParticleFromBGEvent(i, fMCStack, fInputEvent)){ |
1576 | if (particle->Pt()>0.005){ | |
1577 | weighted= ((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetWeightForMeson(fV0Reader->GetPeriodName(),i, 0x0, fInputEvent); | |
1578 | // if(particle->GetPdgCode() == 221){ | |
1579 | // cout << "MC input \t"<<i << "\t" << particle->Pt()<<"\t"<<weighted << endl; | |
1580 | // } | |
1581 | } | |
85b56575 | 1582 | } |
1583 | Double_t mesonY = 10.; | |
1584 | if(particle->E() - particle->Pz() == 0 || particle->E() + particle->Pz() == 0){ | |
344100c4 | 1585 | mesonY=10.-((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetEtaShift(); |
85b56575 | 1586 | } else{ |
344100c4 | 1587 | mesonY = 0.5*(TMath::Log((particle->E()+particle->Pz()) / (particle->E()-particle->Pz()))) |
1588 | -((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetEtaShift(); | |
85b56575 | 1589 | } |
ae947965 | 1590 | |
de752898 | 1591 | Double_t alpha = -1; |
1592 | if (particle->GetPdgCode() == 111 || particle->GetPdgCode() == 221){ | |
1593 | alpha = TMath::Abs((daughter0->E() - daughter1->E()))/(daughter0->E() + daughter1->E()); | |
1594 | } | |
1595 | ||
85b56575 | 1596 | if(particle->GetPdgCode() == 111){ |
344100c4 | 1597 | hMCPi0Pt[fiCut]->Fill(particle->Pt(),weighted); // All MC Pi0 |
1598 | hMCPi0WOWeightPt[fiCut]->Fill(particle->Pt()); | |
de752898 | 1599 | if (fDoMesonQA > 0){ |
1600 | hMCPi0PtY[fiCut]->Fill(particle->Pt(),mesonY,weighted); // All MC Pi0 | |
1601 | hMCPi0PtAlpha[fiCut]->Fill(particle->Pt(),alpha); // All MC Pi0 | |
1602 | } | |
344100c4 | 1603 | } else if(particle->GetPdgCode() == 221){ |
1604 | hMCEtaPt[fiCut]->Fill(particle->Pt(),weighted); // All MC Eta | |
1605 | hMCEtaWOWeightPt[fiCut]->Fill(particle->Pt()); | |
de752898 | 1606 | if (fDoMesonQA > 0){ |
1607 | hMCEtaPtY[fiCut]->Fill(particle->Pt(),mesonY,weighted); // All MC Pi0 | |
1608 | hMCEtaPtAlpha[fiCut]->Fill(particle->Pt(),alpha); // All MC Pi0 | |
1609 | } | |
344100c4 | 1610 | } |
1611 | ||
1612 | // Check the acceptance for both gammas | |
1613 | if(((AliConversionPhotonCuts*)fCutArray->At(fiCut))->PhotonIsSelectedAODMC(daughter0,AODMCTrackArray,kFALSE) && | |
1614 | ((AliConversionPhotonCuts*)fCutArray->At(fiCut))->PhotonIsSelectedAODMC(daughter1,AODMCTrackArray,kFALSE) && | |
1615 | ((AliConversionPhotonCuts*)fCutArray->At(fiCut))->InPlaneOutOfPlaneCut(daughter0->Phi(),fEventPlaneAngle,kFALSE) && | |
1616 | ((AliConversionPhotonCuts*)fCutArray->At(fiCut))->InPlaneOutOfPlaneCut(daughter1->Phi(),fEventPlaneAngle,kFALSE)){ | |
1617 | ||
1618 | if(particle->GetPdgCode() == 111){ | |
1619 | hMCPi0InAccPt[fiCut]->Fill(particle->Pt(),weighted); // MC Pi0 with gamma in acc | |
1620 | } else if(particle->GetPdgCode() == 221){ | |
1621 | hMCEtaInAccPt[fiCut]->Fill(particle->Pt(),weighted); // MC Eta with gamma in acc | |
1622 | } | |
1623 | } | |
1624 | } | |
1625 | } | |
1626 | } | |
1627 | } | |
1628 | return; | |
1629 | } | |
1630 | //________________________________________________________________________ | |
1631 | void AliAnalysisTaskGammaConvV1::ProcessMCParticles() | |
1632 | { | |
1633 | // Loop over all primary MC particle | |
1634 | for(Int_t i = 0; i < fMCStack->GetNprimary(); i++) { | |
1635 | TParticle* particle = (TParticle *)fMCStack->Particle(i); | |
1636 | if (!particle) continue; | |
1637 | ||
1638 | Int_t isMCFromMBHeader = -1; | |
1639 | if(((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetSignalRejection() != 0){ | |
1640 | isMCFromMBHeader | |
1641 | = ((AliConvEventCuts*)fEventCutArray->At(fiCut))->IsParticleFromBGEvent(i, fMCStack, fInputEvent); | |
1642 | if(isMCFromMBHeader == 0 && ((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetSignalRejection() != 3) continue; | |
1643 | } | |
1644 | ||
1645 | if(!((AliConversionPhotonCuts*)fCutArray->At(fiCut))->InPlaneOutOfPlaneCut(particle->Phi(),fEventPlaneAngle,kFALSE)) continue; | |
1646 | if(((AliConversionPhotonCuts*)fCutArray->At(fiCut))->PhotonIsSelectedMC(particle,fMCStack,kFALSE)){ | |
1647 | hMCAllGammaPt[fiCut]->Fill(particle->Pt()); // All MC Gamma | |
1648 | if(particle->GetMother(0) >-1){ // Meson Decay Gamma | |
1649 | switch(fMCStack->Particle(particle->GetMother(0))->GetPdgCode()){ | |
1650 | case 111: // Pi0 | |
1651 | hMCDecayGammaPi0Pt[fiCut]->Fill(particle->Pt()); | |
1652 | break; | |
1653 | case 113: // Rho0 | |
1654 | hMCDecayGammaRhoPt[fiCut]->Fill(particle->Pt()); | |
1655 | break; | |
1656 | case 221: // Eta | |
1657 | hMCDecayGammaEtaPt[fiCut]->Fill(particle->Pt()); | |
1658 | break; | |
1659 | case 223: // Omega | |
1660 | hMCDecayGammaOmegaPt[fiCut]->Fill(particle->Pt()); | |
1661 | break; | |
1662 | case 331: // Eta' | |
1663 | hMCDecayGammaEtapPt[fiCut]->Fill(particle->Pt()); | |
1664 | break; | |
1665 | case 333: // Phi | |
1666 | hMCDecayGammaPhiPt[fiCut]->Fill(particle->Pt()); | |
1667 | break; | |
1668 | case 3212: // Sigma | |
1669 | hMCDecayGammaSigmaPt[fiCut]->Fill(particle->Pt()); | |
1670 | break; | |
1671 | } | |
1672 | } | |
1673 | } | |
1674 | if(((AliConversionPhotonCuts*)fCutArray->At(fiCut))->PhotonIsSelectedMC(particle,fMCStack,kTRUE)){ | |
1675 | hMCConvGammaPt[fiCut]->Fill(particle->Pt()); | |
1676 | if (fDoPhotonQA > 0){ | |
1677 | hMCConvGammaR[fiCut]->Fill(((TParticle*)fMCStack->Particle(particle->GetFirstDaughter()))->R()); | |
1678 | hMCConvGammaEta[fiCut]->Fill(particle->Eta()); | |
1679 | } | |
1680 | } // Converted MC Gamma | |
1681 | if(fDoMesonAnalysis){ | |
1682 | if(particle->GetPdgCode() == 310 && fDoMesonQA > 0){ | |
1683 | Double_t mesonY = 10.; | |
1684 | if(particle->Energy() - particle->Pz() == 0 || particle->Energy() + particle->Pz() == 0){ | |
1685 | mesonY=10.-((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetEtaShift(); | |
1686 | } else{ | |
1687 | mesonY = 0.5*(TMath::Log((particle->Energy()+particle->Pz()) / (particle->Energy()-particle->Pz()))) | |
1688 | -((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetEtaShift(); | |
1689 | } | |
1690 | Float_t weightedK0s= 1; | |
1691 | if(((AliConvEventCuts*)fEventCutArray->At(fiCut))->IsParticleFromBGEvent(i, fMCStack, fInputEvent)){ | |
1692 | if (particle->Pt()>0.005){ | |
1693 | weightedK0s= ((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetWeightForMeson(fV0Reader->GetPeriodName(),i, fMCStack, fInputEvent); | |
1694 | //cout << "MC input \t"<<i << "\t" << particle->Pt()<<"\t"<<weighted << endl; | |
1695 | } | |
1696 | } | |
1697 | if (fMCStack->IsPhysicalPrimary(i)){ | |
1698 | hMCK0sPt[fiCut]->Fill(particle->Pt(),weightedK0s); | |
1699 | hMCK0sWOWeightPt[fiCut]->Fill(particle->Pt()); | |
1700 | hMCK0sPtY[fiCut]->Fill(particle->Pt(),mesonY,weightedK0s); | |
1701 | } | |
1702 | } | |
1703 | if(((AliConversionMesonCuts*)fMesonCutArray->At(fiCut)) | |
1704 | ->MesonIsSelectedMC(particle,fMCStack,((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetEtaShift())){ | |
1705 | TParticle* daughter0 = (TParticle*)fMCStack->Particle(particle->GetFirstDaughter()); | |
1706 | TParticle* daughter1 = (TParticle*)fMCStack->Particle(particle->GetLastDaughter()); | |
1707 | ||
1708 | Float_t weighted= 1; | |
1709 | if(((AliConvEventCuts*)fEventCutArray->At(fiCut))->IsParticleFromBGEvent(i, fMCStack, fInputEvent)){ | |
1710 | if (particle->Pt()>0.005){ | |
1711 | weighted= ((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetWeightForMeson(fV0Reader->GetPeriodName(),i, fMCStack, fInputEvent); | |
1712 | // if(particle->GetPdgCode() == 221){ | |
1713 | // cout << "MC input \t"<<i << "\t" << particle->Pt()<<"\t"<<weighted << endl; | |
1714 | // } | |
1715 | } | |
1716 | } | |
1717 | Double_t mesonY = 10.; | |
1718 | if(particle->Energy() - particle->Pz() == 0 || particle->Energy() + particle->Pz() == 0){ | |
1719 | mesonY=10.-((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetEtaShift(); | |
1720 | } else { | |
1721 | mesonY = 0.5*(TMath::Log((particle->Energy()+particle->Pz()) / (particle->Energy()-particle->Pz()))) | |
1722 | -((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetEtaShift(); | |
1723 | } | |
de752898 | 1724 | Double_t alpha = -1; |
1725 | if (particle->GetPdgCode() == 111 || particle->GetPdgCode() == 221){ | |
1726 | alpha = TMath::Abs((daughter0->Energy() - daughter1->Energy()))/(daughter0->Energy() + daughter1->Energy()); | |
1727 | } | |
344100c4 | 1728 | |
1729 | if(particle->GetPdgCode() == 111){ | |
85b56575 | 1730 | hMCPi0Pt[fiCut]->Fill(particle->Pt(),weighted); // All MC Pi0 |
1731 | hMCPi0WOWeightPt[fiCut]->Fill(particle->Pt()); | |
de752898 | 1732 | if (fDoMesonQA > 0){ |
1733 | hMCPi0PtY[fiCut]->Fill(particle->Pt(),mesonY,weighted); // All MC Pi0 | |
1734 | hMCPi0PtAlpha[fiCut]->Fill(particle->Pt(),alpha); // All MC Pi0 | |
1735 | } | |
344100c4 | 1736 | } else if(particle->GetPdgCode() == 221){ |
85b56575 | 1737 | hMCEtaPt[fiCut]->Fill(particle->Pt(),weighted); // All MC Eta |
1738 | hMCEtaWOWeightPt[fiCut]->Fill(particle->Pt()); | |
de752898 | 1739 | if (fDoMesonQA > 0){ |
1740 | hMCEtaPtY[fiCut]->Fill(particle->Pt(),mesonY,weighted); // All MC Pi0 | |
1741 | hMCEtaPtAlpha[fiCut]->Fill(particle->Pt(),alpha); // All MC Pi0 | |
1742 | } | |
344100c4 | 1743 | } |
1744 | ||
1745 | // Check the acceptance for both gammas | |
1746 | if(((AliConversionPhotonCuts*)fCutArray->At(fiCut))->PhotonIsSelectedMC(daughter0,fMCStack,kFALSE) && | |
1747 | ((AliConversionPhotonCuts*)fCutArray->At(fiCut))->PhotonIsSelectedMC(daughter1,fMCStack,kFALSE) && | |
1748 | ((AliConversionPhotonCuts*)fCutArray->At(fiCut))->InPlaneOutOfPlaneCut(daughter0->Phi(),fEventPlaneAngle,kFALSE) && | |
1749 | ((AliConversionPhotonCuts*)fCutArray->At(fiCut))->InPlaneOutOfPlaneCut(daughter1->Phi(),fEventPlaneAngle,kFALSE)){ | |
85b56575 | 1750 | |
1751 | if(particle->GetPdgCode() == 111){ | |
1752 | hMCPi0InAccPt[fiCut]->Fill(particle->Pt(),weighted); // MC Pi0 with gamma in acc | |
1753 | } else if(particle->GetPdgCode() == 221){ | |
1754 | hMCEtaInAccPt[fiCut]->Fill(particle->Pt(),weighted); // MC Eta with gamma in acc | |
1755 | } | |
85b56575 | 1756 | } |
1757 | } | |
1758 | } | |
1759 | } | |
344100c4 | 1760 | |
d9d6352b | 1761 | if (fDoMesonQA){ |
1762 | for(Int_t i = fMCStack->GetNprimary(); i < fMCStack->GetNtrack(); i++) { | |
1763 | TParticle* particle = (TParticle *)fMCStack->Particle(i); | |
1764 | if (!particle) continue; | |
1765 | ||
1766 | Int_t isMCFromMBHeader = -1; | |
344100c4 | 1767 | if(((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetSignalRejection() != 0){ |
d9d6352b | 1768 | isMCFromMBHeader |
344100c4 | 1769 | = ((AliConvEventCuts*)fEventCutArray->At(fiCut))->IsParticleFromBGEvent(i, fMCStack, fInputEvent); |
1770 | if(isMCFromMBHeader == 0 && ((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetSignalRejection() != 3) continue; | |
d9d6352b | 1771 | } |
1772 | ||
1773 | if(fDoMesonAnalysis){ | |
344100c4 | 1774 | if(((AliConversionMesonCuts*)fMesonCutArray->At(fiCut))->MesonIsSelectedMC(particle,fMCStack,((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetEtaShift())){ |
d9d6352b | 1775 | Float_t weighted= 1; |
344100c4 | 1776 | if(((AliConvEventCuts*)fEventCutArray->At(fiCut))->IsParticleFromBGEvent(i, fMCStack, fInputEvent)){ |
d9d6352b | 1777 | if (particle->Pt()>0.005){ |
344100c4 | 1778 | weighted= ((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetWeightForMeson(fV0Reader->GetPeriodName(),i, fMCStack, fInputEvent); |
d9d6352b | 1779 | // if(particle->GetPdgCode() == 221){ |
1780 | // cout << "MC input \t"<<i << "\t" << particle->Pt()<<"\t"<<weighted << endl; | |
1781 | // } | |
1782 | } | |
1783 | } | |
1784 | ||
1785 | if(particle->GetPdgCode() == 111){ | |
1786 | Int_t pdgCode = ((TParticle*)fMCStack->Particle( particle->GetFirstMother() ))->GetPdgCode(); | |
1787 | Int_t source = GetSourceClassification(111,pdgCode); | |
1788 | hMCSecPi0PtvsSource[fiCut]->Fill(particle->Pt(),source,weighted); // All MC Pi0 | |
1789 | hMCSecPi0Source[fiCut]->Fill(pdgCode); | |
1790 | } else if(particle->GetPdgCode() == 221){ | |
1791 | Int_t pdgCode = ((TParticle*)fMCStack->Particle( particle->GetFirstMother() ))->GetPdgCode(); | |
1792 | hMCSecEtaPt[fiCut]->Fill(particle->Pt(),weighted); // All MC Pi0 | |
1793 | hMCSecEtaSource[fiCut]->Fill(pdgCode); | |
1794 | } | |
1795 | } | |
1796 | } | |
1797 | } | |
1798 | } | |
2bb2434e | 1799 | } |
344100c4 | 1800 | |
2bb2434e | 1801 | //________________________________________________________________________ |
1802 | void AliAnalysisTaskGammaConvV1::CalculatePi0Candidates(){ | |
1803 | ||
344100c4 | 1804 | // Conversion Gammas |
1805 | if(fGammaCandidates->GetEntries()>1){ | |
1806 | for(Int_t firstGammaIndex=0;firstGammaIndex<fGammaCandidates->GetEntries()-1;firstGammaIndex++){ | |
1807 | AliAODConversionPhoton *gamma0=dynamic_cast<AliAODConversionPhoton*>(fGammaCandidates->At(firstGammaIndex)); | |
1808 | if (gamma0==NULL) continue; | |
1809 | for(Int_t secondGammaIndex=firstGammaIndex+1;secondGammaIndex<fGammaCandidates->GetEntries();secondGammaIndex++){ | |
1810 | AliAODConversionPhoton *gamma1=dynamic_cast<AliAODConversionPhoton*>(fGammaCandidates->At(secondGammaIndex)); | |
1811 | //Check for same Electron ID | |
1812 | if (gamma1==NULL) continue; | |
1813 | if(gamma0->GetTrackLabelPositive() == gamma1->GetTrackLabelPositive() || | |
1814 | gamma0->GetTrackLabelNegative() == gamma1->GetTrackLabelNegative() || | |
1815 | gamma0->GetTrackLabelNegative() == gamma1->GetTrackLabelPositive() || | |
1816 | gamma0->GetTrackLabelPositive() == gamma1->GetTrackLabelNegative() ) continue; | |
1817 | ||
1818 | AliAODConversionMother *pi0cand = new AliAODConversionMother(gamma0,gamma1); | |
1819 | pi0cand->SetLabels(firstGammaIndex,secondGammaIndex); | |
1820 | ||
1821 | pi0cand->CalculateDistanceOfClossetApproachToPrimVtx(fInputEvent->GetPrimaryVertex()); | |
1822 | if((((AliConversionMesonCuts*)fMesonCutArray->At(fiCut))->MesonIsSelected(pi0cand,kTRUE,((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetEtaShift()))){ | |
1823 | hESDMotherInvMassPt[fiCut]->Fill(pi0cand->M(),pi0cand->Pt()); | |
1824 | if(pi0cand->GetAlpha()<0.1) hESDMotherInvMassEalpha[fiCut]->Fill(pi0cand->M(),pi0cand->E()); | |
1825 | ||
1826 | if (fDoMesonQA > 0){ | |
1827 | if ( pi0cand->M() > 0.05 && pi0cand->M() < 0.17){ | |
1828 | hESDMotherPi0PtY[fiCut]->Fill(pi0cand->Pt(),pi0cand->Rapidity()-((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetEtaShift()); | |
1829 | hESDMotherPi0PtAlpha[fiCut]->Fill(pi0cand->Pt(),pi0cand->GetAlpha()); | |
1830 | hESDMotherPi0PtOpenAngle[fiCut]->Fill(pi0cand->Pt(),pi0cand->GetOpeningAngle()); | |
1831 | ||
1832 | } | |
1833 | if ( pi0cand->M() > 0.45 && pi0cand->M() < 0.65){ | |
1834 | hESDMotherEtaPtY[fiCut]->Fill(pi0cand->Pt(),pi0cand->Rapidity()-((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetEtaShift()); | |
1835 | hESDMotherEtaPtAlpha[fiCut]->Fill(pi0cand->Pt(),pi0cand->GetAlpha()); | |
1836 | hESDMotherEtaPtOpenAngle[fiCut]->Fill(pi0cand->Pt(),pi0cand->GetOpeningAngle()); | |
1837 | } | |
1838 | } | |
1839 | if(((AliConversionMesonCuts*)fMesonCutArray->At(fiCut))->DoBGCalculation()){ | |
1840 | Int_t zbin = 0; | |
1841 | Int_t mbin = 0; | |
1842 | ||
1843 | if(((AliConversionMesonCuts*)fMesonCutArray->At(fiCut))->BackgroundHandlerType() == 0){ | |
1844 | zbin = fBGHandler[fiCut]->GetZBinIndex(fInputEvent->GetPrimaryVertex()->GetZ()); | |
1845 | if(((AliConversionMesonCuts*)fMesonCutArray->At(fiCut))->UseTrackMultiplicity()){ | |
1846 | mbin = fBGHandler[fiCut]->GetMultiplicityBinIndex(fV0Reader->GetNumberOfPrimaryTracks()); | |
1847 | } else { | |
1848 | mbin = fBGHandler[fiCut]->GetMultiplicityBinIndex(fGammaCandidates->GetEntries()); | |
1849 | } | |
1850 | } | |
1851 | else{ | |
1852 | zbin = fBGHandlerRP[fiCut]->GetZBinIndex(fInputEvent->GetPrimaryVertex()->GetZ()); | |
1853 | if(((AliConversionMesonCuts*)fMesonCutArray->At(fiCut))->UseTrackMultiplicity()){ | |
1854 | mbin = fBGHandlerRP[fiCut]->GetMultiplicityBinIndex(fV0Reader->GetNumberOfPrimaryTracks()); | |
1855 | } else { | |
1856 | mbin = fBGHandlerRP[fiCut]->GetMultiplicityBinIndex(fGammaCandidates->GetEntries()); | |
1857 | } | |
1858 | } | |
1859 | Double_t sparesFill[4] = {pi0cand->M(),pi0cand->Pt(),(Double_t)zbin,(Double_t)mbin}; | |
1860 | sESDMotherInvMassPtZM[fiCut]->Fill(sparesFill,1); | |
1861 | } | |
1862 | ||
1863 | ||
1864 | if(fIsMC){ | |
1865 | if(fInputEvent->IsA()==AliESDEvent::Class()) | |
1866 | ProcessTrueMesonCandidates(pi0cand,gamma0,gamma1); | |
1867 | if(fInputEvent->IsA()==AliAODEvent::Class()) | |
1868 | ProcessTrueMesonCandidatesAOD(pi0cand,gamma0,gamma1); | |
1869 | } | |
1870 | if (fDoMesonQA == 2){ | |
1871 | fInvMass = pi0cand->M(); | |
1872 | fPt = pi0cand->Pt(); | |
1873 | if (abs(gamma0->GetDCAzToPrimVtx()) < abs(gamma1->GetDCAzToPrimVtx())){ | |
1874 | fDCAzGammaMin = gamma0->GetDCAzToPrimVtx(); | |
1875 | fDCAzGammaMax = gamma1->GetDCAzToPrimVtx(); | |
1876 | } else { | |
1877 | fDCAzGammaMin = gamma1->GetDCAzToPrimVtx(); | |
1878 | fDCAzGammaMax = gamma0->GetDCAzToPrimVtx(); | |
1879 | } | |
1880 | iFlag = pi0cand->GetMesonQuality(); | |
1881 | // cout << "gamma 0: " << gamma0->GetV0Index()<< "\t" << gamma0->GetPx() << "\t" << gamma0->GetPy() << "\t" << gamma0->GetPz() << "\t" << endl; | |
1882 | // cout << "gamma 1: " << gamma1->GetV0Index()<< "\t"<< gamma1->GetPx() << "\t" << gamma1->GetPy() << "\t" << gamma1->GetPz() << "\t" << endl; | |
1883 | // cout << "pi0: "<<fInvMass << "\t" << fPt <<"\t" << fDCAzGammaMin << "\t" << fDCAzGammaMax << "\t" << (Int_t)iFlag << "\t" << (Int_t)iMesonMCInfo <<endl; | |
1884 | if (fIsHeavyIon == 1 && fPt > 0.399 && fPt < 20. ) { | |
1885 | if (fInvMass > 0.08 && fInvMass < 0.2) tESDMesonsInvMassPtDcazMinDcazMaxFlag[fiCut]->Fill(); | |
1886 | if ((fInvMass > 0.45 && fInvMass < 0.6) && (fPt > 0.999 && fPt < 20.) )tESDMesonsInvMassPtDcazMinDcazMaxFlag[fiCut]->Fill(); | |
1887 | } else if (fPt > 0.299 && fPt < 20. ) { | |
1888 | if ( (fInvMass > 0.08 && fInvMass < 0.2) || (fInvMass > 0.45 && fInvMass < 0.6)) tESDMesonsInvMassPtDcazMinDcazMaxFlag[fiCut]->Fill(); | |
1889 | } | |
1890 | } | |
1891 | } | |
1892 | delete pi0cand; | |
1893 | pi0cand=0x0; | |
1894 | } | |
1895 | } | |
1896 | } | |
2bb2434e | 1897 | } |
344100c4 | 1898 | |
2bb2434e | 1899 | //______________________________________________________________________ |
1900 | void AliAnalysisTaskGammaConvV1::ProcessTrueMesonCandidates(AliAODConversionMother *Pi0Candidate, AliAODConversionPhoton *TrueGammaCandidate0, AliAODConversionPhoton *TrueGammaCandidate1) | |
1901 | { | |
344100c4 | 1902 | // Process True Mesons |
1903 | AliStack *MCStack = fMCEvent->Stack(); | |
1904 | iMesonMCInfo = 0; | |
1905 | if(TrueGammaCandidate0->GetV0Index()<fInputEvent->GetNumberOfV0s()){ | |
1906 | Bool_t isTruePi0 = kFALSE; | |
1907 | Bool_t isTrueEta = kFALSE; | |
1908 | Bool_t isTruePi0Dalitz = kFALSE; | |
1909 | Bool_t isTrueEtaDalitz = kFALSE; | |
1910 | Bool_t gamma0DalitzCand = kFALSE; | |
1911 | Bool_t gamma1DalitzCand = kFALSE; | |
1912 | Int_t gamma0MCLabel = TrueGammaCandidate0->GetMCParticleLabel(MCStack); | |
1913 | Int_t gamma0MotherLabel = -1; | |
1914 | if(gamma0MCLabel != -1){ // Gamma is Combinatorial; MC Particles don't belong to the same Mother | |
1915 | // Daughters Gamma 0 | |
1916 | TParticle * negativeMC = (TParticle*)TrueGammaCandidate0->GetNegativeMCDaughter(MCStack); | |
1917 | TParticle * positiveMC = (TParticle*)TrueGammaCandidate0->GetPositiveMCDaughter(MCStack); | |
1918 | TParticle * gammaMC0 = (TParticle*)MCStack->Particle(gamma0MCLabel); | |
1919 | if(abs(negativeMC->GetPdgCode())==11 && abs(positiveMC->GetPdgCode())==11){ // Electrons ... | |
1920 | if(negativeMC->GetUniqueID() == 5 && positiveMC->GetUniqueID() ==5){ // ... From Conversion ... | |
1921 | if(gammaMC0->GetPdgCode() == 22){ // ... with Gamma Mother | |
1922 | gamma0MotherLabel=gammaMC0->GetFirstMother(); | |
1923 | } | |
1924 | } | |
1925 | if(gammaMC0->GetPdgCode() ==111){ // Dalitz candidate | |
1926 | gamma0DalitzCand = kTRUE; | |
1927 | gamma0MotherLabel=-111; | |
1928 | } | |
1929 | if(gammaMC0->GetPdgCode() ==221){ // Dalitz candidate | |
1930 | gamma0DalitzCand = kTRUE; | |
1931 | gamma0MotherLabel=-221; | |
1932 | } | |
1933 | } | |
1934 | } | |
1935 | if(TrueGammaCandidate1->GetV0Index()<fInputEvent->GetNumberOfV0s()){ | |
1936 | Int_t gamma1MCLabel = TrueGammaCandidate1->GetMCParticleLabel(MCStack); | |
1937 | Int_t gamma1MotherLabel = -1; | |
1938 | if(gamma1MCLabel != -1){ // Gamma is Combinatorial; MC Particles don't belong to the same Mother | |
1939 | // Daughters Gamma 1 | |
1940 | TParticle * negativeMC = (TParticle*)TrueGammaCandidate1->GetNegativeMCDaughter(MCStack); | |
1941 | TParticle * positiveMC = (TParticle*)TrueGammaCandidate1->GetPositiveMCDaughter(MCStack); | |
1942 | TParticle * gammaMC1 = (TParticle*)MCStack->Particle(gamma1MCLabel); | |
1943 | if(abs(negativeMC->GetPdgCode())==11 && abs(positiveMC->GetPdgCode())==11){ // Electrons ... | |
1944 | if(negativeMC->GetUniqueID() == 5 && positiveMC->GetUniqueID() ==5){ // ... From Conversion ... | |
1945 | if(gammaMC1->GetPdgCode() == 22){ // ... with Gamma Mother | |
1946 | gamma1MotherLabel=gammaMC1->GetFirstMother(); | |
1947 | } | |
1948 | } | |
1949 | if(gammaMC1->GetPdgCode() ==111 ){ // Dalitz candidate | |
1950 | gamma1DalitzCand = kTRUE; | |
1951 | gamma1MotherLabel=-111; | |
1952 | } | |
1953 | if(gammaMC1->GetPdgCode() ==221){ // Dalitz candidate | |
1954 | gamma1DalitzCand = kTRUE; | |
1955 | gamma1MotherLabel=-221; | |
1956 | } | |
1957 | } | |
1958 | } | |
1959 | if(gamma0MotherLabel>=0 && gamma0MotherLabel==gamma1MotherLabel){ | |
1960 | if(((TParticle*)MCStack->Particle(gamma1MotherLabel))->GetPdgCode() == 111){ | |
1961 | isTruePi0=kTRUE; | |
1962 | } | |
1963 | if(((TParticle*)MCStack->Particle(gamma1MotherLabel))->GetPdgCode() == 221){ | |
1964 | isTrueEta=kTRUE; | |
1965 | } | |
1966 | } | |
1967 | ||
1968 | //Identify Dalitz candidate | |
1969 | if (gamma1DalitzCand || gamma0DalitzCand){ | |
1970 | if (gamma0DalitzCand && gamma0MCLabel >=0 && gamma0MCLabel==gamma1MotherLabel){ | |
1971 | if (gamma0MotherLabel == -111) isTruePi0Dalitz = kTRUE; | |
1972 | if (gamma0MotherLabel == -221) isTrueEtaDalitz = kTRUE; | |
1973 | } | |
1974 | if (gamma1DalitzCand && gamma1MCLabel >=0 && gamma1MCLabel==gamma0MotherLabel){ | |
1975 | if (gamma1MotherLabel == -111) isTruePi0Dalitz = kTRUE; | |
1976 | if (gamma1MotherLabel == -221) isTrueEtaDalitz = kTRUE; | |
1977 | } | |
1978 | } | |
1979 | ||
1980 | ||
1981 | if(isTruePi0 || isTrueEta){// True Pion or Eta | |
1982 | hESDTrueMotherInvMassPt[fiCut]->Fill(Pi0Candidate->M(),Pi0Candidate->Pt()); | |
1983 | if (fDoMesonQA > 0){ | |
1984 | if (isTruePi0){ | |
1985 | if ( Pi0Candidate->M() > 0.05 && Pi0Candidate->M() < 0.17){ | |
1986 | hESDTruePi0PtY[fiCut]->Fill(Pi0Candidate->Pt(),Pi0Candidate->Rapidity()-((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetEtaShift()); | |
1987 | hESDTruePi0PtAlpha[fiCut]->Fill(Pi0Candidate->Pt(),Pi0Candidate->GetAlpha()); | |
1988 | hESDTruePi0PtOpenAngle[fiCut]->Fill(Pi0Candidate->Pt(),Pi0Candidate->GetOpeningAngle()); | |
1989 | } | |
1990 | } else if (isTrueEta){ | |
1991 | if ( Pi0Candidate->M() > 0.45 && Pi0Candidate->M() < 0.65){ | |
1992 | hESDTrueEtaPtY[fiCut]->Fill(Pi0Candidate->Pt(),Pi0Candidate->Rapidity()-((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetEtaShift()); | |
1993 | hESDTrueEtaPtAlpha[fiCut]->Fill(Pi0Candidate->Pt(),Pi0Candidate->GetAlpha()); | |
1994 | hESDTrueEtaPtOpenAngle[fiCut]->Fill(Pi0Candidate->Pt(),Pi0Candidate->GetOpeningAngle()); | |
1995 | } | |
1996 | } | |
1997 | } | |
1998 | if(gamma0MotherLabel >= MCStack->GetNprimary()){ // Secondary Meson | |
1999 | Int_t secMotherLabel = ((TParticle*)MCStack->Particle(gamma1MotherLabel))->GetMother(0); | |
2000 | Float_t weightedSec= 1; | |
2001 | if(((AliConvEventCuts*)fEventCutArray->At(fiCut))->IsParticleFromBGEvent(secMotherLabel, fMCStack, fInputEvent) && MCStack->Particle(secMotherLabel)->GetPdgCode()==310){ | |
2002 | weightedSec= ((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetWeightForMeson(fV0Reader->GetPeriodName(),secMotherLabel, fMCStack, fInputEvent)/2.; //invariant mass is additive thus the weight for the daughters has to be devide by two for the K0s at a certain pt | |
2003 | //cout << "MC input \t"<<i << "\t" << particle->Pt()<<"\t"<<weighted << endl; | |
2004 | } | |
2005 | hESDTrueSecondaryMotherInvMassPt[fiCut]->Fill(Pi0Candidate->M(),Pi0Candidate->Pt(),weightedSec); | |
2006 | iMesonMCInfo = 2; | |
2007 | if (secMotherLabel >-1){ | |
2008 | if(MCStack->Particle(secMotherLabel)->GetPdgCode()==310){ | |
2009 | iMesonMCInfo = 4; | |
2010 | hESDTrueSecondaryMotherFromK0sInvMassPt[fiCut]->Fill(Pi0Candidate->M(),Pi0Candidate->Pt(),weightedSec); | |
2011 | if (fDoMesonQA > 0)hESDTrueK0sWithPi0DaughterMCPt[fiCut] | |
2012 | ->Fill(MCStack->Particle(secMotherLabel)->Pt()); | |
2013 | } | |
2014 | if(MCStack->Particle(secMotherLabel)->GetPdgCode()==221){ | |
2015 | iMesonMCInfo = 3; | |
2016 | hESDTrueSecondaryMotherFromEtaInvMassPt[fiCut]->Fill(Pi0Candidate->M(),Pi0Candidate->Pt(),weightedSec); | |
2017 | if (fDoMesonQA > 0)hESDTrueEtaWithPi0DaughterMCPt[fiCut] | |
2018 | ->Fill(MCStack->Particle(secMotherLabel)->Pt()); | |
2019 | } | |
2020 | if(MCStack->Particle(secMotherLabel)->GetPdgCode()==3122){ | |
2021 | iMesonMCInfo = 7; | |
2022 | hESDTrueSecondaryMotherFromLambdaInvMassPt[fiCut]->Fill(Pi0Candidate->M(),Pi0Candidate->Pt(),weightedSec); | |
2023 | if (fDoMesonQA > 0)hESDTrueLambdaWithPi0DaughterMCPt[fiCut] | |
2024 | ->Fill(MCStack->Particle(secMotherLabel)->Pt()); | |
2025 | } | |
2026 | } | |
2027 | } else { // Only primary pi0 for efficiency calculation | |
2028 | iMesonMCInfo = 6; | |
2029 | Float_t weighted= 1; | |
2030 | if(((AliConvEventCuts*)fEventCutArray->At(fiCut))->IsParticleFromBGEvent(gamma1MotherLabel, fMCStack, fInputEvent)){ | |
2031 | if (((TParticle*)MCStack->Particle(gamma1MotherLabel))->Pt()>0.005){ | |
2032 | weighted= ((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetWeightForMeson(fV0Reader->GetPeriodName(),gamma1MotherLabel, fMCStack, fInputEvent); | |
2033 | // cout << "rec \t " <<gamma1MotherLabel << "\t" << weighted << endl; | |
2034 | } | |
2035 | } | |
2036 | hESDTruePrimaryMotherInvMassPt[fiCut]->Fill(Pi0Candidate->M(),Pi0Candidate->Pt(),weighted); | |
2037 | hESDTruePrimaryMotherW0WeightingInvMassPt[fiCut]->Fill(Pi0Candidate->M(),Pi0Candidate->Pt()); | |
2038 | pESDTruePrimaryMotherWeightsInvMassPt[fiCut]->Fill(Pi0Candidate->M(),Pi0Candidate->Pt(),weighted); | |
2039 | ||
2040 | ||
2041 | if (fDoMesonQA > 0){ | |
2042 | if(isTruePi0){ // Only primary pi0 for resolution | |
2043 | hESDTruePrimaryPi0MCPtResolPt[fiCut]->Fill(((TParticle*)MCStack->Particle(gamma1MotherLabel))->Pt(),(Pi0Candidate->Pt()-((TParticle*)MCStack->Particle(gamma1MotherLabel))->Pt())/((TParticle*)MCStack->Particle(gamma1MotherLabel))->Pt(),weighted); | |
2044 | } | |
2045 | if (isTrueEta){ // Only primary eta for resolution | |
2046 | hESDTruePrimaryEtaMCPtResolPt[fiCut]->Fill(((TParticle*)MCStack->Particle(gamma1MotherLabel))->Pt(),(Pi0Candidate->Pt()-((TParticle*)MCStack->Particle(gamma1MotherLabel))->Pt())/((TParticle*)MCStack->Particle(gamma1MotherLabel))->Pt(),weighted); | |
2047 | } | |
2048 | } | |
2049 | } | |
2050 | } else if(!isTruePi0 && !isTrueEta){ // Background | |
2051 | if (fDoMesonQA > 0){ | |
2052 | if(gamma0MotherLabel>-1 && gamma1MotherLabel>-1){ // Both Tracks are Photons and have a mother but not Pi0 or Eta | |
2053 | hESDTrueBckGGInvMassPt[fiCut]->Fill(Pi0Candidate->M(),Pi0Candidate->Pt()); | |
2054 | iMesonMCInfo = 1; | |
2055 | } else { // No photon or without mother | |
2056 | hESDTrueBckContInvMassPt[fiCut]->Fill(Pi0Candidate->M(),Pi0Candidate->Pt()); | |
2057 | } | |
2058 | } | |
2059 | if( isTruePi0Dalitz || isTrueEtaDalitz ){ | |
2060 | // Dalitz | |
2061 | iMesonMCInfo = 5; | |
2062 | hESDTrueMotherDalitzInvMassPt[fiCut]->Fill(Pi0Candidate->M(),Pi0Candidate->Pt()); | |
2063 | } else if (gamma0DalitzCand || gamma1DalitzCand){ | |
2064 | if (fDoMesonQA > 0)hESDTrueBckContInvMassPt[fiCut]->Fill(Pi0Candidate->M(),Pi0Candidate->Pt()); | |
2065 | } | |
2066 | } | |
2067 | } | |
2068 | } | |
2bb2434e | 2069 | } |
ae947965 | 2070 | //______________________________________________________________________ |
2071 | void AliAnalysisTaskGammaConvV1::ProcessTrueMesonCandidatesAOD(AliAODConversionMother *Pi0Candidate, AliAODConversionPhoton *TrueGammaCandidate0, AliAODConversionPhoton *TrueGammaCandidate1) | |
2072 | { | |
2073 | ||
85b56575 | 2074 | // Process True Mesons |
2075 | TClonesArray *AODMCTrackArray = dynamic_cast<TClonesArray*>(fInputEvent->FindListObject(AliAODMCParticle::StdBranchName())); | |
2076 | Bool_t isTruePi0 = kFALSE; | |
2077 | Bool_t isTrueEta = kFALSE; | |
2078 | Bool_t isTruePi0Dalitz = kFALSE; | |
2079 | Bool_t isTrueEtaDalitz = kFALSE; | |
2080 | Bool_t gamma0DalitzCand = kFALSE; | |
2081 | Bool_t gamma1DalitzCand = kFALSE; | |
ae947965 | 2082 | |
85b56575 | 2083 | if (AODMCTrackArray!=NULL && TrueGammaCandidate0 != NULL){ |
2084 | AliAODMCParticle *positiveMC = static_cast<AliAODMCParticle*>(AODMCTrackArray->At(TrueGammaCandidate0->GetMCLabelPositive())); | |
2085 | AliAODMCParticle *negativeMC = static_cast<AliAODMCParticle*>(AODMCTrackArray->At(TrueGammaCandidate0->GetMCLabelNegative())); | |
2086 | ||
2087 | iMesonMCInfo = 0; | |
2088 | Int_t gamma0MCLabel = -1; | |
2089 | Int_t gamma0MotherLabel = -1; | |
2090 | if(!positiveMC||!negativeMC) | |
2091 | return; | |
2092 | ||
2093 | if(positiveMC->GetMother()>-1&&(negativeMC->GetMother() == positiveMC->GetMother())){ | |
2094 | gamma0MCLabel = positiveMC->GetMother(); | |
2095 | } | |
ae947965 | 2096 | |
85b56575 | 2097 | if(gamma0MCLabel != -1){ // Gamma is Combinatorial; MC Particles don't belong to the same Mother |
2098 | // Daughters Gamma 0 | |
2099 | AliAODMCParticle * gammaMC0 = static_cast<AliAODMCParticle*>(AODMCTrackArray->At(gamma0MCLabel)); | |
2100 | if(abs(negativeMC->GetPdgCode())==11 && abs(positiveMC->GetPdgCode())==11){ // Electrons ... | |
2101 | if(((positiveMC->GetMCProcessCode())) == 5 && ((negativeMC->GetMCProcessCode())) == 5){ // ... From Conversion ... | |
2102 | if(gammaMC0->GetPdgCode() == 22){ // ... with Gamma Mother | |
2103 | gamma0MotherLabel=gammaMC0->GetMother(); | |
2104 | } | |
2105 | } | |
2106 | if(gammaMC0->GetPdgCode() ==111){ // Dalitz candidate | |
2107 | gamma0DalitzCand = kTRUE; | |
2108 | gamma0MotherLabel=-111; | |
2109 | } | |
2110 | if(gammaMC0->GetPdgCode() ==221){ // Dalitz candidate | |
2111 | gamma0DalitzCand = kTRUE; | |
2112 | gamma0MotherLabel=-221; | |
2113 | } | |
2114 | } | |
2115 | } | |
2116 | positiveMC = static_cast<AliAODMCParticle*>(AODMCTrackArray->At(TrueGammaCandidate1->GetMCLabelPositive())); | |
2117 | negativeMC = static_cast<AliAODMCParticle*>(AODMCTrackArray->At(TrueGammaCandidate1->GetMCLabelNegative())); | |
2118 | ||
2119 | Int_t gamma1MCLabel = -1; | |
2120 | Int_t gamma1MotherLabel = -1; | |
2121 | if(!positiveMC||!negativeMC) | |
2122 | return; | |
2123 | ||
2124 | if(positiveMC->GetMother()>-1&&(negativeMC->GetMother() == positiveMC->GetMother())){ | |
2125 | gamma1MCLabel = positiveMC->GetMother(); | |
2126 | } | |
2127 | if(gamma1MCLabel != -1){ // Gamma is Combinatorial; MC Particles don't belong to the same Mother | |
2128 | // Daughters Gamma 1 | |
2129 | AliAODMCParticle * gammaMC1 = static_cast<AliAODMCParticle*>(AODMCTrackArray->At(gamma1MCLabel)); | |
2130 | if(abs(negativeMC->GetPdgCode())==11 && abs(positiveMC->GetPdgCode())==11){ // Electrons ... | |
2131 | if(((positiveMC->GetMCProcessCode())) == 5 && ((negativeMC->GetMCProcessCode())) == 5){ // ... From Conversion ... | |
2132 | if(gammaMC1->GetPdgCode() == 22){ // ... with Gamma Mother | |
2133 | gamma1MotherLabel=gammaMC1->GetMother(); | |
2134 | } | |
2135 | } | |
2136 | if(gammaMC1->GetPdgCode() ==111 ){ // Dalitz candidate | |
2137 | gamma1DalitzCand = kTRUE; | |
2138 | gamma1MotherLabel=-111; | |
2139 | } | |
2140 | if(gammaMC1->GetPdgCode() ==221){ // Dalitz candidate | |
2141 | gamma1DalitzCand = kTRUE; | |
2142 | gamma1MotherLabel=-221; | |
2143 | } | |
2144 | } | |
2145 | } | |
2146 | if(gamma0MotherLabel>=0 && gamma0MotherLabel==gamma1MotherLabel){ | |
2147 | if(static_cast<AliAODMCParticle*>(AODMCTrackArray->At(gamma1MotherLabel))->GetPdgCode() == 111){ | |
2148 | isTruePi0=kTRUE; | |
2149 | } | |
2150 | if(static_cast<AliAODMCParticle*>(AODMCTrackArray->At(gamma1MotherLabel))->GetPdgCode() == 221){ | |
2151 | isTrueEta=kTRUE; | |
2152 | } | |
2153 | } | |
2154 | ||
2155 | //Identify Dalitz candidate | |
2156 | if (gamma1DalitzCand || gamma0DalitzCand){ | |
2157 | if (gamma0DalitzCand && gamma0MCLabel >=0 && gamma0MCLabel==gamma1MotherLabel){ | |
2158 | if (gamma0MotherLabel == -111) isTruePi0Dalitz = kTRUE; | |
2159 | if (gamma0MotherLabel == -221) isTrueEtaDalitz = kTRUE; | |
2160 | } | |
2161 | if (gamma1DalitzCand && gamma1MCLabel >=0 && gamma1MCLabel==gamma0MotherLabel){ | |
2162 | if (gamma1MotherLabel == -111) isTruePi0Dalitz = kTRUE; | |
2163 | if (gamma1MotherLabel == -221) isTrueEtaDalitz = kTRUE; | |
2164 | } | |
2165 | } | |
2166 | ||
2167 | if(isTruePi0 || isTrueEta){// True Pion or Eta | |
2168 | hESDTrueMotherInvMassPt[fiCut]->Fill(Pi0Candidate->M(),Pi0Candidate->Pt()); | |
2169 | if (fDoMesonQA > 0){ | |
2170 | if (isTruePi0){ | |
2171 | if ( Pi0Candidate->M() > 0.05 && Pi0Candidate->M() < 0.17){ | |
344100c4 | 2172 | hESDTruePi0PtY[fiCut]->Fill(Pi0Candidate->Pt(),Pi0Candidate->Rapidity()-((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetEtaShift()); |
85b56575 | 2173 | hESDTruePi0PtAlpha[fiCut]->Fill(Pi0Candidate->Pt(),Pi0Candidate->GetAlpha()); |
2174 | hESDTruePi0PtOpenAngle[fiCut]->Fill(Pi0Candidate->Pt(),Pi0Candidate->GetOpeningAngle()); | |
2175 | } | |
2176 | } else if (isTrueEta){ | |
2177 | if ( Pi0Candidate->M() > 0.45 && Pi0Candidate->M() < 0.65){ | |
344100c4 | 2178 | hESDTrueEtaPtY[fiCut]->Fill(Pi0Candidate->Pt(),Pi0Candidate->Rapidity()-((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetEtaShift()); |
85b56575 | 2179 | hESDTrueEtaPtAlpha[fiCut]->Fill(Pi0Candidate->Pt(),Pi0Candidate->GetAlpha()); |
2180 | hESDTrueEtaPtOpenAngle[fiCut]->Fill(Pi0Candidate->Pt(),Pi0Candidate->GetOpeningAngle()); | |
2181 | } | |
2182 | } | |
2183 | } | |
2184 | if(!(static_cast<AliAODMCParticle*>(AODMCTrackArray->At(gamma0MotherLabel))->IsPrimary())){ // Secondary Meson | |
2185 | Int_t secMotherLabel = static_cast<AliAODMCParticle*>(AODMCTrackArray->At(gamma1MotherLabel))->GetMother(); | |
2186 | Float_t weightedSec= 1; | |
344100c4 | 2187 | if(((AliConvEventCuts*)fEventCutArray->At(fiCut))->IsParticleFromBGEvent(secMotherLabel, 0x0, fInputEvent) && static_cast<AliAODMCParticle*>(AODMCTrackArray->At(secMotherLabel))->GetPdgCode()==310){ |
2188 | weightedSec= ((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetWeightForMeson(fV0Reader->GetPeriodName(),secMotherLabel, 0x0, fInputEvent)/2.; //invariant mass is additive thus the weight for the daughters has to be devide by two for the K0s at a certain pt | |
85b56575 | 2189 | //cout << "MC input \t"<<i << "\t" << particle->Pt()<<"\t"<<weighted << endl; |
2190 | } | |
2191 | hESDTrueSecondaryMotherInvMassPt[fiCut]->Fill(Pi0Candidate->M(),Pi0Candidate->Pt(),weightedSec); | |
2192 | iMesonMCInfo = 2; | |
2193 | if (secMotherLabel >-1){ | |
2194 | if(static_cast<AliAODMCParticle*>(AODMCTrackArray->At(secMotherLabel))->GetPdgCode()==310){ | |
344100c4 | 2195 | iMesonMCInfo = 4; |
2196 | hESDTrueSecondaryMotherFromK0sInvMassPt[fiCut]->Fill(Pi0Candidate->M(),Pi0Candidate->Pt(),weightedSec); | |
2197 | if (fDoMesonQA > 0)hESDTrueK0sWithPi0DaughterMCPt[fiCut] | |
2198 | ->Fill(static_cast<AliAODMCParticle*>(AODMCTrackArray->At(secMotherLabel))->Pt()); | |
85b56575 | 2199 | } |
2200 | if(static_cast<AliAODMCParticle*>(AODMCTrackArray->At(secMotherLabel))->GetPdgCode()==221){ | |
344100c4 | 2201 | iMesonMCInfo = 3; |
2202 | hESDTrueSecondaryMotherFromEtaInvMassPt[fiCut]->Fill(Pi0Candidate->M(),Pi0Candidate->Pt(),weightedSec); | |
2203 | if (fDoMesonQA > 0)hESDTrueEtaWithPi0DaughterMCPt[fiCut] | |
2204 | ->Fill(static_cast<AliAODMCParticle*>(AODMCTrackArray->At(secMotherLabel))->Pt()); | |
85b56575 | 2205 | } |
2206 | if(static_cast<AliAODMCParticle*>(AODMCTrackArray->At(secMotherLabel))->GetPdgCode()==3122){ | |
344100c4 | 2207 | iMesonMCInfo = 7; |
2208 | hESDTrueSecondaryMotherFromLambdaInvMassPt[fiCut]->Fill(Pi0Candidate->M(),Pi0Candidate->Pt(),weightedSec); | |
2209 | if (fDoMesonQA > 0)hESDTrueLambdaWithPi0DaughterMCPt[fiCut] | |
2210 | ->Fill(static_cast<AliAODMCParticle*>(AODMCTrackArray->At(secMotherLabel))->Pt()); | |
85b56575 | 2211 | } |
2212 | } | |
2213 | }else{ // Only primary pi0 for efficiency calculation | |
2214 | Float_t weighted= 1; | |
2215 | iMesonMCInfo = 6; | |
344100c4 | 2216 | if(((AliConvEventCuts*)fEventCutArray->At(fiCut))->IsParticleFromBGEvent(gamma1MotherLabel, 0x0, fInputEvent)){ |
85b56575 | 2217 | if (static_cast<AliAODMCParticle*>(AODMCTrackArray->At(gamma1MotherLabel))->Pt()>0.005){ |
344100c4 | 2218 | weighted= ((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetWeightForMeson(fV0Reader->GetPeriodName(),gamma1MotherLabel, 0x0, fInputEvent); |
85b56575 | 2219 | // cout << "rec \t " <<gamma1MotherLabel << "\t" << weighted << endl; |
2220 | } | |
2221 | } | |
2222 | hESDTruePrimaryMotherInvMassPt[fiCut]->Fill(Pi0Candidate->M(),Pi0Candidate->Pt(),weighted); | |
2223 | hESDTruePrimaryMotherW0WeightingInvMassPt[fiCut]->Fill(Pi0Candidate->M(),Pi0Candidate->Pt()); | |
2224 | pESDTruePrimaryMotherWeightsInvMassPt[fiCut]->Fill(Pi0Candidate->M(),Pi0Candidate->Pt(),weighted); | |
2225 | ||
2226 | if (fDoMesonQA > 0){ | |
2227 | if(isTruePi0){ // Only primary pi0 for resolution | |
344100c4 | 2228 | hESDTruePrimaryPi0MCPtResolPt[fiCut]->Fill(static_cast<AliAODMCParticle*>(AODMCTrackArray->At(gamma1MotherLabel))->Pt(), |
85b56575 | 2229 | (Pi0Candidate->Pt()-static_cast<AliAODMCParticle*>(AODMCTrackArray->At(gamma1MotherLabel))->Pt())/static_cast<AliAODMCParticle*>(AODMCTrackArray->At(gamma1MotherLabel))->Pt(),weighted); |
2230 | ||
2231 | } | |
2232 | if (isTrueEta){ // Only primary eta for resolution | |
344100c4 | 2233 | hESDTruePrimaryEtaMCPtResolPt[fiCut]->Fill(static_cast<AliAODMCParticle*>(AODMCTrackArray->At(gamma1MotherLabel))->Pt(), |
85b56575 | 2234 | (Pi0Candidate->Pt()-static_cast<AliAODMCParticle*>(AODMCTrackArray->At(gamma1MotherLabel))->Pt())/static_cast<AliAODMCParticle*>(AODMCTrackArray->At(gamma1MotherLabel))->Pt(),weighted); |
2235 | } | |
2236 | } | |
2237 | } | |
2238 | } else if(!isTruePi0 && !isTrueEta) { // Background | |
2239 | if (fDoMesonQA > 0){ | |
2240 | if(gamma0MotherLabel>-1 && gamma1MotherLabel>-1){ // Both Tracks are Photons and have a mother but not Pi0 or Eta | |
2241 | hESDTrueBckGGInvMassPt[fiCut]->Fill(Pi0Candidate->M(),Pi0Candidate->Pt()); | |
2242 | iMesonMCInfo = 1; | |
2243 | } else { // No photon or without mother | |
2244 | hESDTrueBckContInvMassPt[fiCut]->Fill(Pi0Candidate->M(),Pi0Candidate->Pt()); | |
2245 | } | |
2246 | } | |
2247 | if( isTruePi0Dalitz || isTrueEtaDalitz ){ | |
2248 | // Dalitz | |
2249 | iMesonMCInfo = 5; | |
2250 | hESDTrueMotherDalitzInvMassPt[fiCut]->Fill(Pi0Candidate->M(),Pi0Candidate->Pt()); | |
2251 | } else if (gamma0DalitzCand || gamma1DalitzCand){ | |
2252 | if (fDoMesonQA > 0)hESDTrueBckContInvMassPt[fiCut]->Fill(Pi0Candidate->M(),Pi0Candidate->Pt()); | |
2253 | } | |
2254 | } | |
2255 | } | |
2256 | return; | |
ae947965 | 2257 | } |
2bb2434e | 2258 | //________________________________________________________________________ |
2259 | void AliAnalysisTaskGammaConvV1::CalculateBackground(){ | |
2260 | ||
344100c4 | 2261 | Int_t zbin= fBGHandler[fiCut]->GetZBinIndex(fInputEvent->GetPrimaryVertex()->GetZ()); |
2262 | Int_t mbin = 0; | |
2263 | ||
2264 | if(((AliConversionMesonCuts*)fMesonCutArray->At(fiCut))->UseTrackMultiplicity()){ | |
2265 | mbin = fBGHandler[fiCut]->GetMultiplicityBinIndex(fV0Reader->GetNumberOfPrimaryTracks()); | |
2266 | } else { | |
2267 | mbin = fBGHandler[fiCut]->GetMultiplicityBinIndex(fGammaCandidates->GetEntries()); | |
2268 | } | |
2269 | ||
2270 | if(((AliConversionMesonCuts*)fMesonCutArray->At(fiCut))->UseRotationMethod()){ | |
2271 | ||
2272 | for(Int_t iCurrent=0;iCurrent<fGammaCandidates->GetEntries();iCurrent++){ | |
2273 | AliAODConversionPhoton currentEventGoodV0 = *(AliAODConversionPhoton*)(fGammaCandidates->At(iCurrent)); | |
2274 | for(Int_t iCurrent2=iCurrent+1;iCurrent2<fGammaCandidates->GetEntries();iCurrent2++){ | |
2275 | for(Int_t nRandom=0;nRandom<((AliConversionMesonCuts*)fMesonCutArray->At(fiCut))->GetNumberOfBGEvents();nRandom++){ | |
2276 | AliAODConversionPhoton currentEventGoodV02 = *(AliAODConversionPhoton*)(fGammaCandidates->At(iCurrent2)); | |
2277 | ||
2278 | if(((AliConversionMesonCuts*)fMesonCutArray->At(fiCut))->DoBGProbability()){ | |
2279 | AliAODConversionMother *backgroundCandidateProb = new AliAODConversionMother(¤tEventGoodV0,¤tEventGoodV02); | |
2280 | Double_t massBGprob = backgroundCandidateProb->M(); | |
2281 | if(massBGprob>0.1 && massBGprob<0.14){ | |
2282 | if(fRandom.Rndm()>fBGHandler[fiCut]->GetBGProb(zbin,mbin)){ | |
2283 | delete backgroundCandidateProb; | |
2284 | continue; | |
2285 | } | |
2286 | } | |
2287 | delete backgroundCandidateProb; | |
2288 | backgroundCandidateProb = 0x0; | |
2289 | } | |
2290 | ||
2291 | RotateParticle(¤tEventGoodV02); | |
2292 | AliAODConversionMother *backgroundCandidate = new AliAODConversionMother(¤tEventGoodV0,¤tEventGoodV02); | |
2293 | backgroundCandidate->CalculateDistanceOfClossetApproachToPrimVtx(fInputEvent->GetPrimaryVertex()); | |
2294 | if((((AliConversionMesonCuts*)fMesonCutArray->At(fiCut)) | |
2295 | ->MesonIsSelected(backgroundCandidate,kFALSE,((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetEtaShift()))){ | |
2296 | hESDMotherBackInvMassPt[fiCut]->Fill(backgroundCandidate->M(),backgroundCandidate->Pt()); | |
2297 | Double_t sparesFill[4] = {backgroundCandidate->M(),backgroundCandidate->Pt(),(Double_t)zbin,(Double_t)mbin}; | |
2298 | sESDMotherBackInvMassPtZM[fiCut]->Fill(sparesFill,1); | |
2299 | } | |
2300 | delete backgroundCandidate; | |
2301 | backgroundCandidate = 0x0; | |
2302 | } | |
2303 | } | |
2304 | } | |
2305 | }else{ | |
2306 | AliGammaConversionAODBGHandler::GammaConversionVertex *bgEventVertex = NULL; | |
2307 | ||
2308 | if(((AliConversionMesonCuts*)fMesonCutArray->At(fiCut))->UseTrackMultiplicity()){ | |
2309 | for(Int_t nEventsInBG=0;nEventsInBG<fBGHandler[fiCut]->GetNBGEvents();nEventsInBG++){ | |
2310 | AliGammaConversionAODVector *previousEventV0s = fBGHandler[fiCut]->GetBGGoodV0s(zbin,mbin,nEventsInBG); | |
2311 | if(fMoveParticleAccordingToVertex == kTRUE){ | |
2312 | bgEventVertex = fBGHandler[fiCut]->GetBGEventVertex(zbin,mbin,nEventsInBG); | |
2313 | } | |
2314 | ||
2315 | for(Int_t iCurrent=0;iCurrent<fGammaCandidates->GetEntries();iCurrent++){ | |
2316 | AliAODConversionPhoton currentEventGoodV0 = *(AliAODConversionPhoton*)(fGammaCandidates->At(iCurrent)); | |
2317 | for(UInt_t iPrevious=0;iPrevious<previousEventV0s->size();iPrevious++){ | |
2318 | AliAODConversionPhoton previousGoodV0 = (AliAODConversionPhoton)(*(previousEventV0s->at(iPrevious))); | |
2319 | if(fMoveParticleAccordingToVertex == kTRUE){ | |
2320 | MoveParticleAccordingToVertex(&previousGoodV0,bgEventVertex); | |
2321 | } | |
2322 | if(((AliConversionPhotonCuts*)fCutArray->At(fiCut))->GetInPlaneOutOfPlaneCut() != 0){ | |
2323 | RotateParticleAccordingToEP(&previousGoodV0,bgEventVertex->fEP,fEventPlaneAngle); | |
2324 | } | |
2325 | ||
2326 | AliAODConversionMother *backgroundCandidate = new AliAODConversionMother(¤tEventGoodV0,&previousGoodV0); | |
2327 | backgroundCandidate->CalculateDistanceOfClossetApproachToPrimVtx(fInputEvent->GetPrimaryVertex()); | |
2328 | if((((AliConversionMesonCuts*)fMesonCutArray->At(fiCut)) | |
2329 | ->MesonIsSelected(backgroundCandidate,kFALSE,((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetEtaShift()))){ | |
2330 | hESDMotherBackInvMassPt[fiCut]->Fill(backgroundCandidate->M(),backgroundCandidate->Pt()); | |
2331 | Double_t sparesFill[4] = {backgroundCandidate->M(),backgroundCandidate->Pt(),(Double_t)zbin,(Double_t)mbin}; | |
2332 | sESDMotherBackInvMassPtZM[fiCut]->Fill(sparesFill,1); | |
2333 | } | |
2334 | delete backgroundCandidate; | |
2335 | backgroundCandidate = 0x0; | |
2336 | } | |
2337 | } | |
2338 | } | |
2339 | } | |
2340 | else{ | |
2341 | for(Int_t nEventsInBG=0;nEventsInBG <fBGHandler[fiCut]->GetNBGEvents();nEventsInBG++){ | |
2342 | AliGammaConversionAODVector *previousEventV0s = fBGHandler[fiCut]->GetBGGoodV0s(zbin,mbin,nEventsInBG); | |
2343 | if(previousEventV0s){ | |
2344 | if(fMoveParticleAccordingToVertex == kTRUE){ | |
2345 | bgEventVertex = fBGHandler[fiCut]->GetBGEventVertex(zbin,mbin,nEventsInBG); | |
2346 | } | |
2347 | for(Int_t iCurrent=0;iCurrent<fGammaCandidates->GetEntries();iCurrent++){ | |
2348 | AliAODConversionPhoton currentEventGoodV0 = *(AliAODConversionPhoton*)(fGammaCandidates->At(iCurrent)); | |
2349 | for(UInt_t iPrevious=0;iPrevious<previousEventV0s->size();iPrevious++){ | |
2350 | ||
2351 | AliAODConversionPhoton previousGoodV0 = (AliAODConversionPhoton)(*(previousEventV0s->at(iPrevious))); | |
2352 | ||
2353 | if(fMoveParticleAccordingToVertex == kTRUE){ | |
2354 | MoveParticleAccordingToVertex(&previousGoodV0,bgEventVertex); | |
2355 | } | |
2356 | if(((AliConversionPhotonCuts*)fCutArray->At(fiCut))->GetInPlaneOutOfPlaneCut() != 0){ | |
2357 | RotateParticleAccordingToEP(&previousGoodV0,bgEventVertex->fEP,fEventPlaneAngle); | |
2358 | } | |
2359 | ||
2360 | ||
2361 | AliAODConversionMother *backgroundCandidate = new AliAODConversionMother(¤tEventGoodV0,&previousGoodV0); | |
2362 | backgroundCandidate->CalculateDistanceOfClossetApproachToPrimVtx(fInputEvent->GetPrimaryVertex()); | |
2363 | if((((AliConversionMesonCuts*)fMesonCutArray->At(fiCut)) | |
2364 | ->MesonIsSelected(backgroundCandidate,kFALSE,((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetEtaShift()))){ | |
2365 | hESDMotherBackInvMassPt[fiCut]->Fill(backgroundCandidate->M(),backgroundCandidate->Pt()); | |
2366 | Double_t sparesFill[4] = {backgroundCandidate->M(),backgroundCandidate->Pt(),(Double_t)zbin,(Double_t)mbin}; | |
2367 | sESDMotherBackInvMassPtZM[fiCut]->Fill(sparesFill,1); | |
2368 | } | |
2369 | delete backgroundCandidate; | |
2370 | backgroundCandidate = 0x0; | |
2371 | } | |
2372 | } | |
2373 | } | |
2374 | } | |
2375 | } | |
2376 | } | |
2bb2434e | 2377 | } |
e5b6e8a6 | 2378 | //________________________________________________________________________ |
2379 | void AliAnalysisTaskGammaConvV1::CalculateBackgroundRP(){ | |
2380 | ||
344100c4 | 2381 | Int_t zbin= fBGHandlerRP[fiCut]->GetZBinIndex(fInputEvent->GetPrimaryVertex()->GetZ()); |
2382 | Int_t mbin = 0; | |
2383 | if(((AliConversionMesonCuts*)fMesonCutArray->At(fiCut))->UseTrackMultiplicity()){ | |
2384 | mbin = fBGHandlerRP[fiCut]->GetMultiplicityBinIndex(fV0Reader->GetNumberOfPrimaryTracks()); | |
2385 | } else { | |
2386 | mbin = fBGHandlerRP[fiCut]->GetMultiplicityBinIndex(fGammaCandidates->GetEntries()); | |
2387 | } | |
2388 | ||
2389 | ||
2390 | //Rotation Method | |
2391 | if(((AliConversionMesonCuts*)fMesonCutArray->At(fiCut))->UseRotationMethod()){ | |
2392 | // Correct for the number of rotations | |
2393 | // BG is for rotation the same, except for factor NRotations | |
2394 | Double_t weight=1./Double_t(((AliConversionMesonCuts*)fMesonCutArray->At(fiCut))->GetNumberOfBGEvents()); | |
2395 | ||
2396 | for(Int_t firstGammaIndex=0;firstGammaIndex<fGammaCandidates->GetEntries();firstGammaIndex++){ | |
2397 | ||
2398 | AliAODConversionPhoton *gamma0=dynamic_cast<AliAODConversionPhoton*>(fGammaCandidates->At(firstGammaIndex)); | |
2399 | if (gamma0==NULL) continue; | |
2400 | for(Int_t secondGammaIndex=firstGammaIndex+1;secondGammaIndex<fGammaCandidates->GetEntries();secondGammaIndex++){ | |
2401 | AliAODConversionPhoton *gamma1=dynamic_cast<AliAODConversionPhoton*>(fGammaCandidates->At(secondGammaIndex)); | |
2402 | if (gamma1 == NULL) continue; | |
2403 | if(!((AliConversionPhotonCuts*)fCutArray->At(fiCut))->PhotonIsSelected(gamma1,fInputEvent))continue; | |
2404 | for(Int_t nRandom=0;nRandom<((AliConversionMesonCuts*)fMesonCutArray->At(fiCut))->GetNumberOfBGEvents();nRandom++){ | |
2405 | RotateParticle(gamma1); | |
2406 | AliAODConversionMother backgroundCandidate(gamma0,gamma1); | |
2407 | backgroundCandidate.CalculateDistanceOfClossetApproachToPrimVtx(fInputEvent->GetPrimaryVertex()); | |
2408 | if(((AliConversionMesonCuts*)fMesonCutArray->At(fiCut))->MesonIsSelected(&backgroundCandidate,kFALSE,((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetEtaShift())){ | |
2409 | hESDMotherBackInvMassPt[fiCut]->Fill(backgroundCandidate.M(),backgroundCandidate.Pt()); | |
2410 | Double_t sparesFill[4] = {backgroundCandidate.M(),backgroundCandidate.Pt(),(Double_t)zbin,(Double_t)mbin}; | |
2411 | sESDMotherBackInvMassPtZM[fiCut]->Fill(sparesFill,weight); | |
2412 | } | |
2413 | } | |
2414 | } | |
2415 | } | |
2416 | ||
2417 | } else { | |
2418 | // Do Event Mixing | |
2419 | for(Int_t nEventsInBG=0;nEventsInBG <fBGHandlerRP[fiCut]->GetNBGEvents(fGammaCandidates,fInputEvent);nEventsInBG++){ | |
2420 | ||
2421 | AliGammaConversionPhotonVector *previousEventGammas = fBGHandlerRP[fiCut]->GetBGGoodGammas(fGammaCandidates,fInputEvent,nEventsInBG); | |
2422 | ||
2423 | if(previousEventGammas){ | |
2424 | // test weighted background | |
2425 | Double_t weight=1.0; | |
2426 | // Correct for the number of eventmixing: | |
2427 | // N gammas -> (N-1) + (N-2) +(N-3) ...+ (N-(N-1)) using sum formula sum(i)=N*(N-1)/2 -> N*(N-1)/2 | |
2428 | // real combinations (since you cannot combine a photon with its own) | |
2429 | // but BG leads to N_{a}*N_{b} combinations | |
2430 | weight*=0.5*(Double_t(fGammaCandidates->GetEntries()-1))/Double_t(previousEventGammas->size()); | |
2431 | ||
2432 | for(Int_t iCurrent=0;iCurrent<fGammaCandidates->GetEntries();iCurrent++){ | |
2433 | ||
2434 | AliAODConversionPhoton *gamma0 = (AliAODConversionPhoton*)(fGammaCandidates->At(iCurrent)); | |
2435 | ||
2436 | for(UInt_t iPrevious=0;iPrevious<previousEventGammas->size();iPrevious++){ | |
2437 | ||
2438 | AliAODConversionPhoton *gamma1 = (AliAODConversionPhoton*)(previousEventGammas->at(iPrevious)); | |
2439 | ||
2440 | AliAODConversionMother backgroundCandidate(gamma0,gamma1); | |
2441 | backgroundCandidate.CalculateDistanceOfClossetApproachToPrimVtx(fInputEvent->GetPrimaryVertex()); | |
2442 | if(((AliConversionMesonCuts*)fMesonCutArray->At(fiCut)) | |
2443 | ->MesonIsSelected(&backgroundCandidate,kFALSE,((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetEtaShift())){ | |
2444 | hESDMotherBackInvMassPt[fiCut]->Fill(backgroundCandidate.M(),backgroundCandidate.Pt()); | |
2445 | Double_t sparesFill[4] = {backgroundCandidate.M(),backgroundCandidate.Pt(),(Double_t)zbin,(Double_t)mbin}; | |
2446 | sESDMotherBackInvMassPtZM[fiCut]->Fill(sparesFill,weight); | |
2447 | } | |
2448 | } | |
2449 | } | |
2450 | } | |
2451 | } | |
2452 | } | |
e5b6e8a6 | 2453 | } |
344100c4 | 2454 | |
2bb2434e | 2455 | //________________________________________________________________________ |
2456 | void AliAnalysisTaskGammaConvV1::RotateParticle(AliAODConversionPhoton *gamma){ | |
344100c4 | 2457 | Int_t fNDegreesPMBackground= ((AliConversionMesonCuts*)fMesonCutArray->At(fiCut))->NDegreesRotation(); |
2458 | Double_t nRadiansPM = fNDegreesPMBackground*TMath::Pi()/180; | |
2459 | Double_t rotationValue = fRandom.Rndm()*2*nRadiansPM + TMath::Pi()-nRadiansPM; | |
2460 | gamma->RotateZ(rotationValue); | |
2bb2434e | 2461 | } |
ae4f2cfb | 2462 | |
2463 | //________________________________________________________________________ | |
2464 | void AliAnalysisTaskGammaConvV1::RotateParticleAccordingToEP(AliAODConversionPhoton *gamma, Double_t previousEventEP, Double_t thisEventEP){ | |
2465 | ||
344100c4 | 2466 | previousEventEP=previousEventEP+TMath::Pi(); |
2467 | thisEventEP=thisEventEP+TMath::Pi(); | |
2468 | Double_t rotationValue= thisEventEP-previousEventEP; | |
2469 | gamma->RotateZ(rotationValue); | |
ae4f2cfb | 2470 | } |
2471 | ||
2bb2434e | 2472 | //________________________________________________________________________ |
2473 | void AliAnalysisTaskGammaConvV1::MoveParticleAccordingToVertex(AliAODConversionPhoton* particle,const AliGammaConversionAODBGHandler::GammaConversionVertex *vertex){ | |
344100c4 | 2474 | //see header file for documentation |
2bb2434e | 2475 | |
344100c4 | 2476 | Double_t dx = vertex->fX - fInputEvent->GetPrimaryVertex()->GetX(); |
2477 | Double_t dy = vertex->fY - fInputEvent->GetPrimaryVertex()->GetY(); | |
2478 | Double_t dz = vertex->fZ - fInputEvent->GetPrimaryVertex()->GetZ(); | |
2bb2434e | 2479 | |
344100c4 | 2480 | Double_t movedPlace[3] = {particle->GetConversionX() - dx,particle->GetConversionY() - dy,particle->GetConversionZ() - dz}; |
2481 | particle->SetConversionPoint(movedPlace); | |
2bb2434e | 2482 | } |
344100c4 | 2483 | |
2bb2434e | 2484 | //________________________________________________________________________ |
2485 | void AliAnalysisTaskGammaConvV1::UpdateEventByEventData(){ | |
344100c4 | 2486 | //see header file for documentation |
2487 | if(fGammaCandidates->GetEntries() >0 ){ | |
2488 | if(((AliConversionMesonCuts*)fMesonCutArray->At(fiCut))->UseTrackMultiplicity()){ | |
2489 | fBGHandler[fiCut]->AddEvent(fGammaCandidates,fInputEvent->GetPrimaryVertex()->GetX(),fInputEvent->GetPrimaryVertex()->GetY(),fInputEvent->GetPrimaryVertex()->GetZ(),fV0Reader->GetNumberOfPrimaryTracks(),fEventPlaneAngle); | |
2490 | } | |
2491 | else{ // means we use #V0s for multiplicity | |
2492 | fBGHandler[fiCut]->AddEvent(fGammaCandidates,fInputEvent->GetPrimaryVertex()->GetX(),fInputEvent->GetPrimaryVertex()->GetY(),fInputEvent->GetPrimaryVertex()->GetZ(),fGammaCandidates->GetEntries(),fEventPlaneAngle); | |
2493 | } | |
2494 | } | |
2bb2434e | 2495 | } |
2496 | ||
2bb2434e | 2497 | //________________________________________________________________________ |
ae947965 | 2498 | void AliAnalysisTaskGammaConvV1::FillPhotonCombinatorialBackgroundHist(AliAODConversionPhoton *TruePhotonCandidate, Int_t pdgCode[]) |
2499 | { | |
344100c4 | 2500 | // Combinatorial Bck = 0 ee, 1 ep,i 2 ek, 3 ep, 4 emu, 5 pipi, 6 pik, 7 pip, 8 pimu, 9 kk, 10 kp, 11 kmu, 12 pp, 13 pmu, 14 mumu, 15 Rest |
2501 | if(pdgCode[0]==11 && pdgCode[1]==11){if(fIsFromMBHeader)hESDCombinatorialPt[fiCut]->Fill(TruePhotonCandidate->Pt(),0);} | |
2502 | else if( (pdgCode[0]==11 && pdgCode[1]==211) || (pdgCode[0]==211 && pdgCode[1]==11) ) | |
2503 | {if(fIsFromMBHeader)hESDCombinatorialPt[fiCut]->Fill(TruePhotonCandidate->Pt(),1);} | |
2504 | else if( (pdgCode[0]==11 && pdgCode[1]==321) || (pdgCode[0]==321 && pdgCode[1]==11) ) | |
2505 | {if(fIsFromMBHeader)hESDCombinatorialPt[fiCut]->Fill(TruePhotonCandidate->Pt(),2);} | |
2506 | else if( (pdgCode[0]==11 && pdgCode[1]==2212) || (pdgCode[0]==2212 && pdgCode[1]==11) ) | |
2507 | {if(fIsFromMBHeader)hESDCombinatorialPt[fiCut]->Fill(TruePhotonCandidate->Pt(),3);} | |
2508 | else if( (pdgCode[0]==11 && pdgCode[1]==13) || (pdgCode[0]==13 && pdgCode[1]==11) ) | |
2509 | {if(fIsFromMBHeader)hESDCombinatorialPt[fiCut]->Fill(TruePhotonCandidate->Pt(),4);} | |
2510 | else if( pdgCode[0]==211 && pdgCode[1]==211 ){if(fIsFromMBHeader)hESDCombinatorialPt[fiCut]->Fill(TruePhotonCandidate->Pt(),5);} | |
2511 | else if( (pdgCode[0]==211 && pdgCode[1]==321) || (pdgCode[0]==321 && pdgCode[1]==211) ) | |
2512 | {if(fIsFromMBHeader)hESDCombinatorialPt[fiCut]->Fill(TruePhotonCandidate->Pt(),6);} | |
2513 | else if( (pdgCode[0]==211 && pdgCode[1]==2212) || (pdgCode[0]==2212 && pdgCode[1]==211) ) | |
2514 | {if(fIsFromMBHeader)hESDCombinatorialPt[fiCut]->Fill(TruePhotonCandidate->Pt(),7);} | |
2515 | else if( (pdgCode[0]==211 && pdgCode[1]==13) || (pdgCode[0]==13 && pdgCode[1]==211) ) | |
2516 | {if(fIsFromMBHeader)hESDCombinatorialPt[fiCut]->Fill(TruePhotonCandidate->Pt(),8);} | |
2517 | else if( pdgCode[0]==321 && pdgCode[1]==321 ){if(fIsFromMBHeader)hESDCombinatorialPt[fiCut]->Fill(TruePhotonCandidate->Pt(),9);} | |
2518 | else if( (pdgCode[0]==321 && pdgCode[1]==2212) || (pdgCode[0]==2212 && pdgCode[1]==321) ) | |
2519 | {if(fIsFromMBHeader)hESDCombinatorialPt[fiCut]->Fill(TruePhotonCandidate->Pt(),10);} | |
2520 | else if( (pdgCode[0]==321 && pdgCode[1]==13) || (pdgCode[0]==13 && pdgCode[1]==321) ) | |
2521 | {if(fIsFromMBHeader)hESDCombinatorialPt[fiCut]->Fill(TruePhotonCandidate->Pt(),11);} | |
2522 | else if( pdgCode[0]==2212 && pdgCode[1]==2212 ){if(fIsFromMBHeader)hESDCombinatorialPt[fiCut]->Fill(TruePhotonCandidate->Pt(),12);} | |
2523 | else if( (pdgCode[0]==2212 && pdgCode[1]==13) || (pdgCode[0]==13 && pdgCode[1]==2212) ) | |
2524 | {if(fIsFromMBHeader)hESDCombinatorialPt[fiCut]->Fill(TruePhotonCandidate->Pt(),13);} | |
2525 | else if( pdgCode[0]==13 && pdgCode[1]==13 ){if(fIsFromMBHeader)hESDCombinatorialPt[fiCut]->Fill(TruePhotonCandidate->Pt(),14);} | |
2526 | else {if(fIsFromMBHeader)hESDCombinatorialPt[fiCut]->Fill(TruePhotonCandidate->Pt(),15);} | |
ae947965 | 2527 | } |
344100c4 | 2528 | |
ae947965 | 2529 | //________________________________________________________________________ |
2530 | void AliAnalysisTaskGammaConvV1::RelabelAODPhotonCandidates(Bool_t mode){ | |
2531 | ||
344100c4 | 2532 | // Relabeling For AOD Event |
2533 | // ESDiD -> AODiD | |
2534 | // MCLabel -> AODMCLabel | |
2535 | ||
2536 | if(mode){ | |
2537 | fMCStackPos = new Int_t[fReaderGammas->GetEntries()]; | |
2538 | fMCStackNeg = new Int_t[fReaderGammas->GetEntries()]; | |
2539 | fESDArrayPos = new Int_t[fReaderGammas->GetEntries()]; | |
2540 | fESDArrayNeg = new Int_t[fReaderGammas->GetEntries()]; | |
2541 | } | |
2542 | ||
2543 | for(Int_t iGamma = 0;iGamma<fReaderGammas->GetEntries();iGamma++){ | |
2544 | AliAODConversionPhoton* PhotonCandidate = (AliAODConversionPhoton*) fReaderGammas->At(iGamma); | |
2545 | if(!PhotonCandidate) continue; | |
2546 | if(!mode){// Back to ESD Labels | |
2547 | PhotonCandidate->SetMCLabelPositive(fMCStackPos[iGamma]); | |
2548 | PhotonCandidate->SetMCLabelNegative(fMCStackNeg[iGamma]); | |
2549 | PhotonCandidate->SetLabelPositive(fESDArrayPos[iGamma]); | |
2550 | PhotonCandidate->SetLabelNegative(fESDArrayNeg[iGamma]); | |
2551 | continue; | |
2552 | } | |
2553 | fMCStackPos[iGamma] = PhotonCandidate->GetMCLabelPositive(); | |
2554 | fMCStackNeg[iGamma] = PhotonCandidate->GetMCLabelNegative(); | |
2555 | fESDArrayPos[iGamma] = PhotonCandidate->GetTrackLabelPositive(); | |
2556 | fESDArrayNeg[iGamma] = PhotonCandidate->GetTrackLabelNegative(); | |
2557 | ||
2558 | Bool_t AODLabelPos = kFALSE; | |
2559 | Bool_t AODLabelNeg = kFALSE; | |
2560 | ||
2561 | for(Int_t i = 0; i<fInputEvent->GetNumberOfTracks();i++){ | |
2562 | AliAODTrack *tempDaughter = static_cast<AliAODTrack*>(fInputEvent->GetTrack(i)); | |
2563 | if(!AODLabelPos){ | |
2564 | if( tempDaughter->GetID() == PhotonCandidate->GetTrackLabelPositive() ){ | |
2565 | PhotonCandidate->SetMCLabelPositive(abs(tempDaughter->GetLabel())); | |
2566 | PhotonCandidate->SetLabelPositive(i); | |
2567 | AODLabelPos = kTRUE; | |
2568 | } | |
2569 | } | |
2570 | if(!AODLabelNeg){ | |
2571 | if( tempDaughter->GetID() == PhotonCandidate->GetTrackLabelNegative()){ | |
2572 | PhotonCandidate->SetMCLabelNegative(abs(tempDaughter->GetLabel())); | |
2573 | PhotonCandidate->SetLabelNegative(i); | |
2574 | AODLabelNeg = kTRUE; | |
2575 | } | |
2576 | } | |
2577 | if(AODLabelNeg && AODLabelPos){ | |
2578 | break; | |
2579 | } | |
2580 | } | |
2581 | if(!AODLabelPos || !AODLabelNeg){ | |
2582 | cout<<"WARNING!!! AOD TRACKS NOT FOUND FOR"<<endl; | |
2583 | } | |
2584 | } | |
2585 | ||
2586 | ||
2587 | if(!mode){ | |
2588 | delete[] fMCStackPos; | |
2589 | delete[] fMCStackNeg; | |
2590 | delete[] fESDArrayPos; | |
2591 | delete[] fESDArrayNeg; | |
2592 | } | |
ae947965 | 2593 | } |
d8b864f8 | 2594 | |
344100c4 | 2595 | //________________________________________________________________________ |
d8b864f8 | 2596 | void AliAnalysisTaskGammaConvV1::SetLogBinningXTH2(TH2* histoRebin){ |
344100c4 | 2597 | TAxis *axisafter = histoRebin->GetXaxis(); |
2598 | Int_t bins = axisafter->GetNbins(); | |
2599 | Double_t from = axisafter->GetXmin(); | |
2600 | Double_t to = axisafter->GetXmax(); | |
2601 | Double_t *newbins = new Double_t[bins+1]; | |
2602 | newbins[0] = from; | |
2603 | Double_t factor = TMath::Power(to/from, 1./bins); | |
2604 | for(Int_t i=1; i<=bins; ++i) newbins[i] = factor * newbins[i-1]; | |
2605 | axisafter->Set(bins, newbins); | |
2606 | delete [] newbins; | |
d8b864f8 FB |
2607 | } |
2608 | ||
ae947965 | 2609 | //________________________________________________________________________ |
2bb2434e | 2610 | void AliAnalysisTaskGammaConvV1::Terminate(const Option_t *) |
2611 | { | |
e5b6e8a6 | 2612 | |
a280ac15 | 2613 | //fOutputContainer->Print(); // Will crash on GRID |
2bb2434e | 2614 | } |
d9d6352b | 2615 | |
2616 | //________________________________________________________________________ | |
2617 | Int_t AliAnalysisTaskGammaConvV1::GetSourceClassification(Int_t daughter, Int_t pdgCode){ | |
2618 | ||
2619 | if (daughter == 111) { | |
2620 | if (abs(pdgCode) == 310) return 1; // k0s | |
2621 | else if (abs(pdgCode) == 3122) return 2; // Lambda | |
2622 | else if (abs(pdgCode) == 130) return 3; // K0L | |
2623 | else if (abs(pdgCode) == 2212) return 4; // proton | |
2624 | else if (abs(pdgCode) == 2112) return 5; // neutron | |
2625 | else if (abs(pdgCode) == 211) return 6; // pion | |
2626 | else if (abs(pdgCode) == 321) return 7; // kaon | |
2627 | else if (abs(pdgCode) == 113 || abs(pdgCode) == 213 ) return 8; // rho 0,+,- | |
2628 | else if (abs(pdgCode) == 3222 || abs(pdgCode) == 3212 || abs(pdgCode) == 3112 ) return 9; // Sigma | |
2629 | else if (abs(pdgCode) == 2224 || abs(pdgCode) == 2214 || abs(pdgCode) == 2114 || abs(pdgCode) == 1114 ) return 10; // Delta | |
2630 | else if (abs(pdgCode) == 313 || abs(pdgCode) == 323 ) return 11; // K* | |
2631 | else return 15; | |
2632 | } | |
2633 | return 15; | |
2634 | ||
2635 | } |