AliPhysics  9b6b435 (9b6b435)
AliAnalysisTaskGammaCaloIso.cxx
Go to the documentation of this file.
1 /**************************************************************************
2  * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3  * *
4  * Author: Baldo Sahlmueller, Friederike Bock *
5  * Version 1.0 *
6  * *
7  * *
8  * Permission to use, copy, modify and distribute this software and its *
9  * documentation strictly for non-commercial purposes is hereby granted *
10  * without fee, provided that the above copyright notice appears in all *
11  * copies and that both the copyright notice and this permission notice *
12  * appear in the supporting documentation. The authors make no claims *
13  * about the suitability of this software for any purpose. It is *
14  * provided "as is" without express or implied warranty. *
15  **************************************************************************/
16 
18 //----------------------------------------------------------------
19 // Class used to do analysis on conversion photons + calo photons
20 //----------------------------------------------------------------
22 #include "TChain.h"
23 #include "TTree.h"
24 #include "TBranch.h"
25 #include "TFile.h"
26 #include "TH1F.h"
27 #include "TH2F.h"
28 #include "TH3F.h"
29 #include "THnSparse.h"
30 #include "TCanvas.h"
31 #include "TNtuple.h"
32 #include "AliAnalysisTask.h"
33 #include "AliAnalysisManager.h"
34 #include "AliESDEvent.h"
35 #include "AliESDInputHandler.h"
36 #include "AliMCEventHandler.h"
37 #include "AliMCEvent.h"
38 #include "AliMCParticle.h"
39 #include "AliCentrality.h"
40 #include "AliESDVZERO.h"
41 #include "AliESDpid.h"
43 #include "AliVParticle.h"
44 #include "AliESDtrack.h"
45 #include "AliESDtrackCuts.h"
46 #include "AliKFVertex.h"
47 #include "AliV0ReaderV1.h"
48 #include "AliGenCocktailEventHeader.h"
49 #include "AliAODMCParticle.h"
50 #include "AliAODMCHeader.h"
51 #include "AliEventplane.h"
53 #include "AliAODEvent.h"
54 #include "AliAODInputHandler.h"
55 #include "AliESDEvent.h"
56 #include "AliESDInputHandler.h"
57 #include "AliInputEventHandler.h"
58 #include "AliCaloTrackMatcher.h"
59 #include "AliPhotonIsolation.h"
60 #include <vector>
61 #include <map>
62 #include <fstream>
63 
65 
66 //________________________________________________________________________
68  fV0Reader(NULL),
69  fV0ReaderName("V0ReaderV1"),
70  fCorrTaskSetting(""),
71  fBGHandler(NULL),
72  fInputEvent(NULL),
73  fMCEvent(NULL),
74  fCutFolder(NULL),
75  fESDList(NULL),
76  fIsolation(NULL),
77  fBackList(NULL),
78  fMotherList(NULL),
79  fTrueList(NULL),
80  fMCList(NULL),
81  fTreeList(NULL),
82  fClusterTreeList(NULL),
83  fOutputContainer(NULL),
84  fClusterCandidates(NULL),
85  fIsoCandidates(NULL),
86  fEventCutArray(NULL),
87  fEventCuts(NULL),
88  fClusterCutArray(NULL),
89  fCaloPhotonCuts(NULL),
90  fMesonCutArray(NULL),
91  fMesonCuts(NULL),
92  fConvJetReader(NULL),
93  fDoJetAnalysis(kFALSE),
94  fDoJetQA(kFALSE),
95  fJetHistograms(NULL),
96  fTrueJetHistograms(NULL),
97  fHistoMotherInvMassPt(NULL),
98  fSparseMotherInvMassPtZM(NULL),
99  fHistoMotherBackInvMassPt(NULL),
100  fSparseMotherBackInvMassPtZM(NULL),
101  fHistoMotherPi0PtY(NULL),
102  fHistoMotherEtaPtY(NULL),
103  fHistoMotherPi0PtAlpha(NULL),
104  fHistoMotherEtaPtAlpha(NULL),
105  fHistoMotherPi0PtOpenAngle(NULL),
106  fHistoMotherEtaPtOpenAngle(NULL),
107  fHistoMotherPtOpenAngle(NULL),
108  fHistoMotherPtOpenAngleBck(NULL),
109  fHistoMotherPi0NGoodESDTracksPt(NULL),
110  fHistoMotherEtaNGoodESDTracksPt(NULL),
111  fHistoMotherInvMassECalib(NULL),
112  fHistoMotherBackInvMassECalib(NULL),
113  fHistoClusterCandidates(NULL),
114  fHistoClusterCandidatesBinning(NULL),
115  fHistoFailIsolationCut(NULL),
116  fHistoIsoClusterPDGtoPt(NULL),
117  fHistoIsoMotherPDGtoPt(NULL),
118  fVectorDoubleCountMCInitIsoPhotons(0),
119  fHistoDoubleCountMCIsoInitPhotonPt(NULL),
120  fHistoTruePhotonCandidatesIso(NULL),
121  fHistoTruePhotonsfromPi0DirectIso(NULL),
122  fHistoTruePhotonsfromPi0DirectIsoBinning(NULL),
123  fHistoTrueFragPhotonsDirectIso(NULL),
124  fHistoTruePromptPhotonsDirectIso(NULL),
125  fHistoTruePhotonsfromPi0ConvIso(NULL),
126  fHistoTruePhotonsfromPi0ConvIsoBinning(NULL),
127  fHistoTrueFragPhotonsConvIso(NULL),
128  fHistoTruePromptPhotonsConvIso(NULL),
129  fHistoTrueOtherSourcesIso(NULL),
130  fHistoTruePi0DecayCandNoConv(NULL),
131  fHistoTruePi0DecayCand(NULL),
132  fHistoTruePi0DecayCandNoConvBinning(NULL),
133  fHistoTruePi0DecayCandBinning(NULL),
134  fHistoClusGammaPt(NULL),
135  fHistoClusGammaE(NULL),
136  fHistoClusOverlapHeadersGammaPt(NULL),
137  fHistoClusAllHeadersGammaPt(NULL),
138  fHistoClusRejectedHeadersGammaPt(NULL),
139  fHistoClusGammaPtM02(NULL),
140  fHistoMCHeaders(NULL),
141  fHistoMCAllGammaPt(NULL),
142  fHistoMCAllSecondaryGammaPt(NULL),
143  fHistoMCDecayGammaPi0Pt(NULL),
144  fHistoMCDecayGammaRhoPt(NULL),
145  fHistoMCDecayGammaEtaPt(NULL),
146  fHistoMCDecayGammaOmegaPt(NULL),
147  fHistoMCDecayGammaEtapPt(NULL),
148  fHistoMCDecayGammaPhiPt(NULL),
149  fHistoMCDecayGammaSigmaPt(NULL),
150  fHistoMCPi0Pt(NULL),
151  fHistoMCPi0WOWeightPt(NULL),
152  fHistoMCPi0WOEvtWeightPt(NULL),
153  fHistoMCEtaPt(NULL),
154  fHistoMCEtaWOWeightPt(NULL),
155  fHistoMCEtaWOEvtWeightPt(NULL),
156  fHistoMCPi0InAccPt(NULL),
157  fHistoMCEtaInAccPt(NULL),
158  fHistoMCPi0WOEvtWeightInAccPt(NULL),
159  fHistoMCEtaWOEvtWeightInAccPt(NULL),
160  fHistoMCPi0PtY(NULL),
161  fHistoMCEtaPtY(NULL),
162  fHistoMCPi0PtAlpha(NULL),
163  fHistoMCEtaPtAlpha(NULL),
164  fHistoMCPrimaryPtvsSource(NULL),
165  fHistoMCSecPi0PtvsSource(NULL),
166  fHistoMCSecPi0Source(NULL),
167  fHistoMCSecPi0InAccPtvsSource(NULL),
168  fHistoMCSecEtaPt(NULL),
169  fHistoMCSecEtaSource(NULL),
170  fHistoMCPi0PtJetPt(NULL),
171  fHistoMCEtaPtJetPt(NULL),
172  fHistoTruePi0InvMassPt(NULL),
173  fHistoTruePi0noConvInvMassPt(NULL),
174  fHistoTrueEtaInvMassPt(NULL),
175  fHistoTruePi0CaloPhotonInvMassPt(NULL),
176  fHistoTrueEtaCaloPhotonInvMassPt(NULL),
177  fHistoTruePi0CaloConvertedPhotonInvMassPt(NULL),
178  fHistoTrueEtaCaloConvertedPhotonInvMassPt(NULL),
179  fHistoTruePi0CaloMixedPhotonConvPhotonInvMassPt(NULL),
180  fHistoTrueEtaCaloMixedPhotonConvPhotonInvMassPt(NULL),
181  fHistoTruePi0CaloElectronInvMassPt(NULL),
182  fHistoTrueEtaCaloElectronInvMassPt(NULL),
183  fHistoTruePi0CaloMergedClusterInvMassPt(NULL),
184  fHistoTrueEtaCaloMergedClusterInvMassPt(NULL),
185  fHistoTruePi0CaloMergedClusterPartConvInvMassPt(NULL),
186  fHistoTrueEtaCaloMergedClusterPartConvInvMassPt(NULL),
187  fHistoTruePi0NonMergedElectronPhotonInvMassPt(NULL),
188  fHistoTruePi0NonMergedElectronMergedPhotonInvMassPt(NULL),
189  fHistoTruePi0Category1(NULL),
190  fHistoTrueEtaCategory1(NULL),
191  fHistoTruePi0Category2(NULL),
192  fHistoTrueEtaCategory2(NULL),
193  fHistoTruePi0Category3(NULL),
194  fHistoTrueEtaCategory3(NULL),
195  fHistoTruePi0Category4_6(NULL),
196  fHistoTrueEtaCategory4_6(NULL),
197  fHistoTruePi0Category5(NULL),
198  fHistoTrueEtaCategory5(NULL),
199  fHistoTruePi0Category7(NULL),
200  fHistoTrueEtaCategory7(NULL),
201  fHistoTruePi0Category8(NULL),
202  fHistoTrueEtaCategory8(NULL),
203  fHistoTruePrimaryPi0InvMassPt(NULL),
204  fHistoTruePrimaryEtaInvMassPt(NULL),
205  fHistoTruePrimaryPi0W0WeightingInvMassPt(NULL),
206  fHistoTruePrimaryEtaW0WeightingInvMassPt(NULL),
207  fProfileTruePrimaryPi0WeightsInvMassPt(NULL),
208  fProfileTruePrimaryEtaWeightsInvMassPt(NULL),
209  fHistoTruePrimaryPi0MCPtResolPt(NULL),
210  fHistoTruePrimaryEtaMCPtResolPt(NULL),
211  fHistoTrueSecondaryPi0InvMassPt(NULL),
212  fHistoTrueSecondaryPi0FromK0sInvMassPt(NULL),
213  fHistoTrueK0sWithPi0DaughterMCPt(NULL),
214  fHistoTrueSecondaryPi0FromK0lInvMassPt(NULL),
215  fHistoTrueK0lWithPi0DaughterMCPt(NULL),
216  fHistoTrueSecondaryPi0FromEtaInvMassPt(NULL),
217  fHistoTrueEtaWithPi0DaughterMCPt(NULL),
218  fHistoTrueSecondaryPi0FromLambdaInvMassPt(NULL),
219  fHistoTrueLambdaWithPi0DaughterMCPt(NULL),
220  fHistoTrueBckGGInvMassPt(NULL),
221  fHistoTrueBckFullMesonContainedInOneClusterInvMassPt(NULL),
222  fHistoTrueBckAsymEClustersInvMassPt(NULL),
223  fHistoTrueBckContInvMassPt(NULL),
224  fHistoTruePi0PtY(NULL),
225  fHistoTrueEtaPtY(NULL),
226  fHistoTruePi0PtAlpha(NULL),
227  fHistoTrueEtaPtAlpha(NULL),
228  fHistoTruePi0PtOpenAngle(NULL),
229  fHistoTrueEtaPtOpenAngle(NULL),
230  fHistoClusPhotonBGPt(NULL),
231  fHistoClusPhotonPlusConvBGPt(NULL),
232  fHistoClustPhotonElectronBGPtM02(NULL),
233  fHistoClustPhotonPionBGPtM02(NULL),
234  fHistoClustPhotonKaonBGPtM02(NULL),
235  fHistoClustPhotonK0lBGPtM02(NULL),
236  fHistoClustPhotonNeutronBGPtM02(NULL),
237  fHistoClustPhotonRestBGPtM02(NULL),
238  fHistoClustPhotonPlusConvElectronBGPtM02(NULL),
239  fHistoClustPhotonPlusConvPionBGPtM02(NULL),
240  fHistoClustPhotonPlusConvKaonBGPtM02(NULL),
241  fHistoClustPhotonPlusConvK0lBGPtM02(NULL),
242  fHistoClustPhotonPlusConvNeutronBGPtM02(NULL),
243  fHistoClustPhotonPlusConvRestBGPtM02(NULL),
244  fHistoTrueClusGammaPt(NULL),
245  fHistoTrueClusUnConvGammaPt(NULL),
246  fHistoTrueClusUnConvGammaMCPt(NULL),
247  fHistoTrueClusGammaPtM02(NULL),
248  fHistoTrueClusUnConvGammaPtM02(NULL),
249  fHistoTrueClusElectronPt(NULL),
250  fHistoTrueClusConvGammaPt(NULL),
251  fHistoTrueClusConvGammaMCPt(NULL),
252  fHistoTrueClusConvGammaFullyPt(NULL),
253  fHistoTrueClusMergedGammaPt(NULL),
254  fHistoTrueClusMergedPartConvGammaPt(NULL),
255  fHistoTrueClusDalitzPt(NULL),
256  fHistoTrueClusDalitzMergedPt(NULL),
257  fHistoTrueClusPhotonFromElecMotherPt(NULL),
258  fHistoTrueClusShowerPt(NULL),
259  fHistoTrueClusSubLeadingPt(NULL),
260  fHistoTrueClusNParticles(NULL),
261  fHistoTrueClusEMNonLeadingPt(NULL),
262  fHistoTrueNLabelsInClus(NULL),
263  fHistoTruePrimaryClusGammaPt(NULL),
264  fHistoTruePrimaryClusGammaESDPtMCPt(NULL),
265  fHistoTruePrimaryClusConvGammaPt(NULL),
266  fHistoTruePrimaryClusConvGammaESDPtMCPt(NULL),
267  fHistoTrueSecondaryClusGammaPt(NULL),
268  fHistoTrueSecondaryClusConvGammaPt(NULL),
269  fHistoTrueSecondaryClusGammaMCPt(NULL),
270  fHistoTrueSecondaryClusConvGammaMCPt(NULL),
271  fHistoTrueSecondaryClusGammaFromXFromK0sMCPtESDPt(NULL),
272  fHistoTrueSecondaryClusConvGammaFromXFromK0sMCPtESDPt(NULL),
273  fHistoTrueSecondaryClusGammaFromXFromK0lMCPtESDPt(NULL),
274  fHistoTrueSecondaryClusConvGammaFromXFromK0lMCPtESDPt(NULL),
275  fHistoTrueSecondaryClusGammaFromXFromLambdaMCPtESDPt(NULL),
276  fHistoTrueSecondaryClusConvGammaFromXFromLambdaMCPtESDPt(NULL),
277  fHistoDoubleCountTruePi0InvMassPt(NULL),
278  fHistoDoubleCountTrueEtaInvMassPt(NULL),
279  fHistoDoubleCountTrueClusterGammaPt(NULL),
280  fVectorDoubleCountTruePi0s(0),
281  fVectorDoubleCountTrueEtas(0),
282  fVectorDoubleCountTrueClusterGammas(0),
283  fHistoMultipleCountTrueClusterGamma(NULL),
284  fMapMultipleCountTrueClusterGammas(),
285  fHistoTruePi0InvMassPtAlpha(NULL),
286  fHistoTruePi0PureGammaInvMassPtAlpha(NULL),
287  fHistCellIDvsClusterEnergy(NULL),
288  fHistCellIDvsClusterEnergyMax(NULL),
289  fHistoNEvents(NULL),
290  fHistoNEventsWOWeight(NULL),
291  fHistoNGoodESDTracks(NULL),
292  fHistoVertexZ(NULL),
293  fHistoNGammaCandidates(NULL),
294  fHistoNGammaCandidatesBasic(NULL),
295  fHistoNGoodESDTracksVsNGammaCandidates(NULL),
296  fHistoSPDClusterTrackletBackground(NULL),
297  fHistoNV0Tracks(NULL),
298  fProfileEtaShift(NULL),
299  fProfileJetJetXSection(NULL),
300  fHistoJetJetNTrials(NULL),
301  fHistoEventSphericity(NULL),
302  fHistoEventSphericityvsNtracks(NULL),
303  fHistoPtJet(NULL),
304  fHistoJetEta(NULL),
305  fHistoJetPhi(NULL),
306  fHistoJetArea(NULL),
307  fHistoNJets(NULL),
308  fHistoEventwJets(NULL),
309  fHistoJetPi0PtRatio(NULL),
310  fHistoDoubleCounting(NULL),
311  fHistoJetMotherInvMassPt(NULL),
312  fHistoPi0InJetMotherInvMassPt(NULL),
313  fHistoMotherBackJetInvMassPt(NULL),
314  fHistoRJetPi0Cand(NULL),
315  fHistoEtaPhiJetPi0Cand(NULL),
316  fHistoEtaPhiJetWithPi0Cand(NULL),
317  fHistoJetFragmFunc(NULL),
318  fHistoTruevsRecJetPt(NULL),
319  fHistoTruePi0JetMotherInvMassPt(NULL),
320  fHistoTruePi0InJetMotherInvMassPt(NULL),
321  fHistoTruePrimaryPi0JetInvMassPt(NULL),
322  fHistoTruePrimaryPi0inJetInvMassPt(NULL),
323  fHistoTrueDoubleCountingPi0Jet(NULL),
324  fHistoTrueEtaJetMotherInvMassPt(NULL),
325  fHistoTrueEtaInJetMotherInvMassPt(NULL),
326  fHistoTruePrimaryEtaJetInvMassPt(NULL),
327  fHistoTruePrimaryEtainJetInvMassPt(NULL),
328  fHistoTrueDoubleCountingEtaJet(NULL),
329  fHistoTruePi0JetFragmFunc(NULL),
330  fHistoTrueEtaJetFragmFunc(NULL),
331  fHistoMCPi0JetInAccPt(NULL),
332  fHistoMCPi0inJetInAccPt(NULL),
333  fHistoMCEtaJetInAccPt(NULL),
334  fHistoMCEtainJetInAccPt(NULL),
335  fHistoTrueSecondaryPi0FromK0sJetInvMassPt(NULL),
336  fHistoTrueSecondaryPi0FromK0sinJetInvMassPt(NULL),
337  fHistoTrueSecondaryPi0FromLambdaJetInvMassPt(NULL),
338  fHistoTrueSecondaryPi0FromLambdainJetInvMassPt(NULL),
339  fHistoTrueSecondaryPi0FromK0lJetInvMassPt(NULL),
340  fHistoTrueSecondaryPi0FromK0linJetInvMassPt(NULL),
341  fHistoTrueSecondaryPi0InvJetMassPt(NULL),
342  fHistoTrueSecondaryPi0InvinJetMassPt(NULL),
343  fVectorJetPt(0),
344  fVectorJetPx(0),
345  fVectorJetPy(0),
346  fVectorJetPz(0),
347  fVectorJetEta(0),
348  fVectorJetPhi(0),
349  fVectorJetArea(0),
350  fTrueVectorJetPt(0),
351  fTrueVectorJetPx(0),
352  fTrueVectorJetPy(0),
353  fTrueVectorJetPz(0),
354  fTrueVectorJetEta(0),
355  fTrueVectorJetPhi(0),
356  tTrueInvMassROpenABPtFlag(NULL),
357  fInvMass(-1),
358  fRconv(-1),
359  fOpenRPrim(-1),
360  fInvMassRTOF(-1),
361  fPt(-1),
362  iFlag(3),
363  tSigInvMassPtAlphaTheta(NULL),
364  tBckInvMassPtAlphaTheta(NULL),
365  fInvMassTreeInvMass(0),
366  fInvMassTreePt(0),
367  fInvMassTreeAlpha(0),
368  fInvMassTreeTheta(0),
369  fInvMassTreeMixPool(0),
370  fInvMassTreeZVertex(0),
371  fInvMassTreeEta(0),
372  tClusterEOverP(NULL),
373  fClusterE(0),
374  fClusterM02(0),
375  fClusterM20(0),
376  fClusterEP(0),
377  fClusterLeadCellID(0),
378  fClusterClassification(0),
379  fDeltaEta(0),
380  fDeltaPhi(0),
381  fTrackPt(0),
382  fTrackPID_e(0),
383  fTrackPID_Pi(0),
384  fTrackPID_K(0),
385  fTrackPID_P(0),
386  fClusterIsoSumClusterEt(0),
387  fClusterIsoSumTrackEt(0),
388 // fHistoTruePi0NonLinearity(NULL),
389 // fHistoTrueEtaNonLinearity(NULL),
390  tTreeJetPi0Correlations(NULL),
391  fJetPt(0),
392  fTrueJetPt(0),
393  fPi0Pt(0),
394  fPi0InvMass(0),
395  fEventPlaneAngle(-100),
396  fRandom(0),
397  fnCuts(0),
398  fiCut(0),
399  fIsHeavyIon(0),
400  fDoLightOutput(kFALSE),
401  fDoMesonAnalysis(kTRUE),
402  fDoMesonQA(0),
403  fDoClusterQA(0),
404  fIsFromDesiredHeader(kTRUE),
405  fIsOverlappingWithOtherHeader(kFALSE),
406  fIsMC(0),
407  fDoTHnSparse(kTRUE),
408  fSetPlotHistsExtQA(kFALSE),
409  fDoSoftAnalysis(kFALSE),
410  fWeightJetJetMC(1),
411  fDoInOutTimingCluster(kFALSE),
412  fMinTimingCluster(0),
413  fMaxTimingCluster(0),
414  fEnableSortForClusMC(kFALSE),
415  fProduceCellIDPlots(kFALSE),
416  fProduceTreeEOverP(kFALSE),
417  tBrokenFiles(NULL),
418  fFileNameBroken(NULL),
419  tClusterQATree(NULL),
420  fCloseHighPtClusters(NULL),
421  fLocalDebugFlag(0),
422  fAllowOverlapHeaders(kTRUE),
423  fNCurrentClusterBasic(0),
424  fTrackMatcherRunningMode(0)
425 {
426 
427 }
428 
429 //________________________________________________________________________
431  AliAnalysisTaskSE(name),
432  fV0Reader(NULL),
433  fV0ReaderName("V0ReaderV1"),
434  fCorrTaskSetting(""),
435  fBGHandler(NULL),
436  fInputEvent(NULL),
437  fMCEvent(NULL),
438  fCutFolder(NULL),
439  fESDList(NULL),
440  fIsolation(NULL),
441  fBackList(NULL),
442  fMotherList(NULL),
443  fTrueList(NULL),
444  fMCList(NULL),
445  fTreeList(NULL),
446  fClusterTreeList(NULL),
447  fOutputContainer(0),
448  fClusterCandidates(NULL),
449  fIsoCandidates(NULL),
450  fEventCutArray(NULL),
451  fEventCuts(NULL),
452  fClusterCutArray(NULL),
453  fCaloPhotonCuts(NULL),
454  fMesonCutArray(NULL),
455  fMesonCuts(NULL),
456  fConvJetReader(NULL),
457  fDoJetAnalysis(kFALSE),
458  fDoJetQA(kFALSE),
459  fJetHistograms(NULL),
460  fTrueJetHistograms(NULL),
461  fHistoMotherInvMassPt(NULL),
462  fSparseMotherInvMassPtZM(NULL),
463  fHistoMotherBackInvMassPt(NULL),
464  fSparseMotherBackInvMassPtZM(NULL),
465  fHistoMotherPi0PtY(NULL),
466  fHistoMotherEtaPtY(NULL),
467  fHistoMotherPi0PtAlpha(NULL),
468  fHistoMotherEtaPtAlpha(NULL),
469  fHistoMotherPi0PtOpenAngle(NULL),
470  fHistoMotherEtaPtOpenAngle(NULL),
471  fHistoMotherPtOpenAngle(NULL),
472  fHistoMotherPtOpenAngleBck(NULL),
473  fHistoMotherPi0NGoodESDTracksPt(NULL),
474  fHistoMotherEtaNGoodESDTracksPt(NULL),
475  fHistoMotherInvMassECalib(NULL),
476  fHistoMotherBackInvMassECalib(NULL),
477  fHistoClusterCandidates(NULL),
478  fHistoClusterCandidatesBinning(NULL),
479  fHistoFailIsolationCut(NULL),
480  fHistoIsoClusterPDGtoPt(NULL),
481  fHistoIsoMotherPDGtoPt(NULL),
482  fVectorDoubleCountMCInitIsoPhotons(0),
483  fHistoDoubleCountMCIsoInitPhotonPt(NULL),
484  fHistoTruePhotonCandidatesIso(NULL),
485  fHistoTruePhotonsfromPi0DirectIso(NULL),
486  fHistoTruePhotonsfromPi0DirectIsoBinning(NULL),
487  fHistoTrueFragPhotonsDirectIso(NULL),
488  fHistoTruePromptPhotonsDirectIso(NULL),
489  fHistoTruePhotonsfromPi0ConvIso(NULL),
490  fHistoTruePhotonsfromPi0ConvIsoBinning(NULL),
491  fHistoTrueFragPhotonsConvIso(NULL),
492  fHistoTruePromptPhotonsConvIso(NULL),
493  fHistoTrueOtherSourcesIso(NULL),
494  fHistoTruePi0DecayCandNoConv(NULL),
495  fHistoTruePi0DecayCand(NULL),
496  fHistoTruePi0DecayCandNoConvBinning(NULL),
497  fHistoTruePi0DecayCandBinning(NULL),
498  fHistoClusGammaPt(NULL),
499  fHistoClusGammaE(NULL),
500  fHistoClusOverlapHeadersGammaPt(NULL),
501  fHistoClusAllHeadersGammaPt(NULL),
502  fHistoClusRejectedHeadersGammaPt(NULL),
503  fHistoClusGammaPtM02(NULL),
504  fHistoMCHeaders(NULL),
505  fHistoMCAllGammaPt(NULL),
506  fHistoMCAllSecondaryGammaPt(NULL),
507  fHistoMCDecayGammaPi0Pt(NULL),
508  fHistoMCDecayGammaRhoPt(NULL),
509  fHistoMCDecayGammaEtaPt(NULL),
510  fHistoMCDecayGammaOmegaPt(NULL),
511  fHistoMCDecayGammaEtapPt(NULL),
512  fHistoMCDecayGammaPhiPt(NULL),
513  fHistoMCDecayGammaSigmaPt(NULL),
514  fHistoMCPi0Pt(NULL),
515  fHistoMCPi0WOWeightPt(NULL),
516  fHistoMCPi0WOEvtWeightPt(NULL),
517  fHistoMCEtaPt(NULL),
518  fHistoMCEtaWOWeightPt(NULL),
519  fHistoMCEtaWOEvtWeightPt(NULL),
520  fHistoMCPi0InAccPt(NULL),
521  fHistoMCEtaInAccPt(NULL),
522  fHistoMCPi0WOEvtWeightInAccPt(NULL),
523  fHistoMCEtaWOEvtWeightInAccPt(NULL),
524  fHistoMCPi0PtY(NULL),
525  fHistoMCEtaPtY(NULL),
526  fHistoMCPi0PtAlpha(NULL),
527  fHistoMCEtaPtAlpha(NULL),
528  fHistoMCPrimaryPtvsSource(NULL),
529  fHistoMCSecPi0PtvsSource(NULL),
530  fHistoMCSecPi0Source(NULL),
531  fHistoMCSecPi0InAccPtvsSource(NULL),
532  fHistoMCSecEtaPt(NULL),
533  fHistoMCSecEtaSource(NULL),
534  fHistoMCPi0PtJetPt(NULL),
535  fHistoMCEtaPtJetPt(NULL),
536  fHistoTruePi0InvMassPt(NULL),
537  fHistoTruePi0noConvInvMassPt(NULL),
538  fHistoTrueEtaInvMassPt(NULL),
539  fHistoTruePi0CaloPhotonInvMassPt(NULL),
540  fHistoTrueEtaCaloPhotonInvMassPt(NULL),
541  fHistoTruePi0CaloConvertedPhotonInvMassPt(NULL),
542  fHistoTrueEtaCaloConvertedPhotonInvMassPt(NULL),
543  fHistoTruePi0CaloMixedPhotonConvPhotonInvMassPt(NULL),
544  fHistoTrueEtaCaloMixedPhotonConvPhotonInvMassPt(NULL),
545  fHistoTruePi0CaloElectronInvMassPt(NULL),
546  fHistoTrueEtaCaloElectronInvMassPt(NULL),
547  fHistoTruePi0CaloMergedClusterInvMassPt(NULL),
548  fHistoTrueEtaCaloMergedClusterInvMassPt(NULL),
549  fHistoTruePi0CaloMergedClusterPartConvInvMassPt(NULL),
550  fHistoTrueEtaCaloMergedClusterPartConvInvMassPt(NULL),
551  fHistoTruePi0NonMergedElectronPhotonInvMassPt(NULL),
552  fHistoTruePi0NonMergedElectronMergedPhotonInvMassPt(NULL),
553  fHistoTruePi0Category1(NULL),
554  fHistoTrueEtaCategory1(NULL),
555  fHistoTruePi0Category2(NULL),
556  fHistoTrueEtaCategory2(NULL),
557  fHistoTruePi0Category3(NULL),
558  fHistoTrueEtaCategory3(NULL),
559  fHistoTruePi0Category4_6(NULL),
560  fHistoTrueEtaCategory4_6(NULL),
561  fHistoTruePi0Category5(NULL),
562  fHistoTrueEtaCategory5(NULL),
563  fHistoTruePi0Category7(NULL),
564  fHistoTrueEtaCategory7(NULL),
565  fHistoTruePi0Category8(NULL),
566  fHistoTrueEtaCategory8(NULL),
567  fHistoTruePrimaryPi0InvMassPt(NULL),
568  fHistoTruePrimaryEtaInvMassPt(NULL),
569  fHistoTruePrimaryPi0W0WeightingInvMassPt(NULL),
570  fHistoTruePrimaryEtaW0WeightingInvMassPt(NULL),
571  fProfileTruePrimaryPi0WeightsInvMassPt(NULL),
572  fProfileTruePrimaryEtaWeightsInvMassPt(NULL),
573  fHistoTruePrimaryPi0MCPtResolPt(NULL),
574  fHistoTruePrimaryEtaMCPtResolPt(NULL),
575  fHistoTrueSecondaryPi0InvMassPt(NULL),
576  fHistoTrueSecondaryPi0FromK0sInvMassPt(NULL),
577  fHistoTrueK0sWithPi0DaughterMCPt(NULL),
578  fHistoTrueSecondaryPi0FromK0lInvMassPt(NULL),
579  fHistoTrueK0lWithPi0DaughterMCPt(NULL),
580  fHistoTrueSecondaryPi0FromEtaInvMassPt(NULL),
581  fHistoTrueEtaWithPi0DaughterMCPt(NULL),
582  fHistoTrueSecondaryPi0FromLambdaInvMassPt(NULL),
583  fHistoTrueLambdaWithPi0DaughterMCPt(NULL),
584  fHistoTrueBckGGInvMassPt(NULL),
585  fHistoTrueBckFullMesonContainedInOneClusterInvMassPt(NULL),
586  fHistoTrueBckAsymEClustersInvMassPt(NULL),
587  fHistoTrueBckContInvMassPt(NULL),
588  fHistoTruePi0PtY(NULL),
589  fHistoTrueEtaPtY(NULL),
590  fHistoTruePi0PtAlpha(NULL),
591  fHistoTrueEtaPtAlpha(NULL),
592  fHistoTruePi0PtOpenAngle(NULL),
593  fHistoTrueEtaPtOpenAngle(NULL),
594  fHistoClusPhotonBGPt(NULL),
595  fHistoClusPhotonPlusConvBGPt(NULL),
596  fHistoClustPhotonElectronBGPtM02(NULL),
597  fHistoClustPhotonPionBGPtM02(NULL),
598  fHistoClustPhotonKaonBGPtM02(NULL),
599  fHistoClustPhotonK0lBGPtM02(NULL),
600  fHistoClustPhotonNeutronBGPtM02(NULL),
601  fHistoClustPhotonRestBGPtM02(NULL),
602  fHistoClustPhotonPlusConvElectronBGPtM02(NULL),
603  fHistoClustPhotonPlusConvPionBGPtM02(NULL),
604  fHistoClustPhotonPlusConvKaonBGPtM02(NULL),
605  fHistoClustPhotonPlusConvK0lBGPtM02(NULL),
606  fHistoClustPhotonPlusConvNeutronBGPtM02(NULL),
607  fHistoClustPhotonPlusConvRestBGPtM02(NULL),
608  fHistoTrueClusGammaPt(NULL),
609  fHistoTrueClusUnConvGammaPt(NULL),
610  fHistoTrueClusUnConvGammaMCPt(NULL),
611  fHistoTrueClusGammaPtM02(NULL),
612  fHistoTrueClusUnConvGammaPtM02(NULL),
613  fHistoTrueClusElectronPt(NULL),
614  fHistoTrueClusConvGammaPt(NULL),
615  fHistoTrueClusConvGammaMCPt(NULL),
616  fHistoTrueClusConvGammaFullyPt(NULL),
617  fHistoTrueClusMergedGammaPt(NULL),
618  fHistoTrueClusMergedPartConvGammaPt(NULL),
619  fHistoTrueClusDalitzPt(NULL),
620  fHistoTrueClusDalitzMergedPt(NULL),
621  fHistoTrueClusPhotonFromElecMotherPt(NULL),
622  fHistoTrueClusShowerPt(NULL),
623  fHistoTrueClusSubLeadingPt(NULL),
624  fHistoTrueClusNParticles(NULL),
625  fHistoTrueClusEMNonLeadingPt(NULL),
626  fHistoTrueNLabelsInClus(NULL),
627  fHistoTruePrimaryClusGammaPt(NULL),
628  fHistoTruePrimaryClusGammaESDPtMCPt(NULL),
629  fHistoTruePrimaryClusConvGammaPt(NULL),
630  fHistoTruePrimaryClusConvGammaESDPtMCPt(NULL),
631  fHistoTrueSecondaryClusGammaPt(NULL),
632  fHistoTrueSecondaryClusConvGammaPt(NULL),
633  fHistoTrueSecondaryClusGammaMCPt(NULL),
634  fHistoTrueSecondaryClusConvGammaMCPt(NULL),
635  fHistoTrueSecondaryClusGammaFromXFromK0sMCPtESDPt(NULL),
636  fHistoTrueSecondaryClusConvGammaFromXFromK0sMCPtESDPt(NULL),
637  fHistoTrueSecondaryClusGammaFromXFromK0lMCPtESDPt(NULL),
638  fHistoTrueSecondaryClusConvGammaFromXFromK0lMCPtESDPt(NULL),
639  fHistoTrueSecondaryClusGammaFromXFromLambdaMCPtESDPt(NULL),
640  fHistoTrueSecondaryClusConvGammaFromXFromLambdaMCPtESDPt(NULL),
641  fHistoDoubleCountTruePi0InvMassPt(NULL),
642  fHistoDoubleCountTrueEtaInvMassPt(NULL),
643  fHistoDoubleCountTrueClusterGammaPt(NULL),
644  fVectorDoubleCountTruePi0s(0),
645  fVectorDoubleCountTrueEtas(0),
646  fVectorDoubleCountTrueClusterGammas(0),
647  fHistoMultipleCountTrueClusterGamma(NULL),
648  fMapMultipleCountTrueClusterGammas(),
649  fHistoTruePi0InvMassPtAlpha(NULL),
650  fHistoTruePi0PureGammaInvMassPtAlpha(NULL),
651  fHistCellIDvsClusterEnergy(NULL),
652  fHistCellIDvsClusterEnergyMax(NULL),
653  fHistoNEvents(NULL),
654  fHistoNEventsWOWeight(NULL),
655  fHistoNGoodESDTracks(NULL),
656  fHistoVertexZ(NULL),
657  fHistoNGammaCandidates(NULL),
658  fHistoNGammaCandidatesBasic(NULL),
659  fHistoNGoodESDTracksVsNGammaCandidates(NULL),
660  fHistoSPDClusterTrackletBackground(NULL),
661  fHistoNV0Tracks(NULL),
662  fProfileEtaShift(NULL),
663  fProfileJetJetXSection(NULL),
664  fHistoJetJetNTrials(NULL),
665  fHistoEventSphericity(NULL),
666  fHistoEventSphericityvsNtracks(NULL),
667  fHistoPtJet(NULL),
668  fHistoJetEta(NULL),
669  fHistoJetPhi(NULL),
670  fHistoJetArea(NULL),
671  fHistoNJets(NULL),
672  fHistoEventwJets(NULL),
673  fHistoJetPi0PtRatio(NULL),
674  fHistoDoubleCounting(NULL),
675  fHistoJetMotherInvMassPt(NULL),
676  fHistoPi0InJetMotherInvMassPt(NULL),
677  fHistoMotherBackJetInvMassPt(NULL),
678  fHistoRJetPi0Cand(NULL),
679  fHistoEtaPhiJetPi0Cand(NULL),
680  fHistoEtaPhiJetWithPi0Cand(NULL),
681  fHistoJetFragmFunc(NULL),
682  fHistoTruevsRecJetPt(NULL),
683  fHistoTruePi0JetMotherInvMassPt(NULL),
684  fHistoTruePi0InJetMotherInvMassPt(NULL),
685  fHistoTruePrimaryPi0JetInvMassPt(NULL),
686  fHistoTruePrimaryPi0inJetInvMassPt(NULL),
687  fHistoTrueDoubleCountingPi0Jet(NULL),
688  fHistoTrueEtaJetMotherInvMassPt(NULL),
689  fHistoTrueEtaInJetMotherInvMassPt(NULL),
690  fHistoTruePrimaryEtaJetInvMassPt(NULL),
691  fHistoTruePrimaryEtainJetInvMassPt(NULL),
692  fHistoTrueDoubleCountingEtaJet(NULL),
693  fHistoTruePi0JetFragmFunc(NULL),
694  fHistoTrueEtaJetFragmFunc(NULL),
695  fHistoMCPi0JetInAccPt(NULL),
696  fHistoMCPi0inJetInAccPt(NULL),
697  fHistoMCEtaJetInAccPt(NULL),
698  fHistoMCEtainJetInAccPt(NULL),
699  fHistoTrueSecondaryPi0FromK0sJetInvMassPt(NULL),
700  fHistoTrueSecondaryPi0FromK0sinJetInvMassPt(NULL),
701  fHistoTrueSecondaryPi0FromLambdaJetInvMassPt(NULL),
702  fHistoTrueSecondaryPi0FromLambdainJetInvMassPt(NULL),
703  fHistoTrueSecondaryPi0FromK0lJetInvMassPt(NULL),
704  fHistoTrueSecondaryPi0FromK0linJetInvMassPt(NULL),
705  fHistoTrueSecondaryPi0InvJetMassPt(NULL),
706  fHistoTrueSecondaryPi0InvinJetMassPt(NULL),
707  fVectorJetPt(0),
708  fVectorJetPx(0),
709  fVectorJetPy(0),
710  fVectorJetPz(0),
711  fVectorJetEta(0),
712  fVectorJetPhi(0),
713  fVectorJetArea(0),
714  fTrueVectorJetPt(0),
715  fTrueVectorJetPx(0),
716  fTrueVectorJetPy(0),
717  fTrueVectorJetPz(0),
718  fTrueVectorJetEta(0),
719  fTrueVectorJetPhi(0),
720  tTrueInvMassROpenABPtFlag(NULL),
721  fInvMass(-1),
722  fRconv(-1),
723  fOpenRPrim(-1),
724  fInvMassRTOF(-1),
725  fPt(-1),
726  iFlag(3),
727  tSigInvMassPtAlphaTheta(NULL),
728  tBckInvMassPtAlphaTheta(NULL),
729  fInvMassTreeInvMass(0),
730  fInvMassTreePt(0),
731  fInvMassTreeAlpha(0),
732  fInvMassTreeTheta(0),
733  fInvMassTreeMixPool(0),
734  fInvMassTreeZVertex(0),
735  fInvMassTreeEta(0),
736  tClusterEOverP(NULL),
737  fClusterE(0),
738  fClusterM02(0),
739  fClusterM20(0),
740  fClusterEP(0),
741  fClusterLeadCellID(0),
742  fClusterClassification(0),
743  fDeltaEta(0),
744  fDeltaPhi(0),
745  fTrackPt(0),
746  fTrackPID_e(0),
747  fTrackPID_Pi(0),
748  fTrackPID_K(0),
749  fTrackPID_P(0),
750  fClusterIsoSumClusterEt(0),
751  fClusterIsoSumTrackEt(0),
752 // fHistoTruePi0NonLinearity(NULL),
753 // fHistoTrueEtaNonLinearity(NULL),
754  tTreeJetPi0Correlations(NULL),
755  fJetPt(0),
756  fTrueJetPt(0),
757  fPi0Pt(0),
758  fPi0InvMass(0),
759  fEventPlaneAngle(-100),
760  fRandom(0),
761  fnCuts(0),
762  fiCut(0),
763  fIsHeavyIon(0),
764  fDoLightOutput(kFALSE),
765  fDoMesonAnalysis(kTRUE),
766  fDoMesonQA(0),
767  fDoClusterQA(0),
768  fIsFromDesiredHeader(kTRUE),
769  fIsOverlappingWithOtherHeader(kFALSE),
770  fIsMC(0),
771  fDoTHnSparse(kTRUE),
772  fSetPlotHistsExtQA(kFALSE),
773  fDoSoftAnalysis(kFALSE),
774  fWeightJetJetMC(1),
775  fDoInOutTimingCluster(kFALSE),
776  fMinTimingCluster(0),
777  fMaxTimingCluster(0),
778  fEnableSortForClusMC(kFALSE),
779  fProduceCellIDPlots(kFALSE),
780  fProduceTreeEOverP(kFALSE),
781  tBrokenFiles(NULL),
782  fFileNameBroken(NULL),
783  tClusterQATree(NULL),
784  fCloseHighPtClusters(NULL),
785  fLocalDebugFlag(0),
786  fAllowOverlapHeaders(kTRUE),
787  fNCurrentClusterBasic(0),
788  fTrackMatcherRunningMode(0)
789 {
790  // Define output slots here
791  DefineOutput(1, TList::Class());
792 }
793 
795 {
796  if(fClusterCandidates){
797  delete fClusterCandidates;
798  fClusterCandidates = 0x0;
799  }
800  if(fIsoCandidates){
801  delete fIsoCandidates;
802  fIsoCandidates = 0x0;
803  }
804  if(fBGHandler){
805  delete[] fBGHandler;
806  fBGHandler = 0x0;
807  }
808 }
809 //___________________________________________________________
811 
812  const Int_t nDim = 4;
813  Int_t nBins[nDim] = {800,350,7,6};
814  Double_t xMin[nDim] = {0,0, 0,0};
815  Double_t xMax[nDim] = {0.8,35,7,6};
816 
817  if(fDoTHnSparse){
818  fSparseMotherInvMassPtZM = new THnSparseF*[fnCuts];
819  fSparseMotherBackInvMassPtZM = new THnSparseF*[fnCuts];
820  }
821 
823 
824 
825  for(Int_t iCut = 0; iCut<fnCuts;iCut++){
826  if (((AliConversionMesonCuts*)fMesonCutArray->At(iCut))->DoBGCalculation()){
827  TString cutstringEvent = ((AliConvEventCuts*)fEventCutArray->At(iCut))->GetCutNumber();
828  TString cutstringCalo = ((AliCaloPhotonCuts*)fClusterCutArray->At(iCut))->GetCutNumber();
829  TString cutstringMeson = ((AliConversionMesonCuts*)fMesonCutArray->At(iCut))->GetCutNumber();
830 
831  Int_t collisionSystem = atoi((TString)(((AliConvEventCuts*)fEventCutArray->At(iCut))->GetCutNumber())(0,1));
832  Int_t centMin = atoi((TString)(((AliConvEventCuts*)fEventCutArray->At(iCut))->GetCutNumber())(1,1));
833  Int_t centMax = atoi((TString)(((AliConvEventCuts*)fEventCutArray->At(iCut))->GetCutNumber())(2,1));
834 
835  if(collisionSystem == 1 || collisionSystem == 2 ||
836  collisionSystem == 5 || collisionSystem == 8 ||
837  collisionSystem == 9){
838  centMin = centMin*10;
839  centMax = centMax*10;
840  if(centMax ==0 && centMax!=centMin) centMax=100;
841  } else if(collisionSystem == 3 || collisionSystem == 6){
842  centMin = centMin*5;
843  centMax = centMax*5;
844  } else if(collisionSystem == 4 || collisionSystem == 7){
845  centMin = ((centMin*5)+45);
846  centMax = ((centMax*5)+45);
847  }
848 
849  if(fDoTHnSparse){
850  fBackList[iCut] = new TList();
851  fBackList[iCut]->SetName(Form("%s_%s_%s Back histograms",cutstringEvent.Data(),cutstringCalo.Data(), cutstringMeson.Data()));
852  fBackList[iCut]->SetOwner(kTRUE);
853  fCutFolder[iCut]->Add(fBackList[iCut]);
854 
855  fSparseMotherBackInvMassPtZM[iCut] = new THnSparseF("Back_Back_InvMass_Pt_z_m", "Back_Back_InvMass_Pt_z_m", nDim,nBins,xMin,xMax);
856  fBackList[iCut]->Add(fSparseMotherBackInvMassPtZM[iCut]);
857 
858  fMotherList[iCut] = new TList();
859  fMotherList[iCut]->SetName(Form("%s_%s_%s Mother histograms", cutstringEvent.Data(), cutstringCalo.Data(), cutstringMeson.Data()));
860  fMotherList[iCut]->SetOwner(kTRUE);
861  fCutFolder[iCut]->Add(fMotherList[iCut]);
862 
863  fSparseMotherInvMassPtZM[iCut] = new THnSparseF("Back_Mother_InvMass_Pt_z_m", "Back_Mother_InvMass_Pt_z_m", nDim,nBins,xMin,xMax);
864  fMotherList[iCut]->Add(fSparseMotherInvMassPtZM[iCut]);
865  }
866 
867  if(((AliConversionMesonCuts*)fMesonCutArray->At(iCut))->BackgroundHandlerType() == 0){
868  if( ((AliConversionMesonCuts*)fMesonCutArray->At(iCut))->DoSectorMixing() ){
870  collisionSystem,centMin,centMax,
871  ((AliConversionMesonCuts*)fMesonCutArray->At(iCut))->GetNumberOfBGEvents(),
872  ((AliConversionMesonCuts*)fMesonCutArray->At(iCut))->UseTrackMultiplicity(),
873  4,9,7);
874  } else {
876  collisionSystem,centMin,centMax,
877  ((AliConversionMesonCuts*)fMesonCutArray->At(iCut))->GetNumberOfBGEvents(),
878  ((AliConversionMesonCuts*)fMesonCutArray->At(iCut))->UseTrackMultiplicity(),
879  4,8,7);
880  }
881  }
882  }
883  }
884 }
885 //________________________________________________________________________
887 
888  fV0Reader=(AliV0ReaderV1*)AliAnalysisManager::GetAnalysisManager()->GetTask(fV0ReaderName.Data());
889  if(!fV0Reader){printf("Error: No V0 Reader");return;} // GetV0Reader
890 
891  if(fDoMesonAnalysis){
892  if( ((AliConversionMesonCuts*)fMesonCutArray->At(0))->DoJetAnalysis()) fDoJetAnalysis = kTRUE;
893  if( ((AliConversionMesonCuts*)fMesonCutArray->At(0))->DoJetQA()) fDoJetQA = kTRUE;
894  }
895 
896  if(fDoJetAnalysis){
897  fConvJetReader=(AliAnalysisTaskConvJet*)AliAnalysisManager::GetAnalysisManager()->GetTask("AliAnalysisTaskConvJet");
898  if(!fConvJetReader){printf("Error: No AliAnalysisTaskConvJet");return;} // GetV0Reader
899  }
900 
901  if (fDoClusterQA == 2) fProduceCellIDPlots = kTRUE;
902  if (fIsMC == 2){
903  fDoTHnSparse = kFALSE;
904  } else if (fIsMC == 3){
905  fDoTHnSparse = kFALSE;
906  }
907 
908  // set common binning in pT for mesons and photons
909  Float_t binWidthPt = 0.1;
910  Int_t nBinsPt = 250;
911  Float_t minPt = 0;
912  Float_t maxPt = 25;
913  Int_t nBinsQAPt = 175;
914  Float_t maxQAPt = 25;
915  Int_t nBinsClusterPt = 500;
916  Float_t minClusterPt = 0;
917  Float_t maxClusterPt = 50;
918  Double_t *arrPtBinning = new Double_t[1200];
919  Double_t *arrQAPtBinning = new Double_t[1200];
920  Double_t *arrClusPtBinning = new Double_t[1200];
922  nBinsPt = 400;
923  minPt = 0;
924  maxPt = 40;
925  for(Int_t i=0; i<nBinsPt+1;i++){
926  arrPtBinning[i] = ((maxPt-minPt)/nBinsPt)*i;
927  }
928  nBinsQAPt = 190;
929  maxQAPt = 40;
930  for(Int_t i=0; i<nBinsQAPt+1;i++){
931  if(i<60) arrQAPtBinning[i] = 0.05*i;
932  else if(i<130) arrQAPtBinning[i] = 3.+0.1*(i-60);
933  else if(i<170) arrQAPtBinning[i] = 10.+0.25*(i-130);
934  else if(i<190) arrQAPtBinning[i] = 20.+1.0*(i-170);
935  else arrQAPtBinning[i] = maxQAPt;
936  }
937  nBinsClusterPt = 800;
938  minClusterPt = 0;
939  maxClusterPt = 80;
940  for(Int_t i=0; i<nBinsClusterPt+1;i++){
941  arrClusPtBinning[i] = ((maxClusterPt-minClusterPt)/nBinsClusterPt)*i;
942  }
943  } else if ( ((AliConvEventCuts*)fV0Reader->GetEventCuts())->GetEnergyEnum() == AliConvEventCuts::k13TeV ||
945  nBinsPt = 335;
946  minPt = 0;
947  maxPt = 100;
948  binWidthPt = 0.05;
949  for(Int_t i=0; i<nBinsPt+1;i++){
950  if (i < 1) arrPtBinning[i] = 0.3*i;
951  else if(i<55) arrPtBinning[i] = 0.3+0.05*(i-1);
952  else if(i<225) arrPtBinning[i] = 3.+0.1*(i-55);
953  else if(i<265) arrPtBinning[i] = 20.+0.25*(i-225);
954  else if(i<305) arrPtBinning[i] = 30.+0.5*(i-265);
955  else if(i<325) arrPtBinning[i] = 50.+1.0*(i-305);
956  else if(i<335) arrPtBinning[i] = 70.+2.5*(i-325);
957  else arrPtBinning[i] = maxPt;
958  }
959  nBinsQAPt = 270;
960  maxQAPt = 100;
961  for(Int_t i=0; i<nBinsQAPt+1;i++){
962  if(i<60) arrQAPtBinning[i] = 0.05*i;
963  else if(i<130) arrQAPtBinning[i] = 3.+0.1*(i-60);
964  else if(i<170) arrQAPtBinning[i] = 10.+0.25*(i-130);
965  else if(i<210) arrQAPtBinning[i] = 20.+0.5*(i-170);
966  else if(i<270) arrQAPtBinning[i] = 40.+1.0*(i-210);
967  else arrQAPtBinning[i] = maxQAPt;
968  }
969  nBinsClusterPt = 335;
970  minClusterPt = 0;
971  maxClusterPt = 100;
972  for(Int_t i=0; i<nBinsClusterPt+1;i++){
973  if (i < 1) arrClusPtBinning[i] = 0.3*i;
974  else if(i<55) arrClusPtBinning[i] = 0.3+0.05*(i-1);
975  else if(i<225) arrClusPtBinning[i] = 3.+0.1*(i-55);
976  else if(i<265) arrClusPtBinning[i] = 20.+0.25*(i-225);
977  else if(i<305) arrClusPtBinning[i] = 30.+0.5*(i-265);
978  else if(i<325) arrClusPtBinning[i] = 50.+1.0*(i-305);
979  else if(i<335) arrClusPtBinning[i] = 70.+2.5*(i-325);
980  else arrClusPtBinning[i] = maxClusterPt;
981  }
982  } else if ( ((AliConvEventCuts*)fV0Reader->GetEventCuts())->GetEnergyEnum() == AliConvEventCuts::kpPb8TeV ){
983  binWidthPt = 0.05;
984  nBinsPt = 261;
985  minPt = 0;
986  maxPt = 100;
987  for(Int_t i=0; i<nBinsPt+1;i++){
988  if (i < 1) arrPtBinning[i] = 0.5*i;
989  else if(i<51) arrPtBinning[i] = 0.5+0.05*(i-1);
990  else if(i<121) arrPtBinning[i] = 3.+0.1*(i-51);
991  else if(i<161) arrPtBinning[i] = 10.+0.25*(i-121);
992  else if(i<201) arrPtBinning[i] = 20.+0.5*(i-161);
993  else if(i<261) arrPtBinning[i] = 40.+1.0*(i-201);
994  else arrPtBinning[i] = maxPt;
995  }
996  nBinsQAPt = 270;
997  maxQAPt = 100;
998  for(Int_t i=0; i<nBinsQAPt+1;i++){
999  if(i<60) arrQAPtBinning[i] = 0.05*i;
1000  else if(i<130) arrQAPtBinning[i] = 3.+0.1*(i-60);
1001  else if(i<170) arrQAPtBinning[i] = 10.+0.25*(i-130);
1002  else if(i<210) arrQAPtBinning[i] = 20.+0.5*(i-170);
1003  else if(i<270) arrQAPtBinning[i] = 40.+1.0*(i-210);
1004  else arrQAPtBinning[i] = maxQAPt;
1005  }
1006  nBinsClusterPt = 301;
1007  minClusterPt = 0;
1008  maxClusterPt = 100;
1009  for(Int_t i=0; i<nBinsClusterPt+1;i++){
1010  if (i < 1) arrClusPtBinning[i] = 0.3*i;
1011  else if(i<55) arrClusPtBinning[i] = 0.3+0.05*(i-1);
1012  else if(i<125) arrClusPtBinning[i] = 3.+0.1*(i-55);
1013  else if(i<155) arrClusPtBinning[i] = 10.+0.2*(i-125);
1014  else if(i<211) arrClusPtBinning[i] = 16.+0.25*(i-155);
1015  else if(i<251) arrClusPtBinning[i] = 30.+0.5*(i-211);
1016  else if(i<301) arrClusPtBinning[i] = 50.+1.0*(i-251);
1017  else arrClusPtBinning[i] = maxClusterPt;
1018  }
1019  } else if ( ((AliConvEventCuts*)fV0Reader->GetEventCuts())->GetEnergyEnum() == AliConvEventCuts::kpPb5TeVR2 ||
1021  ((AliConvEventCuts*)fV0Reader->GetEventCuts())->GetEnergyEnum() == AliConvEventCuts::k5TeV ){
1022  binWidthPt = 0.05;
1023  nBinsPt = 201;
1024  minPt = 0;
1025  maxPt = 60;
1026  for(Int_t i=0; i<nBinsPt+1;i++){
1027  if (i < 1) arrPtBinning[i] = 0.5*i;
1028  else if(i<51) arrPtBinning[i] = 0.5+0.05*(i-1);
1029  else if(i<121) arrPtBinning[i] = 3.+0.1*(i-51);
1030  else if(i<161) arrPtBinning[i] = 10.+0.25*(i-121);
1031  else if(i<201) arrPtBinning[i] = 20.+1.0*(i-161);
1032  else arrPtBinning[i] = maxPt;
1033  }
1034  nBinsQAPt = 210;
1035  maxQAPt = 60;
1036  for(Int_t i=0; i<nBinsQAPt+1;i++){
1037  if(i<60) arrQAPtBinning[i] = 0.05*i;
1038  else if(i<130) arrQAPtBinning[i] = 3.+0.1*(i-60);
1039  else if(i<170) arrQAPtBinning[i] = 10.+0.25*(i-130);
1040  else if(i<210) arrQAPtBinning[i] = 20.+1.0*(i-170);
1041  else arrQAPtBinning[i] = maxQAPt;
1042  }
1043  nBinsClusterPt = 301;
1044  minClusterPt = 0;
1045  maxClusterPt = 100;
1046  for(Int_t i=0; i<nBinsClusterPt+1;i++){
1047  if (i < 1) arrClusPtBinning[i] = 0.3*i;
1048  else if(i<55) arrClusPtBinning[i] = 0.3+0.05*(i-1);
1049  else if(i<125) arrClusPtBinning[i] = 3.+0.1*(i-55);
1050  else if(i<155) arrClusPtBinning[i] = 10.+0.2*(i-125);
1051  else if(i<211) arrClusPtBinning[i] = 16.+0.25*(i-155);
1052  else if(i<251) arrClusPtBinning[i] = 30.+0.5*(i-211);
1053  else if(i<301) arrClusPtBinning[i] = 50.+1.0*(i-251);
1054  else arrClusPtBinning[i] = maxClusterPt;
1055  }
1056  } else if (((AliConvEventCuts*)fV0Reader->GetEventCuts())->GetEnergyEnum() == AliConvEventCuts::kXeXe5440GeV ){
1057  nBinsPt = 88;
1058  minPt = 0;
1059  maxPt = 20;
1060  for(Int_t i=0; i<nBinsPt+1;i++){
1061  if (i < 1) arrPtBinning[i] = 0.5*i;
1062  else if(i<56) arrPtBinning[i] = 0.5+0.1*(i-1);
1063  else if(i<80) arrPtBinning[i] = 6.+0.25*(i-56);
1064  else if(i<88) arrPtBinning[i] = 12.+1.0*(i-80);
1065  else arrPtBinning[i] = maxPt;
1066  }
1067  nBinsQAPt = 92;
1068  maxQAPt = 20;
1069  for(Int_t i=0; i<nBinsQAPt+1;i++){
1070  if(i<60) arrQAPtBinning[i] = 0.1*i;
1071  else if(i<84) arrQAPtBinning[i] = 6.+0.25*(i-60);
1072  else if(i<92) arrQAPtBinning[i] = 12.+1.0*(i-84);
1073  else arrQAPtBinning[i] = maxQAPt;
1074  }
1075  nBinsClusterPt = 148;
1076  minClusterPt = 0;
1077  maxClusterPt = 40;
1078  for(Int_t i=0; i<nBinsClusterPt+1;i++){
1079  if (i < 1) arrClusPtBinning[i] = 0.3*i;
1080  else if(i<98) arrClusPtBinning[i] = 0.3+0.1*(i-1);
1081  else if(i<123) arrClusPtBinning[i] = 10.+0.2*(i-98);
1082  else if(i<148) arrClusPtBinning[i] = 15.+1.0*(i-123);
1083  else arrClusPtBinning[i] = maxClusterPt;
1084  }
1085  } else if (((AliConvEventCuts*)fV0Reader->GetEventCuts())->GetEnergyEnum() == AliConvEventCuts::kPbPb5TeV ){
1086  nBinsPt = 88;
1087  minPt = 0;
1088  maxPt = 20;
1089  for(Int_t i=0; i<nBinsPt+1;i++){
1090  if (i < 1) arrPtBinning[i] = 0.5*i;
1091  else if(i<56) arrPtBinning[i] = 0.5+0.1*(i-1);
1092  else if(i<80) arrPtBinning[i] = 6.+0.25*(i-56);
1093  else if(i<88) arrPtBinning[i] = 12.+1.0*(i-80);
1094  else arrPtBinning[i] = maxPt;
1095  }
1096  nBinsQAPt = 92;
1097  maxQAPt = 20;
1098  for(Int_t i=0; i<nBinsQAPt+1;i++){
1099  if(i<60) arrQAPtBinning[i] = 0.1*i;
1100  else if(i<84) arrQAPtBinning[i] = 6.+0.25*(i-60);
1101  else if(i<92) arrQAPtBinning[i] = 12.+1.0*(i-84);
1102  else arrQAPtBinning[i] = maxQAPt;
1103  }
1104  nBinsClusterPt = 148;
1105  minClusterPt = 0;
1106  maxClusterPt = 40;
1107  for(Int_t i=0; i<nBinsClusterPt+1;i++){
1108  if (i < 1) arrClusPtBinning[i] = 0.3*i;
1109  else if(i<98) arrClusPtBinning[i] = 0.3+0.1*(i-1);
1110  else if(i<123) arrClusPtBinning[i] = 10.+0.2*(i-98);
1111  else if(i<148) arrClusPtBinning[i] = 15.+1.0*(i-123);
1112  else arrClusPtBinning[i] = maxClusterPt;
1113  }
1114  } else {
1115  for(Int_t i=0; i<nBinsPt+1;i++){
1116  arrPtBinning[i] = ((maxPt-minPt)/nBinsPt)*i;
1117  }
1118  for(Int_t i=0; i<nBinsClusterPt+1;i++){
1119  arrClusPtBinning[i] = ((maxClusterPt-minClusterPt)/nBinsClusterPt)*i;
1120  }
1121  for(Int_t i=0; i<nBinsQAPt+1;i++){
1122  if(i<60) arrQAPtBinning[i] = 0.05*i;
1123  else if(i<130) arrQAPtBinning[i] = 3.+0.1*(i-60);
1124  else if(i<170) arrQAPtBinning[i] = 10.+0.25*(i-130);
1125  else if(i<175) arrQAPtBinning[i] = 20.+1.0*(i-170);
1126  else arrQAPtBinning[i] = maxQAPt;
1127  }
1128  }
1129 
1130  Double_t* arrLogBinning = new Double_t[51]{1.00e-03, 1.20e-03, 1.45e-03, 1.74e-03, 2.01e-03, 2.51e-03, 3.02e-03, 3.63e-03, 4.37e-03, 5.25e-03, 6.31e-03, 7.60e-03,
1131  9.12e-03, 1.01e-02, 1.32e-02, 1.58e-02, 1.91e-02, 2.29e-02, 2.75e-02, 3.31e-02, 3.98e-02, 4.79e-02, 5.75e-02, 6.91e-02,
1132  8.32e-02, 1.00e-01, 1.20e-01, 1.45e-01, 1.74e-01, 2.09e-01, 2.51e-01, 3.02e-01, 3.63e-01, 4.37e-01, 5.25e-01, 6.31e-01,
1133  7.59e-01, 9.12e-01, 1.10e+00, 1.32e+00, 1.58e+00, 1.91e+00, 2.29e+00, 2.75e+00, 3.31e+00, 3.98e+00, 4.79e+00, 5.75e+00,
1134  6.92e+00, 8.32e+00, 1.00e+01};
1135  // Create histograms
1136  if(fOutputContainer != NULL){
1137  delete fOutputContainer;
1138  fOutputContainer = NULL;
1139  }
1140  if(fOutputContainer == NULL){
1141  fOutputContainer = new TList();
1142  fOutputContainer->SetOwner(kTRUE);
1143  }
1144 
1145  // Array of current cut's gammas
1146  fClusterCandidates = new TList();
1147  fClusterCandidates->SetOwner(kTRUE);
1148 
1149  fIsoCandidates = new TList();
1150  fIsoCandidates->SetOwner(kFALSE);
1151 
1152 
1153  fCutFolder = new TList*[fnCuts];
1154  fESDList = new TList*[fnCuts];
1155  fIsolation = new TList*[fnCuts];
1156 
1157  fHistoClusterCandidates = new TH1F*[fnCuts];
1159  fHistoFailIsolationCut = new TH1F*[fnCuts];
1160  if (fIsMC > 0){
1164 
1172  fHistoTrueFragPhotonsConvIso = new TH1F*[fnCuts];
1174  fHistoTrueOtherSourcesIso = new TH1F*[fnCuts];
1175  fHistoTruePi0DecayCandNoConv = new TH1F*[fnCuts];
1176  fHistoTruePi0DecayCand = new TH1F*[fnCuts];
1179  }
1180 
1181  if(fDoTHnSparse){
1182  fBackList = new TList*[fnCuts];
1183  fMotherList = new TList*[fnCuts];
1184  }
1185  fHistoNEvents = new TH1F*[fnCuts];
1186  if(fIsMC > 1){
1187  fHistoNEventsWOWeight = new TH1F*[fnCuts];
1188  }
1189  if(fIsMC == 2){
1190  fProfileJetJetXSection = new TProfile*[fnCuts];
1191  fHistoJetJetNTrials = new TH1F*[fnCuts];
1192  }
1193 
1194  fHistoNGoodESDTracks = new TH1F*[fnCuts];
1195  fHistoVertexZ = new TH1F*[fnCuts];
1196  fHistoNGammaCandidates = new TH1F*[fnCuts];
1197  fHistoNGammaCandidatesBasic = new TH1F*[fnCuts];
1198  fHistoEventSphericity = new TH1F*[fnCuts];
1200  if(!fDoLightOutput){
1203  fHistoNV0Tracks = new TH1F*[fnCuts];
1204  }
1205  if(fIsHeavyIon==2) fProfileEtaShift = new TProfile*[fnCuts];
1206 
1207  if(fDoMesonAnalysis){
1210  if(!fDoLightOutput){
1213  }
1214  if (fDoMesonQA > 0 && fDoMesonQA < 3){
1215  fHistoMotherPi0PtY = new TH2F*[fnCuts];
1216  fHistoMotherEtaPtY = new TH2F*[fnCuts];
1223  }
1224  if (fDoMesonQA == 2){
1227  }
1228  }
1229 
1230  if(fProduceCellIDPlots){
1233  }
1234 
1235  fHistoClusGammaPt = new TH1F*[fnCuts];
1236  fHistoClusGammaE = new TH1F*[fnCuts];
1238  fHistoClusAllHeadersGammaPt = new TH1F*[fnCuts];
1240  if(!fDoLightOutput && fDoClusterQA > 0)
1242 
1243  if (fDoMesonQA == 4 && fIsMC == 0){
1244  fTreeList = new TList*[fnCuts];
1247  }
1248 
1249  if (fProduceTreeEOverP){
1250  fClusterTreeList = new TList*[fnCuts];
1251  tClusterEOverP = new TTree*[fnCuts];
1252  }
1253  if(fDoJetAnalysis){
1254  fJetHistograms = new TList*[fnCuts];
1255 
1256  fHistoPtJet = new TH1F*[fnCuts];
1257  fHistoJetEta = new TH1F*[fnCuts];
1258  fHistoJetPhi = new TH1F*[fnCuts];
1259  fHistoJetArea = new TH1F*[fnCuts];
1260  fHistoNJets = new TH1F*[fnCuts];
1261  fHistoEventwJets = new TH1F*[fnCuts];
1262  fHistoJetPi0PtRatio = new TH1F*[fnCuts];
1263  fHistoDoubleCounting = new TH1F*[fnCuts];
1264 
1268  fHistoRJetPi0Cand = new TH2F*[fnCuts];
1271  fHistoJetFragmFunc = new TH2F*[fnCuts];
1272  }
1273 
1274  for(Int_t iCut = 0; iCut<fnCuts;iCut++){
1275  TString cutstringEvent = ((AliConvEventCuts*)fEventCutArray->At(iCut))->GetCutNumber();
1276  TString cutstringCalo = ((AliCaloPhotonCuts*)fClusterCutArray->At(iCut))->GetCutNumber();
1277  TString cutstringMeson = "NoMesonCut";
1278  if(fDoMesonAnalysis)
1279  cutstringMeson = ((AliConversionMesonCuts*)fMesonCutArray->At(iCut))->GetCutNumber();
1280 
1281  fCutFolder[iCut] = new TList();
1282  fCutFolder[iCut]->SetName(Form("Cut Number %s_%s_%s", cutstringEvent.Data(), cutstringCalo.Data(), cutstringMeson.Data()));
1283  fCutFolder[iCut]->SetOwner(kTRUE);
1284  fOutputContainer->Add(fCutFolder[iCut]);
1285 
1286 
1287 
1288  fIsolation[iCut] = new TList();
1289  fIsolation[iCut]->SetName("Isolation_Results");
1290  fIsolation[iCut]->SetOwner(kTRUE);
1291  fCutFolder[iCut]->Add(fIsolation[iCut]);
1292 
1293  Int_t IsolationBins = 200;
1294  Int_t startIsolation = 0;
1295  Int_t endIsolation = 200;
1296 
1297  Int_t PDGBins = 800;
1298  Int_t startPDG = -400;
1299  Int_t endPDG = 400;
1300 
1301  Double_t fBinsPi013TeVEMCTrigEG1IsoPt[21] = {0.0, 7.0, 7.25, 7.5, 7.75, 8.0, 8.25, 8.5, 8.75, 9.0, 9.25, 9.5, 10.0, 10.5, 11.0, 12.0, 13.0, 14.0, 15.0, 17.0,
1302  21.0};
1303 
1304  fHistoClusterCandidates[iCut] = new TH1F("ClusterCandidates","Cluster Photon Candidates",nBinsClusterPt, arrClusPtBinning);
1305  fIsolation[iCut]->Add(fHistoClusterCandidates[iCut]);
1306  fHistoClusterCandidatesBinning[iCut] = new TH1F("ClusterCandidatesBinning","Cluster Photon Candidates",20, fBinsPi013TeVEMCTrigEG1IsoPt);
1307  fIsolation[iCut]->Add(fHistoClusterCandidatesBinning[iCut]);
1308  fHistoFailIsolationCut[iCut] = new TH1F("FailIsolationCut","Cluster Candidates, failing Isolation Cut",nBinsClusterPt, arrClusPtBinning);
1309  fIsolation[iCut]->Add(fHistoFailIsolationCut[iCut]);
1310 
1311  if (fIsMC > 0){
1312 
1313  fHistoIsoClusterPDGtoPt[iCut] = new TH2F("IsoClusterPDGtoPt","Isolated Cluster PDG Codes",PDGBins,startPDG,endPDG,IsolationBins,startIsolation,endIsolation);
1314  fIsolation[iCut]->Add(fHistoIsoClusterPDGtoPt[iCut]);
1315  fHistoIsoMotherPDGtoPt[iCut] = new TH2F("IsoMotherPDGtoPt","Isolated Cluster Mother PDG Codes",PDGBins,startPDG,endPDG,IsolationBins,startIsolation,endIsolation);
1316  fIsolation[iCut]->Add(fHistoIsoMotherPDGtoPt[iCut]);
1317  fHistoDoubleCountMCIsoInitPhotonPt[iCut] = new TH1F("DoubleCountIsoGammaJet","Double Count Isolated Gamma Jets", IsolationBins,startIsolation,endIsolation);
1319 
1320  fHistoTruePhotonCandidatesIso[iCut] = new TH1F("TruePhotonCandidatesIso","True Photon Candidates",nBinsClusterPt, arrClusPtBinning);
1321  fIsolation[iCut]->Add(fHistoTruePhotonCandidatesIso[iCut]);
1322  fHistoTruePhotonsfromPi0DirectIso[iCut] = new TH1F("TrueDirectPi0","True Photon from Pi0 Decay (Direct)",nBinsClusterPt, arrClusPtBinning);
1324  fHistoTruePhotonsfromPi0DirectIsoBinning[iCut] = new TH1F("TrueDirectPi0Binning","True Photon from Pi0 Decay (Direct)",20, fBinsPi013TeVEMCTrigEG1IsoPt);
1326  fHistoTrueFragPhotonsDirectIso[iCut] = new TH1F("TrueDirectFragPhoton","True Photon from Fragmentation (Direct)",nBinsClusterPt, arrClusPtBinning);
1327  fIsolation[iCut]->Add(fHistoTrueFragPhotonsDirectIso[iCut]);
1328  fHistoTruePromptPhotonsDirectIso[iCut] = new TH1F("TrueDirectPromptPhoton","True Prompt Photon (Direct)",nBinsClusterPt, arrClusPtBinning);
1329  fIsolation[iCut]->Add(fHistoTruePromptPhotonsDirectIso[iCut]);
1330  fHistoTruePhotonsfromPi0ConvIso[iCut] = new TH1F("TrueConvPi0","True Photon from Pi0 Decay (Conv)",nBinsClusterPt, arrClusPtBinning);
1331  fIsolation[iCut]->Add(fHistoTruePhotonsfromPi0ConvIso[iCut]);
1332  fHistoTruePhotonsfromPi0ConvIsoBinning[iCut] = new TH1F("TrueConvPi0Binning","True Photon from Pi0 Decay (Conv)",20, fBinsPi013TeVEMCTrigEG1IsoPt);
1334  fHistoTrueFragPhotonsConvIso[iCut] = new TH1F("TrueConvFragPhoton","True Photon from Fragmentation (Conv)",nBinsClusterPt, arrClusPtBinning);
1335  fIsolation[iCut]->Add(fHistoTrueFragPhotonsConvIso[iCut]);
1336  fHistoTruePromptPhotonsConvIso[iCut] = new TH1F("TrueConvPromptPhoton","True Prompt Photon (Conv)",nBinsClusterPt, arrClusPtBinning);
1337  fIsolation[iCut]->Add(fHistoTruePromptPhotonsConvIso[iCut]);
1338  fHistoTrueOtherSourcesIso[iCut] = new TH1F("TruePhotonsOtherSources","True Photons from other sources",nBinsClusterPt, arrClusPtBinning);
1339  fIsolation[iCut]->Add(fHistoTrueOtherSourcesIso[iCut]);
1340 
1341  fHistoTruePi0DecayCandNoConv[iCut] = new TH1F("TruePi0DecayCandNoConv","Comparison Decay Photon Yield (Direct)",nBinsClusterPt, arrClusPtBinning);
1342  fIsolation[iCut]->Add(fHistoTruePi0DecayCandNoConv[iCut]);
1343  fHistoTruePi0DecayCand[iCut] = new TH1F("TruePi0DecayCand","Comparison Decay Photon Yield",nBinsClusterPt, arrClusPtBinning);
1344  fIsolation[iCut]->Add(fHistoTruePi0DecayCand[iCut]);
1345 
1346  fHistoTruePi0DecayCandNoConvBinning[iCut] = new TH1F("TruePi0DecayCandNoConvBinning","Comparison Decay Photon Yield (Direct)",20, fBinsPi013TeVEMCTrigEG1IsoPt);
1348  fHistoTruePi0DecayCandBinning[iCut] = new TH1F("TruePi0DecayCandBinning","Comparison Decay Photon Yield",20, fBinsPi013TeVEMCTrigEG1IsoPt);
1349  fIsolation[iCut]->Add(fHistoTruePi0DecayCandBinning[iCut]);
1350 
1351 
1352  }
1353 
1354 
1355 
1356  if (fIsMC > 1){
1357  fHistoIsoClusterPDGtoPt[iCut]->Sumw2();
1358  fHistoIsoMotherPDGtoPt[iCut]->Sumw2();
1359  fHistoDoubleCountMCIsoInitPhotonPt[iCut]->Sumw2();
1360 
1361  fHistoTruePhotonCandidatesIso[iCut]->Sumw2();
1362  fHistoTruePhotonsfromPi0DirectIso[iCut]->Sumw2();
1364  fHistoTrueFragPhotonsDirectIso[iCut]->Sumw2();
1365  fHistoTruePromptPhotonsDirectIso[iCut]->Sumw2();
1366  fHistoTruePhotonsfromPi0ConvIso[iCut]->Sumw2();
1368  fHistoTrueFragPhotonsConvIso[iCut]->Sumw2();
1369  fHistoTruePromptPhotonsConvIso[iCut]->Sumw2();
1370  fHistoTrueOtherSourcesIso[iCut]->Sumw2();
1371  fHistoTruePi0DecayCandNoConv[iCut]->Sumw2();
1372  fHistoTruePi0DecayCand[iCut]->Sumw2();
1373  fHistoTruePi0DecayCandNoConvBinning[iCut]->Sumw2();
1374  fHistoTruePi0DecayCandBinning[iCut]->Sumw2();
1375  }
1376 
1377 
1378 
1379  fESDList[iCut] = new TList();
1380  fESDList[iCut]->SetName(Form("%s_%s_%s ESD histograms", cutstringEvent.Data(), cutstringCalo.Data(), cutstringMeson.Data()));
1381  fESDList[iCut]->SetOwner(kTRUE);
1382  fCutFolder[iCut]->Add(fESDList[iCut]);
1383 
1384  fHistoNEvents[iCut] = new TH1F("NEvents", "NEvents", 15, -0.5, 13.5);
1385  fHistoNEvents[iCut]->GetXaxis()->SetBinLabel(1,"Accepted");
1386  fHistoNEvents[iCut]->GetXaxis()->SetBinLabel(2,"Centrality");
1387  fHistoNEvents[iCut]->GetXaxis()->SetBinLabel(3,"Miss. MC or inc. ev.");
1388  if (((AliConvEventCuts*)fEventCutArray->At(iCut))->IsSpecialTrigger() > 1 ){
1389  TString TriggerNames = "Not Trigger: ";
1390  TriggerNames = TriggerNames+ ( (AliConvEventCuts*)fEventCutArray->At(iCut))->GetSpecialTriggerName();
1391  fHistoNEvents[iCut]->GetXaxis()->SetBinLabel(4,TriggerNames.Data());
1392  } else {
1393  fHistoNEvents[iCut]->GetXaxis()->SetBinLabel(4,"Trigger");
1394  }
1395  fHistoNEvents[iCut]->GetXaxis()->SetBinLabel(5,"Vertex Z");
1396  fHistoNEvents[iCut]->GetXaxis()->SetBinLabel(6,"Cont. Vertex");
1397  fHistoNEvents[iCut]->GetXaxis()->SetBinLabel(7,"SPD Pile-Up");
1398  fHistoNEvents[iCut]->GetXaxis()->SetBinLabel(8,"no SDD");
1399  fHistoNEvents[iCut]->GetXaxis()->SetBinLabel(9,"no V0AND");
1400  fHistoNEvents[iCut]->GetXaxis()->SetBinLabel(10,"EMCAL problems");
1401  fHistoNEvents[iCut]->GetXaxis()->SetBinLabel(11,"rejectedForJetJetMC");
1402  fHistoNEvents[iCut]->GetXaxis()->SetBinLabel(12,"SPD hits vs tracklet");
1403  fHistoNEvents[iCut]->GetXaxis()->SetBinLabel(13,"Out-of-Bunch pileup Past-Future");
1404  fHistoNEvents[iCut]->GetXaxis()->SetBinLabel(14,"Pileup V0M-TPCout Tracks");
1405  fHistoNEvents[iCut]->GetXaxis()->SetBinLabel(15,"Sphericity");
1406  fESDList[iCut]->Add(fHistoNEvents[iCut]);
1407 
1408  if (fIsMC > 1){
1409  fHistoNEventsWOWeight[iCut] = new TH1F("NEventsWOWeight", "NEventsWOWeight", 15, -0.5, 13.5);
1410  fHistoNEventsWOWeight[iCut]->GetXaxis()->SetBinLabel(1,"Accepted");
1411  fHistoNEventsWOWeight[iCut]->GetXaxis()->SetBinLabel(2,"Centrality");
1412  fHistoNEventsWOWeight[iCut]->GetXaxis()->SetBinLabel(3,"Miss. MC or inc. ev.");
1413  if (((AliConvEventCuts*)fEventCutArray->At(iCut))->IsSpecialTrigger() > 1 ){
1414  TString TriggerNames = "Not Trigger: ";
1415  TriggerNames = TriggerNames+ ( (AliConvEventCuts*)fEventCutArray->At(iCut))->GetSpecialTriggerName();
1416  fHistoNEventsWOWeight[iCut]->GetXaxis()->SetBinLabel(4,TriggerNames.Data());
1417  } else {
1418  fHistoNEventsWOWeight[iCut]->GetXaxis()->SetBinLabel(4,"Trigger");
1419  }
1420  fHistoNEventsWOWeight[iCut]->GetXaxis()->SetBinLabel(5,"Vertex Z");
1421  fHistoNEventsWOWeight[iCut]->GetXaxis()->SetBinLabel(6,"Cont. Vertex");
1422  fHistoNEventsWOWeight[iCut]->GetXaxis()->SetBinLabel(7,"Pile-Up");
1423  fHistoNEventsWOWeight[iCut]->GetXaxis()->SetBinLabel(8,"no SDD");
1424  fHistoNEventsWOWeight[iCut]->GetXaxis()->SetBinLabel(9,"no V0AND");
1425  fHistoNEventsWOWeight[iCut]->GetXaxis()->SetBinLabel(10,"EMCAL problem");
1426  fHistoNEventsWOWeight[iCut]->GetXaxis()->SetBinLabel(11,"rejectedForJetJetMC");
1427  fHistoNEventsWOWeight[iCut]->GetXaxis()->SetBinLabel(12,"SPD hits vs tracklet");
1428  fHistoNEventsWOWeight[iCut]->GetXaxis()->SetBinLabel(13,"Out-of-Bunch pileup Past-Future");
1429  fHistoNEventsWOWeight[iCut]->GetXaxis()->SetBinLabel(14,"Pileup V0M-TPCout Tracks");
1430  fHistoNEventsWOWeight[iCut]->GetXaxis()->SetBinLabel(15,"Sphericity");
1431  fESDList[iCut]->Add(fHistoNEventsWOWeight[iCut]);
1432  }
1433  if (fIsMC == 2){
1434  fProfileJetJetXSection[iCut] = new TProfile("XSection", "XSection", 1, -0.5, 0.5);
1435  fESDList[iCut]->Add(fProfileJetJetXSection[iCut]);
1436  fHistoJetJetNTrials[iCut] = new TH1F("NTrials", "#sum{NTrials}", 1, 0, 1);
1437  fHistoJetJetNTrials[iCut]->GetXaxis()->SetBinLabel(1,"#sum{NTrials}");
1438  fESDList[iCut]->Add(fHistoJetJetNTrials[iCut]);
1439  }
1440 
1441  if(fIsHeavyIon == 1)
1442  fHistoNGoodESDTracks[iCut] = new TH1F("GoodESDTracks", "GoodESDTracks", 4000, 0, 4000);
1443  else if(fIsHeavyIon == 2)
1444  fHistoNGoodESDTracks[iCut] = new TH1F("GoodESDTracks", "GoodESDTracks", 400, 0, 400);
1445  else
1446  fHistoNGoodESDTracks[iCut] = new TH1F("GoodESDTracks", "GoodESDTracks", 200, 0, 200);
1447  fHistoNGoodESDTracks[iCut]->GetXaxis()->SetTitle("#primary tracks");
1448  fESDList[iCut]->Add(fHistoNGoodESDTracks[iCut]);
1449 
1450  if(((AliConvEventCuts*)fEventCutArray->At(iCut))->GetUseSphericity()!=0){
1451  fHistoEventSphericity[iCut] = new TH1F("EventSphericity", "EventSphericity", 100, 0, 1);
1452  fHistoEventSphericity[iCut]->GetXaxis()->SetTitle("S");
1453  fESDList[iCut]->Add(fHistoEventSphericity[iCut]);
1454  fV0Reader->SetCalcSphericity(kTRUE);
1455  fHistoEventSphericityvsNtracks[iCut] = new TH2F("EventSphericity vs Ntracks", "EventSphericity vs Ntracks", 100, 0, 1, 100, 0, 100);
1456  fHistoEventSphericityvsNtracks[iCut]->GetXaxis()->SetTitle("S");
1457  fHistoEventSphericityvsNtracks[iCut]->GetYaxis()->SetTitle("Ntracks");
1458  fESDList[iCut]->Add(fHistoEventSphericityvsNtracks[iCut]);
1459  }
1460 
1461  fHistoVertexZ[iCut] = new TH1F("VertexZ", "VertexZ", 200, -10, 10);
1462  fHistoVertexZ[iCut]->GetXaxis()->SetTitle("Z_{vtx} (cm)");
1463  fESDList[iCut]->Add(fHistoVertexZ[iCut]);
1464 
1465  if(fIsHeavyIon == 1)
1466  fHistoNGammaCandidatesBasic[iCut] = new TH1F("GammaCandidatesBasic", "GammaCandidatesBasic", 600, 0, 600);
1467  else if(fIsHeavyIon == 2)
1468  fHistoNGammaCandidatesBasic[iCut] = new TH1F("GammaCandidatesBasic", "GammaCandidatesBasic", 400, 0, 400);
1469  else
1470  fHistoNGammaCandidatesBasic[iCut] = new TH1F("GammaCandidatesBasic", "GammaCandidatesBasic", 100, 0, 100);
1471  fHistoNGammaCandidatesBasic[iCut]->GetXaxis()->SetTitle("#cluster candidates basic");
1472  fESDList[iCut]->Add(fHistoNGammaCandidatesBasic[iCut]);
1473 
1474 
1475  if(fIsHeavyIon == 1)
1476  fHistoNGammaCandidates[iCut] = new TH1F("GammaCandidates", "GammaCandidates", 200, 0, 200);
1477  else if(fIsHeavyIon == 2)
1478  fHistoNGammaCandidates[iCut] = new TH1F("GammaCandidates", "GammaCandidates", 100, 0, 100);
1479  else
1480  fHistoNGammaCandidates[iCut] = new TH1F("GammaCandidates", "GammaCandidates", 50, 0, 50);
1481  fHistoNGammaCandidates[iCut]->GetXaxis()->SetTitle("#cluster candidates with current cut");
1482  fESDList[iCut]->Add(fHistoNGammaCandidates[iCut]);
1483 
1484  if(!fDoLightOutput){
1485  if(fIsHeavyIon == 1)
1486  fHistoNGoodESDTracksVsNGammaCandidates[iCut] = new TH2F("GoodESDTracksVsGammaCandidates", "GoodESDTracksVsGammaCandidates", 4000, 0, 4000, 200, 0, 200);
1487  else if(fIsHeavyIon == 2)
1488  fHistoNGoodESDTracksVsNGammaCandidates[iCut] = new TH2F("GoodESDTracksVsGammaCandidates", "GoodESDTracksVsGammaCandidates", 400, 0, 400, 100, 0, 100);
1489  else
1490  fHistoNGoodESDTracksVsNGammaCandidates[iCut] = new TH2F("GoodESDTracksVsGammaCandidates", "GoodESDTracksVsGammaCandidates", 200, 0, 200, 50, 0, 50);
1491  fHistoNGoodESDTracksVsNGammaCandidates[iCut]->SetXTitle("#good tracks");
1492  fHistoNGoodESDTracksVsNGammaCandidates[iCut]->SetYTitle("#cluster candidates");
1494 
1495  fHistoSPDClusterTrackletBackground[iCut] = new TH2F("SPD tracklets vs SPD clusters", "SPD tracklets vs SPD clusters", 100, 0, 200, 250, 0, 1000);
1496  fESDList[iCut]->Add(fHistoSPDClusterTrackletBackground[iCut]);
1497 
1498  if(fIsHeavyIon == 1)
1499  fHistoNV0Tracks[iCut] = new TH1F("V0 Multiplicity", "V0 Multiplicity", 30000, 0, 30000);
1500  else if(fIsHeavyIon == 2)
1501  fHistoNV0Tracks[iCut] = new TH1F("V0 Multiplicity", "V0 Multiplicity", 2500, 0, 2500);
1502  else
1503  fHistoNV0Tracks[iCut] = new TH1F("V0 Multiplicity", "V0 Multiplicity", 1500, 0, 1500);
1504  fHistoNV0Tracks[iCut]->SetXTitle("V0 amplitude");
1505  fESDList[iCut]->Add(fHistoNV0Tracks[iCut]);
1506  }
1507 
1508  if(fIsHeavyIon==2) {
1509  fProfileEtaShift[iCut] = new TProfile("Eta Shift", "Eta Shift", 1, -0.5, 0.5);
1510  fProfileEtaShift[iCut]->SetXTitle("#eta shift");
1511  fESDList[iCut]->Add(fProfileEtaShift[iCut]);
1512  }
1513 
1514  if (fIsMC > 1){
1515  fHistoNEvents[iCut]->Sumw2();
1516  fHistoNGoodESDTracks[iCut]->Sumw2();
1517  if(((AliConvEventCuts*)fEventCutArray->At(iCut))->GetUseSphericity()!=0){
1518  fHistoEventSphericity[iCut]->Sumw2();
1519  fHistoEventSphericityvsNtracks[iCut]->Sumw2();
1520  }
1521  fHistoVertexZ[iCut]->Sumw2();
1522  fHistoNGammaCandidates[iCut]->Sumw2();
1523  fHistoNGammaCandidatesBasic[iCut]->Sumw2();
1524  if(!fDoLightOutput){
1526  fHistoSPDClusterTrackletBackground[iCut]->Sumw2();
1527  fHistoNV0Tracks[iCut]->Sumw2();
1528  }
1529  if(fIsHeavyIon==2) fProfileEtaShift[iCut]->Sumw2();
1530  }
1531 
1532  fHistoClusGammaPt[iCut] = new TH1F("ClusGamma_Pt", "ClusGamma_Pt", nBinsClusterPt, arrClusPtBinning);
1533  fHistoClusGammaPt[iCut]->SetXTitle("p_{T,clus} (GeV/c)");
1534  fESDList[iCut]->Add(fHistoClusGammaPt[iCut]);
1535  fHistoClusGammaE[iCut] = new TH1F("ClusGamma_E", "ClusGamma_E", nBinsClusterPt, arrClusPtBinning);
1536  fHistoClusGammaPt[iCut]->SetXTitle("E_{clus} (GeV/c)");
1537  fESDList[iCut]->Add(fHistoClusGammaE[iCut]);
1538  fHistoClusOverlapHeadersGammaPt[iCut] = new TH1F("ClusGammaOverlapHeaders_Pt", "ClusGammaOverlapHeaders_Pt", nBinsClusterPt, arrClusPtBinning);
1539  fHistoClusOverlapHeadersGammaPt[iCut]->SetXTitle("p_{T,clus} (GeV/c), selected header w/ overlap");
1540  fESDList[iCut]->Add(fHistoClusOverlapHeadersGammaPt[iCut]);
1541  fHistoClusAllHeadersGammaPt[iCut] = new TH1F("ClusGammaAllHeaders_Pt", "ClusGammaAllHeaders_Pt", nBinsClusterPt, arrClusPtBinning);
1542  fHistoClusAllHeadersGammaPt[iCut]->SetXTitle("p_{T,clus} (GeV/c), all headers");
1543  fESDList[iCut]->Add(fHistoClusAllHeadersGammaPt[iCut]);
1544  fHistoClusRejectedHeadersGammaPt[iCut] = new TH1F("ClusGammaRejectedHeaders_Pt", "ClusGammaRejectedHeaders_Pt", nBinsClusterPt, arrClusPtBinning);
1545  fHistoClusRejectedHeadersGammaPt[iCut]->SetXTitle("p_{T,clus} (GeV/c), rejected headers");
1546  fESDList[iCut]->Add(fHistoClusRejectedHeadersGammaPt[iCut]);
1547  if(!fDoLightOutput && fDoClusterQA > 0){
1548  fHistoClusGammaPtM02[iCut] = new TH2F("ClusGamma_Pt_M02", "ClusGamma_Pt_M02", nBinsClusterPt, arrClusPtBinning, 100, 0, 1);
1549  fHistoClusGammaPtM02[iCut]->SetXTitle("p_{T,clus} (GeV/c)");
1550  fHistoClusGammaPtM02[iCut]->SetYTitle("#sigma_{long}^{2}");
1551  fESDList[iCut]->Add(fHistoClusGammaPtM02[iCut]);
1552  }
1553 
1554  if (fIsMC > 1){
1555  fHistoClusGammaPt[iCut]->Sumw2();
1556  fHistoClusGammaE[iCut]->Sumw2();
1557  fHistoClusOverlapHeadersGammaPt[iCut]->Sumw2();
1558  fHistoClusAllHeadersGammaPt[iCut]->Sumw2();
1559  fHistoClusRejectedHeadersGammaPt[iCut]->Sumw2();
1560  if(!fDoLightOutput && fDoClusterQA > 0)fHistoClusGammaPtM02[iCut]->Sumw2();
1561  }
1562 
1563  if(fDoMesonAnalysis){
1564  fHistoMotherInvMassPt[iCut] = new TH2F("ESD_Mother_InvMass_Pt", "ESD_Mother_InvMass_Pt", 800, 0, 0.8, nBinsPt, arrPtBinning);
1565  fHistoMotherInvMassPt[iCut]->SetXTitle("M_{#gamma#gamma} (GeV/c^{2})");
1566  fHistoMotherInvMassPt[iCut]->SetYTitle("p_{T} (GeV/c)");
1567  fESDList[iCut]->Add(fHistoMotherInvMassPt[iCut]);
1568  fHistoMotherBackInvMassPt[iCut] = new TH2F("ESD_Background_InvMass_Pt", "ESD_Background_InvMass_Pt", 800, 0, 0.8, nBinsPt, arrPtBinning);
1569  fHistoMotherBackInvMassPt[iCut]->SetXTitle("M_{#gamma#gamma} (GeV/c^{2})");
1570  fHistoMotherBackInvMassPt[iCut]->SetYTitle("p_{T} (GeV/c)");
1571  fESDList[iCut]->Add(fHistoMotherBackInvMassPt[iCut]);
1572  if(!fDoLightOutput){
1573  fHistoMotherInvMassECalib[iCut] = new TH2F("ESD_Mother_InvMass_E_Calib", "ESD_Mother_InvMass_E_Calib", 800, 0, 0.8, nBinsPt, arrPtBinning);
1574  fHistoMotherInvMassECalib[iCut]->SetXTitle("M_{inv} (GeV/c^{2})");
1575  fHistoMotherInvMassECalib[iCut]->SetYTitle("E_{cluster}(GeV)");
1576  fESDList[iCut]->Add(fHistoMotherInvMassECalib[iCut]);
1577  fHistoMotherBackInvMassECalib[iCut] = new TH2F("ESD_Background_InvMass_E_Calib", "ESD_Background_InvMass_E_Calib", 800, 0, 0.8, nBinsPt, arrPtBinning);
1578  fHistoMotherBackInvMassECalib[iCut]->SetXTitle("M_{inv} (GeV/c^{2})");
1579  fHistoMotherBackInvMassECalib[iCut]->SetYTitle("E_{cluster}(GeV)");
1580  fESDList[iCut]->Add(fHistoMotherBackInvMassECalib[iCut]);
1581  }
1582 
1583  if (fIsMC > 1){
1584  fHistoMotherInvMassPt[iCut]->Sumw2();
1585  fHistoMotherBackInvMassPt[iCut]->Sumw2();
1586  if(!fDoLightOutput){
1587  fHistoMotherInvMassECalib[iCut]->Sumw2();
1588  fHistoMotherBackInvMassECalib[iCut]->Sumw2();
1589  }
1590  }
1591 
1592  if (fDoMesonQA > 0 && fDoMesonQA < 3 ){
1593  fHistoMotherPi0PtY[iCut] = new TH2F("ESD_MotherPi0_Pt_Y", "ESD_MotherPi0_Pt_Y", nBinsQAPt, arrQAPtBinning, 150, -1.5, 1.5);
1594  fHistoMotherPi0PtY[iCut]->SetXTitle("p_{T} (GeV/c)");
1595  fHistoMotherPi0PtY[iCut]->SetYTitle("y_{#pi^{0}}");
1596  fESDList[iCut]->Add(fHistoMotherPi0PtY[iCut]);
1597  fHistoMotherEtaPtY[iCut] = new TH2F("ESD_MotherEta_Pt_Y", "ESD_MotherEta_Pt_Y", nBinsQAPt, arrQAPtBinning, 150, -1.5, 1.5);
1598  fHistoMotherEtaPtY[iCut]->SetXTitle("p_{T} (GeV/c)");
1599  fHistoMotherEtaPtY[iCut]->SetYTitle("y_{#eta}");
1600  fESDList[iCut]->Add(fHistoMotherEtaPtY[iCut]);
1601  fHistoMotherPi0PtAlpha[iCut] = new TH2F("ESD_MotherPi0_Pt_Alpha", "ESD_MotherPi0_Pt_Alpha", nBinsQAPt, arrQAPtBinning, 100, 0, 1);
1602  fHistoMotherPi0PtAlpha[iCut]->SetXTitle("p_{T} (GeV/c)");
1603  fHistoMotherPi0PtAlpha[iCut]->SetYTitle("#alpha_{#pi^{0}}");
1604  fESDList[iCut]->Add(fHistoMotherPi0PtAlpha[iCut]);
1605  fHistoMotherEtaPtAlpha[iCut] = new TH2F("ESD_MotherEta_Pt_Alpha", "ESD_MotherEta_Pt_Alpha", nBinsQAPt, arrQAPtBinning, 100, 0, 1);
1606  fHistoMotherEtaPtAlpha[iCut]->SetXTitle("p_{T} (GeV/c)");
1607  fHistoMotherEtaPtAlpha[iCut]->SetYTitle("#alpha_{#eta}");
1608  fESDList[iCut]->Add(fHistoMotherEtaPtAlpha[iCut]);
1609  fHistoMotherPi0PtOpenAngle[iCut] = new TH2F("ESD_MotherPi0_Pt_OpenAngle", "ESD_MotherPi0_Pt_OpenAngle", nBinsQAPt, arrQAPtBinning,100,0, 0.5);
1610  fHistoMotherPi0PtOpenAngle[iCut]->SetXTitle("p_{T} (GeV/c)");
1611  fHistoMotherPi0PtOpenAngle[iCut]->SetYTitle("#theta_{#pi^{0}}");
1612  fESDList[iCut]->Add(fHistoMotherPi0PtOpenAngle[iCut]);
1613  fHistoMotherEtaPtOpenAngle[iCut] = new TH2F("ESD_MotherEta_Pt_OpenAngle", "ESD_MotherEta_Pt_OpenAngle", nBinsQAPt, arrQAPtBinning,180,0, 1.8);
1614  fHistoMotherEtaPtOpenAngle[iCut]->SetXTitle("p_{T} (GeV/c)");
1615  fHistoMotherEtaPtOpenAngle[iCut]->SetYTitle("#theta_{#eta}");
1616  fESDList[iCut]->Add(fHistoMotherEtaPtOpenAngle[iCut]);
1617  if(fIsHeavyIon == 1){
1618  fHistoMotherPi0NGoodESDTracksPt[iCut] = new TH2F("ESD_MotherPi0_GoodESDTracks_Pt", "ESD_MotherPi0_GoodESDTracks_Pt", 4000, 0, 4000, nBinsQAPt, arrQAPtBinning);
1619  fHistoMotherPi0NGoodESDTracksPt[iCut]->SetXTitle("# good tracks");
1620  fHistoMotherPi0NGoodESDTracksPt[iCut]->SetYTitle("p_{#pi^{0}, T} (GeV/c)");
1621  fHistoMotherEtaNGoodESDTracksPt[iCut] = new TH2F("ESD_MotherEta_GoodESDTracks_Pt", "ESD_MotherEta_GoodESDTracks_Pt", 4000, 0, 4000, nBinsQAPt, arrQAPtBinning);
1622  fHistoMotherEtaNGoodESDTracksPt[iCut]->SetXTitle("# good tracks");
1623  fHistoMotherEtaNGoodESDTracksPt[iCut]->SetYTitle("p_{#eta, T} (GeV/c)");
1624  }else if(fIsHeavyIon == 2){
1625  fHistoMotherPi0NGoodESDTracksPt[iCut] = new TH2F("ESD_MotherPi0_GoodESDTracks_Pt", "ESD_MotherPi0_GoodESDTracks_Pt", 400, 0, 400, nBinsQAPt, arrQAPtBinning);
1626  fHistoMotherPi0NGoodESDTracksPt[iCut]->SetXTitle("# good tracks");
1627  fHistoMotherPi0NGoodESDTracksPt[iCut]->SetYTitle("p_{#pi^{0}, T} (GeV/c)");
1628  fHistoMotherEtaNGoodESDTracksPt[iCut] = new TH2F("ESD_MotherEta_GoodESDTracks_Pt", "ESD_MotherEta_GoodESDTracks_Pt", 400, 0, 400, nBinsQAPt, arrQAPtBinning);
1629  fHistoMotherEtaNGoodESDTracksPt[iCut]->SetXTitle("# good tracks");
1630  fHistoMotherEtaNGoodESDTracksPt[iCut]->SetYTitle("p_{#eta, T} (GeV/c)");
1631  }else{
1632  fHistoMotherPi0NGoodESDTracksPt[iCut] = new TH2F("ESD_MotherPi0_GoodESDTracks_Pt", "ESD_MotherPi0_GoodESDTracks_Pt", 200, 0, 200, nBinsQAPt, arrQAPtBinning);
1633  fHistoMotherPi0NGoodESDTracksPt[iCut]->SetXTitle("# good tracks");
1634  fHistoMotherPi0NGoodESDTracksPt[iCut]->SetYTitle("p_{#pi^{0}, T} (GeV/c)");
1635  fHistoMotherEtaNGoodESDTracksPt[iCut] = new TH2F("ESD_MotherEta_GoodESDTracks_Pt", "ESD_MotherEta_GoodESDTracks_Pt", 200, 0, 200, nBinsQAPt, arrQAPtBinning);
1636  fHistoMotherEtaNGoodESDTracksPt[iCut]->SetXTitle("# good tracks");
1637  fHistoMotherEtaNGoodESDTracksPt[iCut]->SetYTitle("p_{#eta, T} (GeV/c)");
1638  }
1639  fESDList[iCut]->Add(fHistoMotherPi0NGoodESDTracksPt[iCut]);
1640  fESDList[iCut]->Add(fHistoMotherEtaNGoodESDTracksPt[iCut]);
1641  }
1642  if (fDoMesonQA == 2){
1643  fHistoMotherPtOpenAngle[iCut] = new TH2F("ESD_Mother_Pt_OpenAngle", "ESD_Mother_Pt_OpenAngle", nBinsQAPt, arrQAPtBinning,180,0, 1.8);
1644  fHistoMotherPtOpenAngle[iCut]->SetXTitle("p_{T} (GeV/c)");
1645  fHistoMotherPtOpenAngle[iCut]->SetYTitle("#theta");
1646  fESDList[iCut]->Add(fHistoMotherPtOpenAngle[iCut]);
1647  fHistoMotherPtOpenAngleBck[iCut] = new TH2F("ESD_MotherBck_Pt_OpenAngle", "ESD_MotherBck_Pt_OpenAngle", nBinsQAPt, arrQAPtBinning,180,0, 1.8);
1648  fHistoMotherPtOpenAngleBck[iCut]->SetXTitle("p_{T} (GeV/c)");
1649  fHistoMotherPtOpenAngleBck[iCut]->SetYTitle("#theta");
1650  fESDList[iCut]->Add(fHistoMotherPtOpenAngleBck[iCut]);
1651  if (fIsMC == 2){
1652  fHistoMotherPtOpenAngle[iCut]->Sumw2();
1653  fHistoMotherPtOpenAngleBck[iCut]->Sumw2();
1654  }
1655  }
1656 
1657  if (fIsMC > 1 && fDoMesonQA > 0 && fDoMesonQA < 3){
1658  fHistoMotherPi0PtY[iCut]->Sumw2();
1659  fHistoMotherEtaPtY[iCut]->Sumw2();
1660  fHistoMotherPi0PtAlpha[iCut]->Sumw2();
1661  fHistoMotherEtaPtAlpha[iCut]->Sumw2();
1662  fHistoMotherPi0PtOpenAngle[iCut]->Sumw2();
1663  fHistoMotherEtaPtOpenAngle[iCut]->Sumw2();
1664  fHistoMotherPi0NGoodESDTracksPt[iCut]->Sumw2();
1665  fHistoMotherEtaNGoodESDTracksPt[iCut]->Sumw2();
1666  }
1667 
1668  if (fProduceCellIDPlots){
1669  Int_t nMaxCells = 12*48*24;
1670  if(((AliCaloPhotonCuts*)fClusterCutArray->At(iCut))->GetClusterType() == 2) nMaxCells = 5*56*64;
1671  fHistCellIDvsClusterEnergy[iCut] = new TH2F("CellIDvsClusterEnergy", "CellIDvsClusterEnergy", 100, 0.5, 100., nMaxCells, 0, nMaxCells);
1672  fHistCellIDvsClusterEnergy[iCut]->SetXTitle("E_{clus} (GeV)");
1673  fHistCellIDvsClusterEnergy[iCut]->SetYTitle("Cell ID");
1675  fESDList[iCut]->Add(fHistCellIDvsClusterEnergy[iCut]);
1676  fHistCellIDvsClusterEnergyMax[iCut] = new TH2F("CellIDvsClusterEnergyMax", "CellIDvsClusterEnergyMax", 100, 0.5, 100., nMaxCells, 0, nMaxCells);
1677  fHistCellIDvsClusterEnergyMax[iCut]->SetXTitle("E_{clus} (GeV)");
1678  fHistCellIDvsClusterEnergyMax[iCut]->SetYTitle("Cell ID");
1680  fESDList[iCut]->Add(fHistCellIDvsClusterEnergyMax[iCut]);
1681  }
1682 
1683  if (fDoMesonQA == 4 && fIsMC == 0){
1684  fTreeList[iCut] = new TList();
1685  fTreeList[iCut]->SetName(Form("%s_%s_%s InvMass Tree", cutstringEvent.Data(), cutstringCalo.Data(), cutstringMeson.Data()));
1686  fTreeList[iCut]->SetOwner(kTRUE);
1687  fCutFolder[iCut]->Add(fTreeList[iCut]);
1688 
1689  tSigInvMassPtAlphaTheta[iCut] = new TTree("Sig_InvMass_Pt_Alpha_Theta_MixPool", "Sig_InvMass_Pt_Alpha_Theta_MixPool");
1690  tSigInvMassPtAlphaTheta[iCut]->Branch("InvMass",&fInvMassTreeInvMass,"fInvMassTreeInvMass/F");
1691  tSigInvMassPtAlphaTheta[iCut]->Branch("Pt",&fInvMassTreePt,"fInvMassTreePt/F");
1692  tSigInvMassPtAlphaTheta[iCut]->Branch("Alpha",&fInvMassTreeAlpha,"fInvMassTreeAlpha/F");
1693  tSigInvMassPtAlphaTheta[iCut]->Branch("Theta",&fInvMassTreeTheta,"fInvMassTreeTheta/F");
1694  tSigInvMassPtAlphaTheta[iCut]->Branch("MixPool",&fInvMassTreeMixPool,"fInvMassTreeMixPool/I");
1695  tSigInvMassPtAlphaTheta[iCut]->Branch("zVtx",&fInvMassTreeZVertex,"fInvMassTreeZVertex/F");
1696  tSigInvMassPtAlphaTheta[iCut]->Branch("Eta",&fInvMassTreeEta,"fInvMassTreeEta/F");
1697  fTreeList[iCut]->Add(tSigInvMassPtAlphaTheta[iCut]);
1698 
1699  tBckInvMassPtAlphaTheta[iCut] = new TTree("Bck_InvMass_Pt_Alpha_Theta_MixPool", "Bck_InvMass_Pt_Alpha_Theta_MixPool");
1700  tBckInvMassPtAlphaTheta[iCut]->Branch("InvMass",&fInvMassTreeInvMass,"fInvMassTreeInvMass/F");
1701  tBckInvMassPtAlphaTheta[iCut]->Branch("Pt",&fInvMassTreePt,"fInvMassTreePt/F");
1702  tBckInvMassPtAlphaTheta[iCut]->Branch("Alpha",&fInvMassTreeAlpha,"fInvMassTreeAlpha/F");
1703  tBckInvMassPtAlphaTheta[iCut]->Branch("Theta",&fInvMassTreeTheta,"fInvMassTreeTheta/F");
1704  tBckInvMassPtAlphaTheta[iCut]->Branch("MixPool",&fInvMassTreeMixPool,"fInvMassTreeMixPool/I");
1705  tBckInvMassPtAlphaTheta[iCut]->Branch("zVtx",&fInvMassTreeZVertex,"fInvMassTreeZVertex/F");
1706  tBckInvMassPtAlphaTheta[iCut]->Branch("Eta",&fInvMassTreeEta,"fInvMassTreeEta/F");
1707  fTreeList[iCut]->Add(tBckInvMassPtAlphaTheta[iCut]);
1708  }
1709 
1710  if (fProduceTreeEOverP ){
1711  fClusterTreeList[iCut] = new TList();
1712  fClusterTreeList[iCut]->SetName(Form("%s_%s EoverP Tree",cutstringEvent.Data(),cutstringCalo.Data()));
1713  fClusterTreeList[iCut]->SetOwner(kTRUE);
1714  fCutFolder[iCut]->Add(fClusterTreeList[iCut]);
1715 
1716  tClusterEOverP[iCut] = new TTree("EOverP_ClusE_ClusM02_ClusM20_TrackP_TrackPt", "EOverP_ClusE_ClusM02_ClusM20_TrackP_TrackPt");
1717  tClusterEOverP[iCut]->Branch("ClusE",&fClusterE,"fClusterE/F");
1718  tClusterEOverP[iCut]->Branch("ClusM02",&fClusterM02,"fClusterM02/F");
1719  tClusterEOverP[iCut]->Branch("ClusM20",&fClusterM20,"fClusterM20/F");
1720  tClusterEOverP[iCut]->Branch("ClusEP",&fClusterEP,"fClusterEP/F");
1721  tClusterEOverP[iCut]->Branch("ClusLeadCellID",&fClusterLeadCellID,"fClusterLeadCellID/I");
1722  if(fIsMC > 0) tClusterEOverP[iCut]->Branch("ClusClassification",&fClusterClassification,"fClusterClassification/I");
1723  tClusterEOverP[iCut]->Branch("ClusTrackDeltaEta",&fDeltaEta,"fDeltaEta/F");
1724  tClusterEOverP[iCut]->Branch("ClusTrackDeltaPhi",&fDeltaPhi,"fDeltaPhi/F");
1725  tClusterEOverP[iCut]->Branch("TrackPt",&fTrackPt,"fTrackPt/F");
1726  tClusterEOverP[iCut]->Branch("TrackPID_e",&fTrackPID_e,"fTrackPID_e/I");
1727  tClusterEOverP[iCut]->Branch("TrackPID_Pi",&fTrackPID_Pi,"fTrackPID_Pi/I");
1728  tClusterEOverP[iCut]->Branch("TrackPID_K",&fTrackPID_K,"fTrackPID_K/I");
1729  tClusterEOverP[iCut]->Branch("TrackPID_P",&fTrackPID_P,"fTrackPID_P/I");
1730  tClusterEOverP[iCut]->Branch("ClusIsoSumClusEt",&fClusterIsoSumClusterEt,"fClusterIsoSumClusterEt/F");
1731  tClusterEOverP[iCut]->Branch("ClusIsoSumTrackEt",&fClusterIsoSumTrackEt,"fClusterIsoSumTrackEt/F");
1732  fClusterTreeList[iCut]->Add(tClusterEOverP[iCut]);
1733  }
1734  }
1735  if(fDoJetAnalysis){
1736 
1737  fJetHistograms[iCut] = new TList();
1738  fJetHistograms[iCut]->SetOwner(kTRUE);
1739  fJetHistograms[iCut]->SetName(Form("%s_%s_%s Jet histograms", cutstringEvent.Data(), cutstringCalo.Data(), cutstringMeson.Data()));
1740 
1741  fHistoPtJet[iCut] = new TH1F("JetPt", "JetPt", 150, 0, 150);
1742  fJetHistograms[iCut]->Add(fHistoPtJet[iCut]);
1743  fHistoJetEta[iCut] = new TH1F("JetEta", "JetEta", 100, -1, 1);
1744  fJetHistograms[iCut]->Add(fHistoJetEta[iCut]);
1745  fHistoJetPhi[iCut] = new TH1F("JetPhi", "JetPhi", 70, 0, 7);
1746  fJetHistograms[iCut]->Add(fHistoJetPhi[iCut]);
1747  fHistoJetArea[iCut] = new TH1F("JetArea", "JetArea", 50, 0, 1);
1748  fJetHistograms[iCut]->Add(fHistoJetArea[iCut]);
1749  fHistoNJets[iCut] = new TH1F("NJets", "NJets", 10, 0, 10);
1750  fJetHistograms[iCut]->Add(fHistoNJets[iCut]);
1751  fHistoEventwJets[iCut] = new TH1F("NEvents_with_Jets", "NEvents_with_Jets", 5, 0, 5);
1752  fJetHistograms[iCut]->Add(fHistoEventwJets[iCut]);
1753  fHistoJetPi0PtRatio[iCut] = new TH1F("Ratio_Pt_Pi0_Jet", "Ratio_Pt_Pi0_Jet", 20, 0, 1.5);
1754  fJetHistograms[iCut]->Add(fHistoJetPi0PtRatio[iCut]);
1755 
1756  fHistoJetMotherInvMassPt[iCut] = new TH2F("ESD_Pi0Jet_Mother_InvMass_Pt", "ESD_Pi0Jet_Mother_InvMass_Pt", 800, 0, 0.8, nBinsPt, arrPtBinning);
1757  fJetHistograms[iCut]->Add(fHistoJetMotherInvMassPt[iCut]);
1758  fHistoEtaPhiJetPi0Cand[iCut] = new TH2F("Eta_Phi_Distr_Pi0Jet", "Eta_Phi_Distr_Pi0Jet", 20, 0, M_PI, 20, -1, 1);
1759  fJetHistograms[iCut]->Add(fHistoEtaPhiJetPi0Cand[iCut]);
1760  fHistoRJetPi0Cand[iCut] = new TH2F("ESD_RPi0Jet_Pt", "ESD_RPi0Jet_Pt", 35, 0, 3.5, nBinsPt, arrPtBinning);
1761  fJetHistograms[iCut]->Add(fHistoRJetPi0Cand[iCut]);
1762  fHistoPi0InJetMotherInvMassPt[iCut] = new TH2F("ESD_Pi0inJet_Mother_InvMass_Pt", "ESD_Pi0inJet_Mother_InvMass_Pt", 800, 0, 0.8, nBinsPt, arrPtBinning);
1764  fHistoMotherBackJetInvMassPt[iCut] = new TH2F("ESD_Jet_Background_InvMass_Pt", "ESD_Jet_Background_InvMass_Pt", 800, 0, 0.8, nBinsPt, arrPtBinning);
1765  fJetHistograms[iCut]->Add(fHistoMotherBackJetInvMassPt[iCut]);
1766  fHistoEtaPhiJetWithPi0Cand[iCut] = new TH2F("Eta_Phi_Distr_Pi0inJet", "Eta_Phi_Distr_Pi0inJet", 15, 0, 0.4, 15, -0.4, 0.4);
1767  fJetHistograms[iCut]->Add(fHistoEtaPhiJetWithPi0Cand[iCut]);
1768  fHistoDoubleCounting[iCut] = new TH1F("Double_Counting_Mesons_Jets", "Double_Counting_Mesons_Jets", 6, 0, 6);
1769  fJetHistograms[iCut]->Add(fHistoDoubleCounting[iCut]);
1770  fHistoJetFragmFunc[iCut] = new TH2F("ESD_Pi0inJet_FragmentationFunc", "ESD_Pi0inJet_FragmentationFunc", 50, arrLogBinning, 150, 0., 150.);
1771  fJetHistograms[iCut]->Add(fHistoJetFragmFunc[iCut]);
1772  }
1773 
1774  if( ((AliConversionMesonCuts*)fMesonCutArray->At(iCut))->DoSectorMixing() ){
1775  fV0Reader->SetCalcSector(kTRUE);
1776  }
1777  }
1778  if(fDoMesonAnalysis){
1779  InitBack(); // Init Background Handler
1780  }
1781 
1782  if(fIsMC> 0){
1783  // MC Histogramms
1784  fMCList = new TList*[fnCuts];
1785  // True Histogramms
1786  fTrueList = new TList*[fnCuts];
1787  // Selected Header List
1788  if (fDoMesonQA ==3){
1789  fTreeList = new TList*[fnCuts];
1791  }
1792 
1793  if(fDoJetAnalysis) {
1808  fHistoMCPi0JetInAccPt = new TH1F*[fnCuts];
1809  fHistoMCPi0inJetInAccPt = new TH1F*[fnCuts];
1810  fHistoMCEtaJetInAccPt = new TH1F*[fnCuts];
1811  fHistoMCEtainJetInAccPt = new TH1F*[fnCuts];
1820  if(fDoJetQA){
1822  }
1823  }
1824 
1825  if(!fDoLightOutput){
1826  fHistoMCHeaders = new TH1I*[fnCuts];
1827  fHistoMCAllGammaPt = new TH1F*[fnCuts];
1829  fHistoMCDecayGammaPi0Pt = new TH1F*[fnCuts];
1830  fHistoMCDecayGammaRhoPt = new TH1F*[fnCuts];
1831  fHistoMCDecayGammaEtaPt = new TH1F*[fnCuts];
1832  fHistoMCDecayGammaOmegaPt = new TH1F*[fnCuts];
1833  fHistoMCDecayGammaEtapPt = new TH1F*[fnCuts];
1834  fHistoMCDecayGammaPhiPt = new TH1F*[fnCuts];
1835  fHistoMCDecayGammaSigmaPt = new TH1F*[fnCuts];
1838  if (fDoClusterQA > 1) {
1851  }
1852  }
1853 
1854  fHistoTrueClusGammaPt = new TH1F*[fnCuts];
1855  if(!fDoLightOutput){
1857  fHistoTruePrimaryClusGammaPt = new TH1F*[fnCuts];
1871  fHistoTrueNLabelsInClus = new TH1F*[fnCuts];
1872  }
1875 
1876 // fHistoTruePi0NonLinearity = new TH2F*[fnCuts];
1877 // fHistoTrueEtaNonLinearity = new TH2F*[fnCuts];
1878 
1879  if (fDoClusterQA > 0){
1880  fHistoTrueClusUnConvGammaPt = new TH1F*[fnCuts];
1882  if (!fDoLightOutput)
1884  fHistoTrueClusElectronPt = new TH1F*[fnCuts];
1885  fHistoTrueClusConvGammaPt = new TH1F*[fnCuts];
1886  fHistoTrueClusConvGammaMCPt = new TH1F*[fnCuts];
1888  fHistoTrueClusMergedGammaPt = new TH1F*[fnCuts];
1890  fHistoTrueClusDalitzPt = new TH1F*[fnCuts];
1891  fHistoTrueClusDalitzMergedPt = new TH1F*[fnCuts];
1893  fHistoTrueClusShowerPt = new TH1F*[fnCuts];
1894  fHistoTrueClusSubLeadingPt = new TH1F*[fnCuts];
1895  fHistoTrueClusNParticles = new TH1F*[fnCuts];
1896  fHistoTrueClusEMNonLeadingPt = new TH1F*[fnCuts];
1897  }
1898 
1899  if(fDoMesonAnalysis){
1900  fHistoMCPi0Pt = new TH1F*[fnCuts];
1901  fHistoMCPi0WOWeightPt = new TH1F*[fnCuts];
1902  fHistoMCEtaPt = new TH1F*[fnCuts];
1903  fHistoMCEtaWOWeightPt = new TH1F*[fnCuts];
1904  fHistoMCPi0InAccPt = new TH1F*[fnCuts];
1905  fHistoMCEtaInAccPt = new TH1F*[fnCuts];
1906  if (fIsMC > 1){
1907  fHistoMCPi0WOEvtWeightPt = new TH1F*[fnCuts];
1908  fHistoMCEtaWOEvtWeightPt = new TH1F*[fnCuts];
1911  }
1912 
1929  if(!fDoLightOutput){
1932  }
1936  fHistoMCSecPi0Source = new TH1F*[fnCuts];
1937  fHistoMCSecEtaPt = new TH1F*[fnCuts];
1938  fHistoMCSecEtaSource = new TH1F*[fnCuts];
1939 
1940  if (fDoMesonQA > 0 && fDoMesonQA < 3 ){
1941  fHistoMCPi0PtY = new TH2F*[fnCuts];
1942  fHistoMCEtaPtY = new TH2F*[fnCuts];
1943  fHistoMCPi0PtAlpha = new TH2F*[fnCuts];
1944  fHistoMCEtaPtAlpha = new TH2F*[fnCuts];
1945  if (fIsMC == 2){
1946  fHistoMCPi0PtJetPt = new TH2F*[fnCuts];
1947  fHistoMCEtaPtJetPt = new TH2F*[fnCuts];
1948  }
1949 
1950  if (fIsMC < 2){
1971  }
1972  fHistoTruePi0PtY = new TH2F*[fnCuts];
1973  fHistoTrueEtaPtY = new TH2F*[fnCuts];
1982  }
1983  if (fDoMesonQA==2){
1998  }
1999  }
2000 
2001 
2002 
2003  for(Int_t iCut = 0; iCut<fnCuts;iCut++){
2004  TString cutstringEvent = ((AliConvEventCuts*)fEventCutArray->At(iCut))->GetCutNumber();
2005  TString cutstringCalo = ((AliCaloPhotonCuts*)fClusterCutArray->At(iCut))->GetCutNumber();
2006  TString cutstringMeson = "NoMesonCut";
2007  if(fDoMesonAnalysis)
2008  cutstringMeson = ((AliConversionMesonCuts*)fMesonCutArray->At(iCut))->GetCutNumber();
2009 
2010  fMCList[iCut] = new TList();
2011  fMCList[iCut]->SetName(Form("%s_%s_%s MC histograms", cutstringEvent.Data(), cutstringCalo.Data(), cutstringMeson.Data()));
2012  fMCList[iCut]->SetOwner(kTRUE);
2013  fCutFolder[iCut]->Add(fMCList[iCut]);
2014 
2015  if(!fDoLightOutput){
2016  fHistoMCHeaders[iCut] = new TH1I("MC_Headers", "MC_Headers", 20, 0, 20);
2017  fHistoMCHeaders[iCut]->SetXTitle("accepted headers");
2018  fMCList[iCut]->Add(fHistoMCHeaders[iCut]);
2019  fHistoMCAllGammaPt[iCut] = new TH1F("MC_AllGamma_Pt", "MC_AllGamma_Pt", nBinsClusterPt, arrClusPtBinning);
2020  fHistoMCAllGammaPt[iCut]->SetXTitle("p_{T} (GeV/c)");
2021  fMCList[iCut]->Add(fHistoMCAllGammaPt[iCut]);
2022  fHistoMCAllSecondaryGammaPt[iCut] = new TH2F("MC_AllSecondaryGamma_Pt", "MC_AllSecondaryGamma_Pt", nBinsClusterPt, arrClusPtBinning, 5, -0.5, 4.5);
2023  fHistoMCAllSecondaryGammaPt[iCut]->GetYaxis()->SetBinLabel(1,"K0s");
2024  fHistoMCAllSecondaryGammaPt[iCut]->GetYaxis()->SetBinLabel(2,"K0l");
2025  fHistoMCAllSecondaryGammaPt[iCut]->GetYaxis()->SetBinLabel(3,"Lambda");
2026  fHistoMCAllSecondaryGammaPt[iCut]->GetYaxis()->SetBinLabel(4,"Eta");
2027  fHistoMCAllSecondaryGammaPt[iCut]->GetYaxis()->SetBinLabel(5,"rest");
2028  fHistoMCAllSecondaryGammaPt[iCut]->SetXTitle("p_{T} (GeV/c)");
2029  fHistoMCAllSecondaryGammaPt[iCut]->SetYTitle("sec. particle");
2030  fMCList[iCut]->Add(fHistoMCAllSecondaryGammaPt[iCut]);
2031  fHistoMCDecayGammaPi0Pt[iCut] = new TH1F("MC_DecayGammaPi0_Pt", "MC_DecayGammaPi0_Pt", nBinsClusterPt, arrClusPtBinning);
2032  fHistoMCDecayGammaPi0Pt[iCut]->SetXTitle("p_{T} (GeV/c)");
2033  fMCList[iCut]->Add(fHistoMCDecayGammaPi0Pt[iCut]);
2034  fHistoMCDecayGammaRhoPt[iCut] = new TH1F("MC_DecayGammaRho_Pt", "MC_DecayGammaRho_Pt", nBinsClusterPt, arrClusPtBinning);
2035  fHistoMCDecayGammaRhoPt[iCut]->SetXTitle("p_{T} (GeV/c)");
2036  fMCList[iCut]->Add(fHistoMCDecayGammaRhoPt[iCut]);
2037  fHistoMCDecayGammaEtaPt[iCut] = new TH1F("MC_DecayGammaEta_Pt", "MC_DecayGammaEta_Pt", nBinsClusterPt, arrClusPtBinning);
2038  fHistoMCDecayGammaEtaPt[iCut]->SetXTitle("p_{T} (GeV/c)");
2039  fMCList[iCut]->Add(fHistoMCDecayGammaEtaPt[iCut]);
2040  fHistoMCDecayGammaOmegaPt[iCut] = new TH1F("MC_DecayGammaOmega_Pt", "MC_DecayGammaOmmega_Pt", nBinsClusterPt, arrClusPtBinning);
2041  fHistoMCDecayGammaOmegaPt[iCut]->SetXTitle("p_{T} (GeV/c)");
2042  fMCList[iCut]->Add(fHistoMCDecayGammaOmegaPt[iCut]);
2043  fHistoMCDecayGammaEtapPt[iCut] = new TH1F("MC_DecayGammaEtap_Pt", "MC_DecayGammaEtap_Pt", nBinsClusterPt, arrClusPtBinning);
2044  fHistoMCDecayGammaEtapPt[iCut]->SetXTitle("p_{T} (GeV/c)");
2045  fMCList[iCut]->Add(fHistoMCDecayGammaEtapPt[iCut]);
2046  fHistoMCDecayGammaPhiPt[iCut] = new TH1F("MC_DecayGammaPhi_Pt", "MC_DecayGammaPhi_Pt", nBinsClusterPt, arrClusPtBinning);
2047  fHistoMCDecayGammaPhiPt[iCut]->SetXTitle("p_{T} (GeV/c)");
2048  fMCList[iCut]->Add(fHistoMCDecayGammaPhiPt[iCut]);
2049  fHistoMCDecayGammaSigmaPt[iCut] = new TH1F("MC_DecayGammaSigma_Pt", "MC_DecayGammaSigma_Pt", nBinsClusterPt, arrClusPtBinning);
2050  fHistoMCDecayGammaSigmaPt[iCut]->SetXTitle("p_{T} (GeV/c)");
2051  fMCList[iCut]->Add(fHistoMCDecayGammaSigmaPt[iCut]);
2052 
2053  if (fIsMC > 1){
2054  fHistoMCAllGammaPt[iCut]->Sumw2();
2055  fHistoMCAllSecondaryGammaPt[iCut]->Sumw2();
2056  fHistoMCDecayGammaPi0Pt[iCut]->Sumw2();
2057  fHistoMCDecayGammaRhoPt[iCut]->Sumw2();
2058  fHistoMCDecayGammaEtaPt[iCut]->Sumw2();
2059  fHistoMCDecayGammaOmegaPt[iCut]->Sumw2();
2060  fHistoMCDecayGammaEtapPt[iCut]->Sumw2();
2061  fHistoMCDecayGammaPhiPt[iCut]->Sumw2();
2062  fHistoMCDecayGammaSigmaPt[iCut]->Sumw2();
2063  }
2064  }
2065 
2066  if(fDoMesonAnalysis){
2067  fHistoMCPi0Pt[iCut] = new TH1F("MC_Pi0_Pt", "MC_Pi0_Pt", (Int_t)((maxPt-minPt)/binWidthPt), minPt, maxPt);
2068  fHistoMCPi0Pt[iCut]->SetXTitle("p_{T} (GeV/c)");
2069  fHistoMCPi0Pt[iCut]->Sumw2();
2070  fMCList[iCut]->Add(fHistoMCPi0Pt[iCut]);
2071  fHistoMCPi0WOWeightPt[iCut] = new TH1F("MC_Pi0_WOWeights_Pt", "MC_Pi0_WOWeights_Pt", (Int_t)((maxPt-minPt)/binWidthPt), minPt, maxPt);
2072  fHistoMCPi0WOWeightPt[iCut]->Sumw2();
2073  fHistoMCPi0WOWeightPt[iCut]->SetXTitle("p_{T} (GeV/c)");
2074  fMCList[iCut]->Add(fHistoMCPi0WOWeightPt[iCut]);
2075 
2076  fHistoMCEtaPt[iCut] = new TH1F("MC_Eta_Pt", "MC_Eta_Pt", (Int_t)((maxPt-minPt)/binWidthPt), minPt, maxPt);
2077  fHistoMCEtaPt[iCut]->SetXTitle("p_{T} (GeV/c)");
2078  fHistoMCEtaPt[iCut]->Sumw2();
2079  fMCList[iCut]->Add(fHistoMCEtaPt[iCut]);
2080  fHistoMCEtaWOWeightPt[iCut] = new TH1F("MC_Eta_WOWeights_Pt", "MC_Eta_WOWeights_Pt", (Int_t)((maxPt-minPt)/binWidthPt), minPt, maxPt);
2081  fHistoMCEtaWOWeightPt[iCut]->SetXTitle("p_{T} (GeV/c)");
2082  fHistoMCEtaWOWeightPt[iCut]->Sumw2();
2083  fMCList[iCut]->Add(fHistoMCEtaWOWeightPt[iCut]);
2084  fHistoMCPi0InAccPt[iCut] = new TH1F("MC_Pi0InAcc_Pt", "MC_Pi0InAcc_Pt", (Int_t)((maxPt-minPt)/binWidthPt), minPt, maxPt);
2085  fHistoMCPi0InAccPt[iCut]->SetXTitle("p_{T} (GeV/c)");
2086  fHistoMCPi0InAccPt[iCut]->Sumw2();
2087  fMCList[iCut]->Add(fHistoMCPi0InAccPt[iCut]);
2088  fHistoMCEtaInAccPt[iCut] = new TH1F("MC_EtaInAcc_Pt", "MC_EtaInAcc_Pt", (Int_t)((maxPt-minPt)/binWidthPt), minPt, maxPt);
2089  fHistoMCEtaInAccPt[iCut]->SetXTitle("p_{T} (GeV/c)");
2090  fHistoMCEtaInAccPt[iCut]->Sumw2();
2091  fMCList[iCut]->Add(fHistoMCEtaInAccPt[iCut]);
2092  if (fIsMC > 1){
2093  fHistoMCPi0WOWeightPt[iCut]->Sumw2();
2094  fHistoMCEtaWOWeightPt[iCut]->Sumw2();
2095  fHistoMCPi0WOEvtWeightPt[iCut] = new TH1F("MC_Pi0_WOEventWeights_Pt", "MC_Pi0_WOEventWeights_Pt", (Int_t)((maxPt-minPt)/binWidthPt), minPt, maxPt);
2096  fHistoMCPi0WOEvtWeightPt[iCut]->SetXTitle("p_{T} (GeV/c)");
2097  fMCList[iCut]->Add(fHistoMCPi0WOEvtWeightPt[iCut]);
2098  fHistoMCEtaWOEvtWeightPt[iCut] = new TH1F("MC_Eta_WOEventWeights_Pt", "MC_Eta_WOEventWeights_Pt", (Int_t)((maxPt-minPt)/binWidthPt), minPt, maxPt);
2099  fHistoMCEtaWOEvtWeightPt[iCut]->SetXTitle("p_{T} (GeV/c)");
2100  fMCList[iCut]->Add(fHistoMCEtaWOEvtWeightPt[iCut]);
2101  fHistoMCPi0WOEvtWeightInAccPt[iCut] = new TH1F("MC_Pi0WOEvtWeightInAcc_Pt", "MC_Pi0WOEvtWeightInAcc_Pt", (Int_t)((maxPt-minPt)/binWidthPt), minPt, maxPt);
2102  fHistoMCPi0WOEvtWeightInAccPt[iCut]->SetXTitle("p_{T} (GeV/c)");
2103  fMCList[iCut]->Add(fHistoMCPi0WOEvtWeightInAccPt[iCut]);
2104  fHistoMCEtaWOEvtWeightInAccPt[iCut] = new TH1F("MC_EtaWOEvtWeightInAcc_Pt", "MC_EtaWOEvtWeightInAcc_Pt", (Int_t)((maxPt-minPt)/binWidthPt), minPt, maxPt);
2105  fHistoMCEtaWOEvtWeightInAccPt[iCut]->SetXTitle("p_{T} (GeV/c)");
2106  fMCList[iCut]->Add(fHistoMCEtaWOEvtWeightInAccPt[iCut]);
2107  if (fDoMesonQA > 0 && fDoMesonQA < 3 && fIsMC == 2){
2108  fHistoMCPi0PtJetPt[iCut] = new TH2F("MC_Pi0_Pt_JetPt", "MC_Pi0_Pt_JetPt", nBinsQAPt, arrQAPtBinning, 200, 0, 200);
2109  fHistoMCPi0PtJetPt[iCut]->SetXTitle("p_{T} (GeV/c)");
2110  fHistoMCPi0PtJetPt[iCut]->SetYTitle("p_{jet, T} (GeV/c)");
2111  fHistoMCPi0PtJetPt[iCut]->Sumw2();
2112  fMCList[iCut]->Add(fHistoMCPi0PtJetPt[iCut]);
2113  fHistoMCEtaPtJetPt[iCut] = new TH2F("MC_Eta_Pt_JetPt", "MC_Eta_Pt_JetPt", nBinsQAPt, arrQAPtBinning, 200, 0, 200);
2114  fHistoMCEtaPtJetPt[iCut]->SetXTitle("p_{T} (GeV/c)");
2115  fHistoMCEtaPtJetPt[iCut]->SetYTitle("p_{jet, T} (GeV/c)");
2116  fHistoMCEtaPtJetPt[iCut]->Sumw2();
2117  fMCList[iCut]->Add(fHistoMCEtaPtJetPt[iCut]);
2118  }
2119  }
2120 
2121  fHistoMCPrimaryPtvsSource[iCut] = new TH2F("MC_Primary_Pt_Source", "MC_Primary_Pt_Source", (Int_t)((maxPt-minPt)/binWidthPt), minPt, maxPt, 7, -0.5, 6.5);
2122  fHistoMCPrimaryPtvsSource[iCut]->GetYaxis()->SetBinLabel(1,"Pi+");
2123  fHistoMCPrimaryPtvsSource[iCut]->GetYaxis()->SetBinLabel(2,"Pi-");
2124  fHistoMCPrimaryPtvsSource[iCut]->GetYaxis()->SetBinLabel(3,"K+");
2125  fHistoMCPrimaryPtvsSource[iCut]->GetYaxis()->SetBinLabel(4,"K-");
2126  fHistoMCPrimaryPtvsSource[iCut]->GetYaxis()->SetBinLabel(5,"K0s");
2127  fHistoMCPrimaryPtvsSource[iCut]->GetYaxis()->SetBinLabel(6,"K0l");
2128  fHistoMCPrimaryPtvsSource[iCut]->GetYaxis()->SetBinLabel(7,"Lambda");
2129  fHistoMCPrimaryPtvsSource[iCut]->SetXTitle("p_{T} (GeV/c)");
2130  fHistoMCPrimaryPtvsSource[iCut]->SetYTitle("particle");
2131  fMCList[iCut]->Add(fHistoMCPrimaryPtvsSource[iCut]);
2132 
2133  fHistoMCSecPi0Source[iCut] = new TH1F("MC_SecPi0_Source", "MC_SecPi0_Source", 5000, 0., 5000);
2134  fHistoMCSecPi0Source[iCut]->SetYTitle("source PDG");
2135  fMCList[iCut]->Add(fHistoMCSecPi0Source[iCut]);
2136  fHistoMCSecEtaSource[iCut] = new TH1F("MC_SecEta_Source", "MC_SecEta_Source", 5000, 0, 5000);
2137  fHistoMCSecEtaSource[iCut]->SetYTitle("source PDG");
2138  fMCList[iCut]->Add(fHistoMCSecEtaSource[iCut]);
2139  fHistoMCSecPi0PtvsSource[iCut] = new TH2F("MC_SecPi0_Pt_Source", "MC_SecPi0_Pt_Source", (Int_t)((maxPt-minPt)/binWidthPt), minPt, maxPt, 16, -0.5, 15.5);
2140  fHistoMCSecPi0PtvsSource[iCut]->SetXTitle("p_{T} (GeV/c)");
2141  fHistoMCSecPi0PtvsSource[iCut]->SetYTitle("source");
2142  fMCList[iCut]->Add(fHistoMCSecPi0PtvsSource[iCut]);
2143  fHistoMCSecPi0InAccPtvsSource[iCut] = new TH2F("MC_SecPi0InAcc_Pt_Source", "MC_SecPi0InAcc_Pt_Source", (Int_t)((maxPt-minPt)/binWidthPt), minPt, maxPt, 16, -0.5, 15.5);
2144  fHistoMCSecPi0InAccPtvsSource[iCut]->SetXTitle("p_{T} (GeV/c)");
2145  fHistoMCSecPi0InAccPtvsSource[iCut]->SetYTitle("source");
2146  fMCList[iCut]->Add(fHistoMCSecPi0InAccPtvsSource[iCut]);
2147  fHistoMCSecEtaPt[iCut] = new TH1F("MC_SecEta_Pt", "MC_SecEta_Pt", (Int_t)((maxPt-minPt)/binWidthPt), minPt, maxPt);
2148  fHistoMCSecEtaPt[iCut]->SetXTitle("p_{T} (GeV/c)");
2149  fMCList[iCut]->Add(fHistoMCSecEtaPt[iCut]);
2150  if (fIsMC == 2) {
2151  fHistoMCPrimaryPtvsSource[iCut]->Sumw2();
2152  fHistoMCSecPi0PtvsSource[iCut]->Sumw2();
2153  fHistoMCSecPi0InAccPtvsSource[iCut]->Sumw2();
2154  fHistoMCSecEtaPt[iCut]->Sumw2();
2155  }
2156 
2157 
2158  if (fDoMesonQA > 0 && fDoMesonQA < 3){
2159  fHistoMCPi0PtY[iCut] = new TH2F("MC_Pi0_Pt_Y", "MC_Pi0_Pt_Y", nBinsQAPt, arrQAPtBinning, 150, -1.5, 1.5);
2160  fHistoMCPi0PtY[iCut]->SetXTitle("p_{T} (GeV/c)");
2161  fHistoMCPi0PtY[iCut]->SetYTitle("y");
2162  fHistoMCPi0PtY[iCut]->Sumw2();
2163  fMCList[iCut]->Add(fHistoMCPi0PtY[iCut]);
2164  fHistoMCEtaPtY[iCut] = new TH2F("MC_Eta_Pt_Y", "MC_Eta_Pt_Y", nBinsQAPt, arrQAPtBinning, 150, -1.5, 1.5);
2165  fHistoMCEtaPtY[iCut]->SetXTitle("p_{T} (GeV/c)");
2166  fHistoMCEtaPtY[iCut]->SetYTitle("y");
2167  fHistoMCEtaPtY[iCut]->Sumw2();
2168  fMCList[iCut]->Add(fHistoMCEtaPtY[iCut]);
2169  fHistoMCPi0PtAlpha[iCut] = new TH2F("MC_Pi0_Pt_Alpha", "MC_Pi0_Pt_Alpha", nBinsQAPt, arrQAPtBinning, 100, 0, 1);
2170  fHistoMCPi0PtAlpha[iCut]->SetXTitle("p_{T} (GeV/c)");
2171  fHistoMCPi0PtAlpha[iCut]->SetYTitle("#alpha");
2172  fMCList[iCut]->Add(fHistoMCPi0PtAlpha[iCut]);
2173  fHistoMCEtaPtAlpha[iCut] = new TH2F("MC_Eta_Pt_Alpha", "MC_Eta_Pt_Alpha", nBinsQAPt, arrQAPtBinning, 100, 0, 1);
2174  fHistoMCEtaPtAlpha[iCut]->SetXTitle("p_{T} (GeV/c)");
2175  fHistoMCEtaPtAlpha[iCut]->SetYTitle("#alpha");
2176  fMCList[iCut]->Add(fHistoMCEtaPtAlpha[iCut]);
2177 
2178  if (fIsMC == 2) {
2179  fHistoMCPi0PtAlpha[iCut]->Sumw2();
2180  fHistoMCEtaPtAlpha[iCut]->Sumw2();
2181  }
2182  }
2183  }
2184  fTrueList[iCut] = new TList();
2185  fTrueList[iCut]->SetName(Form("%s_%s_%s True histograms", cutstringEvent.Data(), cutstringCalo.Data(), cutstringMeson.Data()));
2186  fTrueList[iCut]->SetOwner(kTRUE);
2187  fCutFolder[iCut]->Add(fTrueList[iCut]);
2188 
2189  if(fDoJetAnalysis){
2190  fTrueJetHistograms[iCut] = new TList();
2191  fTrueJetHistograms[iCut]->SetName(Form("%s_%s_%s True Jet histograms", cutstringEvent.Data(), cutstringCalo.Data(), cutstringMeson.Data()));
2192  fTrueJetHistograms[iCut]->SetOwner(kTRUE);
2193  fCutFolder[iCut]->Add(fTrueJetHistograms[iCut]);
2194 
2195  fHistoTruevsRecJetPt[iCut] = new TH2F("True_JetPt_vs_Rec_JetPt", "True_JetPt_vs_Rec_JetPt", 150, 0, 150, 150, 0, 150);
2196  fTrueJetHistograms[iCut]->Add(fHistoTruevsRecJetPt[iCut]);
2197  fHistoTruePi0JetMotherInvMassPt[iCut] = new TH2F("ESD_TruePi0_Jet_InvMass_Pt", "ESD_TruePi0_Jet_InvMass_Pt", 800, 0, 0.8, nBinsPt, arrPtBinning);
2199  fHistoTruePrimaryPi0JetInvMassPt[iCut] = new TH2F("ESD_TruePrimaryPi0Jet_InvMass_Pt", "ESD_TruePrimaryPi0Jet_InvMass_Pt", 800, 0, 0.8, nBinsPt, arrPtBinning);
2201  fHistoTrueEtaJetMotherInvMassPt[iCut] = new TH2F("ESD_TrueEta_Jet_InvMass_Pt", "ESD_TruePi0_Jet_InvMass_Pt", 800, 0, 0.8, nBinsPt, arrPtBinning);
2203  fHistoTruePrimaryEtaJetInvMassPt[iCut] = new TH2F("ESD_TruePrimaryEtaJet_InvMass_Pt", "ESD_TruePrimaryEtaJet_InvMass_Pt", 800, 0, 0.8, nBinsPt, arrPtBinning);
2205  fHistoTruePi0InJetMotherInvMassPt[iCut] = new TH2F("ESD_TruePi0_Pi0inJet_InvMass_Pt", "ESD_TruePi0_Pi0inJet_InvMass_Pt", 800, 0, 0.8, nBinsPt, arrPtBinning);
2207  fHistoTruePrimaryPi0inJetInvMassPt[iCut] = new TH2F("ESD_TruePrimaryPi0inJet_InvMass_Pt", "ESD_TruePrimaryPi0inJet_InvMass_Pt", 800, 0, 0.8, nBinsPt, arrPtBinning);
2209  fHistoTrueDoubleCountingPi0Jet[iCut] = new TH1F("Double_Counting_True_Pi0inJet", "Double_Counting_True_Pi0inJet", 6, 0, 6);
2211  fHistoTrueEtaInJetMotherInvMassPt[iCut] = new TH2F("ESD_TrueEta_EtainJet_InvMass_Pt", "ESD_TruePi0_Pi0inJet_InvMass_Pt", 800, 0, 0.8, nBinsPt, arrPtBinning);
2213  fHistoTruePrimaryEtainJetInvMassPt[iCut] = new TH2F("ESD_TruePrimaryEtainJet_InvMass_Pt", "ESD_TruePrimaryEtainJet_InvMass_Pt", 800, 0, 0.8, nBinsPt, arrPtBinning);
2215  fHistoTrueDoubleCountingEtaJet[iCut] = new TH1F("Double_Counting_True_EtainJet", "Double_Counting_True_EtainJet", 6, 0, 6);
2217  fHistoTruePi0JetFragmFunc[iCut] = new TH2F("ESD_TruePi0inJet_FragmentationFunc", "ESD_TruePi0inJet_FragmentationFunc", 50, arrLogBinning, 150, 0., 150.);
2219  fHistoTrueEtaJetFragmFunc[iCut] = new TH2F("ESD_TrueEtainJet_FragmentationFunc", "ESD_TrueEtainJet_FragmentationFunc", 50, arrLogBinning, 150, 0., 150.);
2221  fHistoMCPi0JetInAccPt[iCut] = new TH1F("MC_Pi0JetInAcc_Pt", "MC_Pi0JetInAcc_Pt", (Int_t)((maxPt-minPt)/binWidthPt), minPt, maxPt);
2222  fTrueJetHistograms[iCut]->Add(fHistoMCPi0JetInAccPt[iCut]);
2223  fHistoMCPi0inJetInAccPt[iCut] = new TH1F("MC_Pi0inJetInAcc_Pt", "MC_Pi0inJetInAcc_Pt", (Int_t)((maxPt-minPt)/binWidthPt), minPt, maxPt);
2224  fTrueJetHistograms[iCut]->Add(fHistoMCPi0inJetInAccPt[iCut]);
2225  fHistoMCEtaJetInAccPt[iCut] = new TH1F("MC_EtaJetInAcc_Pt", "MC_EtaJetInAcc_Pt", (Int_t)((maxPt-minPt)/binWidthPt), minPt, maxPt);
2226  fTrueJetHistograms[iCut]->Add(fHistoMCEtaJetInAccPt[iCut]);
2227  fHistoMCEtainJetInAccPt[iCut] = new TH1F("MC_EtainJetInAcc_Pt", "MC_EtainJetInAcc_Pt", (Int_t)((maxPt-minPt)/binWidthPt), minPt, maxPt);
2228  fTrueJetHistograms[iCut]->Add(fHistoMCEtainJetInAccPt[iCut]);
2229  fHistoTrueSecondaryPi0FromK0sJetInvMassPt[iCut] = new TH2F("ESD_TrueSecondaryPi0FromK0sJet_InvMass_Pt", "ESD_TrueSecondaryPi0FromK0sJet_InvMass_Pt", 800, 0, 0.8, nBinsPt, arrPtBinning);
2231  fHistoTrueSecondaryPi0FromK0sinJetInvMassPt[iCut] = new TH2F("ESD_TrueSecondaryPi0FromK0s_inJet_InvMass_Pt", "ESD_TrueSecondaryPi0FromK0s_inJet_InvMass_Pt", 800, 0, 0.8, nBinsPt, arrPtBinning);
2233  fHistoTrueSecondaryPi0FromLambdaJetInvMassPt[iCut] = new TH2F("ESD_TrueSecondaryPi0FromLambdaJet_InvMass_Pt", "ESD_TrueSecondaryPi0FromLambdaJet_InvMass_Pt", 800, 0, 0.8, nBinsPt, arrPtBinning);
2235  fHistoTrueSecondaryPi0FromLambdainJetInvMassPt[iCut] = new TH2F("ESD_TrueSecondaryPi0FromLambda_inJet_InvMass_Pt", "ESD_TrueSecondaryPi0FromLambda_inJet_InvMass_Pt", 800, 0, 0.8, nBinsPt, arrPtBinning);
2237  fHistoTrueSecondaryPi0FromK0lJetInvMassPt[iCut] = new TH2F("ESD_TrueSecondaryPi0FromK0lJet_InvMass_Pt", "ESD_TrueSecondaryPi0FromK0lJet_InvMass_Pt", 800, 0, 0.8, nBinsPt, arrPtBinning);
2239  fHistoTrueSecondaryPi0FromK0linJetInvMassPt[iCut] = new TH2F("ESD_TrueSecondaryPi0FromK0l_inJet_InvMass_Pt", "ESD_TrueSecondaryPi0FromK0l_inJet_InvMass_Pt", 800, 0, 0.8, nBinsPt, arrPtBinning);
2241  fHistoTrueSecondaryPi0InvJetMassPt[iCut] = new TH2F("ESD_TrueSecondaryPi0Jet_InvMass_Pt", "ESD_TrueSecondaryPi0Jet_InvMass_Pt", 800, 0, 0.8, nBinsPt, arrPtBinning);
2243  fHistoTrueSecondaryPi0InvinJetMassPt[iCut] = new TH2F("ESD_TrueSecondaryPi0_inJet_InvMass_Pt", "ESD_TrueSecondaryPi0_inJet_InvMass_Pt", 800, 0, 0.8, nBinsPt, arrPtBinning);
2245 
2246  if(fDoJetQA){
2247  tTreeJetPi0Correlations[iCut] = new TTree("Jet_Pi0_Correlations", "Jet_Pi0_Correlations");
2248  tTreeJetPi0Correlations[iCut]->Branch("JetPt",&fJetPt,"fJetPt/F");
2249  tTreeJetPi0Correlations[iCut]->Branch("TrueJetPt",&fTrueJetPt,"fTrueJetPt/F");
2250  tTreeJetPi0Correlations[iCut]->Branch("Pi0Pt",&fPi0Pt,"fPi0Pt/F");
2251  tTreeJetPi0Correlations[iCut]->Branch("Pi0InvMass",&fPi0InvMass,"fPi0InvMass/F");
2252  fTrueJetHistograms[iCut]->Add(tTreeJetPi0Correlations[iCut]);
2253  }
2254  }
2255 
2256  if(!fDoLightOutput){
2257  fHistoClusPhotonBGPt[iCut] = new TH2F("ESD_TrueClusPhotonBG_Pt", "ESD_TrueClusPhotonBG_Pt", nBinsClusterPt, arrClusPtBinning,10,-0.5,9.5);
2258  fHistoClusPhotonBGPt[iCut]->GetYaxis()->SetBinLabel( 1,"Elec");
2259  fHistoClusPhotonBGPt[iCut]->GetYaxis()->SetBinLabel( 2,"Pion");
2260  fHistoClusPhotonBGPt[iCut]->GetYaxis()->SetBinLabel( 3,"Proton");
2261  fHistoClusPhotonBGPt[iCut]->GetYaxis()->SetBinLabel( 4,"Kaon");
2262  fHistoClusPhotonBGPt[iCut]->GetYaxis()->SetBinLabel( 5,"Neutron");
2263  fHistoClusPhotonBGPt[iCut]->GetYaxis()->SetBinLabel( 6,"K0s");
2264  fHistoClusPhotonBGPt[iCut]->GetYaxis()->SetBinLabel( 7,"Lambda");
2265  fHistoClusPhotonBGPt[iCut]->GetYaxis()->SetBinLabel( 8,"Muon");
2266  fHistoClusPhotonBGPt[iCut]->GetYaxis()->SetBinLabel( 9,"K0l");
2267  fHistoClusPhotonBGPt[iCut]->GetYaxis()->SetBinLabel( 10,"Rest");
2268  fHistoClusPhotonBGPt[iCut]->SetXTitle("p_{T} (GeV/c)");
2269  fHistoClusPhotonBGPt[iCut]->SetYTitle("source");
2270  fTrueList[iCut]->Add(fHistoClusPhotonBGPt[iCut]);
2271  fHistoClusPhotonPlusConvBGPt[iCut] = new TH2F("ESD_TrueClusPhotonPlusConvBG_Pt", "ESD_TrueClusPhotonPlusConvBG_Pt", nBinsClusterPt, arrClusPtBinning,10,-0.5,9.5);
2272  fHistoClusPhotonPlusConvBGPt[iCut]->GetYaxis()->SetBinLabel( 1,"Elec");
2273  fHistoClusPhotonPlusConvBGPt[iCut]->GetYaxis()->SetBinLabel( 2,"Pion");
2274  fHistoClusPhotonPlusConvBGPt[iCut]->GetYaxis()->SetBinLabel( 3,"Proton");
2275  fHistoClusPhotonPlusConvBGPt[iCut]->GetYaxis()->SetBinLabel( 4,"Kaon");
2276  fHistoClusPhotonPlusConvBGPt[iCut]->GetYaxis()->SetBinLabel( 5,"Neutron");
2277  fHistoClusPhotonPlusConvBGPt[iCut]->GetYaxis()->SetBinLabel( 6,"K0s");
2278  fHistoClusPhotonPlusConvBGPt[iCut]->GetYaxis()->SetBinLabel( 7,"Lambda");
2279  fHistoClusPhotonPlusConvBGPt[iCut]->GetYaxis()->SetBinLabel( 8,"Muon");
2280  fHistoClusPhotonPlusConvBGPt[iCut]->GetYaxis()->SetBinLabel( 9,"K0l");
2281  fHistoClusPhotonPlusConvBGPt[iCut]->GetYaxis()->SetBinLabel(10,"Rest");
2282  fHistoClusPhotonPlusConvBGPt[iCut]->SetXTitle("p_{T} (GeV/c)");
2283  fHistoClusPhotonPlusConvBGPt[iCut]->SetYTitle("source");
2284  fTrueList[iCut]->Add(fHistoClusPhotonPlusConvBGPt[iCut]);
2285 
2286  if (fDoClusterQA > 1) {
2287  fHistoClustPhotonElectronBGPtM02[iCut] = new TH2F("ESD_TrueClusPhotonElectronBG_Pt_M02", "ESD_TrueClusPhotonElectronBG_Pt_M02", nBinsClusterPt, arrClusPtBinning, 100, 0, 1);
2288  fHistoClustPhotonElectronBGPtM02[iCut]->SetXTitle("p_{T} (GeV/c)");
2289  fHistoClustPhotonElectronBGPtM02[iCut]->SetYTitle("#sigma_{long}^{2}");
2290  fTrueList[iCut]->Add(fHistoClustPhotonElectronBGPtM02[iCut]);
2291  fHistoClustPhotonPionBGPtM02[iCut] = new TH2F("ESD_TrueClusPhotonPionBG_Pt_M02", "ESD_TrueClusPhotonPionBG_Pt_M02", nBinsClusterPt, arrClusPtBinning, 100, 0, 1);
2292  fHistoClustPhotonPionBGPtM02[iCut]->SetXTitle("p_{T} (GeV/c)");
2293  fHistoClustPhotonPionBGPtM02[iCut]->SetYTitle("#sigma_{long}^{2}");
2294  fTrueList[iCut]->Add(fHistoClustPhotonPionBGPtM02[iCut]);
2295  fHistoClustPhotonKaonBGPtM02[iCut] = new TH2F("ESD_TrueClusPhotonKaonBG_Pt_M02", "ESD_TrueClusPhotonKaonBG_Pt_M02", nBinsClusterPt, arrClusPtBinning, 100, 0, 1);
2296  fHistoClustPhotonKaonBGPtM02[iCut]->SetXTitle("p_{T} (GeV/c)");
2297  fHistoClustPhotonKaonBGPtM02[iCut]->SetYTitle("#sigma_{long}^{2}");
2298  fTrueList[iCut]->Add(fHistoClustPhotonKaonBGPtM02[iCut]);
2299  fHistoClustPhotonK0lBGPtM02[iCut] = new TH2F("ESD_TrueClusPhotonK0lBG_Pt_M02", "ESD_TrueClusPhotonK0lBG_Pt_M02", nBinsClusterPt, arrClusPtBinning, 100, 0, 1);
2300  fHistoClustPhotonK0lBGPtM02[iCut]->SetXTitle("p_{T} (GeV/c)");
2301  fHistoClustPhotonK0lBGPtM02[iCut]->SetYTitle("#sigma_{long}^{2}");
2302  fTrueList[iCut]->Add(fHistoClustPhotonK0lBGPtM02[iCut]);
2303  fHistoClustPhotonNeutronBGPtM02[iCut] = new TH2F("ESD_TrueClusPhotonNeutronBG_Pt_M02", "ESD_TrueClusPhotonNeutronBG_Pt_M02", nBinsClusterPt, arrClusPtBinning, 100, 0, 1);
2304  fHistoClustPhotonNeutronBGPtM02[iCut]->SetXTitle("p_{T} (GeV/c)");
2305  fHistoClustPhotonNeutronBGPtM02[iCut]->SetYTitle("#sigma_{long}^{2}");
2306  fTrueList[iCut]->Add(fHistoClustPhotonNeutronBGPtM02[iCut]);
2307  fHistoClustPhotonRestBGPtM02[iCut] = new TH2F("ESD_TrueClusPhotonRestBG_Pt_M02", "ESD_TrueClusPhotonRestBG_Pt_M02", nBinsClusterPt, arrClusPtBinning, 100, 0, 1);
2308  fHistoClustPhotonRestBGPtM02[iCut]->SetXTitle("p_{T} (GeV/c)");
2309  fHistoClustPhotonRestBGPtM02[iCut]->SetYTitle("#sigma_{long}^{2}");
2310  fTrueList[iCut]->Add(fHistoClustPhotonRestBGPtM02[iCut]);
2311  fHistoClustPhotonPlusConvElectronBGPtM02[iCut]= new TH2F("ESD_TrueClusPhotonPlusConvElectronBG_Pt_M02", "ESD_TrueClusPhotonPlusConvElectronBG_Pt_M02", nBinsClusterPt, arrClusPtBinning, 100, 0, 1);
2312  fHistoClustPhotonPlusConvElectronBGPtM02[iCut]->SetXTitle("p_{T} (GeV/c)");
2313  fHistoClustPhotonPlusConvElectronBGPtM02[iCut]->SetYTitle("#sigma_{long}^{2}");
2315  fHistoClustPhotonPlusConvPionBGPtM02[iCut] = new TH2F("ESD_TrueClusPhotonPlusConvPionBG_Pt_M02", "ESD_TrueClusPhotonPlusConvPionBG_Pt_M02", nBinsClusterPt, arrClusPtBinning, 100, 0, 1);
2316  fHistoClustPhotonPlusConvPionBGPtM02[iCut]->SetXTitle("p_{T} (GeV/c)");
2317  fHistoClustPhotonPlusConvPionBGPtM02[iCut]->SetYTitle("#sigma_{long}^{2}");
2319  fHistoClustPhotonPlusConvKaonBGPtM02[iCut] = new TH2F("ESD_TrueClusPhotonPlusConvKaonBG_Pt_M02", "ESD_TrueClusPhotonPlusConvKaonBG_Pt_M02", nBinsClusterPt, arrClusPtBinning, 100, 0, 1);
2320  fHistoClustPhotonPlusConvKaonBGPtM02[iCut]->SetXTitle("p_{T} (GeV/c)");
2321  fHistoClustPhotonPlusConvKaonBGPtM02[iCut]->SetYTitle("#sigma_{long}^{2}");
2323  fHistoClustPhotonPlusConvK0lBGPtM02[iCut] = new TH2F("ESD_TrueClusPhotonPlusConvK0lBG_Pt_M02", "ESD_TrueClusPhotonPlusConvK0lBG_Pt_M02", nBinsClusterPt, arrClusPtBinning, 100, 0, 1);
2324  fHistoClustPhotonPlusConvK0lBGPtM02[iCut]->SetXTitle("p_{T} (GeV/c)");
2325  fHistoClustPhotonPlusConvK0lBGPtM02[iCut]->SetYTitle("#sigma_{long}^{2}");
2327  fHistoClustPhotonPlusConvNeutronBGPtM02[iCut] = new TH2F("ESD_TrueClusPhotonPlusConvNeutronBG_Pt_M02", "ESD_TrueClusPhotonPlusConvNeutronBG_Pt_M02", nBinsClusterPt, arrClusPtBinning, 100, 0, 1);
2328  fHistoClustPhotonPlusConvNeutronBGPtM02[iCut]->SetXTitle("p_{T} (GeV/c)");
2329  fHistoClustPhotonPlusConvNeutronBGPtM02[iCut]->SetYTitle("#sigma_{long}^{2}");
2331  fHistoClustPhotonPlusConvRestBGPtM02[iCut] = new TH2F("ESD_TrueClusPhotonPlusConvRestBG_Pt_M02", "ESD_TrueClusPhotonPlusConvRestBG_Pt_M02", nBinsClusterPt, arrClusPtBinning, 100, 0, 1);
2332  fHistoClustPhotonPlusConvRestBGPtM02[iCut]->SetXTitle("p_{T} (GeV/c)");
2333  fHistoClustPhotonPlusConvRestBGPtM02[iCut]->SetYTitle("#sigma_{long}^{2}");
2335  }
2336  }
2337 
2338  fHistoTrueClusGammaPt[iCut] = new TH1F("TrueClusGamma_Pt", "ESD_TrueClusGamma_Pt", nBinsClusterPt, arrClusPtBinning);
2339  fHistoTrueClusGammaPt[iCut]->SetXTitle("p_{T} (GeV/c)");
2340  fTrueList[iCut]->Add(fHistoTrueClusGammaPt[iCut]);
2341  if(!fDoLightOutput){
2342  if (fDoClusterQA > 0) {
2343  fHistoTrueClusGammaPtM02[iCut] = new TH2F("TrueClusGamma_Pt_M02", "TrueClusGamma_Pt_M02", nBinsClusterPt, arrClusPtBinning, 100, 0, 1);
2344  fHistoTrueClusGammaPtM02[iCut]->SetXTitle("p_{T} (GeV/c)");
2345  fHistoTrueClusGammaPtM02[iCut]->SetYTitle("#sigma_{long}^{2}");
2346  fTrueList[iCut]->Add(fHistoTrueClusGammaPtM02[iCut]);
2347  }
2348  fHistoTruePrimaryClusGammaPt[iCut] = new TH1F("TruePrimaryClusGamma_Pt", "ESD_TruePrimaryClusGamma_Pt", nBinsClusterPt, arrClusPtBinning);
2349  fHistoTruePrimaryClusGammaPt[iCut]->SetXTitle("p_{T} (GeV/c)");
2350  fTrueList[iCut]->Add(fHistoTruePrimaryClusGammaPt[iCut]);
2351  fHistoTruePrimaryClusGammaESDPtMCPt[iCut] = new TH2F("TruePrimaryClusGamma_Pt_MCPt", "ESD_TruePrimaryClusGamma_MCPt", nBinsClusterPt, arrClusPtBinning, nBinsClusterPt, arrClusPtBinning);
2352  fHistoTruePrimaryClusGammaESDPtMCPt[iCut]->SetXTitle("p_{T} (GeV/c)");
2353  fHistoTruePrimaryClusGammaESDPtMCPt[iCut]->SetYTitle("p_{T, MC} (GeV/c)");
2355  fHistoTruePrimaryClusConvGammaPt[iCut] = new TH1F("TruePrimaryClusConvGamma_Pt", "ESD_TruePrimaryClusConvGamma_Pt", nBinsClusterPt, arrClusPtBinning);
2356  fHistoTruePrimaryClusConvGammaPt[iCut]->SetXTitle("p_{T} (GeV/c)");
2357  fTrueList[iCut]->Add(fHistoTruePrimaryClusConvGammaPt[iCut]);
2358  fHistoTruePrimaryClusConvGammaESDPtMCPt[iCut] = new TH2F("TruePrimaryClusConvGamma_Pt_MCPt", "ESD_TruePrimaryClusConvGamma_MCPt", nBinsClusterPt, arrClusPtBinning, nBinsClusterPt, arrClusPtBinning);
2359  fHistoTruePrimaryClusConvGammaESDPtMCPt[iCut]->SetXTitle("p_{T} (GeV/c)");
2360  fHistoTruePrimaryClusConvGammaESDPtMCPt[iCut]->SetYTitle("p_{T, MC} (GeV/c)");
2362  fHistoTrueSecondaryClusGammaPt[iCut] = new TH2F("ESD_TrueSecondaryClusGamma_Pt", "ESD_TrueSecondaryClusGamma_Pt", nBinsClusterPt, arrClusPtBinning, 5, -0.5, 4.5);
2363  fHistoTrueSecondaryClusGammaPt[iCut]->SetXTitle("p_{T} (GeV/c)");
2364  fHistoTrueSecondaryClusGammaPt[iCut]->SetYTitle("source");
2365  fHistoTrueSecondaryClusGammaPt[iCut]->GetYaxis()->SetBinLabel( 1,"K0s");
2366  fHistoTrueSecondaryClusGammaPt[iCut]->GetYaxis()->SetBinLabel( 2,"K0l");
2367  fHistoTrueSecondaryClusGammaPt[iCut]->GetYaxis()->SetBinLabel( 3,"Lambda");
2368  fHistoTrueSecondaryClusGammaPt[iCut]->GetYaxis()->SetBinLabel( 4,"Eta");
2369  fHistoTrueSecondaryClusGammaPt[iCut]->GetYaxis()->SetBinLabel( 5,"rest");
2370  fTrueList[iCut]->Add(fHistoTrueSecondaryClusGammaPt[iCut]);
2371  fHistoTrueSecondaryClusConvGammaPt[iCut] = new TH2F("ESD_TrueSecondaryClusConvGamma_Pt", "ESD_TrueSecondaryClusConvGamma_Pt", nBinsClusterPt, arrClusPtBinning, 5, -0.5, 4.5);
2372  fHistoTrueSecondaryClusConvGammaPt[iCut]->SetXTitle("p_{T} (GeV/c)");
2373  fHistoTrueSecondaryClusConvGammaPt[iCut]->SetYTitle("source");
2374  fHistoTrueSecondaryClusConvGammaPt[iCut]->GetYaxis()->SetBinLabel( 1,"K0s");
2375  fHistoTrueSecondaryClusConvGammaPt[iCut]->GetYaxis()->SetBinLabel( 2,"K0l");
2376  fHistoTrueSecondaryClusConvGammaPt[iCut]->GetYaxis()->SetBinLabel( 3,"Lambda");
2377  fHistoTrueSecondaryClusConvGammaPt[iCut]->GetYaxis()->SetBinLabel( 4,"Eta");
2378  fHistoTrueSecondaryClusConvGammaPt[iCut]->GetYaxis()->SetBinLabel( 5,"rest");
2380  fHistoTrueSecondaryClusGammaMCPt[iCut] = new TH2F("ESD_TrueSecondaryClusGamma_MCPt", "ESD_TrueSecondaryClusGamma_MCPt", nBinsClusterPt, arrClusPtBinning, 5, -0.5, 4.5);
2381  fHistoTrueSecondaryClusGammaMCPt[iCut]->SetXTitle("p_{T, MC} (GeV/c)");
2382  fHistoTrueSecondaryClusGammaMCPt[iCut]->SetYTitle("source");
2383  fHistoTrueSecondaryClusGammaMCPt[iCut]->GetYaxis()->SetBinLabel( 1,"K0s");
2384  fHistoTrueSecondaryClusGammaMCPt[iCut]->GetYaxis()->SetBinLabel( 2,"K0l");
2385  fHistoTrueSecondaryClusGammaMCPt[iCut]->GetYaxis()->SetBinLabel( 3,"Lambda");
2386  fHistoTrueSecondaryClusGammaMCPt[iCut]->GetYaxis()->SetBinLabel( 4,"Eta");
2387  fHistoTrueSecondaryClusGammaMCPt[iCut]->GetYaxis()->SetBinLabel( 5,"rest");
2388  fTrueList[iCut]->Add(fHistoTrueSecondaryClusGammaMCPt[iCut]);
2389  fHistoTrueSecondaryClusConvGammaMCPt[iCut] = new TH2F("ESD_TrueSecondaryClusConvGamma_MCPt", "ESD_TrueSecondaryClusConvGamma_MCPt", nBinsClusterPt, arrClusPtBinning, 5, -0.5, 4.5);
2390  fHistoTrueSecondaryClusConvGammaMCPt[iCut]->SetXTitle("p_{T, MC} (GeV/c)");
2391  fHistoTrueSecondaryClusConvGammaMCPt[iCut]->SetYTitle("source");
2392  fHistoTrueSecondaryClusConvGammaMCPt[iCut]->GetYaxis()->SetBinLabel( 1,"K0s");
2393  fHistoTrueSecondaryClusConvGammaMCPt[iCut]->GetYaxis()->SetBinLabel( 2,"K0l");
2394  fHistoTrueSecondaryClusConvGammaMCPt[iCut]->GetYaxis()->SetBinLabel( 3,"Lambda");
2395  fHistoTrueSecondaryClusConvGammaMCPt[iCut]->GetYaxis()->SetBinLabel( 4,"Eta");
2396  fHistoTrueSecondaryClusConvGammaMCPt[iCut]->GetYaxis()->SetBinLabel( 5,"rest");
2398 
2399  fHistoTrueSecondaryClusGammaFromXFromK0sMCPtESDPt[iCut] = new TH2F("ESD_TrueSecondaryClusGammaFromXFromK0s_MCPt_Pt", "ESD_TrueSecondaryClusGammaFromXFromK0s_MCPt_Pt",
2400  nBinsClusterPt, arrClusPtBinning, nBinsClusterPt, arrClusPtBinning);
2401  fHistoTrueSecondaryClusGammaFromXFromK0sMCPtESDPt[iCut]->SetXTitle("p_{T, MC} (GeV/c)");
2402  fHistoTrueSecondaryClusGammaFromXFromK0sMCPtESDPt[iCut]->SetYTitle("p_{T} (GeV/c)");
2404  fHistoTrueSecondaryClusConvGammaFromXFromK0sMCPtESDPt[iCut] = new TH2F("ESD_TrueSecondaryClusConvGammaFromXFromK0s_MCPt_Pt", "ESD_TrueSecondaryClusConvGammaFromXFromK0s_MCPt_Pt",
2405  nBinsClusterPt, arrClusPtBinning, nBinsClusterPt, arrClusPtBinning);
2406  fHistoTrueSecondaryClusConvGammaFromXFromK0sMCPtESDPt[iCut]->SetXTitle("p_{T, MC} (GeV/c)");
2407  fHistoTrueSecondaryClusConvGammaFromXFromK0sMCPtESDPt[iCut]->SetYTitle("p_{T} (GeV/c)");
2409  fHistoTrueSecondaryClusGammaFromXFromK0lMCPtESDPt[iCut] = new TH2F("ESD_TrueSecondaryClusGammaFromXFromK0l_MCPt_Pt", "ESD_TrueSecondaryClusGammaFromXFromK0l_MCPt_Pt",
2410  nBinsClusterPt, arrClusPtBinning, nBinsClusterPt, arrClusPtBinning);
2411  fHistoTrueSecondaryClusGammaFromXFromK0lMCPtESDPt[iCut]->SetXTitle("p_{T, MC} (GeV/c)");
2412  fHistoTrueSecondaryClusGammaFromXFromK0lMCPtESDPt[iCut]->SetYTitle("p_{T} (GeV/c)");
2414  fHistoTrueSecondaryClusConvGammaFromXFromK0lMCPtESDPt[iCut] = new TH2F("ESD_TrueSecondaryClusConvGammaFromXFromK0l_MCPt_Pt", "ESD_TrueSecondaryClusConvGammaFromXFromK0l_MCPt_Pt",
2415  nBinsClusterPt, arrClusPtBinning, nBinsClusterPt, arrClusPtBinning);
2416  fHistoTrueSecondaryClusConvGammaFromXFromK0lMCPtESDPt[iCut]->SetXTitle("p_{T, MC} (GeV/c)");
2417  fHistoTrueSecondaryClusConvGammaFromXFromK0lMCPtESDPt[iCut]->SetYTitle("p_{T} (GeV/c)");
2419  fHistoTrueSecondaryClusGammaFromXFromLambdaMCPtESDPt[iCut] = new TH2F("ESD_TrueSecondaryClusGammaFromXFromLambda_MCPt_Pt", "ESD_TrueSecondaryClusGammaFromXFromLambda_MCPt_Pt",
2420  nBinsClusterPt, arrClusPtBinning, nBinsClusterPt, arrClusPtBinning);
2421  fHistoTrueSecondaryClusGammaFromXFromLambdaMCPtESDPt[iCut]->SetXTitle("p_{T, MC} (GeV/c)");
2422  fHistoTrueSecondaryClusGammaFromXFromLambdaMCPtESDPt[iCut]->SetYTitle("p_{T} (GeV/c)");
2424  fHistoTrueSecondaryClusConvGammaFromXFromLambdaMCPtESDPt[iCut] = new TH2F("ESD_TrueSecondaryClusConvGammaFromXFromLambda_MCPt_Pt", "ESD_TrueSecondaryClusConvGammaFromXFromLambda_MCPt_Pt",
2425  nBinsClusterPt, arrClusPtBinning, nBinsClusterPt, arrClusPtBinning);
2426  fHistoTrueSecondaryClusConvGammaFromXFromLambdaMCPtESDPt[iCut]->SetXTitle("p_{T, MC} (GeV/c)");
2427  fHistoTrueSecondaryClusConvGammaFromXFromLambdaMCPtESDPt[iCut]->SetYTitle("p_{T} (GeV/c)");
2429 
2430  fHistoTrueNLabelsInClus[iCut] = new TH1F("TrueNLabelsInClus", "TrueNLabelsInClus", 100, -0.5, 99.5);
2431  fHistoTrueNLabelsInClus[iCut]->SetXTitle("# labels");
2432  fTrueList[iCut]->Add(fHistoTrueNLabelsInClus[iCut]);
2433  }
2434 
2435  fHistoDoubleCountTrueClusterGammaPt[iCut] = new TH2F("TrueDoubleCountClusterGamma_Pt", "TrueDoubleCountClusterGamma_Pt", nBinsClusterPt, arrClusPtBinning, 2, 0, 2);
2436  fHistoDoubleCountTrueClusterGammaPt[iCut]->SetXTitle("p_{T} (GeV/c)");
2438  fHistoMultipleCountTrueClusterGamma[iCut] = new TH1F("TrueMultipleCountClusterGamma", "TrueMultipleCountClusterGamma", 10, 1, 11);
2439  fHistoMultipleCountTrueClusterGamma[iCut]->SetXTitle("# multiple");
2441 
2442  if (fIsMC > 1){
2443  fHistoTrueClusGammaPt[iCut]->Sumw2();
2444  fHistoDoubleCountTrueClusterGammaPt[iCut]->Sumw2();
2445  fHistoMultipleCountTrueClusterGamma[iCut]->Sumw2();
2446  if(!fDoLightOutput){
2447  fHistoTrueNLabelsInClus[iCut]->Sumw2();
2448  if (fDoClusterQA > 0) fHistoTrueClusGammaPtM02[iCut]->Sumw2();
2449  fHistoTruePrimaryClusGammaPt[iCut]->Sumw2();
2450  fHistoTruePrimaryClusGammaESDPtMCPt[iCut]->Sumw2();
2451  fHistoTruePrimaryClusConvGammaPt[iCut]->Sumw2();
2453  fHistoTrueSecondaryClusGammaPt[iCut]->Sumw2();
2454  fHistoTrueSecondaryClusConvGammaPt[iCut]->Sumw2();
2455  fHistoTrueSecondaryClusGammaMCPt[iCut]->Sumw2();
2456  fHistoTrueSecondaryClusConvGammaMCPt[iCut]->Sumw2();
2463  }
2464  }
2465 
2466  if (fDoClusterQA > 0){
2467  fHistoTrueClusUnConvGammaPt[iCut] = new TH1F("TrueClusUnConvGamma_Pt", "TrueClusUnConvGamma_Pt", nBinsClusterPt, arrClusPtBinning);
2468  fHistoTrueClusUnConvGammaPt[iCut]->SetXTitle("p_{T} (GeV/c)");
2469  fTrueList[iCut]->Add(fHistoTrueClusUnConvGammaPt[iCut]);
2470  fHistoTrueClusUnConvGammaMCPt[iCut] = new TH1F("TrueClusUnConvGamma_MCPt", "TrueClusUnConvGamma_MCPt", nBinsClusterPt, arrClusPtBinning);
2471  fHistoTrueClusUnConvGammaMCPt[iCut]->SetXTitle("p_{T, MC} (GeV/c)");
2472  fTrueList[iCut]->Add(fHistoTrueClusUnConvGammaMCPt[iCut]);
2473  if (!fDoLightOutput) {
2474  fHistoTrueClusUnConvGammaPtM02[iCut] = new TH2F("TrueClusUnConvGamma_Pt_M02", "TrueClusUnConvGamma_Pt_M02", nBinsClusterPt, arrClusPtBinning, 100, 0, 1);
2475  fHistoTrueClusUnConvGammaPtM02[iCut]->SetXTitle("p_{T, MC} (GeV/c)");
2476  fHistoTrueClusUnConvGammaPtM02[iCut]->SetYTitle("#sigma_{long}^{2}");
2477  fTrueList[iCut]->Add(fHistoTrueClusUnConvGammaPtM02[iCut]);
2478  }
2479  fHistoTrueClusElectronPt[iCut] = new TH1F("TrueClusElectron_Pt", "TrueElectronGamma_Pt", nBinsClusterPt, arrClusPtBinning);
2480  fHistoTrueClusElectronPt[iCut]->SetXTitle("p_{T} (GeV/c)");
2481  fTrueList[iCut]->Add(fHistoTrueClusElectronPt[iCut]);
2482  fHistoTrueClusConvGammaPt[iCut] = new TH1F("TrueClusConvGamma_Pt", "TrueClusConvGamma_Pt", nBinsClusterPt, arrClusPtBinning);
2483  fHistoTrueClusConvGammaPt[iCut]->SetXTitle("p_{T} (GeV/c)");
2484  fTrueList[iCut]->Add(fHistoTrueClusConvGammaPt[iCut]);
2485  fHistoTrueClusConvGammaMCPt[iCut] = new TH1F("TrueClusConvGamma_MCPt", "TrueClusConvGamma_MCPt", nBinsClusterPt, arrClusPtBinning);
2486  fHistoTrueClusConvGammaMCPt[iCut]->SetXTitle("p_{T, MC} (GeV/c)");
2487  fTrueList[iCut]->Add(fHistoTrueClusConvGammaMCPt[iCut]);
2488  fHistoTrueClusConvGammaFullyPt[iCut] = new TH1F("TrueClusConvGammaFullyContained_Pt", "TrueClusConvGammaFullyContained_Pt", nBinsClusterPt, arrClusPtBinning);
2489  fHistoTrueClusConvGammaFullyPt[iCut]->SetXTitle("p_{T} (GeV/c)");
2490  fTrueList[iCut]->Add(fHistoTrueClusConvGammaFullyPt[iCut]);
2491  fHistoTrueClusMergedGammaPt[iCut] = new TH1F("TrueClusMergedGamma_Pt", "TrueClusMergedGamma_Pt", nBinsClusterPt, arrClusPtBinning);
2492  fHistoTrueClusMergedGammaPt[iCut]->SetXTitle("p_{T} (GeV/c)");
2493  fTrueList[iCut]->Add(fHistoTrueClusMergedGammaPt[iCut]);
2494  fHistoTrueClusMergedPartConvGammaPt[iCut] = new TH1F("TrueClusMergedPartConvGamma_Pt", "TrueClusMergedPartConvGamma_Pt", nBinsClusterPt, arrClusPtBinning);
2495  fHistoTrueClusMergedPartConvGammaPt[iCut]->SetXTitle("p_{T} (GeV/c)");
2497  fHistoTrueClusDalitzPt[iCut] = new TH1F("TrueClusDalitz_Pt", "TrueClusDalitz_Pt", nBinsClusterPt, arrClusPtBinning);
2498  fHistoTrueClusDalitzPt[iCut]->SetXTitle("p_{T} (GeV/c)");
2499  fTrueList[iCut]->Add(fHistoTrueClusDalitzPt[iCut]);
2500  fHistoTrueClusDalitzMergedPt[iCut] = new TH1F("TrueClusDalitzMerged_Pt", "TrueClusDalitzMerged_Pt", nBinsClusterPt, arrClusPtBinning);
2501  fHistoTrueClusDalitzMergedPt[iCut]->SetXTitle("p_{T} (GeV/c)");
2502  fTrueList[iCut]->Add(fHistoTrueClusDalitzMergedPt[iCut]);
2503  fHistoTrueClusPhotonFromElecMotherPt[iCut] = new TH1F("TrueClusPhotonFromElecMother_Pt", "TrueClusPhotonFromElecMother_Pt", nBinsClusterPt, arrClusPtBinning);
2504  fHistoTrueClusPhotonFromElecMotherPt[iCut]->SetXTitle("p_{T} (GeV/c)");
2506  fHistoTrueClusShowerPt[iCut] = new TH1F("TrueClusShower_Pt", "TrueClusShower_Pt", nBinsClusterPt, arrClusPtBinning);
2507  fHistoTrueClusShowerPt[iCut]->SetXTitle("p_{T} (GeV/c)");
2508  fTrueList[iCut]->Add(fHistoTrueClusShowerPt[iCut]);
2509  fHistoTrueClusSubLeadingPt[iCut] = new TH1F("TrueClusSubleading_Pt", "TrueClusSubleading_Pt", nBinsClusterPt, arrClusPtBinning);
2510  fHistoTrueClusSubLeadingPt[iCut]->SetXTitle("p_{T} (GeV/c)");
2511  fTrueList[iCut]->Add(fHistoTrueClusSubLeadingPt[iCut]);
2512  fHistoTrueClusNParticles[iCut] = new TH1F("TrueClusNParticles", "TrueClusNParticles", 20, 0, 20);
2513  fHistoTrueClusNParticles[iCut]->SetXTitle("#particles");
2514  fTrueList[iCut]->Add(fHistoTrueClusNParticles[iCut]);
2515  fHistoTrueClusEMNonLeadingPt[iCut] = new TH1F("TrueClusEMNonLeading_Pt", "TrueClusEMNonLeading_Pt", nBinsClusterPt, arrClusPtBinning);
2516  fHistoTrueClusEMNonLeadingPt[iCut]->SetXTitle("p_{T} (GeV/c)");
2517  fTrueList[iCut]->Add(fHistoTrueClusEMNonLeadingPt[iCut]);
2518 
2519  if (fIsMC > 1){
2520  fHistoTrueClusUnConvGammaPt[iCut]->Sumw2();
2521  fHistoTrueClusUnConvGammaMCPt[iCut]->Sumw2();
2522  if (!fDoLightOutput)
2523  fHistoTrueClusUnConvGammaPtM02[iCut]->Sumw2();
2524  fHistoTrueClusElectronPt[iCut]->Sumw2();
2525  fHistoTrueClusConvGammaPt[iCut]->Sumw2();
2526  fHistoTrueClusConvGammaMCPt[iCut]->Sumw2();
2527  fHistoTrueClusConvGammaFullyPt[iCut]->Sumw2();
2528  fHistoTrueClusMergedGammaPt[iCut]->Sumw2();
2529  fHistoTrueClusMergedPartConvGammaPt[iCut]->Sumw2();
2530  fHistoTrueClusDalitzPt[iCut]->Sumw2();
2531  fHistoTrueClusDalitzMergedPt[iCut]->Sumw2();
2532  fHistoTrueClusPhotonFromElecMotherPt[iCut]->Sumw2();
2533  fHistoTrueClusShowerPt[iCut]->Sumw2();
2534  fHistoTrueClusSubLeadingPt[iCut]->Sumw2();
2535  fHistoTrueClusNParticles[iCut]->Sumw2();
2536  fHistoTrueClusEMNonLeadingPt[iCut]->Sumw2();
2537  }
2538  }
2539 
2540  if(fDoMesonAnalysis){
2541  fHistoTruePi0InvMassPt[iCut] = new TH2F("ESD_TruePi0_InvMass_Pt", "ESD_TruePi0_InvMass_Pt", 800, 0, 0.8, nBinsPt, arrPtBinning);
2542  fHistoTruePi0InvMassPt[iCut]->SetYTitle("p_{T} (GeV/c)");
2543  fHistoTruePi0InvMassPt[iCut]->SetXTitle("M_{#gamma#gamma} (GeV/c^{2})");
2544  fTrueList[iCut]->Add(fHistoTruePi0InvMassPt[iCut]);
2545  fHistoTruePi0noConvInvMassPt[iCut] = new TH2F("ESD_TruePi0_noConv_InvMass_Pt", "ESD_TruePi0_noConv_InvMass_Pt", 800, 0, 0.8, nBinsPt, arrPtBinning);
2546  fHistoTruePi0noConvInvMassPt[iCut]->SetYTitle("p_{T} (GeV/c)");
2547  fHistoTruePi0noConvInvMassPt[iCut]->SetXTitle("M_{#gamma#gamma} (GeV/c^{2})");
2548  fTrueList[iCut]->Add(fHistoTruePi0noConvInvMassPt[iCut]);
2549  fHistoTrueEtaInvMassPt[iCut] = new TH2F("ESD_TrueEta_InvMass_Pt", "ESD_TrueEta_InvMass_Pt", 800, 0, 0.8, nBinsPt, arrPtBinning);
2550  fHistoTrueEtaInvMassPt[iCut]->SetYTitle("p_{T} (GeV/c)");
2551  fHistoTrueEtaInvMassPt[iCut]->SetXTitle("M_{#gamma#gamma} (GeV/c^{2})");
2552  fTrueList[iCut]->Add(fHistoTrueEtaInvMassPt[iCut]);
2553 
2554  fHistoDoubleCountTruePi0InvMassPt[iCut] = new TH2F("ESD_TrueDoubleCountPi0_InvMass_Pt", "ESD_TrueDoubleCountPi0_InvMass_Pt", 800, 0, 0.8, nBinsPt, arrPtBinning);
2555  fHistoDoubleCountTruePi0InvMassPt[iCut]->SetYTitle("p_{T} (GeV/c)");
2556  fHistoDoubleCountTruePi0InvMassPt[iCut]->SetXTitle("M_{#gamma#gamma} (GeV/c^{2})");
2557  fTrueList[iCut]->Add(fHistoDoubleCountTruePi0InvMassPt[iCut]);
2558  fHistoDoubleCountTrueEtaInvMassPt[iCut] = new TH2F("ESD_TrueDoubleCountEta_InvMass_Pt", "ESD_TrueDoubleCountEta_InvMass_Pt", 800, 0, 0.8, nBinsPt, arrPtBinning);
2559  fHistoDoubleCountTrueEtaInvMassPt[iCut]->SetYTitle("p_{T} (GeV/c)");
2560  fHistoDoubleCountTrueEtaInvMassPt[iCut]->SetXTitle("M_{#gamma#gamma} (GeV/c^{2})");
2561  fTrueList[iCut]->Add(fHistoDoubleCountTrueEtaInvMassPt[iCut]);
2562 
2563  fHistoTruePrimaryPi0InvMassPt[iCut] = new TH2F("ESD_TruePrimaryPi0_InvMass_Pt", "ESD_TruePrimaryPi0_InvMass_Pt", 800, 0, 0.8, nBinsPt, arrPtBinning);
2564  fHistoTruePrimaryPi0InvMassPt[iCut]->SetYTitle("p_{T} (GeV/c)");
2565  fHistoTruePrimaryPi0InvMassPt[iCut]->SetXTitle("M_{#gamma#gamma} (GeV/c^{2})");
2566  fHistoTruePrimaryPi0InvMassPt[iCut]->Sumw2();
2567  fTrueList[iCut]->Add(fHistoTruePrimaryPi0InvMassPt[iCut]);
2568  fHistoTruePrimaryEtaInvMassPt[iCut] = new TH2F("ESD_TruePrimaryEta_InvMass_Pt", "ESD_TruePrimaryEta_InvMass_Pt", 800, 0, 0.8, nBinsPt, arrPtBinning);
2569  fHistoTruePrimaryEtaInvMassPt[iCut]->SetYTitle("p_{T} (GeV/c)");
2570  fHistoTruePrimaryEtaInvMassPt[iCut]->SetXTitle("M_{#gamma#gamma} (GeV/c^{2})");
2571  fHistoTruePrimaryEtaInvMassPt[iCut]->Sumw2();
2572  fTrueList[iCut]->Add(fHistoTruePrimaryEtaInvMassPt[iCut]);
2573 
2574  fHistoTruePrimaryPi0W0WeightingInvMassPt[iCut] = new TH2F("ESD_TruePrimaryPi0W0Weights_InvMass_Pt", "ESD_TruePrimaryPi0W0Weights_InvMass_Pt", 800, 0, 0.8, nBinsPt, arrPtBinning);
2575  fHistoTruePrimaryPi0W0WeightingInvMassPt[iCut]->SetYTitle("p_{T} (GeV/c)");
2576  fHistoTruePrimaryPi0W0WeightingInvMassPt[iCut]->SetXTitle("M_{#gamma#gamma} (GeV/c^{2})");
2579  fHistoTruePrimaryEtaW0WeightingInvMassPt[iCut] = new TH2F("ESD_TruePrimaryEtaW0Weights_InvMass_Pt", "ESD_TruePrimaryEtaW0Weights_InvMass_Pt", 800, 0, 0.8, nBinsPt, arrPtBinning);
2580  fHistoTruePrimaryEtaW0WeightingInvMassPt[iCut]->SetYTitle("p_{T} (GeV/c)");
2581  fHistoTruePrimaryEtaW0WeightingInvMassPt[iCut]->SetXTitle("M_{#gamma#gamma} (GeV/c^{2})");
2584 
2585  fProfileTruePrimaryPi0WeightsInvMassPt[iCut] = new TProfile2D("ESD_TruePrimaryPi0Weights_InvMass_Pt", "ESD_TruePrimaryPi0Weights_InvMass_Pt", 800, 0, 0.8, nBinsPt, arrPtBinning);
2586  fProfileTruePrimaryPi0WeightsInvMassPt[iCut]->SetYTitle("p_{T} (GeV/c)");
2587  fProfileTruePrimaryPi0WeightsInvMassPt[iCut]->SetXTitle("M_{#gamma#gamma} (GeV/c^{2})");
2590  fProfileTruePrimaryEtaWeightsInvMassPt[iCut] = new TProfile2D("ESD_TruePrimaryEtaWeights_InvMass_Pt", "ESD_TruePrimaryEtaWeights_InvMass_Pt", 800, 0, 0.8, nBinsPt, arrPtBinning);
2591  fProfileTruePrimaryEtaWeightsInvMassPt[iCut]->SetYTitle("p_{T} (GeV/c)");
2592  fProfileTruePrimaryEtaWeightsInvMassPt[iCut]->SetXTitle("M_{#gamma#gamma} (GeV/c^{2})");
2595 
2596  fHistoTrueSecondaryPi0InvMassPt[iCut] = new TH2F("ESD_TrueSecondaryPi0_InvMass_Pt", "ESD_TrueSecondaryPi0_InvMass_Pt", 800, 0, 0.8, nBinsPt, arrPtBinning);
2597  fHistoTrueSecondaryPi0InvMassPt[iCut]->SetYTitle("p_{T} (GeV/c)");
2598  fHistoTrueSecondaryPi0InvMassPt[iCut]->SetXTitle("M_{#gamma#gamma} (GeV/c^{2})");
2599  fHistoTrueSecondaryPi0InvMassPt[iCut]->Sumw2();
2600  fTrueList[iCut]->Add(fHistoTrueSecondaryPi0InvMassPt[iCut]);
2601 
2602  if(!fDoLightOutput){
2603  fHistoTruePi0InvMassPtAlpha[iCut] = new TH2F("ESD_TruePi0_InvMass_vs_Pt_Alpha", "ESD_TruePi0_InvMass_vs_Pt_Alpha", 800, 0, 0.8, nBinsPt, arrPtBinning);
2604  fHistoTruePi0InvMassPtAlpha[iCut]->SetYTitle("p_{T} (GeV/c)");
2605  fHistoTruePi0InvMassPtAlpha[iCut]->SetXTitle("M_{#gamma#gamma} (GeV/c^{2})");
2606  fHistoTruePi0InvMassPtAlpha[iCut]->Sumw2();
2607  fESDList[iCut]->Add(fHistoTruePi0InvMassPtAlpha[iCut]);
2608  fHistoTruePi0PureGammaInvMassPtAlpha[iCut] = new TH2F("ESD_TruePi0PureGamma_InvMass_vs_Pt_Alpha", "ESD_TruePi0PureGamma_InvMass_vs_Pt_Alpha", 800, 0, 0.8, nBinsPt, arrPtBinning);
2609  fHistoTruePi0PureGammaInvMassPtAlpha[iCut]->SetYTitle("p_{T} (GeV/c)");
2610  fHistoTruePi0PureGammaInvMassPtAlpha[iCut]->SetXTitle("M_{#gamma#gamma} (GeV/c^{2})");
2611  fHistoTruePi0PureGammaInvMassPtAlpha[iCut]->Sumw2();
2613  }
2614 
2615  fHistoTrueSecondaryPi0FromK0sInvMassPt[iCut] = new TH2F("ESD_TrueSecondaryPi0FromK0s_InvMass_Pt", "ESD_TrueSecondaryPi0FromK0s_InvMass_Pt", 800, 0, 0.8, nBinsPt, arrPtBinning);
2616  fHistoTrueSecondaryPi0FromK0sInvMassPt[iCut]->SetYTitle("p_{T} (GeV/c)");
2617  fHistoTrueSecondaryPi0FromK0sInvMassPt[iCut]->SetXTitle("M_{#gamma#gamma} (GeV/c^{2})");
2620  fHistoTrueSecondaryPi0FromK0lInvMassPt[iCut] = new TH2F("ESD_TrueSecondaryPi0FromK0l_InvMass_Pt", "ESD_TrueSecondaryPi0FromK0l_InvMass_Pt", 800, 0, 0.8, nBinsPt, arrPtBinning);
2621  fHistoTrueSecondaryPi0FromK0lInvMassPt[iCut]->SetYTitle("p_{T} (GeV/c)");
2622  fHistoTrueSecondaryPi0FromK0lInvMassPt[iCut]->SetXTitle("M_{#gamma#gamma} (GeV/c^{2})");
2625  fHistoTrueSecondaryPi0FromEtaInvMassPt[iCut] = new TH2F("ESD_TrueSecondaryPi0FromEta_InvMass_Pt", "ESD_TrueSecondaryPi0FromEta_InvMass_Pt", 800, 0, 0.8, nBinsPt, arrPtBinning);
2626  fHistoTrueSecondaryPi0FromEtaInvMassPt[iCut]->SetYTitle("p_{T} (GeV/c)");
2627  fHistoTrueSecondaryPi0FromEtaInvMassPt[iCut]->SetXTitle("M_{#gamma#gamma} (GeV/c^{2})");
2629  fHistoTrueSecondaryPi0FromLambdaInvMassPt[iCut] = new TH2F("ESD_TrueSecondaryPi0FromLambda_InvMass_Pt", "ESD_TrueSecondaryPi0FromLambda_InvMass_Pt", 800, 0, 0.8, nBinsPt, arrPtBinning);
2630  fHistoTrueSecondaryPi0FromLambdaInvMassPt[iCut]->SetYTitle("p_{T} (GeV/c)");
2631  fHistoTrueSecondaryPi0FromLambdaInvMassPt[iCut]->SetXTitle("M_{#gamma#gamma} (GeV/c^{2})");
2633 
2634  if (fIsMC > 1){
2635  fHistoTruePi0InvMassPt[iCut]->Sumw2();
2636  fHistoTruePi0noConvInvMassPt[iCut]->Sumw2();
2637  fHistoTrueEtaInvMassPt[iCut]->Sumw2();
2638  fHistoDoubleCountTruePi0InvMassPt[iCut]->Sumw2();
2639  fHistoDoubleCountTrueEtaInvMassPt[iCut]->Sumw2();
2644  }
2645 
2646 
2647  if (fDoMesonQA > 0 && fDoMesonQA < 3){
2648  if (fIsMC < 2){
2649 
2650  fHistoTruePi0CaloPhotonInvMassPt[iCut] = new TH2F("ESD_TruePi0CaloPhoton_InvMass_Pt", "ESD_TruePi0CaloPhoton_InvMass_Pt", 800, 0, 0.8, nBinsPt, arrPtBinning);
2651  fHistoTruePi0CaloPhotonInvMassPt[iCut]->SetYTitle("p_{T} (GeV/c)");
2652  fHistoTruePi0CaloPhotonInvMassPt[iCut]->SetXTitle("M_{#gamma#gamma} (GeV/c^{2})");
2653  fTrueList[iCut]->Add(fHistoTruePi0CaloPhotonInvMassPt[iCut]);
2654  fHistoTrueEtaCaloPhotonInvMassPt[iCut] = new TH2F("ESD_TrueEtaCaloPhoton_InvMass_Pt", "ESD_TrueEtaCaloPhoton_InvMass_Pt", 800, 0, 0.8, nBinsPt, arrPtBinning);
2655  fHistoTrueEtaCaloPhotonInvMassPt[iCut]->SetYTitle("p_{T} (GeV/c)");
2656  fHistoTrueEtaCaloPhotonInvMassPt[iCut]->SetXTitle("M_{#gamma#gamma} (GeV/c^{2})");
2657  fTrueList[iCut]->Add(fHistoTrueEtaCaloPhotonInvMassPt[iCut]);
2658 
2659  fHistoTruePi0CaloMixedPhotonConvPhotonInvMassPt[iCut] = new TH2F("ESD_TruePi0CaloMixedPhotonConvertedPhoton_InvMass_Pt", "ESD_TruePi0CaloMixedPhotonConvertedPhoton_InvMass_Pt", 800, 0, 0.8,
2660  nBinsPt, arrPtBinning);
2661  fHistoTruePi0CaloMixedPhotonConvPhotonInvMassPt[iCut]->SetYTitle("p_{T} (GeV/c)");
2662  fHistoTruePi0CaloMixedPhotonConvPhotonInvMassPt[iCut]->SetXTitle("M_{#gamma#gamma} (GeV/c^{2})");
2664  fHistoTrueEtaCaloMixedPhotonConvPhotonInvMassPt[iCut] = new TH2F("ESD_TrueEtaCaloMixedPhotonConvertedPhoton_InvMass_Pt", "ESD_TrueEtaCaloMixedPhotonConvertedPhoton_InvMass_Pt", 800, 0, 0.8,
2665  nBinsPt, arrPtBinning);
2666  fHistoTrueEtaCaloMixedPhotonConvPhotonInvMassPt[iCut]->SetYTitle("p_{T} (GeV/c)");
2667  fHistoTrueEtaCaloMixedPhotonConvPhotonInvMassPt[iCut]->SetXTitle("M_{#gamma#gamma} (GeV/c^{2})");
2669 
2670  fHistoTruePi0CaloConvertedPhotonInvMassPt[iCut] = new TH2F("ESD_TruePi0CaloConvertedPhoton_InvMass_Pt", "ESD_TruePi0CaloConvertedPhoton_InvMass_Pt", 800, 0, 0.8, nBinsPt, arrPtBinning);
2671  fHistoTruePi0CaloConvertedPhotonInvMassPt[iCut]->SetYTitle("p_{T} (GeV/c)");
2672  fHistoTruePi0CaloConvertedPhotonInvMassPt[iCut]->SetXTitle("M_{#gamma#gamma} (GeV/c^{2})");
2674  fHistoTrueEtaCaloConvertedPhotonInvMassPt[iCut] = new TH2F("ESD_TrueEtaCaloConvertedPhoton_InvMass_Pt", "ESD_TrueEtaCaloConvertedPhoton_InvMass_Pt", 800, 0, 0.8, nBinsPt, arrPtBinning);
2675  fHistoTrueEtaCaloConvertedPhotonInvMassPt[iCut]->SetYTitle("p_{T} (GeV/c)");
2676  fHistoTrueEtaCaloConvertedPhotonInvMassPt[iCut]->SetXTitle("M_{#gamma#gamma} (GeV/c^{2})");
2678 
2679  fHistoTruePi0CaloElectronInvMassPt[iCut] = new TH2F("ESD_TruePi0CaloElectron_InvMass_Pt", "ESD_TruePi0CaloElectron_InvMass_Pt", 800, 0, 0.8, nBinsPt, arrPtBinning);
2680  fHistoTruePi0CaloElectronInvMassPt[iCut]->SetYTitle("p_{T} (GeV/c)");
2681  fHistoTruePi0CaloElectronInvMassPt[iCut]->SetXTitle("M_{#gamma#gamma} (GeV/c^{2})");
2683  fHistoTrueEtaCaloElectronInvMassPt[iCut] = new TH2F("ESD_TrueEtaCaloElectron_InvMass_Pt", "ESD_TrueEtaCaloElectron_InvMass_Pt", 800, 0, 0.8, nBinsPt, arrPtBinning);
2684  fHistoTrueEtaCaloElectronInvMassPt[iCut]->SetYTitle("p_{T} (GeV/c)");
2685  fHistoTrueEtaCaloElectronInvMassPt[iCut]->SetXTitle("M_{#gamma#gamma} (GeV/c^{2})");
2687 
2688  fHistoTruePi0CaloMergedClusterInvMassPt[iCut] = new TH2F("ESD_TruePi0CaloMergedCluster_InvMass_Pt", "ESD_TruePi0CaloMergedCluster_InvMass_Pt", 800, 0, 0.8, nBinsPt, arrPtBinning);
2689  fHistoTruePi0CaloMergedClusterInvMassPt[iCut]->SetYTitle("p_{T} (GeV/c)");
2690  fHistoTruePi0CaloMergedClusterInvMassPt[iCut]->SetXTitle("M_{#gamma#gamma} (GeV/c^{2})");
2692  fHistoTrueEtaCaloMergedClusterInvMassPt[iCut] = new TH2F("ESD_TrueEtaCaloMergedCluster_InvMass_Pt", "ESD_TrueEtaCaloMergedCluster_InvMass_Pt", 800, 0, 0.8, nBinsPt, arrPtBinning);
2693  fHistoTrueEtaCaloMergedClusterInvMassPt[iCut]->SetYTitle("p_{T} (GeV/c)");
2694  fHistoTrueEtaCaloMergedClusterInvMassPt[iCut]->SetXTitle("M_{#gamma#gamma} (GeV/c^{2})");
2696 
2697  fHistoTruePi0CaloMergedClusterPartConvInvMassPt[iCut] = new TH2F("ESD_TruePi0CaloMergedClusterPartConv_InvMass_Pt", "ESD_TruePi0CaloMergedClusterPartConv_InvMass_Pt", 800, 0, 0.8,
2698  nBinsPt, arrPtBinning);
2699  fHistoTruePi0CaloMergedClusterPartConvInvMassPt[iCut]->SetYTitle("p_{T} (GeV/c)");
2700  fHistoTruePi0CaloMergedClusterPartConvInvMassPt[iCut]->SetXTitle("M_{#gamma#gamma} (GeV/c^{2})");
2702  fHistoTrueEtaCaloMergedClusterPartConvInvMassPt[iCut] = new TH2F("ESD_TrueEtaCaloMergedClusterPartConv_InvMass_Pt", "ESD_TrueEtaCaloMergedClusterPartConv_InvMass_Pt", 800, 0, 0.8,
2703  nBinsPt, arrPtBinning);
2704  fHistoTrueEtaCaloMergedClusterPartConvInvMassPt[iCut]->SetYTitle("p_{T} (GeV/c)");
2705  fHistoTrueEtaCaloMergedClusterPartConvInvMassPt[iCut]->SetXTitle("M_{#gamma#gamma} (GeV/c^{2})");
2707 
2708  fHistoTruePi0NonMergedElectronPhotonInvMassPt[iCut] = new TH2F("ESD_TruePi0NonMergedElectronPhoton_InvMass_Pt", "ESD_TruePi0NonMergedElectronPhoton_InvMass_Pt", 800, 0, 0.8, nBinsPt, arrPtBinning);
2709  fHistoTruePi0NonMergedElectronPhotonInvMassPt[iCut]->SetYTitle("p_{T} (GeV/c)");
2710  fHistoTruePi0NonMergedElectronPhotonInvMassPt[iCut]->SetXTitle("M_{#gamma#gamma} (GeV/c^{2})");
2712  fHistoTruePi0NonMergedElectronMergedPhotonInvMassPt[iCut] = new TH2F("ESD_TruePi0NonMergedElectronMergedPhoton_InvMass_Pt", "ESD_TruePi0NonMergedElectronMergedPhoton_InvMass_Pt", 800, 0, 0.8,
2713  nBinsPt, arrPtBinning);
2714  fHistoTruePi0NonMergedElectronMergedPhotonInvMassPt[iCut]->SetYTitle("p_{T} (GeV/c)");
2715  fHistoTruePi0NonMergedElectronMergedPhotonInvMassPt[iCut]->SetXTitle("M_{#gamma#gamma} (GeV/c^{2})");
2717 
2718  fHistoTruePrimaryPi0MCPtResolPt[iCut] = new TH2F("ESD_TruePrimaryPi0_MCPt_ResolPt", "ESD_TruePrimaryPi0_ResolPt_MCPt", 500, 0.03, 35, 1000, -1., 1.);
2719  fHistoTruePrimaryPi0MCPtResolPt[iCut]->SetXTitle("p_{T, MC} (GeV/c)");
2720  fHistoTruePrimaryPi0MCPtResolPt[iCut]->SetXTitle("#delta (p_{T}) (GeV/c)");
2721  fHistoTruePrimaryPi0MCPtResolPt[iCut]->Sumw2();
2723  fTrueList[iCut]->Add(fHistoTruePrimaryPi0MCPtResolPt[iCut]);
2724  fHistoTruePrimaryEtaMCPtResolPt[iCut] = new TH2F("ESD_TruePrimaryEta_MCPt_ResolPt", "ESD_TruePrimaryEta_ResolPt_MCPt", 500, 0.03, 35, 1000, -1., 1.);
2725  fHistoTruePrimaryEtaMCPtResolPt[iCut]->SetXTitle("p_{T, MC} (GeV/c)");
2726  fHistoTruePrimaryEtaMCPtResolPt[iCut]->SetXTitle("#delta (p_{T}) (GeV/c)");
2727  fHistoTruePrimaryEtaMCPtResolPt[iCut]->Sumw2();
2729  fTrueList[iCut]->Add(fHistoTruePrimaryEtaMCPtResolPt[iCut]);
2730  fHistoTrueK0sWithPi0DaughterMCPt[iCut] = new TH1F("ESD_TrueK0sWithPi0Daughter_MCPt", "ESD_TrueK0sWithPi0Daughter_MCPt", nBinsPt, arrPtBinning);
2731  fHistoTrueK0sWithPi0DaughterMCPt[iCut]->SetXTitle("p_{T, MC} (GeV/c)");
2732  fTrueList[iCut]->Add(fHistoTrueK0sWithPi0DaughterMCPt[iCut]);
2733  fHistoTrueK0lWithPi0DaughterMCPt[iCut] = new TH1F("ESD_TrueK0lWithPi0Daughter_MCPt", "ESD_TrueK0lWithPi0Daughter_MCPt", nBinsPt, arrPtBinning);
2734  fHistoTrueK0lWithPi0DaughterMCPt[iCut]->SetXTitle("p_{T, MC} (GeV/c)");
2735  fTrueList[iCut]->Add(fHistoTrueK0lWithPi0DaughterMCPt[iCut]);
2736  fHistoTrueEtaWithPi0DaughterMCPt[iCut] = new TH1F("ESD_TrueEtaWithPi0Daughter_MCPt", "ESD_TrueEtaWithPi0Daughter_MCPt", nBinsPt, arrPtBinning);
2737  fHistoTrueEtaWithPi0DaughterMCPt[iCut]->SetXTitle("p_{T, MC} (GeV/c)");
2738  fTrueList[iCut]->Add(fHistoTrueEtaWithPi0DaughterMCPt[iCut]);
2739  fHistoTrueLambdaWithPi0DaughterMCPt[iCut] = new TH1F("ESD_TrueLambdaWithPi0Daughter_MCPt", "ESD_TrueLambdaWithPi0Daughter_MCPt", nBinsPt, arrPtBinning);
2740  fHistoTrueLambdaWithPi0DaughterMCPt[iCut]->SetXTitle("p_{T, MC} (GeV/c)");
2742  }
2743 
2744  fHistoTruePi0PtY[iCut] = new TH2F("ESD_TruePi0_Pt_Y", "ESD_TruePi0_Pt_Y", nBinsQAPt, arrQAPtBinning, 150, -1.5, 1.5);
2745  fHistoTruePi0PtY[iCut]->SetXTitle("p_{T} (GeV/c)");
2746  fHistoTruePi0PtY[iCut]->SetYTitle("y");
2747  fTrueList[iCut]->Add(fHistoTruePi0PtY[iCut]);
2748  fHistoTrueEtaPtY[iCut] = new TH2F("ESD_TrueEta_Pt_Y", "ESD_TrueEta_Pt_Y", nBinsQAPt, arrQAPtBinning, 150, -1.5, 1.5);
2749  fHistoTrueEtaPtY[iCut]->SetXTitle("p_{T} (GeV/c)");
2750  fHistoTrueEtaPtY[iCut]->SetYTitle("y");
2751  fTrueList[iCut]->Add(fHistoTrueEtaPtY[iCut]);
2752  fHistoTruePi0PtAlpha[iCut] = new TH2F("ESD_TruePi0_Pt_Alpha", "ESD_TruePi0_Pt_Alpha", nBinsQAPt, arrQAPtBinning, 100, 0, 1);
2753  fHistoTruePi0PtAlpha[iCut]->SetXTitle("p_{T} (GeV/c)");
2754  fHistoTruePi0PtAlpha[iCut]->SetYTitle("#alpha");
2755  fTrueList[iCut]->Add(fHistoTruePi0PtAlpha[iCut]);
2756  fHistoTrueEtaPtAlpha[iCut] = new TH2F("ESD_TrueEta_Pt_Alpha", "ESD_TrueEta_Pt_Alpha", nBinsQAPt, arrQAPtBinning, 100, 0, 1);
2757  fHistoTrueEtaPtAlpha[iCut]->SetXTitle("p_{T} (GeV/c)");
2758  fHistoTrueEtaPtAlpha[iCut]->SetYTitle("#alpha");
2759  fTrueList[iCut]->Add(fHistoTrueEtaPtAlpha[iCut]);
2760 
2761  fHistoTruePi0PtOpenAngle[iCut] = new TH2F("ESD_TruePi0_Pt_OpenAngle", "ESD_TruePi0_Pt_OpenAngle", nBinsQAPt, arrQAPtBinning, 100, 0, 0.5);
2762  fHistoTruePi0PtOpenAngle[iCut]->SetXTitle("p_{T} (GeV/c)");
2763  fHistoTruePi0PtOpenAngle[iCut]->SetYTitle("#theta");
2764  fTrueList[iCut]->Add(fHistoTruePi0PtOpenAngle[iCut]);
2765  fHistoTrueEtaPtOpenAngle[iCut] = new TH2F("ESD_TrueEta_Pt_OpenAngle", "ESD_TrueEta_Pt_OpenAngle", nBinsQAPt, arrQAPtBinning, 180, 0, 1.8);
2766  fHistoTrueEtaPtOpenAngle[iCut]->SetXTitle("p_{T} (GeV/c)");
2767  fHistoTrueEtaPtOpenAngle[iCut]->SetYTitle("#theta");
2768  fTrueList[iCut]->Add(fHistoTrueEtaPtOpenAngle[iCut]);
2769 
2770  fHistoTrueBckGGInvMassPt[iCut] = new TH2F("ESD_TrueBckGG_InvMass_Pt", "ESD_TrueBckGG_InvMass_Pt", 800, 0, 0.8, nBinsPt, arrPtBinning);
2771  fHistoTrueBckGGInvMassPt[iCut]->SetYTitle("p_{T} (GeV/c)");
2772  fHistoTrueBckGGInvMassPt[iCut]->SetXTitle("M_{#gamma#gamma} (GeV/c^{2})");
2773  fTrueList[iCut]->Add(fHistoTrueBckGGInvMassPt[iCut]);
2774  fHistoTrueBckFullMesonContainedInOneClusterInvMassPt[iCut] = new TH2F("ESD_TrueBckFullMesonContained_InvMass_Pt", "ESD_TrueBckFullMesonContained_InvMass_Pt", 800, 0, 0.8, nBinsPt, arrPtBinning);
2775  fHistoTrueBckFullMesonContainedInOneClusterInvMassPt[iCut]->SetYTitle("p_{T} (GeV/c)");
2776  fHistoTrueBckFullMesonContainedInOneClusterInvMassPt[iCut]->SetXTitle("M_{#gamma#gamma} (GeV/c^{2})");
2778  fHistoTrueBckAsymEClustersInvMassPt[iCut] = new TH2F("ESD_TrueBckAsymEClus_InvMass_Pt", "ESD_TrueBckAsymEClus_InvMass_Pt", 800, 0, 0.8, nBinsPt, arrPtBinning);
2779  fHistoTrueBckAsymEClustersInvMassPt[iCut]->SetYTitle("p_{T} (GeV/c)");
2780  fHistoTrueBckAsymEClustersInvMassPt[iCut]->SetXTitle("M_{#gamma#gamma} (GeV/c^{2})");
2782  fHistoTrueBckContInvMassPt[iCut] = new TH2F("ESD_TrueBckCont_InvMass_Pt", "ESD_TrueBckCont_InvMass_Pt", 800, 0, 0.8, nBinsPt, arrPtBinning);
2783  fHistoTrueBckContInvMassPt[iCut]->SetYTitle("p_{T} (GeV/c)");
2784  fHistoTrueBckContInvMassPt[iCut]->SetXTitle("M_{#gamma#gamma} (GeV/c^{2})");
2785  fTrueList[iCut]->Add(fHistoTrueBckContInvMassPt[iCut]);
2786 
2787  if (fIsMC > 1){
2788  fHistoTruePi0PtY[iCut]->Sumw2();
2789  fHistoTrueEtaPtY[iCut]->Sumw2();
2790  fHistoTruePi0PtAlpha[iCut]->Sumw2();
2791  fHistoTrueEtaPtAlpha[iCut]->Sumw2();
2792  fHistoTruePi0PtOpenAngle[iCut]->Sumw2();
2793  fHistoTrueEtaPtOpenAngle[iCut]->Sumw2();
2794  fHistoTrueBckGGInvMassPt[iCut]->Sumw2();
2796  fHistoTrueBckAsymEClustersInvMassPt[iCut]->Sumw2();
2797  fHistoTrueBckContInvMassPt[iCut]->Sumw2();
2798  }
2799 
2800  }
2801 
2802  if (fDoMesonQA == 2 && fIsMC < 2){
2803  fHistoTruePi0Category1[iCut] = new TH2F("ESD_TruePi0Category1_InvMass_Pt", "ESD_TruePi0Category1_InvMass_Pt", 800, 0, 0.8, nBinsPt, arrPtBinning);
2804  fHistoTruePi0Category1[iCut]->SetYTitle("p_{T} (GeV/c)");
2805  fHistoTruePi0Category1[iCut]->SetXTitle("M_{#gamma#gamma} (GeV/c^{2})");
2806  fTrueList[iCut]->Add(fHistoTruePi0Category1[iCut]);
2807  fHistoTrueEtaCategory1[iCut] = new TH2F("ESD_TrueEtaCategory1_InvMass_Pt", "ESD_TrueEtaCategory1_InvMass_Pt", 800, 0, 0.8, nBinsPt, arrPtBinning);
2808  fHistoTrueEtaCategory1[iCut]->SetYTitle("p_{T} (GeV/c)");
2809  fHistoTrueEtaCategory1[iCut]->SetXTitle("M_{#gamma#gamma} (GeV/c^{2})");
2810  fTrueList[iCut]->Add(fHistoTrueEtaCategory1[iCut]);
2811  fHistoTruePi0Category2[iCut] = new TH2F("ESD_TruePi0Category2_InvMass_Pt", "ESD_TruePi0Category2_InvMass_Pt", 800, 0, 0.8, nBinsPt, arrPtBinning);
2812  fHistoTruePi0Category2[iCut]->SetYTitle("p_{T} (GeV/c)");
2813  fHistoTruePi0Category2[iCut]->SetXTitle("M_{#gamma#gamma} (GeV/c^{2})");
2814  fTrueList[iCut]->Add(fHistoTruePi0Category2[iCut]);
2815  fHistoTrueEtaCategory2[iCut] = new TH2F("ESD_TrueEtaCategory2_InvMass_Pt", "ESD_TrueEtaCategory2_InvMass_Pt", 800, 0, 0.8, nBinsPt, arrPtBinning);
2816  fHistoTrueEtaCategory2[iCut]->SetYTitle("p_{T} (GeV/c)");
2817  fHistoTrueEtaCategory2[iCut]->SetXTitle("M_{#gamma#gamma} (GeV/c^{2})");
2818  fTrueList[iCut]->Add(fHistoTrueEtaCategory2[iCut]);
2819  fHistoTruePi0Category3[iCut] = new TH2F("ESD_TruePi0Category3_InvMass_Pt", "ESD_TruePi0Category3_InvMass_Pt", 800, 0, 0.8, nBinsPt, arrPtBinning);
2820  fHistoTruePi0Category3[iCut]->SetYTitle("p_{T} (GeV/c)");
2821  fHistoTruePi0Category3[iCut]->SetXTitle("M_{#gamma#gamma} (GeV/c^{2})");
2822  fTrueList[iCut]->Add(fHistoTruePi0Category3[iCut]);
2823  fHistoTrueEtaCategory3[iCut] = new TH2F("ESD_TrueEtaCategory3_InvMass_Pt", "ESD_TrueEtaCategory3_InvMass_Pt", 800, 0, 0.8, nBinsPt, arrPtBinning);
2824  fHistoTrueEtaCategory3[iCut]->SetYTitle("p_{T} (GeV/c)");
2825  fHistoTrueEtaCategory3[iCut]->SetXTitle("M_{#gamma#gamma} (GeV/c^{2})");
2826  fTrueList[iCut]->Add(fHistoTrueEtaCategory3[iCut]);
2827  fHistoTruePi0Category4_6[iCut] = new TH2F("ESD_TruePi0Category4_6_InvMass_Pt", "ESD_TruePi0Category4_6_InvMass_Pt", 800, 0, 0.8, nBinsPt, arrPtBinning);
2828  fHistoTruePi0Category4_6[iCut]->SetYTitle("p_{T} (GeV/c)");
2829  fHistoTruePi0Category4_6[iCut]->SetXTitle("M_{#gamma#gamma} (GeV/c^{2})");
2830  fTrueList[iCut]->Add(fHistoTruePi0Category4_6[iCut]);
2831  fHistoTrueEtaCategory4_6[iCut] = new TH2F("ESD_TrueEtaCategory4_6_InvMass_Pt", "ESD_TrueEtaCategory4_6_InvMass_Pt", 800, 0, 0.8, nBinsPt, arrPtBinning);
2832  fHistoTrueEtaCategory4_6[iCut]->SetYTitle("p_{T} (GeV/c)");
2833  fHistoTrueEtaCategory4_6[iCut]->SetXTitle("M_{#gamma#gamma} (GeV/c^{2})");
2834  fTrueList[iCut]->Add(fHistoTrueEtaCategory4_6[iCut]);
2835  fHistoTruePi0Category5[iCut] = new TH2F("ESD_TruePi0Category5_InvMass_Pt", "ESD_TruePi0Category5_InvMass_Pt", 800, 0, 0.8, nBinsPt, arrPtBinning);
2836  fHistoTruePi0Category5[iCut]->SetYTitle("p_{T} (GeV/c)");
2837  fHistoTruePi0Category5[iCut]->SetXTitle("M_{#gamma#gamma} (GeV/c^{2})");
2838  fTrueList[iCut]->Add(fHistoTruePi0Category5[iCut]);
2839  fHistoTrueEtaCategory5[iCut] = new TH2F("ESD_TrueEtaCategory5_InvMass_Pt", "ESD_TrueEtaCategory5_InvMass_Pt", 800, 0, 0.8, nBinsPt, arrPtBinning);
2840  fHistoTrueEtaCategory5[iCut]->SetYTitle("p_{T} (GeV/c)");
2841  fHistoTrueEtaCategory5[iCut]->SetXTitle("M_{#gamma#gamma} (GeV/c^{2})");
2842  fTrueList[iCut]->Add(fHistoTrueEtaCategory5[iCut]);
2843  fHistoTruePi0Category7[iCut] = new TH2F("ESD_TruePi0Category7_InvMass_Pt", "ESD_TruePi0Category7_InvMass_Pt", 800, 0, 0.8, nBinsPt, arrPtBinning);
2844  fHistoTruePi0Category7[iCut]->SetYTitle("p_{T} (GeV/c)");
2845  fHistoTruePi0Category7[iCut]->SetXTitle("M_{#gamma#gamma} (GeV/c^{2})");
2846  fTrueList[iCut]->Add(fHistoTruePi0Category7[iCut]);
2847  fHistoTrueEtaCategory7[iCut] = new TH2F("ESD_TrueEtaCategory7_InvMass_Pt", "ESD_TrueEtaCategory7_InvMass_Pt", 800, 0, 0.8, nBinsPt, arrPtBinning);
2848  fHistoTrueEtaCategory7[iCut]->SetYTitle("p_{T} (GeV/c)");
2849  fHistoTrueEtaCategory7[iCut]->SetXTitle("M_{#gamma#gamma} (GeV/c^{2})");
2850  fTrueList[iCut]->Add(fHistoTrueEtaCategory7[iCut]);
2851  fHistoTruePi0Category8[iCut] = new TH2F("ESD_TruePi0Category8_InvMass_Pt", "ESD_TruePi0Category8_InvMass_Pt", 800, 0, 0.8, nBinsPt, arrPtBinning);
2852  fHistoTruePi0Category8[iCut]->SetYTitle("p_{T} (GeV/c)");
2853  fHistoTruePi0Category8[iCut]->SetXTitle("M_{#gamma#gamma} (GeV/c^{2})");
2854  fTrueList[iCut]->Add(fHistoTruePi0Category8[iCut]);
2855  fHistoTrueEtaCategory8[iCut] = new TH2F("ESD_TrueEtaCategory8_InvMass_Pt", "ESD_TrueEtaCategory8_InvMass_Pt", 800, 0, 0.8, nBinsPt, arrPtBinning);
2856  fHistoTrueEtaCategory8[iCut]->SetYTitle("p_{T} (GeV/c)");
2857  fHistoTrueEtaCategory8[iCut]->SetXTitle("M_{#gamma#gamma} (GeV/c^{2})");
2858  fTrueList[iCut]->Add(fHistoTrueEtaCategory8[iCut]);
2859  }
2860 
2861  if (fDoMesonQA == 3){
2862  fTreeList[iCut] = new TList();
2863  fTreeList[iCut]->SetName(Form("%s_%s_%s True ClusterComb tree", cutstringEvent.Data(), cutstringCalo.Data(), cutstringMeson.Data()));
2864  fTreeList[iCut]->SetOwner(kTRUE);
2865  fCutFolder[iCut]->Add(fTreeList[iCut]);
2866 
2867  tTrueInvMassROpenABPtFlag[iCut] = new TTree("True_InvMass_R_OpenA_OpenB_Pt_Flag", "True_InvMass_R_OpenA_OpenB_Pt_Flag");
2868  tTrueInvMassROpenABPtFlag[iCut]->Branch("InvMass",&fInvMass,"fInvMass/F");
2869  tTrueInvMassROpenABPtFlag[iCut]->Branch("RConv",&fRconv,"fRconv/F");
2870  tTrueInvMassROpenABPtFlag[iCut]->Branch("OpenAngleRPrimVtx",&fOpenRPrim,"fOpenRPrim/F");
2871  tTrueInvMassROpenABPtFlag[iCut]->Branch("InvMassRTOF",&fInvMassRTOF,"fInvMassRTOF/F");
2872  tTrueInvMassROpenABPtFlag[iCut]->Branch("Pt",&fPt,"fPt/F");
2873 // tTrueInvMassROpenABPtFlag[iCut]->Branch("Weight",&fWeightJetJetMC,"fWeightJetJetMC/F");
2874  tTrueInvMassROpenABPtFlag[iCut]->Branch("cat",&iFlag,"iFlag/b");
2875  fTreeList[iCut]->Add(tTrueInvMassROpenABPtFlag[iCut]);
2876  }
2877  }
2878  }
2879  }
2880 
2885 
2887 
2888  if(fV0Reader)
2890  if(((AliConversionPhotonCuts*)fV0Reader->GetConversionCuts())->GetCutHistograms())
2891  fOutputContainer->Add(((AliConversionPhotonCuts*)fV0Reader->GetConversionCuts())->GetCutHistograms());
2892  if(fV0Reader)
2894  if(((AliConvEventCuts*)fV0Reader->GetEventCuts())->GetCutHistograms())
2895  fOutputContainer->Add(((AliConvEventCuts*)fV0Reader->GetEventCuts())->GetCutHistograms());
2896 
2897  for(Int_t iMatcherTask = 0; iMatcherTask < 3; iMatcherTask++){
2898  AliCaloTrackMatcher* temp = (AliCaloTrackMatcher*) (AliAnalysisManager::GetAnalysisManager()->GetTask(Form("CaloTrackMatcher_%i_%i",iMatcherTask,fTrackMatcherRunningMode)));
2899  if(temp) fOutputContainer->Add(temp->GetCaloTrackMatcherHistograms());
2900  }
2901  AliPhotonIsolation* temp2 = (AliPhotonIsolation*)AliAnalysisManager::GetAnalysisManager()->GetTask("PhotonIsolation");
2902  if(temp2) fOutputContainer->Add(temp2->GetPhotonIsolationHistograms());
2903 
2904 
2905  for(Int_t iCut = 0; iCut<fnCuts;iCut++){
2906  if(!((AliConvEventCuts*)fEventCutArray->At(iCut))) continue;
2907  if(((AliConvEventCuts*)fEventCutArray->At(iCut))->GetCutHistograms()){
2908  fCutFolder[iCut]->Add(((AliConvEventCuts*)fEventCutArray->At(iCut))->GetCutHistograms());
2909  }
2910  if(!((AliCaloPhotonCuts*)fClusterCutArray->At(iCut))) continue;
2911  if(((AliCaloPhotonCuts*)fClusterCutArray->At(iCut))->GetCutHistograms()){
2912  fCutFolder[iCut]->Add(((AliCaloPhotonCuts*)fClusterCutArray->At(iCut))->GetCutHistograms());
2913  }
2914  if(fSetPlotHistsExtQA){
2915  if(!((AliCaloPhotonCuts*)fClusterCutArray->At(iCut))) continue;
2916  if(((AliCaloPhotonCuts*)fClusterCutArray->At(iCut))->GetExtQAHistograms()){
2917  fCutFolder[iCut]->Add(((AliCaloPhotonCuts*)fClusterCutArray->At(iCut))->GetExtQAHistograms());
2918  }
2919  }
2920  if(fDoMesonAnalysis){
2921  if(!((AliConversionMesonCuts*)fMesonCutArray->At(iCut))) continue;
2922  if(((AliConversionMesonCuts*)fMesonCutArray->At(iCut))->GetCutHistograms()){
2923  fCutFolder[iCut]->Add(((AliConversionMesonCuts*)fMesonCutArray->At(iCut))->GetCutHistograms());
2924  }
2925  }
2926  if(fDoJetAnalysis){
2927  fCutFolder[iCut]->Add(fJetHistograms[iCut]);
2928  }
2929  }
2930 
2931  if (fIsMC > 0 ){
2932  tBrokenFiles = new TTree("BrokenFiles", "BrokenFiles");
2933  tBrokenFiles->Branch("fileName",&fFileNameBroken);
2935  }
2936  if (fDoClusterQA > 1){
2937  tClusterQATree = new TTree("ClusterQATree", "ClusterQATree");
2938  tClusterQATree->Branch("closeHighPtClusters",&fCloseHighPtClusters);
2940  }
2941 
2942  if(fLocalDebugFlag > 0){
2943  fstream fOutputLocalDebug;
2944  fOutputLocalDebug.open("debugOutput.txt",ios::out);
2945  fOutputLocalDebug.close();
2946  }
2947 
2948  PostData(1, fOutputContainer);
2949 }
2950 //_____________________________________________________________________________
2952 {
2953  for(Int_t iCut = 0; iCut<fnCuts;iCut++){
2954  if (((AliConvEventCuts*)fEventCutArray->At(iCut))->GetPeriodEnum() == AliConvEventCuts::kNoPeriod && ((AliConvEventCuts*)fV0Reader->GetEventCuts())->GetPeriodEnum() != AliConvEventCuts::kNoPeriod){
2955  ((AliConvEventCuts*)fEventCutArray->At(iCut))->SetPeriodEnumExplicit(((AliConvEventCuts*)fV0Reader->GetEventCuts())->GetPeriodEnum());
2956  } else if (((AliConvEventCuts*)fEventCutArray->At(iCut))->GetPeriodEnum() == AliConvEventCuts::kNoPeriod ){
2957  ((AliConvEventCuts*)fEventCutArray->At(iCut))->SetPeriodEnum(fV0Reader->GetPeriodName());
2958  }
2959  if(fIsHeavyIon==2) {
2960  if(!((AliConvEventCuts*)fEventCutArray->At(iCut))->GetDoEtaShift()){
2961  fProfileEtaShift[iCut]->Fill(0.,(((AliConvEventCuts*)fEventCutArray->At(iCut))->GetEtaShift()));
2962  continue; // No Eta Shift requested, continue
2963  }
2964  if(((AliConvEventCuts*)fEventCutArray->At(iCut))->GetEtaShift() == 0.0){ // Eta Shift requested but not set, get shift automatically
2965  ((AliConvEventCuts*)fEventCutArray->At(iCut))->GetCorrectEtaShiftFromPeriod();
2966  fProfileEtaShift[iCut]->Fill(0.,(((AliConvEventCuts*)fEventCutArray->At(iCut))->GetEtaShift()));
2967  ((AliConvEventCuts*)fEventCutArray->At(iCut))->DoEtaShift(kFALSE); // Eta Shift Set, make sure that it is called only once
2968  continue;
2969  }
2970  else{
2971  printf(" Gamma Conversion Task %s :: Eta Shift Manually Set to %f \n\n",
2972  (((AliConvEventCuts*)fEventCutArray->At(iCut))->GetCutNumber()).Data(),((AliConvEventCuts*)fEventCutArray->At(iCut))->GetEtaShift());
2973  fProfileEtaShift[iCut]->Fill(0.,(((AliConvEventCuts*)fEventCutArray->At(iCut))->GetEtaShift()));
2974  ((AliConvEventCuts*)fEventCutArray->At(iCut))->DoEtaShift(kFALSE); // Eta Shift Set, make sure that it is called only once
2975  }
2976  }
2977  }
2978 
2979  return kTRUE;
2980 }
2981 //_____________________________________________________________________________
2983 {
2984  //
2985  // Called for each event
2986  //
2987  fInputEvent = InputEvent();
2988  fCloseHighPtClusters = 0x0;
2989  if(fIsMC> 0) fMCEvent = MCEvent();
2990 
2991  Int_t eventQuality = ((AliConvEventCuts*)fV0Reader->GetEventCuts())->GetEventQuality();
2992 
2993  if(fInputEvent->IsIncompleteDAQ()==kTRUE) eventQuality = 2; // incomplete event
2994  if(eventQuality == 2 || eventQuality == 3){// Event Not Accepted due to MC event missing or wrong trigger for V0ReaderV1 or because it is incomplete
2995  // write out name of broken file for first event
2996  if (fIsMC > 0){
2997  if (fInputEvent->IsA()==AliESDEvent::Class()){
2998  if (((AliESDEvent*)fInputEvent)->GetEventNumberInFile() == 0){
2999  fFileNameBroken = new TObjString(Form("%s", ((TString)fV0Reader->GetCurrentFileName()).Data()));
3000  if (tBrokenFiles) tBrokenFiles->Fill();
3001  delete fFileNameBroken;
3002  }
3003  }
3004  }
3005 
3006  for(Int_t iCut = 0; iCut<fnCuts; iCut++){
3007  fHistoNEvents[iCut]->Fill(eventQuality);
3008  if (fIsMC>1) fHistoNEventsWOWeight[iCut]->Fill(eventQuality);
3009  }
3010  return;
3011  }
3012 
3013  // ------------------- BeginEvent ----------------------------
3014 
3015  AliEventplane *EventPlane = fInputEvent->GetEventplane();
3016  if(fIsHeavyIon ==1)fEventPlaneAngle = EventPlane->GetEventplane("V0",fInputEvent,2);
3017  else fEventPlaneAngle=0.0;
3018 
3019  for(Int_t iCut = 0; iCut<fnCuts; iCut++){
3020 
3021  fiCut = iCut;
3022 
3024  Bool_t isRunningEMCALrelAna = kFALSE;
3025  if (((AliCaloPhotonCuts*)fClusterCutArray->At(fiCut))->GetClusterType() == 1) isRunningEMCALrelAna = kTRUE;
3026 
3027  Int_t eventNotAccepted = ((AliConvEventCuts*)fEventCutArray->At(iCut))->IsEventAcceptedByCut(fV0Reader->GetEventCuts(),fInputEvent,fMCEvent,fIsHeavyIon, isRunningEMCALrelAna);
3028 
3029  if(fIsMC==2){
3030  Float_t xsection = -1.;
3031  Float_t ntrials = -1.;
3032  ((AliConvEventCuts*)fEventCutArray->At(iCut))->GetXSectionAndNTrials(fMCEvent,xsection,ntrials, fInputEvent );
3033  if((xsection==-1.) || (ntrials==-1.)) AliFatal(Form("ERROR: GetXSectionAndNTrials returned invalid xsection/ntrials, periodName from V0Reader: '%s'",fV0Reader->GetPeriodName().Data()));
3034  fProfileJetJetXSection[iCut]->Fill(0.,xsection);
3035  fHistoJetJetNTrials[iCut]->Fill("#sum{NTrials}", ntrials);
3036  }
3037 
3038  if (fIsMC > 0){
3039  fWeightJetJetMC = 1;
3040  Bool_t isMCJet = ((AliConvEventCuts*)fEventCutArray->At(iCut))->IsJetJetMCEventAccepted( fMCEvent, fWeightJetJetMC , fInputEvent);
3041  if (fIsMC == 3){
3042  Double_t weightMult = ((AliConvEventCuts*)fEventCutArray->At(iCut))->GetWeightForMultiplicity(fV0Reader->GetNumberOfPrimaryTracks());
3043  fWeightJetJetMC = fWeightJetJetMC*weightMult;
3044  }
3045 
3046  if (!isMCJet){
3047  fHistoNEvents[iCut]->Fill(10,fWeightJetJetMC);
3048  if (fIsMC>1) fHistoNEventsWOWeight[iCut]->Fill(10);
3049  continue;
3050  }
3051  }
3052 
3053  Bool_t triggered = kTRUE;
3054  if(eventNotAccepted!= 0){
3055  fHistoNEvents[iCut]->Fill(eventNotAccepted, fWeightJetJetMC); // Check Centrality, PileUp, SDD and V0AND --> Not Accepted => eventQuality = 1
3056  if (fIsMC>1) fHistoNEventsWOWeight[iCut]->Fill(eventNotAccepted);
3057  // cout << "event rejected due to wrong trigger: " <<eventNotAccepted << endl;
3058  if (eventNotAccepted==3 && fIsMC > 0){
3059  triggered = kFALSE;
3060  }else {
3061  continue;
3062  }
3063  }
3064 
3065  if(eventQuality != 0 && triggered== kTRUE){// Event Not Accepted
3066  //cout << "event rejected due to: " <<eventQuality << endl;
3067  fHistoNEvents[iCut]->Fill(eventQuality, fWeightJetJetMC);
3068  if (fIsMC>1) fHistoNEventsWOWeight[iCut]->Fill(eventQuality); // Should be 0 here
3069  continue;
3070  }
3071  if (triggered == kTRUE) {
3072  if(((AliConvEventCuts*)fEventCutArray->At(iCut))->GetUseSphericity()!=0){
3073  if(fV0Reader->GetSphericity() != -1 && fV0Reader->GetSphericity() != 0){
3075  if(fConvJetReader->GetNJets() > 0){
3076  fHistoNEvents[iCut]->Fill(eventQuality, fWeightJetJetMC); // Should be 0 here
3077  if (fIsMC>1) fHistoNEventsWOWeight[iCut]->Fill(eventQuality); // Should be 0 here
3079  fHistoVertexZ[iCut]->Fill(fInputEvent->GetPrimaryVertex()->GetZ(), fWeightJetJetMC);
3082  }
3083  }else if(fDoJetAnalysis && fDoSoftAnalysis){
3084  if(fConvJetReader->GetNJets() < 1){
3085  fHistoNEvents[iCut]->Fill(eventQuality, fWeightJetJetMC); // Should be 0 here
3086  if (fIsMC>1) fHistoNEventsWOWeight[iCut]->Fill(eventQuality); // Should be 0 here
3088  fHistoVertexZ[iCut]->Fill(fInputEvent->GetPrimaryVertex()->GetZ(), fWeightJetJetMC);
3091  }
3092  }else{
3093  fHistoNEvents[iCut]->Fill(eventQuality, fWeightJetJetMC); // Should be 0 here
3094  if (fIsMC>1) fHistoNEventsWOWeight[iCut]->Fill(eventQuality); // Should be 0 here
3096  fHistoVertexZ[iCut]->Fill(fInputEvent->GetPrimaryVertex()->GetZ(), fWeightJetJetMC);
3099  }
3100  }
3101  }else{
3102  fHistoNEvents[iCut]->Fill(eventQuality, fWeightJetJetMC); // Should be 0 here
3103  if (fIsMC>1) fHistoNEventsWOWeight[iCut]->Fill(eventQuality); // Should be 0 here
3105  fHistoVertexZ[iCut]->Fill(fInputEvent->GetPrimaryVertex()->GetZ(), fWeightJetJetMC);
3106  }
3107  if(!fDoLightOutput){
3108  fHistoSPDClusterTrackletBackground[iCut]->Fill(fInputEvent->GetMultiplicity()->GetNumberOfTracklets(),(fInputEvent->GetNumberOfITSClusters(0)+fInputEvent->GetNumberOfITSClusters(1)), fWeightJetJetMC);
3109  if(((AliConvEventCuts*)fEventCutArray->At(iCut))->IsHeavyIon() == 2) fHistoNV0Tracks[iCut]->Fill(fInputEvent->GetVZEROData()->GetMTotV0A(), fWeightJetJetMC);
3110  else fHistoNV0Tracks[iCut]->Fill(fInputEvent->GetVZEROData()->GetMTotV0A()+fInputEvent->GetVZEROData()->GetMTotV0C(), fWeightJetJetMC);
3111  }
3112  }
3113  if(fIsMC> 0){
3114  // Process MC Particle
3115  if(((AliConvEventCuts*)fEventCutArray->At(iCut))->GetSignalRejection() != 0){
3116  if(fInputEvent->IsA()==AliESDEvent::Class()){
3117  ((AliConvEventCuts*)fEventCutArray->At(iCut))->GetNotRejectedParticles(((AliConvEventCuts*)fEventCutArray->At(iCut))->GetSignalRejection(),
3118  ((AliConvEventCuts*)fEventCutArray->At(iCut))->GetAcceptedHeader(),
3119  fMCEvent);
3120  }
3121  else if(fInputEvent->IsA()==AliAODEvent::Class()){
3122  ((AliConvEventCuts*)fEventCutArray->At(iCut))->GetNotRejectedParticles(((AliConvEventCuts*)fEventCutArray->At(iCut))->GetSignalRejection(),
3123  ((AliConvEventCuts*)fEventCutArray->At(iCut))->GetAcceptedHeader(),
3124  fInputEvent);
3125  }
3126 
3127  if(!fDoLightOutput){
3128  if(((AliConvEventCuts*)fEventCutArray->At(iCut))->GetAcceptedHeader()){
3129  for(Int_t i = 0;i<(((AliConvEventCuts*)fEventCutArray->At(iCut))->GetAcceptedHeader())->GetEntries();i++){
3130  TString nameBin= fHistoMCHeaders[iCut]->GetXaxis()->GetBinLabel(i+1);
3131  if (nameBin.CompareTo("")== 0){
3132  TString nameHeader = ((TObjString*)((TList*)((AliConvEventCuts*)fEventCutArray->At(iCut))
3133  ->GetAcceptedHeader())->At(i))->GetString();
3134  fHistoMCHeaders[iCut]->GetXaxis()->SetBinLabel(i+1,nameHeader.Data());
3135  }
3136  }
3137  }
3138  }
3139  }
3140  }
3141  if(fIsMC> 0){
3142  if(fInputEvent->IsA()==AliESDEvent::Class())
3144  if(fInputEvent->IsA()==AliAODEvent::Class())
3146  }
3147 
3148  if (triggered==kFALSE) continue;
3149 
3150  // it is in the loop to have the same conversion cut string (used also for MC stuff that should be same for V0 and Cluster)
3151  ProcessClusters(); // process calo clusters
3153 
3155 
3156  fHistoNGammaCandidates[iCut]->Fill(fClusterCandidates->GetEntries(), fWeightJetJetMC);
3158  if(fDoMesonAnalysis){ // Meson Analysis
3159 
3160  // CalculatePi0Candidates(); // Combine Gammas from conversion and from calo
3162  if(((AliConversionMesonCuts*)fMesonCutArray->At(iCut))->DoBGCalculation()){
3163  if(((AliConversionMesonCuts*)fMesonCutArray->At(iCut))->BackgroundHandlerType() == 0){
3164  //CalculateBackground(); // Combinatorial Background
3165  CalculateBackgroundIsolation(); // Combinatorial Background for Isolation Method
3166  UpdateEventByEventData(); // Store Event for mixed Events
3167  }
3168 
3169  }
3172  }
3173 
3174  if(fIsMC> 0){
3178  }
3179 
3180  fIsoCandidates->Clear();
3181  fClusterCandidates->Clear(); // delete cluster candidates
3182  }
3184 
3185  PostData(1, fOutputContainer);
3186 }
3187 
3188 //________________________________________________________________________
3190 {
3191  Int_t nclus = 0;
3192  TClonesArray * arrClustersProcess = NULL;
3194  if(!fCorrTaskSetting.CompareTo("")){
3195  nclus = fInputEvent->GetNumberOfCaloClusters();
3196  } else {
3197  arrClustersProcess = dynamic_cast<TClonesArray*>(fInputEvent->FindListObject(Form("%sClustersBranch",fCorrTaskSetting.Data())));
3198  if(!arrClustersProcess)
3199  AliFatal(Form("%sClustersBranch was not found in AliAnalysisTaskGammaCaloIso! Check the correction framework settings!",fCorrTaskSetting.Data()));
3200  nclus = arrClustersProcess->GetEntries();
3201  }
3202 
3203  if(nclus == 0) return;
3204  // plotting histograms on cell/tower level, only if extendedMatchAndQA > 1
3205  ((AliCaloPhotonCuts*)fClusterCutArray->At(fiCut))->FillHistogramsExtendedQA(fInputEvent,fIsMC);
3206 
3207  // match tracks to clusters
3208  ((AliCaloPhotonCuts*)fClusterCutArray->At(fiCut))->MatchTracksToClusters(fInputEvent,fWeightJetJetMC,kTRUE, fMCEvent);
3209 
3210  // vertex
3211  Double_t vertex[3] = {0};
3212  InputEvent()->GetPrimaryVertex()->GetXYZ(vertex);
3213 
3214  Int_t totalActiveCells = 0;
3215  Double_t totalCellsinClusters = 0;
3216  Double_t totalUnclusteredE = 0;
3217  if(((AliCaloPhotonCuts*)fClusterCutArray->At(fiCut))->GetDoFlatEnergySubtraction()){
3218  Double_t totalClusterEnergy = 0;
3219  totalActiveCells = ((AliCaloPhotonCuts*)fClusterCutArray->At(fiCut))->GetNactiveEmcalCells();
3220  totalCellsinClusters = 0;
3221  for(Long_t i = 0; i < nclus; i++){
3222  AliVCluster* clus = NULL;
3223  if(fInputEvent->IsA()==AliESDEvent::Class()){
3224  if(arrClustersProcess)
3225  clus = new AliESDCaloCluster(*(AliESDCaloCluster*)arrClustersProcess->At(i));
3226  else
3227  clus = new AliESDCaloCluster(*(AliESDCaloCluster*)fInputEvent->GetCaloCluster(i));
3228  } else if(fInputEvent->IsA()==AliAODEvent::Class()){
3229  if(arrClustersProcess)
3230  clus = new AliAODCaloCluster(*(AliAODCaloCluster*)arrClustersProcess->At(i));
3231  else
3232  clus = new AliAODCaloCluster(*(AliAODCaloCluster*)fInputEvent->GetCaloCluster(i));
3233  }
3234  if(!clus) continue;
3235  totalClusterEnergy += clus->E();
3236  totalCellsinClusters += clus->GetNCells();
3237  delete clus;
3238  }
3239  Double_t totalEDeposit = ((AliCaloPhotonCuts*)fClusterCutArray->At(fiCut))->GetTotalEnergyDeposit(fInputEvent);
3240  totalUnclusteredE = totalEDeposit - totalClusterEnergy;
3241  }
3242 
3243  Double_t maxClusterEnergy = -1;
3244  Int_t maxClusterID = -1;
3245  map<Long_t,Int_t> mapIsClusterAccepted;
3246  map<Long_t,Int_t> mapIsClusterAcceptedWithoutTrackMatch;
3247  // Loop over EMCal clusters
3248  for(Long_t i = 0; i < nclus; i++){
3249  Double_t tempClusterWeight = fWeightJetJetMC;
3250  Double_t tempPhotonWeight = fWeightJetJetMC;
3251  AliVCluster* clus = NULL;
3252  if(fInputEvent->IsA()==AliESDEvent::Class()){
3253  if(arrClustersProcess)
3254  clus = new AliESDCaloCluster(*(AliESDCaloCluster*)arrClustersProcess->At(i));
3255  else
3256  clus = new AliESDCaloCluster(*(AliESDCaloCluster*)fInputEvent->GetCaloCluster(i));
3257  } else if(fInputEvent->IsA()==AliAODEvent::Class()){
3258  if(arrClustersProcess)
3259  clus = new AliAODCaloCluster(*(AliAODCaloCluster*)arrClustersProcess->At(i));
3260  else
3261  clus = new AliAODCaloCluster(*(AliAODCaloCluster*)fInputEvent->GetCaloCluster(i));
3262  }
3263  if(!clus) continue;
3264 
3265  if(((AliCaloPhotonCuts*)fClusterCutArray->At(fiCut))->GetDoFlatEnergySubtraction()){
3266  if(totalUnclusteredE!=0 && totalActiveCells!=0 && totalCellsinClusters!=0){
3267  clus->SetE(clus->E()-(clus->GetNCells()*(totalUnclusteredE)/(totalActiveCells-totalCellsinClusters)));
3268  }
3269  }
3270 
3271  // Set the jetjet weight to 1 in case the cluster orignated from the minimum bias header
3272  if (fIsMC>0 && ((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetSignalRejection() == 4){
3273  if( ((AliConvEventCuts*)fEventCutArray->At(fiCut))->IsParticleFromBGEvent(clus->GetLabelAt(0), fMCEvent, fInputEvent) == 2)
3274  tempClusterWeight = 1;
3275  }
3276 
3277  if(!((AliCaloPhotonCuts*)fClusterCutArray->At(fiCut))->ClusterIsSelected(clus,fInputEvent,fMCEvent,fIsMC, tempClusterWeight,i)){
3278  if(fProduceTreeEOverP && ((AliCaloPhotonCuts*)fClusterCutArray->At(fiCut))->ClusterIsSelectedBeforeTrackMatch() ) mapIsClusterAcceptedWithoutTrackMatch[i] = 1;
3279  if (((AliCaloPhotonCuts*)fClusterCutArray->At(fiCut))->GetIsAcceptedForBasicCounting())fNCurrentClusterBasic++;
3280  delete clus;
3281  continue;
3282  }
3284 
3285  // TLorentzvector with cluster
3286  TLorentzVector clusterVector;
3287  clus->GetMomentum(clusterVector,vertex);
3288 
3289  TLorentzVector* tmpvec = new TLorentzVector();
3290  tmpvec->SetPxPyPzE(clusterVector.Px(),clusterVector.Py(),clusterVector.Pz(),clusterVector.E());
3291 
3292  // convert to AODConversionPhoton
3293  AliAODConversionPhoton *PhotonCandidate=new AliAODConversionPhoton(tmpvec);
3294  if(!PhotonCandidate){ delete clus; delete tmpvec; continue;}
3295 
3296  //determine maximum cluster energy in event
3297  if(fProduceCellIDPlots && (clus->E() > maxClusterEnergy)){
3298  maxClusterEnergy = clus->E();
3299  maxClusterID = (Int_t) i;
3300  }
3302  mapIsClusterAccepted[i] = 1;
3303  mapIsClusterAcceptedWithoutTrackMatch[i] = 1;
3304  }
3305 
3306  // Flag Photon as CaloPhoton
3307  PhotonCandidate->SetIsCaloPhoton();
3308  PhotonCandidate->SetCaloClusterRef(i);
3309  PhotonCandidate->SetLeadingCellID(((AliCaloPhotonCuts*)fClusterCutArray->At(fiCut))->FindLargestCellInCluster(clus,fInputEvent));
3310  // get MC label
3311  if(fIsMC> 0){
3312  Int_t* mclabelsCluster = clus->GetLabels();
3313  PhotonCandidate->SetNCaloPhotonMCLabels(clus->GetNLabels());
3314  // cout << clus->GetNLabels() << endl;
3315  if (clus->GetNLabels()>0){
3316  for (Int_t k =0; k< (Int_t)clus->GetNLabels(); k++){
3317  if (k< 50)PhotonCandidate->SetCaloPhotonMCLabel(k,mclabelsCluster[k]);
3318  // Int_t pdgCode = fMCEvent->Particle(mclabelsCluster[k])->GetPdgCode();
3319  // cout << "label " << k << "\t" << mclabelsCluster[k] << " pdg code: " << pdgCode << endl;
3320  }
3321  }
3322  }
3323 
3324  fIsFromDesiredHeader = kTRUE;
3326  // test whether largest contribution to cluster orginates in added signals
3327  if (fIsMC>0 && ((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetSignalRejection() > 0){
3328  // Set the jetjet weight to 1 in case the photon candidate orignated from the minimum bias header
3329  if ( ((AliConvEventCuts*)fEventCutArray->At(fiCut))->IsParticleFromBGEvent(PhotonCandidate->GetCaloPhotonMCLabel(0), fMCEvent, fInputEvent) == 2 && ((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetSignalRejection() == 4) tempPhotonWeight = 1;
3330  if ( ((AliConvEventCuts*)fEventCutArray->At(fiCut))->IsParticleFromBGEvent(PhotonCandidate->GetCaloPhotonMCLabel(0), fMCEvent, fInputEvent) == 0) fIsFromDesiredHeader = kFALSE;
3331  if (clus->GetNLabels()>1){
3332  Int_t* mclabelsCluster = clus->GetLabels();
3333  if (fLocalDebugFlag > 1) cout << "testing if other labels in cluster belong to different header, need to test " << (Int_t)clus->GetNLabels()-1 << " additional labels" << endl;
3334  for (Int_t l = 1; l < (Int_t)clus->GetNLabels(); l++ ){
3335  if (((AliConvEventCuts*)fEventCutArray->At(fiCut))->IsParticleFromBGEvent(mclabelsCluster[l], fMCEvent, fInputEvent, fLocalDebugFlag) == 0) fIsOverlappingWithOtherHeader = kTRUE;
3336  }
3337  if (fLocalDebugFlag > 1 && fIsOverlappingWithOtherHeader) cout << "found overlapping header: " << endl;
3338  }
3339  }
3340 
3341  fHistoClusAllHeadersGammaPt[fiCut]->Fill(PhotonCandidate->Pt(), tempPhotonWeight);
3342  if (!fIsFromDesiredHeader) fHistoClusRejectedHeadersGammaPt[fiCut]->Fill(PhotonCandidate->Pt(), tempPhotonWeight);
3343  if (fIsFromDesiredHeader && fIsOverlappingWithOtherHeader) fHistoClusOverlapHeadersGammaPt[fiCut]->Fill(PhotonCandidate->Pt(), tempPhotonWeight);
3344 
3345 
3347  fHistoClusGammaPt[fiCut]->Fill(PhotonCandidate->Pt(), tempPhotonWeight);
3348  fHistoClusGammaE[fiCut]->Fill(PhotonCandidate->E(), tempPhotonWeight);
3349  if (!fDoLightOutput && fDoClusterQA > 0) fHistoClusGammaPtM02[fiCut]->Fill(PhotonCandidate->Pt(), clus->GetM02(), tempPhotonWeight);
3350  if(fIsMC> 0){
3351  if(fInputEvent->IsA()==AliESDEvent::Class()){
3352  ProcessTrueClusterCandidates(PhotonCandidate,clus);
3353  } else {
3354  ProcessTrueClusterCandidatesAOD(PhotonCandidate,clus);
3355  }
3356  }
3357 
3358  fClusterCandidates->Add(PhotonCandidate); // if no second loop is required add to events good gammas
3359 
3360  //################################################### Isolation Cut ###########################################################
3361  //if Cluster passes all standard conditions to be selected, then check if it is also isolated and save it in new TList
3362  //Isolationfunction added in AliCaloPhotonCuts
3363 
3364  if(!((AliCaloPhotonCuts*)fClusterCutArray->At(fiCut))->ClusterIsIsolated(i,PhotonCandidate)){//Isolation check
3365  fHistoFailIsolationCut[fiCut]->Fill(PhotonCandidate->Pt(), fWeightJetJetMC);//fill with clusters not passing isolation
3366  continue;
3367  }
3368 
3369  fIsoCandidates->Add(PhotonCandidate);
3370 
3371  fHistoClusterCandidates[fiCut]->Fill(PhotonCandidate->Pt(), fWeightJetJetMC);// fill with isolated clusters
3372  fHistoClusterCandidatesBinning[fiCut]->Fill(PhotonCandidate->Pt(), fWeightJetJetMC);// fill with isolated clusters
3373 
3374 
3375  if(fIsMC>0){
3376  if(fInputEvent->IsA()==AliAODEvent::Class()){
3377  ProcessTrueIsolatedClustersAOD(clus, PhotonCandidate);
3378  }
3379  }
3380 
3381  } else{
3382  delete PhotonCandidate;
3383  }
3384 
3385  delete clus;
3386  delete tmpvec;
3387  }
3388 
3389  if(fProduceCellIDPlots){
3390  for(Long_t i = 0; i < nclus; i++){
3391  if( mapIsClusterAccepted[i] != 1 ) continue;
3392 
3393  AliVCluster* clus = NULL;
3394  if(fInputEvent->IsA()==AliESDEvent::Class()){
3395  if(arrClustersProcess)
3396  clus = new AliESDCaloCluster(*(AliESDCaloCluster*)arrClustersProcess->At(i));
3397  else
3398  clus = new AliESDCaloCluster(*(AliESDCaloCluster*)fInputEvent->GetCaloCluster(i));
3399  } else if(fInputEvent->IsA()==AliAODEvent::Class()){
3400  if(arrClustersProcess)
3401  clus = new AliAODCaloCluster(*(AliAODCaloCluster*)arrClustersProcess->At(i));
3402  else
3403  clus = new AliAODCaloCluster(*(AliAODCaloCluster*)fInputEvent->GetCaloCluster(i));
3404  }
3405 
3406  if(!clus) continue;
3407 
3408  Int_t cellID = ((AliCaloPhotonCuts*)fClusterCutArray->At(fiCut))->FindLargestCellInCluster(clus,fInputEvent);
3409  fHistCellIDvsClusterEnergy[fiCut]->Fill(clus->E(),cellID);
3410  if (maxClusterID == i && maxClusterID > -1 ) fHistCellIDvsClusterEnergyMax[fiCut]->Fill(maxClusterEnergy,cellID);
3411  delete clus;
3412  }
3413  }
3414 
3415  if(fProduceTreeEOverP){
3416  AliESDEvent *esdev = dynamic_cast<AliESDEvent*>(fInputEvent);
3417  AliAODEvent *aodev = 0;
3418  Bool_t isESD = kTRUE;
3419  if (!esdev) {
3420  isESD = kFALSE;
3421  aodev = dynamic_cast<AliAODEvent*>(fInputEvent);
3422  if (!aodev) {
3423  AliError("Task needs AOD or ESD event...");
3424  }
3425  }
3426 
3427  AliESDtrackCuts *EsdTrackCuts = 0x0;
3428  if(esdev){
3429  // Using standard function for setting Cuts
3430  Int_t runNumber = fInputEvent->GetRunNumber();
3431  // if LHC11a or earlier or if LHC13g or if LHC12a-i -> use 2010 cuts
3432  if( (runNumber<=146860) || (runNumber>=197470 && runNumber<=197692) || (runNumber>=172440 && runNumber<=193766) ){
3433  EsdTrackCuts = AliESDtrackCuts::GetStandardITSTPCTrackCuts2010();
3434  // else if run2 data use 2015 PbPb cuts
3435  }else if (runNumber>=209122){
3436  EsdTrackCuts = AliESDtrackCuts::GetStandardITSTPCTrackCuts2015PbPb();
3437  // else use 2011 version of track cuts
3438  }else{
3439  EsdTrackCuts = AliESDtrackCuts::GetStandardITSTPCTrackCuts2011();
3440  }
3441  EsdTrackCuts->SetMaxDCAToVertexZ(2);
3442  EsdTrackCuts->SetEtaRange(-0.8, 0.8);
3443  EsdTrackCuts->SetPtRange(0.15);
3444  }
3445 
3446  for(Long_t i = 0; i < nclus; i++){
3447  if( mapIsClusterAcceptedWithoutTrackMatch[i] != 1 ) continue;
3448 
3449  AliVCluster* clus = NULL;
3450  if(fInputEvent->IsA()==AliESDEvent::Class()){
3451  if(arrClustersProcess)
3452  clus = new AliESDCaloCluster(*(AliESDCaloCluster*)arrClustersProcess->At(i));
3453  else
3454  clus = new AliESDCaloCluster(*(AliESDCaloCluster*)fInputEvent->GetCaloCluster(i));
3455  } else if(fInputEvent->IsA()==AliAODEvent::Class()){
3456  if(arrClustersProcess)
3457  clus = new AliAODCaloCluster(*(AliAODCaloCluster*)arrClustersProcess->At(i));
3458  else
3459  clus = new AliAODCaloCluster(*(AliAODCaloCluster*)fInputEvent->GetCaloCluster(i));
3460  }
3461 
3462  if(!clus) continue;
3463 
3464  fClusterE = clus->E();
3465  fClusterM02 = clus->GetM02();
3466  fClusterM20 = clus->GetM20();
3467  fClusterLeadCellID = ((AliCaloPhotonCuts*)fClusterCutArray->At(fiCut))->FindLargestCellInCluster(clus,fInputEvent);
3468 
3469  Int_t labelTrackMatch = -1;
3470  if(!((AliCaloPhotonCuts*)fClusterCutArray->At(fiCut))->GetHighestPtMatchedTrackToCluster(fInputEvent,clus,labelTrackMatch)){
3471  delete clus;
3472  continue;
3473  }
3474 
3475  AliVTrack* currTrack = dynamic_cast<AliVTrack*>(fInputEvent->GetTrack(labelTrackMatch));
3476  if(!currTrack){
3477  delete clus;
3478  continue;
3479  }
3480  if(esdev){
3481  AliESDtrack *esdt = dynamic_cast<AliESDtrack*>(currTrack);
3482  if(!EsdTrackCuts->AcceptTrack(esdt)){
3483  delete clus;
3484  continue;
3485  }
3486  if(esdt->Pt()<1.){
3487  delete clus;
3488  continue;
3489  }
3490  fClusterEP = fClusterE/esdt->P();
3491  fTrackPt = esdt->Pt();
3492  }else if(aodev){
3493  AliAODTrack *aodt = dynamic_cast<AliAODTrack*>(currTrack);
3494  if(!aodt->IsHybridGlobalConstrainedGlobal()){
3495  delete clus;
3496  continue;
3497  }
3498  if(TMath::Abs(aodt->Eta())>0.8){
3499  delete clus;
3500  continue;
3501  }
3502  if(aodt->Pt()<1.){
3503  delete clus;
3504  continue;
3505  }
3506  fClusterEP = fClusterE/aodt->P();
3507  fTrackPt = aodt->Pt();
3508  }
3509 
3510  AliPIDResponse* pidResponse = ((AliConversionPhotonCuts*)fV0Reader->GetConversionCuts())->GetPIDResponse();
3511  if(!pidResponse){
3512  delete clus;
3513  continue;
3514  }
3515 
3516  Float_t temp = TMath::Abs(pidResponse->NumberOfSigmasTPC(currTrack,AliPID::kElectron));
3517  if(temp<10.){
3518  fTrackPID_e = temp*10;
3519  }else fTrackPID_e = 99;
3520 
3521  temp = TMath::Abs(pidResponse->NumberOfSigmasTPC(currTrack,AliPID::kPion));
3522  if(temp<10.){
3523  fTrackPID_Pi = temp*10;
3524  }else fTrackPID_Pi = 99;
3525 
3526  temp = TMath::Abs(pidResponse->NumberOfSigmasTPC(currTrack,AliPID::kKaon));
3527  if(temp<10.){
3528  fTrackPID_K = temp*10;
3529  }else fTrackPID_K = 99;
3530 
3531  temp = TMath::Abs(pidResponse->NumberOfSigmasTPC(currTrack,AliPID::kProton));
3532  if(temp<10.){
3533  fTrackPID_P = temp*10;
3534  }else fTrackPID_P = 99;
3535 
3536  Float_t tempEta = -99999;
3537  Float_t tempPhi = -99999;
3538  ((AliCaloTrackMatcher*)((AliCaloPhotonCuts*)fClusterCutArray->At(fiCut))->GetCaloTrackMatcherInstance())->GetTrackClusterMatchingResidual(currTrack->GetID(),clus->GetID(),tempEta,tempPhi);
3539  fDeltaEta = tempEta;
3540  fDeltaPhi = tempPhi;
3541 
3542  //determine isolation in cluster Et
3543  Float_t clsPos[3] = {0.,0.,0.};
3544  Float_t secondClsPos[3] = {0.,0.,0.};
3545  TLorentzVector clusterVector;
3546 
3547  clus->GetPosition(clsPos);
3548  TVector3 clsPosVec(clsPos);
3549 
3550  Float_t sum_Et = 0;
3551  for(Int_t j=0; j<nclus; j++){
3552  if( i == j ) continue;
3553  if( mapIsClusterAcceptedWithoutTrackMatch[j] != 1 ) continue;
3554 
3555  AliVCluster* secondClus = NULL;
3556  if(fInputEvent->IsA()==AliESDEvent::Class()){
3557  if(arrClustersProcess)
3558  secondClus = new AliESDCaloCluster(*(AliESDCaloCluster*)arrClustersProcess->At(j));
3559  else
3560  secondClus = new AliESDCaloCluster(*(AliESDCaloCluster*)fInputEvent->GetCaloCluster(j));
3561  } else if(fInputEvent->IsA()==AliAODEvent::Class()){
3562  if(arrClustersProcess)
3563  secondClus = new AliAODCaloCluster(*(AliAODCaloCluster*)arrClustersProcess->At(j));
3564  else
3565  secondClus = new AliAODCaloCluster(*(AliAODCaloCluster*)fInputEvent->GetCaloCluster(j));
3566  }
3567 
3568  if(!secondClus) continue;
3569  secondClus->GetPosition(secondClsPos);
3570  TVector3 secondClsPosVec(secondClsPos);
3571 
3572  Float_t dPhi = clsPosVec.DeltaPhi(secondClsPosVec);
3573  Float_t dEta = clsPosVec.Eta()-secondClsPosVec.Eta();
3574  if(TMath::Sqrt(dEta*dEta + dPhi*dPhi) < 0.2){
3575  secondClus->GetMomentum(clusterVector,vertex);
3576  sum_Et += clusterVector.Et();
3577  }
3578  delete secondClus;
3579  }
3580  fClusterIsoSumClusterEt = sum_Et;
3581 
3582  //determine isolation in track Et
3583  fClusterIsoSumTrackEt = ((AliCaloTrackMatcher*)((AliCaloPhotonCuts*)fClusterCutArray->At(fiCut))->GetCaloTrackMatcherInstance())->SumTrackEtAroundCluster(fInputEvent,clus->GetID(),0.2);
3584  //remove Et from matched track
3585  TLorentzVector vecTrack;
3586  vecTrack.SetPxPyPzE(currTrack->Px(),currTrack->Py(),currTrack->Pz(),currTrack->E());
3587  fClusterIsoSumTrackEt -= vecTrack.Et();
3588 
3589  //get cluster classification
3590  if(fIsMC > 0) fClusterClassification = ((AliCaloPhotonCuts*)fClusterCutArray->At(fiCut))->ClassifyClusterForTMEffi(clus,fInputEvent,fMCEvent,isESD);
3591 
3592  tClusterEOverP[fiCut]->Fill();
3593  delete clus;
3594  }
3595  mapIsClusterAcceptedWithoutTrackMatch.clear();
3596  }
3597 
3598  if(fProduceCellIDPlots || fProduceTreeEOverP) mapIsClusterAccepted.clear();
3599 
3600  if(fLocalDebugFlag == 2) EventDebugMethod();
3601 
3602  return;
3603 }
3604 //________________________________________________________________________
3606 {
3608  if(fConvJetReader->GetNJets()>0){
3616  if(fIsMC > 0 && fConvJetReader->GetTrueNJets()>0){
3620  }
3622  for(Int_t i=0; i<fConvJetReader->GetNJets(); i++){
3623  fHistoPtJet[fiCut]->Fill(fVectorJetPt.at(i));
3624  fHistoJetEta[fiCut]->Fill(fVectorJetEta.at(i));
3625  fHistoJetPhi[fiCut]->Fill(fVectorJetPhi.at(i));
3626  fHistoJetArea[fiCut]->Fill(fVectorJetArea.at(i));
3627  if(fIsMC > 0 && fConvJetReader->GetNJets()>0 && fConvJetReader->GetTrueNJets()>0){
3628  Double_t min = 100;
3629  Int_t match = 0;
3630  for(Int_t j = 0; j<fConvJetReader->GetTrueNJets(); j++){
3631  Double_t R_jetjet;
3632  Double_t DeltaEta = fVectorJetEta.at(i)-fTrueVectorJetEta.at(j);
3633  Double_t DeltaPhi = abs(fVectorJetPhi.at(i)-fTrueVectorJetPhi.at(j));
3634  if(DeltaPhi > M_PI) {
3635  DeltaPhi = 2*M_PI - DeltaPhi;
3636  }
3637  R_jetjet = TMath::Sqrt(pow((DeltaEta),2)+pow((DeltaPhi),2));
3638  if(R_jetjet < min){
3639  min = R_jetjet;
3640  match = j;
3641  }
3642  }
3643  fHistoTruevsRecJetPt[fiCut]->Fill(fVectorJetPt.at(i), fTrueVectorJetPt.at(match));
3644  }
3645  }
3646  fHistoEventwJets[fiCut]->Fill(0);
3647  }
3648  fVectorJetPt.clear();
3649  fVectorJetPx.clear();
3650  fVectorJetPy.clear();
3651  fVectorJetPz.clear();
3652  fVectorJetEta.clear();
3653  fVectorJetPhi.clear();
3654  fVectorJetArea.clear();
3655  if(fIsMC > 0 && fConvJetReader->GetTrueNJets()>0){
3656  fTrueVectorJetPt.clear();
3657  fTrueVectorJetEta.clear();
3658  fTrueVectorJetPhi.clear();
3659  }
3660  }
3661 }
3662 
3663 //________________________________________________________________________
3665 {
3666  const AliVVertex* primVtxMC = fMCEvent->GetPrimaryVertex();
3667  Double_t mcProdVtxX = primVtxMC->GetX();
3668  Double_t mcProdVtxY = primVtxMC->GetY();
3669  Double_t mcProdVtxZ = primVtxMC->GetZ();
3670 
3671  Double_t tempPhotonWeight = fWeightJetJetMC;
3672  TParticle *Photon = NULL;
3673  if (!TruePhotonCandidate->GetIsCaloPhoton()) AliFatal("CaloPhotonFlag has not been set task will abort");
3674  if (!fDoLightOutput && fDoClusterQA > 0) fHistoTrueNLabelsInClus[fiCut]->Fill(TruePhotonCandidate->GetNCaloPhotonMCLabels(), tempPhotonWeight);
3675 
3676  if (TruePhotonCandidate->GetCaloPhotonMCLabel(0) < 0) return;
3677  if (TruePhotonCandidate->GetNCaloPhotonMCLabels() > 0) Photon = fMCEvent->Particle(TruePhotonCandidate->GetCaloPhotonMCLabel(0));
3678  else return;
3679 
3680  if(Photon == NULL){
3681  // cout << "no photon" << endl;
3682  return;
3683  }
3684  // Set the jetjet weight to 1 in case the photon orignated from the minimum bias header
3685  if (fIsMC>0 && ((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetSignalRejection() == 4){
3686  if ( ((AliConvEventCuts*)fEventCutArray->At(fiCut))->IsParticleFromBGEvent(TruePhotonCandidate->GetCaloPhotonMCLabel(0), fMCEvent, fInputEvent) == 2) tempPhotonWeight = 1;
3687  }
3688 
3689 
3690 
3691  Int_t pdgCodeParticle = Photon->GetPdgCode();
3692  TruePhotonCandidate->SetCaloPhotonMCFlags(fMCEvent, fEnableSortForClusMC);
3693 
3694  // True Photon
3695 
3696  if (TruePhotonCandidate->IsLargestComponentPhoton() || (TruePhotonCandidate->IsLargestComponentElectron() && TruePhotonCandidate->IsConversion())) {
3697  fHistoTrueClusGammaPt[fiCut]->Fill(TruePhotonCandidate->Pt(), tempPhotonWeight);
3698  if (!fDoLightOutput && fDoClusterQA > 0) fHistoTrueClusGammaPtM02[fiCut]->Fill(TruePhotonCandidate->Pt(), clus->GetM02(), tempPhotonWeight);
3699  } else if (fDoClusterQA > 0) fHistoTrueClusEMNonLeadingPt[fiCut]->Fill(TruePhotonCandidate->Pt());
3700  if (fDoClusterQA > 0){
3701  if (TruePhotonCandidate->IsLargestComponentPhoton()){
3702  fHistoTrueClusUnConvGammaPt[fiCut]->Fill(TruePhotonCandidate->Pt(), tempPhotonWeight);
3703  fHistoTrueClusUnConvGammaMCPt[fiCut]->Fill(Photon->Pt(), tempPhotonWeight);
3704  if (!fDoLightOutput) fHistoTrueClusUnConvGammaPtM02[fiCut]->Fill(TruePhotonCandidate->Pt(), clus->GetM02(), tempPhotonWeight);
3705  }
3706  if (TruePhotonCandidate->IsLargestComponentElectron())
3707  fHistoTrueClusElectronPt[fiCut]->Fill(TruePhotonCandidate->Pt(), tempPhotonWeight);
3708  if (TruePhotonCandidate->IsLargestComponentElectron() && TruePhotonCandidate->IsConversion()){
3709  fHistoTrueClusConvGammaPt[fiCut]->Fill(TruePhotonCandidate->Pt(), tempPhotonWeight);
3710  if(Photon->GetMother(0) > -1){
3711  TParticle* motherPart = (TParticle*)fMCEvent->Particle(Photon->GetMother(0));
3712  fHistoTrueClusConvGammaMCPt[fiCut]->Fill(motherPart->Pt(), tempPhotonWeight);
3713  }
3714  }
3715  if (TruePhotonCandidate->IsLargestComponentElectron() && TruePhotonCandidate->IsConversion() && TruePhotonCandidate->IsConversionFullyContained())
3716  fHistoTrueClusConvGammaFullyPt[fiCut]->Fill(TruePhotonCandidate->Pt(), tempPhotonWeight);
3717  if (TruePhotonCandidate->IsMerged() || TruePhotonCandidate->IsMergedPartConv() || TruePhotonCandidate->IsDalitzMerged())
3718  fHistoTrueClusMergedGammaPt[fiCut]->Fill(TruePhotonCandidate->Pt(), tempPhotonWeight);
3719  if (TruePhotonCandidate->IsMergedPartConv())
3720  fHistoTrueClusMergedPartConvGammaPt[fiCut]->Fill(TruePhotonCandidate->Pt(), tempPhotonWeight);
3721  if (TruePhotonCandidate->IsDalitz())
3722  fHistoTrueClusDalitzPt[fiCut]->Fill(TruePhotonCandidate->Pt(), tempPhotonWeight);
3723  if (TruePhotonCandidate->IsDalitzMerged())
3724  fHistoTrueClusDalitzMergedPt[fiCut]->Fill(TruePhotonCandidate->Pt(), tempPhotonWeight);
3725  if (TruePhotonCandidate->IsPhotonWithElecMother())
3726  fHistoTrueClusPhotonFromElecMotherPt[fiCut]->Fill(TruePhotonCandidate->Pt(), tempPhotonWeight);
3727  if (TruePhotonCandidate->IsShower())
3728  fHistoTrueClusShowerPt[fiCut]->Fill(TruePhotonCandidate->Pt(), tempPhotonWeight);
3729  if (TruePhotonCandidate->IsSubLeadingEM())
3730  fHistoTrueClusSubLeadingPt[fiCut]->Fill(TruePhotonCandidate->Pt(), tempPhotonWeight);
3731  fHistoTrueClusNParticles[fiCut]->Fill(TruePhotonCandidate->GetNCaloPhotonMCLabels(), tempPhotonWeight);
3732  if (!TruePhotonCandidate->IsLargestComponentPhoton()) {
3733  FillPhotonBackgroundHist(TruePhotonCandidate,pdgCodeParticle);
3734  if (!fDoLightOutput) FillPhotonBackgroundM02Hist(TruePhotonCandidate,clus,pdgCodeParticle);
3735  }
3736  if (!(TruePhotonCandidate->IsLargestComponentPhoton() || (TruePhotonCandidate->IsLargestComponentElectron() && TruePhotonCandidate->IsConversion())) ) {
3737  FillPhotonPlusConversionBackgroundHist(TruePhotonCandidate,pdgCodeParticle);
3738  if (!fDoLightOutput) FillPhotonPlusConversionBackgroundM02Hist(TruePhotonCandidate,clus,pdgCodeParticle);
3739  }
3740  Int_t motherLab = Photon->GetMother(0);
3741  if (motherLab > -1){
3742  if (TruePhotonCandidate->IsLargestComponentPhoton()){
3744  fHistoDoubleCountTrueClusterGammaPt[fiCut]->Fill(TruePhotonCandidate->Pt(),(Double_t)0,tempPhotonWeight);
3746  }
3747  }
3748  Int_t grandMotherLab = fMCEvent->Particle(motherLab)->GetMother(0);
3749  if (grandMotherLab > -1){
3750  if (TruePhotonCandidate->IsLargestComponentElectron() && TruePhotonCandidate->IsConversion()){
3752  fHistoDoubleCountTrueClusterGammaPt[fiCut]->Fill(TruePhotonCandidate->Pt(),(Double_t)1,tempPhotonWeight);
3754  }
3755  }
3756  }
3757  }
3758  }
3759 
3760  if(!fDoLightOutput){
3761  Bool_t isPrimary = ((AliConvEventCuts*)fEventCutArray->At(fiCut))->IsConversionPrimaryESD( fMCEvent, TruePhotonCandidate->GetCaloPhotonMCLabel(0), mcProdVtxX, mcProdVtxY, mcProdVtxZ);
3762  if (TruePhotonCandidate->IsLargestComponentElectron() && TruePhotonCandidate->IsConversion())
3763  isPrimary = ((AliConvEventCuts*)fEventCutArray->At(fiCut))->IsConversionPrimaryESD( fMCEvent, Photon->GetMother(0), mcProdVtxX, mcProdVtxY, mcProdVtxZ);
3764 
3765  if(isPrimary){
3766  // filling primary histograms
3767  if (TruePhotonCandidate->IsLargestComponentPhoton()){
3768  fHistoTruePrimaryClusGammaPt[fiCut]->Fill(TruePhotonCandidate->Pt(), tempPhotonWeight);
3769  fHistoTruePrimaryClusGammaESDPtMCPt[fiCut]->Fill(TruePhotonCandidate->Pt(),Photon->Pt(), tempPhotonWeight); // Allways Filled
3770  }
3771  if (TruePhotonCandidate->IsLargestComponentElectron() && TruePhotonCandidate->IsConversion()){
3772  fHistoTruePrimaryClusConvGammaPt[fiCut]->Fill(TruePhotonCandidate->Pt(), tempPhotonWeight);
3773  fHistoTruePrimaryClusConvGammaESDPtMCPt[fiCut]->Fill(TruePhotonCandidate->Pt(),Photon->Pt(), tempPhotonWeight); // Allways Filled
3774  }
3775 
3776  } else {
3777  // filling secondary histograms
3778  Int_t secondaryClass = -1;
3779  if (TruePhotonCandidate->IsLargestComponentElectron() && TruePhotonCandidate->IsConversion())
3780  secondaryClass = ((AliConvEventCuts*)fEventCutArray->At(fiCut))->SecondaryClassificationPhoton( Photon, fMCEvent, kTRUE);
3781  else
3782  secondaryClass = ((AliConvEventCuts*)fEventCutArray->At(fiCut))->SecondaryClassificationPhoton( Photon, fMCEvent, kFALSE);
3783 
3784  // all secondaries
3785  if (TruePhotonCandidate->IsLargestComponentPhoton()){
3786  if (secondaryClass == 2) {
3787  fHistoTrueSecondaryClusGammaPt[fiCut]->Fill(TruePhotonCandidate->Pt(),0.,tempPhotonWeight);
3788  fHistoTrueSecondaryClusGammaMCPt[fiCut]->Fill(Photon->Pt(),0.,tempPhotonWeight);
3789  fHistoTrueSecondaryClusGammaFromXFromK0sMCPtESDPt[fiCut]->Fill(Photon->Pt(),TruePhotonCandidate->Pt(),tempPhotonWeight);
3790  } else if (secondaryClass == 5) {
3791  fHistoTrueSecondaryClusGammaPt[fiCut]->Fill(TruePhotonCandidate->Pt(),1.,tempPhotonWeight);
3792  fHistoTrueSecondaryClusGammaMCPt[fiCut]->Fill(Photon->Pt(),1.,tempPhotonWeight);
3793  fHistoTrueSecondaryClusGammaFromXFromK0lMCPtESDPt[fiCut]->Fill(Photon->Pt(),TruePhotonCandidate->Pt(),tempPhotonWeight);
3794  } else if (secondaryClass == 3) {
3795  fHistoTrueSecondaryClusGammaPt[fiCut]->Fill(TruePhotonCandidate->Pt(),2.,tempPhotonWeight);
3796  fHistoTrueSecondaryClusGammaMCPt[fiCut]->Fill(Photon->Pt(),2.,tempPhotonWeight);
3797  fHistoTrueSecondaryClusGammaFromXFromLambdaMCPtESDPt[fiCut]->Fill(Photon->Pt(),TruePhotonCandidate->Pt(),tempPhotonWeight);
3798  } else if (secondaryClass == 4) {
3799  fHistoTrueSecondaryClusGammaPt[fiCut]->Fill(TruePhotonCandidate->Pt(),3.,tempPhotonWeight);
3800  fHistoTrueSecondaryClusGammaMCPt[fiCut]->Fill(Photon->Pt(),3.,tempPhotonWeight);
3801  } else {
3802  fHistoTrueSecondaryClusGammaPt[fiCut]->Fill(TruePhotonCandidate->Pt(),4.,tempPhotonWeight);
3803  fHistoTrueSecondaryClusGammaMCPt[fiCut]->Fill(Photon->Pt(),4.,tempPhotonWeight);
3804  }
3805  }
3806  if (TruePhotonCandidate->IsLargestComponentElectron() && TruePhotonCandidate->IsConversion()){
3807  if (secondaryClass == 2) {
3808  fHistoTrueSecondaryClusConvGammaPt[fiCut]->Fill(TruePhotonCandidate->Pt(),0.,tempPhotonWeight);
3809  fHistoTrueSecondaryClusConvGammaMCPt[fiCut]->Fill(Photon->Pt(),0.,tempPhotonWeight);
3810  fHistoTrueSecondaryClusConvGammaFromXFromK0sMCPtESDPt[fiCut]->Fill(Photon->Pt(),TruePhotonCandidate->Pt(),tempPhotonWeight);
3811  } else if (secondaryClass == 5) {
3812  fHistoTrueSecondaryClusConvGammaPt[fiCut]->Fill(TruePhotonCandidate->Pt(),1.,tempPhotonWeight);
3813  fHistoTrueSecondaryClusConvGammaMCPt[fiCut]->Fill(Photon->Pt(),1.,tempPhotonWeight);
3814  fHistoTrueSecondaryClusConvGammaFromXFromK0lMCPtESDPt[fiCut]->Fill(Photon->Pt(),TruePhotonCandidate->Pt(),tempPhotonWeight);
3815  } else if (secondaryClass == 3) {
3816  fHistoTrueSecondaryClusConvGammaPt[fiCut]->Fill(TruePhotonCandidate->Pt(),2.,tempPhotonWeight);
3817  fHistoTrueSecondaryClusConvGammaMCPt[fiCut]->Fill(Photon->Pt(),2.,tempPhotonWeight);
3818  fHistoTrueSecondaryClusConvGammaFromXFromLambdaMCPtESDPt[fiCut]->Fill(Photon->Pt(),TruePhotonCandidate->Pt(),tempPhotonWeight);
3819  } else if (secondaryClass == 4) {
3820  fHistoTrueSecondaryClusConvGammaPt[fiCut]->Fill(TruePhotonCandidate->Pt(),3.,tempPhotonWeight);
3821  fHistoTrueSecondaryClusConvGammaMCPt[fiCut]->Fill(Photon->Pt(),3.,tempPhotonWeight);
3822  } else {
3823  fHistoTrueSecondaryClusConvGammaPt[fiCut]->Fill(TruePhotonCandidate->Pt(),4.,tempPhotonWeight);
3824  fHistoTrueSecondaryClusConvGammaMCPt[fiCut]->Fill(Photon->Pt(),4.,tempPhotonWeight);
3825  }
3826  }
3827  }
3828  }
3829  return;
3830 }
3831 
3832 
3833 //________________________________________________________________________
3835 {
3836  const AliVVertex* primVtxMC = fMCEvent->GetPrimaryVertex();
3837  Double_t mcProdVtxX = primVtxMC->GetX();
3838  Double_t mcProdVtxY = primVtxMC->GetY();
3839  Double_t mcProdVtxZ = primVtxMC->GetZ();
3840 
3841  Double_t tempPhotonWeight = fWeightJetJetMC;
3842  AliAODMCParticle *Photon = NULL;
3843  TClonesArray *AODMCTrackArray = dynamic_cast<TClonesArray*>(fInputEvent->FindListObject(AliAODMCParticle::StdBranchName()));
3844  if (!fDoLightOutput && fDoClusterQA > 0) fHistoTrueNLabelsInClus[fiCut]->Fill(TruePhotonCandidate->GetNCaloPhotonMCLabels(), tempPhotonWeight);
3845  if (AODMCTrackArray){
3846  if (!TruePhotonCandidate->GetIsCaloPhoton()) AliFatal("CaloPhotonFlag has not been set task will abort");
3847  if (TruePhotonCandidate->GetNCaloPhotonMCLabels()>0) Photon = (AliAODMCParticle*) AODMCTrackArray->At(TruePhotonCandidate->GetCaloPhotonMCLabel(0));
3848  else return;
3849  } else {
3850  AliInfo("AODMCTrackArray could not be loaded");
3851  return;
3852  }
3853 
3854  if(Photon == NULL){
3855  // cout << "no photon" << endl;
3856  return;
3857  }
3858  Int_t pdgCodeParticle = Photon->GetPdgCode();
3860 
3861  // Set the jetjet weight to 1 in case the cluster orignated from the minimum bias header
3862  if (fIsMC>0 && ((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetSignalRejection() == 4){
3863  if ( ((AliConvEventCuts*)fEventCutArray->At(fiCut))->IsParticleFromBGEvent(TruePhotonCandidate->GetCaloPhotonMCLabel(0), fMCEvent, fInputEvent) == 2) tempPhotonWeight = 1;
3864  }
3865 
3866  // True Photon
3867  if (TruePhotonCandidate->IsLargestComponentPhoton() || (TruePhotonCandidate->IsLargestComponentElectron() && TruePhotonCandidate->IsConversion())) {
3868  fHistoTrueClusGammaPt[fiCut]->Fill(TruePhotonCandidate->Pt(), tempPhotonWeight);
3869  if (!fDoLightOutput && fDoClusterQA > 0) fHistoTrueClusGammaPtM02[fiCut]->Fill(TruePhotonCandidate->Pt(), clus->GetM02(), tempPhotonWeight);
3870  } else if (fDoClusterQA > 0) fHistoTrueClusEMNonLeadingPt[fiCut]->Fill(TruePhotonCandidate->Pt());
3871  if (fDoClusterQA > 0){
3872  if (TruePhotonCandidate->IsLargestComponentPhoton()) {
3873  fHistoTrueClusUnConvGammaPt[fiCut]->Fill(TruePhotonCandidate->Pt(), tempPhotonWeight);
3874  fHistoTrueClusUnConvGammaMCPt[fiCut]->Fill(Photon->Pt(), tempPhotonWeight);
3875  if (!fDoLightOutput) fHistoTrueClusUnConvGammaPtM02[fiCut]->Fill(TruePhotonCandidate->Pt(), clus->GetM02(), tempPhotonWeight);
3876  }
3877  if (TruePhotonCandidate->IsLargestComponentElectron())
3878  fHistoTrueClusElectronPt[fiCut]->Fill(TruePhotonCandidate->Pt(), tempPhotonWeight);
3879  if (TruePhotonCandidate->IsLargestComponentElectron() && TruePhotonCandidate->IsConversion()) {
3880  fHistoTrueClusConvGammaPt[fiCut]->Fill(TruePhotonCandidate->Pt(), tempPhotonWeight);
3881  AliAODMCParticle *motherPart = (AliAODMCParticle*) AODMCTrackArray->At(Photon->GetMother());
3882  fHistoTrueClusConvGammaMCPt[fiCut]->Fill(motherPart->Pt(), tempPhotonWeight);
3883  }
3884  if (TruePhotonCandidate->IsLargestComponentElectron() && TruePhotonCandidate->IsConversion() && TruePhotonCandidate->IsConversionFullyContained())
3885  fHistoTrueClusConvGammaFullyPt[fiCut]->Fill(TruePhotonCandidate->Pt(), tempPhotonWeight);
3886  if (TruePhotonCandidate->IsMerged() || TruePhotonCandidate->IsMergedPartConv() || TruePhotonCandidate->IsDalitzMerged())
3887  fHistoTrueClusMergedGammaPt[fiCut]->Fill(TruePhotonCandidate->Pt(), tempPhotonWeight);
3888  if (TruePhotonCandidate->IsMergedPartConv())
3889  fHistoTrueClusMergedPartConvGammaPt[fiCut]->Fill(TruePhotonCandidate->Pt(), tempPhotonWeight);
3890  if (TruePhotonCandidate->IsDalitz())
3891  fHistoTrueClusDalitzPt[fiCut]->Fill(TruePhotonCandidate->Pt(), tempPhotonWeight);
3892  if (TruePhotonCandidate->IsDalitzMerged())
3893  fHistoTrueClusDalitzMergedPt[fiCut]->Fill(TruePhotonCandidate->Pt(), tempPhotonWeight);
3894  if (TruePhotonCandidate->IsPhotonWithElecMother())
3895  fHistoTrueClusPhotonFromElecMotherPt[fiCut]->Fill(TruePhotonCandidate->Pt(), tempPhotonWeight);
3896  if (TruePhotonCandidate->IsShower())
3897  fHistoTrueClusShowerPt[fiCut]->Fill(TruePhotonCandidate->Pt(), tempPhotonWeight);
3898  if (TruePhotonCandidate->IsSubLeadingEM())
3899  fHistoTrueClusSubLeadingPt[fiCut]->Fill(TruePhotonCandidate->Pt(), tempPhotonWeight);
3900  fHistoTrueClusNParticles[fiCut]->Fill(TruePhotonCandidate->GetNCaloPhotonMCLabels(), tempPhotonWeight);
3901 
3902  if (!TruePhotonCandidate->IsLargestComponentPhoton()) {
3903  FillPhotonBackgroundHist(TruePhotonCandidate,pdgCodeParticle);
3904  if (!fDoLightOutput) FillPhotonBackgroundM02Hist(TruePhotonCandidate,clus,pdgCodeParticle);
3905  }
3906  if (!(TruePhotonCandidate->IsLargestComponentPhoton() || (TruePhotonCandidate->IsLargestComponentElectron() && TruePhotonCandidate->IsConversion())) ) {
3907  FillPhotonPlusConversionBackgroundHist(TruePhotonCandidate,pdgCodeParticle);
3908  if (!fDoLightOutput) FillPhotonPlusConversionBackgroundM02Hist(TruePhotonCandidate,clus,pdgCodeParticle);
3909  }
3910  Int_t motherLab = Photon->GetMother();
3911  if (motherLab > -1){
3912  if (TruePhotonCandidate->IsLargestComponentPhoton()){
3914  fHistoDoubleCountTrueClusterGammaPt[fiCut]->Fill(TruePhotonCandidate->Pt(),(Double_t)0,tempPhotonWeight);
3916  }
3917  }
3918  Int_t grandMotherLab = ((AliAODMCParticle*) AODMCTrackArray->At(motherLab))->GetMother();
3919  if (grandMotherLab > -1){
3920  if (TruePhotonCandidate->IsLargestComponentElectron() && TruePhotonCandidate->IsConversion()){
3922  fHistoDoubleCountTrueClusterGammaPt[fiCut]->Fill(TruePhotonCandidate->Pt(),(Double_t)1,tempPhotonWeight);
3924  }
3925  }
3926  }
3927  }
3928  }
3929 
3930  if(!fDoLightOutput){
3931  Bool_t isPrimary = ((AliConvEventCuts*)fEventCutArray->At(fiCut))->IsConversionPrimaryAOD(fInputEvent, Photon, mcProdVtxX, mcProdVtxY, mcProdVtxZ);
3932  if (TruePhotonCandidate->IsLargestComponentElectron() && TruePhotonCandidate->IsConversion()){
3933  if (Photon->GetMother()> -1){
3934  AliAODMCParticle *Mother = (AliAODMCParticle*) AODMCTrackArray->At(Photon->GetMother());
3935  isPrimary = ((AliConvEventCuts*)fEventCutArray->At(fiCut))->IsConversionPrimaryAOD(fInputEvent, Mother, mcProdVtxX, mcProdVtxY, mcProdVtxZ);
3936  }
3937  }
3938  if(isPrimary){
3939  if (TruePhotonCandidate->IsLargestComponentPhoton()){
3940  fHistoTruePrimaryClusGammaPt[fiCut]->Fill(TruePhotonCandidate->Pt(), tempPhotonWeight);
3941  fHistoTruePrimaryClusGammaESDPtMCPt[fiCut]->Fill(TruePhotonCandidate->Pt(),Photon->Pt(), tempPhotonWeight); // Allways Filled
3942  }
3943  if (TruePhotonCandidate->IsLargestComponentElectron() && TruePhotonCandidate->IsConversion()){
3944  fHistoTruePrimaryClusConvGammaPt[fiCut]->Fill(TruePhotonCandidate->Pt(), tempPhotonWeight);
3945  fHistoTruePrimaryClusConvGammaESDPtMCPt[fiCut]->Fill(TruePhotonCandidate->Pt(),Photon->Pt(), tempPhotonWeight); // Allways Filled
3946  }
3947 
3948  } else {
3949  // filling secondary histograms
3950  Int_t secondaryClass = -1;
3951  if (TruePhotonCandidate->IsLargestComponentElectron() && TruePhotonCandidate->IsConversion())
3952  secondaryClass = ((AliConvEventCuts*)fEventCutArray->At(fiCut))->SecondaryClassificationPhotonAOD( Photon, AODMCTrackArray, kTRUE);
3953  else
3954  secondaryClass = ((AliConvEventCuts*)fEventCutArray->At(fiCut))->SecondaryClassificationPhotonAOD( Photon, AODMCTrackArray, kFALSE);
3955 
3956  // all secondaries
3957  if (TruePhotonCandidate->IsLargestComponentPhoton()){
3958  if (secondaryClass == 2) {
3959  fHistoTrueSecondaryClusGammaPt[fiCut]->Fill(TruePhotonCandidate->Pt(),0.,tempPhotonWeight);
3960  fHistoTrueSecondaryClusGammaMCPt[fiCut]->Fill(Photon->Pt(),0.,tempPhotonWeight);
3961  fHistoTrueSecondaryClusGammaFromXFromK0sMCPtESDPt[fiCut]->Fill(Photon->Pt(),TruePhotonCandidate->Pt(),tempPhotonWeight);
3962  } else if (secondaryClass == 5) {
3963  fHistoTrueSecondaryClusGammaPt[fiCut]->Fill(TruePhotonCandidate->Pt(),1.,tempPhotonWeight);
3964  fHistoTrueSecondaryClusGammaMCPt[fiCut]->Fill(Photon->Pt(),1.,tempPhotonWeight);
3965  fHistoTrueSecondaryClusGammaFromXFromK0lMCPtESDPt[fiCut]->Fill(Photon->Pt(),TruePhotonCandidate->Pt(),tempPhotonWeight);
3966  } else if (secondaryClass == 3) {
3967  fHistoTrueSecondaryClusGammaPt[fiCut]->Fill(TruePhotonCandidate->Pt(),2.,tempPhotonWeight);
3968  fHistoTrueSecondaryClusGammaMCPt[fiCut]->Fill(Photon->Pt(),2.,tempPhotonWeight);
3969  fHistoTrueSecondaryClusGammaFromXFromLambdaMCPtESDPt[fiCut]->Fill(Photon->Pt(),TruePhotonCandidate->Pt(),tempPhotonWeight);
3970  } else if (secondaryClass == 4) {
3971  fHistoTrueSecondaryClusGammaPt[fiCut]->Fill(TruePhotonCandidate->Pt(),3.,tempPhotonWeight);
3972  fHistoTrueSecondaryClusGammaMCPt[fiCut]->Fill(Photon->Pt(),3.,tempPhotonWeight);
3973  } else {
3974  fHistoTrueSecondaryClusGammaPt[fiCut]->Fill(TruePhotonCandidate->Pt(),4.,tempPhotonWeight);
3975  fHistoTrueSecondaryClusGammaMCPt[fiCut]->Fill(Photon->Pt(),4.,tempPhotonWeight);
3976  }
3977  }
3978  if (TruePhotonCandidate->IsLargestComponentElectron() && TruePhotonCandidate->IsConversion()){
3979  if (secondaryClass == 2) {
3980  fHistoTrueSecondaryClusConvGammaPt[fiCut]->Fill(TruePhotonCandidate->Pt(),0.,tempPhotonWeight);
3981  fHistoTrueSecondaryClusConvGammaMCPt[fiCut]->Fill(Photon->Pt(),0.,tempPhotonWeight);
3982  fHistoTrueSecondaryClusConvGammaFromXFromK0sMCPtESDPt[fiCut]->Fill(Photon->Pt(),TruePhotonCandidate->Pt(),tempPhotonWeight);
3983  } else if (secondaryClass == 5) {
3984  fHistoTrueSecondaryClusConvGammaPt[fiCut]->Fill(TruePhotonCandidate->Pt(),1.,tempPhotonWeight);
3985  fHistoTrueSecondaryClusConvGammaMCPt[fiCut]->Fill(Photon->Pt(),1.,tempPhotonWeight);
3986  fHistoTrueSecondaryClusConvGammaFromXFromK0lMCPtESDPt[fiCut]->Fill(Photon->Pt(),TruePhotonCandidate->Pt(),tempPhotonWeight);
3987  } else if (secondaryClass == 3) {
3988  fHistoTrueSecondaryClusConvGammaPt[fiCut]->Fill(TruePhotonCandidate->Pt(),2.,tempPhotonWeight);
3989  fHistoTrueSecondaryClusConvGammaMCPt[fiCut]->Fill(Photon->Pt(),2.,tempPhotonWeight);
3990  fHistoTrueSecondaryClusConvGammaFromXFromLambdaMCPtESDPt[fiCut]->Fill(Photon->Pt(),TruePhotonCandidate->Pt(),tempPhotonWeight);
3991  } else if (secondaryClass == 4) {
3992  fHistoTrueSecondaryClusConvGammaPt[fiCut]->Fill(TruePhotonCandidate->Pt(),3.,tempPhotonWeight);
3993  fHistoTrueSecondaryClusConvGammaMCPt[fiCut]->Fill(Photon->Pt(),3.,tempPhotonWeight);
3994  } else {
3995  fHistoTrueSecondaryClusConvGammaPt[fiCut]->Fill(TruePhotonCandidate->Pt(),4.,tempPhotonWeight);
3996  fHistoTrueSecondaryClusConvGammaMCPt[fiCut]->Fill(Photon->Pt(),4.,tempPhotonWeight);
3997  }
3998  }
3999  }
4000  }
4001 
4002 }
4003 
4004 //________________________________________________________________________
4006 {
4007  const AliVVertex* primVtxMC = fMCEvent->GetPrimaryVertex();
4008  Double_t mcProdVtxX = primVtxMC->GetX();
4009  Double_t mcProdVtxY = primVtxMC->GetY();
4010  Double_t mcProdVtxZ = primVtxMC->GetZ();
4011 
4012 
4013  TClonesArray *AODMCTrackArray = dynamic_cast<TClonesArray*>(fInputEvent->FindListObject(AliAODMCParticle::StdBranchName()));
4014  if (AODMCTrackArray == NULL) return;
4015 
4016  // Loop over all primary MC particle
4017  for(Long_t i = 0; i < AODMCTrackArray->GetEntriesFast(); i++) {
4018  Double_t tempParticleWeight = fWeightJetJetMC;
4019 
4020  AliAODMCParticle* particle = static_cast<AliAODMCParticle*>(AODMCTrackArray->At(i));
4021  if (!particle) continue;
4022 
4023  Bool_t isPrimary = ((AliConvEventCuts*)fEventCutArray->At(fiCut))->IsConversionPrimaryAOD(fInputEvent, particle, mcProdVtxX, mcProdVtxY, mcProdVtxZ);
4024  if (isPrimary){
4025 
4026  Int_t isMCFromMBHeader = -1;
4027  if(((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetSignalRejection() != 0){
4028  isMCFromMBHeader = ((AliConvEventCuts*)fEventCutArray->At(fiCut))->IsParticleFromBGEvent(i, fMCEvent, fInputEvent);
4029  if(isMCFromMBHeader == 0 && ((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetSignalRejection() != 3) continue;
4030  // Set the jetjet weight to 1 in case the particle orignated from the minimum bias header
4031  if(isMCFromMBHeader == 2 && ((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetSignalRejection() == 4) tempParticleWeight = 1;
4032  }
4033 
4034  if(!fDoLightOutput){
4035  if(((AliCaloPhotonCuts*)fClusterCutArray->At(fiCut))->ClusterIsSelectedAODMC(particle,AODMCTrackArray)){
4036  fHistoMCAllGammaPt[fiCut]->Fill(particle->Pt(), tempParticleWeight); // All MC Gamma
4037  if(particle->GetMother() >-1){ // Meson Decay Gamma
4038  switch((static_cast<AliAODMCParticle*>(AODMCTrackArray->At(particle->GetMother())))->GetPdgCode()){
4039  case 111: // Pi0
4040  fHistoMCDecayGammaPi0Pt[fiCut]->Fill(particle->Pt(), tempParticleWeight);
4041  break;
4042  case 113: // Rho0