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