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