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