AliPhysics  c7b8e89 (c7b8e89)
AliAnalysisTaskGammaCaloIso.cxx
Go to the documentation of this file.
1 /**************************************************************************
2  * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3  * *
4  * Author: Baldo Sahlmueller, Friederike Bock *
5  * Version 1.0 *
6  * *
7  * *
8  * Permission to use, copy, modify and distribute this software and its *
9  * documentation strictly for non-commercial purposes is hereby granted *
10  * without fee, provided that the above copyright notice appears in all *
11  * copies and that both the copyright notice and this permission notice *
12  * appear in the supporting documentation. The authors make no claims *
13  * about the suitability of this software for any purpose. It is *
14  * provided "as is" without express or implied warranty. *
15  **************************************************************************/
16 
18 //----------------------------------------------------------------
19 // Class used to do analysis on conversion photons + calo photons
20 //----------------------------------------------------------------
22 #include "TChain.h"
23 #include "TTree.h"
24 #include "TBranch.h"
25 #include "TFile.h"
26 #include "TH1F.h"
27 #include "TH2F.h"
28 #include "TH3F.h"
29 #include "THnSparse.h"
30 #include "TCanvas.h"
31 #include "TNtuple.h"
32 #include "AliAnalysisTask.h"
33 #include "AliAnalysisManager.h"
34 #include "AliESDEvent.h"
35 #include "AliESDInputHandler.h"
36 #include "AliMCEventHandler.h"
37 #include "AliMCEvent.h"
38 #include "AliMCParticle.h"
39 #include "AliCentrality.h"
40 #include "AliESDVZERO.h"
41 #include "AliESDpid.h"
43 #include "AliVParticle.h"
44 #include "AliESDtrack.h"
45 #include "AliESDtrackCuts.h"
46 #include "AliKFVertex.h"
47 #include "AliV0ReaderV1.h"
48 #include "AliGenCocktailEventHeader.h"
49 #include "AliAODMCParticle.h"
50 #include "AliAODMCHeader.h"
51 #include "AliEventplane.h"
53 #include "AliAODEvent.h"
54 #include "AliAODInputHandler.h"
55 #include "AliESDEvent.h"
56 #include "AliESDInputHandler.h"
57 #include "AliInputEventHandler.h"
58 #include "AliCaloTrackMatcher.h"
59 #include "AliPhotonIsolation.h"
60 #include <vector>
61 #include <map>
62 #include <fstream>
63 
65 
66 //________________________________________________________________________
68  fV0Reader(NULL),
69  fV0ReaderName("V0ReaderV1"),
70  fCorrTaskSetting(""),
71  fBGHandler(NULL),
72  fInputEvent(NULL),
73  fMCEvent(NULL),
74  fCutFolder(NULL),
75  fESDList(NULL),
76  fIsolation(NULL),
77  fBackList(NULL),
78  fMotherList(NULL),
79  fTrueList(NULL),
80  fMCList(NULL),
81  fTreeList(NULL),
82  fClusterTreeList(NULL),
83  fOutputContainer(NULL),
84  fClusterCandidates(NULL),
85  fIsoCandidates(NULL),
86  fEventCutArray(NULL),
87  fEventCuts(NULL),
88  fClusterCutArray(NULL),
89  fCaloPhotonCuts(NULL),
90  fMesonCutArray(NULL),
91  fMesonCuts(NULL),
92  fConvJetReader(NULL),
93  fDoJetAnalysis(kFALSE),
94  fDoJetQA(kFALSE),
95  fJetHistograms(NULL),
96  fTrueJetHistograms(NULL),
97  fHistoMotherInvMassPt(NULL),
98  fSparseMotherInvMassPtZM(NULL),
99  fHistoMotherBackInvMassPt(NULL),
100  fSparseMotherBackInvMassPtZM(NULL),
101  fHistoMotherPi0PtY(NULL),
102  fHistoMotherEtaPtY(NULL),
103  fHistoMotherPi0PtAlpha(NULL),
104  fHistoMotherEtaPtAlpha(NULL),
105  fHistoMotherPi0PtOpenAngle(NULL),
106  fHistoMotherEtaPtOpenAngle(NULL),
107  fHistoMotherPtOpenAngle(NULL),
108  fHistoMotherPtOpenAngleBck(NULL),
109  fHistoMotherPi0NGoodESDTracksPt(NULL),
110  fHistoMotherEtaNGoodESDTracksPt(NULL),
111  fHistoMotherInvMassECalib(NULL),
112  fHistoMotherBackInvMassECalib(NULL),
113  fHistoClusterCandidates(NULL),
114  fHistoClusterCandidatesBinning(NULL),
115  fHistoFailIsolationCut(NULL),
116  fHistoIsoClusterPDGtoPt(NULL),
117  fHistoIsoClusterPDGtoPtMatSec(NULL),
118  fHistoIsoMotherPDGtoPt(NULL),
119  fHistoIsoMatSecConversionfromPhoton(NULL),
120  fHistoIsoPhotonfromPi0(NULL),
121  fHistoIsoInitPhotons(NULL),
122  fHistoIsoFragPhotons(NULL),
123  fHistoIsoInitPhotonsConversionCorrection(NULL),
124  fVectorDoubleCountMCInitIsoPhotons(0),
125  fHistoDoubleCountMCIsoInitPhotonCorrectPt(NULL),
126  fHistoDoubleCountMCIsoInitPhotonPt(NULL),
127  fHistoTruePhotonCandidatesIso(NULL),
128  fHistoTruePhotonsfromPi0DirectIso(NULL),
129  fHistoTrueFragPhotonsDirectIso(NULL),
130  fHistoTruePromptPhotonsDirectIso(NULL),
131  fHistoTruePhotonsfromPi0ConvIso(NULL),
132  fHistoTrueFragPhotonsConvIso(NULL),
133  fHistoTruePromptPhotonsConvIso(NULL),
134  fHistoTrueOtherSourcesIso(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  fHistoMotherInvMassPt(NULL),
463  fSparseMotherInvMassPtZM(NULL),
464  fHistoMotherBackInvMassPt(NULL),
465  fSparseMotherBackInvMassPtZM(NULL),
466  fHistoMotherPi0PtY(NULL),
467  fHistoMotherEtaPtY(NULL),
468  fHistoMotherPi0PtAlpha(NULL),
469  fHistoMotherEtaPtAlpha(NULL),
470  fHistoMotherPi0PtOpenAngle(NULL),
471  fHistoMotherEtaPtOpenAngle(NULL),
472  fHistoMotherPtOpenAngle(NULL),
473  fHistoMotherPtOpenAngleBck(NULL),
474  fHistoMotherPi0NGoodESDTracksPt(NULL),
475  fHistoMotherEtaNGoodESDTracksPt(NULL),
476  fHistoMotherInvMassECalib(NULL),
477  fHistoMotherBackInvMassECalib(NULL),
478  fHistoClusterCandidates(NULL),
479  fHistoClusterCandidatesBinning(NULL),
480  fHistoFailIsolationCut(NULL),
481  fHistoIsoClusterPDGtoPt(NULL),
482  fHistoIsoClusterPDGtoPtMatSec(NULL),
483  fHistoIsoMotherPDGtoPt(NULL),
484  fHistoIsoMatSecConversionfromPhoton(NULL),
485  fHistoIsoPhotonfromPi0(NULL),
486  fHistoIsoInitPhotons(NULL),
487  fHistoIsoFragPhotons(NULL),
488  fHistoIsoInitPhotonsConversionCorrection(NULL),
489  fVectorDoubleCountMCInitIsoPhotons(0),
490  fHistoDoubleCountMCIsoInitPhotonCorrectPt(NULL),
491  fHistoDoubleCountMCIsoInitPhotonPt(NULL),
492  fHistoTruePhotonCandidatesIso(NULL),
493  fHistoTruePhotonsfromPi0DirectIso(NULL),
494  fHistoTrueFragPhotonsDirectIso(NULL),
495  fHistoTruePromptPhotonsDirectIso(NULL),
496  fHistoTruePhotonsfromPi0ConvIso(NULL),
497  fHistoTrueFragPhotonsConvIso(NULL),
498  fHistoTruePromptPhotonsConvIso(NULL),
499  fHistoTrueOtherSourcesIso(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;
1133  if(fDoJetAnalysis){
1134  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,
1135  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,
1136  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,
1137  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,
1138  6.92e+00, 8.32e+00, 1.00e+01};
1139  }
1140  // Create histograms
1141  if(fOutputContainer != NULL){
1142  delete fOutputContainer;
1143  fOutputContainer = NULL;
1144  }
1145  if(fOutputContainer == NULL){
1146  fOutputContainer = new TList();
1147  fOutputContainer->SetOwner(kTRUE);
1148  }
1149 
1150  // Array of current cut's gammas
1151  fClusterCandidates = new TList();
1152  fClusterCandidates->SetOwner(kTRUE);
1153 
1154  fIsoCandidates = new TList();
1155  fIsoCandidates->SetOwner(kFALSE);
1156 
1157 
1158  fCutFolder = new TList*[fnCuts];
1159  fESDList = new TList*[fnCuts];
1160  fIsolation = new TList*[fnCuts];
1161 
1162  fHistoClusterCandidates = new TH1F*[fnCuts];
1164  fHistoFailIsolationCut = new TH1F*[fnCuts];
1165  if (fIsMC > 0){
1170  fHistoIsoPhotonfromPi0 = new TH1F*[fnCuts];
1171  fHistoIsoInitPhotons = new TH1F*[fnCuts];
1172  fHistoIsoFragPhotons = new TH1F*[fnCuts];
1176 
1182  fHistoTrueFragPhotonsConvIso = new TH1F*[fnCuts];
1184  fHistoTrueOtherSourcesIso = new TH1F*[fnCuts];
1185  }
1186 
1187  if(fDoTHnSparse){
1188  fBackList = new TList*[fnCuts];
1189  fMotherList = new TList*[fnCuts];
1190  }
1191  fHistoNEvents = new TH1F*[fnCuts];
1192  if(fIsMC > 1){
1193  fHistoNEventsWOWeight = new TH1F*[fnCuts];
1194  }
1195  if(fIsMC == 2){
1196  fProfileJetJetXSection = new TProfile*[fnCuts];
1197  fHistoJetJetNTrials = new TH1F*[fnCuts];
1198  }
1199 
1200  fHistoNGoodESDTracks = new TH1F*[fnCuts];
1201  fHistoVertexZ = new TH1F*[fnCuts];
1202  fHistoNGammaCandidates = new TH1F*[fnCuts];
1203  fHistoNGammaCandidatesBasic = new TH1F*[fnCuts];
1204  fHistoEventSphericity = new TH1F*[fnCuts];
1206  if(!fDoLightOutput){
1209  fHistoNV0Tracks = new TH1F*[fnCuts];
1210  }
1211  if(fIsHeavyIon==2) fProfileEtaShift = new TProfile*[fnCuts];
1212 
1213  if(fDoMesonAnalysis){
1216  if(!fDoLightOutput){
1219  }
1220  if (fDoMesonQA > 0 && fDoMesonQA < 3){
1221  fHistoMotherPi0PtY = new TH2F*[fnCuts];
1222  fHistoMotherEtaPtY = new TH2F*[fnCuts];
1229  }
1230  if (fDoMesonQA == 2){
1233  }
1234  }
1235 
1236  if(fProduceCellIDPlots){
1239  }
1240 
1241  fHistoClusGammaPt = new TH1F*[fnCuts];
1242  fHistoClusGammaE = new TH1F*[fnCuts];
1244  fHistoClusAllHeadersGammaPt = new TH1F*[fnCuts];
1246  if(!fDoLightOutput && fDoClusterQA > 0)
1248 
1249  if (fDoMesonQA == 4 && fIsMC == 0){
1250  fTreeList = new TList*[fnCuts];
1253  }
1254 
1255  if (fProduceTreeEOverP){
1256  fClusterTreeList = new TList*[fnCuts];
1257  tClusterEOverP = new TTree*[fnCuts];
1258  }
1259  if(fDoJetAnalysis){
1260  fJetHistograms = new TList*[fnCuts];
1261 
1262  fHistoPtJet = new TH1F*[fnCuts];
1263  fHistoJetEta = new TH1F*[fnCuts];
1264  fHistoJetPhi = new TH1F*[fnCuts];
1265  fHistoJetArea = new TH1F*[fnCuts];
1266  fHistoNJets = new TH1F*[fnCuts];
1267  fHistoEventwJets = new TH1F*[fnCuts];
1268  fHistoJetPi0PtRatio = new TH1F*[fnCuts];
1269  fHistoDoubleCounting = new TH1F*[fnCuts];
1270 
1274  fHistoRJetPi0Cand = new TH2F*[fnCuts];
1277  fHistoJetFragmFunc = new TH2F*[fnCuts];
1278  }
1279 
1280  for(Int_t iCut = 0; iCut<fnCuts;iCut++){
1281  TString cutstringEvent = ((AliConvEventCuts*)fEventCutArray->At(iCut))->GetCutNumber();
1282  TString cutstringCalo = ((AliCaloPhotonCuts*)fClusterCutArray->At(iCut))->GetCutNumber();
1283  TString cutstringMeson = "NoMesonCut";
1284  if(fDoMesonAnalysis)
1285  cutstringMeson = ((AliConversionMesonCuts*)fMesonCutArray->At(iCut))->GetCutNumber();
1286 
1287  fCutFolder[iCut] = new TList();
1288  fCutFolder[iCut]->SetName(Form("Cut Number %s_%s_%s", cutstringEvent.Data(), cutstringCalo.Data(), cutstringMeson.Data()));
1289  fCutFolder[iCut]->SetOwner(kTRUE);
1290  fOutputContainer->Add(fCutFolder[iCut]);
1291 
1292 
1293 
1294  fIsolation[iCut] = new TList();
1295  fIsolation[iCut]->SetName("Isolation_Results");
1296  fIsolation[iCut]->SetOwner(kTRUE);
1297  fCutFolder[iCut]->Add(fIsolation[iCut]);
1298 
1299  Int_t IsolationBins = 200;
1300  Int_t startIsolation = 0;
1301  Int_t endIsolation = 200;
1302 
1303  Int_t PDGBins = 800;
1304  Int_t startPDG = -400;
1305  Int_t endPDG = 400;
1306 
1307  Double_t fBinsPi013TeVPCMEMCTrigEG1IsoPt[19] = {0.0, 7.0, 7.5, 8.0, 8.5, 9.0, 9.5, 10.0, 10.5, 11.0, 11.5, 12.0, 12.5, 13.0, 13.5, 14.0, 15.0, 17.0, 20.0};
1308 
1309  fHistoClusterCandidates[iCut] = new TH1F("ClusterCandidates","Cluster Photon Candidates",nBinsClusterPt, arrClusPtBinning);
1310  fIsolation[iCut]->Add(fHistoClusterCandidates[iCut]);
1311  fHistoClusterCandidatesBinning[iCut] = new TH1F("ClusterCandidatesBinning","Cluster Photon Candidates",18, fBinsPi013TeVPCMEMCTrigEG1IsoPt);
1312  fIsolation[iCut]->Add(fHistoClusterCandidatesBinning[iCut]);
1313  fHistoFailIsolationCut[iCut] = new TH1F("FailIsolationCut","Cluster Candidates, failing Isolation Cut",nBinsClusterPt, arrClusPtBinning);
1314  fIsolation[iCut]->Add(fHistoFailIsolationCut[iCut]);
1315 
1316  if (fIsMC > 0){
1317 
1318  fHistoIsoClusterPDGtoPt[iCut] = new TH2F("IsoClusterPDGtoPt","Isolated Cluster PDG Codes",PDGBins,startPDG,endPDG,IsolationBins,startIsolation,endIsolation);
1319  fIsolation[iCut]->Add(fHistoIsoClusterPDGtoPt[iCut]);
1320  fHistoIsoClusterPDGtoPtMatSec[iCut] = new TH2F("IsoClusterPDGtoPtMatSec","Isolated Cluster PDG Codes for Maetrial Secondaries",PDGBins,startPDG,endPDG,IsolationBins,startIsolation,endIsolation);
1321  fIsolation[iCut]->Add(fHistoIsoClusterPDGtoPtMatSec[iCut]);
1322  fHistoIsoMotherPDGtoPt[iCut] = new TH2F("IsoMotherPDGtoPt","Isolated Cluster Mother PDG Codes",PDGBins,startPDG,endPDG,IsolationBins,startIsolation,endIsolation);
1323  fIsolation[iCut]->Add(fHistoIsoMotherPDGtoPt[iCut]);
1324  fHistoIsoMatSecConversionfromPhoton[iCut] = new TH1F("MatSecConversionfromPhoton","Mat. Sec. Conversion e- or e+ from Photon",IsolationBins,startIsolation,endIsolation);
1326  fHistoIsoPhotonfromPi0[iCut] = new TH1F("MatSecPhotonfromPi0","Mat. Sec. Photon from Pi0",IsolationBins,startIsolation,endIsolation);
1327  fIsolation[iCut]->Add(fHistoIsoPhotonfromPi0[iCut]);
1328 
1329  fHistoIsoInitPhotons[iCut] = new TH1F("IsolatedTrueGammaJets","Isolated Gamma Jets",IsolationBins,startIsolation,endIsolation);
1330  fIsolation[iCut]->Add(fHistoIsoInitPhotons[iCut]);
1331  fHistoIsoFragPhotons[iCut] = new TH1F("IsolatedTrueFragPhotons","Isolated Fragmentation Photons",IsolationBins,startIsolation,endIsolation);
1332  fIsolation[iCut]->Add(fHistoIsoFragPhotons[iCut]);
1333 
1334  fHistoIsoInitPhotonsConversionCorrection[iCut] = new TH1F("IsoTrueGammaJets_ConversionCorrection","Isolated Gamma Jets with Conversion Correction",IsolationBins,startIsolation,endIsolation);
1336  fHistoDoubleCountMCIsoInitPhotonCorrectPt[iCut] = new TH1F("DoubleCountIsoGammaJetCorrect","Double Count Isolated Gamma Jets for Material Sec.", IsolationBins,startIsolation,endIsolation);
1338  fHistoDoubleCountMCIsoInitPhotonPt[iCut] = new TH1F("DoubleCountIsoGammaJet","Double Count Isolated Gamma Jets", IsolationBins,startIsolation,endIsolation);
1340 
1341  fHistoTruePhotonCandidatesIso[iCut] = new TH1F("TruePhotonCandidatesIso","True Photon Candidates",nBinsClusterPt, arrClusPtBinning);
1342  fIsolation[iCut]->Add(fHistoTruePhotonCandidatesIso[iCut]);
1343  fHistoTruePhotonsfromPi0DirectIso[iCut] = new TH1F("TrueDirectPi0","True Photon from Pi0 Decay (Direct)",nBinsClusterPt, arrClusPtBinning);
1345  fHistoTrueFragPhotonsDirectIso[iCut] = new TH1F("TrueDirectFragPhoton","True Photon from Fragmentation (Direct)",nBinsClusterPt, arrClusPtBinning);
1346  fIsolation[iCut]->Add(fHistoTrueFragPhotonsDirectIso[iCut]);
1347  fHistoTruePromptPhotonsDirectIso[iCut] = new TH1F("TrueDirectPromptPhoton","True Prompt Photon (Direct)",nBinsClusterPt, arrClusPtBinning);
1348  fIsolation[iCut]->Add(fHistoTruePromptPhotonsDirectIso[iCut]);
1349  fHistoTruePhotonsfromPi0ConvIso[iCut] = new TH1F("TrueConvPi0","True Photon from Pi0 Decay (Conv)",nBinsClusterPt, arrClusPtBinning);
1350  fIsolation[iCut]->Add(fHistoTruePhotonsfromPi0ConvIso[iCut]);
1351  fHistoTrueFragPhotonsConvIso[iCut] = new TH1F("TrueConvFragPhoton","True Photon from Fragmentation (Conv)",nBinsClusterPt, arrClusPtBinning);
1352  fIsolation[iCut]->Add(fHistoTrueFragPhotonsConvIso[iCut]);
1353  fHistoTruePromptPhotonsConvIso[iCut] = new TH1F("TrueConvPromptPhoton","True Prompt Photon (Conv)",nBinsClusterPt, arrClusPtBinning);
1354  fIsolation[iCut]->Add(fHistoTruePromptPhotonsConvIso[iCut]);
1355  fHistoTrueOtherSourcesIso[iCut] = new TH1F("TruePhotonsOtherSources","True Photons from other sources",nBinsClusterPt, arrClusPtBinning);
1356  fIsolation[iCut]->Add(fHistoTrueOtherSourcesIso[iCut]);
1357 
1358  }
1359 
1360 
1361 
1362  if (fIsMC > 1){
1363  fHistoIsoClusterPDGtoPt[iCut]->Sumw2();
1364  fHistoIsoClusterPDGtoPtMatSec[iCut]->Sumw2();
1365  fHistoIsoMotherPDGtoPt[iCut]->Sumw2();
1366  fHistoIsoMatSecConversionfromPhoton[iCut]->Sumw2();
1367  fHistoIsoPhotonfromPi0[iCut]->Sumw2();
1368  fHistoIsoInitPhotons[iCut]->Sumw2();
1369  fHistoIsoFragPhotons[iCut]->Sumw2();
1372  fHistoDoubleCountMCIsoInitPhotonPt[iCut]->Sumw2();
1373 
1374  fHistoTruePhotonCandidatesIso[iCut]->Sumw2();
1375  fHistoTruePhotonsfromPi0DirectIso[iCut]->Sumw2();
1376  fHistoTrueFragPhotonsDirectIso[iCut]->Sumw2();
1377  fHistoTruePromptPhotonsDirectIso[iCut]->Sumw2();
1378  fHistoTruePhotonsfromPi0ConvIso[iCut]->Sumw2();
1379  fHistoTrueFragPhotonsConvIso[iCut]->Sumw2();
1380  fHistoTruePromptPhotonsConvIso[iCut]->Sumw2();
1381  fHistoTrueOtherSourcesIso[iCut]->Sumw2();
1382  }
1383 
1384 
1385 
1386  fESDList[iCut] = new TList();
1387  fESDList[iCut]->SetName(Form("%s_%s_%s ESD histograms", cutstringEvent.Data(), cutstringCalo.Data(), cutstringMeson.Data()));
1388  fESDList[iCut]->SetOwner(kTRUE);
1389  fCutFolder[iCut]->Add(fESDList[iCut]);
1390 
1391  fHistoNEvents[iCut] = new TH1F("NEvents", "NEvents", 15, -0.5, 13.5);
1392  fHistoNEvents[iCut]->GetXaxis()->SetBinLabel(1,"Accepted");
1393  fHistoNEvents[iCut]->GetXaxis()->SetBinLabel(2,"Centrality");
1394  fHistoNEvents[iCut]->GetXaxis()->SetBinLabel(3,"Miss. MC or inc. ev.");
1395  if (((AliConvEventCuts*)fEventCutArray->At(iCut))->IsSpecialTrigger() > 1 ){
1396  TString TriggerNames = "Not Trigger: ";
1397  TriggerNames = TriggerNames+ ( (AliConvEventCuts*)fEventCutArray->At(iCut))->GetSpecialTriggerName();
1398  fHistoNEvents[iCut]->GetXaxis()->SetBinLabel(4,TriggerNames.Data());
1399  } else {
1400  fHistoNEvents[iCut]->GetXaxis()->SetBinLabel(4,"Trigger");
1401  }
1402  fHistoNEvents[iCut]->GetXaxis()->SetBinLabel(5,"Vertex Z");
1403  fHistoNEvents[iCut]->GetXaxis()->SetBinLabel(6,"Cont. Vertex");
1404  fHistoNEvents[iCut]->GetXaxis()->SetBinLabel(7,"SPD Pile-Up");
1405  fHistoNEvents[iCut]->GetXaxis()->SetBinLabel(8,"no SDD");
1406  fHistoNEvents[iCut]->GetXaxis()->SetBinLabel(9,"no V0AND");
1407  fHistoNEvents[iCut]->GetXaxis()->SetBinLabel(10,"EMCAL problems");
1408  fHistoNEvents[iCut]->GetXaxis()->SetBinLabel(11,"rejectedForJetJetMC");
1409  fHistoNEvents[iCut]->GetXaxis()->SetBinLabel(12,"SPD hits vs tracklet");
1410  fHistoNEvents[iCut]->GetXaxis()->SetBinLabel(13,"Out-of-Bunch pileup Past-Future");
1411  fHistoNEvents[iCut]->GetXaxis()->SetBinLabel(14,"Pileup V0M-TPCout Tracks");
1412  fHistoNEvents[iCut]->GetXaxis()->SetBinLabel(15,"Sphericity");
1413  fESDList[iCut]->Add(fHistoNEvents[iCut]);
1414 
1415  if (fIsMC > 1){
1416  fHistoNEventsWOWeight[iCut] = new TH1F("NEventsWOWeight", "NEventsWOWeight", 15, -0.5, 13.5);
1417  fHistoNEventsWOWeight[iCut]->GetXaxis()->SetBinLabel(1,"Accepted");
1418  fHistoNEventsWOWeight[iCut]->GetXaxis()->SetBinLabel(2,"Centrality");
1419  fHistoNEventsWOWeight[iCut]->GetXaxis()->SetBinLabel(3,"Miss. MC or inc. ev.");
1420  if (((AliConvEventCuts*)fEventCutArray->At(iCut))->IsSpecialTrigger() > 1 ){
1421  TString TriggerNames = "Not Trigger: ";
1422  TriggerNames = TriggerNames+ ( (AliConvEventCuts*)fEventCutArray->At(iCut))->GetSpecialTriggerName();
1423  fHistoNEventsWOWeight[iCut]->GetXaxis()->SetBinLabel(4,TriggerNames.Data());
1424  } else {
1425  fHistoNEventsWOWeight[iCut]->GetXaxis()->SetBinLabel(4,"Trigger");
1426  }
1427  fHistoNEventsWOWeight[iCut]->GetXaxis()->SetBinLabel(5,"Vertex Z");
1428  fHistoNEventsWOWeight[iCut]->GetXaxis()->SetBinLabel(6,"Cont. Vertex");
1429  fHistoNEventsWOWeight[iCut]->GetXaxis()->SetBinLabel(7,"Pile-Up");
1430  fHistoNEventsWOWeight[iCut]->GetXaxis()->SetBinLabel(8,"no SDD");
1431  fHistoNEventsWOWeight[iCut]->GetXaxis()->SetBinLabel(9,"no V0AND");
1432  fHistoNEventsWOWeight[iCut]->GetXaxis()->SetBinLabel(10,"EMCAL problem");
1433  fHistoNEventsWOWeight[iCut]->GetXaxis()->SetBinLabel(11,"rejectedForJetJetMC");
1434  fHistoNEventsWOWeight[iCut]->GetXaxis()->SetBinLabel(12,"SPD hits vs tracklet");
1435  fHistoNEventsWOWeight[iCut]->GetXaxis()->SetBinLabel(13,"Out-of-Bunch pileup Past-Future");
1436  fHistoNEventsWOWeight[iCut]->GetXaxis()->SetBinLabel(14,"Pileup V0M-TPCout Tracks");
1437  fHistoNEventsWOWeight[iCut]->GetXaxis()->SetBinLabel(15,"Sphericity");
1438  fESDList[iCut]->Add(fHistoNEventsWOWeight[iCut]);
1439  }
1440  if (fIsMC == 2){
1441  fProfileJetJetXSection[iCut] = new TProfile("XSection", "XSection", 1, -0.5, 0.5);
1442  fESDList[iCut]->Add(fProfileJetJetXSection[iCut]);
1443  fHistoJetJetNTrials[iCut] = new TH1F("NTrials", "#sum{NTrials}", 1, 0, 1);
1444  fHistoJetJetNTrials[iCut]->GetXaxis()->SetBinLabel(1,"#sum{NTrials}");
1445  fESDList[iCut]->Add(fHistoJetJetNTrials[iCut]);
1446  }
1447 
1448  if(fIsHeavyIon == 1)
1449  fHistoNGoodESDTracks[iCut] = new TH1F("GoodESDTracks", "GoodESDTracks", 4000, 0, 4000);
1450  else if(fIsHeavyIon == 2)
1451  fHistoNGoodESDTracks[iCut] = new TH1F("GoodESDTracks", "GoodESDTracks", 400, 0, 400);
1452  else
1453  fHistoNGoodESDTracks[iCut] = new TH1F("GoodESDTracks", "GoodESDTracks", 200, 0, 200);
1454  fHistoNGoodESDTracks[iCut]->GetXaxis()->SetTitle("#primary tracks");
1455  fESDList[iCut]->Add(fHistoNGoodESDTracks[iCut]);
1456 
1457  if(((AliConvEventCuts*)fEventCutArray->At(iCut))->GetUseSphericity()!=0){
1458  fHistoEventSphericity[iCut] = new TH1F("EventSphericity", "EventSphericity", 100, 0, 1);
1459  fHistoEventSphericity[iCut]->GetXaxis()->SetTitle("S");
1460  fESDList[iCut]->Add(fHistoEventSphericity[iCut]);
1461  fV0Reader->SetCalcSphericity(kTRUE);
1462  fHistoEventSphericityvsNtracks[iCut] = new TH2F("EventSphericity vs Ntracks", "EventSphericity vs Ntracks", 100, 0, 1, 100, 0, 100);
1463  fHistoEventSphericityvsNtracks[iCut]->GetXaxis()->SetTitle("S");
1464  fHistoEventSphericityvsNtracks[iCut]->GetYaxis()->SetTitle("Ntracks");
1465  fESDList[iCut]->Add(fHistoEventSphericityvsNtracks[iCut]);
1466  }
1467 
1468  fHistoVertexZ[iCut] = new TH1F("VertexZ", "VertexZ", 200, -10, 10);
1469  fHistoVertexZ[iCut]->GetXaxis()->SetTitle("Z_{vtx} (cm)");
1470  fESDList[iCut]->Add(fHistoVertexZ[iCut]);
1471 
1472  if(fIsHeavyIon == 1)
1473  fHistoNGammaCandidatesBasic[iCut] = new TH1F("GammaCandidatesBasic", "GammaCandidatesBasic", 600, 0, 600);
1474  else if(fIsHeavyIon == 2)
1475  fHistoNGammaCandidatesBasic[iCut] = new TH1F("GammaCandidatesBasic", "GammaCandidatesBasic", 400, 0, 400);
1476  else
1477  fHistoNGammaCandidatesBasic[iCut] = new TH1F("GammaCandidatesBasic", "GammaCandidatesBasic", 100, 0, 100);
1478  fHistoNGammaCandidatesBasic[iCut]->GetXaxis()->SetTitle("#cluster candidates basic");
1479  fESDList[iCut]->Add(fHistoNGammaCandidatesBasic[iCut]);
1480 
1481 
1482  if(fIsHeavyIon == 1)
1483  fHistoNGammaCandidates[iCut] = new TH1F("GammaCandidates", "GammaCandidates", 200, 0, 200);
1484  else if(fIsHeavyIon == 2)
1485  fHistoNGammaCandidates[iCut] = new TH1F("GammaCandidates", "GammaCandidates", 100, 0, 100);
1486  else
1487  fHistoNGammaCandidates[iCut] = new TH1F("GammaCandidates", "GammaCandidates", 50, 0, 50);
1488  fHistoNGammaCandidates[iCut]->GetXaxis()->SetTitle("#cluster candidates with current cut");
1489  fESDList[iCut]->Add(fHistoNGammaCandidates[iCut]);
1490 
1491  if(!fDoLightOutput){
1492  if(fIsHeavyIon == 1)
1493  fHistoNGoodESDTracksVsNGammaCandidates[iCut] = new TH2F("GoodESDTracksVsGammaCandidates", "GoodESDTracksVsGammaCandidates", 4000, 0, 4000, 200, 0, 200);
1494  else if(fIsHeavyIon == 2)
1495  fHistoNGoodESDTracksVsNGammaCandidates[iCut] = new TH2F("GoodESDTracksVsGammaCandidates", "GoodESDTracksVsGammaCandidates", 400, 0, 400, 100, 0, 100);
1496  else
1497  fHistoNGoodESDTracksVsNGammaCandidates[iCut] = new TH2F("GoodESDTracksVsGammaCandidates", "GoodESDTracksVsGammaCandidates", 200, 0, 200, 50, 0, 50);
1498  fHistoNGoodESDTracksVsNGammaCandidates[iCut]->SetXTitle("#good tracks");
1499  fHistoNGoodESDTracksVsNGammaCandidates[iCut]->SetYTitle("#cluster candidates");
1501 
1502  fHistoSPDClusterTrackletBackground[iCut] = new TH2F("SPD tracklets vs SPD clusters", "SPD tracklets vs SPD clusters", 100, 0, 200, 250, 0, 1000);
1503  fESDList[iCut]->Add(fHistoSPDClusterTrackletBackground[iCut]);
1504 
1505  if(fIsHeavyIon == 1)
1506  fHistoNV0Tracks[iCut] = new TH1F("V0 Multiplicity", "V0 Multiplicity", 30000, 0, 30000);
1507  else if(fIsHeavyIon == 2)
1508  fHistoNV0Tracks[iCut] = new TH1F("V0 Multiplicity", "V0 Multiplicity", 2500, 0, 2500);
1509  else
1510  fHistoNV0Tracks[iCut] = new TH1F("V0 Multiplicity", "V0 Multiplicity", 1500, 0, 1500);
1511  fHistoNV0Tracks[iCut]->SetXTitle("V0 amplitude");
1512  fESDList[iCut]->Add(fHistoNV0Tracks[iCut]);
1513  }
1514 
1515  if(fIsHeavyIon==2) {
1516  fProfileEtaShift[iCut] = new TProfile("Eta Shift", "Eta Shift", 1, -0.5, 0.5);
1517  fProfileEtaShift[iCut]->SetXTitle("#eta shift");
1518  fESDList[iCut]->Add(fProfileEtaShift[iCut]);
1519  }
1520 
1521  if (fIsMC > 1){
1522  fHistoNEvents[iCut]->Sumw2();
1523  fHistoNGoodESDTracks[iCut]->Sumw2();
1524  if(((AliConvEventCuts*)fEventCutArray->At(iCut))->GetUseSphericity()!=0){
1525  fHistoEventSphericity[iCut]->Sumw2();
1526  fHistoEventSphericityvsNtracks[iCut]->Sumw2();
1527  }
1528  fHistoVertexZ[iCut]->Sumw2();
1529  fHistoNGammaCandidates[iCut]->Sumw2();
1530  fHistoNGammaCandidatesBasic[iCut]->Sumw2();
1531  if(!fDoLightOutput){
1533  fHistoSPDClusterTrackletBackground[iCut]->Sumw2();
1534  fHistoNV0Tracks[iCut]->Sumw2();
1535  }
1536  if(fIsHeavyIon==2) fProfileEtaShift[iCut]->Sumw2();
1537  }
1538 
1539  fHistoClusGammaPt[iCut] = new TH1F("ClusGamma_Pt", "ClusGamma_Pt", nBinsClusterPt, arrClusPtBinning);
1540  fHistoClusGammaPt[iCut]->SetXTitle("p_{T,clus} (GeV/c)");
1541  fESDList[iCut]->Add(fHistoClusGammaPt[iCut]);
1542  fHistoClusGammaE[iCut] = new TH1F("ClusGamma_E", "ClusGamma_E", nBinsClusterPt, arrClusPtBinning);
1543  fHistoClusGammaPt[iCut]->SetXTitle("E_{clus} (GeV/c)");
1544  fESDList[iCut]->Add(fHistoClusGammaE[iCut]);
1545  fHistoClusOverlapHeadersGammaPt[iCut] = new TH1F("ClusGammaOverlapHeaders_Pt", "ClusGammaOverlapHeaders_Pt", nBinsClusterPt, arrClusPtBinning);
1546  fHistoClusOverlapHeadersGammaPt[iCut]->SetXTitle("p_{T,clus} (GeV/c), selected header w/ overlap");
1547  fESDList[iCut]->Add(fHistoClusOverlapHeadersGammaPt[iCut]);
1548  fHistoClusAllHeadersGammaPt[iCut] = new TH1F("ClusGammaAllHeaders_Pt", "ClusGammaAllHeaders_Pt", nBinsClusterPt, arrClusPtBinning);
1549  fHistoClusAllHeadersGammaPt[iCut]->SetXTitle("p_{T,clus} (GeV/c), all headers");
1550  fESDList[iCut]->Add(fHistoClusAllHeadersGammaPt[iCut]);
1551  fHistoClusRejectedHeadersGammaPt[iCut] = new TH1F("ClusGammaRejectedHeaders_Pt", "ClusGammaRejectedHeaders_Pt", nBinsClusterPt, arrClusPtBinning);
1552  fHistoClusRejectedHeadersGammaPt[iCut]->SetXTitle("p_{T,clus} (GeV/c), rejected headers");
1553  fESDList[iCut]->Add(fHistoClusRejectedHeadersGammaPt[iCut]);
1554  if(!fDoLightOutput && fDoClusterQA > 0){
1555  fHistoClusGammaPtM02[iCut] = new TH2F("ClusGamma_Pt_M02", "ClusGamma_Pt_M02", nBinsClusterPt, arrClusPtBinning, 100, 0, 1);
1556  fHistoClusGammaPtM02[iCut]->SetXTitle("p_{T,clus} (GeV/c)");
1557  fHistoClusGammaPtM02[iCut]->SetYTitle("#sigma_{long}^{2}");
1558  fESDList[iCut]->Add(fHistoClusGammaPtM02[iCut]);
1559  }
1560 
1561  if (fIsMC > 1){
1562  fHistoClusGammaPt[iCut]->Sumw2();
1563  fHistoClusGammaE[iCut]->Sumw2();
1564  fHistoClusOverlapHeadersGammaPt[iCut]->Sumw2();
1565  fHistoClusAllHeadersGammaPt[iCut]->Sumw2();
1566  fHistoClusRejectedHeadersGammaPt[iCut]->Sumw2();
1567  if(!fDoLightOutput && fDoClusterQA > 0)fHistoClusGammaPtM02[iCut]->Sumw2();
1568  }
1569 
1570  if(fDoMesonAnalysis){
1571  fHistoMotherInvMassPt[iCut] = new TH2F("ESD_Mother_InvMass_Pt", "ESD_Mother_InvMass_Pt", 800, 0, 0.8, nBinsPt, arrPtBinning);
1572  fHistoMotherInvMassPt[iCut]->SetXTitle("M_{#gamma#gamma} (GeV/c^{2})");
1573  fHistoMotherInvMassPt[iCut]->SetYTitle("p_{T} (GeV/c)");
1574  fESDList[iCut]->Add(fHistoMotherInvMassPt[iCut]);
1575  fHistoMotherBackInvMassPt[iCut] = new TH2F("ESD_Background_InvMass_Pt", "ESD_Background_InvMass_Pt", 800, 0, 0.8, nBinsPt, arrPtBinning);
1576  fHistoMotherBackInvMassPt[iCut]->SetXTitle("M_{#gamma#gamma} (GeV/c^{2})");
1577  fHistoMotherBackInvMassPt[iCut]->SetYTitle("p_{T} (GeV/c)");
1578  fESDList[iCut]->Add(fHistoMotherBackInvMassPt[iCut]);
1579  if(!fDoLightOutput){
1580  fHistoMotherInvMassECalib[iCut] = new TH2F("ESD_Mother_InvMass_E_Calib", "ESD_Mother_InvMass_E_Calib", 800, 0, 0.8, nBinsPt, arrPtBinning);
1581  fHistoMotherInvMassECalib[iCut]->SetXTitle("M_{inv} (GeV/c^{2})");
1582  fHistoMotherInvMassECalib[iCut]->SetYTitle("E_{cluster}(GeV)");
1583  fESDList[iCut]->Add(fHistoMotherInvMassECalib[iCut]);
1584  fHistoMotherBackInvMassECalib[iCut] = new TH2F("ESD_Background_InvMass_E_Calib", "ESD_Background_InvMass_E_Calib", 800, 0, 0.8, nBinsPt, arrPtBinning);
1585  fHistoMotherBackInvMassECalib[iCut]->SetXTitle("M_{inv} (GeV/c^{2})");
1586  fHistoMotherBackInvMassECalib[iCut]->SetYTitle("E_{cluster}(GeV)");
1587  fESDList[iCut]->Add(fHistoMotherBackInvMassECalib[iCut]);
1588  }
1589 
1590  if (fIsMC > 1){
1591  fHistoMotherInvMassPt[iCut]->Sumw2();
1592  fHistoMotherBackInvMassPt[iCut]->Sumw2();
1593  if(!fDoLightOutput){
1594  fHistoMotherInvMassECalib[iCut]->Sumw2();
1595  fHistoMotherBackInvMassECalib[iCut]->Sumw2();
1596  }
1597  }
1598 
1599  if (fDoMesonQA > 0 && fDoMesonQA < 3 ){
1600  fHistoMotherPi0PtY[iCut] = new TH2F("ESD_MotherPi0_Pt_Y", "ESD_MotherPi0_Pt_Y", nBinsQAPt, arrQAPtBinning, 150, -1.5, 1.5);
1601  fHistoMotherPi0PtY[iCut]->SetXTitle("p_{T} (GeV/c)");
1602  fHistoMotherPi0PtY[iCut]->SetYTitle("y_{#pi^{0}}");
1603  fESDList[iCut]->Add(fHistoMotherPi0PtY[iCut]);
1604  fHistoMotherEtaPtY[iCut] = new TH2F("ESD_MotherEta_Pt_Y", "ESD_MotherEta_Pt_Y", nBinsQAPt, arrQAPtBinning, 150, -1.5, 1.5);
1605  fHistoMotherEtaPtY[iCut]->SetXTitle("p_{T} (GeV/c)");
1606  fHistoMotherEtaPtY[iCut]->SetYTitle("y_{#eta}");
1607  fESDList[iCut]->Add(fHistoMotherEtaPtY[iCut]);
1608  fHistoMotherPi0PtAlpha[iCut] = new TH2F("ESD_MotherPi0_Pt_Alpha", "ESD_MotherPi0_Pt_Alpha", nBinsQAPt, arrQAPtBinning, 100, 0, 1);
1609  fHistoMotherPi0PtAlpha[iCut]->SetXTitle("p_{T} (GeV/c)");
1610  fHistoMotherPi0PtAlpha[iCut]->SetYTitle("#alpha_{#pi^{0}}");
1611  fESDList[iCut]->Add(fHistoMotherPi0PtAlpha[iCut]);
1612  fHistoMotherEtaPtAlpha[iCut] = new TH2F("ESD_MotherEta_Pt_Alpha", "ESD_MotherEta_Pt_Alpha", nBinsQAPt, arrQAPtBinning, 100, 0, 1);
1613  fHistoMotherEtaPtAlpha[iCut]->SetXTitle("p_{T} (GeV/c)");
1614  fHistoMotherEtaPtAlpha[iCut]->SetYTitle("#alpha_{#eta}");
1615  fESDList[iCut]->Add(fHistoMotherEtaPtAlpha[iCut]);
1616  fHistoMotherPi0PtOpenAngle[iCut] = new TH2F("ESD_MotherPi0_Pt_OpenAngle", "ESD_MotherPi0_Pt_OpenAngle", nBinsQAPt, arrQAPtBinning,100,0, 0.5);
1617  fHistoMotherPi0PtOpenAngle[iCut]->SetXTitle("p_{T} (GeV/c)");
1618  fHistoMotherPi0PtOpenAngle[iCut]->SetYTitle("#theta_{#pi^{0}}");
1619  fESDList[iCut]->Add(fHistoMotherPi0PtOpenAngle[iCut]);
1620  fHistoMotherEtaPtOpenAngle[iCut] = new TH2F("ESD_MotherEta_Pt_OpenAngle", "ESD_MotherEta_Pt_OpenAngle", nBinsQAPt, arrQAPtBinning,180,0, 1.8);
1621  fHistoMotherEtaPtOpenAngle[iCut]->SetXTitle("p_{T} (GeV/c)");
1622  fHistoMotherEtaPtOpenAngle[iCut]->SetYTitle("#theta_{#eta}");
1623  fESDList[iCut]->Add(fHistoMotherEtaPtOpenAngle[iCut]);
1624  if(fIsHeavyIon == 1){
1625  fHistoMotherPi0NGoodESDTracksPt[iCut] = new TH2F("ESD_MotherPi0_GoodESDTracks_Pt", "ESD_MotherPi0_GoodESDTracks_Pt", 4000, 0, 4000, nBinsQAPt, arrQAPtBinning);
1626  fHistoMotherPi0NGoodESDTracksPt[iCut]->SetXTitle("# good tracks");
1627  fHistoMotherPi0NGoodESDTracksPt[iCut]->SetYTitle("p_{#pi^{0}, T} (GeV/c)");
1628  fHistoMotherEtaNGoodESDTracksPt[iCut] = new TH2F("ESD_MotherEta_GoodESDTracks_Pt", "ESD_MotherEta_GoodESDTracks_Pt", 4000, 0, 4000, nBinsQAPt, arrQAPtBinning);
1629  fHistoMotherEtaNGoodESDTracksPt[iCut]->SetXTitle("# good tracks");
1630  fHistoMotherEtaNGoodESDTracksPt[iCut]->SetYTitle("p_{#eta, T} (GeV/c)");
1631  }else if(fIsHeavyIon == 2){
1632  fHistoMotherPi0NGoodESDTracksPt[iCut] = new TH2F("ESD_MotherPi0_GoodESDTracks_Pt", "ESD_MotherPi0_GoodESDTracks_Pt", 400, 0, 400, nBinsQAPt, arrQAPtBinning);
1633  fHistoMotherPi0NGoodESDTracksPt[iCut]->SetXTitle("# good tracks");
1634  fHistoMotherPi0NGoodESDTracksPt[iCut]->SetYTitle("p_{#pi^{0}, T} (GeV/c)");
1635  fHistoMotherEtaNGoodESDTracksPt[iCut] = new TH2F("ESD_MotherEta_GoodESDTracks_Pt", "ESD_MotherEta_GoodESDTracks_Pt", 400, 0, 400, nBinsQAPt, arrQAPtBinning);
1636  fHistoMotherEtaNGoodESDTracksPt[iCut]->SetXTitle("# good tracks");
1637  fHistoMotherEtaNGoodESDTracksPt[iCut]->SetYTitle("p_{#eta, T} (GeV/c)");
1638  }else{
1639  fHistoMotherPi0NGoodESDTracksPt[iCut] = new TH2F("ESD_MotherPi0_GoodESDTracks_Pt", "ESD_MotherPi0_GoodESDTracks_Pt", 200, 0, 200, nBinsQAPt, arrQAPtBinning);
1640  fHistoMotherPi0NGoodESDTracksPt[iCut]->SetXTitle("# good tracks");
1641  fHistoMotherPi0NGoodESDTracksPt[iCut]->SetYTitle("p_{#pi^{0}, T} (GeV/c)");
1642  fHistoMotherEtaNGoodESDTracksPt[iCut] = new TH2F("ESD_MotherEta_GoodESDTracks_Pt", "ESD_MotherEta_GoodESDTracks_Pt", 200, 0, 200, nBinsQAPt, arrQAPtBinning);
1643  fHistoMotherEtaNGoodESDTracksPt[iCut]->SetXTitle("# good tracks");
1644  fHistoMotherEtaNGoodESDTracksPt[iCut]->SetYTitle("p_{#eta, T} (GeV/c)");
1645  }
1646  fESDList[iCut]->Add(fHistoMotherPi0NGoodESDTracksPt[iCut]);
1647  fESDList[iCut]->Add(fHistoMotherEtaNGoodESDTracksPt[iCut]);
1648  }
1649  if (fDoMesonQA == 2){
1650  fHistoMotherPtOpenAngle[iCut] = new TH2F("ESD_Mother_Pt_OpenAngle", "ESD_Mother_Pt_OpenAngle", nBinsQAPt, arrQAPtBinning,180,0, 1.8);
1651  fHistoMotherPtOpenAngle[iCut]->SetXTitle("p_{T} (GeV/c)");
1652  fHistoMotherPtOpenAngle[iCut]->SetYTitle("#theta");
1653  fESDList[iCut]->Add(fHistoMotherPtOpenAngle[iCut]);
1654  fHistoMotherPtOpenAngleBck[iCut] = new TH2F("ESD_MotherBck_Pt_OpenAngle", "ESD_MotherBck_Pt_OpenAngle", nBinsQAPt, arrQAPtBinning,180,0, 1.8);
1655  fHistoMotherPtOpenAngleBck[iCut]->SetXTitle("p_{T} (GeV/c)");
1656  fHistoMotherPtOpenAngleBck[iCut]->SetYTitle("#theta");
1657  fESDList[iCut]->Add(fHistoMotherPtOpenAngleBck[iCut]);
1658  if (fIsMC == 2){
1659  fHistoMotherPtOpenAngle[iCut]->Sumw2();
1660  fHistoMotherPtOpenAngleBck[iCut]->Sumw2();
1661  }
1662  }
1663 
1664  if (fIsMC > 1 && fDoMesonQA > 0 && fDoMesonQA < 3){
1665  fHistoMotherPi0PtY[iCut]->Sumw2();
1666  fHistoMotherEtaPtY[iCut]->Sumw2();
1667  fHistoMotherPi0PtAlpha[iCut]->Sumw2();
1668  fHistoMotherEtaPtAlpha[iCut]->Sumw2();
1669  fHistoMotherPi0PtOpenAngle[iCut]->Sumw2();
1670  fHistoMotherEtaPtOpenAngle[iCut]->Sumw2();
1671  fHistoMotherPi0NGoodESDTracksPt[iCut]->Sumw2();
1672  fHistoMotherEtaNGoodESDTracksPt[iCut]->Sumw2();
1673  }
1674 
1675  if (fProduceCellIDPlots){
1676  Int_t nMaxCells = 12*48*24;
1677  if(((AliCaloPhotonCuts*)fClusterCutArray->At(iCut))->GetClusterType() == 2) nMaxCells = 5*56*64;
1678  fHistCellIDvsClusterEnergy[iCut] = new TH2F("CellIDvsClusterEnergy", "CellIDvsClusterEnergy", 100, 0.5, 100., nMaxCells, 0, nMaxCells);
1679  fHistCellIDvsClusterEnergy[iCut]->SetXTitle("E_{clus} (GeV)");
1680  fHistCellIDvsClusterEnergy[iCut]->SetYTitle("Cell ID");
1682  fESDList[iCut]->Add(fHistCellIDvsClusterEnergy[iCut]);
1683  fHistCellIDvsClusterEnergyMax[iCut] = new TH2F("CellIDvsClusterEnergyMax", "CellIDvsClusterEnergyMax", 100, 0.5, 100., nMaxCells, 0, nMaxCells);
1684  fHistCellIDvsClusterEnergyMax[iCut]->SetXTitle("E_{clus} (GeV)");
1685  fHistCellIDvsClusterEnergyMax[iCut]->SetYTitle("Cell ID");
1687  fESDList[iCut]->Add(fHistCellIDvsClusterEnergyMax[iCut]);
1688  }
1689 
1690  if (fDoMesonQA == 4 && fIsMC == 0){
1691  fTreeList[iCut] = new TList();
1692  fTreeList[iCut]->SetName(Form("%s_%s_%s InvMass Tree", cutstringEvent.Data(), cutstringCalo.Data(), cutstringMeson.Data()));
1693  fTreeList[iCut]->SetOwner(kTRUE);
1694  fCutFolder[iCut]->Add(fTreeList[iCut]);
1695 
1696  tSigInvMassPtAlphaTheta[iCut] = new TTree("Sig_InvMass_Pt_Alpha_Theta_MixPool", "Sig_InvMass_Pt_Alpha_Theta_MixPool");
1697  tSigInvMassPtAlphaTheta[iCut]->Branch("InvMass",&fInvMassTreeInvMass,"fInvMassTreeInvMass/F");
1698  tSigInvMassPtAlphaTheta[iCut]->Branch("Pt",&fInvMassTreePt,"fInvMassTreePt/F");
1699  tSigInvMassPtAlphaTheta[iCut]->Branch("Alpha",&fInvMassTreeAlpha,"fInvMassTreeAlpha/F");
1700  tSigInvMassPtAlphaTheta[iCut]->Branch("Theta",&fInvMassTreeTheta,"fInvMassTreeTheta/F");
1701  tSigInvMassPtAlphaTheta[iCut]->Branch("MixPool",&fInvMassTreeMixPool,"fInvMassTreeMixPool/I");
1702  tSigInvMassPtAlphaTheta[iCut]->Branch("zVtx",&fInvMassTreeZVertex,"fInvMassTreeZVertex/F");
1703  tSigInvMassPtAlphaTheta[iCut]->Branch("Eta",&fInvMassTreeEta,"fInvMassTreeEta/F");
1704  fTreeList[iCut]->Add(tSigInvMassPtAlphaTheta[iCut]);
1705 
1706  tBckInvMassPtAlphaTheta[iCut] = new TTree("Bck_InvMass_Pt_Alpha_Theta_MixPool", "Bck_InvMass_Pt_Alpha_Theta_MixPool");
1707  tBckInvMassPtAlphaTheta[iCut]->Branch("InvMass",&fInvMassTreeInvMass,"fInvMassTreeInvMass/F");
1708  tBckInvMassPtAlphaTheta[iCut]->Branch("Pt",&fInvMassTreePt,"fInvMassTreePt/F");
1709  tBckInvMassPtAlphaTheta[iCut]->Branch("Alpha",&fInvMassTreeAlpha,"fInvMassTreeAlpha/F");
1710  tBckInvMassPtAlphaTheta[iCut]->Branch("Theta",&fInvMassTreeTheta,"fInvMassTreeTheta/F");
1711  tBckInvMassPtAlphaTheta[iCut]->Branch("MixPool",&fInvMassTreeMixPool,"fInvMassTreeMixPool/I");
1712  tBckInvMassPtAlphaTheta[iCut]->Branch("zVtx",&fInvMassTreeZVertex,"fInvMassTreeZVertex/F");
1713  tBckInvMassPtAlphaTheta[iCut]->Branch("Eta",&fInvMassTreeEta,"fInvMassTreeEta/F");
1714  fTreeList[iCut]->Add(tBckInvMassPtAlphaTheta[iCut]);
1715  }
1716 
1717  if (fProduceTreeEOverP ){
1718  fClusterTreeList[iCut] = new TList();
1719  fClusterTreeList[iCut]->SetName(Form("%s_%s EoverP Tree",cutstringEvent.Data(),cutstringCalo.Data()));
1720  fClusterTreeList[iCut]->SetOwner(kTRUE);
1721  fCutFolder[iCut]->Add(fClusterTreeList[iCut]);
1722 
1723  tClusterEOverP[iCut] = new TTree("EOverP_ClusE_ClusM02_ClusM20_TrackP_TrackPt", "EOverP_ClusE_ClusM02_ClusM20_TrackP_TrackPt");
1724  tClusterEOverP[iCut]->Branch("ClusE",&fClusterE,"fClusterE/F");
1725  tClusterEOverP[iCut]->Branch("ClusM02",&fClusterM02,"fClusterM02/F");
1726  tClusterEOverP[iCut]->Branch("ClusM20",&fClusterM20,"fClusterM20/F");
1727  tClusterEOverP[iCut]->Branch("ClusEP",&fClusterEP,"fClusterEP/F");
1728  tClusterEOverP[iCut]->Branch("ClusLeadCellID",&fClusterLeadCellID,"fClusterLeadCellID/I");
1729  if(fIsMC > 0) tClusterEOverP[iCut]->Branch("ClusClassification",&fClusterClassification,"fClusterClassification/I");
1730  tClusterEOverP[iCut]->Branch("ClusTrackDeltaEta",&fDeltaEta,"fDeltaEta/F");
1731  tClusterEOverP[iCut]->Branch("ClusTrackDeltaPhi",&fDeltaPhi,"fDeltaPhi/F");
1732  tClusterEOverP[iCut]->Branch("TrackPt",&fTrackPt,"fTrackPt/F");
1733  tClusterEOverP[iCut]->Branch("TrackPID_e",&fTrackPID_e,"fTrackPID_e/I");
1734  tClusterEOverP[iCut]->Branch("TrackPID_Pi",&fTrackPID_Pi,"fTrackPID_Pi/I");
1735  tClusterEOverP[iCut]->Branch("TrackPID_K",&fTrackPID_K,"fTrackPID_K/I");
1736  tClusterEOverP[iCut]->Branch("TrackPID_P",&fTrackPID_P,"fTrackPID_P/I");
1737  tClusterEOverP[iCut]->Branch("ClusIsoSumClusEt",&fClusterIsoSumClusterEt,"fClusterIsoSumClusterEt/F");
1738  tClusterEOverP[iCut]->Branch("ClusIsoSumTrackEt",&fClusterIsoSumTrackEt,"fClusterIsoSumTrackEt/F");
1739  fClusterTreeList[iCut]->Add(tClusterEOverP[iCut]);
1740  }
1741  }
1742  if(fDoJetAnalysis){
1743 
1744  fJetHistograms[iCut] = new TList();
1745  fJetHistograms[iCut]->SetOwner(kTRUE);
1746  fJetHistograms[iCut]->SetName(Form("%s_%s_%s Jet histograms", cutstringEvent.Data(), cutstringCalo.Data(), cutstringMeson.Data()));
1747 
1748  fHistoPtJet[iCut] = new TH1F("JetPt", "JetPt", 150, 0, 150);
1749  fJetHistograms[iCut]->Add(fHistoPtJet[iCut]);
1750  fHistoJetEta[iCut] = new TH1F("JetEta", "JetEta", 100, -1, 1);
1751  fJetHistograms[iCut]->Add(fHistoJetEta[iCut]);
1752  fHistoJetPhi[iCut] = new TH1F("JetPhi", "JetPhi", 70, 0, 7);
1753  fJetHistograms[iCut]->Add(fHistoJetPhi[iCut]);
1754  fHistoJetArea[iCut] = new TH1F("JetArea", "JetArea", 50, 0, 1);
1755  fJetHistograms[iCut]->Add(fHistoJetArea[iCut]);
1756  fHistoNJets[iCut] = new TH1F("NJets", "NJets", 10, 0, 10);
1757  fJetHistograms[iCut]->Add(fHistoNJets[iCut]);
1758  fHistoEventwJets[iCut] = new TH1F("NEvents_with_Jets", "NEvents_with_Jets", 5, 0, 5);
1759  fJetHistograms[iCut]->Add(fHistoEventwJets[iCut]);
1760  fHistoJetPi0PtRatio[iCut] = new TH1F("Ratio_Pt_Pi0_Jet", "Ratio_Pt_Pi0_Jet", 20, 0, 1.5);
1761  fJetHistograms[iCut]->Add(fHistoJetPi0PtRatio[iCut]);
1762 
1763  fHistoJetMotherInvMassPt[iCut] = new TH2F("ESD_Pi0Jet_Mother_InvMass_Pt", "ESD_Pi0Jet_Mother_InvMass_Pt", 800, 0, 0.8, nBinsPt, arrPtBinning);
1764  fJetHistograms[iCut]->Add(fHistoJetMotherInvMassPt[iCut]);
1765  fHistoEtaPhiJetPi0Cand[iCut] = new TH2F("Eta_Phi_Distr_Pi0Jet", "Eta_Phi_Distr_Pi0Jet", 20, 0, M_PI, 20, -1, 1);
1766  fJetHistograms[iCut]->Add(fHistoEtaPhiJetPi0Cand[iCut]);
1767  fHistoRJetPi0Cand[iCut] = new TH2F("ESD_RPi0Jet_Pt", "ESD_RPi0Jet_Pt", 35, 0, 3.5, nBinsPt, arrPtBinning);
1768  fJetHistograms[iCut]->Add(fHistoRJetPi0Cand[iCut]);
1769  fHistoPi0InJetMotherInvMassPt[iCut] = new TH2F("ESD_Pi0inJet_Mother_InvMass_Pt", "ESD_Pi0inJet_Mother_InvMass_Pt", 800, 0, 0.8, nBinsPt, arrPtBinning);
1771  fHistoMotherBackJetInvMassPt[iCut] = new TH2F("ESD_Jet_Background_InvMass_Pt", "ESD_Jet_Background_InvMass_Pt", 800, 0, 0.8, nBinsPt, arrPtBinning);
1772  fJetHistograms[iCut]->Add(fHistoMotherBackJetInvMassPt[iCut]);
1773  fHistoEtaPhiJetWithPi0Cand[iCut] = new TH2F("Eta_Phi_Distr_Pi0inJet", "Eta_Phi_Distr_Pi0inJet", 15, 0, 0.4, 15, -0.4, 0.4);
1774  fJetHistograms[iCut]->Add(fHistoEtaPhiJetWithPi0Cand[iCut]);
1775  fHistoDoubleCounting[iCut] = new TH1F("Double_Counting_Mesons_Jets", "Double_Counting_Mesons_Jets", 6, 0, 6);
1776  fJetHistograms[iCut]->Add(fHistoDoubleCounting[iCut]);
1777  fHistoJetFragmFunc[iCut] = new TH2F("ESD_Pi0inJet_FragmentationFunc", "ESD_Pi0inJet_FragmentationFunc", 50, arrLogBinning, 150, 0., 150.);
1778  fJetHistograms[iCut]->Add(fHistoJetFragmFunc[iCut]);
1779  }
1780 
1781  if( ((AliConversionMesonCuts*)fMesonCutArray->At(iCut))->DoSectorMixing() ){
1782  fV0Reader->SetCalcSector(kTRUE);
1783  }
1784  }
1785  if(fDoMesonAnalysis){
1786  InitBack(); // Init Background Handler
1787  }
1788 
1789  if(fIsMC> 0){
1790  // MC Histogramms
1791  fMCList = new TList*[fnCuts];
1792  // True Histogramms
1793  fTrueList = new TList*[fnCuts];
1794  // Selected Header List
1795  if (fDoMesonQA ==3){
1796  fTreeList = new TList*[fnCuts];
1798  }
1799 
1800  if(fDoJetAnalysis) {
1815  fHistoMCPi0JetInAccPt = new TH1F*[fnCuts];
1816  fHistoMCPi0inJetInAccPt = new TH1F*[fnCuts];
1817  fHistoMCEtaJetInAccPt = new TH1F*[fnCuts];
1818  fHistoMCEtainJetInAccPt = new TH1F*[fnCuts];
1827  if(fDoJetQA){
1829  }
1830  }
1831 
1832  if(!fDoLightOutput){
1833  fHistoMCHeaders = new TH1I*[fnCuts];
1834  fHistoMCAllGammaPt = new TH1F*[fnCuts];
1836  fHistoMCDecayGammaPi0Pt = new TH1F*[fnCuts];
1837  fHistoMCDecayGammaRhoPt = new TH1F*[fnCuts];
1838  fHistoMCDecayGammaEtaPt = new TH1F*[fnCuts];
1839  fHistoMCDecayGammaOmegaPt = new TH1F*[fnCuts];
1840  fHistoMCDecayGammaEtapPt = new TH1F*[fnCuts];
1841  fHistoMCDecayGammaPhiPt = new TH1F*[fnCuts];
1842  fHistoMCDecayGammaSigmaPt = new TH1F*[fnCuts];
1845  if (fDoClusterQA > 1) {
1858  }
1859  }
1860 
1861  fHistoTrueClusGammaPt = new TH1F*[fnCuts];
1862  if(!fDoLightOutput){
1864  fHistoTruePrimaryClusGammaPt = new TH1F*[fnCuts];
1878  fHistoTrueNLabelsInClus = new TH1F*[fnCuts];
1879  }
1882 
1883 // fHistoTruePi0NonLinearity = new TH2F*[fnCuts];
1884 // fHistoTrueEtaNonLinearity = new TH2F*[fnCuts];
1885 
1886  if (fDoClusterQA > 0){
1887  fHistoTrueClusUnConvGammaPt = new TH1F*[fnCuts];
1889  if (!fDoLightOutput)
1891  fHistoTrueClusElectronPt = new TH1F*[fnCuts];
1892  fHistoTrueClusConvGammaPt = new TH1F*[fnCuts];
1893  fHistoTrueClusConvGammaMCPt = new TH1F*[fnCuts];
1895  fHistoTrueClusMergedGammaPt = new TH1F*[fnCuts];
1897  fHistoTrueClusDalitzPt = new TH1F*[fnCuts];
1898  fHistoTrueClusDalitzMergedPt = new TH1F*[fnCuts];
1900  fHistoTrueClusShowerPt = new TH1F*[fnCuts];
1901  fHistoTrueClusSubLeadingPt = new TH1F*[fnCuts];
1902  fHistoTrueClusNParticles = new TH1F*[fnCuts];
1903  fHistoTrueClusEMNonLeadingPt = new TH1F*[fnCuts];
1904  }
1905 
1906  if(fDoMesonAnalysis){
1907  fHistoMCPi0Pt = new TH1F*[fnCuts];
1908  fHistoMCPi0WOWeightPt = new TH1F*[fnCuts];
1909  fHistoMCEtaPt = new TH1F*[fnCuts];
1910  fHistoMCEtaWOWeightPt = new TH1F*[fnCuts];
1911  fHistoMCPi0InAccPt = new TH1F*[fnCuts];
1912  fHistoMCEtaInAccPt = new TH1F*[fnCuts];
1913  if (fIsMC > 1){
1914  fHistoMCPi0WOEvtWeightPt = new TH1F*[fnCuts];
1915  fHistoMCEtaWOEvtWeightPt = new TH1F*[fnCuts];
1918  }
1919 
1936  if(!fDoLightOutput){
1939  }
1943  fHistoMCSecPi0Source = new TH1F*[fnCuts];
1944  fHistoMCSecEtaPt = new TH1F*[fnCuts];
1945  fHistoMCSecEtaSource = new TH1F*[fnCuts];
1946 
1947  if (fDoMesonQA > 0 && fDoMesonQA < 3 ){
1948  fHistoMCPi0PtY = new TH2F*[fnCuts];
1949  fHistoMCEtaPtY = new TH2F*[fnCuts];
1950  fHistoMCPi0PtAlpha = new TH2F*[fnCuts];
1951  fHistoMCEtaPtAlpha = new TH2F*[fnCuts];
1952  if (fIsMC == 2){
1953  fHistoMCPi0PtJetPt = new TH2F*[fnCuts];
1954  fHistoMCEtaPtJetPt = new TH2F*[fnCuts];
1955  }
1956 
1957  if (fIsMC < 2){
1978  }
1979  fHistoTruePi0PtY = new TH2F*[fnCuts];
1980  fHistoTrueEtaPtY = new TH2F*[fnCuts];
1989  }
1990  if (fDoMesonQA==2){
2005  }
2006  }
2007 
2008 
2009 
2010  for(Int_t iCut = 0; iCut<fnCuts;iCut++){
2011  TString cutstringEvent = ((AliConvEventCuts*)fEventCutArray->At(iCut))->GetCutNumber();
2012  TString cutstringCalo = ((AliCaloPhotonCuts*)fClusterCutArray->At(iCut))->GetCutNumber();
2013  TString cutstringMeson = "NoMesonCut";
2014  if(fDoMesonAnalysis)
2015  cutstringMeson = ((AliConversionMesonCuts*)fMesonCutArray->At(iCut))->GetCutNumber();
2016 
2017  fMCList[iCut] = new TList();
2018  fMCList[iCut]->SetName(Form("%s_%s_%s MC histograms", cutstringEvent.Data(), cutstringCalo.Data(), cutstringMeson.Data()));
2019  fMCList[iCut]->SetOwner(kTRUE);
2020  fCutFolder[iCut]->Add(fMCList[iCut]);
2021 
2022  if(!fDoLightOutput){
2023  fHistoMCHeaders[iCut] = new TH1I("MC_Headers", "MC_Headers", 20, 0, 20);
2024  fHistoMCHeaders[iCut]->SetXTitle("accepted headers");
2025  fMCList[iCut]->Add(fHistoMCHeaders[iCut]);
2026  fHistoMCAllGammaPt[iCut] = new TH1F("MC_AllGamma_Pt", "MC_AllGamma_Pt", nBinsClusterPt, arrClusPtBinning);
2027  fHistoMCAllGammaPt[iCut]->SetXTitle("p_{T} (GeV/c)");
2028  fMCList[iCut]->Add(fHistoMCAllGammaPt[iCut]);
2029  fHistoMCAllSecondaryGammaPt[iCut] = new TH2F("MC_AllSecondaryGamma_Pt", "MC_AllSecondaryGamma_Pt", nBinsClusterPt, arrClusPtBinning, 5, -0.5, 4.5);
2030  fHistoMCAllSecondaryGammaPt[iCut]->GetYaxis()->SetBinLabel(1,"K0s");
2031  fHistoMCAllSecondaryGammaPt[iCut]->GetYaxis()->SetBinLabel(2,"K0l");
2032  fHistoMCAllSecondaryGammaPt[iCut]->GetYaxis()->SetBinLabel(3,"Lambda");
2033  fHistoMCAllSecondaryGammaPt[iCut]->GetYaxis()->SetBinLabel(4,"Eta");
2034  fHistoMCAllSecondaryGammaPt[iCut]->GetYaxis()->SetBinLabel(5,"rest");
2035  fHistoMCAllSecondaryGammaPt[iCut]->SetXTitle("p_{T} (GeV/c)");
2036  fHistoMCAllSecondaryGammaPt[iCut]->SetYTitle("sec. particle");
2037  fMCList[iCut]->Add(fHistoMCAllSecondaryGammaPt[iCut]);
2038  fHistoMCDecayGammaPi0Pt[iCut] = new TH1F("MC_DecayGammaPi0_Pt", "MC_DecayGammaPi0_Pt", nBinsClusterPt, arrClusPtBinning);
2039  fHistoMCDecayGammaPi0Pt[iCut]->SetXTitle("p_{T} (GeV/c)");
2040  fMCList[iCut]->Add(fHistoMCDecayGammaPi0Pt[iCut]);
2041  fHistoMCDecayGammaRhoPt[iCut] = new TH1F("MC_DecayGammaRho_Pt", "MC_DecayGammaRho_Pt", nBinsClusterPt, arrClusPtBinning);
2042  fHistoMCDecayGammaRhoPt[iCut]->SetXTitle("p_{T} (GeV/c)");
2043  fMCList[iCut]->Add(fHistoMCDecayGammaRhoPt[iCut]);
2044  fHistoMCDecayGammaEtaPt[iCut] = new TH1F("MC_DecayGammaEta_Pt", "MC_DecayGammaEta_Pt", nBinsClusterPt, arrClusPtBinning);
2045  fHistoMCDecayGammaEtaPt[iCut]->SetXTitle("p_{T} (GeV/c)");
2046  fMCList[iCut]->Add(fHistoMCDecayGammaEtaPt[iCut]);
2047  fHistoMCDecayGammaOmegaPt[iCut] = new TH1F("MC_DecayGammaOmega_Pt", "MC_DecayGammaOmmega_Pt", nBinsClusterPt, arrClusPtBinning);
2048  fHistoMCDecayGammaOmegaPt[iCut]->SetXTitle("p_{T} (GeV/c)");
2049  fMCList[iCut]->Add(fHistoMCDecayGammaOmegaPt[iCut]);
2050  fHistoMCDecayGammaEtapPt[iCut] = new TH1F("MC_DecayGammaEtap_Pt", "MC_DecayGammaEtap_Pt", nBinsClusterPt, arrClusPtBinning);
2051  fHistoMCDecayGammaEtapPt[iCut]->SetXTitle("p_{T} (GeV/c)");
2052  fMCList[iCut]->Add(fHistoMCDecayGammaEtapPt[iCut]);
2053  fHistoMCDecayGammaPhiPt[iCut] = new TH1F("MC_DecayGammaPhi_Pt", "MC_DecayGammaPhi_Pt", nBinsClusterPt, arrClusPtBinning);
2054  fHistoMCDecayGammaPhiPt[iCut]->SetXTitle("p_{T} (GeV/c)");
2055  fMCList[iCut]->Add(fHistoMCDecayGammaPhiPt[iCut]);
2056  fHistoMCDecayGammaSigmaPt[iCut] = new TH1F("MC_DecayGammaSigma_Pt", "MC_DecayGammaSigma_Pt", nBinsClusterPt, arrClusPtBinning);
2057  fHistoMCDecayGammaSigmaPt[iCut]->SetXTitle("p_{T} (GeV/c)");
2058  fMCList[iCut]->Add(fHistoMCDecayGammaSigmaPt[iCut]);
2059 
2060  if (fIsMC > 1){
2061  fHistoMCAllGammaPt[iCut]->Sumw2();
2062  fHistoMCAllSecondaryGammaPt[iCut]->Sumw2();
2063  fHistoMCDecayGammaPi0Pt[iCut]->Sumw2();
2064  fHistoMCDecayGammaRhoPt[iCut]->Sumw2();
2065  fHistoMCDecayGammaEtaPt[iCut]->Sumw2();
2066  fHistoMCDecayGammaOmegaPt[iCut]->Sumw2();
2067  fHistoMCDecayGammaEtapPt[iCut]->Sumw2();
2068  fHistoMCDecayGammaPhiPt[iCut]->Sumw2();
2069  fHistoMCDecayGammaSigmaPt[iCut]->Sumw2();
2070  }
2071  }
2072 
2073  if(fDoMesonAnalysis){
2074  fHistoMCPi0Pt[iCut] = new TH1F("MC_Pi0_Pt", "MC_Pi0_Pt", (Int_t)((maxPt-minPt)/binWidthPt), minPt, maxPt);
2075  fHistoMCPi0Pt[iCut]->SetXTitle("p_{T} (GeV/c)");
2076  fHistoMCPi0Pt[iCut]->Sumw2();
2077  fMCList[iCut]->Add(fHistoMCPi0Pt[iCut]);
2078  fHistoMCPi0WOWeightPt[iCut] = new TH1F("MC_Pi0_WOWeights_Pt", "MC_Pi0_WOWeights_Pt", (Int_t)((maxPt-minPt)/binWidthPt), minPt, maxPt);
2079  fHistoMCPi0WOWeightPt[iCut]->Sumw2();
2080  fHistoMCPi0WOWeightPt[iCut]->SetXTitle("p_{T} (GeV/c)");
2081  fMCList[iCut]->Add(fHistoMCPi0WOWeightPt[iCut]);
2082 
2083  fHistoMCEtaPt[iCut] = new TH1F("MC_Eta_Pt", "MC_Eta_Pt", (Int_t)((maxPt-minPt)/binWidthPt), minPt, maxPt);
2084  fHistoMCEtaPt[iCut]->SetXTitle("p_{T} (GeV/c)");
2085  fHistoMCEtaPt[iCut]->Sumw2();
2086  fMCList[iCut]->Add(fHistoMCEtaPt[iCut]);
2087  fHistoMCEtaWOWeightPt[iCut] = new TH1F("MC_Eta_WOWeights_Pt", "MC_Eta_WOWeights_Pt", (Int_t)((maxPt-minPt)/binWidthPt), minPt, maxPt);
2088  fHistoMCEtaWOWeightPt[iCut]->SetXTitle("p_{T} (GeV/c)");
2089  fHistoMCEtaWOWeightPt[iCut]->Sumw2();
2090  fMCList[iCut]->Add(fHistoMCEtaWOWeightPt[iCut]);
2091  fHistoMCPi0InAccPt[iCut] = new TH1F("MC_Pi0InAcc_Pt", "MC_Pi0InAcc_Pt", (Int_t)((maxPt-minPt)/binWidthPt), minPt, maxPt);
2092  fHistoMCPi0InAccPt[iCut]->SetXTitle("p_{T} (GeV/c)");
2093  fHistoMCPi0InAccPt[iCut]->Sumw2();
2094  fMCList[iCut]->Add(fHistoMCPi0InAccPt[iCut]);
2095  fHistoMCEtaInAccPt[iCut] = new TH1F("MC_EtaInAcc_Pt", "MC_EtaInAcc_Pt", (Int_t)((maxPt-minPt)/binWidthPt), minPt, maxPt);
2096  fHistoMCEtaInAccPt[iCut]->SetXTitle("p_{T} (GeV/c)");
2097  fHistoMCEtaInAccPt[iCut]->Sumw2();
2098  fMCList[iCut]->Add(fHistoMCEtaInAccPt[iCut]);
2099  if (fIsMC > 1){
2100  fHistoMCPi0WOWeightPt[iCut]->Sumw2();
2101  fHistoMCEtaWOWeightPt[iCut]->Sumw2();
2102  fHistoMCPi0WOEvtWeightPt[iCut] = new TH1F("MC_Pi0_WOEventWeights_Pt", "MC_Pi0_WOEventWeights_Pt", (Int_t)((maxPt-minPt)/binWidthPt), minPt, maxPt);
2103  fHistoMCPi0WOEvtWeightPt[iCut]->SetXTitle("p_{T} (GeV/c)");
2104  fMCList[iCut]->Add(fHistoMCPi0WOEvtWeightPt[iCut]);
2105  fHistoMCEtaWOEvtWeightPt[iCut] = new TH1F("MC_Eta_WOEventWeights_Pt", "MC_Eta_WOEventWeights_Pt", (Int_t)((maxPt-minPt)/binWidthPt), minPt, maxPt);
2106  fHistoMCEtaWOEvtWeightPt[iCut]->SetXTitle("p_{T} (GeV/c)");
2107  fMCList[iCut]->Add(fHistoMCEtaWOEvtWeightPt[iCut]);
2108  fHistoMCPi0WOEvtWeightInAccPt[iCut] = new TH1F("MC_Pi0WOEvtWeightInAcc_Pt", "MC_Pi0WOEvtWeightInAcc_Pt", (Int_t)((maxPt-minPt)/binWidthPt), minPt, maxPt);
2109  fHistoMCPi0WOEvtWeightInAccPt[iCut]->SetXTitle("p_{T} (GeV/c)");
2110  fMCList[iCut]->Add(fHistoMCPi0WOEvtWeightInAccPt[iCut]);
2111  fHistoMCEtaWOEvtWeightInAccPt[iCut] = new TH1F("MC_EtaWOEvtWeightInAcc_Pt", "MC_EtaWOEvtWeightInAcc_Pt", (Int_t)((maxPt-minPt)/binWidthPt), minPt, maxPt);
2112  fHistoMCEtaWOEvtWeightInAccPt[iCut]->SetXTitle("p_{T} (GeV/c)");
2113  fMCList[iCut]->Add(fHistoMCEtaWOEvtWeightInAccPt[iCut]);
2114  if (fDoMesonQA > 0 && fDoMesonQA < 3 && fIsMC == 2){
2115  fHistoMCPi0PtJetPt[iCut] = new TH2F("MC_Pi0_Pt_JetPt", "MC_Pi0_Pt_JetPt", nBinsQAPt, arrQAPtBinning, 200, 0, 200);
2116  fHistoMCPi0PtJetPt[iCut]->SetXTitle("p_{T} (GeV/c)");
2117  fHistoMCPi0PtJetPt[iCut]->SetYTitle("p_{jet, T} (GeV/c)");
2118  fHistoMCPi0PtJetPt[iCut]->Sumw2();
2119  fMCList[iCut]->Add(fHistoMCPi0PtJetPt[iCut]);
2120  fHistoMCEtaPtJetPt[iCut] = new TH2F("MC_Eta_Pt_JetPt", "MC_Eta_Pt_JetPt", nBinsQAPt, arrQAPtBinning, 200, 0, 200);
2121  fHistoMCEtaPtJetPt[iCut]->SetXTitle("p_{T} (GeV/c)");
2122  fHistoMCEtaPtJetPt[iCut]->SetYTitle("p_{jet, T} (GeV/c)");
2123  fHistoMCEtaPtJetPt[iCut]->Sumw2();
2124  fMCList[iCut]->Add(fHistoMCEtaPtJetPt[iCut]);
2125  }
2126  }
2127 
2128  fHistoMCPrimaryPtvsSource[iCut] = new TH2F("MC_Primary_Pt_Source", "MC_Primary_Pt_Source", (Int_t)((maxPt-minPt)/binWidthPt), minPt, maxPt, 7, -0.5, 6.5);
2129  fHistoMCPrimaryPtvsSource[iCut]->GetYaxis()->SetBinLabel(1,"Pi+");
2130  fHistoMCPrimaryPtvsSource[iCut]->GetYaxis()->SetBinLabel(2,"Pi-");
2131  fHistoMCPrimaryPtvsSource[iCut]->GetYaxis()->SetBinLabel(3,"K+");
2132  fHistoMCPrimaryPtvsSource[iCut]->GetYaxis()->SetBinLabel(4,"K-");
2133  fHistoMCPrimaryPtvsSource[iCut]->GetYaxis()->SetBinLabel(5,"K0s");
2134  fHistoMCPrimaryPtvsSource[iCut]->GetYaxis()->SetBinLabel(6,"K0l");
2135  fHistoMCPrimaryPtvsSource[iCut]->GetYaxis()->SetBinLabel(7,"Lambda");
2136  fHistoMCPrimaryPtvsSource[iCut]->SetXTitle("p_{T} (GeV/c)");
2137  fHistoMCPrimaryPtvsSource[iCut]->SetYTitle("particle");
2138  fMCList[iCut]->Add(fHistoMCPrimaryPtvsSource[iCut]);
2139 
2140  fHistoMCSecPi0Source[iCut] = new TH1F("MC_SecPi0_Source", "MC_SecPi0_Source", 5000, 0., 5000);
2141  fHistoMCSecPi0Source[iCut]->SetYTitle("source PDG");
2142  fMCList[iCut]->Add(fHistoMCSecPi0Source[iCut]);
2143  fHistoMCSecEtaSource[iCut] = new TH1F("MC_SecEta_Source", "MC_SecEta_Source", 5000, 0, 5000);
2144  fHistoMCSecEtaSource[iCut]->SetYTitle("source PDG");
2145  fMCList[iCut]->Add(fHistoMCSecEtaSource[iCut]);
2146  fHistoMCSecPi0PtvsSource[iCut] = new TH2F("MC_SecPi0_Pt_Source", "MC_SecPi0_Pt_Source", (Int_t)((maxPt-minPt)/binWidthPt), minPt, maxPt, 16, -0.5, 15.5);
2147  fHistoMCSecPi0PtvsSource[iCut]->SetXTitle("p_{T} (GeV/c)");
2148  fHistoMCSecPi0PtvsSource[iCut]->SetYTitle("source");
2149  fMCList[iCut]->Add(fHistoMCSecPi0PtvsSource[iCut]);
2150  fHistoMCSecPi0InAccPtvsSource[iCut] = new TH2F("MC_SecPi0InAcc_Pt_Source", "MC_SecPi0InAcc_Pt_Source", (Int_t)((maxPt-minPt)/binWidthPt), minPt, maxPt, 16, -0.5, 15.5);
2151  fHistoMCSecPi0InAccPtvsSource[iCut]->SetXTitle("p_{T} (GeV/c)");
2152  fHistoMCSecPi0InAccPtvsSource[iCut]->SetYTitle("source");
2153  fMCList[iCut]->Add(fHistoMCSecPi0InAccPtvsSource[iCut]);
2154  fHistoMCSecEtaPt[iCut] = new TH1F("MC_SecEta_Pt", "MC_SecEta_Pt", (Int_t)((maxPt-minPt)/binWidthPt), minPt, maxPt);
2155  fHistoMCSecEtaPt[iCut]->SetXTitle("p_{T} (GeV/c)");
2156  fMCList[iCut]->Add(fHistoMCSecEtaPt[iCut]);
2157  if (fIsMC == 2) {
2158  fHistoMCPrimaryPtvsSource[iCut]->Sumw2();
2159  fHistoMCSecPi0PtvsSource[iCut]->Sumw2();
2160  fHistoMCSecPi0InAccPtvsSource[iCut]->Sumw2();
2161  fHistoMCSecEtaPt[iCut]->Sumw2();
2162  }
2163 
2164 
2165  if (fDoMesonQA > 0 && fDoMesonQA < 3){
2166  fHistoMCPi0PtY[iCut] = new TH2F("MC_Pi0_Pt_Y", "MC_Pi0_Pt_Y", nBinsQAPt, arrQAPtBinning, 150, -1.5, 1.5);
2167  fHistoMCPi0PtY[iCut]->SetXTitle("p_{T} (GeV/c)");
2168  fHistoMCPi0PtY[iCut]->SetYTitle("y");
2169  fHistoMCPi0PtY[iCut]->Sumw2();
2170  fMCList[iCut]->Add(fHistoMCPi0PtY[iCut]);
2171  fHistoMCEtaPtY[iCut] = new TH2F("MC_Eta_Pt_Y", "MC_Eta_Pt_Y", nBinsQAPt, arrQAPtBinning, 150, -1.5, 1.5);
2172  fHistoMCEtaPtY[iCut]->SetXTitle("p_{T} (GeV/c)");
2173  fHistoMCEtaPtY[iCut]->SetYTitle("y");
2174  fHistoMCEtaPtY[iCut]->Sumw2();
2175  fMCList[iCut]->Add(fHistoMCEtaPtY[iCut]);
2176  fHistoMCPi0PtAlpha[iCut] = new TH2F("MC_Pi0_Pt_Alpha", "MC_Pi0_Pt_Alpha", nBinsQAPt, arrQAPtBinning, 100, 0, 1);
2177  fHistoMCPi0PtAlpha[iCut]->SetXTitle("p_{T} (GeV/c)");
2178  fHistoMCPi0PtAlpha[iCut]->SetYTitle("#alpha");
2179  fMCList[iCut]->Add(fHistoMCPi0PtAlpha[iCut]);
2180  fHistoMCEtaPtAlpha[iCut] = new TH2F("MC_Eta_Pt_Alpha", "MC_Eta_Pt_Alpha", nBinsQAPt, arrQAPtBinning, 100, 0, 1);
2181  fHistoMCEtaPtAlpha[iCut]->SetXTitle("p_{T} (GeV/c)");
2182  fHistoMCEtaPtAlpha[iCut]->SetYTitle("#alpha");
2183  fMCList[iCut]->Add(fHistoMCEtaPtAlpha[iCut]);
2184 
2185  if (fIsMC == 2) {
2186  fHistoMCPi0PtAlpha[iCut]->Sumw2();
2187  fHistoMCEtaPtAlpha[iCut]->Sumw2();
2188  }
2189  }
2190  }
2191  fTrueList[iCut] = new TList();
2192  fTrueList[iCut]->SetName(Form("%s_%s_%s True histograms", cutstringEvent.Data(), cutstringCalo.Data(), cutstringMeson.Data()));
2193  fTrueList[iCut]->SetOwner(kTRUE);
2194  fCutFolder[iCut]->Add(fTrueList[iCut]);
2195 
2196  if(fDoJetAnalysis){
2197  fTrueJetHistograms[iCut] = new TList();
2198  fTrueJetHistograms[iCut]->SetName(Form("%s_%s_%s True Jet histograms", cutstringEvent.Data(), cutstringCalo.Data(), cutstringMeson.Data()));
2199  fTrueJetHistograms[iCut]->SetOwner(kTRUE);
2200  fCutFolder[iCut]->Add(fTrueJetHistograms[iCut]);
2201 
2202  fHistoTruevsRecJetPt[iCut] = new TH2F("True_JetPt_vs_Rec_JetPt", "True_JetPt_vs_Rec_JetPt", 150, 0, 150, 150, 0, 150);
2203  fTrueJetHistograms[iCut]->Add(fHistoTruevsRecJetPt[iCut]);
2204  fHistoTruePi0JetMotherInvMassPt[iCut] = new TH2F("ESD_TruePi0_Jet_InvMass_Pt", "ESD_TruePi0_Jet_InvMass_Pt", 800, 0, 0.8, nBinsPt, arrPtBinning);
2206  fHistoTruePrimaryPi0JetInvMassPt[iCut] = new TH2F("ESD_TruePrimaryPi0Jet_InvMass_Pt", "ESD_TruePrimaryPi0Jet_InvMass_Pt", 800, 0, 0.8, nBinsPt, arrPtBinning);
2208  fHistoTrueEtaJetMotherInvMassPt[iCut] = new TH2F("ESD_TrueEta_Jet_InvMass_Pt", "ESD_TruePi0_Jet_InvMass_Pt", 800, 0, 0.8, nBinsPt, arrPtBinning);
2210  fHistoTruePrimaryEtaJetInvMassPt[iCut] = new TH2F("ESD_TruePrimaryEtaJet_InvMass_Pt", "ESD_TruePrimaryEtaJet_InvMass_Pt", 800, 0, 0.8, nBinsPt, arrPtBinning);
2212  fHistoTruePi0InJetMotherInvMassPt[iCut] = new TH2F("ESD_TruePi0_Pi0inJet_InvMass_Pt", "ESD_TruePi0_Pi0inJet_InvMass_Pt", 800, 0, 0.8, nBinsPt, arrPtBinning);
2214  fHistoTruePrimaryPi0inJetInvMassPt[iCut] = new TH2F("ESD_TruePrimaryPi0inJet_InvMass_Pt", "ESD_TruePrimaryPi0inJet_InvMass_Pt", 800, 0, 0.8, nBinsPt, arrPtBinning);
2216  fHistoTrueDoubleCountingPi0Jet[iCut] = new TH1F("Double_Counting_True_Pi0inJet", "Double_Counting_True_Pi0inJet", 6, 0, 6);
2218  fHistoTrueEtaInJetMotherInvMassPt[iCut] = new TH2F("ESD_TrueEta_EtainJet_InvMass_Pt", "ESD_TruePi0_Pi0inJet_InvMass_Pt", 800, 0, 0.8, nBinsPt, arrPtBinning);
2220  fHistoTruePrimaryEtainJetInvMassPt[iCut] = new TH2F("ESD_TruePrimaryEtainJet_InvMass_Pt", "ESD_TruePrimaryEtainJet_InvMass_Pt", 800, 0, 0.8, nBinsPt, arrPtBinning);
2222  fHistoTrueDoubleCountingEtaJet[iCut] = new TH1F("Double_Counting_True_EtainJet", "Double_Counting_True_EtainJet", 6, 0, 6);
2224  fHistoTruePi0JetFragmFunc[iCut] = new TH2F("ESD_TruePi0inJet_FragmentationFunc", "ESD_TruePi0inJet_FragmentationFunc", 50, arrLogBinning, 150, 0., 150.);
2226  fHistoTrueEtaJetFragmFunc[iCut] = new TH2F("ESD_TrueEtainJet_FragmentationFunc", "ESD_TrueEtainJet_FragmentationFunc", 50, arrLogBinning, 150, 0., 150.);
2228  fHistoMCPi0JetInAccPt[iCut] = new TH1F("MC_Pi0JetInAcc_Pt", "MC_Pi0JetInAcc_Pt", (Int_t)((maxPt-minPt)/binWidthPt), minPt, maxPt);
2229  fTrueJetHistograms[iCut]->Add(fHistoMCPi0JetInAccPt[iCut]);
2230  fHistoMCPi0inJetInAccPt[iCut] = new TH1F("MC_Pi0inJetInAcc_Pt", "MC_Pi0inJetInAcc_Pt", (Int_t)((maxPt-minPt)/binWidthPt), minPt, maxPt);
2231  fTrueJetHistograms[iCut]->Add(fHistoMCPi0inJetInAccPt[iCut]);
2232  fHistoMCEtaJetInAccPt[iCut] = new TH1F("MC_EtaJetInAcc_Pt", "MC_EtaJetInAcc_Pt", (Int_t)((maxPt-minPt)/binWidthPt), minPt, maxPt);
2233  fTrueJetHistograms[iCut]->Add(fHistoMCEtaJetInAccPt[iCut]);
2234  fHistoMCEtainJetInAccPt[iCut] = new TH1F("MC_EtainJetInAcc_Pt", "MC_EtainJetInAcc_Pt", (Int_t)((maxPt-minPt)/binWidthPt), minPt, maxPt);
2235  fTrueJetHistograms[iCut]->Add(fHistoMCEtainJetInAccPt[iCut]);
2236  fHistoTrueSecondaryPi0FromK0sJetInvMassPt[iCut] = new TH2F("ESD_TrueSecondaryPi0FromK0sJet_InvMass_Pt", "ESD_TrueSecondaryPi0FromK0sJet_InvMass_Pt", 800, 0, 0.8, nBinsPt, arrPtBinning);
2238  fHistoTrueSecondaryPi0FromK0sinJetInvMassPt[iCut] = new TH2F("ESD_TrueSecondaryPi0FromK0s_inJet_InvMass_Pt", "ESD_TrueSecondaryPi0FromK0s_inJet_InvMass_Pt", 800, 0, 0.8, nBinsPt, arrPtBinning);
2240  fHistoTrueSecondaryPi0FromLambdaJetInvMassPt[iCut] = new TH2F("ESD_TrueSecondaryPi0FromLambdaJet_InvMass_Pt", "ESD_TrueSecondaryPi0FromLambdaJet_InvMass_Pt", 800, 0, 0.8, nBinsPt, arrPtBinning);
2242  fHistoTrueSecondaryPi0FromLambdainJetInvMassPt[iCut] = new TH2F("ESD_TrueSecondaryPi0FromLambda_inJet_InvMass_Pt", "ESD_TrueSecondaryPi0FromLambda_inJet_InvMass_Pt", 800, 0, 0.8, nBinsPt, arrPtBinning);
2244  fHistoTrueSecondaryPi0FromK0lJetInvMassPt[iCut] = new TH2F("ESD_TrueSecondaryPi0FromK0lJet_InvMass_Pt", "ESD_TrueSecondaryPi0FromK0lJet_InvMass_Pt", 800, 0, 0.8, nBinsPt, arrPtBinning);
2246  fHistoTrueSecondaryPi0FromK0linJetInvMassPt[iCut] = new TH2F("ESD_TrueSecondaryPi0FromK0l_inJet_InvMass_Pt", "ESD_TrueSecondaryPi0FromK0l_inJet_InvMass_Pt", 800, 0, 0.8, nBinsPt, arrPtBinning);
2248  fHistoTrueSecondaryPi0InvJetMassPt[iCut] = new TH2F("ESD_TrueSecondaryPi0Jet_InvMass_Pt", "ESD_TrueSecondaryPi0Jet_InvMass_Pt", 800, 0, 0.8, nBinsPt, arrPtBinning);
2250  fHistoTrueSecondaryPi0InvinJetMassPt[iCut] = new TH2F("ESD_TrueSecondaryPi0_inJet_InvMass_Pt", "ESD_TrueSecondaryPi0_inJet_InvMass_Pt", 800, 0, 0.8, nBinsPt, arrPtBinning);
2252 
2253  if(fDoJetQA){
2254  tTreeJetPi0Correlations[iCut] = new TTree("Jet_Pi0_Correlations", "Jet_Pi0_Correlations");
2255  tTreeJetPi0Correlations[iCut]->Branch("JetPt",&fJetPt,"fJetPt/F");
2256  tTreeJetPi0Correlations[iCut]->Branch("TrueJetPt",&fTrueJetPt,"fTrueJetPt/F");
2257  tTreeJetPi0Correlations[iCut]->Branch("Pi0Pt",&fPi0Pt,"fPi0Pt/F");
2258  tTreeJetPi0Correlations[iCut]->Branch("Pi0InvMass",&fPi0InvMass,"fPi0InvMass/F");
2259  fTrueJetHistograms[iCut]->Add(tTreeJetPi0Correlations[iCut]);
2260  }
2261  }
2262 
2263  if(!fDoLightOutput){
2264  fHistoClusPhotonBGPt[iCut] = new TH2F("ESD_TrueClusPhotonBG_Pt", "ESD_TrueClusPhotonBG_Pt", nBinsClusterPt, arrClusPtBinning,10,-0.5,9.5);
2265  fHistoClusPhotonBGPt[iCut]->GetYaxis()->SetBinLabel( 1,"Elec");
2266  fHistoClusPhotonBGPt[iCut]->GetYaxis()->SetBinLabel( 2,"Pion");
2267  fHistoClusPhotonBGPt[iCut]->GetYaxis()->SetBinLabel( 3,"Proton");
2268  fHistoClusPhotonBGPt[iCut]->GetYaxis()->SetBinLabel( 4,"Kaon");
2269  fHistoClusPhotonBGPt[iCut]->GetYaxis()->SetBinLabel( 5,"Neutron");
2270  fHistoClusPhotonBGPt[iCut]->GetYaxis()->SetBinLabel( 6,"K0s");
2271  fHistoClusPhotonBGPt[iCut]->GetYaxis()->SetBinLabel( 7,"Lambda");
2272  fHistoClusPhotonBGPt[iCut]->GetYaxis()->SetBinLabel( 8,"Muon");
2273  fHistoClusPhotonBGPt[iCut]->GetYaxis()->SetBinLabel( 9,"K0l");
2274  fHistoClusPhotonBGPt[iCut]->GetYaxis()->SetBinLabel( 10,"Rest");
2275  fHistoClusPhotonBGPt[iCut]->SetXTitle("p_{T} (GeV/c)");
2276  fHistoClusPhotonBGPt[iCut]->SetYTitle("source");
2277  fTrueList[iCut]->Add(fHistoClusPhotonBGPt[iCut]);
2278  fHistoClusPhotonPlusConvBGPt[iCut] = new TH2F("ESD_TrueClusPhotonPlusConvBG_Pt", "ESD_TrueClusPhotonPlusConvBG_Pt", nBinsClusterPt, arrClusPtBinning,10,-0.5,9.5);
2279  fHistoClusPhotonPlusConvBGPt[iCut]->GetYaxis()->SetBinLabel( 1,"Elec");
2280  fHistoClusPhotonPlusConvBGPt[iCut]->GetYaxis()->SetBinLabel( 2,"Pion");
2281  fHistoClusPhotonPlusConvBGPt[iCut]->GetYaxis()->SetBinLabel( 3,"Proton");
2282  fHistoClusPhotonPlusConvBGPt[iCut]->GetYaxis()->SetBinLabel( 4,"Kaon");
2283  fHistoClusPhotonPlusConvBGPt[iCut]->GetYaxis()->SetBinLabel( 5,"Neutron");
2284  fHistoClusPhotonPlusConvBGPt[iCut]->GetYaxis()->SetBinLabel( 6,"K0s");
2285  fHistoClusPhotonPlusConvBGPt[iCut]->GetYaxis()->SetBinLabel( 7,"Lambda");
2286  fHistoClusPhotonPlusConvBGPt[iCut]->GetYaxis()->SetBinLabel( 8,"Muon");
2287  fHistoClusPhotonPlusConvBGPt[iCut]->GetYaxis()->SetBinLabel( 9,"K0l");
2288  fHistoClusPhotonPlusConvBGPt[iCut]->GetYaxis()->SetBinLabel(10,"Rest");
2289  fHistoClusPhotonPlusConvBGPt[iCut]->SetXTitle("p_{T} (GeV/c)");
2290  fHistoClusPhotonPlusConvBGPt[iCut]->SetYTitle("source");
2291  fTrueList[iCut]->Add(fHistoClusPhotonPlusConvBGPt[iCut]);
2292 
2293  if (fDoClusterQA > 1) {
2294  fHistoClustPhotonElectronBGPtM02[iCut] = new TH2F("ESD_TrueClusPhotonElectronBG_Pt_M02", "ESD_TrueClusPhotonElectronBG_Pt_M02", nBinsClusterPt, arrClusPtBinning, 100, 0, 1);
2295  fHistoClustPhotonElectronBGPtM02[iCut]->SetXTitle("p_{T} (GeV/c)");
2296  fHistoClustPhotonElectronBGPtM02[iCut]->SetYTitle("#sigma_{long}^{2}");
2297  fTrueList[iCut]->Add(fHistoClustPhotonElectronBGPtM02[iCut]);
2298  fHistoClustPhotonPionBGPtM02[iCut] = new TH2F("ESD_TrueClusPhotonPionBG_Pt_M02", "ESD_TrueClusPhotonPionBG_Pt_M02", nBinsClusterPt, arrClusPtBinning, 100, 0, 1);
2299  fHistoClustPhotonPionBGPtM02[iCut]->SetXTitle("p_{T} (GeV/c)");
2300  fHistoClustPhotonPionBGPtM02[iCut]->SetYTitle("#sigma_{long}^{2}");
2301  fTrueList[iCut]->Add(fHistoClustPhotonPionBGPtM02[iCut]);
2302  fHistoClustPhotonKaonBGPtM02[iCut] = new TH2F("ESD_TrueClusPhotonKaonBG_Pt_M02", "ESD_TrueClusPhotonKaonBG_Pt_M02", nBinsClusterPt, arrClusPtBinning, 100, 0, 1);
2303  fHistoClustPhotonKaonBGPtM02[iCut]->SetXTitle("p_{T} (GeV/c)");
2304  fHistoClustPhotonKaonBGPtM02[iCut]->SetYTitle("#sigma_{long}^{2}");
2305  fTrueList[iCut]->Add(fHistoClustPhotonKaonBGPtM02[iCut]);
2306  fHistoClustPhotonK0lBGPtM02[iCut] = new TH2F("ESD_TrueClusPhotonK0lBG_Pt_M02", "ESD_TrueClusPhotonK0lBG_Pt_M02", nBinsClusterPt, arrClusPtBinning, 100, 0, 1);
2307  fHistoClustPhotonK0lBGPtM02[iCut]->SetXTitle("p_{T} (GeV/c)");
2308  fHistoClustPhotonK0lBGPtM02[iCut]->SetYTitle("#sigma_{long}^{2}");
2309  fTrueList[iCut]->Add(fHistoClustPhotonK0lBGPtM02[iCut]);
2310  fHistoClustPhotonNeutronBGPtM02[iCut] = new TH2F("ESD_TrueClusPhotonNeutronBG_Pt_M02", "ESD_TrueClusPhotonNeutronBG_Pt_M02", nBinsClusterPt, arrClusPtBinning, 100, 0, 1);
2311  fHistoClustPhotonNeutronBGPtM02[iCut]->SetXTitle("p_{T} (GeV/c)");
2312  fHistoClustPhotonNeutronBGPtM02[iCut]->SetYTitle("#sigma_{long}^{2}");
2313  fTrueList[iCut]->Add(fHistoClustPhotonNeutronBGPtM02[iCut]);
2314  fHistoClustPhotonRestBGPtM02[iCut] = new TH2F("ESD_TrueClusPhotonRestBG_Pt_M02", "ESD_TrueClusPhotonRestBG_Pt_M02", nBinsClusterPt, arrClusPtBinning, 100, 0, 1);
2315  fHistoClustPhotonRestBGPtM02[iCut]->SetXTitle("p_{T} (GeV/c)");
2316  fHistoClustPhotonRestBGPtM02[iCut]->SetYTitle("#sigma_{long}^{2}");
2317  fTrueList[iCut]->Add(fHistoClustPhotonRestBGPtM02[iCut]);
2318  fHistoClustPhotonPlusConvElectronBGPtM02[iCut]= new TH2F("ESD_TrueClusPhotonPlusConvElectronBG_Pt_M02", "ESD_TrueClusPhotonPlusConvElectronBG_Pt_M02", nBinsClusterPt, arrClusPtBinning, 100, 0, 1);
2319  fHistoClustPhotonPlusConvElectronBGPtM02[iCut]->SetXTitle("p_{T} (GeV/c)");
2320  fHistoClustPhotonPlusConvElectronBGPtM02[iCut]->SetYTitle("#sigma_{long}^{2}");
2322  fHistoClustPhotonPlusConvPionBGPtM02[iCut] = new TH2F("ESD_TrueClusPhotonPlusConvPionBG_Pt_M02", "ESD_TrueClusPhotonPlusConvPionBG_Pt_M02", nBinsClusterPt, arrClusPtBinning, 100, 0, 1);
2323  fHistoClustPhotonPlusConvPionBGPtM02[iCut]->SetXTitle("p_{T} (GeV/c)");
2324  fHistoClustPhotonPlusConvPionBGPtM02[iCut]->SetYTitle("#sigma_{long}^{2}");
2326  fHistoClustPhotonPlusConvKaonBGPtM02[iCut] = new TH2F("ESD_TrueClusPhotonPlusConvKaonBG_Pt_M02", "ESD_TrueClusPhotonPlusConvKaonBG_Pt_M02", nBinsClusterPt, arrClusPtBinning, 100, 0, 1);
2327  fHistoClustPhotonPlusConvKaonBGPtM02[iCut]->SetXTitle("p_{T} (GeV/c)");
2328  fHistoClustPhotonPlusConvKaonBGPtM02[iCut]->SetYTitle("#sigma_{long}^{2}");
2330  fHistoClustPhotonPlusConvK0lBGPtM02[iCut] = new TH2F("ESD_TrueClusPhotonPlusConvK0lBG_Pt_M02", "ESD_TrueClusPhotonPlusConvK0lBG_Pt_M02", nBinsClusterPt, arrClusPtBinning, 100, 0, 1);
2331  fHistoClustPhotonPlusConvK0lBGPtM02[iCut]->SetXTitle("p_{T} (GeV/c)");
2332  fHistoClustPhotonPlusConvK0lBGPtM02[iCut]->SetYTitle("#sigma_{long}^{2}");
2334  fHistoClustPhotonPlusConvNeutronBGPtM02[iCut] = new TH2F("ESD_TrueClusPhotonPlusConvNeutronBG_Pt_M02", "ESD_TrueClusPhotonPlusConvNeutronBG_Pt_M02", nBinsClusterPt, arrClusPtBinning, 100, 0, 1);
2335  fHistoClustPhotonPlusConvNeutronBGPtM02[iCut]->SetXTitle("p_{T} (GeV/c)");
2336  fHistoClustPhotonPlusConvNeutronBGPtM02[iCut]->SetYTitle("#sigma_{long}^{2}");
2338  fHistoClustPhotonPlusConvRestBGPtM02[iCut] = new TH2F("ESD_TrueClusPhotonPlusConvRestBG_Pt_M02", "ESD_TrueClusPhotonPlusConvRestBG_Pt_M02", nBinsClusterPt, arrClusPtBinning, 100, 0, 1);
2339  fHistoClustPhotonPlusConvRestBGPtM02[iCut]->SetXTitle("p_{T} (GeV/c)");
2340  fHistoClustPhotonPlusConvRestBGPtM02[iCut]->SetYTitle("#sigma_{long}^{2}");
2342  }
2343  }
2344 
2345  fHistoTrueClusGammaPt[iCut] = new TH1F("TrueClusGamma_Pt", "ESD_TrueClusGamma_Pt", nBinsClusterPt, arrClusPtBinning);
2346  fHistoTrueClusGammaPt[iCut]->SetXTitle("p_{T} (GeV/c)");
2347  fTrueList[iCut]->Add(fHistoTrueClusGammaPt[iCut]);
2348  if(!fDoLightOutput){
2349  if (fDoClusterQA > 0) {
2350  fHistoTrueClusGammaPtM02[iCut] = new TH2F("TrueClusGamma_Pt_M02", "TrueClusGamma_Pt_M02", nBinsClusterPt, arrClusPtBinning, 100, 0, 1);
2351  fHistoTrueClusGammaPtM02[iCut]->SetXTitle("p_{T} (GeV/c)");
2352  fHistoTrueClusGammaPtM02[iCut]->SetYTitle("#sigma_{long}^{2}");
2353  fTrueList[iCut]->Add(fHistoTrueClusGammaPtM02[iCut]);
2354  }
2355  fHistoTruePrimaryClusGammaPt[iCut] = new TH1F("TruePrimaryClusGamma_Pt", "ESD_TruePrimaryClusGamma_Pt", nBinsClusterPt, arrClusPtBinning);
2356  fHistoTruePrimaryClusGammaPt[iCut]->SetXTitle("p_{T} (GeV/c)");
2357  fTrueList[iCut]->Add(fHistoTruePrimaryClusGammaPt[iCut]);
2358  fHistoTruePrimaryClusGammaESDPtMCPt[iCut] = new TH2F("TruePrimaryClusGamma_Pt_MCPt", "ESD_TruePrimaryClusGamma_MCPt", nBinsClusterPt, arrClusPtBinning, nBinsClusterPt, arrClusPtBinning);
2359  fHistoTruePrimaryClusGammaESDPtMCPt[iCut]->SetXTitle("p_{T} (GeV/c)");
2360  fHistoTruePrimaryClusGammaESDPtMCPt[iCut]->SetYTitle("p_{T, MC} (GeV/c)");
2362  fHistoTruePrimaryClusConvGammaPt[iCut] = new TH1F("TruePrimaryClusConvGamma_Pt", "ESD_TruePrimaryClusConvGamma_Pt", nBinsClusterPt, arrClusPtBinning);
2363  fHistoTruePrimaryClusConvGammaPt[iCut]->SetXTitle("p_{T} (GeV/c)");
2364  fTrueList[iCut]->Add(fHistoTruePrimaryClusConvGammaPt[iCut]);
2365  fHistoTruePrimaryClusConvGammaESDPtMCPt[iCut] = new TH2F("TruePrimaryClusConvGamma_Pt_MCPt", "ESD_TruePrimaryClusConvGamma_MCPt", nBinsClusterPt, arrClusPtBinning, nBinsClusterPt, arrClusPtBinning);
2366  fHistoTruePrimaryClusConvGammaESDPtMCPt[iCut]->SetXTitle("p_{T} (GeV/c)");
2367  fHistoTruePrimaryClusConvGammaESDPtMCPt[iCut]->SetYTitle("p_{T, MC} (GeV/c)");
2369  fHistoTrueSecondaryClusGammaPt[iCut] = new TH2F("ESD_TrueSecondaryClusGamma_Pt", "ESD_TrueSecondaryClusGamma_Pt", nBinsClusterPt, arrClusPtBinning, 5, -0.5, 4.5);
2370  fHistoTrueSecondaryClusGammaPt[iCut]->SetXTitle("p_{T} (GeV/c)");
2371  fHistoTrueSecondaryClusGammaPt[iCut]->SetYTitle("source");
2372  fHistoTrueSecondaryClusGammaPt[iCut]->GetYaxis()->SetBinLabel( 1,"K0s");
2373  fHistoTrueSecondaryClusGammaPt[iCut]->GetYaxis()->SetBinLabel( 2,"K0l");
2374  fHistoTrueSecondaryClusGammaPt[iCut]->GetYaxis()->SetBinLabel( 3,"Lambda");
2375  fHistoTrueSecondaryClusGammaPt[iCut]->GetYaxis()->SetBinLabel( 4,"Eta");
2376  fHistoTrueSecondaryClusGammaPt[iCut]->GetYaxis()->SetBinLabel( 5,"rest");
2377  fTrueList[iCut]->Add(fHistoTrueSecondaryClusGammaPt[iCut]);
2378  fHistoTrueSecondaryClusConvGammaPt[iCut] = new TH2F("ESD_TrueSecondaryClusConvGamma_Pt", "ESD_TrueSecondaryClusConvGamma_Pt", nBinsClusterPt, arrClusPtBinning, 5, -0.5, 4.5);
2379  fHistoTrueSecondaryClusConvGammaPt[iCut]->SetXTitle("p_{T} (GeV/c)");
2380  fHistoTrueSecondaryClusConvGammaPt[iCut]->SetYTitle("source");
2381  fHistoTrueSecondaryClusConvGammaPt[iCut]->GetYaxis()->SetBinLabel( 1,"K0s");
2382  fHistoTrueSecondaryClusConvGammaPt[iCut]->GetYaxis()->SetBinLabel( 2,"K0l");
2383  fHistoTrueSecondaryClusConvGammaPt[iCut]->GetYaxis()->SetBinLabel( 3,"Lambda");
2384  fHistoTrueSecondaryClusConvGammaPt[iCut]->GetYaxis()->SetBinLabel( 4,"Eta");
2385  fHistoTrueSecondaryClusConvGammaPt[iCut]->GetYaxis()->SetBinLabel( 5,"rest");
2387  fHistoTrueSecondaryClusGammaMCPt[iCut] = new TH2F("ESD_TrueSecondaryClusGamma_MCPt", "ESD_TrueSecondaryClusGamma_MCPt", nBinsClusterPt, arrClusPtBinning, 5, -0.5, 4.5);
2388  fHistoTrueSecondaryClusGammaMCPt[iCut]->SetXTitle("p_{T, MC} (GeV/c)");
2389  fHistoTrueSecondaryClusGammaMCPt[iCut]->SetYTitle("source");
2390  fHistoTrueSecondaryClusGammaMCPt[iCut]->GetYaxis()->SetBinLabel( 1,"K0s");
2391  fHistoTrueSecondaryClusGammaMCPt[iCut]->GetYaxis()->SetBinLabel( 2,"K0l");
2392  fHistoTrueSecondaryClusGammaMCPt[iCut]->GetYaxis()->SetBinLabel( 3,"Lambda");
2393  fHistoTrueSecondaryClusGammaMCPt[iCut]->GetYaxis()->SetBinLabel( 4,"Eta");
2394  fHistoTrueSecondaryClusGammaMCPt[iCut]->GetYaxis()->SetBinLabel( 5,"rest");
2395  fTrueList[iCut]->Add(fHistoTrueSecondaryClusGammaMCPt[iCut]);
2396  fHistoTrueSecondaryClusConvGammaMCPt[iCut] = new TH2F("ESD_TrueSecondaryClusConvGamma_MCPt", "ESD_TrueSecondaryClusConvGamma_MCPt", nBinsClusterPt, arrClusPtBinning, 5, -0.5, 4.5);
2397  fHistoTrueSecondaryClusConvGammaMCPt[iCut]->SetXTitle("p_{T, MC} (GeV/c)");
2398  fHistoTrueSecondaryClusConvGammaMCPt[iCut]->SetYTitle("source");
2399  fHistoTrueSecondaryClusConvGammaMCPt[iCut]->GetYaxis()->SetBinLabel( 1,"K0s");
2400  fHistoTrueSecondaryClusConvGammaMCPt[iCut]->GetYaxis()->SetBinLabel( 2,"K0l");
2401  fHistoTrueSecondaryClusConvGammaMCPt[iCut]->GetYaxis()->SetBinLabel( 3,"Lambda");
2402  fHistoTrueSecondaryClusConvGammaMCPt[iCut]->GetYaxis()->SetBinLabel( 4,"Eta");
2403  fHistoTrueSecondaryClusConvGammaMCPt[iCut]->GetYaxis()->SetBinLabel( 5,"rest");
2405 
2406  fHistoTrueSecondaryClusGammaFromXFromK0sMCPtESDPt[iCut] = new TH2F("ESD_TrueSecondaryClusGammaFromXFromK0s_MCPt_Pt", "ESD_TrueSecondaryClusGammaFromXFromK0s_MCPt_Pt",
2407  nBinsClusterPt, arrClusPtBinning, nBinsClusterPt, arrClusPtBinning);
2408  fHistoTrueSecondaryClusGammaFromXFromK0sMCPtESDPt[iCut]->SetXTitle("p_{T, MC} (GeV/c)");
2409  fHistoTrueSecondaryClusGammaFromXFromK0sMCPtESDPt[iCut]->SetYTitle("p_{T} (GeV/c)");
2411  fHistoTrueSecondaryClusConvGammaFromXFromK0sMCPtESDPt[iCut] = new TH2F("ESD_TrueSecondaryClusConvGammaFromXFromK0s_MCPt_Pt", "ESD_TrueSecondaryClusConvGammaFromXFromK0s_MCPt_Pt",
2412  nBinsClusterPt, arrClusPtBinning, nBinsClusterPt, arrClusPtBinning);
2413  fHistoTrueSecondaryClusConvGammaFromXFromK0sMCPtESDPt[iCut]->SetXTitle("p_{T, MC} (GeV/c)");
2414  fHistoTrueSecondaryClusConvGammaFromXFromK0sMCPtESDPt[iCut]->SetYTitle("p_{T} (GeV/c)");
2416  fHistoTrueSecondaryClusGammaFromXFromK0lMCPtESDPt[iCut] = new TH2F("ESD_TrueSecondaryClusGammaFromXFromK0l_MCPt_Pt", "ESD_TrueSecondaryClusGammaFromXFromK0l_MCPt_Pt",
2417  nBinsClusterPt, arrClusPtBinning, nBinsClusterPt, arrClusPtBinning);
2418  fHistoTrueSecondaryClusGammaFromXFromK0lMCPtESDPt[iCut]->SetXTitle("p_{T, MC} (GeV/c)");
2419  fHistoTrueSecondaryClusGammaFromXFromK0lMCPtESDPt[iCut]->SetYTitle("p_{T} (GeV/c)");
2421  fHistoTrueSecondaryClusConvGammaFromXFromK0lMCPtESDPt[iCut] = new TH2F("ESD_TrueSecondaryClusConvGammaFromXFromK0l_MCPt_Pt", "ESD_TrueSecondaryClusConvGammaFromXFromK0l_MCPt_Pt",
2422  nBinsClusterPt, arrClusPtBinning, nBinsClusterPt, arrClusPtBinning);
2423  fHistoTrueSecondaryClusConvGammaFromXFromK0lMCPtESDPt[iCut]->SetXTitle("p_{T, MC} (GeV/c)");
2424  fHistoTrueSecondaryClusConvGammaFromXFromK0lMCPtESDPt[iCut]->SetYTitle("p_{T} (GeV/c)");
2426  fHistoTrueSecondaryClusGammaFromXFromLambdaMCPtESDPt[iCut] = new TH2F("ESD_TrueSecondaryClusGammaFromXFromLambda_MCPt_Pt", "ESD_TrueSecondaryClusGammaFromXFromLambda_MCPt_Pt",
2427  nBinsClusterPt, arrClusPtBinning, nBinsClusterPt, arrClusPtBinning);
2428  fHistoTrueSecondaryClusGammaFromXFromLambdaMCPtESDPt[iCut]->SetXTitle("p_{T, MC} (GeV/c)");
2429  fHistoTrueSecondaryClusGammaFromXFromLambdaMCPtESDPt[iCut]->SetYTitle("p_{T} (GeV/c)");
2431  fHistoTrueSecondaryClusConvGammaFromXFromLambdaMCPtESDPt[iCut] = new TH2F("ESD_TrueSecondaryClusConvGammaFromXFromLambda_MCPt_Pt", "ESD_TrueSecondaryClusConvGammaFromXFromLambda_MCPt_Pt",
2432  nBinsClusterPt, arrClusPtBinning, nBinsClusterPt, arrClusPtBinning);
2433  fHistoTrueSecondaryClusConvGammaFromXFromLambdaMCPtESDPt[iCut]->SetXTitle("p_{T, MC} (GeV/c)");
2434  fHistoTrueSecondaryClusConvGammaFromXFromLambdaMCPtESDPt[iCut]->SetYTitle("p_{T} (GeV/c)");
2436 
2437  fHistoTrueNLabelsInClus[iCut] = new TH1F("TrueNLabelsInClus", "TrueNLabelsInClus", 100, -0.5, 99.5);
2438  fHistoTrueNLabelsInClus[iCut]->SetXTitle("# labels");
2439  fTrueList[iCut]->Add(fHistoTrueNLabelsInClus[iCut]);
2440  }
2441 
2442  fHistoDoubleCountTrueClusterGammaPt[iCut] = new TH2F("TrueDoubleCountClusterGamma_Pt", "TrueDoubleCountClusterGamma_Pt", nBinsClusterPt, arrClusPtBinning, 2, 0, 2);
2443  fHistoDoubleCountTrueClusterGammaPt[iCut]->SetXTitle("p_{T} (GeV/c)");
2445  fHistoMultipleCountTrueClusterGamma[iCut] = new TH1F("TrueMultipleCountClusterGamma", "TrueMultipleCountClusterGamma", 10, 1, 11);
2446  fHistoMultipleCountTrueClusterGamma[iCut]->SetXTitle("# multiple");
2448 
2449  if (fIsMC > 1){
2450  fHistoTrueClusGammaPt[iCut]->Sumw2();
2451  fHistoDoubleCountTrueClusterGammaPt[iCut]->Sumw2();
2452  fHistoMultipleCountTrueClusterGamma[iCut]->Sumw2();
2453  if(!fDoLightOutput){
2454  fHistoTrueNLabelsInClus[iCut]->Sumw2();
2455  if (fDoClusterQA > 0) fHistoTrueClusGammaPtM02[iCut]->Sumw2();
2456  fHistoTruePrimaryClusGammaPt[iCut]->Sumw2();
2457  fHistoTruePrimaryClusGammaESDPtMCPt[iCut]->Sumw2();
2458  fHistoTruePrimaryClusConvGammaPt[iCut]->Sumw2();
2460  fHistoTrueSecondaryClusGammaPt[iCut]->Sumw2();
2461  fHistoTrueSecondaryClusConvGammaPt[iCut]->Sumw2();
2462  fHistoTrueSecondaryClusGammaMCPt[iCut]->Sumw2();
2463  fHistoTrueSecondaryClusConvGammaMCPt[iCut]->Sumw2();
2470  }
2471  }
2472 
2473  if (fDoClusterQA > 0){
2474  fHistoTrueClusUnConvGammaPt[iCut] = new TH1F("TrueClusUnConvGamma_Pt", "TrueClusUnConvGamma_Pt", nBinsClusterPt, arrClusPtBinning);
2475  fHistoTrueClusUnConvGammaPt[iCut]->SetXTitle("p_{T} (GeV/c)");
2476  fTrueList[iCut]->Add(fHistoTrueClusUnConvGammaPt[iCut]);
2477  fHistoTrueClusUnConvGammaMCPt[iCut] = new TH1F("TrueClusUnConvGamma_MCPt", "TrueClusUnConvGamma_MCPt", nBinsClusterPt, arrClusPtBinning);
2478  fHistoTrueClusUnConvGammaMCPt[iCut]->SetXTitle("p_{T, MC} (GeV/c)");
2479  fTrueList[iCut]->Add(fHistoTrueClusUnConvGammaMCPt[iCut]);
2480  if (!fDoLightOutput) {
2481  fHistoTrueClusUnConvGammaPtM02[iCut] = new TH2F("TrueClusUnConvGamma_Pt_M02", "TrueClusUnConvGamma_Pt_M02", nBinsClusterPt, arrClusPtBinning, 100, 0, 1);
2482  fHistoTrueClusUnConvGammaPtM02[iCut]->SetXTitle("p_{T, MC} (GeV/c)");
2483  fHistoTrueClusUnConvGammaPtM02[iCut]->SetYTitle("#sigma_{long}^{2}");
2484  fTrueList[iCut]->Add(fHistoTrueClusUnConvGammaPtM02[iCut]);
2485  }
2486  fHistoTrueClusElectronPt[iCut] = new TH1F("TrueClusElectron_Pt", "TrueElectronGamma_Pt", nBinsClusterPt, arrClusPtBinning);
2487  fHistoTrueClusElectronPt[iCut]->SetXTitle("p_{T} (GeV/c)");
2488  fTrueList[iCut]->Add(fHistoTrueClusElectronPt[iCut]);
2489  fHistoTrueClusConvGammaPt[iCut] = new TH1F("TrueClusConvGamma_Pt", "TrueClusConvGamma_Pt", nBinsClusterPt, arrClusPtBinning);
2490  fHistoTrueClusConvGammaPt[iCut]->SetXTitle("p_{T} (GeV/c)");
2491  fTrueList[iCut]->Add(fHistoTrueClusConvGammaPt[iCut]);
2492  fHistoTrueClusConvGammaMCPt[iCut] = new TH1F("TrueClusConvGamma_MCPt", "TrueClusConvGamma_MCPt", nBinsClusterPt, arrClusPtBinning);
2493  fHistoTrueClusConvGammaMCPt[iCut]->SetXTitle("p_{T, MC} (GeV/c)");
2494  fTrueList[iCut]->Add(fHistoTrueClusConvGammaMCPt[iCut]);
2495  fHistoTrueClusConvGammaFullyPt[iCut] = new TH1F("TrueClusConvGammaFullyContained_Pt", "TrueClusConvGammaFullyContained_Pt", nBinsClusterPt, arrClusPtBinning);
2496  fHistoTrueClusConvGammaFullyPt[iCut]->SetXTitle("p_{T} (GeV/c)");
2497  fTrueList[iCut]->Add(fHistoTrueClusConvGammaFullyPt[iCut]);
2498  fHistoTrueClusMergedGammaPt[iCut] = new TH1F("TrueClusMergedGamma_Pt", "TrueClusMergedGamma_Pt", nBinsClusterPt, arrClusPtBinning);
2499  fHistoTrueClusMergedGammaPt[iCut]->SetXTitle("p_{T} (GeV/c)");
2500  fTrueList[iCut]->Add(fHistoTrueClusMergedGammaPt[iCut]);
2501  fHistoTrueClusMergedPartConvGammaPt[iCut] = new TH1F("TrueClusMergedPartConvGamma_Pt", "TrueClusMergedPartConvGamma_Pt", nBinsClusterPt, arrClusPtBinning);
2502  fHistoTrueClusMergedPartConvGammaPt[iCut]->SetXTitle("p_{T} (GeV/c)");
2504  fHistoTrueClusDalitzPt[iCut] = new TH1F("TrueClusDalitz_Pt", "TrueClusDalitz_Pt", nBinsClusterPt, arrClusPtBinning);
2505  fHistoTrueClusDalitzPt[iCut]->SetXTitle("p_{T} (GeV/c)");
2506  fTrueList[iCut]->Add(fHistoTrueClusDalitzPt[iCut]);
2507  fHistoTrueClusDalitzMergedPt[iCut] = new TH1F("TrueClusDalitzMerged_Pt", "TrueClusDalitzMerged_Pt", nBinsClusterPt, arrClusPtBinning);
2508  fHistoTrueClusDalitzMergedPt[iCut]->SetXTitle("p_{T} (GeV/c)");
2509  fTrueList[iCut]->Add(fHistoTrueClusDalitzMergedPt[iCut]);
2510  fHistoTrueClusPhotonFromElecMotherPt[iCut] = new TH1F("TrueClusPhotonFromElecMother_Pt", "TrueClusPhotonFromElecMother_Pt", nBinsClusterPt, arrClusPtBinning);
2511  fHistoTrueClusPhotonFromElecMotherPt[iCut]->SetXTitle("p_{T} (GeV/c)");
2513  fHistoTrueClusShowerPt[iCut] = new TH1F("TrueClusShower_Pt", "TrueClusShower_Pt", nBinsClusterPt, arrClusPtBinning);
2514  fHistoTrueClusShowerPt[iCut]->SetXTitle("p_{T} (GeV/c)");
2515  fTrueList[iCut]->Add(fHistoTrueClusShowerPt[iCut]);
2516  fHistoTrueClusSubLeadingPt[iCut] = new TH1F("TrueClusSubleading_Pt", "TrueClusSubleading_Pt", nBinsClusterPt, arrClusPtBinning);
2517  fHistoTrueClusSubLeadingPt[iCut]->SetXTitle("p_{T} (GeV/c)");
2518  fTrueList[iCut]->Add(fHistoTrueClusSubLeadingPt[iCut]);
2519  fHistoTrueClusNParticles[iCut] = new TH1F("TrueClusNParticles", "TrueClusNParticles", 20, 0, 20);
2520  fHistoTrueClusNParticles[iCut]->SetXTitle("#particles");
2521  fTrueList[iCut]->Add(fHistoTrueClusNParticles[iCut]);
2522  fHistoTrueClusEMNonLeadingPt[iCut] = new TH1F("TrueClusEMNonLeading_Pt", "TrueClusEMNonLeading_Pt", nBinsClusterPt, arrClusPtBinning);
2523  fHistoTrueClusEMNonLeadingPt[iCut]->SetXTitle("p_{T} (GeV/c)");
2524  fTrueList[iCut]->Add(fHistoTrueClusEMNonLeadingPt[iCut]);
2525 
2526  if (fIsMC > 1){
2527  fHistoTrueClusUnConvGammaPt[iCut]->Sumw2();
2528  fHistoTrueClusUnConvGammaMCPt[iCut]->Sumw2();
2529  if (!fDoLightOutput)
2530  fHistoTrueClusUnConvGammaPtM02[iCut]->Sumw2();
2531  fHistoTrueClusElectronPt[iCut]->Sumw2();
2532  fHistoTrueClusConvGammaPt[iCut]->Sumw2();
2533  fHistoTrueClusConvGammaMCPt[iCut]->Sumw2();
2534  fHistoTrueClusConvGammaFullyPt[iCut]->Sumw2();
2535  fHistoTrueClusMergedGammaPt[iCut]->Sumw2();
2536  fHistoTrueClusMergedPartConvGammaPt[iCut]->Sumw2();
2537  fHistoTrueClusDalitzPt[iCut]->Sumw2();
2538  fHistoTrueClusDalitzMergedPt[iCut]->Sumw2();
2539  fHistoTrueClusPhotonFromElecMotherPt[iCut]->Sumw2();
2540  fHistoTrueClusShowerPt[iCut]->Sumw2();
2541  fHistoTrueClusSubLeadingPt[iCut]->Sumw2();
2542  fHistoTrueClusNParticles[iCut]->Sumw2();
2543  fHistoTrueClusEMNonLeadingPt[iCut]->Sumw2();
2544  }
2545  }
2546 
2547  if(fDoMesonAnalysis){
2548  fHistoTruePi0InvMassPt[iCut] = new TH2F("ESD_TruePi0_InvMass_Pt", "ESD_TruePi0_InvMass_Pt", 800, 0, 0.8, nBinsPt, arrPtBinning);
2549  fHistoTruePi0InvMassPt[iCut]->SetYTitle("p_{T} (GeV/c)");
2550  fHistoTruePi0InvMassPt[iCut]->SetXTitle("M_{#gamma#gamma} (GeV/c^{2})");
2551  fTrueList[iCut]->Add(fHistoTruePi0InvMassPt[iCut]);
2552  fHistoTruePi0noConvInvMassPt[iCut] = new TH2F("ESD_TruePi0_noConv_InvMass_Pt", "ESD_TruePi0_noConv_InvMass_Pt", 800, 0, 0.8, nBinsPt, arrPtBinning);
2553  fHistoTruePi0noConvInvMassPt[iCut]->SetYTitle("p_{T} (GeV/c)");
2554  fHistoTruePi0noConvInvMassPt[iCut]->SetXTitle("M_{#gamma#gamma} (GeV/c^{2})");
2555  fTrueList[iCut]->Add(fHistoTruePi0noConvInvMassPt[iCut]);
2556  fHistoTrueEtaInvMassPt[iCut] = new TH2F("ESD_TrueEta_InvMass_Pt", "ESD_TrueEta_InvMass_Pt", 800, 0, 0.8, nBinsPt, arrPtBinning);
2557  fHistoTrueEtaInvMassPt[iCut]->SetYTitle("p_{T} (GeV/c)");
2558  fHistoTrueEtaInvMassPt[iCut]->SetXTitle("M_{#gamma#gamma} (GeV/c^{2})");
2559  fTrueList[iCut]->Add(fHistoTrueEtaInvMassPt[iCut]);
2560 
2561  fHistoDoubleCountTruePi0InvMassPt[iCut] = new TH2F("ESD_TrueDoubleCountPi0_InvMass_Pt", "ESD_TrueDoubleCountPi0_InvMass_Pt", 800, 0, 0.8, nBinsPt, arrPtBinning);
2562  fHistoDoubleCountTruePi0InvMassPt[iCut]->SetYTitle("p_{T} (GeV/c)");
2563  fHistoDoubleCountTruePi0InvMassPt[iCut]->SetXTitle("M_{#gamma#gamma} (GeV/c^{2})");
2564  fTrueList[iCut]->Add(fHistoDoubleCountTruePi0InvMassPt[iCut]);
2565  fHistoDoubleCountTrueEtaInvMassPt[iCut] = new TH2F("ESD_TrueDoubleCountEta_InvMass_Pt", "ESD_TrueDoubleCountEta_InvMass_Pt", 800, 0, 0.8, nBinsPt, arrPtBinning);
2566  fHistoDoubleCountTrueEtaInvMassPt[iCut]->SetYTitle("p_{T} (GeV/c)");
2567  fHistoDoubleCountTrueEtaInvMassPt[iCut]->SetXTitle("M_{#gamma#gamma} (GeV/c^{2})");
2568  fTrueList[iCut]->Add(fHistoDoubleCountTrueEtaInvMassPt[iCut]);
2569 
2570  fHistoTruePrimaryPi0InvMassPt[iCut] = new TH2F("ESD_TruePrimaryPi0_InvMass_Pt", "ESD_TruePrimaryPi0_InvMass_Pt", 800, 0, 0.8, nBinsPt, arrPtBinning);
2571  fHistoTruePrimaryPi0InvMassPt[iCut]->SetYTitle("p_{T} (GeV/c)");
2572  fHistoTruePrimaryPi0InvMassPt[iCut]->SetXTitle("M_{#gamma#gamma} (GeV/c^{2})");
2573  fHistoTruePrimaryPi0InvMassPt[iCut]->Sumw2();
2574  fTrueList[iCut]->Add(fHistoTruePrimaryPi0InvMassPt[iCut]);
2575  fHistoTruePrimaryEtaInvMassPt[iCut] = new TH2F("ESD_TruePrimaryEta_InvMass_Pt", "ESD_TruePrimaryEta_InvMass_Pt", 800, 0, 0.8, nBinsPt, arrPtBinning);
2576  fHistoTruePrimaryEtaInvMassPt[iCut]->SetYTitle("p_{T} (GeV/c)");
2577  fHistoTruePrimaryEtaInvMassPt[iCut]->SetXTitle("M_{#gamma#gamma} (GeV/c^{2})");
2578  fHistoTruePrimaryEtaInvMassPt[iCut]->Sumw2();
2579  fTrueList[iCut]->Add(fHistoTruePrimaryEtaInvMassPt[iCut]);
2580 
2581  fHistoTruePrimaryPi0W0WeightingInvMassPt[iCut] = new TH2F("ESD_TruePrimaryPi0W0Weights_InvMass_Pt", "ESD_TruePrimaryPi0W0Weights_InvMass_Pt", 800, 0, 0.8, nBinsPt, arrPtBinning);
2582  fHistoTruePrimaryPi0W0WeightingInvMassPt[iCut]->SetYTitle("p_{T} (GeV/c)");
2583  fHistoTruePrimaryPi0W0WeightingInvMassPt[iCut]->SetXTitle("M_{#gamma#gamma} (GeV/c^{2})");
2586  fHistoTruePrimaryEtaW0WeightingInvMassPt[iCut] = new TH2F("ESD_TruePrimaryEtaW0Weights_InvMass_Pt", "ESD_TruePrimaryEtaW0Weights_InvMass_Pt", 800, 0, 0.8, nBinsPt, arrPtBinning);
2587  fHistoTruePrimaryEtaW0WeightingInvMassPt[iCut]->SetYTitle("p_{T} (GeV/c)");
2588  fHistoTruePrimaryEtaW0WeightingInvMassPt[iCut]->SetXTitle("M_{#gamma#gamma} (GeV/c^{2})");
2591 
2592  fProfileTruePrimaryPi0WeightsInvMassPt[iCut] = new TProfile2D("ESD_TruePrimaryPi0Weights_InvMass_Pt", "ESD_TruePrimaryPi0Weights_InvMass_Pt", 800, 0, 0.8, nBinsPt, arrPtBinning);
2593  fProfileTruePrimaryPi0WeightsInvMassPt[iCut]->SetYTitle("p_{T} (GeV/c)");
2594  fProfileTruePrimaryPi0WeightsInvMassPt[iCut]->SetXTitle("M_{#gamma#gamma} (GeV/c^{2})");
2597  fProfileTruePrimaryEtaWeightsInvMassPt[iCut] = new TProfile2D("ESD_TruePrimaryEtaWeights_InvMass_Pt", "ESD_TruePrimaryEtaWeights_InvMass_Pt", 800, 0, 0.8, nBinsPt, arrPtBinning);
2598  fProfileTruePrimaryEtaWeightsInvMassPt[iCut]->SetYTitle("p_{T} (GeV/c)");
2599  fProfileTruePrimaryEtaWeightsInvMassPt[iCut]->SetXTitle("M_{#gamma#gamma} (GeV/c^{2})");
2602 
2603  fHistoTrueSecondaryPi0InvMassPt[iCut] = new TH2F("ESD_TrueSecondaryPi0_InvMass_Pt", "ESD_TrueSecondaryPi0_InvMass_Pt", 800, 0, 0.8, nBinsPt, arrPtBinning);
2604  fHistoTrueSecondaryPi0InvMassPt[iCut]->SetYTitle("p_{T} (GeV/c)");
2605  fHistoTrueSecondaryPi0InvMassPt[iCut]->SetXTitle("M_{#gamma#gamma} (GeV/c^{2})");
2606  fHistoTrueSecondaryPi0InvMassPt[iCut]->Sumw2();
2607  fTrueList[iCut]->Add(fHistoTrueSecondaryPi0InvMassPt[iCut]);
2608 
2609  if(!fDoLightOutput){
2610  fHistoTruePi0InvMassPtAlpha[iCut] = new TH2F("ESD_TruePi0_InvMass_vs_Pt_Alpha", "ESD_TruePi0_InvMass_vs_Pt_Alpha", 800, 0, 0.8, nBinsPt, arrPtBinning);
2611  fHistoTruePi0InvMassPtAlpha[iCut]->SetYTitle("p_{T} (GeV/c)");
2612  fHistoTruePi0InvMassPtAlpha[iCut]->SetXTitle("M_{#gamma#gamma} (GeV/c^{2})");
2613  fHistoTruePi0InvMassPtAlpha[iCut]->Sumw2();
2614  fESDList[iCut]->Add(fHistoTruePi0InvMassPtAlpha[iCut]);
2615  fHistoTruePi0PureGammaInvMassPtAlpha[iCut] = new TH2F("ESD_TruePi0PureGamma_InvMass_vs_Pt_Alpha", "ESD_TruePi0PureGamma_InvMass_vs_Pt_Alpha", 800, 0, 0.8, nBinsPt, arrPtBinning);
2616  fHistoTruePi0PureGammaInvMassPtAlpha[iCut]->SetYTitle("p_{T} (GeV/c)");
2617  fHistoTruePi0PureGammaInvMassPtAlpha[iCut]->SetXTitle("M_{#gamma#gamma} (GeV/c^{2})");
2618  fHistoTruePi0PureGammaInvMassPtAlpha[iCut]->Sumw2();
2620  }
2621 
2622  fHistoTrueSecondaryPi0FromK0sInvMassPt[iCut] = new TH2F("ESD_TrueSecondaryPi0FromK0s_InvMass_Pt", "ESD_TrueSecondaryPi0FromK0s_InvMass_Pt", 800, 0, 0.8, nBinsPt, arrPtBinning);
2623  fHistoTrueSecondaryPi0FromK0sInvMassPt[iCut]->SetYTitle("p_{T} (GeV/c)");
2624  fHistoTrueSecondaryPi0FromK0sInvMassPt[iCut]->SetXTitle("M_{#gamma#gamma} (GeV/c^{2})");
2627  fHistoTrueSecondaryPi0FromK0lInvMassPt[iCut] = new TH2F("ESD_TrueSecondaryPi0FromK0l_InvMass_Pt", "ESD_TrueSecondaryPi0FromK0l_InvMass_Pt", 800, 0, 0.8, nBinsPt, arrPtBinning);
2628  fHistoTrueSecondaryPi0FromK0lInvMassPt[iCut]->SetYTitle("p_{T} (GeV/c)");
2629  fHistoTrueSecondaryPi0FromK0lInvMassPt[iCut]->SetXTitle("M_{#gamma#gamma} (GeV/c^{2})");
2632  fHistoTrueSecondaryPi0FromEtaInvMassPt[iCut] = new TH2F("ESD_TrueSecondaryPi0FromEta_InvMass_Pt", "ESD_TrueSecondaryPi0FromEta_InvMass_Pt", 800, 0, 0.8, nBinsPt, arrPtBinning);
2633  fHistoTrueSecondaryPi0FromEtaInvMassPt[iCut]->SetYTitle("p_{T} (GeV/c)");
2634  fHistoTrueSecondaryPi0FromEtaInvMassPt[iCut]->SetXTitle("M_{#gamma#gamma} (GeV/c^{2})");
2636  fHistoTrueSecondaryPi0FromLambdaInvMassPt[iCut] = new TH2F("ESD_TrueSecondaryPi0FromLambda_InvMass_Pt", "ESD_TrueSecondaryPi0FromLambda_InvMass_Pt", 800, 0, 0.8, nBinsPt, arrPtBinning);
2637  fHistoTrueSecondaryPi0FromLambdaInvMassPt[iCut]->SetYTitle("p_{T} (GeV/c)");
2638  fHistoTrueSecondaryPi0FromLambdaInvMassPt[iCut]->SetXTitle("M_{#gamma#gamma} (GeV/c^{2})");
2640 
2641  if (fIsMC > 1){
2642  fHistoTruePi0InvMassPt[iCut]->Sumw2();
2643  fHistoTruePi0noConvInvMassPt[iCut]->Sumw2();
2644  fHistoTrueEtaInvMassPt[iCut]->Sumw2();
2645  fHistoDoubleCountTruePi0InvMassPt[iCut]->Sumw2();
2646  fHistoDoubleCountTrueEtaInvMassPt[iCut]->Sumw2();
2651  }
2652 
2653 
2654  if (fDoMesonQA > 0 && fDoMesonQA < 3){
2655  if (fIsMC < 2){
2656 
2657  fHistoTruePi0CaloPhotonInvMassPt[iCut] = new TH2F("ESD_TruePi0CaloPhoton_InvMass_Pt", "ESD_TruePi0CaloPhoton_InvMass_Pt", 800, 0, 0.8, nBinsPt, arrPtBinning);
2658  fHistoTruePi0CaloPhotonInvMassPt[iCut]->SetYTitle("p_{T} (GeV/c)");
2659  fHistoTruePi0CaloPhotonInvMassPt[iCut]->SetXTitle("M_{#gamma#gamma} (GeV/c^{2})");
2660  fTrueList[iCut]->Add(fHistoTruePi0CaloPhotonInvMassPt[iCut]);
2661  fHistoTrueEtaCaloPhotonInvMassPt[iCut] = new TH2F("ESD_TrueEtaCaloPhoton_InvMass_Pt", "ESD_TrueEtaCaloPhoton_InvMass_Pt", 800, 0, 0.8, nBinsPt, arrPtBinning);
2662  fHistoTrueEtaCaloPhotonInvMassPt[iCut]->SetYTitle("p_{T} (GeV/c)");
2663  fHistoTrueEtaCaloPhotonInvMassPt[iCut]->SetXTitle("M_{#gamma#gamma} (GeV/c^{2})");
2664  fTrueList[iCut]->Add(fHistoTrueEtaCaloPhotonInvMassPt[iCut]);
2665 
2666  fHistoTruePi0CaloMixedPhotonConvPhotonInvMassPt[iCut] = new TH2F("ESD_TruePi0CaloMixedPhotonConvertedPhoton_InvMass_Pt", "ESD_TruePi0CaloMixedPhotonConvertedPhoton_InvMass_Pt", 800, 0, 0.8,
2667  nBinsPt, arrPtBinning);
2668  fHistoTruePi0CaloMixedPhotonConvPhotonInvMassPt[iCut]->SetYTitle("p_{T} (GeV/c)");
2669  fHistoTruePi0CaloMixedPhotonConvPhotonInvMassPt[iCut]->SetXTitle("M_{#gamma#gamma} (GeV/c^{2})");
2671  fHistoTrueEtaCaloMixedPhotonConvPhotonInvMassPt[iCut] = new TH2F("ESD_TrueEtaCaloMixedPhotonConvertedPhoton_InvMass_Pt", "ESD_TrueEtaCaloMixedPhotonConvertedPhoton_InvMass_Pt", 800, 0, 0.8,
2672  nBinsPt, arrPtBinning);
2673  fHistoTrueEtaCaloMixedPhotonConvPhotonInvMassPt[iCut]->SetYTitle("p_{T} (GeV/c)");
2674  fHistoTrueEtaCaloMixedPhotonConvPhotonInvMassPt[iCut]->SetXTitle("M_{#gamma#gamma} (GeV/c^{2})");
2676 
2677  fHistoTruePi0CaloConvertedPhotonInvMassPt[iCut] = new TH2F("ESD_TruePi0CaloConvertedPhoton_InvMass_Pt", "ESD_TruePi0CaloConvertedPhoton_InvMass_Pt", 800, 0, 0.8, nBinsPt, arrPtBinning);
2678  fHistoTruePi0CaloConvertedPhotonInvMassPt[iCut]->SetYTitle("p_{T} (GeV/c)");
2679  fHistoTruePi0CaloConvertedPhotonInvMassPt[iCut]->SetXTitle("M_{#gamma#gamma} (GeV/c^{2})");
2681  fHistoTrueEtaCaloConvertedPhotonInvMassPt[iCut] = new TH2F("ESD_TrueEtaCaloConvertedPhoton_InvMass_Pt", "ESD_TrueEtaCaloConvertedPhoton_InvMass_Pt", 800, 0, 0.8, nBinsPt, arrPtBinning);
2682  fHistoTrueEtaCaloConvertedPhotonInvMassPt[iCut]->SetYTitle("p_{T} (GeV/c)");
2683  fHistoTrueEtaCaloConvertedPhotonInvMassPt[iCut]->SetXTitle("M_{#gamma#gamma} (GeV/c^{2})");
2685 
2686  fHistoTruePi0CaloElectronInvMassPt[iCut] = new TH2F("ESD_TruePi0CaloElectron_InvMass_Pt", "ESD_TruePi0CaloElectron_InvMass_Pt", 800, 0, 0.8, nBinsPt, arrPtBinning);
2687  fHistoTruePi0CaloElectronInvMassPt[iCut]->SetYTitle("p_{T} (GeV/c)");
2688  fHistoTruePi0CaloElectronInvMassPt[iCut]->SetXTitle("M_{#gamma#gamma} (GeV/c^{2})");
2690  fHistoTrueEtaCaloElectronInvMassPt[iCut] = new TH2F("ESD_TrueEtaCaloElectron_InvMass_Pt", "ESD_TrueEtaCaloElectron_InvMass_Pt", 800, 0, 0.8, nBinsPt, arrPtBinning);
2691  fHistoTrueEtaCaloElectronInvMassPt[iCut]->SetYTitle("p_{T} (GeV/c)");
2692  fHistoTrueEtaCaloElectronInvMassPt[iCut]->SetXTitle("M_{#gamma#gamma} (GeV/c^{2})");
2694 
2695  fHistoTruePi0CaloMergedClusterInvMassPt[iCut] = new TH2F("ESD_TruePi0CaloMergedCluster_InvMass_Pt", "ESD_TruePi0CaloMergedCluster_InvMass_Pt", 800, 0, 0.8, nBinsPt, arrPtBinning);
2696  fHistoTruePi0CaloMergedClusterInvMassPt[iCut]->SetYTitle("p_{T} (GeV/c)");
2697  fHistoTruePi0CaloMergedClusterInvMassPt[iCut]->SetXTitle("M_{#gamma#gamma} (GeV/c^{2})");
2699  fHistoTrueEtaCaloMergedClusterInvMassPt[iCut] = new TH2F("ESD_TrueEtaCaloMergedCluster_InvMass_Pt", "ESD_TrueEtaCaloMergedCluster_InvMass_Pt", 800, 0, 0.8, nBinsPt, arrPtBinning);
2700  fHistoTrueEtaCaloMergedClusterInvMassPt[iCut]->SetYTitle("p_{T} (GeV/c)");
2701  fHistoTrueEtaCaloMergedClusterInvMassPt[iCut]->SetXTitle("M_{#gamma#gamma} (GeV/c^{2})");
2703 
2704  fHistoTruePi0CaloMergedClusterPartConvInvMassPt[iCut] = new TH2F("ESD_TruePi0CaloMergedClusterPartConv_InvMass_Pt", "ESD_TruePi0CaloMergedClusterPartConv_InvMass_Pt", 800, 0, 0.8,
2705  nBinsPt, arrPtBinning);
2706  fHistoTruePi0CaloMergedClusterPartConvInvMassPt[iCut]->SetYTitle("p_{T} (GeV/c)");
2707  fHistoTruePi0CaloMergedClusterPartConvInvMassPt[iCut]->SetXTitle("M_{#gamma#gamma} (GeV/c^{2})");
2709  fHistoTrueEtaCaloMergedClusterPartConvInvMassPt[iCut] = new TH2F("ESD_TrueEtaCaloMergedClusterPartConv_InvMass_Pt", "ESD_TrueEtaCaloMergedClusterPartConv_InvMass_Pt", 800, 0, 0.8,
2710  nBinsPt, arrPtBinning);
2711  fHistoTrueEtaCaloMergedClusterPartConvInvMassPt[iCut]->SetYTitle("p_{T} (GeV/c)");
2712  fHistoTrueEtaCaloMergedClusterPartConvInvMassPt[iCut]->SetXTitle("M_{#gamma#gamma} (GeV/c^{2})");
2714 
2715  fHistoTruePi0NonMergedElectronPhotonInvMassPt[iCut] = new TH2F("ESD_TruePi0NonMergedElectronPhoton_InvMass_Pt", "ESD_TruePi0NonMergedElectronPhoton_InvMass_Pt", 800, 0, 0.8, nBinsPt, arrPtBinning);
2716  fHistoTruePi0NonMergedElectronPhotonInvMassPt[iCut]->SetYTitle("p_{T} (GeV/c)");
2717  fHistoTruePi0NonMergedElectronPhotonInvMassPt[iCut]->SetXTitle("M_{#gamma#gamma} (GeV/c^{2})");
2719  fHistoTruePi0NonMergedElectronMergedPhotonInvMassPt[iCut] = new TH2F("ESD_TruePi0NonMergedElectronMergedPhoton_InvMass_Pt", "ESD_TruePi0NonMergedElectronMergedPhoton_InvMass_Pt", 800, 0, 0.8,
2720  nBinsPt, arrPtBinning);
2721  fHistoTruePi0NonMergedElectronMergedPhotonInvMassPt[iCut]->SetYTitle("p_{T} (GeV/c)");
2722  fHistoTruePi0NonMergedElectronMergedPhotonInvMassPt[iCut]->SetXTitle("M_{#gamma#gamma} (GeV/c^{2})");
2724 
2725  fHistoTruePrimaryPi0MCPtResolPt[iCut] = new TH2F("ESD_TruePrimaryPi0_MCPt_ResolPt", "ESD_TruePrimaryPi0_ResolPt_MCPt", 500, 0.03, 35, 1000, -1., 1.);
2726  fHistoTruePrimaryPi0MCPtResolPt[iCut]->SetXTitle("p_{T, MC} (GeV/c)");
2727  fHistoTruePrimaryPi0MCPtResolPt[iCut]->SetXTitle("#delta (p_{T}) (GeV/c)");
2728  fHistoTruePrimaryPi0MCPtResolPt[iCut]->Sumw2();
2730  fTrueList[iCut]->Add(fHistoTruePrimaryPi0MCPtResolPt[iCut]);
2731  fHistoTruePrimaryEtaMCPtResolPt[iCut] = new TH2F("ESD_TruePrimaryEta_MCPt_ResolPt", "ESD_TruePrimaryEta_ResolPt_MCPt", 500, 0.03, 35, 1000, -1., 1.);
2732  fHistoTruePrimaryEtaMCPtResolPt[iCut]->SetXTitle("p_{T, MC} (GeV/c)");
2733  fHistoTruePrimaryEtaMCPtResolPt[iCut]->SetXTitle("#delta (p_{T}) (GeV/c)");
2734  fHistoTruePrimaryEtaMCPtResolPt[iCut]->Sumw2();
2736  fTrueList[iCut]->Add(fHistoTruePrimaryEtaMCPtResolPt[iCut]);
2737  fHistoTrueK0sWithPi0DaughterMCPt[iCut] = new TH1F("ESD_TrueK0sWithPi0Daughter_MCPt", "ESD_TrueK0sWithPi0Daughter_MCPt", nBinsPt, arrPtBinning);
2738  fHistoTrueK0sWithPi0DaughterMCPt[iCut]->SetXTitle("p_{T, MC} (GeV/c)");
2739  fTrueList[iCut]->Add(fHistoTrueK0sWithPi0DaughterMCPt[iCut]);
2740  fHistoTrueK0lWithPi0DaughterMCPt[iCut] = new TH1F("ESD_TrueK0lWithPi0Daughter_MCPt", "ESD_TrueK0lWithPi0Daughter_MCPt", nBinsPt, arrPtBinning);
2741  fHistoTrueK0lWithPi0DaughterMCPt[iCut]->SetXTitle("p_{T, MC} (GeV/c)");
2742  fTrueList[iCut]->Add(fHistoTrueK0lWithPi0DaughterMCPt[iCut]);
2743  fHistoTrueEtaWithPi0DaughterMCPt[iCut] = new TH1F("ESD_TrueEtaWithPi0Daughter_MCPt", "ESD_TrueEtaWithPi0Daughter_MCPt", nBinsPt, arrPtBinning);
2744  fHistoTrueEtaWithPi0DaughterMCPt[iCut]->SetXTitle("p_{T, MC} (GeV/c)");
2745  fTrueList[iCut]->Add(fHistoTrueEtaWithPi0DaughterMCPt[iCut]);
2746  fHistoTrueLambdaWithPi0DaughterMCPt[iCut] = new TH1F("ESD_TrueLambdaWithPi0Daughter_MCPt", "ESD_TrueLambdaWithPi0Daughter_MCPt", nBinsPt, arrPtBinning);
2747  fHistoTrueLambdaWithPi0DaughterMCPt[iCut]->SetXTitle("p_{T, MC} (GeV/c)");
2749  }
2750 
2751  fHistoTruePi0PtY[iCut] = new TH2F("ESD_TruePi0_Pt_Y", "ESD_TruePi0_Pt_Y", nBinsQAPt, arrQAPtBinning, 150, -1.5, 1.5);
2752  fHistoTruePi0PtY[iCut]->SetXTitle("p_{T} (GeV/c)");
2753  fHistoTruePi0PtY[iCut]->SetYTitle("y");
2754  fTrueList[iCut]->Add(fHistoTruePi0PtY[iCut]);
2755  fHistoTrueEtaPtY[iCut] = new TH2F("ESD_TrueEta_Pt_Y", "ESD_TrueEta_Pt_Y", nBinsQAPt, arrQAPtBinning, 150, -1.5, 1.5);
2756  fHistoTrueEtaPtY[iCut]->SetXTitle("p_{T} (GeV/c)");
2757  fHistoTrueEtaPtY[iCut]->SetYTitle("y");
2758  fTrueList[iCut]->Add(fHistoTrueEtaPtY[iCut]);
2759  fHistoTruePi0PtAlpha[iCut] = new TH2F("ESD_TruePi0_Pt_Alpha", "ESD_TruePi0_Pt_Alpha", nBinsQAPt, arrQAPtBinning, 100, 0, 1);
2760  fHistoTruePi0PtAlpha[iCut]->SetXTitle("p_{T} (GeV/c)");
2761  fHistoTruePi0PtAlpha[iCut]->SetYTitle("#alpha");
2762  fTrueList[iCut]->Add(fHistoTruePi0PtAlpha[iCut]);
2763  fHistoTrueEtaPtAlpha[iCut] = new TH2F("ESD_TrueEta_Pt_Alpha", "ESD_TrueEta_Pt_Alpha", nBinsQAPt, arrQAPtBinning, 100, 0, 1);
2764  fHistoTrueEtaPtAlpha[iCut]->SetXTitle("p_{T} (GeV/c)");
2765  fHistoTrueEtaPtAlpha[iCut]->SetYTitle("#alpha");
2766  fTrueList[iCut]->Add(fHistoTrueEtaPtAlpha[iCut]);
2767 
2768  fHistoTruePi0PtOpenAngle[iCut] = new TH2F("ESD_TruePi0_Pt_OpenAngle", "ESD_TruePi0_Pt_OpenAngle", nBinsQAPt, arrQAPtBinning, 100, 0, 0.5);
2769  fHistoTruePi0PtOpenAngle[iCut]->SetXTitle("p_{T} (GeV/c)");
2770  fHistoTruePi0PtOpenAngle[iCut]->SetYTitle("#theta");
2771  fTrueList[iCut]->Add(fHistoTruePi0PtOpenAngle[iCut]);
2772  fHistoTrueEtaPtOpenAngle[iCut] = new TH2F("ESD_TrueEta_Pt_OpenAngle", "ESD_TrueEta_Pt_OpenAngle", nBinsQAPt, arrQAPtBinning, 180, 0, 1.8);
2773  fHistoTrueEtaPtOpenAngle[iCut]->SetXTitle("p_{T} (GeV/c)");
2774  fHistoTrueEtaPtOpenAngle[iCut]->SetYTitle("#theta");
2775  fTrueList[iCut]->Add(fHistoTrueEtaPtOpenAngle[iCut]);
2776 
2777  fHistoTrueBckGGInvMassPt[iCut] = new TH2F("ESD_TrueBckGG_InvMass_Pt", "ESD_TrueBckGG_InvMass_Pt", 800, 0, 0.8, nBinsPt, arrPtBinning);
2778  fHistoTrueBckGGInvMassPt[iCut]->SetYTitle("p_{T} (GeV/c)");
2779  fHistoTrueBckGGInvMassPt[iCut]->SetXTitle("M_{#gamma#gamma} (GeV/c^{2})");
2780  fTrueList[iCut]->Add(fHistoTrueBckGGInvMassPt[iCut]);
2781  fHistoTrueBckFullMesonContainedInOneClusterInvMassPt[iCut] = new TH2F("ESD_TrueBckFullMesonContained_InvMass_Pt", "ESD_TrueBckFullMesonContained_InvMass_Pt", 800, 0, 0.8, nBinsPt, arrPtBinning);
2782  fHistoTrueBckFullMesonContainedInOneClusterInvMassPt[iCut]->SetYTitle("p_{T} (GeV/c)");
2783  fHistoTrueBckFullMesonContainedInOneClusterInvMassPt[iCut]->SetXTitle("M_{#gamma#gamma} (GeV/c^{2})");
2785  fHistoTrueBckAsymEClustersInvMassPt[iCut] = new TH2F("ESD_TrueBckAsymEClus_InvMass_Pt", "ESD_TrueBckAsymEClus_InvMass_Pt", 800, 0, 0.8, nBinsPt, arrPtBinning);
2786  fHistoTrueBckAsymEClustersInvMassPt[iCut]->SetYTitle("p_{T} (GeV/c)");
2787  fHistoTrueBckAsymEClustersInvMassPt[iCut]->SetXTitle("M_{#gamma#gamma} (GeV/c^{2})");
2789  fHistoTrueBckContInvMassPt[iCut] = new TH2F("ESD_TrueBckCont_InvMass_Pt", "ESD_TrueBckCont_InvMass_Pt", 800, 0, 0.8, nBinsPt, arrPtBinning);
2790  fHistoTrueBckContInvMassPt[iCut]->SetYTitle("p_{T} (GeV/c)");
2791  fHistoTrueBckContInvMassPt[iCut]->SetXTitle("M_{#gamma#gamma} (GeV/c^{2})");
2792  fTrueList[iCut]->Add(fHistoTrueBckContInvMassPt[iCut]);
2793 
2794  if (fIsMC > 1){
2795  fHistoTruePi0PtY[iCut]->Sumw2();
2796  fHistoTrueEtaPtY[iCut]->Sumw2();
2797  fHistoTruePi0PtAlpha[iCut]->Sumw2();
2798  fHistoTrueEtaPtAlpha[iCut]->Sumw2();
2799  fHistoTruePi0PtOpenAngle[iCut]->Sumw2();
2800  fHistoTrueEtaPtOpenAngle[iCut]->Sumw2();
2801  fHistoTrueBckGGInvMassPt[iCut]->Sumw2();
2803  fHistoTrueBckAsymEClustersInvMassPt[iCut]->Sumw2();
2804  fHistoTrueBckContInvMassPt[iCut]->Sumw2();
2805  }
2806 
2807  }
2808 
2809  if (fDoMesonQA == 2 && fIsMC < 2){
2810  fHistoTruePi0Category1[iCut] = new TH2F("ESD_TruePi0Category1_InvMass_Pt", "ESD_TruePi0Category1_InvMass_Pt", 800, 0, 0.8, nBinsPt, arrPtBinning);
2811  fHistoTruePi0Category1[iCut]->SetYTitle("p_{T} (GeV/c)");
2812  fHistoTruePi0Category1[iCut]->SetXTitle("M_{#gamma#gamma} (GeV/c^{2})");
2813  fTrueList[iCut]->Add(fHistoTruePi0Category1[iCut]);
2814  fHistoTrueEtaCategory1[iCut] = new TH2F("ESD_TrueEtaCategory1_InvMass_Pt", "ESD_TrueEtaCategory1_InvMass_Pt", 800, 0, 0.8, nBinsPt, arrPtBinning);
2815  fHistoTrueEtaCategory1[iCut]->SetYTitle("p_{T} (GeV/c)");
2816  fHistoTrueEtaCategory1[iCut]->SetXTitle("M_{#gamma#gamma} (GeV/c^{2})");
2817  fTrueList[iCut]->Add(fHistoTrueEtaCategory1[iCut]);
2818  fHistoTruePi0Category2[iCut] = new TH2F("ESD_TruePi0Category2_InvMass_Pt", "ESD_TruePi0Category2_InvMass_Pt", 800, 0, 0.8, nBinsPt, arrPtBinning);
2819  fHistoTruePi0Category2[iCut]->SetYTitle("p_{T} (GeV/c)");
2820  fHistoTruePi0Category2[iCut]->SetXTitle("M_{#gamma#gamma} (GeV/c^{2})");
2821  fTrueList[iCut]->Add(fHistoTruePi0Category2[iCut]);
2822  fHistoTrueEtaCategory2[iCut] = new TH2F("ESD_TrueEtaCategory2_InvMass_Pt", "ESD_TrueEtaCategory2_InvMass_Pt", 800, 0, 0.8, nBinsPt, arrPtBinning);
2823  fHistoTrueEtaCategory2[iCut]->SetYTitle("p_{T} (GeV/c)");
2824  fHistoTrueEtaCategory2[iCut]->SetXTitle("M_{#gamma#gamma} (GeV/c^{2})");
2825  fTrueList[iCut]->Add(fHistoTrueEtaCategory2[iCut]);
2826  fHistoTruePi0Category3[iCut] = new TH2F("ESD_TruePi0Category3_InvMass_Pt", "ESD_TruePi0Category3_InvMass_Pt", 800, 0, 0.8, nBinsPt, arrPtBinning);
2827  fHistoTruePi0Category3[iCut]->SetYTitle("p_{T} (GeV/c)");
2828  fHistoTruePi0Category3[iCut]->SetXTitle("M_{#gamma#gamma} (GeV/c^{2})");
2829  fTrueList[iCut]->Add(fHistoTruePi0Category3[iCut]);
2830  fHistoTrueEtaCategory3[iCut] = new TH2F("ESD_TrueEtaCategory3_InvMass_Pt", "ESD_TrueEtaCategory3_InvMass_Pt", 800, 0, 0.8, nBinsPt, arrPtBinning);
2831  fHistoTrueEtaCategory3[iCut]->SetYTitle("p_{T} (GeV/c)");
2832  fHistoTrueEtaCategory3[iCut]->SetXTitle("M_{#gamma#gamma} (GeV/c^{2})");
2833  fTrueList[iCut]->Add(fHistoTrueEtaCategory3[iCut]);
2834  fHistoTruePi0Category4_6[iCut] = new TH2F("ESD_TruePi0Category4_6_InvMass_Pt", "ESD_TruePi0Category4_6_InvMass_Pt", 800, 0, 0.8, nBinsPt, arrPtBinning);
2835  fHistoTruePi0Category4_6[iCut]->SetYTitle("p_{T} (GeV/c)");
2836  fHistoTruePi0Category4_6[iCut]->SetXTitle("M_{#gamma#gamma} (GeV/c^{2})");
2837  fTrueList[iCut]->Add(fHistoTruePi0Category4_6[iCut]);
2838  fHistoTrueEtaCategory4_6[iCut] = new TH2F("ESD_TrueEtaCategory4_6_InvMass_Pt", "ESD_TrueEtaCategory4_6_InvMass_Pt", 800, 0, 0.8, nBinsPt, arrPtBinning);
2839  fHistoTrueEtaCategory4_6[iCut]->SetYTitle("p_{T} (GeV/c)");
2840  fHistoTrueEtaCategory4_6[iCut]->SetXTitle("M_{#gamma#gamma} (GeV/c^{2})");
2841  fTrueList[iCut]->Add(fHistoTrueEtaCategory4_6[iCut]);
2842  fHistoTruePi0Category5[iCut] = new TH2F("ESD_TruePi0Category5_InvMass_Pt", "ESD_TruePi0Category5_InvMass_Pt", 800, 0, 0.8, nBinsPt, arrPtBinning);
2843  fHistoTruePi0Category5[iCut]->SetYTitle("p_{T} (GeV/c)");
2844  fHistoTruePi0Category5[iCut]->SetXTitle("M_{#gamma#gamma} (GeV/c^{2})");
2845  fTrueList[iCut]->Add(fHistoTruePi0Category5[iCut]);
2846  fHistoTrueEtaCategory5[iCut] = new TH2F("ESD_TrueEtaCategory5_InvMass_Pt", "ESD_TrueEtaCategory5_InvMass_Pt", 800, 0, 0.8, nBinsPt, arrPtBinning);
2847  fHistoTrueEtaCategory5[iCut]->SetYTitle("p_{T} (GeV/c)");
2848  fHistoTrueEtaCategory5[iCut]->SetXTitle("M_{#gamma#gamma} (GeV/c^{2})");
2849  fTrueList[iCut]->Add(fHistoTrueEtaCategory5[iCut]);
2850  fHistoTruePi0Category7[iCut] = new TH2F("ESD_TruePi0Category7_InvMass_Pt", "ESD_TruePi0Category7_InvMass_Pt", 800, 0, 0.8, nBinsPt, arrPtBinning);
2851  fHistoTruePi0Category7[iCut]->SetYTitle("p_{T} (GeV/c)");
2852  fHistoTruePi0Category7[iCut]->SetXTitle("M_{#gamma#gamma} (GeV/c^{2})");
2853  fTrueList[iCut]->Add(fHistoTruePi0Category7[iCut]);
2854  fHistoTrueEtaCategory7[iCut] = new TH2F("ESD_TrueEtaCategory7_InvMass_Pt", "ESD_TrueEtaCategory7_InvMass_Pt", 800, 0, 0.8, nBinsPt, arrPtBinning);
2855  fHistoTrueEtaCategory7[iCut]->SetYTitle("p_{T} (GeV/c)");
2856  fHistoTrueEtaCategory7[iCut]->SetXTitle("M_{#gamma#gamma} (GeV/c^{2})");
2857  fTrueList[iCut]->Add(fHistoTrueEtaCategory7[iCut]);
2858  fHistoTruePi0Category8[iCut] = new TH2F("ESD_TruePi0Category8_InvMass_Pt", "ESD_TruePi0Category8_InvMass_Pt", 800, 0, 0.8, nBinsPt, arrPtBinning);
2859  fHistoTruePi0Category8[iCut]->SetYTitle("p_{T} (GeV/c)");
2860  fHistoTruePi0Category8[iCut]->SetXTitle("M_{#gamma#gamma} (GeV/c^{2})");
2861  fTrueList[iCut]->Add(fHistoTruePi0Category8[iCut]);
2862  fHistoTrueEtaCategory8[iCut] = new TH2F("ESD_TrueEtaCategory8_InvMass_Pt", "ESD_TrueEtaCategory8_InvMass_Pt", 800, 0, 0.8, nBinsPt, arrPtBinning);
2863  fHistoTrueEtaCategory8[iCut]->SetYTitle("p_{T} (GeV/c)");
2864  fHistoTrueEtaCategory8[iCut]->SetXTitle("M_{#gamma#gamma} (GeV/c^{2})");
2865  fTrueList[iCut]->Add(fHistoTrueEtaCategory8[iCut]);
2866  }
2867 
2868  if (fDoMesonQA == 3){
2869  fTreeList[iCut] = new TList();
2870  fTreeList[iCut]->SetName(Form("%s_%s_%s True ClusterComb tree", cutstringEvent.Data(), cutstringCalo.Data(), cutstringMeson.Data()));
2871  fTreeList[iCut]->SetOwner(kTRUE);
2872  fCutFolder[iCut]->Add(fTreeList[iCut]);
2873 
2874  tTrueInvMassROpenABPtFlag[iCut] = new TTree("True_InvMass_R_OpenA_OpenB_Pt_Flag", "True_InvMass_R_OpenA_OpenB_Pt_Flag");
2875  tTrueInvMassROpenABPtFlag[iCut]->Branch("InvMass",&fInvMass,"fInvMass/F");
2876  tTrueInvMassROpenABPtFlag[iCut]->Branch("RConv",&fRconv,"fRconv/F");
2877  tTrueInvMassROpenABPtFlag[iCut]->Branch("OpenAngleRPrimVtx",&fOpenRPrim,"fOpenRPrim/F");
2878  tTrueInvMassROpenABPtFlag[iCut]->Branch("InvMassRTOF",&fInvMassRTOF,"fInvMassRTOF/F");
2879  tTrueInvMassROpenABPtFlag[iCut]->Branch("Pt",&fPt,"fPt/F");
2880 // tTrueInvMassROpenABPtFlag[iCut]->Branch("Weight",&fWeightJetJetMC,"fWeightJetJetMC/F");
2881  tTrueInvMassROpenABPtFlag[iCut]->Branch("cat",&iFlag,"iFlag/b");
2882  fTreeList[iCut]->Add(tTrueInvMassROpenABPtFlag[iCut]);
2883  }
2884  }
2885  }
2886  }
2887 
2892 
2894 
2895  if(fV0Reader)
2897  if(((AliConversionPhotonCuts*)fV0Reader->GetConversionCuts())->GetCutHistograms())
2898  fOutputContainer->Add(((AliConversionPhotonCuts*)fV0Reader->GetConversionCuts())->GetCutHistograms());
2899  if(fV0Reader)
2901  if(((AliConvEventCuts*)fV0Reader->GetEventCuts())->GetCutHistograms())
2902  fOutputContainer->Add(((AliConvEventCuts*)fV0Reader->GetEventCuts())->GetCutHistograms());
2903 
2904  for(Int_t iMatcherTask = 0; iMatcherTask < 3; iMatcherTask++){
2905  AliCaloTrackMatcher* temp = (AliCaloTrackMatcher*) (AliAnalysisManager::GetAnalysisManager()->GetTask(Form("CaloTrackMatcher_%i_%i",iMatcherTask,fTrackMatcherRunningMode)));
2906  if(temp) fOutputContainer->Add(temp->GetCaloTrackMatcherHistograms());
2907  }
2908  AliPhotonIsolation* temp2 = (AliPhotonIsolation*)AliAnalysisManager::GetAnalysisManager()->GetTask("PhotonIsolation");
2909  if(temp2) fOutputContainer->Add(temp2->GetPhotonIsolationHistograms());
2910 
2911 
2912  for(Int_t iCut = 0; iCut<fnCuts;iCut++){
2913  if(!((AliConvEventCuts*)fEventCutArray->At(iCut))) continue;
2914  if(((AliConvEventCuts*)fEventCutArray->At(iCut))->GetCutHistograms()){
2915  fCutFolder[iCut]->Add(((AliConvEventCuts*)fEventCutArray->At(iCut))->GetCutHistograms());
2916  }
2917  if(!((AliCaloPhotonCuts*)fClusterCutArray->At(iCut))) continue;
2918  if(((AliCaloPhotonCuts*)fClusterCutArray->At(iCut))->GetCutHistograms()){
2919  fCutFolder[iCut]->Add(((AliCaloPhotonCuts*)fClusterCutArray->At(iCut))->GetCutHistograms());
2920  }
2921  if(fSetPlotHistsExtQA){
2922  if(!((AliCaloPhotonCuts*)fClusterCutArray->At(iCut))) continue;
2923  if(((AliCaloPhotonCuts*)fClusterCutArray->At(iCut))->GetExtQAHistograms()){
2924  fCutFolder[iCut]->Add(((AliCaloPhotonCuts*)fClusterCutArray->At(iCut))->GetExtQAHistograms());
2925  }
2926  }
2927  if(fDoMesonAnalysis){
2928  if(!((AliConversionMesonCuts*)fMesonCutArray->At(iCut))) continue;
2929  if(((AliConversionMesonCuts*)fMesonCutArray->At(iCut))->GetCutHistograms()){
2930  fCutFolder[iCut]->Add(((AliConversionMesonCuts*)fMesonCutArray->At(iCut))->GetCutHistograms());
2931  }
2932  }
2933  if(fDoJetAnalysis){
2934  fCutFolder[iCut]->Add(fJetHistograms[iCut]);
2935  }
2936  }
2937 
2938  if (fIsMC > 0 ){
2939  tBrokenFiles = new TTree("BrokenFiles", "BrokenFiles");
2940  tBrokenFiles->Branch("fileName",&fFileNameBroken);
2942  }
2943  if (fDoClusterQA > 1){
2944  tClusterQATree = new TTree("ClusterQATree", "ClusterQATree");
2945  tClusterQATree->Branch("closeHighPtClusters",&fCloseHighPtClusters);
2947  }
2948 
2949  if(fLocalDebugFlag > 0){
2950  fstream fOutputLocalDebug;
2951  fOutputLocalDebug.open("debugOutput.txt",ios::out);
2952  fOutputLocalDebug.close();
2953  }
2954 
2955  PostData(1, fOutputContainer);
2956 }
2957 //_____________________________________________________________________________
2959 {
2960  for(Int_t iCut = 0; iCut<fnCuts;iCut++){
2961  if (((AliConvEventCuts*)fEventCutArray->At(iCut))->GetPeriodEnum() == AliConvEventCuts::kNoPeriod && ((AliConvEventCuts*)fV0Reader->GetEventCuts())->GetPeriodEnum() != AliConvEventCuts::kNoPeriod){
2962  ((AliConvEventCuts*)fEventCutArray->At(iCut))->SetPeriodEnumExplicit(((AliConvEventCuts*)fV0Reader->GetEventCuts())->GetPeriodEnum());
2963  } else if (((AliConvEventCuts*)fEventCutArray->At(iCut))->GetPeriodEnum() == AliConvEventCuts::kNoPeriod ){
2964  ((AliConvEventCuts*)fEventCutArray->At(iCut))->SetPeriodEnum(fV0Reader->GetPeriodName());
2965  }
2966  if(fIsHeavyIon==2) {
2967  if(!((AliConvEventCuts*)fEventCutArray->At(iCut))->GetDoEtaShift()){
2968  fProfileEtaShift[iCut]->Fill(0.,(((AliConvEventCuts*)fEventCutArray->At(iCut))->GetEtaShift()));
2969  continue; // No Eta Shift requested, continue
2970  }
2971  if(((AliConvEventCuts*)fEventCutArray->At(iCut))->GetEtaShift() == 0.0){ // Eta Shift requested but not set, get shift automatically
2972  ((AliConvEventCuts*)fEventCutArray->At(iCut))->GetCorrectEtaShiftFromPeriod();
2973  fProfileEtaShift[iCut]->Fill(0.,(((AliConvEventCuts*)fEventCutArray->At(iCut))->GetEtaShift()));
2974  ((AliConvEventCuts*)fEventCutArray->At(iCut))->DoEtaShift(kFALSE); // Eta Shift Set, make sure that it is called only once
2975  continue;
2976  }
2977  else{
2978  printf(" Gamma Conversion Task %s :: Eta Shift Manually Set to %f \n\n",
2979  (((AliConvEventCuts*)fEventCutArray->At(iCut))->GetCutNumber()).Data(),((AliConvEventCuts*)fEventCutArray->At(iCut))->GetEtaShift());
2980  fProfileEtaShift[iCut]->Fill(0.,(((AliConvEventCuts*)fEventCutArray->At(iCut))->GetEtaShift()));
2981  ((AliConvEventCuts*)fEventCutArray->At(iCut))->DoEtaShift(kFALSE); // Eta Shift Set, make sure that it is called only once
2982  }
2983  }
2984  }
2985 
2986  return kTRUE;
2987 }
2988 //_____________________________________________________________________________
2990 {
2991  //
2992  // Called for each event
2993  //
2994  fInputEvent = InputEvent();
2995  fCloseHighPtClusters = 0x0;
2996  if(fIsMC> 0) fMCEvent = MCEvent();
2997 
2998  Int_t eventQuality = ((AliConvEventCuts*)fV0Reader->GetEventCuts())->GetEventQuality();
2999 
3000  if(fInputEvent->IsIncompleteDAQ()==kTRUE) eventQuality = 2; // incomplete event
3001  if(eventQuality == 2 || eventQuality == 3){// Event Not Accepted due to MC event missing or wrong trigger for V0ReaderV1 or because it is incomplete
3002  // write out name of broken file for first event
3003  if (fIsMC > 0){
3004  if (fInputEvent->IsA()==AliESDEvent::Class()){
3005  if (((AliESDEvent*)fInputEvent)->GetEventNumberInFile() == 0){
3006  fFileNameBroken = new TObjString(Form("%s", ((TString)fV0Reader->GetCurrentFileName()).Data()));
3007  if (tBrokenFiles) tBrokenFiles->Fill();
3008  delete fFileNameBroken;
3009  }
3010  }
3011  }
3012 
3013  for(Int_t iCut = 0; iCut<fnCuts; iCut++){
3014  fHistoNEvents[iCut]->Fill(eventQuality);
3015  if (fIsMC>1) fHistoNEventsWOWeight[iCut]->Fill(eventQuality);
3016  }
3017  return;
3018  }
3019 
3020  // ------------------- BeginEvent ----------------------------
3021 
3022  AliEventplane *EventPlane = fInputEvent->GetEventplane();
3023  if(fIsHeavyIon ==1)fEventPlaneAngle = EventPlane->GetEventplane("V0",fInputEvent,2);
3024  else fEventPlaneAngle=0.0;
3025 
3026  for(Int_t iCut = 0; iCut<fnCuts; iCut++){
3027 
3028  fiCut = iCut;
3029 
3031  Bool_t isRunningEMCALrelAna = kFALSE;
3032  if (((AliCaloPhotonCuts*)fClusterCutArray->At(fiCut))->GetClusterType() == 1) isRunningEMCALrelAna = kTRUE;
3033 
3034  Int_t eventNotAccepted = ((AliConvEventCuts*)fEventCutArray->At(iCut))->IsEventAcceptedByCut(fV0Reader->GetEventCuts(),fInputEvent,fMCEvent,fIsHeavyIon, isRunningEMCALrelAna);
3035 
3036  if(fIsMC==2){
3037  Float_t xsection = -1.;
3038  Float_t ntrials = -1.;
3039  ((AliConvEventCuts*)fEventCutArray->At(iCut))->GetXSectionAndNTrials(fMCEvent,xsection,ntrials, fInputEvent );
3040  if((xsection==-1.) || (ntrials==-1.)) AliFatal(Form("ERROR: GetXSectionAndNTrials returned invalid xsection/ntrials, periodName from V0Reader: '%s'",fV0Reader->GetPeriodName().Data()));
3041  fProfileJetJetXSection[iCut]->Fill(0.,xsection);
3042  fHistoJetJetNTrials[iCut]->Fill("#sum{NTrials}", ntrials);
3043  }
3044 
3045  if (fIsMC > 0){
3046  fWeightJetJetMC = 1;
3047  Bool_t isMCJet = ((AliConvEventCuts*)fEventCutArray->At(iCut))->IsJetJetMCEventAccepted( fMCEvent, fWeightJetJetMC , fInputEvent);
3048  if (fIsMC == 3){
3049  Double_t weightMult = ((AliConvEventCuts*)fEventCutArray->At(iCut))->GetWeightForMultiplicity(fV0Reader->GetNumberOfPrimaryTracks());
3050  fWeightJetJetMC = fWeightJetJetMC*weightMult;
3051  }
3052 
3053  if (!isMCJet){
3054  fHistoNEvents[iCut]->Fill(10,fWeightJetJetMC);
3055  if (fIsMC>1) fHistoNEventsWOWeight[iCut]->Fill(10);
3056  continue;
3057  }
3058  }
3059 
3060  Bool_t triggered = kTRUE;
3061  if(eventNotAccepted!= 0){
3062  fHistoNEvents[iCut]->Fill(eventNotAccepted, fWeightJetJetMC); // Check Centrality, PileUp, SDD and V0AND --> Not Accepted => eventQuality = 1
3063  if (fIsMC>1) fHistoNEventsWOWeight[iCut]->Fill(eventNotAccepted);
3064  // cout << "event rejected due to wrong trigger: " <<eventNotAccepted << endl;
3065  if (eventNotAccepted==3 && fIsMC > 0){
3066  triggered = kFALSE;
3067  }else {
3068  continue;
3069  }
3070  }
3071 
3072  if(eventQuality != 0 && triggered== kTRUE){// Event Not Accepted
3073  //cout << "event rejected due to: " <<eventQuality << endl;
3074  fHistoNEvents[iCut]->Fill(eventQuality, fWeightJetJetMC);
3075  if (fIsMC>1) fHistoNEventsWOWeight[iCut]->Fill(eventQuality); // Should be 0 here
3076  continue;
3077  }
3078  if (triggered == kTRUE) {
3079  if(((AliConvEventCuts*)fEventCutArray->At(iCut))->GetUseSphericity()!=0){
3080  if(fV0Reader->GetSphericity() != -1 && fV0Reader->GetSphericity() != 0){
3082  if(fConvJetReader->GetNJets() > 0){
3083  fHistoNEvents[iCut]->Fill(eventQuality, fWeightJetJetMC); // Should be 0 here
3084  if (fIsMC>1) fHistoNEventsWOWeight[iCut]->Fill(eventQuality); // Should be 0 here
3086  fHistoVertexZ[iCut]->Fill(fInputEvent->GetPrimaryVertex()->GetZ(), fWeightJetJetMC);
3089  }
3090  }else if(fDoJetAnalysis && fDoSoftAnalysis){
3091  if(fConvJetReader->GetNJets() < 1){
3092  fHistoNEvents[iCut]->Fill(eventQuality, fWeightJetJetMC); // Should be 0 here
3093  if (fIsMC>1) fHistoNEventsWOWeight[iCut]->Fill(eventQuality); // Should be 0 here
3095  fHistoVertexZ[iCut]->Fill(fInputEvent->GetPrimaryVertex()->GetZ(), fWeightJetJetMC);
3098  }
3099  }else{
3100  fHistoNEvents[iCut]->Fill(eventQuality, fWeightJetJetMC); // Should be 0 here
3101  if (fIsMC>1) fHistoNEventsWOWeight[iCut]->Fill(eventQuality); // Should be 0 here
3103  fHistoVertexZ[iCut]->Fill(fInputEvent->GetPrimaryVertex()->GetZ(), fWeightJetJetMC);
3106  }
3107  }
3108  }else{
3109  fHistoNEvents[iCut]->Fill(eventQuality, fWeightJetJetMC); // Should be 0 here
3110  if (fIsMC>1) fHistoNEventsWOWeight[iCut]->Fill(eventQuality); // Should be 0 here
3112  fHistoVertexZ[iCut]->Fill(fInputEvent->GetPrimaryVertex()->GetZ(), fWeightJetJetMC);
3113  }
3114  if(!fDoLightOutput){
3115  fHistoSPDClusterTrackletBackground[iCut]->Fill(fInputEvent->GetMultiplicity()->GetNumberOfTracklets(),(fInputEvent->GetNumberOfITSClusters(0)+fInputEvent->GetNumberOfITSClusters(1)), fWeightJetJetMC);
3116  if(((AliConvEventCuts*)fEventCutArray->At(iCut))->IsHeavyIon() == 2) fHistoNV0Tracks[iCut]->Fill(fInputEvent->GetVZEROData()->GetMTotV0A(), fWeightJetJetMC);
3117  else fHistoNV0Tracks[iCut]->Fill(fInputEvent->GetVZEROData()->GetMTotV0A()+fInputEvent->GetVZEROData()->GetMTotV0C(), fWeightJetJetMC);
3118  }
3119  }
3120  if(fIsMC> 0){
3121  // Process MC Particle
3122  if(((AliConvEventCuts*)fEventCutArray->At(iCut))->GetSignalRejection() != 0){
3123  if(fInputEvent->IsA()==AliESDEvent::Class()){
3124  ((AliConvEventCuts*)fEventCutArray->At(iCut))->GetNotRejectedParticles(((AliConvEventCuts*)fEventCutArray->At(iCut))->GetSignalRejection(),
3125  ((AliConvEventCuts*)fEventCutArray->At(iCut))->GetAcceptedHeader(),
3126  fMCEvent);
3127  }
3128  else if(fInputEvent->IsA()==AliAODEvent::Class()){
3129  ((AliConvEventCuts*)fEventCutArray->At(iCut))->GetNotRejectedParticles(((AliConvEventCuts*)fEventCutArray->At(iCut))->GetSignalRejection(),
3130  ((AliConvEventCuts*)fEventCutArray->At(iCut))->GetAcceptedHeader(),
3131  fInputEvent);
3132  }
3133 
3134  if(!fDoLightOutput){
3135  if(((AliConvEventCuts*)fEventCutArray->At(iCut))->GetAcceptedHeader()){
3136  for(Int_t i = 0;i<(((AliConvEventCuts*)fEventCutArray->At(iCut))->GetAcceptedHeader())->GetEntries();i++){
3137  TString nameBin= fHistoMCHeaders[iCut]->GetXaxis()->GetBinLabel(i+1);
3138  if (nameBin.CompareTo("")== 0){
3139  TString nameHeader = ((TObjString*)((TList*)((AliConvEventCuts*)fEventCutArray->At(iCut))
3140  ->GetAcceptedHeader())->At(i))->GetString();
3141  fHistoMCHeaders[iCut]->GetXaxis()->SetBinLabel(i+1,nameHeader.Data());
3142  }
3143  }
3144  }
3145  }
3146  }
3147  }
3148  if(fIsMC> 0){
3149  if(fInputEvent->IsA()==AliESDEvent::Class())
3151  if(fInputEvent->IsA()==AliAODEvent::Class())
3153  }
3154 
3155  if (triggered==kFALSE) continue;
3156 
3157  // 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)
3158  ProcessClusters(); // process calo clusters
3160 
3162 
3163  fHistoNGammaCandidates[iCut]->Fill(fClusterCandidates->GetEntries(), fWeightJetJetMC);
3165  if(fDoMesonAnalysis){ // Meson Analysis
3166 
3167  // CalculatePi0Candidates(); // Combine Gammas from conversion and from calo
3169  if(((AliConversionMesonCuts*)fMesonCutArray->At(iCut))->DoBGCalculation()){
3170  if(((AliConversionMesonCuts*)fMesonCutArray->At(iCut))->BackgroundHandlerType() == 0){
3171  //CalculateBackground(); // Combinatorial Background
3172  CalculateBackgroundIsolation(); // Combinatorial Background for Isolation Method
3173  UpdateEventByEventData(); // Store Event for mixed Events
3174  }
3175 
3176  }
3179  }
3180 
3181  if(fIsMC> 0){
3185  }
3186 
3187  fIsoCandidates->Clear();
3188  fClusterCandidates->Clear(); // delete cluster candidates
3189  }
3191 
3192  PostData(1, fOutputContainer);
3193 }
3194 
3195 //________________________________________________________________________
3197 {
3198  Int_t nclus = 0;
3199  TClonesArray * arrClustersProcess = NULL;
3201  if(!fCorrTaskSetting.CompareTo("")){
3202  nclus = fInputEvent->GetNumberOfCaloClusters();
3203  } else {
3204  arrClustersProcess = dynamic_cast<TClonesArray*>(fInputEvent->FindListObject(Form("%sClustersBranch",fCorrTaskSetting.Data())));
3205  if(!arrClustersProcess)
3206  AliFatal(Form("%sClustersBranch was not found in AliAnalysisTaskGammaCaloIso! Check the correction framework settings!",fCorrTaskSetting.Data()));
3207  nclus = arrClustersProcess->GetEntries();
3208  }
3209 
3210  if(nclus == 0) return;
3211  // plotting histograms on cell/tower level, only if extendedMatchAndQA > 1
3212  ((AliCaloPhotonCuts*)fClusterCutArray->At(fiCut))->FillHistogramsExtendedQA(fInputEvent,fIsMC);
3213 
3214  // match tracks to clusters
3215  ((AliCaloPhotonCuts*)fClusterCutArray->At(fiCut))->MatchTracksToClusters(fInputEvent,fWeightJetJetMC,kTRUE, fMCEvent);
3216 
3217  // vertex
3218  Double_t vertex[3] = {0};
3219  InputEvent()->GetPrimaryVertex()->GetXYZ(vertex);
3220 
3221  Int_t totalActiveCells = 0;
3222  Double_t totalCellsinClusters = 0;
3223  Double_t totalUnclusteredE = 0;
3224  if(((AliCaloPhotonCuts*)fClusterCutArray->At(fiCut))->GetDoFlatEnergySubtraction()){
3225  Double_t totalClusterEnergy = 0;
3226  totalActiveCells = ((AliCaloPhotonCuts*)fClusterCutArray->At(fiCut))->GetNactiveEmcalCells();
3227  totalCellsinClusters = 0;
3228  for(Long_t i = 0; i < nclus; i++){
3229  AliVCluster* clus = NULL;
3230  if(fInputEvent->IsA()==AliESDEvent::Class()){
3231  if(arrClustersProcess)
3232  clus = new AliESDCaloCluster(*(AliESDCaloCluster*)arrClustersProcess->At(i));
3233  else
3234  clus = new AliESDCaloCluster(*(AliESDCaloCluster*)fInputEvent->GetCaloCluster(i));
3235  } else if(fInputEvent->IsA()==AliAODEvent::Class()){
3236  if(arrClustersProcess)
3237  clus = new AliAODCaloCluster(*(AliAODCaloCluster*)arrClustersProcess->At(i));
3238  else
3239  clus = new AliAODCaloCluster(*(AliAODCaloCluster*)fInputEvent->GetCaloCluster(i));
3240  }
3241  if(!clus) continue;
3242  totalClusterEnergy += clus->E();
3243  totalCellsinClusters += clus->GetNCells();
3244  delete clus;
3245  }
3246  Double_t totalEDeposit = ((AliCaloPhotonCuts*)fClusterCutArray->At(fiCut))->GetTotalEnergyDeposit(fInputEvent);
3247  totalUnclusteredE = totalEDeposit - totalClusterEnergy;
3248  }
3249 
3250  Double_t maxClusterEnergy = -1;
3251  Int_t maxClusterID = -1;
3252  map<Long_t,Int_t> mapIsClusterAccepted;
3253  map<Long_t,Int_t> mapIsClusterAcceptedWithoutTrackMatch;
3254  // Loop over EMCal clusters
3255  for(Long_t i = 0; i < nclus; i++){
3256  Double_t tempClusterWeight = fWeightJetJetMC;
3257  Double_t tempPhotonWeight = fWeightJetJetMC;
3258  AliVCluster* clus = NULL;
3259  if(fInputEvent->IsA()==AliESDEvent::Class()){
3260  if(arrClustersProcess)
3261  clus = new AliESDCaloCluster(*(AliESDCaloCluster*)arrClustersProcess->At(i));
3262  else
3263  clus = new AliESDCaloCluster(*(AliESDCaloCluster*)fInputEvent->GetCaloCluster(i));
3264  } else if(fInputEvent->IsA()==AliAODEvent::Class()){
3265  if(arrClustersProcess)
3266  clus = new AliAODCaloCluster(*(AliAODCaloCluster*)arrClustersProcess->At(i));
3267  else
3268  clus = new AliAODCaloCluster(*(AliAODCaloCluster*)fInputEvent->GetCaloCluster(i));
3269  }
3270  if(!clus) continue;
3271 
3272  if(((AliCaloPhotonCuts*)fClusterCutArray->At(fiCut))->GetDoFlatEnergySubtraction()){
3273  if(totalUnclusteredE!=0 && totalActiveCells!=0 && totalCellsinClusters!=0){
3274  clus->SetE(clus->E()-(clus->GetNCells()*(totalUnclusteredE)/(totalActiveCells-totalCellsinClusters)));
3275  }
3276  }
3277 
3278  // Set the jetjet weight to 1 in case the cluster orignated from the minimum bias header
3279  if (fIsMC>0 && ((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetSignalRejection() == 4){
3280  if( ((AliConvEventCuts*)fEventCutArray->At(fiCut))->IsParticleFromBGEvent(clus->GetLabelAt(0), fMCEvent, fInputEvent) == 2)
3281  tempClusterWeight = 1;
3282  }
3283 
3284  if(!((AliCaloPhotonCuts*)fClusterCutArray->At(fiCut))->ClusterIsSelected(clus,fInputEvent,fMCEvent,fIsMC, tempClusterWeight,i)){
3285  if(fProduceTreeEOverP && ((AliCaloPhotonCuts*)fClusterCutArray->At(fiCut))->ClusterIsSelectedBeforeTrackMatch() ) mapIsClusterAcceptedWithoutTrackMatch[i] = 1;
3286  if (((AliCaloPhotonCuts*)fClusterCutArray->At(fiCut))->GetIsAcceptedForBasicCounting())fNCurrentClusterBasic++;
3287  delete clus;
3288  continue;
3289  }
3291 
3292  // TLorentzvector with cluster
3293  TLorentzVector clusterVector;
3294  clus->GetMomentum(clusterVector,vertex);
3295 
3296  TLorentzVector* tmpvec = new TLorentzVector();
3297  tmpvec->SetPxPyPzE(clusterVector.Px(),clusterVector.Py(),clusterVector.Pz(),clusterVector.E());
3298 
3299  // convert to AODConversionPhoton
3300  AliAODConversionPhoton *PhotonCandidate=new AliAODConversionPhoton(tmpvec);
3301  if(!PhotonCandidate){ delete clus; delete tmpvec; continue;}
3302 
3303  //determine maximum cluster energy in event
3304  if(fProduceCellIDPlots && (clus->E() > maxClusterEnergy)){
3305  maxClusterEnergy = clus->E();
3306  maxClusterID = (Int_t) i;
3307  }
3309  mapIsClusterAccepted[i] = 1;
3310  mapIsClusterAcceptedWithoutTrackMatch[i] = 1;
3311  }
3312 
3313  // Flag Photon as CaloPhoton
3314  PhotonCandidate->SetIsCaloPhoton();
3315  PhotonCandidate->SetCaloClusterRef(i);
3316  PhotonCandidate->SetLeadingCellID(((AliCaloPhotonCuts*)fClusterCutArray->At(fiCut))->FindLargestCellInCluster(clus,fInputEvent));
3317  // get MC label
3318  if(fIsMC> 0){
3319  Int_t* mclabelsCluster = clus->GetLabels();
3320  PhotonCandidate->SetNCaloPhotonMCLabels(clus->GetNLabels());
3321  // cout << clus->GetNLabels() << endl;
3322  if (clus->GetNLabels()>0){
3323  for (Int_t k =0; k< (Int_t)clus->GetNLabels(); k++){
3324  if (k< 50)PhotonCandidate->SetCaloPhotonMCLabel(k,mclabelsCluster[k]);
3325  // Int_t pdgCode = fMCEvent->Particle(mclabelsCluster[k])->GetPdgCode();
3326  // cout << "label " << k << "\t" << mclabelsCluster[k] << " pdg code: " << pdgCode << endl;
3327  }
3328  }
3329  }
3330 
3331  fIsFromDesiredHeader = kTRUE;
3333  // test whether largest contribution to cluster orginates in added signals
3334  if (fIsMC>0 && ((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetSignalRejection() > 0){
3335  // Set the jetjet weight to 1 in case the photon candidate orignated from the minimum bias header
3336  if ( ((AliConvEventCuts*)fEventCutArray->At(fiCut))->IsParticleFromBGEvent(PhotonCandidate->GetCaloPhotonMCLabel(0), fMCEvent, fInputEvent) == 2 && ((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetSignalRejection() == 4) tempPhotonWeight = 1;
3337  if ( ((AliConvEventCuts*)fEventCutArray->At(fiCut))->IsParticleFromBGEvent(PhotonCandidate->GetCaloPhotonMCLabel(0), fMCEvent, fInputEvent) == 0) fIsFromDesiredHeader = kFALSE;
3338  if (clus->GetNLabels()>1){
3339  Int_t* mclabelsCluster = clus->GetLabels();
3340  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;
3341  for (Int_t l = 1; l < (Int_t)clus->GetNLabels(); l++ ){
3342  if (((AliConvEventCuts*)fEventCutArray->At(fiCut))->IsParticleFromBGEvent(mclabelsCluster[l], fMCEvent, fInputEvent, fLocalDebugFlag) == 0) fIsOverlappingWithOtherHeader = kTRUE;
3343  }
3344  if (fLocalDebugFlag > 1 && fIsOverlappingWithOtherHeader) cout << "found overlapping header: " << endl;
3345  }
3346  }
3347 
3348  fHistoClusAllHeadersGammaPt[fiCut]->Fill(PhotonCandidate->Pt(), tempPhotonWeight);
3349  if (!fIsFromDesiredHeader) fHistoClusRejectedHeadersGammaPt[fiCut]->Fill(PhotonCandidate->Pt(), tempPhotonWeight);
3350  if (fIsFromDesiredHeader && fIsOverlappingWithOtherHeader) fHistoClusOverlapHeadersGammaPt[fiCut]->Fill(PhotonCandidate->Pt(), tempPhotonWeight);
3351 
3352 
3354  fHistoClusGammaPt[fiCut]->Fill(PhotonCandidate->Pt(), tempPhotonWeight);
3355  fHistoClusGammaE[fiCut]->Fill(PhotonCandidate->E(), tempPhotonWeight);
3356  if (!fDoLightOutput && fDoClusterQA > 0) fHistoClusGammaPtM02[fiCut]->Fill(PhotonCandidate->Pt(), clus->GetM02(), tempPhotonWeight);
3357  if(fIsMC> 0){
3358  if(fInputEvent->IsA()==AliESDEvent::Class()){
3359  ProcessTrueClusterCandidates(PhotonCandidate,clus);
3360  } else {
3361  ProcessTrueClusterCandidatesAOD(PhotonCandidate,clus);
3362  }
3363  }
3364 
3365  fClusterCandidates->Add(PhotonCandidate); // if no second loop is required add to events good gammas
3366 
3367  //################################################### Isolation Cut ###########################################################
3368  //if Cluster passes all standard conditions to be selected, then check if it is also isolated and save it in new TList
3369  //Isolationfunction added in AliCaloPhotonCuts
3370 
3371  if(!((AliCaloPhotonCuts*)fClusterCutArray->At(fiCut))->ClusterIsIsolated(i,PhotonCandidate)){//Isolation check
3372  fHistoFailIsolationCut[fiCut]->Fill(PhotonCandidate->Pt(), fWeightJetJetMC);//fill with clusters not passing isolation
3373  continue;
3374  }
3375 
3376  fIsoCandidates->Add(PhotonCandidate);
3377 
3378  fHistoClusterCandidates[fiCut]->Fill(PhotonCandidate->Pt(), fWeightJetJetMC);// fill with isolated clusters
3379  fHistoClusterCandidatesBinning[fiCut]->Fill(PhotonCandidate->Pt(), fWeightJetJetMC);// fill with isolated clusters
3380 
3381 
3382  if(fIsMC>0){
3383  if(fInputEvent->IsA()==AliAODEvent::Class()){
3384  ProcessTrueIsolatedClustersAOD(clus, PhotonCandidate);
3385  }
3386  }
3387 
3388  } else{
3389  delete PhotonCandidate;
3390  }
3391 
3392  delete clus;
3393  delete tmpvec;
3394  }
3395 
3396  if(fProduceCellIDPlots){
3397  for(Long_t i = 0; i < nclus; i++){
3398  if( mapIsClusterAccepted[i] != 1 ) continue;
3399 
3400  AliVCluster* clus = NULL;
3401  if(fInputEvent->IsA()==AliESDEvent::Class()){
3402  if(arrClustersProcess)
3403  clus = new AliESDCaloCluster(*(AliESDCaloCluster*)arrClustersProcess->At(i));
3404  else
3405  clus = new AliESDCaloCluster(*(AliESDCaloCluster*)fInputEvent->GetCaloCluster(i));
3406  } else if(fInputEvent->IsA()==AliAODEvent::Class()){
3407  if(arrClustersProcess)
3408  clus = new AliAODCaloCluster(*(AliAODCaloCluster*)arrClustersProcess->At(i));
3409  else
3410  clus = new AliAODCaloCluster(*(AliAODCaloCluster*)fInputEvent->GetCaloCluster(i));
3411  }
3412 
3413  if(!clus) continue;
3414 
3415  Int_t cellID = ((AliCaloPhotonCuts*)fClusterCutArray->At(fiCut))->FindLargestCellInCluster(clus,fInputEvent);
3416  fHistCellIDvsClusterEnergy[fiCut]->Fill(clus->E(),cellID);
3417  if (maxClusterID == i && maxClusterID > -1 ) fHistCellIDvsClusterEnergyMax[fiCut]->Fill(maxClusterEnergy,cellID);
3418  delete clus;
3419  }
3420  }
3421 
3422  if(fProduceTreeEOverP){
3423  AliESDEvent *esdev = dynamic_cast<AliESDEvent*>(fInputEvent);
3424  AliAODEvent *aodev = 0;
3425  Bool_t isESD = kTRUE;
3426  if (!esdev) {
3427  isESD = kFALSE;
3428  aodev = dynamic_cast<AliAODEvent*>(fInputEvent);
3429  if (!aodev) {
3430  AliError("Task needs AOD or ESD event...");
3431  }
3432  }
3433 
3434  AliESDtrackCuts *EsdTrackCuts = 0x0;
3435  if(esdev){
3436  // Using standard function for setting Cuts
3437  Int_t runNumber = fInputEvent->GetRunNumber();
3438  // if LHC11a or earlier or if LHC13g or if LHC12a-i -> use 2010 cuts
3439  if( (runNumber<=146860) || (runNumber>=197470 && runNumber<=197692) || (runNumber>=172440 && runNumber<=193766) ){
3440  EsdTrackCuts = AliESDtrackCuts::GetStandardITSTPCTrackCuts2010();
3441  // else if run2 data use 2015 PbPb cuts
3442  }else if (runNumber>=209122){
3443  EsdTrackCuts = AliESDtrackCuts::GetStandardITSTPCTrackCuts2015PbPb();
3444  // else use 2011 version of track cuts
3445  }else{
3446  EsdTrackCuts = AliESDtrackCuts::GetStandardITSTPCTrackCuts2011();
3447  }
3448  EsdTrackCuts->SetMaxDCAToVertexZ(2);
3449  EsdTrackCuts->SetEtaRange(-0.8, 0.8);
3450  EsdTrackCuts->SetPtRange(0.15);
3451  }
3452 
3453  for(Long_t i = 0; i < nclus; i++){
3454  if( mapIsClusterAcceptedWithoutTrackMatch[i] != 1 ) continue;
3455 
3456  AliVCluster* clus = NULL;
3457  if(fInputEvent->IsA()==AliESDEvent::Class()){
3458  if(arrClustersProcess)
3459  clus = new AliESDCaloCluster(*(AliESDCaloCluster*)arrClustersProcess->At(i));
3460  else
3461  clus = new AliESDCaloCluster(*(AliESDCaloCluster*)fInputEvent->GetCaloCluster(i));
3462  } else if(fInputEvent->IsA()==AliAODEvent::Class()){
3463  if(arrClustersProcess)
3464  clus = new AliAODCaloCluster(*(AliAODCaloCluster*)arrClustersProcess->At(i));
3465  else
3466  clus = new AliAODCaloCluster(*(AliAODCaloCluster*)fInputEvent->GetCaloCluster(i));
3467  }
3468 
3469  if(!clus) continue;
3470 
3471  fClusterE = clus->E();
3472  fClusterM02 = clus->GetM02();
3473  fClusterM20 = clus->GetM20();
3474  fClusterLeadCellID = ((AliCaloPhotonCuts*)fClusterCutArray->At(fiCut))->FindLargestCellInCluster(clus,fInputEvent);
3475 
3476  Int_t labelTrackMatch = -1;
3477  if(!((AliCaloPhotonCuts*)fClusterCutArray->At(fiCut))->GetHighestPtMatchedTrackToCluster(fInputEvent,clus,labelTrackMatch)){
3478  delete clus;
3479  continue;
3480  }
3481 
3482  AliVTrack* currTrack = dynamic_cast<AliVTrack*>(fInputEvent->GetTrack(labelTrackMatch));
3483  if(!currTrack){
3484  delete clus;
3485  continue;
3486  }
3487  if(esdev){
3488  AliESDtrack *esdt = dynamic_cast<AliESDtrack*>(currTrack);
3489  if(!EsdTrackCuts->AcceptTrack(esdt)){
3490  delete clus;
3491  continue;
3492  }
3493  if(esdt->Pt()<1.){
3494  delete clus;
3495  continue;
3496  }
3497  fClusterEP = fClusterE/esdt->P();
3498  fTrackPt = esdt->Pt();
3499  }else if(aodev){
3500  AliAODTrack *aodt = dynamic_cast<AliAODTrack*>(currTrack);
3501  if(!aodt->IsHybridGlobalConstrainedGlobal()){
3502  delete clus;
3503  continue;
3504  }
3505  if(TMath::Abs(aodt->Eta())>0.8){
3506  delete clus;
3507  continue;
3508  }
3509  if(aodt->Pt()<1.){
3510  delete clus;
3511  continue;
3512  }
3513  fClusterEP = fClusterE/aodt->P();
3514  fTrackPt = aodt->Pt();
3515  }
3516 
3517  AliPIDResponse* pidResponse = ((AliConversionPhotonCuts*)fV0Reader->GetConversionCuts())->GetPIDResponse();
3518  if(!pidResponse){
3519  delete clus;
3520  continue;
3521  }
3522 
3523  Float_t temp = TMath::Abs(pidResponse->NumberOfSigmasTPC(currTrack,AliPID::kElectron));
3524  if(temp<10.){
3525  fTrackPID_e = temp*10;
3526  }else fTrackPID_e = 99;
3527 
3528  temp = TMath::Abs(pidResponse->NumberOfSigmasTPC(currTrack,AliPID::kPion));
3529  if(temp<10.){
3530  fTrackPID_Pi = temp*10;
3531  }else fTrackPID_Pi = 99;
3532 
3533  temp = TMath::Abs(pidResponse->NumberOfSigmasTPC(currTrack,AliPID::kKaon));
3534  if(temp<10.){
3535  fTrackPID_K = temp*10;
3536  }else fTrackPID_K = 99;
3537 
3538  temp = TMath::Abs(pidResponse->NumberOfSigmasTPC(currTrack,AliPID::kProton));
3539  if(temp<10.){
3540  fTrackPID_P = temp*10;
3541  }else fTrackPID_P = 99;
3542 
3543  Float_t tempEta = -99999;
3544  Float_t tempPhi = -99999;
3545  ((AliCaloTrackMatcher*)((AliCaloPhotonCuts*)fClusterCutArray->At(fiCut))->GetCaloTrackMatcherInstance())->GetTrackClusterMatchingResidual(currTrack->GetID(),clus->GetID(),tempEta,tempPhi);
3546  fDeltaEta = tempEta;
3547  fDeltaPhi = tempPhi;
3548 
3549  //determine isolation in cluster Et
3550  Float_t clsPos[3] = {0.,0.,0.};
3551  Float_t secondClsPos[3] = {0.,0.,0.};
3552  TLorentzVector clusterVector;
3553 
3554  clus->GetPosition(clsPos);
3555  TVector3 clsPosVec(clsPos);
3556 
3557  Float_t sum_Et = 0;
3558  for(Int_t j=0; j<nclus; j++){
3559  if( i == j ) continue;
3560  if( mapIsClusterAcceptedWithoutTrackMatch[j] != 1 ) continue;
3561 
3562  AliVCluster* secondClus = NULL;
3563  if(fInputEvent->IsA()==AliESDEvent::Class()){
3564  if(arrClustersProcess)
3565  secondClus = new AliESDCaloCluster(*(AliESDCaloCluster*)arrClustersProcess->At(j));
3566  else
3567  secondClus = new AliESDCaloCluster(*(AliESDCaloCluster*)fInputEvent->GetCaloCluster(j));
3568  } else if(fInputEvent->IsA()==AliAODEvent::Class()){
3569  if(arrClustersProcess)
3570  secondClus = new AliAODCaloCluster(*(AliAODCaloCluster*)arrClustersProcess->At(j));
3571  else
3572  secondClus = new AliAODCaloCluster(*(AliAODCaloCluster*)fInputEvent->GetCaloCluster(j));
3573  }
3574 
3575  if(!secondClus) continue;
3576  secondClus->GetPosition(secondClsPos);
3577  TVector3 secondClsPosVec(secondClsPos);
3578 
3579  Float_t dPhi = clsPosVec.DeltaPhi(secondClsPosVec);
3580  Float_t dEta = clsPosVec.Eta()-secondClsPosVec.Eta();
3581  if(TMath::Sqrt(dEta*dEta + dPhi*dPhi) < 0.2){
3582  secondClus->GetMomentum(clusterVector,vertex);
3583  sum_Et += clusterVector.Et();
3584  }
3585  delete secondClus;
3586  }
3587  fClusterIsoSumClusterEt = sum_Et;
3588 
3589  //determine isolation in track Et
3590  fClusterIsoSumTrackEt = ((AliCaloTrackMatcher*)((AliCaloPhotonCuts*)fClusterCutArray->At(fiCut))->GetCaloTrackMatcherInstance())->SumTrackEtAroundCluster(fInputEvent,clus->GetID(),0.2);
3591  //remove Et from matched track
3592  TLorentzVector vecTrack;
3593  vecTrack.SetPxPyPzE(currTrack->Px(),currTrack->Py(),currTrack->Pz(),currTrack->E());
3594  fClusterIsoSumTrackEt -= vecTrack.Et();
3595 
3596  //get cluster classification
3597  if(fIsMC > 0) fClusterClassification = ((AliCaloPhotonCuts*)fClusterCutArray->At(fiCut))->ClassifyClusterForTMEffi(clus,fInputEvent,fMCEvent,isESD);
3598 
3599  tClusterEOverP[fiCut]->Fill();
3600  delete clus;
3601  }
3602  mapIsClusterAcceptedWithoutTrackMatch.clear();
3603  }
3604 
3605  if(fProduceCellIDPlots || fProduceTreeEOverP) mapIsClusterAccepted.clear();
3606 
3607  if(fLocalDebugFlag == 2) EventDebugMethod();
3608 
3609  return;
3610 }
3611 //________________________________________________________________________
3613 {
3615  if(fConvJetReader->GetNJets()>0){
3623  if(fIsMC > 0 && fConvJetReader->GetTrueNJets()>0){
3627  }
3629  for(Int_t i=0; i<fConvJetReader->GetNJets(); i++){
3630  fHistoPtJet[fiCut]->Fill(fVectorJetPt.at(i));
3631  fHistoJetEta[fiCut]->Fill(fVectorJetEta.at(i));
3632  fHistoJetPhi[fiCut]->Fill(fVectorJetPhi.at(i));
3633  fHistoJetArea[fiCut]->Fill(fVectorJetArea.at(i));
3634  if(fIsMC > 0 && fConvJetReader->GetNJets()>0 && fConvJetReader->GetTrueNJets()>0){
3635  Double_t min = 100;
3636  Int_t match = 0;
3637  for(Int_t j = 0; j<fConvJetReader->GetTrueNJets(); j++){
3638  Double_t R_jetjet;
3639  Double_t DeltaEta = fVectorJetEta.at(i)-fTrueVectorJetEta.at(j);
3640  Double_t DeltaPhi = abs(fVectorJetPhi.at(i)-fTrueVectorJetPhi.at(j));
3641  if(DeltaPhi > M_PI) {
3642  DeltaPhi = 2*M_PI - DeltaPhi;
3643  }
3644  R_jetjet = TMath::Sqrt(pow((DeltaEta),2)+pow((DeltaPhi),2));
3645  if(R_jetjet < min){
3646  min = R_jetjet;
3647  match = j;
3648  }
3649  }
3650  fHistoTruevsRecJetPt[fiCut]->Fill(fVectorJetPt.at(i), fTrueVectorJetPt.at(match));
3651  }
3652  }
3653  fHistoEventwJets[fiCut]->Fill(0);
3654  }
3655  fVectorJetPt.clear();
3656  fVectorJetPx.clear();
3657  fVectorJetPy.clear();
3658  fVectorJetPz.clear();
3659  fVectorJetEta.clear();
3660  fVectorJetPhi.clear();
3661  fVectorJetArea.clear();
3662  if(fIsMC > 0 && fConvJetReader->GetTrueNJets()>0){
3663  fTrueVectorJetPt.clear();
3664  fTrueVectorJetEta.clear();
3665  fTrueVectorJetPhi.clear();
3666  }
3667  }
3668 }
3669 
3670 //________________________________________________________________________
3672 {
3673  const AliVVertex* primVtxMC = fMCEvent->GetPrimaryVertex();
3674  Double_t mcProdVtxX = primVtxMC->GetX();
3675  Double_t mcProdVtxY = primVtxMC->GetY();
3676  Double_t mcProdVtxZ = primVtxMC->GetZ();
3677 
3678  Double_t tempPhotonWeight = fWeightJetJetMC;
3679  TParticle *Photon = NULL;
3680  if (!TruePhotonCandidate->GetIsCaloPhoton()) AliFatal("CaloPhotonFlag has not been set task will abort");
3681  if (!fDoLightOutput && fDoClusterQA > 0) fHistoTrueNLabelsInClus[fiCut]->Fill(TruePhotonCandidate->GetNCaloPhotonMCLabels(), tempPhotonWeight);
3682 
3683  if (TruePhotonCandidate->GetCaloPhotonMCLabel(0) < 0) return;
3684  if (TruePhotonCandidate->GetNCaloPhotonMCLabels() > 0) Photon = fMCEvent->Particle(TruePhotonCandidate->GetCaloPhotonMCLabel(0));
3685  else return;
3686 
3687  if(Photon == NULL){
3688  // cout << "no photon" << endl;
3689  return;
3690  }
3691  // Set the jetjet weight to 1 in case the photon orignated from the minimum bias header
3692  if (fIsMC>0 && ((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetSignalRejection() == 4){
3693  if ( ((AliConvEventCuts*)fEventCutArray->At(fiCut))->IsParticleFromBGEvent(TruePhotonCandidate->GetCaloPhotonMCLabel(0), fMCEvent, fInputEvent) == 2) tempPhotonWeight = 1;
3694  }
3695 
3696 
3697 
3698  Int_t pdgCodeParticle = Photon->GetPdgCode();
3699  TruePhotonCandidate->SetCaloPhotonMCFlags(fMCEvent, fEnableSortForClusMC);
3700 
3701  // True Photon
3702 
3703  if (TruePhotonCandidate->IsLargestComponentPhoton() || (TruePhotonCandidate->IsLargestComponentElectron() && TruePhotonCandidate->IsConversion())) {
3704  fHistoTrueClusGammaPt[fiCut]->Fill(TruePhotonCandidate->Pt(), tempPhotonWeight);
3705  if (!fDoLightOutput && fDoClusterQA > 0) fHistoTrueClusGammaPtM02[fiCut]->Fill(TruePhotonCandidate->Pt(), clus->GetM02(), tempPhotonWeight);
3706  } else if (fDoClusterQA > 0) fHistoTrueClusEMNonLeadingPt[fiCut]->Fill(TruePhotonCandidate->Pt());
3707  if (fDoClusterQA > 0){
3708  if (TruePhotonCandidate->IsLargestComponentPhoton()){
3709  fHistoTrueClusUnConvGammaPt[fiCut]->Fill(TruePhotonCandidate->Pt(), tempPhotonWeight);
3710  fHistoTrueClusUnConvGammaMCPt[fiCut]->Fill(Photon->Pt(), tempPhotonWeight);
3711  if (!fDoLightOutput) fHistoTrueClusUnConvGammaPtM02[fiCut]->Fill(TruePhotonCandidate->Pt(), clus->GetM02(), tempPhotonWeight);
3712  }
3713  if (TruePhotonCandidate->IsLargestComponentElectron())
3714  fHistoTrueClusElectronPt[fiCut]->Fill(TruePhotonCandidate->Pt(), tempPhotonWeight);
3715  if (TruePhotonCandidate->IsLargestComponentElectron() && TruePhotonCandidate->IsConversion()){
3716  fHistoTrueClusConvGammaPt[fiCut]->Fill(TruePhotonCandidate->Pt(), tempPhotonWeight);
3717  if(Photon->GetMother(0) > -1){
3718  TParticle* motherPart = (TParticle*)fMCEvent->Particle(Photon->GetMother(0));
3719  fHistoTrueClusConvGammaMCPt[fiCut]->Fill(motherPart->Pt(), tempPhotonWeight);
3720  }
3721  }
3722  if (TruePhotonCandidate->IsLargestComponentElectron() && TruePhotonCandidate->IsConversion() && TruePhotonCandidate->IsConversionFullyContained())
3723  fHistoTrueClusConvGammaFullyPt[fiCut]->Fill(TruePhotonCandidate->Pt(), tempPhotonWeight);
3724  if (TruePhotonCandidate->IsMerged() || TruePhotonCandidate->IsMergedPartConv() || TruePhotonCandidate->IsDalitzMerged())
3725  fHistoTrueClusMergedGammaPt[fiCut]->Fill(TruePhotonCandidate->Pt(), tempPhotonWeight);
3726  if (TruePhotonCandidate->IsMergedPartConv())
3727  fHistoTrueClusMergedPartConvGammaPt[fiCut]->Fill(TruePhotonCandidate->Pt(), tempPhotonWeight);
3728  if (TruePhotonCandidate->IsDalitz())
3729  fHistoTrueClusDalitzPt[fiCut]->Fill(TruePhotonCandidate->Pt(), tempPhotonWeight);
3730  if (TruePhotonCandidate->IsDalitzMerged())
3731  fHistoTrueClusDalitzMergedPt[fiCut]->Fill(TruePhotonCandidate->Pt(), tempPhotonWeight);
3732  if (TruePhotonCandidate->IsPhotonWithElecMother())
3733  fHistoTrueClusPhotonFromElecMotherPt[fiCut]->Fill(TruePhotonCandidate->Pt(), tempPhotonWeight);
3734  if (TruePhotonCandidate->IsShower())
3735  fHistoTrueClusShowerPt[fiCut]->Fill(TruePhotonCandidate->Pt(), tempPhotonWeight);
3736  if (TruePhotonCandidate->IsSubLeadingEM())
3737  fHistoTrueClusSubLeadingPt[fiCut]->Fill(TruePhotonCandidate->Pt(), tempPhotonWeight);
3738  fHistoTrueClusNParticles[fiCut]->Fill(TruePhotonCandidate->GetNCaloPhotonMCLabels(), tempPhotonWeight);
3739  if (!TruePhotonCandidate->IsLargestComponentPhoton()) {
3740  FillPhotonBackgroundHist(TruePhotonCandidate,pdgCodeParticle);
3741  if (!fDoLightOutput) FillPhotonBackgroundM02Hist(TruePhotonCandidate,clus,pdgCodeParticle);
3742  }
3743  if (!(TruePhotonCandidate->IsLargestComponentPhoton() || (TruePhotonCandidate->IsLargestComponentElectron() && TruePhotonCandidate->IsConversion())) ) {
3744  FillPhotonPlusConversionBackgroundHist(TruePhotonCandidate,pdgCodeParticle);
3745  if (!fDoLightOutput) FillPhotonPlusConversionBackgroundM02Hist(TruePhotonCandidate,clus,pdgCodeParticle);
3746  }
3747  Int_t motherLab = Photon->GetMother(0);
3748  if (motherLab > -1){
3749  if (TruePhotonCandidate->IsLargestComponentPhoton()){
3751  fHistoDoubleCountTrueClusterGammaPt[fiCut]->Fill(TruePhotonCandidate->Pt(),(Double_t)0,tempPhotonWeight);
3753  }
3754  }
3755  Int_t grandMotherLab = fMCEvent->Particle(motherLab)->GetMother(0);
3756  if (grandMotherLab > -1){
3757  if (TruePhotonCandidate->IsLargestComponentElectron() && TruePhotonCandidate->IsConversion()){
3759  fHistoDoubleCountTrueClusterGammaPt[fiCut]->Fill(TruePhotonCandidate->Pt(),(Double_t)1,tempPhotonWeight);
3761  }
3762  }
3763  }
3764  }
3765  }
3766 
3767  if(!fDoLightOutput){
3768  Bool_t isPrimary = ((AliConvEventCuts*)fEventCutArray->At(fiCut))->IsConversionPrimaryESD( fMCEvent, TruePhotonCandidate->GetCaloPhotonMCLabel(0), mcProdVtxX, mcProdVtxY, mcProdVtxZ);
3769  if (TruePhotonCandidate->IsLargestComponentElectron() && TruePhotonCandidate->IsConversion())
3770  isPrimary = ((AliConvEventCuts*)fEventCutArray->At(fiCut))->IsConversionPrimaryESD( fMCEvent, Photon->GetMother(0), mcProdVtxX, mcProdVtxY, mcProdVtxZ);
3771 
3772  if(isPrimary){
3773  // filling primary histograms
3774  if (TruePhotonCandidate->IsLargestComponentPhoton()){
3775  fHistoTruePrimaryClusGammaPt[fiCut]->Fill(TruePhotonCandidate->Pt(), tempPhotonWeight);
3776  fHistoTruePrimaryClusGammaESDPtMCPt[fiCut]->Fill(TruePhotonCandidate->Pt(),Photon->Pt(), tempPhotonWeight); // Allways Filled
3777  }
3778  if (TruePhotonCandidate->IsLargestComponentElectron() && TruePhotonCandidate->IsConversion()){
3779  fHistoTruePrimaryClusConvGammaPt[fiCut]->Fill(TruePhotonCandidate->Pt(), tempPhotonWeight);
3780  fHistoTruePrimaryClusConvGammaESDPtMCPt[fiCut]->Fill(TruePhotonCandidate->Pt(),Photon->Pt(), tempPhotonWeight); // Allways Filled
3781  }
3782 
3783  } else {
3784  // filling secondary histograms
3785  Int_t secondaryClass = -1;
3786  if (TruePhotonCandidate->IsLargestComponentElectron() && TruePhotonCandidate->IsConversion())
3787  secondaryClass = ((AliConvEventCuts*)fEventCutArray->At(fiCut))->SecondaryClassificationPhoton( Photon, fMCEvent, kTRUE);
3788  else
3789  secondaryClass = ((AliConvEventCuts*)fEventCutArray->At(fiCut))->SecondaryClassificationPhoton( Photon, fMCEvent, kFALSE);
3790 
3791  // all secondaries
3792  if (TruePhotonCandidate->IsLargestComponentPhoton()){
3793  if (secondaryClass == 2) {
3794  fHistoTrueSecondaryClusGammaPt[fiCut]->Fill(TruePhotonCandidate->Pt(),0.,tempPhotonWeight);
3795  fHistoTrueSecondaryClusGammaMCPt[fiCut]->Fill(Photon->Pt(),0.,tempPhotonWeight);
3796  fHistoTrueSecondaryClusGammaFromXFromK0sMCPtESDPt[fiCut]->Fill(Photon->Pt(),TruePhotonCandidate->Pt(),tempPhotonWeight);
3797  } else if (secondaryClass == 5) {
3798  fHistoTrueSecondaryClusGammaPt[fiCut]->Fill(TruePhotonCandidate->Pt(),1.,tempPhotonWeight);
3799  fHistoTrueSecondaryClusGammaMCPt[fiCut]->Fill(Photon->Pt(),1.,tempPhotonWeight);
3800  fHistoTrueSecondaryClusGammaFromXFromK0lMCPtESDPt[fiCut]->Fill(Photon->Pt(),TruePhotonCandidate->Pt(),tempPhotonWeight);
3801  } else if (secondaryClass == 3) {
3802  fHistoTrueSecondaryClusGammaPt[fiCut]->Fill(TruePhotonCandidate->Pt(),2.,tempPhotonWeight);
3803  fHistoTrueSecondaryClusGammaMCPt[fiCut]->Fill(Photon->Pt(),2.,tempPhotonWeight);
3804  fHistoTrueSecondaryClusGammaFromXFromLambdaMCPtESDPt[fiCut]->Fill(Photon->Pt(),TruePhotonCandidate->Pt(),tempPhotonWeight);
3805  } else if (secondaryClass == 4) {
3806  fHistoTrueSecondaryClusGammaPt[fiCut]->Fill(TruePhotonCandidate->Pt(),3.,tempPhotonWeight);
3807  fHistoTrueSecondaryClusGammaMCPt[fiCut]->Fill(Photon->Pt(),3.,tempPhotonWeight);
3808  } else {
3809  fHistoTrueSecondaryClusGammaPt[fiCut]->Fill(TruePhotonCandidate->Pt(),4.,tempPhotonWeight);
3810  fHistoTrueSecondaryClusGammaMCPt[fiCut]->Fill(Photon->Pt(),4.,tempPhotonWeight);
3811  }
3812  }
3813  if (TruePhotonCandidate->IsLargestComponentElectron() && TruePhotonCandidate->IsConversion()){
3814  if (secondaryClass == 2) {
3815  fHistoTrueSecondaryClusConvGammaPt[fiCut]->Fill(TruePhotonCandidate->Pt(),0.,tempPhotonWeight);
3816  fHistoTrueSecondaryClusConvGammaMCPt[fiCut]->Fill(Photon->Pt(),0.,tempPhotonWeight);
3817  fHistoTrueSecondaryClusConvGammaFromXFromK0sMCPtESDPt[fiCut]->Fill(Photon->Pt(),TruePhotonCandidate->Pt(),tempPhotonWeight);
3818  } else if (secondaryClass == 5) {
3819  fHistoTrueSecondaryClusConvGammaPt[fiCut]->Fill(TruePhotonCandidate->Pt(),1.,tempPhotonWeight);
3820  fHistoTrueSecondaryClusConvGammaMCPt[fiCut]->Fill(Photon->Pt(),1.,tempPhotonWeight);
3821  fHistoTrueSecondaryClusConvGammaFromXFromK0lMCPtESDPt[fiCut]->Fill(Photon->Pt(),TruePhotonCandidate->Pt(),tempPhotonWeight);
3822  } else if (secondaryClass == 3) {
3823  fHistoTrueSecondaryClusConvGammaPt[fiCut]->Fill(TruePhotonCandidate->Pt(),2.,tempPhotonWeight);
3824  fHistoTrueSecondaryClusConvGammaMCPt[fiCut]->Fill(Photon->Pt(),2.,tempPhotonWeight);
3825  fHistoTrueSecondaryClusConvGammaFromXFromLambdaMCPtESDPt[fiCut]->Fill(Photon->Pt(),TruePhotonCandidate->Pt(),tempPhotonWeight);
3826  } else if (secondaryClass == 4) {
3827  fHistoTrueSecondaryClusConvGammaPt[fiCut]->Fill(TruePhotonCandidate->Pt(),3.,tempPhotonWeight);
3828  fHistoTrueSecondaryClusConvGammaMCPt[fiCut]->Fill(Photon->Pt(),3.,tempPhotonWeight);
3829  } else {
3830  fHistoTrueSecondaryClusConvGammaPt[fiCut]->Fill(TruePhotonCandidate->Pt(),4.,tempPhotonWeight);
3831  fHistoTrueSecondaryClusConvGammaMCPt[fiCut]->Fill(Photon->Pt(),4.,tempPhotonWeight);
3832  }
3833  }
3834  }
3835  }
3836  return;
3837 }
3838 
3839 
3840 //________________________________________________________________________
3842 {
3843  const AliVVertex* primVtxMC = fMCEvent->GetPrimaryVertex();
3844  Double_t mcProdVtxX = primVtxMC->GetX();
3845  Double_t mcProdVtxY = primVtxMC->GetY();
3846  Double_t mcProdVtxZ = primVtxMC->GetZ();
3847 
3848  Double_t tempPhotonWeight = fWeightJetJetMC;
3849  AliAODMCParticle *Photon = NULL;
3850  TClonesArray *AODMCTrackArray = dynamic_cast<TClonesArray*>(fInputEvent->FindListObject(AliAODMCParticle::StdBranchName()));
3851  if (!fDoLightOutput && fDoClusterQA > 0) fHistoTrueNLabelsInClus[fiCut]->Fill(TruePhotonCandidate->GetNCaloPhotonMCLabels(), tempPhotonWeight);
3852  if (AODMCTrackArray){
3853  if (!TruePhotonCandidate->GetIsCaloPhoton()) AliFatal("CaloPhotonFlag has not been set task will abort");
3854  if (TruePhotonCandidate->GetNCaloPhotonMCLabels()>0) Photon = (AliAODMCParticle*) AODMCTrackArray->At(TruePhotonCandidate->GetCaloPhotonMCLabel(0));
3855  else return;
3856  } else {
3857  AliInfo("AODMCTrackArray could not be loaded");
3858  return;
3859  }
3860 
3861  if(Photon == NULL){
3862  // cout << "no photon" << endl;
3863  return;
3864  }
3865  Int_t pdgCodeParticle = Photon->GetPdgCode();
3867 
3868  // Set the jetjet weight to 1 in case the cluster orignated from the minimum bias header
3869  if (fIsMC>0 && ((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetSignalRejection() == 4){
3870  if ( ((AliConvEventCuts*)fEventCutArray->At(fiCut))->IsParticleFromBGEvent(TruePhotonCandidate->GetCaloPhotonMCLabel(0), fMCEvent, fInputEvent) == 2) tempPhotonWeight = 1;
3871  }
3872 
3873  // True Photon
3874  if (TruePhotonCandidate->IsLargestComponentPhoton() || (TruePhotonCandidate->IsLargestComponentElectron() && TruePhotonCandidate->IsConversion())) {
3875  fHistoTrueClusGammaPt[fiCut]->Fill(TruePhotonCandidate->Pt(), tempPhotonWeight);
3876  if (!fDoLightOutput && fDoClusterQA > 0) fHistoTrueClusGammaPtM02[fiCut]->Fill(TruePhotonCandidate->Pt(), clus->GetM02(), tempPhotonWeight);
3877  } else if (fDoClusterQA > 0) fHistoTrueClusEMNonLeadingPt[fiCut]->Fill(TruePhotonCandidate->Pt());
3878  if (fDoClusterQA > 0){
3879  if (TruePhotonCandidate->IsLargestComponentPhoton()) {
3880  fHistoTrueClusUnConvGammaPt[fiCut]->Fill(TruePhotonCandidate->Pt(), tempPhotonWeight);
3881  fHistoTrueClusUnConvGammaMCPt[fiCut]->Fill(Photon->Pt(), tempPhotonWeight);
3882  if (!fDoLightOutput) fHistoTrueClusUnConvGammaPtM02[fiCut]->Fill(TruePhotonCandidate->Pt(), clus->GetM02(), tempPhotonWeight);
3883  }
3884  if (TruePhotonCandidate->IsLargestComponentElectron())
3885  fHistoTrueClusElectronPt[fiCut]->Fill(TruePhotonCandidate->Pt(), tempPhotonWeight);
3886  if (TruePhotonCandidate->IsLargestComponentElectron() && TruePhotonCandidate->IsConversion()) {
3887  fHistoTrueClusConvGammaPt[fiCut]->Fill(TruePhotonCandidate->Pt(), tempPhotonWeight);
3888  AliAODMCParticle *motherPart = (AliAODMCParticle*) AODMCTrackArray->At(Photon->GetMother());
3889  fHistoTrueClusConvGammaMCPt[fiCut]->Fill(motherPart->Pt(), tempPhotonWeight);
3890  }
3891  if (TruePhotonCandidate->IsLargestComponentElectron() && TruePhotonCandidate->IsConversion() && TruePhotonCandidate->IsConversionFullyContained())
3892  fHistoTrueClusConvGammaFullyPt[fiCut]->Fill(TruePhotonCandidate->Pt(), tempPhotonWeight);
3893  if (TruePhotonCandidate->IsMerged() || TruePhotonCandidate->IsMergedPartConv() || TruePhotonCandidate->IsDalitzMerged())
3894  fHistoTrueClusMergedGammaPt[fiCut]->Fill(TruePhotonCandidate->Pt(), tempPhotonWeight);
3895  if (TruePhotonCandidate->IsMergedPartConv())
3896  fHistoTrueClusMergedPartConvGammaPt[fiCut]->Fill(TruePhotonCandidate->Pt(), tempPhotonWeight);
3897  if (TruePhotonCandidate->IsDalitz())
3898  fHistoTrueClusDalitzPt[fiCut]->Fill(TruePhotonCandidate->Pt(), tempPhotonWeight);
3899  if (TruePhotonCandidate->IsDalitzMerged())
3900  fHistoTrueClusDalitzMergedPt[fiCut]->Fill(TruePhotonCandidate->Pt(), tempPhotonWeight);
3901  if (TruePhotonCandidate->IsPhotonWithElecMother())
3902  fHistoTrueClusPhotonFromElecMotherPt[fiCut]->Fill(TruePhotonCandidate->Pt(), tempPhotonWeight);
3903  if (TruePhotonCandidate->IsShower())
3904  fHistoTrueClusShowerPt[fiCut]->Fill(TruePhotonCandidate->Pt(), tempPhotonWeight);
3905  if (TruePhotonCandidate->IsSubLeadingEM())
3906  fHistoTrueClusSubLeadingPt[fiCut]->Fill(TruePhotonCandidate->Pt(), tempPhotonWeight);
3907  fHistoTrueClusNParticles[fiCut]->Fill(TruePhotonCandidate->GetNCaloPhotonMCLabels(), tempPhotonWeight);
3908 
3909  if (!TruePhotonCandidate->IsLargestComponentPhoton()) {
3910  FillPhotonBackgroundHist(TruePhotonCandidate,pdgCodeParticle);
3911  if (!fDoLightOutput) FillPhotonBackgroundM02Hist(TruePhotonCandidate,clus,pdgCodeParticle);
3912  }
3913  if (!(TruePhotonCandidate->IsLargestComponentPhoton() || (TruePhotonCandidate->IsLargestComponentElectron() && TruePhotonCandidate->IsConversion())) ) {
3914  FillPhotonPlusConversionBackgroundHist(TruePhotonCandidate,pdgCodeParticle);
3915  if (!fDoLightOutput) FillPhotonPlusConversionBackgroundM02Hist(TruePhotonCandidate,clus,pdgCodeParticle);
3916  }
3917  Int_t motherLab = Photon->GetMother();
3918  if (motherLab > -1){
3919  if (TruePhotonCandidate->IsLargestComponentPhoton()){
3921  fHistoDoubleCountTrueClusterGammaPt[fiCut]->Fill(TruePhotonCandidate->Pt(),(Double_t)0,tempPhotonWeight);
3923  }
3924  }
3925  Int_t grandMotherLab = ((AliAODMCParticle*) AODMCTrackArray->At(motherLab))->GetMother();
3926  if (grandMotherLab > -1){
3927  if (TruePhotonCandidate->IsLargestComponentElectron() && TruePhotonCandidate->IsConversion()){
3929  fHistoDoubleCountTrueClusterGammaPt[fiCut]->Fill(TruePhotonCandidate->Pt(),(Double_t)1,tempPhotonWeight);
3931  }
3932  }
3933  }
3934  }
3935  }
3936 
3937  if(!fDoLightOutput){
3938  Bool_t isPrimary = ((AliConvEventCuts*)fEventCutArray->At(fiCut))->IsConversionPrimaryAOD(fInputEvent, Photon, mcProdVtxX, mcProdVtxY, mcProdVtxZ);
3939  if (TruePhotonCandidate->IsLargestComponentElectron() && TruePhotonCandidate->IsConversion()){
3940  if (Photon->GetMother()> -1){
3941  AliAODMCParticle *Mother = (AliAODMCParticle*) AODMCTrackArray->At(Photon->GetMother());
3942  isPrimary = ((AliConvEventCuts*)fEventCutArray->At(fiCut))->IsConversionPrimaryAOD(fInputEvent, Mother, mcProdVtxX, mcProdVtxY, mcProdVtxZ);
3943  }
3944  }
3945  if(isPrimary){
3946  if (TruePhotonCandidate->IsLargestComponentPhoton()){
3947  fHistoTruePrimaryClusGammaPt[fiCut]->Fill(TruePhotonCandidate->Pt(), tempPhotonWeight);
3948  fHistoTruePrimaryClusGammaESDPtMCPt[fiCut]->Fill(TruePhotonCandidate->Pt(),Photon->Pt(), tempPhotonWeight); // Allways Filled
3949  }
3950  if (TruePhotonCandidate->IsLargestComponentElectron() && TruePhotonCandidate->IsConversion()){
3951  fHistoTruePrimaryClusConvGammaPt[fiCut]->Fill(TruePhotonCandidate->Pt(), tempPhotonWeight);
3952  fHistoTruePrimaryClusConvGammaESDPtMCPt[fiCut]->Fill(TruePhotonCandidate->Pt(),Photon->Pt(), tempPhotonWeight); // Allways Filled
3953  }
3954 
3955  } else {
3956  // filling secondary histograms
3957  Int_t secondaryClass = -1;
3958  if (TruePhotonCandidate->IsLargestComponentElectron() && TruePhotonCandidate->IsConversion())
3959  secondaryClass = ((AliConvEventCuts*)fEventCutArray->At(fiCut))->SecondaryClassificationPhotonAOD( Photon, AODMCTrackArray, kTRUE);
3960  else
3961  secondaryClass = ((AliConvEventCuts*)fEventCutArray->At(fiCut))->SecondaryClassificationPhotonAOD( Photon, AODMCTrackArray, kFALSE);
3962 
3963  // all secondaries
3964  if (TruePhotonCandidate->IsLargestComponentPhoton()){
3965  if (secondaryClass == 2) {
3966  fHistoTrueSecondaryClusGammaPt[fiCut]->Fill(TruePhotonCandidate->Pt(),0.,tempPhotonWeight);
3967  fHistoTrueSecondaryClusGammaMCPt[fiCut]->Fill(Photon->Pt(),0.,tempPhotonWeight);
3968  fHistoTrueSecondaryClusGammaFromXFromK0sMCPtESDPt[fiCut]->Fill(Photon->Pt(),TruePhotonCandidate->Pt(),tempPhotonWeight);
3969  } else if (secondaryClass == 5) {
3970  fHistoTrueSecondaryClusGammaPt[fiCut]->Fill(TruePhotonCandidate->Pt(),1.,tempPhotonWeight);
3971  fHistoTrueSecondaryClusGammaMCPt[fiCut]->Fill(Photon->Pt(),1.,tempPhotonWeight);
3972  fHistoTrueSecondaryClusGammaFromXFromK0lMCPtESDPt[fiCut]->Fill(Photon->Pt(),TruePhotonCandidate->Pt(),tempPhotonWeight);
3973  } else if (secondaryClass == 3) {
3974  fHistoTrueSecondaryClusGammaPt[fiCut]->Fill(TruePhotonCandidate->Pt(),2.,tempPhotonWeight);
3975  fHistoTrueSecondaryClusGammaMCPt[fiCut]->Fill(Photon->Pt(),2.,tempPhotonWeight);
3976  fHistoTrueSecondaryClusGammaFromXFromLambdaMCPtESDPt[fiCut]->Fill(Photon->Pt(),TruePhotonCandidate->Pt(),tempPhotonWeight);
3977  } else if (secondaryClass == 4) {
3978  fHistoTrueSecondaryClusGammaPt[fiCut]->Fill(TruePhotonCandidate->Pt(),3.,tempPhotonWeight);
3979  fHistoTrueSecondaryClusGammaMCPt[fiCut]->Fill(Photon->Pt(),3.,tempPhotonWeight);
3980  } else {
3981  fHistoTrueSecondaryClusGammaPt[fiCut]->Fill(TruePhotonCandidate->Pt(),4.,tempPhotonWeight);
3982  fHistoTrueSecondaryClusGammaMCPt[fiCut]->Fill(Photon->Pt(),4.,tempPhotonWeight);
3983  }
3984  }
3985  if (TruePhotonCandidate->IsLargestComponentElectron() && TruePhotonCandidate->IsConversion()){
3986  if (secondaryClass == 2) {
3987  fHistoTrueSecondaryClusConvGammaPt[fiCut]->Fill(TruePhotonCandidate->Pt(),0.,tempPhotonWeight);
3988  fHistoTrueSecondaryClusConvGammaMCPt[fiCut]->Fill(Photon->Pt(),0.,tempPhotonWeight);
3989  fHistoTrueSecondaryClusConvGammaFromXFromK0sMCPtESDPt[fiCut]->Fill(Photon->Pt(),TruePhotonCandidate->Pt(),tempPhotonWeight);
3990  } else if (secondaryClass == 5) {
3991  fHistoTrueSecondaryClusConvGammaPt[fiCut]->Fill(TruePhotonCandidate->Pt(),1.,tempPhotonWeight);
3992  fHistoTrueSecondaryClusConvGammaMCPt[fiCut]->Fill(Photon->Pt(),1.,tempPhotonWeight);
3993  fHistoTrueSecondaryClusConvGammaFromXFromK0lMCPtESDPt[fiCut]->Fill(Photon->Pt(),TruePhotonCandidate->Pt(),tempPhotonWeight);
3994  } else if (secondaryClass == 3) {
3995  fHistoTrueSecondaryClusConvGammaPt[fiCut]->Fill(TruePhotonCandidate->Pt(),2.,tempPhotonWeight);
3996  fHistoTrueSecondaryClusConvGammaMCPt[fiCut]->Fill(Photon->Pt(),2.,tempPhotonWeight);
3997  fHistoTrueSecondaryClusConvGammaFromXFromLambdaMCPtESDPt[fiCut]->Fill(Photon->Pt(),TruePhotonCandidate->Pt(),tempPhotonWeight);
3998  } else if (secondaryClass == 4) {
3999  fHistoTrueSecondaryClusConvGammaPt[fiCut]->Fill(TruePhotonCandidate->Pt(),3.,tempPhotonWeight);
4000  fHistoTrueSecondaryClusConvGammaMCPt[fiCut]->Fill(Photon->Pt(),3.,tempPhotonWeight);
4001  } else {
4002  fHistoTrueSecondaryClusConvGammaPt[fiCut]->Fill(TruePhotonCandidate->Pt(),4.,tempPhotonWeight);
4003  fHistoTrueSecondaryClusConvGammaMCPt[fiCut]->Fill(Photon->Pt(),4.,tempPhotonWeight);
4004  }
4005  }
4006  }
4007  }
4008 
4009 }
4010 
4011 //________________________________________________________________________
4013 {
4014  const AliVVertex* primVtxMC = fMCEvent->GetPrimaryVertex();
4015  Double_t mcProdVtxX = primVtxMC->GetX();
4016  Double_t mcProdVtxY = primVtxMC->GetY();
4017  Double_t mcProdVtxZ = primVtxMC->GetZ();
4018 
4019 
4020  TClonesArray *AODMCTrackArray = dynamic_cast<TClonesArray*>(fInputEvent->FindListObject(AliAODMCParticle::StdBranchName()));
4021  if (AODMCTrackArray == NULL) return;
4022 
4023  // Loop over all primary MC particle
4024  for(Long_t i = 0; i < AODMCTrackArray->GetEntriesFast(); i++) {
4025  Double_t tempParticleWeight = fWeightJetJetMC;
4026 
4027  AliAODMCParticle* particle = static_cast<AliAODMCParticle*>(AODMCTrackArray->At(i));
4028  if (!particle) continue;
4029 
4030  Bool_t isPrimary = ((AliConvEventCuts*)fEventCutArray->At(fiCut))->IsConversionPrimaryAOD(fInputEvent, particle, mcProdVtxX, mcProdVtxY, mcProdVtxZ);
4031  if (isPrimary){
4032 
4033  Int_t isMCFromMBHeader = -1;
4034  if(((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetSignalRejection() != 0){
4035  isMCFromMBHeader = ((AliConvEventCuts*)fEventCutArray->At(fiCut))->IsParticleFromBGEvent(i, fMCEvent, fInputEvent);
4036  if(isMCFromMBHeader == 0 && ((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetSignalRejection() != 3) continue;
4037  // Set the jetjet weight to 1 in case the particle orignated from the minimum bias header
4038  if(isMCFromMBHeader == 2 && ((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetSignalRejection() == 4) tempParticleWeight = 1;
4039  }
4040 
4041  if(!fDoLightOutput){
4042  if(((AliCaloPhotonCuts*)fClusterCutArray->At(fiCut))->ClusterIsSelectedAODMC(particle,AODMCTrackArray)){