AliPhysics  c2ade29 (c2ade29)
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  fHistoPtJet(NULL),
299  fHistoJetEta(NULL),
300  fHistoJetPhi(NULL),
301  fHistoJetArea(NULL),
302  fHistoNJets(NULL),
303  fHistoEventwJets(NULL),
304  fHistoJetPi0PtRatio(NULL),
305  fHistoDoubleCounting(NULL),
306  fHistoJetMotherInvMassPt(NULL),
307  fHistoPi0InJetMotherInvMassPt(NULL),
308  fHistoMotherBackJetInvMassPt(NULL),
309  fHistoRJetPi0Cand(NULL),
310  fHistoEtaPhiJetPi0Cand(NULL),
311  fHistoEtaPhiJetWithPi0Cand(NULL),
312  fHistoJetFragmFunc(NULL),
313  fHistoJetFragmFuncChargPart(NULL),
314  fHistoTruevsRecJetPt(NULL),
315  fHistoTruePi0JetMotherInvMassPt(NULL),
316  fHistoTruePi0InJetMotherInvMassPt(NULL),
317  fHistoTruePrimaryPi0JetInvMassPt(NULL),
318  fHistoTruePrimaryPi0inJetInvMassPt(NULL),
319  fHistoTruePrimaryPi0InJetInvMassTruePt(NULL),
320  fHistoTrueDoubleCountingPi0Jet(NULL),
321  fHistoTrueEtaJetMotherInvMassPt(NULL),
322  fHistoTrueEtaInJetMotherInvMassPt(NULL),
323  fHistoTruePrimaryEtaJetInvMassPt(NULL),
324  fHistoTruePrimaryEtainJetInvMassPt(NULL),
325  fHistoTrueDoubleCountingEtaJet(NULL),
326  fHistoTruePi0JetFragmFunc(NULL),
327  fHistoTrueEtaJetFragmFunc(NULL),
328  fHistoTruePi0JetFragmFuncChargPart(NULL),
329  fHistoTrueEtaJetFragmFuncChargPart(NULL),
330  fHistoMCPi0JetInAccPt(NULL),
331  fHistoMCPi0inJetInAccPt(NULL),
332  fHistoMCEtaJetInAccPt(NULL),
333  fHistoMCEtainJetInAccPt(NULL),
334  fHistoMCPi0JetEventGenerated(NULL),
335  fHistoMCPi0inJetGenerated(NULL),
336  fHistoMCEtaJetEventGenerated(NULL),
337  fHistoMCEtainJetGenerated(NULL),
338  fHistoTrueSecondaryPi0FromK0sJetInvMassPt(NULL),
339  fHistoTrueSecondaryPi0FromK0sinJetInvMassPt(NULL),
340  fHistoTrueSecondaryPi0FromLambdaJetInvMassPt(NULL),
341  fHistoTrueSecondaryPi0FromLambdainJetInvMassPt(NULL),
342  fHistoTrueSecondaryPi0FromK0lJetInvMassPt(NULL),
343  fHistoTrueSecondaryPi0FromK0linJetInvMassPt(NULL),
344  fHistoTrueSecondaryPi0InvJetMassPt(NULL),
345  fHistoTrueSecondaryPi0InvinJetMassPt(NULL),
346  fHistoMotherPi0inJetPtY(NULL),
347  fHistoMotherEtainJetPtY(NULL),
348  fHistoMotherPi0inJetPtPhi(NULL),
349  fHistoMotherEtainJetPtPhi(NULL),
350  fNumberOfClusters(NULL),
351  fNumberOfClustersinJets(NULL),
352  fEnergyRatio(NULL),
353  fEnergyRatioinJets(NULL),
354  fEnergyRatioGamma1(NULL),
355  fEnergyRatioGamma1inJets(NULL),
356  fEnergyRatioGammaAnywhere(NULL),
357  fEnergyRatioGammaAnywhereinJets(NULL),
358  fEnergyDeposit(NULL),
359  fEnergyDepositinJets(NULL),
360  fEnergyDepGamma1(NULL),
361  fEnergyDepGamma1inJets(NULL),
362  fEnergyDepGammaAnywhere(NULL),
363  fEnergyDepGammaAnywhereinJets(NULL),
364  fEnergyRatioGamma1Helped(NULL),
365  fEnergyRatioGamma1HelpedinJets(NULL),
366  fClusterEtaPhiJets(NULL),
367  fVectorJetPt(0),
368  fVectorJetPx(0),
369  fVectorJetPy(0),
370  fVectorJetPz(0),
371  fVectorJetEta(0),
372  fVectorJetPhi(0),
373  fVectorJetArea(0),
374  fVectorJetNChargPart(0),
375  fTrueVectorJetPt(0),
376  fTrueVectorJetPx(0),
377  fTrueVectorJetPy(0),
378  fTrueVectorJetPz(0),
379  fTrueVectorJetEta(0),
380  fTrueVectorJetPhi(0),
381  fTrueVectorJetNChargPart(0),
382  tTrueInvMassROpenABPtFlag(NULL),
383  fInvMass(-1),
384  fRconv(-1),
385  fOpenRPrim(-1),
386  fInvMassRTOF(-1),
387  fPt(-1),
388  iFlag(3),
389  tSigInvMassPtAlphaTheta(NULL),
390  tBckInvMassPtAlphaTheta(NULL),
391  fInvMassTreeInvMass(0),
392  fInvMassTreePt(0),
393  fInvMassTreeAlpha(0),
394  fInvMassTreeTheta(0),
395  fInvMassTreeMixPool(0),
396  fInvMassTreeZVertex(0),
397  fInvMassTreeEta(0),
398  tClusterEOverP(NULL),
399  fClusterE(0),
400  fClusterM02(0),
401  fClusterM20(0),
402  fClusterEP(0),
403  fClusterLeadCellID(0),
404  fClusterClassification(0),
405  fDeltaEta(0),
406  fDeltaPhi(0),
407  fTrackPt(0),
408  fTrackPID_e(0),
409  fTrackPID_Pi(0),
410  fTrackPID_K(0),
411  fTrackPID_P(0),
412  fClusterIsoSumClusterEt(0),
413  fClusterIsoSumTrackEt(0),
414 // fHistoTruePi0NonLinearity(NULL),
415 // fHistoTrueEtaNonLinearity(NULL),
416  tTreeJetPi0Correlations(NULL),
417  fJetPt(0),
418  fTrueJetPt(0),
419  fPi0Pt(0),
420  fPi0InvMass(0),
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  fHistoPtJet(NULL),
691  fHistoJetEta(NULL),
692  fHistoJetPhi(NULL),
693  fHistoJetArea(NULL),
694  fHistoNJets(NULL),
695  fHistoEventwJets(NULL),
696  fHistoJetPi0PtRatio(NULL),
697  fHistoDoubleCounting(NULL),
698  fHistoJetMotherInvMassPt(NULL),
699  fHistoPi0InJetMotherInvMassPt(NULL),
700  fHistoMotherBackJetInvMassPt(NULL),
701  fHistoRJetPi0Cand(NULL),
702  fHistoEtaPhiJetPi0Cand(NULL),
703  fHistoEtaPhiJetWithPi0Cand(NULL),
704  fHistoJetFragmFunc(NULL),
705  fHistoJetFragmFuncChargPart(NULL),
706  fHistoTruevsRecJetPt(NULL),
707  fHistoTruePi0JetMotherInvMassPt(NULL),
708  fHistoTruePi0InJetMotherInvMassPt(NULL),
709  fHistoTruePrimaryPi0JetInvMassPt(NULL),
710  fHistoTruePrimaryPi0inJetInvMassPt(NULL),
711  fHistoTruePrimaryPi0InJetInvMassTruePt(NULL),
712  fHistoTrueDoubleCountingPi0Jet(NULL),
713  fHistoTrueEtaJetMotherInvMassPt(NULL),
714  fHistoTrueEtaInJetMotherInvMassPt(NULL),
715  fHistoTruePrimaryEtaJetInvMassPt(NULL),
716  fHistoTruePrimaryEtainJetInvMassPt(NULL),
717  fHistoTrueDoubleCountingEtaJet(NULL),
718  fHistoTruePi0JetFragmFunc(NULL),
719  fHistoTrueEtaJetFragmFunc(NULL),
720  fHistoTruePi0JetFragmFuncChargPart(NULL),
721  fHistoTrueEtaJetFragmFuncChargPart(NULL),
722  fHistoMCPi0JetInAccPt(NULL),
723  fHistoMCPi0inJetInAccPt(NULL),
724  fHistoMCEtaJetInAccPt(NULL),
725  fHistoMCEtainJetInAccPt(NULL),
726  fHistoMCPi0JetEventGenerated(NULL),
727  fHistoMCPi0inJetGenerated(NULL),
728  fHistoMCEtaJetEventGenerated(NULL),
729  fHistoMCEtainJetGenerated(NULL),
730  fHistoTrueSecondaryPi0FromK0sJetInvMassPt(NULL),
731  fHistoTrueSecondaryPi0FromK0sinJetInvMassPt(NULL),
732  fHistoTrueSecondaryPi0FromLambdaJetInvMassPt(NULL),
733  fHistoTrueSecondaryPi0FromLambdainJetInvMassPt(NULL),
734  fHistoTrueSecondaryPi0FromK0lJetInvMassPt(NULL),
735  fHistoTrueSecondaryPi0FromK0linJetInvMassPt(NULL),
736  fHistoTrueSecondaryPi0InvJetMassPt(NULL),
737  fHistoTrueSecondaryPi0InvinJetMassPt(NULL),
738  fHistoMotherPi0inJetPtY(NULL),
739  fHistoMotherEtainJetPtY(NULL),
740  fHistoMotherPi0inJetPtPhi(NULL),
741  fHistoMotherEtainJetPtPhi(NULL),
742  fNumberOfClusters(NULL),
743  fNumberOfClustersinJets(NULL),
744  fEnergyRatio(NULL),
745  fEnergyRatioinJets(NULL),
746  fEnergyRatioGamma1(NULL),
747  fEnergyRatioGamma1inJets(NULL),
748  fEnergyRatioGammaAnywhere(NULL),
749  fEnergyRatioGammaAnywhereinJets(NULL),
750  fEnergyDeposit(NULL),
751  fEnergyDepositinJets(NULL),
752  fEnergyDepGamma1(NULL),
753  fEnergyDepGamma1inJets(NULL),
754  fEnergyDepGammaAnywhere(NULL),
755  fEnergyDepGammaAnywhereinJets(NULL),
756  fEnergyRatioGamma1Helped(NULL),
757  fEnergyRatioGamma1HelpedinJets(NULL),
758  fClusterEtaPhiJets(NULL),
759  fVectorJetPt(0),
760  fVectorJetPx(0),
761  fVectorJetPy(0),
762  fVectorJetPz(0),
763  fVectorJetEta(0),
764  fVectorJetPhi(0),
765  fVectorJetArea(0),
766  fVectorJetNChargPart(0),
767  fTrueVectorJetPt(0),
768  fTrueVectorJetPx(0),
769  fTrueVectorJetPy(0),
770  fTrueVectorJetPz(0),
771  fTrueVectorJetEta(0),
772  fTrueVectorJetPhi(0),
773  fTrueVectorJetNChargPart(0),
774  tTrueInvMassROpenABPtFlag(NULL),
775  fInvMass(-1),
776  fRconv(-1),
777  fOpenRPrim(-1),
778  fInvMassRTOF(-1),
779  fPt(-1),
780  iFlag(3),
781  tSigInvMassPtAlphaTheta(NULL),
782  tBckInvMassPtAlphaTheta(NULL),
783  fInvMassTreeInvMass(0),
784  fInvMassTreePt(0),
785  fInvMassTreeAlpha(0),
786  fInvMassTreeTheta(0),
787  fInvMassTreeMixPool(0),
788  fInvMassTreeZVertex(0),
789  fInvMassTreeEta(0),
790  tClusterEOverP(NULL),
791  fClusterE(0),
792  fClusterM02(0),
793  fClusterM20(0),
794  fClusterEP(0),
795  fClusterLeadCellID(0),
796  fClusterClassification(0),
797  fDeltaEta(0),
798  fDeltaPhi(0),
799  fTrackPt(0),
800  fTrackPID_e(0),
801  fTrackPID_Pi(0),
802  fTrackPID_K(0),
803  fTrackPID_P(0),
804  fClusterIsoSumClusterEt(0),
805  fClusterIsoSumTrackEt(0),
806 // fHistoTruePi0NonLinearity(NULL),
807 // fHistoTrueEtaNonLinearity(NULL),
808  tTreeJetPi0Correlations(NULL),
809  fJetPt(0),
810  fTrueJetPt(0),
811  fPi0Pt(0),
812  fPi0InvMass(0),
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){
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", 20, 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", 20, 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", 20, 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  if(fDoJetQA){
1927  }
1928  }
1929 
1930  if(!fDoLightOutput){
1931  fHistoMCHeaders = new TH1I*[fnCuts];
1932  fHistoMCAllGammaPt = new TH1F*[fnCuts];
1934  fHistoMCDecayGammaPi0Pt = new TH1F*[fnCuts];
1935  fHistoMCDecayGammaRhoPt = new TH1F*[fnCuts];
1936  fHistoMCDecayGammaEtaPt = new TH1F*[fnCuts];
1937  fHistoMCDecayGammaOmegaPt = new TH1F*[fnCuts];
1938  fHistoMCDecayGammaEtapPt = new TH1F*[fnCuts];
1939  fHistoMCDecayGammaPhiPt = new TH1F*[fnCuts];
1940  fHistoMCDecayGammaSigmaPt = new TH1F*[fnCuts];
1943  if (fDoClusterQA > 1) {
1956  }
1957  }
1958 
1959  fHistoTrueClusGammaPt = new TH1F*[fnCuts];
1960  if(!fDoLightOutput){
1962  fHistoTruePrimaryClusGammaPt = new TH1F*[fnCuts];
1976  fHistoTrueNLabelsInClus = new TH1F*[fnCuts];
1977  }
1980 
1981 // fHistoTruePi0NonLinearity = new TH2F*[fnCuts];
1982 // fHistoTrueEtaNonLinearity = new TH2F*[fnCuts];
1983 
1984  if (fDoClusterQA > 0){
1985  fHistoTrueClusUnConvGammaPt = new TH1F*[fnCuts];
1987  if (!fDoLightOutput)
1989  fHistoTrueClusElectronPt = new TH1F*[fnCuts];
1990  fHistoTrueClusConvGammaPt = new TH1F*[fnCuts];
1991  fHistoTrueClusConvGammaMCPt = new TH1F*[fnCuts];
1993  fHistoTrueClusMergedGammaPt = new TH1F*[fnCuts];
1995  fHistoTrueClusDalitzPt = new TH1F*[fnCuts];
1996  fHistoTrueClusDalitzMergedPt = new TH1F*[fnCuts];
1998  fHistoTrueClusShowerPt = new TH1F*[fnCuts];
1999  fHistoTrueClusSubLeadingPt = new TH1F*[fnCuts];
2000  fHistoTrueClusNParticles = new TH1F*[fnCuts];
2001  fHistoTrueClusEMNonLeadingPt = new TH1F*[fnCuts];
2002  }
2003 
2004  if(fDoMesonAnalysis){
2005  fHistoMCPi0Pt = new TH1F*[fnCuts];
2006  fHistoMCPi0WOWeightPt = new TH1F*[fnCuts];
2007  fHistoMCPi0InAccPt = new TH1F*[fnCuts];
2008 
2009  if (fIsMC > 1){
2010  fHistoMCPi0WOEvtWeightPt = new TH1F*[fnCuts];
2012  if( !fDoPi0Only ){
2013  fHistoMCEtaWOEvtWeightPt = new TH1F*[fnCuts];
2015  }
2016  }
2017 
2028  if( !fDoPi0Only ){
2029  fHistoMCEtaPt = new TH1F*[fnCuts];
2030  fHistoMCEtaWOWeightPt = new TH1F*[fnCuts];
2031  fHistoMCEtaInAccPt = new TH1F*[fnCuts];
2037  fHistoMCSecEtaPt = new TH1F*[fnCuts];
2038  fHistoMCSecEtaSource = new TH1F*[fnCuts];
2039  }
2040  if(!fDoLightOutput){
2043  }
2047  fHistoMCSecPi0Source = new TH1F*[fnCuts];
2048 
2049  if (fDoMesonQA > 0 && fDoMesonQA < 3 ){
2050  fHistoMCPi0PtY = new TH2F*[fnCuts];
2051  fHistoMCPi0PtAlpha = new TH2F*[fnCuts];
2052  if( !fDoPi0Only ){
2053  fHistoMCEtaPtY = new TH2F*[fnCuts];
2054  fHistoMCEtaPtAlpha = new TH2F*[fnCuts];
2055  }
2056  if (fIsMC == 2){
2057  fHistoMCPi0PtJetPt = new TH2F*[fnCuts];
2058  if( !fDoPi0Only )fHistoMCEtaPtJetPt = new TH2F*[fnCuts];
2059  }
2060 
2061  if (fIsMC < 2){
2074  if( !fDoPi0Only ){
2083 
2084  }
2085  }
2086  fHistoTruePi0PtY = new TH2F*[fnCuts];
2093  if( !fDoPi0Only ){
2096  fHistoTrueEtaPtY = new TH2F*[fnCuts];
2097  }
2098  }
2099  if (fDoMesonQA==2){
2107  if( !fDoPi0Only ){
2115  }
2116  }
2117  }
2118 
2119 
2120  for(Int_t iCut = 0; iCut<fnCuts;iCut++){
2121  TString cutstringEvent = ((AliConvEventCuts*)fEventCutArray->At(iCut))->GetCutNumber();
2122  TString cutstringCalo = ((AliCaloPhotonCuts*)fClusterCutArray->At(iCut))->GetCutNumber();
2123  TString cutstringMeson = "NoMesonCut";
2124  if(fDoMesonAnalysis)
2125  cutstringMeson = ((AliConversionMesonCuts*)fMesonCutArray->At(iCut))->GetCutNumber();
2126 
2127  fMCList[iCut] = new TList();
2128  fMCList[iCut]->SetName(Form("%s_%s_%s MC histograms", cutstringEvent.Data(), cutstringCalo.Data(), cutstringMeson.Data()));
2129  fMCList[iCut]->SetOwner(kTRUE);
2130  fCutFolder[iCut]->Add(fMCList[iCut]);
2131 
2132  if(!fDoLightOutput){
2133  fHistoMCHeaders[iCut] = new TH1I("MC_Headers", "MC_Headers", 20, 0, 20);
2134  fHistoMCHeaders[iCut]->SetXTitle("accepted headers");
2135  fMCList[iCut]->Add(fHistoMCHeaders[iCut]);
2136  fHistoMCAllGammaPt[iCut] = new TH1F("MC_AllGamma_Pt", "MC_AllGamma_Pt", nBinsClusterPt, arrClusPtBinning);
2137  fHistoMCAllGammaPt[iCut]->SetXTitle("p_{T} (GeV/c)");
2138  fMCList[iCut]->Add(fHistoMCAllGammaPt[iCut]);
2139  fHistoMCAllSecondaryGammaPt[iCut] = new TH2F("MC_AllSecondaryGamma_Pt", "MC_AllSecondaryGamma_Pt", nBinsClusterPt, arrClusPtBinning, 5, -0.5, 4.5);
2140  fHistoMCAllSecondaryGammaPt[iCut]->GetYaxis()->SetBinLabel(1,"K0s");
2141  fHistoMCAllSecondaryGammaPt[iCut]->GetYaxis()->SetBinLabel(2,"K0l");
2142  fHistoMCAllSecondaryGammaPt[iCut]->GetYaxis()->SetBinLabel(3,"Lambda");
2143  fHistoMCAllSecondaryGammaPt[iCut]->GetYaxis()->SetBinLabel(4,"Eta");
2144  fHistoMCAllSecondaryGammaPt[iCut]->GetYaxis()->SetBinLabel(5,"rest");
2145  fHistoMCAllSecondaryGammaPt[iCut]->SetXTitle("p_{T} (GeV/c)");
2146  fHistoMCAllSecondaryGammaPt[iCut]->SetYTitle("sec. particle");
2147  fMCList[iCut]->Add(fHistoMCAllSecondaryGammaPt[iCut]);
2148  fHistoMCDecayGammaPi0Pt[iCut] = new TH1F("MC_DecayGammaPi0_Pt", "MC_DecayGammaPi0_Pt", nBinsClusterPt, arrClusPtBinning);
2149  fHistoMCDecayGammaPi0Pt[iCut]->SetXTitle("p_{T} (GeV/c)");
2150  fMCList[iCut]->Add(fHistoMCDecayGammaPi0Pt[iCut]);
2151  fHistoMCDecayGammaRhoPt[iCut] = new TH1F("MC_DecayGammaRho_Pt", "MC_DecayGammaRho_Pt", nBinsClusterPt, arrClusPtBinning);
2152  fHistoMCDecayGammaRhoPt[iCut]->SetXTitle("p_{T} (GeV/c)");
2153  fMCList[iCut]->Add(fHistoMCDecayGammaRhoPt[iCut]);
2154  fHistoMCDecayGammaEtaPt[iCut] = new TH1F("MC_DecayGammaEta_Pt", "MC_DecayGammaEta_Pt", nBinsClusterPt, arrClusPtBinning);
2155  fHistoMCDecayGammaEtaPt[iCut]->SetXTitle("p_{T} (GeV/c)");
2156  fMCList[iCut]->Add(fHistoMCDecayGammaEtaPt[iCut]);
2157  fHistoMCDecayGammaOmegaPt[iCut] = new TH1F("MC_DecayGammaOmega_Pt", "MC_DecayGammaOmmega_Pt", nBinsClusterPt, arrClusPtBinning);
2158  fHistoMCDecayGammaOmegaPt[iCut]->SetXTitle("p_{T} (GeV/c)");
2159  fMCList[iCut]->Add(fHistoMCDecayGammaOmegaPt[iCut]);
2160  fHistoMCDecayGammaEtapPt[iCut] = new TH1F("MC_DecayGammaEtap_Pt", "MC_DecayGammaEtap_Pt", nBinsClusterPt, arrClusPtBinning);
2161  fHistoMCDecayGammaEtapPt[iCut]->SetXTitle("p_{T} (GeV/c)");
2162  fMCList[iCut]->Add(fHistoMCDecayGammaEtapPt[iCut]);
2163  fHistoMCDecayGammaPhiPt[iCut] = new TH1F("MC_DecayGammaPhi_Pt", "MC_DecayGammaPhi_Pt", nBinsClusterPt, arrClusPtBinning);
2164  fHistoMCDecayGammaPhiPt[iCut]->SetXTitle("p_{T} (GeV/c)");
2165  fMCList[iCut]->Add(fHistoMCDecayGammaPhiPt[iCut]);
2166  fHistoMCDecayGammaSigmaPt[iCut] = new TH1F("MC_DecayGammaSigma_Pt", "MC_DecayGammaSigma_Pt", nBinsClusterPt, arrClusPtBinning);
2167  fHistoMCDecayGammaSigmaPt[iCut]->SetXTitle("p_{T} (GeV/c)");
2168  fMCList[iCut]->Add(fHistoMCDecayGammaSigmaPt[iCut]);
2169 
2170  if (fIsMC > 1){
2171  fHistoMCAllGammaPt[iCut]->Sumw2();
2172  fHistoMCAllSecondaryGammaPt[iCut]->Sumw2();
2173  fHistoMCDecayGammaPi0Pt[iCut]->Sumw2();
2174  fHistoMCDecayGammaRhoPt[iCut]->Sumw2();
2175  fHistoMCDecayGammaEtaPt[iCut]->Sumw2();
2176  fHistoMCDecayGammaOmegaPt[iCut]->Sumw2();
2177  fHistoMCDecayGammaEtapPt[iCut]->Sumw2();
2178  fHistoMCDecayGammaPhiPt[iCut]->Sumw2();
2179  fHistoMCDecayGammaSigmaPt[iCut]->Sumw2();
2180  }
2181  }
2182  if(fDoMesonAnalysis){
2183  fHistoMCPi0Pt[iCut] = new TH1F("MC_Pi0_Pt", "MC_Pi0_Pt", (Int_t)((maxPt-minPt)/binWidthPt), minPt, maxPt);
2184  fHistoMCPi0Pt[iCut]->SetXTitle("p_{T} (GeV/c)");
2185  fHistoMCPi0Pt[iCut]->Sumw2();
2186  fMCList[iCut]->Add(fHistoMCPi0Pt[iCut]);
2187  fHistoMCPi0WOWeightPt[iCut] = new TH1F("MC_Pi0_WOWeights_Pt", "MC_Pi0_WOWeights_Pt", (Int_t)((maxPt-minPt)/binWidthPt), minPt, maxPt);
2188  fHistoMCPi0WOWeightPt[iCut]->Sumw2();
2189  fHistoMCPi0WOWeightPt[iCut]->SetXTitle("p_{T} (GeV/c)");
2190  fMCList[iCut]->Add(fHistoMCPi0WOWeightPt[iCut]);
2191  fHistoMCPi0InAccPt[iCut] = new TH1F("MC_Pi0InAcc_Pt", "MC_Pi0InAcc_Pt", (Int_t)((maxPt-minPt)/binWidthPt), minPt, maxPt);
2192  fHistoMCPi0InAccPt[iCut]->SetXTitle("p_{T} (GeV/c)");
2193  fHistoMCPi0InAccPt[iCut]->Sumw2();
2194  fMCList[iCut]->Add(fHistoMCPi0InAccPt[iCut]);
2195  if( !fDoPi0Only ){
2196  fHistoMCEtaPt[iCut] = new TH1F("MC_Eta_Pt", "MC_Eta_Pt", (Int_t)((maxPt-minPt)/binWidthPt), minPt, maxPt);
2197  fHistoMCEtaPt[iCut]->SetXTitle("p_{T} (GeV/c)");
2198  fHistoMCEtaPt[iCut]->Sumw2();
2199  fMCList[iCut]->Add(fHistoMCEtaPt[iCut]);
2200  fHistoMCEtaWOWeightPt[iCut] = new TH1F("MC_Eta_WOWeights_Pt", "MC_Eta_WOWeights_Pt", (Int_t)((maxPt-minPt)/binWidthPt), minPt, maxPt);
2201  fHistoMCEtaWOWeightPt[iCut]->SetXTitle("p_{T} (GeV/c)");
2202  fHistoMCEtaWOWeightPt[iCut]->Sumw2();
2203  fMCList[iCut]->Add(fHistoMCEtaWOWeightPt[iCut]);
2204  fHistoMCEtaInAccPt[iCut] = new TH1F("MC_EtaInAcc_Pt", "MC_EtaInAcc_Pt", (Int_t)((maxPt-minPt)/binWidthPt), minPt, maxPt);
2205  fHistoMCEtaInAccPt[iCut]->SetXTitle("p_{T} (GeV/c)");
2206  fHistoMCEtaInAccPt[iCut]->Sumw2();
2207  fMCList[iCut]->Add(fHistoMCEtaInAccPt[iCut]);
2208  }
2209  if (fIsMC > 1){
2210  fHistoMCPi0WOWeightPt[iCut]->Sumw2();
2211  fHistoMCPi0WOEvtWeightPt[iCut] = new TH1F("MC_Pi0_WOEventWeights_Pt", "MC_Pi0_WOEventWeights_Pt", (Int_t)((maxPt-minPt)/binWidthPt), minPt, maxPt);
2212  fHistoMCPi0WOEvtWeightPt[iCut]->SetXTitle("p_{T} (GeV/c)");
2213  fMCList[iCut]->Add(fHistoMCPi0WOEvtWeightPt[iCut]);
2214  fHistoMCPi0WOEvtWeightInAccPt[iCut] = new TH1F("MC_Pi0WOEvtWeightInAcc_Pt", "MC_Pi0WOEvtWeightInAcc_Pt", (Int_t)((maxPt-minPt)/binWidthPt), minPt, maxPt);
2215  fHistoMCPi0WOEvtWeightInAccPt[iCut]->SetXTitle("p_{T} (GeV/c)");
2216  fMCList[iCut]->Add(fHistoMCPi0WOEvtWeightInAccPt[iCut]);
2217  if( !fDoPi0Only ){
2218  fHistoMCEtaWOWeightPt[iCut]->Sumw2();
2219  fHistoMCEtaWOEvtWeightPt[iCut] = new TH1F("MC_Eta_WOEventWeights_Pt", "MC_Eta_WOEventWeights_Pt", (Int_t)((maxPt-minPt)/binWidthPt), minPt, maxPt);
2220  fHistoMCEtaWOEvtWeightPt[iCut]->SetXTitle("p_{T} (GeV/c)");
2221  fMCList[iCut]->Add(fHistoMCEtaWOEvtWeightPt[iCut]);
2222  fHistoMCEtaWOEvtWeightInAccPt[iCut] = new TH1F("MC_EtaWOEvtWeightInAcc_Pt", "MC_EtaWOEvtWeightInAcc_Pt", (Int_t)((maxPt-minPt)/binWidthPt), minPt, maxPt);
2223  fHistoMCEtaWOEvtWeightInAccPt[iCut]->SetXTitle("p_{T} (GeV/c)");
2224  fMCList[iCut]->Add(fHistoMCEtaWOEvtWeightInAccPt[iCut]);
2225  }
2226 
2227  if (fDoMesonQA > 0 && fDoMesonQA < 3 && fIsMC == 2){
2228  fHistoMCPi0PtJetPt[iCut] = new TH2F("MC_Pi0_Pt_JetPt", "MC_Pi0_Pt_JetPt", nBinsQAPt, arrQAPtBinning, 200, 0, 200);
2229  fHistoMCPi0PtJetPt[iCut]->SetXTitle("p_{T} (GeV/c)");
2230  fHistoMCPi0PtJetPt[iCut]->SetYTitle("p_{jet, T} (GeV/c)");
2231  fHistoMCPi0PtJetPt[iCut]->Sumw2();
2232  fMCList[iCut]->Add(fHistoMCPi0PtJetPt[iCut]);
2233  if( !fDoPi0Only ){
2234  fHistoMCEtaPtJetPt[iCut] = new TH2F("MC_Eta_Pt_JetPt", "MC_Eta_Pt_JetPt", nBinsQAPt, arrQAPtBinning, 200, 0, 200);
2235  fHistoMCEtaPtJetPt[iCut]->SetXTitle("p_{T} (GeV/c)");
2236  fHistoMCEtaPtJetPt[iCut]->SetYTitle("p_{jet, T} (GeV/c)");
2237  fHistoMCEtaPtJetPt[iCut]->Sumw2();
2238  fMCList[iCut]->Add(fHistoMCEtaPtJetPt[iCut]);
2239  }
2240  }
2241  }
2242  fHistoMCPrimaryPtvsSource[iCut] = new TH2F("MC_Primary_Pt_Source", "MC_Primary_Pt_Source", (Int_t)((maxPt-minPt)/binWidthPt), minPt, maxPt, 7, -0.5, 6.5);
2243  fHistoMCPrimaryPtvsSource[iCut]->GetYaxis()->SetBinLabel(1,"Pi+");
2244  fHistoMCPrimaryPtvsSource[iCut]->GetYaxis()->SetBinLabel(2,"Pi-");
2245  fHistoMCPrimaryPtvsSource[iCut]->GetYaxis()->SetBinLabel(3,"K+");
2246  fHistoMCPrimaryPtvsSource[iCut]->GetYaxis()->SetBinLabel(4,"K-");
2247  fHistoMCPrimaryPtvsSource[iCut]->GetYaxis()->SetBinLabel(5,"K0s");
2248  fHistoMCPrimaryPtvsSource[iCut]->GetYaxis()->SetBinLabel(6,"K0l");
2249  fHistoMCPrimaryPtvsSource[iCut]->GetYaxis()->SetBinLabel(7,"Lambda");
2250  fHistoMCPrimaryPtvsSource[iCut]->SetXTitle("p_{T} (GeV/c)");
2251  fHistoMCPrimaryPtvsSource[iCut]->SetYTitle("particle");
2252  fMCList[iCut]->Add(fHistoMCPrimaryPtvsSource[iCut]);
2253 
2254  fHistoMCSecPi0Source[iCut] = new TH1F("MC_SecPi0_Source", "MC_SecPi0_Source", 5000, 0., 5000);
2255  fHistoMCSecPi0Source[iCut]->SetYTitle("source PDG");
2256  fMCList[iCut]->Add(fHistoMCSecPi0Source[iCut]);
2257  if( !fDoPi0Only ){
2258  fHistoMCSecEtaSource[iCut] = new TH1F("MC_SecEta_Source", "MC_SecEta_Source", 5000, 0, 5000);
2259  fHistoMCSecEtaSource[iCut]->SetYTitle("source PDG");
2260  fMCList[iCut]->Add(fHistoMCSecEtaSource[iCut]);
2261  }
2262  fHistoMCSecPi0PtvsSource[iCut] = new TH2F("MC_SecPi0_Pt_Source", "MC_SecPi0_Pt_Source", (Int_t)((maxPt-minPt)/binWidthPt), minPt, maxPt, 16, -0.5, 15.5);
2263  fHistoMCSecPi0PtvsSource[iCut]->SetXTitle("p_{T} (GeV/c)");
2264  fHistoMCSecPi0PtvsSource[iCut]->SetYTitle("source");
2265  fMCList[iCut]->Add(fHistoMCSecPi0PtvsSource[iCut]);
2266  fHistoMCSecPi0InAccPtvsSource[iCut] = new TH2F("MC_SecPi0InAcc_Pt_Source", "MC_SecPi0InAcc_Pt_Source", (Int_t)((maxPt-minPt)/binWidthPt), minPt, maxPt, 16, -0.5, 15.5);
2267  fHistoMCSecPi0InAccPtvsSource[iCut]->SetXTitle("p_{T} (GeV/c)");
2268  fHistoMCSecPi0InAccPtvsSource[iCut]->SetYTitle("source");
2269  fMCList[iCut]->Add(fHistoMCSecPi0InAccPtvsSource[iCut]);
2270  if( !fDoPi0Only ){
2271  fHistoMCSecEtaPt[iCut] = new TH1F("MC_SecEta_Pt", "MC_SecEta_Pt", (Int_t)((maxPt-minPt)/binWidthPt), minPt, maxPt);
2272  fHistoMCSecEtaPt[iCut]->SetXTitle("p_{T} (GeV/c)");
2273  fMCList[iCut]->Add(fHistoMCSecEtaPt[iCut]);
2274  }
2275  if (fIsMC == 2) {
2276  fHistoMCPrimaryPtvsSource[iCut]->Sumw2();
2277  fHistoMCSecPi0PtvsSource[iCut]->Sumw2();
2278  fHistoMCSecPi0InAccPtvsSource[iCut]->Sumw2();
2279  if( !fDoPi0Only ) fHistoMCSecEtaPt[iCut]->Sumw2();
2280  }
2281 
2282 
2283  if (fDoMesonQA > 0 && fDoMesonQA < 3){
2284  fHistoMCPi0PtY[iCut] = new TH2F("MC_Pi0_Pt_Y", "MC_Pi0_Pt_Y", nBinsQAPt, arrQAPtBinning, 150, -1.5, 1.5);
2285  fHistoMCPi0PtY[iCut]->SetXTitle("p_{T} (GeV/c)");
2286  fHistoMCPi0PtY[iCut]->SetYTitle("y");
2287  fHistoMCPi0PtY[iCut]->Sumw2();
2288  fMCList[iCut]->Add(fHistoMCPi0PtY[iCut]);
2289  if( !fDoPi0Only ){
2290  fHistoMCEtaPtY[iCut] = new TH2F("MC_Eta_Pt_Y", "MC_Eta_Pt_Y", nBinsQAPt, arrQAPtBinning, 150, -1.5, 1.5);
2291  fHistoMCEtaPtY[iCut]->SetXTitle("p_{T} (GeV/c)");
2292  fHistoMCEtaPtY[iCut]->SetYTitle("y");
2293  fHistoMCEtaPtY[iCut]->Sumw2();
2294  fMCList[iCut]->Add(fHistoMCEtaPtY[iCut]);
2295  }
2296  fHistoMCPi0PtAlpha[iCut] = new TH2F("MC_Pi0_Pt_Alpha", "MC_Pi0_Pt_Alpha", nBinsQAPt, arrQAPtBinning, 100, 0, 1);
2297  fHistoMCPi0PtAlpha[iCut]->SetXTitle("p_{T} (GeV/c)");
2298  fHistoMCPi0PtAlpha[iCut]->SetYTitle("#alpha");
2299  fMCList[iCut]->Add(fHistoMCPi0PtAlpha[iCut]);
2300  if( !fDoPi0Only ){
2301  fHistoMCEtaPtAlpha[iCut] = new TH2F("MC_Eta_Pt_Alpha", "MC_Eta_Pt_Alpha", nBinsQAPt, arrQAPtBinning, 100, 0, 1);
2302  fHistoMCEtaPtAlpha[iCut]->SetXTitle("p_{T} (GeV/c)");
2303  fHistoMCEtaPtAlpha[iCut]->SetYTitle("#alpha");
2304  fMCList[iCut]->Add(fHistoMCEtaPtAlpha[iCut]);
2305  }
2306 
2307  if (fIsMC == 2) {
2308  fHistoMCPi0PtAlpha[iCut]->Sumw2();
2309  if( !fDoPi0Only )fHistoMCEtaPtAlpha[iCut]->Sumw2();
2310  }
2311  }
2312  }
2313  fTrueList[iCut] = new TList();
2314  fTrueList[iCut]->SetName(Form("%s_%s_%s True histograms", cutstringEvent.Data(), cutstringCalo.Data(), cutstringMeson.Data()));
2315  fTrueList[iCut]->SetOwner(kTRUE);
2316  fCutFolder[iCut]->Add(fTrueList[iCut]);
2317 
2319  fTrueJetHistograms[iCut] = new TList();
2320  fTrueJetHistograms[iCut]->SetName(Form("%s_%s_%s True Jet histograms", cutstringEvent.Data(), cutstringCalo.Data(), cutstringMeson.Data()));
2321  fTrueJetHistograms[iCut]->SetOwner(kTRUE);
2322  fCutFolder[iCut]->Add(fTrueJetHistograms[iCut]);
2323  fHistoTruevsRecJetPt[iCut] = new TH2F("True_JetPt_vs_Rec_JetPt", "True_JetPt_vs_Rec_JetPt", 150, 0, 150, 150, 0, 150);
2324  fTrueJetHistograms[iCut]->Add(fHistoTruevsRecJetPt[iCut]);
2325  fHistoTruePi0JetMotherInvMassPt[iCut] = new TH2F("ESD_TruePi0_Jet_InvMass_Pt", "ESD_TruePi0_Jet_InvMass_Pt", nBinsMinv, 0, maxMinv, nBinsPt, arrPtBinning);
2327  fHistoTruePrimaryPi0JetInvMassPt[iCut] = new TH2F("ESD_TruePrimaryPi0Jet_InvMass_Pt", "ESD_TruePrimaryPi0Jet_InvMass_Pt", nBinsMinv, 0, maxMinv, nBinsPt, arrPtBinning);
2329  fHistoTruePi0InJetMotherInvMassPt[iCut] = new TH2F("ESD_TruePi0_Pi0inJet_InvMass_Pt", "ESD_TruePi0_Pi0inJet_InvMass_Pt", nBinsMinv, 0, maxMinv, nBinsPt, arrPtBinning);
2331  fHistoTruePrimaryPi0inJetInvMassPt[iCut] = new TH2F("ESD_TruePrimaryPi0inJet_InvMass_Pt", "ESD_TruePrimaryPi0inJet_InvMass_Pt", nBinsMinv, 0, maxMinv, nBinsPt, arrPtBinning);
2333  fHistoTruePrimaryPi0InJetInvMassTruePt[iCut] = new TH2F("ESD_TruePrimaryPi0inJet_InvMass_TruePt", "ESD_TruePrimaryPi0inJet_InvMass_TruePt", nBinsMinv, 0, maxMinv, nBinsPt, arrPtBinning);
2335  fHistoTrueDoubleCountingPi0Jet[iCut] = new TH1F("Double_Counting_True_Pi0inJet", "Double_Counting_True_Pi0inJet", 6, 0, 6);
2337  fHistoTruePi0JetFragmFunc[iCut] = new TH2F("ESD_TruePi0inJetPt_FragmentationFunc", "ESD_TruePi0inJetPt_FragmentationFunc", 50, arrLogBinning, 150, 0., 150.);
2339  fHistoTruePi0JetFragmFuncChargPart[iCut] = new TH2F("ESD_TruePi0inJet_FragmentationFunc_ChargPart", "ESD_TruePi0inJet_FragmentationFunc_ChargPart", 50, arrLogBinning, 60, 0., 60.);
2341  fHistoMCPi0JetInAccPt[iCut] = new TH1F("MC_Pi0JetInAcc_Pt", "MC_Pi0JetInAcc_Pt", (Int_t)((maxPt-minPt)/binWidthPt), minPt, maxPt);
2342  fTrueJetHistograms[iCut]->Add(fHistoMCPi0JetInAccPt[iCut]);
2343  fHistoMCPi0inJetInAccPt[iCut] = new TH1F("MC_Pi0inJetInAcc_Pt", "MC_Pi0inJetInAcc_Pt", (Int_t)((maxPt-minPt)/binWidthPt), minPt, maxPt);
2344  fTrueJetHistograms[iCut]->Add(fHistoMCPi0inJetInAccPt[iCut]);
2345  fHistoMCPi0JetEventGenerated[iCut] = new TH1F("MC_Pi0_JetEvent_Generated", "MC_Pi0_JetEvent_Generated", (Int_t)((maxPt-minPt)/binWidthPt), minPt, maxPt);
2347  fHistoMCPi0inJetGenerated[iCut] = new TH1F("MC_Pi0_inJet_Generated", "MC_Pi0_inJet_Generated", (Int_t)((maxPt-minPt)/binWidthPt), minPt, maxPt);
2349  fHistoTrueSecondaryPi0FromK0sJetInvMassPt[iCut] = new TH2F("ESD_TrueSecondaryPi0FromK0sJet_InvMass_Pt", "ESD_TrueSecondaryPi0FromK0sJet_InvMass_Pt", nBinsMinv, 0, maxMinv, nBinsPt, arrPtBinning);
2351  fHistoTrueSecondaryPi0FromK0sinJetInvMassPt[iCut] = new TH2F("ESD_TrueSecondaryPi0FromK0s_inJet_InvMass_Pt", "ESD_TrueSecondaryPi0FromK0s_inJet_InvMass_Pt", nBinsMinv, 0, maxMinv, nBinsPt, arrPtBinning);
2353  fHistoTrueSecondaryPi0FromLambdaJetInvMassPt[iCut] = new TH2F("ESD_TrueSecondaryPi0FromLambdaJet_InvMass_Pt", "ESD_TrueSecondaryPi0FromLambdaJet_InvMass_Pt", nBinsMinv, 0, maxMinv, nBinsPt, arrPtBinning);
2355  fHistoTrueSecondaryPi0FromLambdainJetInvMassPt[iCut] = new TH2F("ESD_TrueSecondaryPi0FromLambda_inJet_InvMass_Pt", "ESD_TrueSecondaryPi0FromLambda_inJet_InvMass_Pt", nBinsMinv, 0, maxMinv, nBinsPt, arrPtBinning);
2357  fHistoTrueSecondaryPi0FromK0lJetInvMassPt[iCut] = new TH2F("ESD_TrueSecondaryPi0FromK0lJet_InvMass_Pt", "ESD_TrueSecondaryPi0FromK0lJet_InvMass_Pt", nBinsMinv, 0, maxMinv, nBinsPt, arrPtBinning);
2359  fHistoTrueSecondaryPi0FromK0linJetInvMassPt[iCut] = new TH2F("ESD_TrueSecondaryPi0FromK0l_inJet_InvMass_Pt", "ESD_TrueSecondaryPi0FromK0l_inJet_InvMass_Pt", nBinsMinv, 0, maxMinv, nBinsPt, arrPtBinning);
2361  fHistoTrueSecondaryPi0InvJetMassPt[iCut] = new TH2F("ESD_TrueSecondaryPi0Jet_InvMass_Pt", "ESD_TrueSecondaryPi0Jet_InvMass_Pt", nBinsMinv, 0, maxMinv, nBinsPt, arrPtBinning);
2363  fHistoTrueSecondaryPi0InvinJetMassPt[iCut] = new TH2F("ESD_TrueSecondaryPi0_inJet_InvMass_Pt", "ESD_TrueSecondaryPi0_inJet_InvMass_Pt", nBinsMinv, 0, maxMinv, nBinsPt, arrPtBinning);
2365  fHistoMotherPi0inJetPtY[iCut] = new TH2F("ESD_MotherPi0inJet_Pt_Y", "ESD_MotherPi0inJet_Pt_Y", nBinsQAPt, arrQAPtBinning, 150, -1.5, 1.5);
2366  fTrueJetHistograms[iCut]->Add(fHistoMotherPi0inJetPtY[iCut]);
2367  fHistoMotherPi0inJetPtPhi[iCut] = new TH2F("ESD_MotherPi0inJet_Pt_Phi", "ESD_MotherPi0inJet_Pt_Phi", nBinsQAPt, arrQAPtBinning, 150, 0, 6.5);
2369 
2370  if(!fDoPi0Only){
2371  fHistoTrueEtaJetMotherInvMassPt[iCut] = new TH2F("ESD_TrueEta_Jet_InvMass_Pt", "ESD_TruePi0_Jet_InvMass_Pt", nBinsMinv, 0, maxMinv, nBinsPt, arrPtBinning);
2373  fHistoTruePrimaryEtaJetInvMassPt[iCut] = new TH2F("ESD_TruePrimaryEtaJet_InvMass_Pt", "ESD_TruePrimaryEtaJet_InvMass_Pt", nBinsMinv, 0, maxMinv, nBinsPt, arrPtBinning);
2375  fHistoTrueEtaInJetMotherInvMassPt[iCut] = new TH2F("ESD_TrueEta_EtainJet_InvMass_Pt", "ESD_TruePi0_Pi0inJet_InvMass_Pt", nBinsMinv, 0, maxMinv, nBinsPt, arrPtBinning);
2377  fHistoTruePrimaryEtainJetInvMassPt[iCut] = new TH2F("ESD_TruePrimaryEtainJet_InvMass_Pt", "ESD_TruePrimaryEtainJet_InvMass_Pt", nBinsMinv, 0, maxMinv, nBinsPt, arrPtBinning);
2379  fHistoTrueDoubleCountingEtaJet[iCut] = new TH1F("Double_Counting_True_EtainJet", "Double_Counting_True_EtainJet", 6, 0, 6);
2381  fHistoTrueEtaJetFragmFunc[iCut] = new TH2F("ESD_TrueEtainJet_FragmentationFunc", "ESD_TrueEtainJet_FragmentationFunc", 50, arrLogBinning, 150, 0., 150.);
2383  fHistoTrueEtaJetFragmFuncChargPart[iCut] = new TH2F("ESD_TrueEtainJet_FragmentationFunc_ChargPart", "ESD_TrueEtainJet_FragmentationFunc_ChargPart", 50, arrLogBinning, 60, 0., 60.);
2385  fHistoMCEtaJetInAccPt[iCut] = new TH1F("MC_EtaJetInAcc_Pt", "MC_EtaJetInAcc_Pt", (Int_t)((maxPt-minPt)/binWidthPt), minPt, maxPt);
2386  fTrueJetHistograms[iCut]->Add(fHistoMCEtaJetInAccPt[iCut]);
2387  fHistoMCEtainJetInAccPt[iCut] = new TH1F("MC_EtainJetInAcc_Pt", "MC_EtainJetInAcc_Pt", (Int_t)((maxPt-minPt)/binWidthPt), minPt, maxPt);
2388  fTrueJetHistograms[iCut]->Add(fHistoMCEtainJetInAccPt[iCut]);
2389  fHistoMCEtaJetEventGenerated[iCut] = new TH1F("MC_Eta_JetEvent_Generated", "MC_Eta_JetEvent_Generated", (Int_t)((maxPt-minPt)/binWidthPt), minPt, maxPt);
2391  fHistoMCEtainJetGenerated[iCut] = new TH1F("MC_Eta_inJet_Generated", "MC_Eta_inJet_Generated", (Int_t)((maxPt-minPt)/binWidthPt), minPt, maxPt);
2393  fHistoMotherEtainJetPtY[iCut] = new TH2F("ESD_MotherEtainJet_Pt_Y", "ESD_MotherEtainJet_Pt_Y", nBinsQAPt, arrQAPtBinning, 150, -1.5, 1.5);
2394  fTrueJetHistograms[iCut]->Add(fHistoMotherEtainJetPtY[iCut]);
2395  fHistoMotherEtainJetPtPhi[iCut] = new TH2F("ESD_MotherEtainJet_Pt_Phi", "ESD_MotherEtainJet_Pt_Phi", nBinsQAPt, arrQAPtBinning, 150, 0, 6.5);
2397  }
2398  if(fIsMC > 0 && fDoClusterQA == kTRUE){
2399  fNumberOfClusters[iCut] = new TH1F("MC_NumberofClusters", "MC_NumberofClusters", 25, 0 ,25);
2400  fNumberOfClusters[iCut]->SetXTitle("Number of clusters");
2401  fTrueJetHistograms[iCut]->Add(fNumberOfClusters[iCut]);
2402  fNumberOfClustersinJets[iCut] = new TH1F("MC_NumberofClusters_inJets", "MC_NumberofClusters_inJets", 25, 0 ,25);
2403  fNumberOfClustersinJets[iCut]->SetXTitle("Number of clusters in Jets");
2404  fTrueJetHistograms[iCut]->Add(fNumberOfClustersinJets[iCut]);
2405  fEnergyRatio[iCut] = new TH2F("MC_EnergyFrac", "MC_EnergyFrac", 25, 0, 1, 30 , 0, 30);
2406  fEnergyRatio[iCut]->SetXTitle("Energy fraction if NLabels > 1");
2407  fEnergyRatio[iCut]->SetYTitle("Energy particle");
2408  fTrueJetHistograms[iCut]->Add(fEnergyRatio[iCut]);
2409  fEnergyRatioinJets[iCut] = new TH2F("MC_EnergyFrac_inJets", "MC_EnergyFrac_inJets", 25, 0, 1, 30 , 0, 30);
2410  fEnergyRatioinJets[iCut]->SetXTitle("Energy fraction if NLabels > 1 in Jets");
2411  fEnergyRatioinJets[iCut]->SetYTitle("Energy particle");
2412  fTrueJetHistograms[iCut]->Add(fEnergyRatioinJets[iCut]);
2413  fEnergyRatioGamma1[iCut] = new TH2F("MC_EnergyFracGamma", "MC_EnergyFracGamma", 25, 0, 1, 30 , 0, 30);
2414  fEnergyRatioGamma1[iCut]->SetXTitle("Energy fraction if Label 1 is Gamma (NLabels > 1)");
2415  fEnergyRatioGamma1[iCut]->SetYTitle("Energy particle");
2416  fTrueJetHistograms[iCut]->Add(fEnergyRatioGamma1[iCut]);
2417  fEnergyRatioGamma1inJets[iCut] = new TH2F("MC_EnergyFracGamma_inJets", "MC_EnergyFracGamma_inJets", 25, 0 ,1, 30 , 0, 30);
2418  fEnergyRatioGamma1inJets[iCut]->SetXTitle("Energy fraction if Label 1 is Gamma (NLabels > 1) in Jets");
2419  fEnergyRatioGamma1inJets[iCut]->SetYTitle("Energy particle");
2420  fTrueJetHistograms[iCut]->Add(fEnergyRatioGamma1inJets[iCut]);
2421  fEnergyRatioGammaAnywhere[iCut] = new TH2F("MC_EnergyFracGammaAnywhere", "MC_EnergyFracGammaAnywhere", 25, 0, 1, 30 , 0, 30);
2422  fEnergyRatioGammaAnywhere[iCut]->SetXTitle("Energy fraction if a Label is Gamma (NLabels > 1)");
2423  fEnergyRatioGammaAnywhere[iCut]->SetYTitle("Energy particle");
2425  fEnergyRatioGammaAnywhereinJets[iCut] = new TH2F("MC_EnergyFracGammaAnywhere_inJets", "MC_EnergyFracGammaAnywhere_inJets", 25, 0 ,1, 30 , 0, 30);
2426  fEnergyRatioGammaAnywhereinJets[iCut]->SetXTitle("Energy fraction if a Label is Gamma (NLabels > 1) in Jets");
2427  fEnergyRatioGammaAnywhereinJets[iCut]->SetYTitle("Energy particle");
2429  fEnergyDeposit[iCut] = new TH2F("MC_EnergyDep", "MC_EnergyDep", 25, 0, 5, 30 , 0, 30);
2430  fEnergyDeposit[iCut]->SetXTitle("Energy deposit if NLabels > 1");
2431  fEnergyDeposit[iCut]->SetYTitle("Energy particle");
2432  fTrueJetHistograms[iCut]->Add(fEnergyDeposit[iCut]);
2433  fEnergyDepositinJets[iCut] = new TH2F("MC_EnergyDep_inJets", "MC_EnergyDep_inJets", 25, 0, 5, 30 , 0, 30);
2434  fEnergyDepositinJets[iCut]->SetXTitle("Energy deposit if NLabels > 1 in Jets");
2435  fEnergyDepositinJets[iCut]->SetYTitle("Energy particle");
2436  fTrueJetHistograms[iCut]->Add(fEnergyDepositinJets[iCut]);
2437  fEnergyDepGamma1[iCut] = new TH2F("MC_EnergyDepGamma", "MC_EnergyDepGamma", 25, 0, 5, 30 , 0, 30);
2438  fEnergyDepGamma1[iCut]->SetXTitle("Energy deposit if Label 1 is Gamma (NLabels > 1)");
2439  fEnergyDepGamma1[iCut]->SetYTitle("Energy particle");
2440  fTrueJetHistograms[iCut]->Add(fEnergyDepGamma1[iCut]);
2441  fEnergyDepGamma1inJets[iCut] = new TH2F("MC_EnergyDepGamma_inJets", "MC_EnergyDepGamma_inJets", 25, 0 ,5, 30 , 0, 30);
2442  fEnergyDepGamma1inJets[iCut]->SetXTitle("Energy deposit if Label 1 is Gamma (NLabels > 1) in Jets");
2443  fEnergyDepGamma1inJets[iCut]->SetYTitle("Energy particle");
2444  fTrueJetHistograms[iCut]->Add(fEnergyDepGamma1inJets[iCut]);
2445  fEnergyDepGammaAnywhere[iCut] = new TH2F("MC_EnergyDepGammaAnywhere", "MC_EnergyDepGammaAnywhere", 25, 0, 5, 30 , 0, 30);
2446  fEnergyDepGammaAnywhere[iCut]->SetXTitle("Energy deposit if a Label is Gamma (NLabels > 1)");
2447  fEnergyDepGammaAnywhere[iCut]->SetYTitle("Energy particle");
2448  fTrueJetHistograms[iCut]->Add(fEnergyDepGammaAnywhere[iCut]);
2449  fEnergyDepGammaAnywhereinJets[iCut] = new TH2F("MC_EnergyDepGammaAnywhere_inJets", "MC_EnergyDepGammaAnywhere_inJets", 25, 0 ,5, 30 , 0, 30);
2450  fEnergyDepGammaAnywhereinJets[iCut]->SetXTitle("Energy deposit if a Label is Gamma (NLabels > 1) in Jets");
2451  fEnergyDepGammaAnywhereinJets[iCut]->SetYTitle("Energy particle");
2453  fEnergyRatioGamma1Helped[iCut] = new TH1F("MC_EnergyFracGamma_Helped", "MC_EnergyFracGamma_Helped", 50, 0 ,1);
2454  fEnergyRatioGamma1Helped[iCut]->SetXTitle("Energy photon if NLabels > 1");
2455  fTrueJetHistograms[iCut]->Add(fEnergyRatioGamma1Helped[iCut]);
2456  fEnergyRatioGamma1HelpedinJets[iCut] = new TH1F("MC_EnergyFracGamma_Helped_inJets", "MC_EnergyFracGamma_Helped_inJets", 50, 0 ,1);
2457  fEnergyRatioGamma1HelpedinJets[iCut]->SetXTitle("Energy photon if NLabels > 1 in Jets");
2459  fClusterEtaPhiJets[iCut] = new TH2F("MC_Cluster_EtaPhi_Jets", "MC_Cluster_EtaPhi_Jets", 462,0,2*TMath::Pi(),110,-0.7,0.7);
2460  fClusterEtaPhiJets[iCut]->SetXTitle("#varphi");
2461  fClusterEtaPhiJets[iCut]->SetYTitle("#eta");
2462  fTrueJetHistograms[iCut]->Add(fClusterEtaPhiJets[iCut]);
2463  }
2464 
2465  if(fDoJetQA){
2466  tTreeJetPi0Correlations[iCut] = new TTree("Jet_Pi0_Correlations", "Jet_Pi0_Correlations");
2467  tTreeJetPi0Correlations[iCut]->Branch("JetPt",&fJetPt,"fJetPt/F");
2468  tTreeJetPi0Correlations[iCut]->Branch("TrueJetPt",&fTrueJetPt,"fTrueJetPt/F");
2469  tTreeJetPi0Correlations[iCut]->Branch("Pi0Pt",&fPi0Pt,"fPi0Pt/F");
2470  tTreeJetPi0Correlations[iCut]->Branch("Pi0InvMass",&fPi0InvMass,"fPi0InvMass/F");
2471  fTrueJetHistograms[iCut]->Add(tTreeJetPi0Correlations[iCut]);
2472  }
2473  }
2474  if(!fDoLightOutput){
2475  fHistoClusPhotonBGPt[iCut] = new TH2F("ESD_TrueClusPhotonBG_Pt", "ESD_TrueClusPhotonBG_Pt", nBinsClusterPt, arrClusPtBinning,10,-0.5,9.5);
2476  fHistoClusPhotonBGPt[iCut]->GetYaxis()->SetBinLabel( 1,"Elec");
2477  fHistoClusPhotonBGPt[iCut]->GetYaxis()->SetBinLabel( 2,"Pion");
2478  fHistoClusPhotonBGPt[iCut]->GetYaxis()->SetBinLabel( 3,"Proton");
2479  fHistoClusPhotonBGPt[iCut]->GetYaxis()->SetBinLabel( 4,"Kaon");
2480  fHistoClusPhotonBGPt[iCut]->GetYaxis()->SetBinLabel( 5,"Neutron");
2481  fHistoClusPhotonBGPt[iCut]->GetYaxis()->SetBinLabel( 6,"K0s");
2482  fHistoClusPhotonBGPt[iCut]->GetYaxis()->SetBinLabel( 7,"Lambda");
2483  fHistoClusPhotonBGPt[iCut]->GetYaxis()->SetBinLabel( 8,"Muon");
2484  fHistoClusPhotonBGPt[iCut]->GetYaxis()->SetBinLabel( 9,"K0l");
2485  fHistoClusPhotonBGPt[iCut]->GetYaxis()->SetBinLabel( 10,"Rest");
2486  fHistoClusPhotonBGPt[iCut]->SetXTitle("p_{T} (GeV/c)");
2487  fHistoClusPhotonBGPt[iCut]->SetYTitle("source");
2488  fTrueList[iCut]->Add(fHistoClusPhotonBGPt[iCut]);
2489  fHistoClusPhotonPlusConvBGPt[iCut] = new TH2F("ESD_TrueClusPhotonPlusConvBG_Pt", "ESD_TrueClusPhotonPlusConvBG_Pt", nBinsClusterPt, arrClusPtBinning,10,-0.5,9.5);
2490  fHistoClusPhotonPlusConvBGPt[iCut]->GetYaxis()->SetBinLabel( 1,"Elec");
2491  fHistoClusPhotonPlusConvBGPt[iCut]->GetYaxis()->SetBinLabel( 2,"Pion");
2492  fHistoClusPhotonPlusConvBGPt[iCut]->GetYaxis()->SetBinLabel( 3,"Proton");
2493  fHistoClusPhotonPlusConvBGPt[iCut]->GetYaxis()->SetBinLabel( 4,"Kaon");
2494  fHistoClusPhotonPlusConvBGPt[iCut]->GetYaxis()->SetBinLabel( 5,"Neutron");
2495  fHistoClusPhotonPlusConvBGPt[iCut]->GetYaxis()->SetBinLabel( 6,"K0s");
2496  fHistoClusPhotonPlusConvBGPt[iCut]->GetYaxis()->SetBinLabel( 7,"Lambda");
2497  fHistoClusPhotonPlusConvBGPt[iCut]->GetYaxis()->SetBinLabel( 8,"Muon");
2498  fHistoClusPhotonPlusConvBGPt[iCut]->GetYaxis()->SetBinLabel( 9,"K0l");
2499  fHistoClusPhotonPlusConvBGPt[iCut]->GetYaxis()->SetBinLabel(10,"Rest");
2500  fHistoClusPhotonPlusConvBGPt[iCut]->SetXTitle("p_{T} (GeV/c)");
2501  fHistoClusPhotonPlusConvBGPt[iCut]->SetYTitle("source");
2502  fTrueList[iCut]->Add(fHistoClusPhotonPlusConvBGPt[iCut]);
2503 
2504  if (fDoClusterQA > 1) {
2505  fHistoClustPhotonElectronBGPtM02[iCut] = new TH2F("ESD_TrueClusPhotonElectronBG_Pt_M02", "ESD_TrueClusPhotonElectronBG_Pt_M02", nBinsClusterPt, arrClusPtBinning, 100, 0, 1);
2506  fHistoClustPhotonElectronBGPtM02[iCut]->SetXTitle("p_{T} (GeV/c)");
2507  fHistoClustPhotonElectronBGPtM02[iCut]->SetYTitle("#sigma_{long}^{2}");
2508  fTrueList[iCut]->Add(fHistoClustPhotonElectronBGPtM02[iCut]);
2509  fHistoClustPhotonPionBGPtM02[iCut] = new TH2F("ESD_TrueClusPhotonPionBG_Pt_M02", "ESD_TrueClusPhotonPionBG_Pt_M02", nBinsClusterPt, arrClusPtBinning, 100, 0, 1);
2510  fHistoClustPhotonPionBGPtM02[iCut]->SetXTitle("p_{T} (GeV/c)");
2511  fHistoClustPhotonPionBGPtM02[iCut]->SetYTitle("#sigma_{long}^{2}");
2512  fTrueList[iCut]->Add(fHistoClustPhotonPionBGPtM02[iCut]);
2513  fHistoClustPhotonKaonBGPtM02[iCut] = new TH2F("ESD_TrueClusPhotonKaonBG_Pt_M02", "ESD_TrueClusPhotonKaonBG_Pt_M02", nBinsClusterPt, arrClusPtBinning, 100, 0, 1);
2514  fHistoClustPhotonKaonBGPtM02[iCut]->SetXTitle("p_{T} (GeV/c)");
2515  fHistoClustPhotonKaonBGPtM02[iCut]->SetYTitle("#sigma_{long}^{2}");
2516  fTrueList[iCut]->Add(fHistoClustPhotonKaonBGPtM02[iCut]);
2517  fHistoClustPhotonK0lBGPtM02[iCut] = new TH2F("ESD_TrueClusPhotonK0lBG_Pt_M02", "ESD_TrueClusPhotonK0lBG_Pt_M02", nBinsClusterPt, arrClusPtBinning, 100, 0, 1);
2518  fHistoClustPhotonK0lBGPtM02[iCut]->SetXTitle("p_{T} (GeV/c)");
2519  fHistoClustPhotonK0lBGPtM02[iCut]->SetYTitle("#sigma_{long}^{2}");
2520  fTrueList[iCut]->Add(fHistoClustPhotonK0lBGPtM02[iCut]);
2521  fHistoClustPhotonNeutronBGPtM02[iCut] = new TH2F("ESD_TrueClusPhotonNeutronBG_Pt_M02", "ESD_TrueClusPhotonNeutronBG_Pt_M02", nBinsClusterPt, arrClusPtBinning, 100, 0, 1);
2522  fHistoClustPhotonNeutronBGPtM02[iCut]->SetXTitle("p_{T} (GeV/c)");
2523  fHistoClustPhotonNeutronBGPtM02[iCut]->SetYTitle("#sigma_{long}^{2}");
2524  fTrueList[iCut]->Add(fHistoClustPhotonNeutronBGPtM02[iCut]);
2525  fHistoClustPhotonRestBGPtM02[iCut] = new TH2F("ESD_TrueClusPhotonRestBG_Pt_M02", "ESD_TrueClusPhotonRestBG_Pt_M02", nBinsClusterPt, arrClusPtBinning, 100, 0, 1);
2526  fHistoClustPhotonRestBGPtM02[iCut]->SetXTitle("p_{T} (GeV/c)");
2527  fHistoClustPhotonRestBGPtM02[iCut]->SetYTitle("#sigma_{long}^{2}");
2528  fTrueList[iCut]->Add(fHistoClustPhotonRestBGPtM02[iCut]);
2529  fHistoClustPhotonPlusConvElectronBGPtM02[iCut]= new TH2F("ESD_TrueClusPhotonPlusConvElectronBG_Pt_M02", "ESD_TrueClusPhotonPlusConvElectronBG_Pt_M02", nBinsClusterPt, arrClusPtBinning, 100, 0, 1);
2530  fHistoClustPhotonPlusConvElectronBGPtM02[iCut]->SetXTitle("p_{T} (GeV/c)");
2531  fHistoClustPhotonPlusConvElectronBGPtM02[iCut]->SetYTitle("#sigma_{long}^{2}");
2533  fHistoClustPhotonPlusConvPionBGPtM02[iCut] = new TH2F("ESD_TrueClusPhotonPlusConvPionBG_Pt_M02", "ESD_TrueClusPhotonPlusConvPionBG_Pt_M02", nBinsClusterPt, arrClusPtBinning, 100, 0, 1);
2534  fHistoClustPhotonPlusConvPionBGPtM02[iCut]->SetXTitle("p_{T} (GeV/c)");
2535  fHistoClustPhotonPlusConvPionBGPtM02[iCut]->SetYTitle("#sigma_{long}^{2}");
2537  fHistoClustPhotonPlusConvKaonBGPtM02[iCut] = new TH2F("ESD_TrueClusPhotonPlusConvKaonBG_Pt_M02", "ESD_TrueClusPhotonPlusConvKaonBG_Pt_M02", nBinsClusterPt, arrClusPtBinning, 100, 0, 1);
2538  fHistoClustPhotonPlusConvKaonBGPtM02[iCut]->SetXTitle("p_{T} (GeV/c)");
2539  fHistoClustPhotonPlusConvKaonBGPtM02[iCut]->SetYTitle("#sigma_{long}^{2}");
2541  fHistoClustPhotonPlusConvK0lBGPtM02[iCut] = new TH2F("ESD_TrueClusPhotonPlusConvK0lBG_Pt_M02", "ESD_TrueClusPhotonPlusConvK0lBG_Pt_M02", nBinsClusterPt, arrClusPtBinning, 100, 0, 1);
2542  fHistoClustPhotonPlusConvK0lBGPtM02[iCut]->SetXTitle("p_{T} (GeV/c)");
2543  fHistoClustPhotonPlusConvK0lBGPtM02[iCut]->SetYTitle("#sigma_{long}^{2}");
2545  fHistoClustPhotonPlusConvNeutronBGPtM02[iCut] = new TH2F("ESD_TrueClusPhotonPlusConvNeutronBG_Pt_M02", "ESD_TrueClusPhotonPlusConvNeutronBG_Pt_M02", nBinsClusterPt, arrClusPtBinning, 100, 0, 1);
2546  fHistoClustPhotonPlusConvNeutronBGPtM02[iCut]->SetXTitle("p_{T} (GeV/c)");
2547  fHistoClustPhotonPlusConvNeutronBGPtM02[iCut]->SetYTitle("#sigma_{long}^{2}");
2549  fHistoClustPhotonPlusConvRestBGPtM02[iCut] = new TH2F("ESD_TrueClusPhotonPlusConvRestBG_Pt_M02", "ESD_TrueClusPhotonPlusConvRestBG_Pt_M02", nBinsClusterPt, arrClusPtBinning, 100, 0, 1);
2550  fHistoClustPhotonPlusConvRestBGPtM02[iCut]->SetXTitle("p_{T} (GeV/c)");
2551  fHistoClustPhotonPlusConvRestBGPtM02[iCut]->SetYTitle("#sigma_{long}^{2}");
2553  }
2554  }
2555  fHistoTrueClusGammaPt[iCut] = new TH1F("TrueClusGamma_Pt", "ESD_TrueClusGamma_Pt", nBinsClusterPt, arrClusPtBinning);
2556  fHistoTrueClusGammaPt[iCut]->SetXTitle("p_{T} (GeV/c)");
2557  fTrueList[iCut]->Add(fHistoTrueClusGammaPt[iCut]);
2558  if(!fDoLightOutput){
2559  if (fDoClusterQA > 0) {
2560  fHistoTrueClusGammaPtM02[iCut] = new TH2F("TrueClusGamma_Pt_M02", "TrueClusGamma_Pt_M02", nBinsClusterPt, arrClusPtBinning, 100, 0, 1);
2561  fHistoTrueClusGammaPtM02[iCut]->SetXTitle("p_{T} (GeV/c)");
2562  fHistoTrueClusGammaPtM02[iCut]->SetYTitle("#sigma_{long}^{2}");
2563  fTrueList[iCut]->Add(fHistoTrueClusGammaPtM02[iCut]);
2564  }
2565  fHistoTruePrimaryClusGammaPt[iCut] = new TH1F("TruePrimaryClusGamma_Pt", "ESD_TruePrimaryClusGamma_Pt", nBinsClusterPt, arrClusPtBinning);
2566  fHistoTruePrimaryClusGammaPt[iCut]->SetXTitle("p_{T} (GeV/c)");
2567  fTrueList[iCut]->Add(fHistoTruePrimaryClusGammaPt[iCut]);
2568  fHistoTruePrimaryClusGammaESDPtMCPt[iCut] = new TH2F("TruePrimaryClusGamma_Pt_MCPt", "ESD_TruePrimaryClusGamma_MCPt", nBinsClusterPt, arrClusPtBinning, nBinsClusterPt, arrClusPtBinning);
2569  fHistoTruePrimaryClusGammaESDPtMCPt[iCut]->SetXTitle("p_{T} (GeV/c)");
2570  fHistoTruePrimaryClusGammaESDPtMCPt[iCut]->SetYTitle("p_{T, MC} (GeV/c)");
2572  fHistoTruePrimaryClusConvGammaPt[iCut] = new TH1F("TruePrimaryClusConvGamma_Pt", "ESD_TruePrimaryClusConvGamma_Pt", nBinsClusterPt, arrClusPtBinning);
2573  fHistoTruePrimaryClusConvGammaPt[iCut]->SetXTitle("p_{T} (GeV/c)");
2574  fTrueList[iCut]->Add(fHistoTruePrimaryClusConvGammaPt[iCut]);
2575  fHistoTruePrimaryClusConvGammaESDPtMCPt[iCut] = new TH2F("TruePrimaryClusConvGamma_Pt_MCPt", "ESD_TruePrimaryClusConvGamma_MCPt", nBinsClusterPt, arrClusPtBinning, nBinsClusterPt, arrClusPtBinning);
2576  fHistoTruePrimaryClusConvGammaESDPtMCPt[iCut]->SetXTitle("p_{T} (GeV/c)");
2577  fHistoTruePrimaryClusConvGammaESDPtMCPt[iCut]->SetYTitle("p_{T, MC} (GeV/c)");
2579  fHistoTrueSecondaryClusGammaPt[iCut] = new TH2F("ESD_TrueSecondaryClusGamma_Pt", "ESD_TrueSecondaryClusGamma_Pt", nBinsClusterPt, arrClusPtBinning, 5, -0.5, 4.5);
2580  fHistoTrueSecondaryClusGammaPt[iCut]->SetXTitle("p_{T} (GeV/c)");
2581  fHistoTrueSecondaryClusGammaPt[iCut]->SetYTitle("source");
2582  fHistoTrueSecondaryClusGammaPt[iCut]->GetYaxis()->SetBinLabel( 1,"K0s");
2583  fHistoTrueSecondaryClusGammaPt[iCut]->GetYaxis()->SetBinLabel( 2,"K0l");
2584  fHistoTrueSecondaryClusGammaPt[iCut]->GetYaxis()->SetBinLabel( 3,"Lambda");
2585  fHistoTrueSecondaryClusGammaPt[iCut]->GetYaxis()->SetBinLabel( 4,"Eta");
2586  fHistoTrueSecondaryClusGammaPt[iCut]->GetYaxis()->SetBinLabel( 5,"rest");
2587  fTrueList[iCut]->Add(fHistoTrueSecondaryClusGammaPt[iCut]);
2588  fHistoTrueSecondaryClusConvGammaPt[iCut] = new TH2F("ESD_TrueSecondaryClusConvGamma_Pt", "ESD_TrueSecondaryClusConvGamma_Pt", nBinsClusterPt, arrClusPtBinning, 5, -0.5, 4.5);
2589  fHistoTrueSecondaryClusConvGammaPt[iCut]->SetXTitle("p_{T} (GeV/c)");
2590  fHistoTrueSecondaryClusConvGammaPt[iCut]->SetYTitle("source");
2591  fHistoTrueSecondaryClusConvGammaPt[iCut]->GetYaxis()->SetBinLabel( 1,"K0s");
2592  fHistoTrueSecondaryClusConvGammaPt[iCut]->GetYaxis()->SetBinLabel( 2,"K0l");
2593  fHistoTrueSecondaryClusConvGammaPt[iCut]->GetYaxis()->SetBinLabel( 3,"Lambda");
2594  fHistoTrueSecondaryClusConvGammaPt[iCut]->GetYaxis()->SetBinLabel( 4,"Eta");
2595  fHistoTrueSecondaryClusConvGammaPt[iCut]->GetYaxis()->SetBinLabel( 5,"rest");
2597  fHistoTrueSecondaryClusGammaMCPt[iCut] = new TH2F("ESD_TrueSecondaryClusGamma_MCPt", "ESD_TrueSecondaryClusGamma_MCPt", nBinsClusterPt, arrClusPtBinning, 5, -0.5, 4.5);
2598  fHistoTrueSecondaryClusGammaMCPt[iCut]->SetXTitle("p_{T, MC} (GeV/c)");
2599  fHistoTrueSecondaryClusGammaMCPt[iCut]->SetYTitle("source");
2600  fHistoTrueSecondaryClusGammaMCPt[iCut]->GetYaxis()->SetBinLabel( 1,"K0s");
2601  fHistoTrueSecondaryClusGammaMCPt[iCut]->GetYaxis()->SetBinLabel( 2,"K0l");
2602  fHistoTrueSecondaryClusGammaMCPt[iCut]->GetYaxis()->SetBinLabel( 3,"Lambda");
2603  fHistoTrueSecondaryClusGammaMCPt[iCut]->GetYaxis()->SetBinLabel( 4,"Eta");
2604  fHistoTrueSecondaryClusGammaMCPt[iCut]->GetYaxis()->SetBinLabel( 5,"rest");
2605  fTrueList[iCut]->Add(fHistoTrueSecondaryClusGammaMCPt[iCut]);
2606  fHistoTrueSecondaryClusConvGammaMCPt[iCut] = new TH2F("ESD_TrueSecondaryClusConvGamma_MCPt", "ESD_TrueSecondaryClusConvGamma_MCPt", nBinsClusterPt, arrClusPtBinning, 5, -0.5, 4.5);
2607  fHistoTrueSecondaryClusConvGammaMCPt[iCut]->SetXTitle("p_{T, MC} (GeV/c)");
2608  fHistoTrueSecondaryClusConvGammaMCPt[iCut]->SetYTitle("source");
2609  fHistoTrueSecondaryClusConvGammaMCPt[iCut]->GetYaxis()->SetBinLabel( 1,"K0s");
2610  fHistoTrueSecondaryClusConvGammaMCPt[iCut]->GetYaxis()->SetBinLabel( 2,"K0l");
2611  fHistoTrueSecondaryClusConvGammaMCPt[iCut]->GetYaxis()->SetBinLabel( 3,"Lambda");
2612  fHistoTrueSecondaryClusConvGammaMCPt[iCut]->GetYaxis()->SetBinLabel( 4,"Eta");
2613  fHistoTrueSecondaryClusConvGammaMCPt[iCut]->GetYaxis()->SetBinLabel( 5,"rest");
2615 
2616  fHistoTrueSecondaryClusGammaFromXFromK0sMCPtESDPt[iCut] = new TH2F("ESD_TrueSecondaryClusGammaFromXFromK0s_MCPt_Pt", "ESD_TrueSecondaryClusGammaFromXFromK0s_MCPt_Pt",
2617  nBinsClusterPt, arrClusPtBinning, nBinsClusterPt, arrClusPtBinning);
2618  fHistoTrueSecondaryClusGammaFromXFromK0sMCPtESDPt[iCut]->SetXTitle("p_{T, MC} (GeV/c)");
2619  fHistoTrueSecondaryClusGammaFromXFromK0sMCPtESDPt[iCut]->SetYTitle("p_{T} (GeV/c)");
2621  fHistoTrueSecondaryClusConvGammaFromXFromK0sMCPtESDPt[iCut] = new TH2F("ESD_TrueSecondaryClusConvGammaFromXFromK0s_MCPt_Pt", "ESD_TrueSecondaryClusConvGammaFromXFromK0s_MCPt_Pt",
2622  nBinsClusterPt, arrClusPtBinning, nBinsClusterPt, arrClusPtBinning);
2623  fHistoTrueSecondaryClusConvGammaFromXFromK0sMCPtESDPt[iCut]->SetXTitle("p_{T, MC} (GeV/c)");
2624  fHistoTrueSecondaryClusConvGammaFromXFromK0sMCPtESDPt[iCut]->SetYTitle("p_{T} (GeV/c)");
2626  fHistoTrueSecondaryClusGammaFromXFromK0lMCPtESDPt[iCut] = new TH2F("ESD_TrueSecondaryClusGammaFromXFromK0l_MCPt_Pt", "ESD_TrueSecondaryClusGammaFromXFromK0l_MCPt_Pt",
2627  nBinsClusterPt, arrClusPtBinning, nBinsClusterPt, arrClusPtBinning);
2628  fHistoTrueSecondaryClusGammaFromXFromK0lMCPtESDPt[iCut]->SetXTitle("p_{T, MC} (GeV/c)");
2629  fHistoTrueSecondaryClusGammaFromXFromK0lMCPtESDPt[iCut]->SetYTitle("p_{T} (GeV/c)");
2631  fHistoTrueSecondaryClusConvGammaFromXFromK0lMCPtESDPt[iCut] = new TH2F("ESD_TrueSecondaryClusConvGammaFromXFromK0l_MCPt_Pt", "ESD_TrueSecondaryClusConvGammaFromXFromK0l_MCPt_Pt",
2632  nBinsClusterPt, arrClusPtBinning, nBinsClusterPt, arrClusPtBinning);
2633  fHistoTrueSecondaryClusConvGammaFromXFromK0lMCPtESDPt[iCut]->SetXTitle("p_{T, MC} (GeV/c)");
2634  fHistoTrueSecondaryClusConvGammaFromXFromK0lMCPtESDPt[iCut]->SetYTitle("p_{T} (GeV/c)");
2636  fHistoTrueSecondaryClusGammaFromXFromLambdaMCPtESDPt[iCut] = new TH2F("ESD_TrueSecondaryClusGammaFromXFromLambda_MCPt_Pt", "ESD_TrueSecondaryClusGammaFromXFromLambda_MCPt_Pt",
2637  nBinsClusterPt, arrClusPtBinning, nBinsClusterPt, arrClusPtBinning);
2638  fHistoTrueSecondaryClusGammaFromXFromLambdaMCPtESDPt[iCut]->SetXTitle("p_{T, MC} (GeV/c)");
2639  fHistoTrueSecondaryClusGammaFromXFromLambdaMCPtESDPt[iCut]->SetYTitle("p_{T} (GeV/c)");
2641  fHistoTrueSecondaryClusConvGammaFromXFromLambdaMCPtESDPt[iCut] = new TH2F("ESD_TrueSecondaryClusConvGammaFromXFromLambda_MCPt_Pt", "ESD_TrueSecondaryClusConvGammaFromXFromLambda_MCPt_Pt",
2642  nBinsClusterPt, arrClusPtBinning, nBinsClusterPt, arrClusPtBinning);
2643  fHistoTrueSecondaryClusConvGammaFromXFromLambdaMCPtESDPt[iCut]->SetXTitle("p_{T, MC} (GeV/c)");
2644  fHistoTrueSecondaryClusConvGammaFromXFromLambdaMCPtESDPt[iCut]->SetYTitle("p_{T} (GeV/c)");
2646 
2647  fHistoTrueNLabelsInClus[iCut] = new TH1F("TrueNLabelsInClus", "TrueNLabelsInClus", 100, -0.5, 99.5);
2648  fHistoTrueNLabelsInClus[iCut]->SetXTitle("# labels");
2649  fTrueList[iCut]->Add(fHistoTrueNLabelsInClus[iCut]);
2650  }
2651  fHistoDoubleCountTrueClusterGammaPt[iCut] = new TH2F("TrueDoubleCountClusterGamma_Pt", "TrueDoubleCountClusterGamma_Pt", nBinsClusterPt, arrClusPtBinning, 2, 0, 2);
2652  fHistoDoubleCountTrueClusterGammaPt[iCut]->SetXTitle("p_{T} (GeV/c)");
2654  fHistoMultipleCountTrueClusterGamma[iCut] = new TH1F("TrueMultipleCountClusterGamma", "TrueMultipleCountClusterGamma", 10, 1, 11);
2655  fHistoMultipleCountTrueClusterGamma[iCut]->SetXTitle("# multiple");
2657 
2658  if (fIsMC > 1){
2659  fHistoTrueClusGammaPt[iCut]->Sumw2();
2660  fHistoDoubleCountTrueClusterGammaPt[iCut]->Sumw2();
2661  fHistoMultipleCountTrueClusterGamma[iCut]->Sumw2();
2662  if(!fDoLightOutput){
2663  fHistoTrueNLabelsInClus[iCut]->Sumw2();
2664  if (fDoClusterQA > 0) fHistoTrueClusGammaPtM02[iCut]->Sumw2();
2665  fHistoTruePrimaryClusGammaPt[iCut]->Sumw2();
2666  fHistoTruePrimaryClusGammaESDPtMCPt[iCut]->Sumw2();
2667  fHistoTruePrimaryClusConvGammaPt[iCut]->Sumw2();
2669  fHistoTrueSecondaryClusGammaPt[iCut]->Sumw2();
2670  fHistoTrueSecondaryClusConvGammaPt[iCut]->Sumw2();
2671  fHistoTrueSecondaryClusGammaMCPt[iCut]->Sumw2();
2672  fHistoTrueSecondaryClusConvGammaMCPt[iCut]->Sumw2();
2679  }
2680  }
2681 
2682  if (fDoClusterQA > 0){
2683  fHistoTrueClusUnConvGammaPt[iCut] = new TH1F("TrueClusUnConvGamma_Pt", "TrueClusUnConvGamma_Pt", nBinsClusterPt, arrClusPtBinning);
2684  fHistoTrueClusUnConvGammaPt[iCut]->SetXTitle("p_{T} (GeV/c)");
2685  fTrueList[iCut]->Add(fHistoTrueClusUnConvGammaPt[iCut]);
2686  fHistoTrueClusUnConvGammaMCPt[iCut] = new TH1F("TrueClusUnConvGamma_MCPt", "TrueClusUnConvGamma_MCPt", nBinsClusterPt, arrClusPtBinning);
2687  fHistoTrueClusUnConvGammaMCPt[iCut]->SetXTitle("p_{T, MC} (GeV/c)");
2688  fTrueList[iCut]->Add(fHistoTrueClusUnConvGammaMCPt[iCut]);
2689  if (!fDoLightOutput) {
2690  fHistoTrueClusUnConvGammaPtM02[iCut] = new TH2F("TrueClusUnConvGamma_Pt_M02", "TrueClusUnConvGamma_Pt_M02", nBinsClusterPt, arrClusPtBinning, 100, 0, 1);
2691  fHistoTrueClusUnConvGammaPtM02[iCut]->SetXTitle("p_{T, MC} (GeV/c)");
2692  fHistoTrueClusUnConvGammaPtM02[iCut]->SetYTitle("#sigma_{long}^{2}");
2693  fTrueList[iCut]->Add(fHistoTrueClusUnConvGammaPtM02[iCut]);
2694  }
2695  fHistoTrueClusElectronPt[iCut] = new TH1F("TrueClusElectron_Pt", "TrueElectronGamma_Pt", nBinsClusterPt, arrClusPtBinning);
2696  fHistoTrueClusElectronPt[iCut]->SetXTitle("p_{T} (GeV/c)");
2697  fTrueList[iCut]->Add(fHistoTrueClusElectronPt[iCut]);
2698  fHistoTrueClusConvGammaPt[iCut] = new TH1F("TrueClusConvGamma_Pt", "TrueClusConvGamma_Pt", nBinsClusterPt, arrClusPtBinning);
2699  fHistoTrueClusConvGammaPt[iCut]->SetXTitle("p_{T} (GeV/c)");
2700  fTrueList[iCut]->Add(fHistoTrueClusConvGammaPt[iCut]);
2701  fHistoTrueClusConvGammaMCPt[iCut] = new TH1F("TrueClusConvGamma_MCPt", "TrueClusConvGamma_MCPt", nBinsClusterPt, arrClusPtBinning);
2702  fHistoTrueClusConvGammaMCPt[iCut]->SetXTitle("p_{T, MC} (GeV/c)");
2703  fTrueList[iCut]->Add(fHistoTrueClusConvGammaMCPt[iCut]);
2704  fHistoTrueClusConvGammaFullyPt[iCut] = new TH1F("TrueClusConvGammaFullyContained_Pt", "TrueClusConvGammaFullyContained_Pt", nBinsClusterPt, arrClusPtBinning);
2705  fHistoTrueClusConvGammaFullyPt[iCut]->SetXTitle("p_{T} (GeV/c)");
2706  fTrueList[iCut]->Add(fHistoTrueClusConvGammaFullyPt[iCut]);
2707  fHistoTrueClusMergedGammaPt[iCut] = new TH1F("TrueClusMergedGamma_Pt", "TrueClusMergedGamma_Pt", nBinsClusterPt, arrClusPtBinning);
2708  fHistoTrueClusMergedGammaPt[iCut]->SetXTitle("p_{T} (GeV/c)");
2709  fTrueList[iCut]->Add(fHistoTrueClusMergedGammaPt[iCut]);
2710  fHistoTrueClusMergedPartConvGammaPt[iCut] = new TH1F("TrueClusMergedPartConvGamma_Pt", "TrueClusMergedPartConvGamma_Pt", nBinsClusterPt, arrClusPtBinning);
2711  fHistoTrueClusMergedPartConvGammaPt[iCut]->SetXTitle("p_{T} (GeV/c)");
2713  fHistoTrueClusDalitzPt[iCut] = new TH1F("TrueClusDalitz_Pt", "TrueClusDalitz_Pt", nBinsClusterPt, arrClusPtBinning);
2714  fHistoTrueClusDalitzPt[iCut]->SetXTitle("p_{T} (GeV/c)");
2715  fTrueList[iCut]->Add(fHistoTrueClusDalitzPt[iCut]);
2716  fHistoTrueClusDalitzMergedPt[iCut] = new TH1F("TrueClusDalitzMerged_Pt", "TrueClusDalitzMerged_Pt", nBinsClusterPt, arrClusPtBinning);
2717  fHistoTrueClusDalitzMergedPt[iCut]->SetXTitle("p_{T} (GeV/c)");
2718  fTrueList[iCut]->Add(fHistoTrueClusDalitzMergedPt[iCut]);
2719  fHistoTrueClusPhotonFromElecMotherPt[iCut] = new TH1F("TrueClusPhotonFromElecMother_Pt", "TrueClusPhotonFromElecMother_Pt", nBinsClusterPt, arrClusPtBinning);
2720  fHistoTrueClusPhotonFromElecMotherPt[iCut]->SetXTitle("p_{T} (GeV/c)");
2722  fHistoTrueClusShowerPt[iCut] = new TH1F("TrueClusShower_Pt", "TrueClusShower_Pt", nBinsClusterPt, arrClusPtBinning);
2723  fHistoTrueClusShowerPt[iCut]->SetXTitle("p_{T} (GeV/c)");
2724  fTrueList[iCut]->Add(fHistoTrueClusShowerPt[iCut]);
2725  fHistoTrueClusSubLeadingPt[iCut] = new TH1F("TrueClusSubleading_Pt", "TrueClusSubleading_Pt", nBinsClusterPt, arrClusPtBinning);
2726  fHistoTrueClusSubLeadingPt[iCut]->SetXTitle("p_{T} (GeV/c)");
2727  fTrueList[iCut]->Add(fHistoTrueClusSubLeadingPt[iCut]);
2728  fHistoTrueClusNParticles[iCut] = new TH1F("TrueClusNParticles", "TrueClusNParticles", 20, 0, 20);
2729  fHistoTrueClusNParticles[iCut]->SetXTitle("#particles");
2730  fTrueList[iCut]->Add(fHistoTrueClusNParticles[iCut]);
2731  fHistoTrueClusEMNonLeadingPt[iCut] = new TH1F("TrueClusEMNonLeading_Pt", "TrueClusEMNonLeading_Pt", nBinsClusterPt, arrClusPtBinning);
2732  fHistoTrueClusEMNonLeadingPt[iCut]->SetXTitle("p_{T} (GeV/c)");
2733  fTrueList[iCut]->Add(fHistoTrueClusEMNonLeadingPt[iCut]);
2734 
2735  if (fIsMC > 1){
2736  fHistoTrueClusUnConvGammaPt[iCut]->Sumw2();
2737  fHistoTrueClusUnConvGammaMCPt[iCut]->Sumw2();
2738  if (!fDoLightOutput)
2739  fHistoTrueClusUnConvGammaPtM02[iCut]->Sumw2();
2740  fHistoTrueClusElectronPt[iCut]->Sumw2();
2741  fHistoTrueClusConvGammaPt[iCut]->Sumw2();
2742  fHistoTrueClusConvGammaMCPt[iCut]->Sumw2();
2743  fHistoTrueClusConvGammaFullyPt[iCut]->Sumw2();
2744  fHistoTrueClusMergedGammaPt[iCut]->Sumw2();
2745  fHistoTrueClusMergedPartConvGammaPt[iCut]->Sumw2();
2746  fHistoTrueClusDalitzPt[iCut]->Sumw2();
2747  fHistoTrueClusDalitzMergedPt[iCut]->Sumw2();
2748  fHistoTrueClusPhotonFromElecMotherPt[iCut]->Sumw2();
2749  fHistoTrueClusShowerPt[iCut]->Sumw2();
2750  fHistoTrueClusSubLeadingPt[iCut]->Sumw2();
2751  fHistoTrueClusNParticles[iCut]->Sumw2();
2752  fHistoTrueClusEMNonLeadingPt[iCut]->Sumw2();
2753  }
2754  }
2755  if(fDoMesonAnalysis){
2756  fHistoTruePi0InvMassPt[iCut] = new TH2F("ESD_TruePi0_InvMass_Pt", "ESD_TruePi0_InvMass_Pt", nBinsMinv, 0, maxMinv, nBinsPt, arrPtBinning);
2757  fHistoTruePi0InvMassPt[iCut]->SetYTitle("p_{T} (GeV/c)");
2758  fHistoTruePi0InvMassPt[iCut]->SetXTitle("M_{#gamma#gamma} (GeV/c^{2})");
2759  fTrueList[iCut]->Add(fHistoTruePi0InvMassPt[iCut]);
2760  fHistoDoubleCountTruePi0InvMassPt[iCut] = new TH2F("ESD_TrueDoubleCountPi0_InvMass_Pt", "ESD_TrueDoubleCountPi0_InvMass_Pt", nBinsMinv, 0, maxMinv, nBinsPt, arrPtBinning);
2761  fHistoDoubleCountTruePi0InvMassPt[iCut]->SetYTitle("p_{T} (GeV/c)");
2762  fHistoDoubleCountTruePi0InvMassPt[iCut]->SetXTitle("M_{#gamma#gamma} (GeV/c^{2})");
2763  fTrueList[iCut]->Add(fHistoDoubleCountTruePi0InvMassPt[iCut]);
2764  if( !fDoPi0Only ){
2765  fHistoTrueEtaInvMassPt[iCut] = new TH2F("ESD_TrueEta_InvMass_Pt", "ESD_TrueEta_InvMass_Pt", nBinsMinv, 0, maxMinv, nBinsPt, arrPtBinning);
2766  fHistoTrueEtaInvMassPt[iCut]->SetYTitle("p_{T} (GeV/c)");
2767  fHistoTrueEtaInvMassPt[iCut]->SetXTitle("M_{#gamma#gamma} (GeV/c^{2})");
2768  fTrueList[iCut]->Add(fHistoTrueEtaInvMassPt[iCut]);
2769  fHistoDoubleCountTrueEtaInvMassPt[iCut] = new TH2F("ESD_TrueDoubleCountEta_InvMass_Pt", "ESD_TrueDoubleCountEta_InvMass_Pt", nBinsMinv, 0, maxMinv, nBinsPt, arrPtBinning);
2770  fHistoDoubleCountTrueEtaInvMassPt[iCut]->SetYTitle("p_{T} (GeV/c)");
2771  fHistoDoubleCountTrueEtaInvMassPt[iCut]->SetXTitle("M_{#gamma#gamma} (GeV/c^{2})");
2772  fTrueList[iCut]->Add(fHistoDoubleCountTrueEtaInvMassPt[iCut]);
2773  fHistoTruePrimaryEtaInvMassPt[iCut] = new TH2F("ESD_TruePrimaryEta_InvMass_Pt", "ESD_TruePrimaryEta_InvMass_Pt", nBinsMinv, 0, maxMinv, nBinsPt, arrPtBinning);
2774  fHistoTruePrimaryEtaInvMassPt[iCut]->SetYTitle("p_{T} (GeV/c)");
2775  fHistoTruePrimaryEtaInvMassPt[iCut]->SetXTitle("M_{#gamma#gamma} (GeV/c^{2})");
2776  fHistoTruePrimaryEtaInvMassPt[iCut]->Sumw2();
2777  fTrueList[iCut]->Add(fHistoTruePrimaryEtaInvMassPt[iCut]);
2778  fHistoTruePrimaryEtaW0WeightingInvMassPt[iCut] = new TH2F("ESD_TruePrimaryEtaW0Weights_InvMass_Pt", "ESD_TruePrimaryEtaW0Weights_InvMass_Pt", nBinsMinv, 0, maxMinv, nBinsPt, arrPtBinning);
2779  fHistoTruePrimaryEtaW0WeightingInvMassPt[iCut]->SetYTitle("p_{T} (GeV/c)");
2780  fHistoTruePrimaryEtaW0WeightingInvMassPt[iCut]->SetXTitle("M_{#gamma#gamma} (GeV/c^{2})");
2783  fProfileTruePrimaryEtaWeightsInvMassPt[iCut] = new TProfile2D("ESD_TruePrimaryEtaWeights_InvMass_Pt", "ESD_TruePrimaryEtaWeights_InvMass_Pt", nBinsMinv, 0, maxMinv, nBinsPt, arrPtBinning);
2784  fProfileTruePrimaryEtaWeightsInvMassPt[iCut]->SetYTitle("p_{T} (GeV/c)");
2785  fProfileTruePrimaryEtaWeightsInvMassPt[iCut]->SetXTitle("M_{#gamma#gamma} (GeV/c^{2})");
2788  }
2789  fHistoTruePrimaryPi0InvMassPt[iCut] = new TH2F("ESD_TruePrimaryPi0_InvMass_Pt", "ESD_TruePrimaryPi0_InvMass_Pt", nBinsMinv, 0, maxMinv, nBinsPt, arrPtBinning);
2790  fHistoTruePrimaryPi0InvMassPt[iCut]->SetYTitle("p_{T} (GeV/c)");
2791  fHistoTruePrimaryPi0InvMassPt[iCut]->SetXTitle("M_{#gamma#gamma} (GeV/c^{2})");
2792  fHistoTruePrimaryPi0InvMassPt[iCut]->Sumw2();
2793  fTrueList[iCut]->Add(fHistoTruePrimaryPi0InvMassPt[iCut]);
2794  fHistoTruePrimaryPi0W0WeightingInvMassPt[iCut] = new TH2F("ESD_TruePrimaryPi0W0Weights_InvMass_Pt", "ESD_TruePrimaryPi0W0Weights_InvMass_Pt", nBinsMinv, 0, maxMinv, nBinsPt, arrPtBinning);
2795  fHistoTruePrimaryPi0W0WeightingInvMassPt[iCut]->SetYTitle("p_{T} (GeV/c)");
2796  fHistoTruePrimaryPi0W0WeightingInvMassPt[iCut]->SetXTitle("M_{#gamma#gamma} (GeV/c^{2})");
2799  fProfileTruePrimaryPi0WeightsInvMassPt[iCut] = new TProfile2D("ESD_TruePrimaryPi0Weights_InvMass_Pt", "ESD_TruePrimaryPi0Weights_InvMass_Pt", nBinsMinv, 0, maxMinv, nBinsPt, arrPtBinning);
2800  fProfileTruePrimaryPi0WeightsInvMassPt[iCut]->SetYTitle("p_{T} (GeV/c)");
2801  fProfileTruePrimaryPi0WeightsInvMassPt[iCut]->SetXTitle("M_{#gamma#gamma} (GeV/c^{2})");
2804  fHistoTrueSecondaryPi0InvMassPt[iCut] = new TH2F("ESD_TrueSecondaryPi0_InvMass_Pt", "ESD_TrueSecondaryPi0_InvMass_Pt", nBinsMinv, 0, maxMinv, nBinsPt, arrPtBinning);
2805  fHistoTrueSecondaryPi0InvMassPt[iCut]->SetYTitle("p_{T} (GeV/c)");
2806  fHistoTrueSecondaryPi0InvMassPt[iCut]->SetXTitle("M_{#gamma#gamma} (GeV/c^{2})");
2807  fHistoTrueSecondaryPi0InvMassPt[iCut]->Sumw2();
2808  fTrueList[iCut]->Add(fHistoTrueSecondaryPi0InvMassPt[iCut]);
2809 
2810  if(!fDoLightOutput){
2811  fHistoTruePi0InvMassPtAlpha[iCut] = new TH2F("ESD_TruePi0_InvMass_vs_Pt_Alpha", "ESD_TruePi0_InvMass_vs_Pt_Alpha", nBinsMinv, 0, maxMinv, nBinsPt, arrPtBinning);
2812  fHistoTruePi0InvMassPtAlpha[iCut]->SetYTitle("p_{T} (GeV/c)");
2813  fHistoTruePi0InvMassPtAlpha[iCut]->SetXTitle("M_{#gamma#gamma} (GeV/c^{2})");
2814  fHistoTruePi0InvMassPtAlpha[iCut]->Sumw2();
2815  fESDList[iCut]->Add(fHistoTruePi0InvMassPtAlpha[iCut]);
2816  fHistoTruePi0PureGammaInvMassPtAlpha[iCut] = new TH2F("ESD_TruePi0PureGamma_InvMass_vs_Pt_Alpha", "ESD_TruePi0PureGamma_InvMass_vs_Pt_Alpha", nBinsMinv, 0, maxMinv, nBinsPt, arrPtBinning);
2817  fHistoTruePi0PureGammaInvMassPtAlpha[iCut]->SetYTitle("p_{T} (GeV/c)");
2818  fHistoTruePi0PureGammaInvMassPtAlpha[iCut]->SetXTitle("M_{#gamma#gamma} (GeV/c^{2})");
2819  fHistoTruePi0PureGammaInvMassPtAlpha[iCut]->Sumw2();
2821  }
2822  fHistoTrueSecondaryPi0FromK0sInvMassPt[iCut] = new TH2F("ESD_TrueSecondaryPi0FromK0s_InvMass_Pt", "ESD_TrueSecondaryPi0FromK0s_InvMass_Pt", nBinsMinv, 0, maxMinv, nBinsPt, arrPtBinning);
2823  fHistoTrueSecondaryPi0FromK0sInvMassPt[iCut]->SetYTitle("p_{T} (GeV/c)");
2824  fHistoTrueSecondaryPi0FromK0sInvMassPt[iCut]->SetXTitle("M_{#gamma#gamma} (GeV/c^{2})");
2827  fHistoTrueSecondaryPi0FromK0lInvMassPt[iCut] = new TH2F("ESD_TrueSecondaryPi0FromK0l_InvMass_Pt", "ESD_TrueSecondaryPi0FromK0l_InvMass_Pt", nBinsMinv, 0, maxMinv, nBinsPt, arrPtBinning);
2828  fHistoTrueSecondaryPi0FromK0lInvMassPt[iCut]->SetYTitle("p_{T} (GeV/c)");
2829  fHistoTrueSecondaryPi0FromK0lInvMassPt[iCut]->SetXTitle("M_{#gamma#gamma} (GeV/c^{2})");
2832  fHistoTrueSecondaryPi0FromEtaInvMassPt[iCut] = new TH2F("ESD_TrueSecondaryPi0FromEta_InvMass_Pt", "ESD_TrueSecondaryPi0FromEta_InvMass_Pt", nBinsMinv, 0, maxMinv, nBinsPt, arrPtBinning);
2833  fHistoTrueSecondaryPi0FromEtaInvMassPt[iCut]->SetYTitle("p_{T} (GeV/c)");
2834  fHistoTrueSecondaryPi0FromEtaInvMassPt[iCut]->SetXTitle("M_{#gamma#gamma} (GeV/c^{2})");
2836  fHistoTrueSecondaryPi0FromLambdaInvMassPt[iCut] = new TH2F("ESD_TrueSecondaryPi0FromLambda_InvMass_Pt", "ESD_TrueSecondaryPi0FromLambda_InvMass_Pt", nBinsMinv, 0, maxMinv, nBinsPt, arrPtBinning);
2837  fHistoTrueSecondaryPi0FromLambdaInvMassPt[iCut]->SetYTitle("p_{T} (GeV/c)");
2838  fHistoTrueSecondaryPi0FromLambdaInvMassPt[iCut]->SetXTitle("M_{#gamma#gamma} (GeV/c^{2})");
2840  if (fIsMC > 1){
2841  fHistoTruePi0InvMassPt[iCut]->Sumw2();
2842  fHistoDoubleCountTruePi0InvMassPt[iCut]->Sumw2();
2846  if( !fDoPi0Only ){
2847  fHistoTrueEtaInvMassPt[iCut]->Sumw2();
2848  fHistoDoubleCountTrueEtaInvMassPt[iCut]->Sumw2();
2850  }
2851  }
2852 
2853  if (fDoMesonQA > 0 && fDoMesonQA < 3){
2854  if (fIsMC < 2){
2855 
2856  fHistoTruePi0CaloPhotonInvMassPt[iCut] = new TH2F("ESD_TruePi0CaloPhoton_InvMass_Pt", "ESD_TruePi0CaloPhoton_InvMass_Pt", nBinsMinv, 0, maxMinv, nBinsPt, arrPtBinning);
2857  fHistoTruePi0CaloPhotonInvMassPt[iCut]->SetYTitle("p_{T} (GeV/c)");
2858  fHistoTruePi0CaloPhotonInvMassPt[iCut]->SetXTitle("M_{#gamma#gamma} (GeV/c^{2})");
2859  fTrueList[iCut]->Add(fHistoTruePi0CaloPhotonInvMassPt[iCut]);
2860  if( !fDoPi0Only ){
2861  fHistoTrueEtaCaloPhotonInvMassPt[iCut] = new TH2F("ESD_TrueEtaCaloPhoton_InvMass_Pt", "ESD_TrueEtaCaloPhoton_InvMass_Pt", nBinsMinv, 0, maxMinv, nBinsPt, arrPtBinning);
2862  fHistoTrueEtaCaloPhotonInvMassPt[iCut]->SetYTitle("p_{T} (GeV/c)");
2863  fHistoTrueEtaCaloPhotonInvMassPt[iCut]->SetXTitle("M_{#gamma#gamma} (GeV/c^{2})");
2864  fTrueList[iCut]->Add(fHistoTrueEtaCaloPhotonInvMassPt[iCut]);
2865  fHistoTrueEtaCaloMixedPhotonConvPhotonInvMassPt[iCut] = new TH2F("ESD_TrueEtaCaloMixedPhotonConvertedPhoton_InvMass_Pt", "ESD_TrueEtaCaloMixedPhotonConvertedPhoton_InvMass_Pt", nBinsMinv, 0, maxMinv,
2866  nBinsPt, arrPtBinning);
2867  fHistoTrueEtaCaloMixedPhotonConvPhotonInvMassPt[iCut]->SetYTitle("p_{T} (GeV/c)");
2868  fHistoTrueEtaCaloMixedPhotonConvPhotonInvMassPt[iCut]->SetXTitle("M_{#gamma#gamma} (GeV/c^{2})");
2870  fHistoTrueEtaCaloConvertedPhotonInvMassPt[iCut] = new TH2F("ESD_TrueEtaCaloConvertedPhoton_InvMass_Pt", "ESD_TrueEtaCaloConvertedPhoton_InvMass_Pt", nBinsMinv, 0, maxMinv, nBinsPt, arrPtBinning);
2871  fHistoTrueEtaCaloConvertedPhotonInvMassPt[iCut]->SetYTitle("p_{T} (GeV/c)");
2872  fHistoTrueEtaCaloConvertedPhotonInvMassPt[iCut]->SetXTitle("M_{#gamma#gamma} (GeV/c^{2})");
2874  fHistoTrueEtaCaloElectronInvMassPt[iCut] = new TH2F("ESD_TrueEtaCaloElectron_InvMass_Pt", "ESD_TrueEtaCaloElectron_InvMass_Pt", nBinsMinv, 0, maxMinv, nBinsPt, arrPtBinning);
2875  fHistoTrueEtaCaloElectronInvMassPt[iCut]->SetYTitle("p_{T} (GeV/c)");
2876  fHistoTrueEtaCaloElectronInvMassPt[iCut]->SetXTitle("M_{#gamma#gamma} (GeV/c^{2})");
2878  fHistoTrueEtaCaloMergedClusterInvMassPt[iCut] = new TH2F("ESD_TrueEtaCaloMergedCluster_InvMass_Pt", "ESD_TrueEtaCaloMergedCluster_InvMass_Pt", nBinsMinv, 0, maxMinv, nBinsPt, arrPtBinning);
2879  fHistoTrueEtaCaloMergedClusterInvMassPt[iCut]->SetYTitle("p_{T} (GeV/c)");
2880  fHistoTrueEtaCaloMergedClusterInvMassPt[iCut]->SetXTitle("M_{#gamma#gamma} (GeV/c^{2})");
2882  fHistoTrueEtaCaloMergedClusterPartConvInvMassPt[iCut] = new TH2F("ESD_TrueEtaCaloMergedClusterPartConv_InvMass_Pt", "ESD_TrueEtaCaloMergedClusterPartConv_InvMass_Pt", nBinsMinv, 0, maxMinv,
2883  nBinsPt, arrPtBinning);
2884  fHistoTrueEtaCaloMergedClusterPartConvInvMassPt[iCut]->SetYTitle("p_{T} (GeV/c)");
2885  fHistoTrueEtaCaloMergedClusterPartConvInvMassPt[iCut]->SetXTitle("M_{#gamma#gamma} (GeV/c^{2})");
2887  fHistoTruePrimaryEtaMCPtResolPt[iCut] = new TH2F("ESD_TruePrimaryEta_MCPt_ResolPt", "ESD_TruePrimaryEta_ResolPt_MCPt", 500, 0.03, 35, 1000, -1., 1.);
2888  fHistoTruePrimaryEtaMCPtResolPt[iCut]->SetXTitle("p_{T, MC} (GeV/c)");
2889  fHistoTruePrimaryEtaMCPtResolPt[iCut]->SetXTitle("#delta (p_{T}) (GeV/c)");
2890  fHistoTruePrimaryEtaMCPtResolPt[iCut]->Sumw2();
2892  fTrueList[iCut]->Add(fHistoTruePrimaryEtaMCPtResolPt[iCut]);
2893  }
2894  fHistoTruePi0CaloMixedPhotonConvPhotonInvMassPt[iCut] = new TH2F("ESD_TruePi0CaloMixedPhotonConvertedPhoton_InvMass_Pt", "ESD_TruePi0CaloMixedPhotonConvertedPhoton_InvMass_Pt", nBinsMinv, 0, maxMinv,
2895  nBinsPt, arrPtBinning);
2896  fHistoTruePi0CaloMixedPhotonConvPhotonInvMassPt[iCut]->SetYTitle("p_{T} (GeV/c)");
2897  fHistoTruePi0CaloMixedPhotonConvPhotonInvMassPt[iCut]->SetXTitle("M_{#gamma#gamma} (GeV/c^{2})");
2899  fHistoTruePi0CaloConvertedPhotonInvMassPt[iCut] = new TH2F("ESD_TruePi0CaloConvertedPhoton_InvMass_Pt", "ESD_TruePi0CaloConvertedPhoton_InvMass_Pt", nBinsMinv, 0, maxMinv, nBinsPt, arrPtBinning);
2900  fHistoTruePi0CaloConvertedPhotonInvMassPt[iCut]->SetYTitle("p_{T} (GeV/c)");
2901  fHistoTruePi0CaloConvertedPhotonInvMassPt[iCut]->SetXTitle("M_{#gamma#gamma} (GeV/c^{2})");
2903  fHistoTruePi0CaloElectronInvMassPt[iCut] = new TH2F("ESD_TruePi0CaloElectron_InvMass_Pt", "ESD_TruePi0CaloElectron_InvMass_Pt", nBinsMinv, 0, maxMinv, nBinsPt, arrPtBinning);
2904  fHistoTruePi0CaloElectronInvMassPt[iCut]->SetYTitle("p_{T} (GeV/c)");
2905  fHistoTruePi0CaloElectronInvMassPt[iCut]->SetXTitle("M_{#gamma#gamma} (GeV/c^{2})");
2907  fHistoTruePi0CaloMergedClusterInvMassPt[iCut] = new TH2F("ESD_TruePi0CaloMergedCluster_InvMass_Pt", "ESD_TruePi0CaloMergedCluster_InvMass_Pt", nBinsMinv, 0, maxMinv, nBinsPt, arrPtBinning);
2908  fHistoTruePi0CaloMergedClusterInvMassPt[iCut]->SetYTitle("p_{T} (GeV/c)");
2909  fHistoTruePi0CaloMergedClusterInvMassPt[iCut]->SetXTitle("M_{#gamma#gamma} (GeV/c^{2})");
2911  fHistoTruePi0CaloMergedClusterPartConvInvMassPt[iCut] = new TH2F("ESD_TruePi0CaloMergedClusterPartConv_InvMass_Pt", "ESD_TruePi0CaloMergedClusterPartConv_InvMass_Pt", nBinsMinv, 0, maxMinv,
2912  nBinsPt, arrPtBinning);
2913  fHistoTruePi0CaloMergedClusterPartConvInvMassPt[iCut]->SetYTitle("p_{T} (GeV/c)");
2914  fHistoTruePi0CaloMergedClusterPartConvInvMassPt[iCut]->SetXTitle("M_{#gamma#gamma} (GeV/c^{2})");
2916  fHistoTruePi0NonMergedElectronPhotonInvMassPt[iCut] = new TH2F("ESD_TruePi0NonMergedElectronPhoton_InvMass_Pt", "ESD_TruePi0NonMergedElectronPhoton_InvMass_Pt", nBinsMinv, 0, maxMinv, nBinsPt, arrPtBinning);
2917  fHistoTruePi0NonMergedElectronPhotonInvMassPt[iCut]->SetYTitle("p_{T} (GeV/c)");
2918  fHistoTruePi0NonMergedElectronPhotonInvMassPt[iCut]->SetXTitle("M_{#gamma#gamma} (GeV/c^{2})");
2920  fHistoTruePi0NonMergedElectronMergedPhotonInvMassPt[iCut] = new TH2F("ESD_TruePi0NonMergedElectronMergedPhoton_InvMass_Pt", "ESD_TruePi0NonMergedElectronMergedPhoton_InvMass_Pt", nBinsMinv, 0, maxMinv,
2921  nBinsPt, arrPtBinning);
2922  fHistoTruePi0NonMergedElectronMergedPhotonInvMassPt[iCut]->SetYTitle("p_{T} (GeV/c)");
2923  fHistoTruePi0NonMergedElectronMergedPhotonInvMassPt[iCut]->SetXTitle("M_{#gamma#gamma} (GeV/c^{2})");
2925  fHistoTruePrimaryPi0MCPtResolPt[iCut] = new TH2F("ESD_TruePrimaryPi0_MCPt_ResolPt", "ESD_TruePrimaryPi0_ResolPt_MCPt", 500, 0.03, 35, 1000, -1., 1.);
2926  fHistoTruePrimaryPi0MCPtResolPt[iCut]->SetXTitle("p_{T, MC} (GeV/c)");
2927  fHistoTruePrimaryPi0MCPtResolPt[iCut]->SetXTitle("#delta (p_{T}) (GeV/c)");
2928  fHistoTruePrimaryPi0MCPtResolPt[iCut]->Sumw2();
2930  fTrueList[iCut]->Add(fHistoTruePrimaryPi0MCPtResolPt[iCut]);
2931  fHistoTrueK0sWithPi0DaughterMCPt[iCut] = new TH1F("ESD_TrueK0sWithPi0Daughter_MCPt", "ESD_TrueK0sWithPi0Daughter_MCPt", nBinsPt, arrPtBinning);
2932  fHistoTrueK0sWithPi0DaughterMCPt[iCut]->SetXTitle("p_{T, MC} (GeV/c)");
2933  fTrueList[iCut]->Add(fHistoTrueK0sWithPi0DaughterMCPt[iCut]);
2934  fHistoTrueK0lWithPi0DaughterMCPt[iCut] = new TH1F("ESD_TrueK0lWithPi0Daughter_MCPt", "ESD_TrueK0lWithPi0Daughter_MCPt", nBinsPt, arrPtBinning);
2935  fHistoTrueK0lWithPi0DaughterMCPt[iCut]->SetXTitle("p_{T, MC} (GeV/c)");
2936  fTrueList[iCut]->Add(fHistoTrueK0lWithPi0DaughterMCPt[iCut]);
2937  fHistoTrueEtaWithPi0DaughterMCPt[iCut] = new TH1F("ESD_TrueEtaWithPi0Daughter_MCPt", "ESD_TrueEtaWithPi0Daughter_MCPt", nBinsPt, arrPtBinning);
2938  fHistoTrueEtaWithPi0DaughterMCPt[iCut]->SetXTitle("p_{T, MC} (GeV/c)");
2939  fTrueList[iCut]->Add(fHistoTrueEtaWithPi0DaughterMCPt[iCut]);
2940  fHistoTrueLambdaWithPi0DaughterMCPt[iCut] = new TH1F("ESD_TrueLambdaWithPi0Daughter_MCPt", "ESD_TrueLambdaWithPi0Daughter_MCPt", nBinsPt, arrPtBinning);
2941  fHistoTrueLambdaWithPi0DaughterMCPt[iCut]->SetXTitle("p_{T, MC} (GeV/c)");
2943  }
2944 
2945  fHistoTruePi0PtY[iCut] = new TH2F("ESD_TruePi0_Pt_Y", "ESD_TruePi0_Pt_Y", nBinsQAPt, arrQAPtBinning, 150, -1.5, 1.5);
2946  fHistoTruePi0PtY[iCut]->SetXTitle("p_{T} (GeV/c)");
2947  fHistoTruePi0PtY[iCut]->SetYTitle("y");
2948  fTrueList[iCut]->Add(fHistoTruePi0PtY[iCut]);
2949  if( !fDoPi0Only ){
2950  fHistoTrueEtaPtY[iCut] = new TH2F("ESD_TrueEta_Pt_Y", "ESD_TrueEta_Pt_Y", nBinsQAPt, arrQAPtBinning, 150, -1.5, 1.5);
2951  fHistoTrueEtaPtY[iCut]->SetXTitle("p_{T} (GeV/c)");
2952  fHistoTrueEtaPtY[iCut]->SetYTitle("y");
2953  fTrueList[iCut]->Add(fHistoTrueEtaPtY[iCut]);
2954  fHistoTrueEtaPtAlpha[iCut] = new TH2F("ESD_TrueEta_Pt_Alpha", "ESD_TrueEta_Pt_Alpha", nBinsQAPt, arrQAPtBinning, 100, 0, 1);
2955  fHistoTrueEtaPtAlpha[iCut]->SetXTitle("p_{T} (GeV/c)");
2956  fHistoTrueEtaPtAlpha[iCut]->SetYTitle("#alpha");
2957  fTrueList[iCut]->Add(fHistoTrueEtaPtAlpha[iCut]);
2958  fHistoTrueEtaPtOpenAngle[iCut] = new TH2F("ESD_TrueEta_Pt_OpenAngle", "ESD_TrueEta_Pt_OpenAngle", nBinsQAPt, arrQAPtBinning, 180, 0, 1.8);
2959  fHistoTrueEtaPtOpenAngle[iCut]->SetXTitle("p_{T} (GeV/c)");
2960  fHistoTrueEtaPtOpenAngle[iCut]->SetYTitle("#theta");
2961  fTrueList[iCut]->Add(fHistoTrueEtaPtOpenAngle[iCut]);
2962  }
2963  fHistoTruePi0PtAlpha[iCut] = new TH2F("ESD_TruePi0_Pt_Alpha", "ESD_TruePi0_Pt_Alpha", nBinsQAPt, arrQAPtBinning, 100, 0, 1);
2964  fHistoTruePi0PtAlpha[iCut]->SetXTitle("p_{T} (GeV/c)");
2965  fHistoTruePi0PtAlpha[iCut]->SetYTitle("#alpha");
2966  fTrueList[iCut]->Add(fHistoTruePi0PtAlpha[iCut]);
2967 
2968  fHistoTruePi0PtOpenAngle[iCut] = new TH2F("ESD_TruePi0_Pt_OpenAngle", "ESD_TruePi0_Pt_OpenAngle", nBinsQAPt, arrQAPtBinning, 100, 0, 0.5);
2969  fHistoTruePi0PtOpenAngle[iCut]->SetXTitle("p_{T} (GeV/c)");
2970  fHistoTruePi0PtOpenAngle[iCut]->SetYTitle("#theta");
2971  fTrueList[iCut]->Add(fHistoTruePi0PtOpenAngle[iCut]);
2972  fHistoTrueBckGGInvMassPt[iCut] = new TH2F("ESD_TrueBckGG_InvMass_Pt", "ESD_TrueBckGG_InvMass_Pt", nBinsMinv, 0, maxMinv, nBinsPt, arrPtBinning);
2973  fHistoTrueBckGGInvMassPt[iCut]->SetYTitle("p_{T} (GeV/c)");
2974  fHistoTrueBckGGInvMassPt[iCut]->SetXTitle("M_{#gamma#gamma} (GeV/c^{2})");
2975  fTrueList[iCut]->Add(fHistoTrueBckGGInvMassPt[iCut]);
2976  fHistoTrueBckFullMesonContainedInOneClusterInvMassPt[iCut] = new TH2F("ESD_TrueBckFullMesonContained_InvMass_Pt", "ESD_TrueBckFullMesonContained_InvMass_Pt", nBinsMinv, 0, maxMinv, nBinsPt, arrPtBinning);
2977  fHistoTrueBckFullMesonContainedInOneClusterInvMassPt[iCut]->SetYTitle("p_{T} (GeV/c)");
2978  fHistoTrueBckFullMesonContainedInOneClusterInvMassPt[iCut]->SetXTitle("M_{#gamma#gamma} (GeV/c^{2})");
2980  fHistoTrueBckAsymEClustersInvMassPt[iCut] = new TH2F("ESD_TrueBckAsymEClus_InvMass_Pt", "ESD_TrueBckAsymEClus_InvMass_Pt", nBinsMinv, 0, maxMinv, nBinsPt, arrPtBinning);
2981  fHistoTrueBckAsymEClustersInvMassPt[iCut]->SetYTitle("p_{T} (GeV/c)");
2982  fHistoTrueBckAsymEClustersInvMassPt[iCut]->SetXTitle("M_{#gamma#gamma} (GeV/c^{2})");
2984  fHistoTrueBckContInvMassPt[iCut] = new TH2F("ESD_TrueBckCont_InvMass_Pt", "ESD_TrueBckCont_InvMass_Pt", nBinsMinv, 0, maxMinv, nBinsPt, arrPtBinning);
2985  fHistoTrueBckContInvMassPt[iCut]->SetYTitle("p_{T} (GeV/c)");
2986  fHistoTrueBckContInvMassPt[iCut]->SetXTitle("M_{#gamma#gamma} (GeV/c^{2})");
2987  fTrueList[iCut]->Add(fHistoTrueBckContInvMassPt[iCut]);
2988 
2989  if (fIsMC > 1){
2990  fHistoTruePi0PtY[iCut]->Sumw2();
2991  fHistoTruePi0PtAlpha[iCut]->Sumw2();
2992  fHistoTruePi0PtOpenAngle[iCut]->Sumw2();
2993  fHistoTrueBckGGInvMassPt[iCut]->Sumw2();
2995  fHistoTrueBckAsymEClustersInvMassPt[iCut]->Sumw2();
2996  fHistoTrueBckContInvMassPt[iCut]->Sumw2();
2997  if( !fDoPi0Only ){
2998  fHistoTrueEtaPtOpenAngle[iCut]->Sumw2();
2999  fHistoTrueEtaPtAlpha[iCut]->Sumw2();
3000  fHistoTrueEtaPtY[iCut]->Sumw2();
3001  }
3002  }
3003 
3004  }
3005 
3006  if (fDoMesonQA == 2 && fIsMC < 2){
3007  fHistoTruePi0Category1[iCut] = new TH2F("ESD_TruePi0Category1_InvMass_Pt", "ESD_TruePi0Category1_InvMass_Pt", nBinsMinv, 0, maxMinv, nBinsPt, arrPtBinning);
3008  fHistoTruePi0Category1[iCut]->SetYTitle("p_{T} (GeV/c)");
3009  fHistoTruePi0Category1[iCut]->SetXTitle("M_{#gamma#gamma} (GeV/c^{2})");
3010  fTrueList[iCut]->Add(fHistoTruePi0Category1[iCut]);
3011  fHistoTruePi0Category2[iCut] = new TH2F("ESD_TruePi0Category2_InvMass_Pt", "ESD_TruePi0Category2_InvMass_Pt", nBinsMinv, 0, maxMinv, nBinsPt, arrPtBinning);
3012  fHistoTruePi0Category2[iCut]->SetYTitle("p_{T} (GeV/c)");
3013  fHistoTruePi0Category2[iCut]->SetXTitle("M_{#gamma#gamma} (GeV/c^{2})");
3014  fTrueList[iCut]->Add(fHistoTruePi0Category2[iCut]);
3015  fHistoTruePi0Category3[iCut] = new TH2F("ESD_TruePi0Category3_InvMass_Pt", "ESD_TruePi0Category3_InvMass_Pt", nBinsMinv, 0, maxMinv, nBinsPt, arrPtBinning);
3016  fHistoTruePi0Category3[iCut]->SetYTitle("p_{T} (GeV/c)");
3017  fHistoTruePi0Category3[iCut]->SetXTitle("M_{#gamma#gamma} (GeV/c^{2})");
3018  fTrueList[iCut]->Add(fHistoTruePi0Category3[iCut]);
3019  fHistoTruePi0Category4_6[iCut] = new TH2F("ESD_TruePi0Category4_6_InvMass_Pt", "ESD_TruePi0Category4_6_InvMass_Pt", nBinsMinv, 0, maxMinv, nBinsPt, arrPtBinning);
3020  fHistoTruePi0Category4_6[iCut]->SetYTitle("p_{T} (GeV/c)");
3021  fHistoTruePi0Category4_6[iCut]->SetXTitle("M_{#gamma#gamma} (GeV/c^{2})");
3022  fTrueList[iCut]->Add(fHistoTruePi0Category4_6[iCut]);
3023  fHistoTruePi0Category5[iCut] = new TH2F("ESD_TruePi0Category5_InvMass_Pt", "ESD_TruePi0Category5_InvMass_Pt", nBinsMinv, 0, maxMinv, nBinsPt, arrPtBinning);
3024  fHistoTruePi0Category5[iCut]->SetYTitle("p_{T} (GeV/c)");
3025  fHistoTruePi0Category5[iCut]->SetXTitle("M_{#gamma#gamma} (GeV/c^{2})");
3026  fTrueList[iCut]->Add(fHistoTruePi0Category5[iCut]);
3027  fHistoTruePi0Category7[iCut] = new TH2F("ESD_TruePi0Category7_InvMass_Pt", "ESD_TruePi0Category7_InvMass_Pt", nBinsMinv, 0, maxMinv, nBinsPt, arrPtBinning);
3028  fHistoTruePi0Category7[iCut]->SetYTitle("p_{T} (GeV/c)");
3029  fHistoTruePi0Category7[iCut]->SetXTitle("M_{#gamma#gamma} (GeV/c^{2})");
3030  fTrueList[iCut]->Add(fHistoTruePi0Category7[iCut]);
3031  fHistoTruePi0Category8[iCut] = new TH2F("ESD_TruePi0Category8_InvMass_Pt", "ESD_TruePi0Category8_InvMass_Pt", nBinsMinv, 0, maxMinv, nBinsPt, arrPtBinning);
3032  fHistoTruePi0Category8[iCut]->SetYTitle("p_{T} (GeV/c)");
3033  fHistoTruePi0Category8[iCut]->SetXTitle("M_{#gamma#gamma} (GeV/c^{2})");
3034  fTrueList[iCut]->Add(fHistoTruePi0Category8[iCut]);
3035 
3036  if( !fDoPi0Only ){
3037  fHistoTrueEtaCategory1[iCut] = new TH2F("ESD_TrueEtaCategory1_InvMass_Pt", "ESD_TrueEtaCategory1_InvMass_Pt", nBinsMinv, 0, maxMinv, nBinsPt, arrPtBinning);
3038  fHistoTrueEtaCategory1[iCut]->SetYTitle("p_{T} (GeV/c)");
3039  fHistoTrueEtaCategory1[iCut]->SetXTitle("M_{#gamma#gamma} (GeV/c^{2})");
3040  fTrueList[iCut]->Add(fHistoTrueEtaCategory1[iCut]);
3041  fHistoTrueEtaCategory2[iCut] = new TH2F("ESD_TrueEtaCategory2_InvMass_Pt", "ESD_TrueEtaCategory2_InvMass_Pt", nBinsMinv, 0, maxMinv, nBinsPt, arrPtBinning);
3042  fHistoTrueEtaCategory2[iCut]->SetYTitle("p_{T} (GeV/c)");
3043  fHistoTrueEtaCategory2[iCut]->SetXTitle("M_{#gamma#gamma} (GeV/c^{2})");
3044  fTrueList[iCut]->Add(fHistoTrueEtaCategory2[iCut]);
3045  fHistoTrueEtaCategory3[iCut] = new TH2F("ESD_TrueEtaCategory3_InvMass_Pt", "ESD_TrueEtaCategory3_InvMass_Pt", nBinsMinv, 0, maxMinv, nBinsPt, arrPtBinning);
3046  fHistoTrueEtaCategory3[iCut]->SetYTitle("p_{T} (GeV/c)");
3047  fHistoTrueEtaCategory3[iCut]->SetXTitle("M_{#gamma#gamma} (GeV/c^{2})");
3048  fTrueList[iCut]->Add(fHistoTrueEtaCategory3[iCut]);
3049  fHistoTrueEtaCategory4_6[iCut] = new TH2F("ESD_TrueEtaCategory4_6_InvMass_Pt", "ESD_TrueEtaCategory4_6_InvMass_Pt", nBinsMinv, 0, maxMinv, nBinsPt, arrPtBinning);
3050  fHistoTrueEtaCategory4_6[iCut]->SetYTitle("p_{T} (GeV/c)");
3051  fHistoTrueEtaCategory4_6[iCut]->SetXTitle("M_{#gamma#gamma} (GeV/c^{2})");
3052  fTrueList[iCut]->Add(fHistoTrueEtaCategory4_6[iCut]);
3053  fHistoTrueEtaCategory5[iCut] = new TH2F("ESD_TrueEtaCategory5_InvMass_Pt", "ESD_TrueEtaCategory5_InvMass_Pt", nBinsMinv, 0, maxMinv, nBinsPt, arrPtBinning);
3054  fHistoTrueEtaCategory5[iCut]->SetYTitle("p_{T} (GeV/c)");
3055  fHistoTrueEtaCategory5[iCut]->SetXTitle("M_{#gamma#gamma} (GeV/c^{2})");
3056  fTrueList[iCut]->Add(fHistoTrueEtaCategory5[iCut]);
3057  fHistoTrueEtaCategory7[iCut] = new TH2F("ESD_TrueEtaCategory7_InvMass_Pt", "ESD_TrueEtaCategory7_InvMass_Pt", nBinsMinv, 0, maxMinv, nBinsPt, arrPtBinning);
3058  fHistoTrueEtaCategory7[iCut]->SetYTitle("p_{T} (GeV/c)");
3059  fHistoTrueEtaCategory7[iCut]->SetXTitle("M_{#gamma#gamma} (GeV/c^{2})");
3060  fTrueList[iCut]->Add(fHistoTrueEtaCategory7[iCut]);
3061  fHistoTrueEtaCategory8[iCut] = new TH2F("ESD_TrueEtaCategory8_InvMass_Pt", "ESD_TrueEtaCategory8_InvMass_Pt", nBinsMinv, 0, maxMinv, nBinsPt, arrPtBinning);
3062  fHistoTrueEtaCategory8[iCut]->SetYTitle("p_{T} (GeV/c)");
3063  fHistoTrueEtaCategory8[iCut]->SetXTitle("M_{#gamma#gamma} (GeV/c^{2})");
3064  fTrueList[iCut]->Add(fHistoTrueEtaCategory8[iCut]);
3065  }
3066  }
3067 
3068  if (fDoMesonQA == 3){
3069  fTreeList[iCut] = new TList();
3070  fTreeList[iCut]->SetName(Form("%s_%s_%s True ClusterComb tree", cutstringEvent.Data(), cutstringCalo.Data(), cutstringMeson.Data()));
3071  fTreeList[iCut]->SetOwner(kTRUE);
3072  fCutFolder[iCut]->Add(fTreeList[iCut]);
3073 
3074  tTrueInvMassROpenABPtFlag[iCut] = new TTree("True_InvMass_R_OpenA_OpenB_Pt_Flag", "True_InvMass_R_OpenA_OpenB_Pt_Flag");
3075  tTrueInvMassROpenABPtFlag[iCut]->Branch("InvMass",&fInvMass,"fInvMass/F");
3076  tTrueInvMassROpenABPtFlag[iCut]->Branch("RConv",&fRconv,"fRconv/F");
3077  tTrueInvMassROpenABPtFlag[iCut]->Branch("OpenAngleRPrimVtx",&fOpenRPrim,"fOpenRPrim/F");
3078  tTrueInvMassROpenABPtFlag[iCut]->Branch("InvMassRTOF",&fInvMassRTOF,"fInvMassRTOF/F");
3079  tTrueInvMassROpenABPtFlag[iCut]->Branch("Pt",&fPt,"fPt/F");
3080 // tTrueInvMassROpenABPtFlag[iCut]->Branch("Weight",&fWeightJetJetMC,"fWeightJetJetMC/F");
3081  tTrueInvMassROpenABPtFlag[iCut]->Branch("cat",&iFlag,"iFlag/b");
3082  fTreeList[iCut]->Add(tTrueInvMassROpenABPtFlag[iCut]);
3083  }
3084  }
3085  }
3086  }
3090 
3092 
3093  if(fV0Reader)
3095  if(((AliConversionPhotonCuts*)fV0Reader->GetConversionCuts())->GetCutHistograms())
3096  fOutputContainer->Add(((AliConversionPhotonCuts*)fV0Reader->GetConversionCuts())->GetCutHistograms());
3097  if(fV0Reader)
3099  if(((AliConvEventCuts*)fV0Reader->GetEventCuts())->GetCutHistograms())
3100  fOutputContainer->Add(((AliConvEventCuts*)fV0Reader->GetEventCuts())->GetCutHistograms());
3101 
3102  for(Int_t iMatcherTask = 0; iMatcherTask < 5; iMatcherTask++){
3103  AliCaloTrackMatcher* temp = (AliCaloTrackMatcher*) (AliAnalysisManager::GetAnalysisManager()->GetTask(Form("CaloTrackMatcher_%i_%i",iMatcherTask,fTrackMatcherRunningMode)));
3104  if(temp) fOutputContainer->Add(temp->GetCaloTrackMatcherHistograms());
3105  }
3106 
3107  for(Int_t iCut = 0; iCut<fnCuts;iCut++){
3108  if(!((AliConvEventCuts*)fEventCutArray->At(iCut))) continue;
3109  if(((AliConvEventCuts*)fEventCutArray->At(iCut))->GetCutHistograms()){
3110  fCutFolder[iCut]->Add(((AliConvEventCuts*)fEventCutArray->At(iCut))->GetCutHistograms());
3111  }
3112  if(!((AliCaloPhotonCuts*)fClusterCutArray->At(iCut))) continue;
3113  if(((AliCaloPhotonCuts*)fClusterCutArray->At(iCut))->GetCutHistograms()){
3114  fCutFolder[iCut]->Add(((AliCaloPhotonCuts*)fClusterCutArray->At(iCut))->GetCutHistograms());
3115  }
3116  if(fSetPlotHistsExtQA){
3117  if(!((AliCaloPhotonCuts*)fClusterCutArray->At(iCut))) continue;
3118  if(((AliCaloPhotonCuts*)fClusterCutArray->At(iCut))->GetExtQAHistograms()){
3119  fCutFolder[iCut]->Add(((AliCaloPhotonCuts*)fClusterCutArray->At(iCut))->GetExtQAHistograms());
3120  }
3121  }
3122  if(fDoMesonAnalysis){
3123  if(!((AliConversionMesonCuts*)fMesonCutArray->At(iCut))) continue;
3124  if(((AliConversionMesonCuts*)fMesonCutArray->At(iCut))->GetCutHistograms()){
3125  fCutFolder[iCut]->Add(((AliConversionMesonCuts*)fMesonCutArray->At(iCut))->GetCutHistograms());
3126  }
3127  }
3128  if(fDoJetAnalysis){
3129  fCutFolder[iCut]->Add(fJetHistograms[iCut]);
3130  }
3131  }
3132 
3133  if (fIsMC > 0 ){
3134  tBrokenFiles = new TTree("BrokenFiles", "BrokenFiles");
3135  tBrokenFiles->Branch("fileName",&fFileNameBroken);
3137  }
3138  if (fDoClusterQA > 1){
3139  tClusterQATree = new TTree("ClusterQATree", "ClusterQATree");
3140  tClusterQATree->Branch("closeHighPtClusters",&fCloseHighPtClusters);
3142  }
3143 
3144  if(fLocalDebugFlag > 0){
3145  fstream fOutputLocalDebug;
3146  fOutputLocalDebug.open("debugOutput.txt",ios::out);
3147  fOutputLocalDebug.close();
3148  }
3149 
3150  PostData(1, fOutputContainer);
3151 }
3152 //_____________________________________________________________________________
3154 {
3155  for(Int_t iCut = 0; iCut<fnCuts;iCut++){
3156  if (((AliConvEventCuts*)fEventCutArray->At(iCut))->GetPeriodEnum() == AliConvEventCuts::kNoPeriod && ((AliConvEventCuts*)fV0Reader->GetEventCuts())->GetPeriodEnum() != AliConvEventCuts::kNoPeriod){
3157  ((AliConvEventCuts*)fEventCutArray->At(iCut))->SetPeriodEnumExplicit(((AliConvEventCuts*)fV0Reader->GetEventCuts())->GetPeriodEnum());
3158  } else if (((AliConvEventCuts*)fEventCutArray->At(iCut))->GetPeriodEnum() == AliConvEventCuts::kNoPeriod ){
3159  ((AliConvEventCuts*)fEventCutArray->At(iCut))->SetPeriodEnum(fV0Reader->GetPeriodName());
3160  }
3161  if(fIsHeavyIon==2) {
3162  if(!((AliConvEventCuts*)fEventCutArray->At(iCut))->GetDoEtaShift()){
3163  fProfileEtaShift[iCut]->Fill(0.,(((AliConvEventCuts*)fEventCutArray->At(iCut))->GetEtaShift()));
3164  continue; // No Eta Shift requested, continue
3165  }
3166  if(((AliConvEventCuts*)fEventCutArray->At(iCut))->GetEtaShift() == 0.0){ // Eta Shift requested but not set, get shift automatically
3167  ((AliConvEventCuts*)fEventCutArray->At(iCut))->GetCorrectEtaShiftFromPeriod();
3168  fProfileEtaShift[iCut]->Fill(0.,(((AliConvEventCuts*)fEventCutArray->At(iCut))->GetEtaShift()));
3169  ((AliConvEventCuts*)fEventCutArray->At(iCut))->DoEtaShift(kFALSE); // Eta Shift Set, make sure that it is called only once
3170  continue;
3171  }
3172  else{
3173  printf(" Gamma Conversion Task %s :: Eta Shift Manually Set to %f \n\n",
3174  (((AliConvEventCuts*)fEventCutArray->At(iCut))->GetCutNumber()).Data(),((AliConvEventCuts*)fEventCutArray->At(iCut))->GetEtaShift());
3175  fProfileEtaShift[iCut]->Fill(0.,(((AliConvEventCuts*)fEventCutArray->At(iCut))->GetEtaShift()));
3176  ((AliConvEventCuts*)fEventCutArray->At(iCut))->DoEtaShift(kFALSE); // Eta Shift Set, make sure that it is called only once
3177  }
3178  }
3179  }
3180 
3181  return kTRUE;
3182 }
3183 //_____________________________________________________________________________
3185 {
3186  //
3187  // Called for each event
3188  //
3189  fInputEvent = InputEvent();
3190  fCloseHighPtClusters = 0x0;
3191  if(fIsMC> 0) fMCEvent = MCEvent();
3192  Int_t eventQuality = ((AliConvEventCuts*)fV0Reader->GetEventCuts())->GetEventQuality();
3193 
3194  if(fInputEvent->IsIncompleteDAQ()==kTRUE) eventQuality = 2; // incomplete event
3195  if(eventQuality == 2 || eventQuality == 3){// Event Not Accepted due to MC event missing or wrong trigger for V0ReaderV1 or because it is incomplete
3196  // write out name of broken file for first event
3197  if (fIsMC > 0){
3198  if (fInputEvent->IsA()==AliESDEvent::Class()){
3199  if (((AliESDEvent*)fInputEvent)->GetEventNumberInFile() == 0){
3200  fFileNameBroken = new TObjString(Form("%s", ((TString)fV0Reader->GetCurrentFileName()).Data()));
3201  if (tBrokenFiles) tBrokenFiles->Fill();
3202  delete fFileNameBroken;
3203  }
3204  }
3205  }
3206 
3207  for(Int_t iCut = 0; iCut<fnCuts; iCut++){
3208  fHistoNEvents[iCut]->Fill(eventQuality);
3209  if (fIsMC>1) fHistoNEventsWOWeight[iCut]->Fill(eventQuality);
3210  }
3211  return;
3212  }
3213  if(((AliCaloPhotonCuts*)fClusterCutArray->At(fiCut))->GetDoSecondaryTrackMatching())fReaderGammas = fV0Reader->GetReconstructedGammas(); // Gammas from default Cut
3214 
3215  // ------------------- BeginEvent ----------------------------
3216 
3217  AliEventplane *EventPlane = fInputEvent->GetEventplane();
3218  if(fIsHeavyIon ==1)fEventPlaneAngle = EventPlane->GetEventplane("V0",fInputEvent,2);
3219  else fEventPlaneAngle=0.0;
3220  for(Int_t iCut = 0; iCut<fnCuts; iCut++){
3221 
3222  fiCut = iCut;
3224  Bool_t isRunningEMCALrelAna = kFALSE;
3225  if (((AliCaloPhotonCuts*)fClusterCutArray->At(fiCut))->GetClusterType() == 1) isRunningEMCALrelAna = kTRUE;
3226 
3227  Int_t eventNotAccepted = ((AliConvEventCuts*)fEventCutArray->At(iCut))->IsEventAcceptedByCut(fV0Reader->GetEventCuts(),fInputEvent,fMCEvent,fIsHeavyIon, isRunningEMCALrelAna);
3228 
3229  if(fIsMC==2){
3230  Float_t xsection = -1.;
3231  Float_t ntrials = -1.;
3232  ((AliConvEventCuts*)fEventCutArray->At(iCut))->GetXSectionAndNTrials(fMCEvent,xsection,ntrials, fInputEvent );
3233  if((xsection==-1.) || (ntrials==-1.)) AliFatal(Form("ERROR: GetXSectionAndNTrials returned invalid xsection/ntrials, periodName from V0Reader: '%s'",fV0Reader->GetPeriodName().Data()));
3234  fProfileJetJetXSection[iCut]->Fill(0.,xsection);
3235  fHistoJetJetNTrials[iCut]->Fill("#sum{NTrials}", ntrials);
3236  }
3237 
3238  if (fIsMC > 0){
3239  fWeightJetJetMC = 1;
3240  Bool_t isMCJet = ((AliConvEventCuts*)fEventCutArray->At(iCut))->IsJetJetMCEventAccepted( fMCEvent, fWeightJetJetMC , fInputEvent);
3241  if (fIsMC == 3){
3242  Double_t weightMult = ((AliConvEventCuts*)fEventCutArray->At(iCut))->GetWeightForMultiplicity(fV0Reader->GetNumberOfPrimaryTracks());
3243  fWeightJetJetMC = fWeightJetJetMC*weightMult;
3244  }
3245 
3246  if (!isMCJet){
3247  fHistoNEvents[iCut]->Fill(10,fWeightJetJetMC);
3248  if (fIsMC>1) fHistoNEventsWOWeight[iCut]->Fill(10);
3249  continue;
3250  }
3251  }
3252 
3253  Bool_t triggered = kTRUE;
3254  if(eventNotAccepted!= 0){
3255  fHistoNEvents[iCut]->Fill(eventNotAccepted, fWeightJetJetMC); // Check Centrality, PileUp, SDD and V0AND --> Not Accepted => eventQuality = 1
3256  if (fIsMC>1) fHistoNEventsWOWeight[iCut]->Fill(eventNotAccepted);
3257  // cout << "event rejected due to wrong trigger: " <<eventNotAccepted << endl;
3258  if (eventNotAccepted==3 && fIsMC > 0){
3259  triggered = kFALSE;
3260  }else {
3261  continue;
3262  }
3263  }
3264  if(eventQuality != 0 && triggered== kTRUE){// Event Not Accepted
3265  //cout << "event rejected due to: " <<eventQuality << endl;
3266  fHistoNEvents[iCut]->Fill(eventQuality, fWeightJetJetMC);
3267  if (fIsMC>1) fHistoNEventsWOWeight[iCut]->Fill(eventQuality); // Should be 0 here
3268  continue;
3269  }
3270  if (triggered == kTRUE) {
3271  if(((AliConvEventCuts*)fEventCutArray->At(iCut))->GetUseSphericity()!=0){
3272  if(fV0Reader->GetSphericity() != -1 && fV0Reader->GetSphericity() != 0){
3274  if(fConvJetReader->GetNJets() > 0){
3275  fHistoNEvents[iCut]->Fill(eventQuality, fWeightJetJetMC); // Should be 0 here
3276  if (fIsMC>1) fHistoNEventsWOWeight[iCut]->Fill(eventQuality); // Should be 0 here
3278  fHistoVertexZ[iCut]->Fill(fInputEvent->GetPrimaryVertex()->GetZ(), fWeightJetJetMC);
3282  }
3284  if(fIsMC>0){
3288  }
3292  }else if(fDoJetAnalysis && fDoSoftAnalysis){
3293  if(fConvJetReader->GetNJets() < 1){
3294  fHistoNEvents[iCut]->Fill(eventQuality, fWeightJetJetMC); // Should be 0 here
3295  if (fIsMC>1) fHistoNEventsWOWeight[iCut]->Fill(eventQuality); // Should be 0 here
3297  fHistoVertexZ[iCut]->Fill(fInputEvent->GetPrimaryVertex()->GetZ(), fWeightJetJetMC);
3301  }
3303  if(fIsMC>0){
3307  }
3311  }else{
3312  fHistoNEvents[iCut]->Fill(eventQuality, fWeightJetJetMC); // Should be 0 here
3313  if (fIsMC>1) fHistoNEventsWOWeight[iCut]->Fill(eventQuality); // Should be 0 here
3315  fHistoVertexZ[iCut]->Fill(fInputEvent->GetPrimaryVertex()->GetZ(), fWeightJetJetMC);
3316  if(((AliConvEventCuts*)fEventCutArray->At(iCut))->GetUseSphericityTrue() && fIsMC>0){
3319  }else{
3323  }
3324  if(fIsMC>0){
3328  }
3332  }
3333  }
3334  }else{
3335  fHistoNEvents[iCut]->Fill(eventQuality, fWeightJetJetMC); // Should be 0 here
3336  if (fIsMC>1) fHistoNEventsWOWeight[iCut]->Fill(eventQuality); // Should be 0 here
3338  fHistoVertexZ[iCut]->Fill(fInputEvent->GetPrimaryVertex()->GetZ(), fWeightJetJetMC);
3339  }
3340  if(!fDoLightOutput){
3341  fHistoSPDClusterTrackletBackground[iCut]->Fill(fInputEvent->GetMultiplicity()->GetNumberOfTracklets(),(fInputEvent->GetNumberOfITSClusters(0)+fInputEvent->GetNumberOfITSClusters(1)), fWeightJetJetMC);
3342  if(((AliConvEventCuts*)fEventCutArray->At(iCut))->IsHeavyIon() == 2) fHistoNV0Tracks[iCut]->Fill(fInputEvent->GetVZEROData()->GetMTotV0A(), fWeightJetJetMC);
3343  else fHistoNV0Tracks[iCut]->Fill(fInputEvent->GetVZEROData()->GetMTotV0A()+fInputEvent->GetVZEROData()->GetMTotV0C(), fWeightJetJetMC);
3344  }
3345  }
3346  if(fIsMC> 0){
3347  // Process MC Particle
3348  if(((AliConvEventCuts*)fEventCutArray->At(iCut))->GetSignalRejection() != 0){
3349  if(fInputEvent->IsA()==AliESDEvent::Class()){
3350  ((AliConvEventCuts*)fEventCutArray->At(iCut))->GetNotRejectedParticles(((AliConvEventCuts*)fEventCutArray->At(iCut))->GetSignalRejection(),
3351  ((AliConvEventCuts*)fEventCutArray->At(iCut))->GetAcceptedHeader(),
3352  fMCEvent);
3353  }
3354  else if(fInputEvent->IsA()==AliAODEvent::Class()){
3355  ((AliConvEventCuts*)fEventCutArray->At(iCut))->GetNotRejectedParticles(((AliConvEventCuts*)fEventCutArray->At(iCut))->GetSignalRejection(),
3356  ((AliConvEventCuts*)fEventCutArray->At(iCut))->GetAcceptedHeader(),
3357  fInputEvent);
3358  }
3359  if(!fDoLightOutput){
3360  if(((AliConvEventCuts*)fEventCutArray->At(iCut))->GetAcceptedHeader()){
3361  for(Int_t i = 0;i<(((AliConvEventCuts*)fEventCutArray->At(iCut))->GetAcceptedHeader())->GetEntries();i++){
3362  TString nameBin= fHistoMCHeaders[iCut]->GetXaxis()->GetBinLabel(i+1);
3363  if (nameBin.CompareTo("")== 0){
3364  TString nameHeader = ((TObjString*)((TList*)((AliConvEventCuts*)fEventCutArray->At(iCut))
3365  ->GetAcceptedHeader())->At(i))->GetString();
3366  fHistoMCHeaders[iCut]->GetXaxis()->SetBinLabel(i+1,nameHeader.Data());
3367  }
3368  }
3369  }
3370  }
3371  }
3372  }
3373  if(fIsMC> 0){
3374  if(fInputEvent->IsA()==AliESDEvent::Class())
3376  if(fInputEvent->IsA()==AliAODEvent::Class())
3378  }
3379 
3380  if (triggered==kFALSE) continue;
3381  // 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)
3382  ProcessClusters(); // process calo clusters
3383  if(((AliCaloPhotonCuts*)fClusterCutArray->At(fiCut))->GetDoSecondaryTrackMatching()) ProcessConversionCandidates(); // process conversion candidates for secondary track matching
3385 
3387 
3388  fHistoNGammaCandidates[iCut]->Fill(fClusterCandidates->GetEntries(), fWeightJetJetMC);
3390  if(fDoMesonAnalysis){ // Meson Analysis
3391  CalculatePi0Candidates(); // Combine Gammas from conversion and from calo
3392  if(((AliConversionMesonCuts*)fMesonCutArray->At(iCut))->DoBGCalculation()){
3393  if(((AliConversionMesonCuts*)fMesonCutArray->At(iCut))->BackgroundHandlerType() == 0){
3394  CalculateBackground(); // Combinatorial Background
3395  UpdateEventByEventData(); // Store Event for mixed Events
3396  }
3397 
3398  }
3401  }
3402  if(fIsMC> 0){
3405  }
3406  if(((AliCaloPhotonCuts*)fClusterCutArray->At(fiCut))->GetDoSecondaryTrackMatching()) fGammaCandidates->Clear();
3407  fClusterCandidates->Clear(); // delete cluster candidates
3408  }
3410  PostData(1, fOutputContainer);
3411 }
3412 
3413 //________________________________________________________________________
3415 {
3416  Int_t nclus = 0;
3417  TClonesArray * arrClustersProcess = NULL;
3419  if(!fCorrTaskSetting.CompareTo("")){
3420  nclus = fInputEvent->GetNumberOfCaloClusters();
3421  } else {
3422  arrClustersProcess = dynamic_cast<TClonesArray*>(fInputEvent->FindListObject(Form("%sClustersBranch",fCorrTaskSetting.Data())));
3423  if(!arrClustersProcess)
3424  AliFatal(Form("%sClustersBranch was not found in AliAnalysisTaskGammaCalo! Check the correction framework settings!",fCorrTaskSetting.Data()));
3425  nclus = arrClustersProcess->GetEntries();
3426  }
3427 
3428  if(nclus == 0) return;
3429  // plotting histograms on cell/tower level, only if extendedMatchAndQA > 1
3430  ((AliCaloPhotonCuts*)fClusterCutArray->At(fiCut))->FillHistogramsExtendedQA(fInputEvent,fIsMC);
3431 
3432  // match tracks to clusters
3433  ((AliCaloPhotonCuts*)fClusterCutArray->At(fiCut))->MatchTracksToClusters(fInputEvent,fWeightJetJetMC,kTRUE, fMCEvent);
3434 
3435  // vertex
3436  Double_t vertex[3] = {0};
3437  InputEvent()->GetPrimaryVertex()->GetXYZ(vertex);
3438 
3439  Int_t totalActiveCells = 0;
3440  Double_t totalCellsinClusters = 0;
3441  Double_t totalUnclusteredE = 0;
3442  if(((AliCaloPhotonCuts*)fClusterCutArray->At(fiCut))->GetDoFlatEnergySubtraction()){
3443  Double_t totalClusterEnergy = 0;
3444  totalActiveCells = ((AliCaloPhotonCuts*)fClusterCutArray->At(fiCut))->GetNactiveEmcalCells();
3445  totalCellsinClusters = 0;
3446  for(Long_t i = 0; i < nclus; i++){
3447  AliVCluster* clus = NULL;
3448  if(fInputEvent->IsA()==AliESDEvent::Class()){
3449  if(arrClustersProcess)
3450  clus = new AliESDCaloCluster(*(AliESDCaloCluster*)arrClustersProcess->At(i));
3451  else
3452  clus = new AliESDCaloCluster(*(AliESDCaloCluster*)fInputEvent->GetCaloCluster(i));
3453  } else if(fInputEvent->IsA()==AliAODEvent::Class()){
3454  if(arrClustersProcess)
3455  clus = new AliAODCaloCluster(*(AliAODCaloCluster*)arrClustersProcess->At(i));
3456  else
3457  clus = new AliAODCaloCluster(*(AliAODCaloCluster*)fInputEvent->GetCaloCluster(i));
3458  }
3459  if(!clus) continue;
3460  totalClusterEnergy += clus->E();
3461  totalCellsinClusters += clus->GetNCells();
3462  delete clus;
3463  }
3464  Double_t totalEDeposit = ((AliCaloPhotonCuts*)fClusterCutArray->At(fiCut))->GetTotalEnergyDeposit(fInputEvent);
3465  totalUnclusteredE = totalEDeposit - totalClusterEnergy;
3466  }
3467 
3468  Double_t maxClusterEnergy = -1;
3469  Int_t maxClusterID = -1;
3470  map<Long_t,Int_t> mapIsClusterAccepted;
3471  map<Long_t,Int_t> mapIsClusterAcceptedWithoutTrackMatch;
3472  // Loop over EMCal clusters
3473  Int_t NClusinJets = 0;
3474  for(Long_t i = 0; i < nclus; i++){
3475  Double_t tempClusterWeight = fWeightJetJetMC;
3476  Double_t tempPhotonWeight = fWeightJetJetMC;
3477  AliVCluster* clus = NULL;
3478  if(fInputEvent->IsA()==AliESDEvent::Class()){
3479  if(arrClustersProcess)
3480  clus = new AliESDCaloCluster(*(AliESDCaloCluster*)arrClustersProcess->At(i));
3481  else
3482  clus = new AliESDCaloCluster(*(AliESDCaloCluster*)fInputEvent->GetCaloCluster(i));
3483  } else if(fInputEvent->IsA()==AliAODEvent::Class()){
3484  if(arrClustersProcess)
3485  clus = new AliAODCaloCluster(*(AliAODCaloCluster*)arrClustersProcess->At(i));
3486  else
3487  clus = new AliAODCaloCluster(*(AliAODCaloCluster*)fInputEvent->GetCaloCluster(i));
3488  }
3489  if(!clus) continue;
3490 
3491  if(((AliCaloPhotonCuts*)fClusterCutArray->At(fiCut))->GetDoFlatEnergySubtraction()){
3492  if(totalUnclusteredE!=0 && totalActiveCells!=0 && totalCellsinClusters!=0){
3493  clus->SetE(clus->E()-(clus->GetNCells()*(totalUnclusteredE)/(totalActiveCells-totalCellsinClusters)));
3494  }
3495  }
3496 
3497  // Set the jetjet weight to 1 in case the cluster orignated from the minimum bias header
3498  if (fIsMC>0 && ((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetSignalRejection() == 4){
3499  if( ((AliConvEventCuts*)fEventCutArray->At(fiCut))->IsParticleFromBGEvent(clus->GetLabelAt(0), fMCEvent, fInputEvent) == 2)
3500  tempClusterWeight = 1;
3501  }
3502 
3503  if(!((AliCaloPhotonCuts*)fClusterCutArray->At(fiCut))->ClusterIsSelected(clus,fInputEvent,fMCEvent,fIsMC, tempClusterWeight,i)){
3504  if(fProduceTreeEOverP && ((AliCaloPhotonCuts*)fClusterCutArray->At(fiCut))->ClusterIsSelectedBeforeTrackMatch() ) mapIsClusterAcceptedWithoutTrackMatch[i] = 1;
3505  if (((AliCaloPhotonCuts*)fClusterCutArray->At(fiCut))->GetIsAcceptedForBasicCounting())fNCurrentClusterBasic++;
3506  delete clus;
3507  continue;
3508  }
3509 
3511 
3512  // TLorentzvector with cluster
3513  TLorentzVector clusterVector;
3514  clus->GetMomentum(clusterVector,vertex);
3515 
3516  TLorentzVector* tmpvec = new TLorentzVector();
3517  tmpvec->SetPxPyPzE(clusterVector.Px(),clusterVector.Py(),clusterVector.Pz(),clusterVector.E());
3518 
3519  // convert to AODConversionPhoton
3520  AliAODConversionPhoton *PhotonCandidate=new AliAODConversionPhoton(tmpvec);
3521  if(!PhotonCandidate){ delete clus; delete tmpvec; continue;}
3522 
3523  //determine maximum cluster energy in event
3524  if(fProduceCellIDPlots && (clus->E() > maxClusterEnergy)){
3525  maxClusterEnergy = clus->E();
3526  maxClusterID = (Int_t) i;
3527  }
3529  mapIsClusterAccepted[i] = 1;
3530  mapIsClusterAcceptedWithoutTrackMatch[i] = 1;
3531  }
3532 
3533  // Flag Photon as CaloPhoton
3534  PhotonCandidate->SetIsCaloPhoton();
3535  PhotonCandidate->SetCaloClusterRef(i);
3536  PhotonCandidate->SetLeadingCellID(((AliCaloPhotonCuts*)fClusterCutArray->At(fiCut))->FindLargestCellInCluster(clus,fInputEvent));
3537  // get MC label
3538  if(fIsMC> 0){
3539  Int_t* mclabelsCluster = clus->GetLabels();
3540  PhotonCandidate->SetNCaloPhotonMCLabels(clus->GetNLabels());
3541  // cout << clus->GetNLabels() << endl;
3542  if (clus->GetNLabels()>0){
3543  for (Int_t k =0; k< (Int_t)clus->GetNLabels(); k++){
3544  if (k< 50)PhotonCandidate->SetCaloPhotonMCLabel(k,mclabelsCluster[k]);
3545  // Int_t pdgCode = fMCEvent->Particle(mclabelsCluster[k])->GetPdgCode();
3546  // cout << "label " << k << "\t" << mclabelsCluster[k] << " pdg code: " << pdgCode << endl;
3547  }
3548  }
3549  }
3550  if(fDoJetAnalysis == kTRUE && fIsMC > 0 && fDoClusterQA == kTRUE){
3551  Bool_t InsideJet = kFALSE;
3552  fNumberOfClusters[fiCut]->Fill(nclus);
3553  Float_t clusPos[3]={0,0,0};
3554  clus->GetPosition(clusPos);
3555  TVector3 clusterVectorJets(clusPos[0],clusPos[1],clusPos[2]);
3556  Double_t etaCluster = clusterVectorJets.Eta();
3557  Double_t phiCluster = clusterVectorJets.Phi();
3558  if(fConvJetReader->GetTrueNJets()>0){
3561  Double_t RJetPi0Cand;
3562  for(Int_t i=0; i<fConvJetReader->GetTrueNJets(); i++){
3563  Double_t DeltaEta = fTrueVectorJetEta.at(i)-etaCluster;
3564  Double_t DeltaPhi = abs(fTrueVectorJetPhi.at(i)-phiCluster);
3565  if(DeltaPhi > M_PI) {
3566  DeltaPhi = 2*M_PI - DeltaPhi;
3567  }
3568  RJetPi0Cand = TMath::Sqrt(pow((DeltaEta),2)+pow((DeltaPhi),2));
3569  if(fConvJetReader->Get_Jet_Radius() > 0 ){
3570  if(RJetPi0Cand < fConvJetReader->Get_Jet_Radius()){
3571  InsideJet = kTRUE;
3572  NClusinJets++;
3573  fClusterEtaPhiJets[fiCut]->Fill(phiCluster, etaCluster);
3574  }
3575  }
3576  }
3577  fTrueVectorJetEta.clear();
3578  fTrueVectorJetPhi.clear();
3579  }
3580  if(clus->GetNLabels() > 1){
3581  Int_t* mclabelsCluster = clus->GetLabels();
3582  TClonesArray *AODMCTrackArray = dynamic_cast<TClonesArray*>(fInputEvent->FindListObject(AliAODMCParticle::StdBranchName()));
3583  for(Int_t k =0; k< (Int_t)clus->GetNLabels(); k++){
3584  AliAODMCParticle* dummy = (AliAODMCParticle*) AODMCTrackArray->At(mclabelsCluster[k]);
3585  Int_t pdgcode = dummy->GetPdgCode();
3586  if(k == 0){
3587  fEnergyRatio[fiCut]->Fill(clus->GetClusterMCEdepFraction(k), dummy->E());
3588  fEnergyDeposit[fiCut]->Fill(clus->GetClusterMCEdepFraction(k)*clus->E(), dummy->E());
3589  if(InsideJet){
3590  fEnergyRatioinJets[fiCut]->Fill(clus->GetClusterMCEdepFraction(k), dummy->E());
3591  fEnergyDepositinJets[fiCut]->Fill(clus->GetClusterMCEdepFraction(k)*clus->E(), dummy->E());
3592  }
3593  }
3594  if(pdgcode == 22 && k == 0){
3595  fEnergyRatioGamma1[fiCut]->Fill(clus->GetClusterMCEdepFraction(k), dummy->E());
3596  fEnergyDepGamma1[fiCut]->Fill(clus->GetClusterMCEdepFraction(k)*clus->E(), dummy->E());
3597  if(InsideJet){
3598  fEnergyRatioGamma1inJets[fiCut]->Fill(clus->GetClusterMCEdepFraction(k), dummy->E());
3599  fEnergyDepGamma1inJets[fiCut]->Fill(clus->GetClusterMCEdepFraction(k)*clus->E(), dummy->E());
3600  }
3601  }
3602  if(pdgcode == 22){
3603  fEnergyRatioGammaAnywhere[fiCut]->Fill(clus->GetClusterMCEdepFraction(k), dummy->E());
3604  fEnergyDepGammaAnywhere[fiCut]->Fill(clus->GetClusterMCEdepFraction(k)*clus->E(), dummy->E());
3605  if(InsideJet){
3606  fEnergyRatioGammaAnywhereinJets[fiCut]->Fill(clus->GetClusterMCEdepFraction(k), dummy->E());
3607  fEnergyDepGammaAnywhereinJets[fiCut]->Fill(clus->GetClusterMCEdepFraction(k)*clus->E(), dummy->E());
3608  }
3609  }
3610  if(pdgcode == 22){
3611  Double_t energyGamma = clus->GetClusterMCEdepFraction(k)*clus->E();
3612  if(energyGamma < 0.7){
3613  fEnergyRatioGamma1Helped[fiCut]->Fill(energyGamma);
3614  if(InsideJet){
3615  fEnergyRatioGamma1HelpedinJets[fiCut]->Fill(energyGamma);
3616  }
3617  }
3618  }
3619  }
3620  }
3621  }
3622 
3623  fIsFromDesiredHeader = kTRUE;
3625  // test whether largest contribution to cluster orginates in added signals
3626  if (fIsMC>0 && ((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetSignalRejection() > 0){
3627  // Set the jetjet weight to 1 in case the photon candidate orignated from the minimum bias header
3628  if ( ((AliConvEventCuts*)fEventCutArray->At(fiCut))->IsParticleFromBGEvent(PhotonCandidate->GetCaloPhotonMCLabel(0), fMCEvent, fInputEvent) == 2 && ((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetSignalRejection() == 4) tempPhotonWeight = 1;
3629  if ( ((AliConvEventCuts*)fEventCutArray->At(fiCut))->IsParticleFromBGEvent(PhotonCandidate->GetCaloPhotonMCLabel(0), fMCEvent, fInputEvent) == 0) fIsFromDesiredHeader = kFALSE;
3630  if (clus->GetNLabels()>1){
3631  Int_t* mclabelsCluster = clus->GetLabels();
3632  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;
3633  for (Int_t l = 1; l < (Int_t)clus->GetNLabels(); l++ ){
3634  if (((AliConvEventCuts*)fEventCutArray->At(fiCut))->IsParticleFromBGEvent(mclabelsCluster[l], fMCEvent, fInputEvent, fLocalDebugFlag) == 0) fIsOverlappingWithOtherHeader = kTRUE;
3635  }
3636  if (fLocalDebugFlag > 1 && fIsOverlappingWithOtherHeader) cout << "found overlapping header: " << endl;
3637  }
3638  }
3639 
3640  fHistoClusAllHeadersGammaPt[fiCut]->Fill(PhotonCandidate->Pt(), tempPhotonWeight);
3641  if (!fIsFromDesiredHeader) fHistoClusRejectedHeadersGammaPt[fiCut]->Fill(PhotonCandidate->Pt(), tempPhotonWeight);
3642  if (fIsFromDesiredHeader && fIsOverlappingWithOtherHeader) fHistoClusOverlapHeadersGammaPt[fiCut]->Fill(PhotonCandidate->Pt(), tempPhotonWeight);
3643 
3644 
3646  fHistoClusGammaPt[fiCut]->Fill(PhotonCandidate->Pt(), tempPhotonWeight);
3647  fHistoClusGammaE[fiCut]->Fill(PhotonCandidate->E(), tempPhotonWeight);
3648  if (!fDoLightOutput && fDoClusterQA > 0) fHistoClusGammaPtM02[fiCut]->Fill(PhotonCandidate->Pt(), clus->GetM02(), tempPhotonWeight);
3649  if(fIsMC> 0){
3650  if(fInputEvent->IsA()==AliESDEvent::Class()){
3651  ProcessTrueClusterCandidates(PhotonCandidate,clus);
3652  } else {
3653  ProcessTrueClusterCandidatesAOD(PhotonCandidate,clus);
3654  }
3655  }
3656 
3657  fClusterCandidates->Add(PhotonCandidate); // if no second loop is required add to events good gammas
3658  } else{
3659  delete PhotonCandidate;
3660  }
3661 
3662  delete clus;
3663  delete tmpvec;
3664  }
3665  if(fDoJetAnalysis == kTRUE && fIsMC > 0 && fDoClusterQA == kTRUE){
3666  if(NClusinJets > 0) fNumberOfClustersinJets[fiCut]->Fill(NClusinJets);
3667  }
3668 
3669  if(fProduceCellIDPlots){
3670  for(Long_t i = 0; i < nclus; i++){
3671  if( mapIsClusterAccepted[i] != 1 ) continue;
3672 
3673  AliVCluster* clus = NULL;
3674  if(fInputEvent->IsA()==AliESDEvent::Class()){
3675  if(arrClustersProcess)
3676  clus = new AliESDCaloCluster(*(AliESDCaloCluster*)arrClustersProcess->At(i));
3677  else
3678  clus = new AliESDCaloCluster(*(AliESDCaloCluster*)fInputEvent->GetCaloCluster(i));
3679  } else if(fInputEvent->IsA()==AliAODEvent::Class()){
3680  if(arrClustersProcess)
3681  clus = new AliAODCaloCluster(*(AliAODCaloCluster*)arrClustersProcess->At(i));
3682  else
3683  clus = new AliAODCaloCluster(*(AliAODCaloCluster*)fInputEvent->GetCaloCluster(i));
3684  }
3685 
3686  if(!clus) continue;
3687 
3688  Int_t cellID = ((AliCaloPhotonCuts*)fClusterCutArray->At(fiCut))->FindLargestCellInCluster(clus,fInputEvent);
3689  fHistCellIDvsClusterEnergy[fiCut]->Fill(clus->E(),cellID);
3690  if (maxClusterID == i && maxClusterID > -1 ) fHistCellIDvsClusterEnergyMax[fiCut]->Fill(maxClusterEnergy,cellID);
3691  delete clus;
3692  }
3693  }
3694 
3695  if(fProduceTreeEOverP){
3696  AliESDEvent *esdev = dynamic_cast<AliESDEvent*>(fInputEvent);
3697  AliAODEvent *aodev = 0;
3698  Bool_t isESD = kTRUE;
3699  if (!esdev) {
3700  isESD = kFALSE;
3701  aodev = dynamic_cast<AliAODEvent*>(fInputEvent);
3702  if (!aodev) {
3703  AliError("Task needs AOD or ESD event...");
3704  }
3705  }
3706 
3707  AliESDtrackCuts *EsdTrackCuts = 0x0;
3708  if(esdev){
3709  // Using standard function for setting Cuts
3710  Int_t runNumber = fInputEvent->GetRunNumber();
3711  // if LHC11a or earlier or if LHC13g or if LHC12a-i -> use 2010 cuts
3712  if( (runNumber<=146860) || (runNumber>=197470 && runNumber<=197692) || (runNumber>=172440 && runNumber<=193766) ){
3713  EsdTrackCuts = AliESDtrackCuts::GetStandardITSTPCTrackCuts2010();
3714  // else if run2 data use 2015 PbPb cuts
3715  }else if (runNumber>=209122){
3716  EsdTrackCuts = AliESDtrackCuts::GetStandardITSTPCTrackCuts2015PbPb();
3717  // else use 2011 version of track cuts
3718  }else{
3719  EsdTrackCuts = AliESDtrackCuts::GetStandardITSTPCTrackCuts2011();
3720  }
3721  EsdTrackCuts->SetMaxDCAToVertexZ(2);
3722  EsdTrackCuts->SetEtaRange(-0.8, 0.8);
3723  EsdTrackCuts->SetPtRange(0.15);
3724  }
3725 
3726  for(Long_t i = 0; i < nclus; i++){
3727  if( mapIsClusterAcceptedWithoutTrackMatch[i] != 1 ) continue;
3728 
3729  AliVCluster* clus = NULL;
3730  if(fInputEvent->IsA()==AliESDEvent::Class()){
3731  if(arrClustersProcess)
3732  clus = new AliESDCaloCluster(*(AliESDCaloCluster*)arrClustersProcess->At(i));
3733  else
3734  clus = new AliESDCaloCluster(*(AliESDCaloCluster*)fInputEvent->GetCaloCluster(i));
3735  } else if(fInputEvent->IsA()==AliAODEvent::Class()){
3736  if(arrClustersProcess)
3737  clus = new AliAODCaloCluster(*(AliAODCaloCluster*)arrClustersProcess->At(i));
3738  else
3739  clus = new AliAODCaloCluster(*(AliAODCaloCluster*)fInputEvent->GetCaloCluster(i));
3740  }
3741 
3742  if(!clus) continue;
3743 
3744  fClusterE = clus->E();
3745  fClusterM02 = clus->GetM02();
3746  fClusterM20 = clus->GetM20();
3747  fClusterLeadCellID = ((AliCaloPhotonCuts*)fClusterCutArray->At(fiCut))->FindLargestCellInCluster(clus,fInputEvent);
3748 
3749  Int_t labelTrackMatch = -1;
3750  if(!((AliCaloPhotonCuts*)fClusterCutArray->At(fiCut))->GetHighestPtMatchedTrackToCluster(fInputEvent,clus,labelTrackMatch)){
3751  delete clus;
3752  continue;
3753  }
3754 
3755  AliVTrack* currTrack = dynamic_cast<AliVTrack*>(fInputEvent->GetTrack(labelTrackMatch));
3756  if(!currTrack){
3757  delete clus;
3758  continue;
3759  }
3760  if(esdev){
3761  AliESDtrack *esdt = dynamic_cast<AliESDtrack*>(currTrack);
3762  if(!EsdTrackCuts->AcceptTrack(esdt)){
3763  delete clus;
3764  continue;
3765  }
3766  if(esdt->Pt()<1.){
3767  delete clus;
3768  continue;
3769  }
3770  fClusterEP = fClusterE/esdt->P();
3771  fTrackPt = esdt->Pt();
3772  }else if(aodev){
3773  AliAODTrack *aodt = dynamic_cast<AliAODTrack*>(currTrack);
3774  if(!aodt->IsHybridGlobalConstrainedGlobal()){
3775  delete clus;
3776  continue;
3777  }
3778  if(TMath::Abs(aodt->Eta())>0.8){
3779  delete clus;
3780  continue;
3781  }
3782  if(aodt->Pt()<1.){
3783  delete clus;
3784  continue;
3785  }
3786  fClusterEP = fClusterE/aodt->P();
3787  fTrackPt = aodt->Pt();
3788  }
3789 
3790  AliPIDResponse* pidResponse = ((AliConversionPhotonCuts*)fV0Reader->GetConversionCuts())->GetPIDResponse();
3791  if(!pidResponse){
3792  delete clus;
3793  continue;
3794  }
3795 
3796  Float_t temp = TMath::Abs(pidResponse->NumberOfSigmasTPC(currTrack,AliPID::kElectron));
3797  if(temp<10.){
3798  fTrackPID_e = temp*10;
3799  }else fTrackPID_e = 99;
3800 
3801  temp = TMath::Abs(pidResponse->NumberOfSigmasTPC(currTrack,AliPID::kPion));
3802  if(temp<10.){
3803  fTrackPID_Pi = temp*10;
3804  }else fTrackPID_Pi = 99;
3805 
3806  temp = TMath::Abs(pidResponse->NumberOfSigmasTPC(currTrack,AliPID::kKaon));
3807  if(temp<10.){
3808  fTrackPID_K = temp*10;
3809  }else fTrackPID_K = 99;
3810 
3811  temp = TMath::Abs(pidResponse->NumberOfSigmasTPC(currTrack,AliPID::kProton));
3812  if(temp<10.){
3813  fTrackPID_P = temp*10;
3814  }else fTrackPID_P = 99;
3815 
3816  Float_t tempEta = -99999;
3817  Float_t tempPhi = -99999;
3818  ((AliCaloTrackMatcher*)((AliCaloPhotonCuts*)fClusterCutArray->At(fiCut))->GetCaloTrackMatcherInstance())->GetTrackClusterMatchingResidual(currTrack->GetID(),clus->GetID(),tempEta,tempPhi);
3819  fDeltaEta = tempEta;
3820  fDeltaPhi = tempPhi;
3821 
3822  //determine isolation in cluster Et
3823  Float_t clsPos[3] = {0.,0.,0.};
3824  Float_t secondClsPos[3] = {0.,0.,0.};
3825  TLorentzVector clusterVector;
3826 
3827  clus->GetPosition(clsPos);
3828  TVector3 clsPosVec(clsPos);
3829 
3830  Float_t sum_Et = 0;
3831  for(Int_t j=0; j<nclus; j++){
3832  if( i == j ) continue;
3833  if( mapIsClusterAcceptedWithoutTrackMatch[j] != 1 ) continue;
3834 
3835  AliVCluster* secondClus = NULL;
3836  if(fInputEvent->IsA()==AliESDEvent::Class()){
3837  if(arrClustersProcess)
3838  secondClus = new AliESDCaloCluster(*(AliESDCaloCluster*)arrClustersProcess->At(j));
3839  else
3840  secondClus = new AliESDCaloCluster(*(AliESDCaloCluster*)fInputEvent->GetCaloCluster(j));
3841  } else if(fInputEvent->IsA()==AliAODEvent::Class()){
3842  if(arrClustersProcess)
3843  secondClus = new AliAODCaloCluster(*(AliAODCaloCluster*)arrClustersProcess->At(j));
3844  else
3845  secondClus = new AliAODCaloCluster(*(AliAODCaloCluster*)fInputEvent->GetCaloCluster(j));
3846  }
3847 
3848  if(!secondClus) continue;
3849  secondClus->GetPosition(secondClsPos);
3850  TVector3 secondClsPosVec(secondClsPos);
3851 
3852  Float_t dPhi = clsPosVec.DeltaPhi(secondClsPosVec);
3853  Float_t dEta = clsPosVec.Eta()-secondClsPosVec.Eta();
3854  if(TMath::Sqrt(dEta*dEta + dPhi*dPhi) < 0.2){
3855  secondClus->GetMomentum(clusterVector,vertex);
3856  sum_Et += clusterVector.Et();
3857  }
3858  delete secondClus;
3859  }
3860  fClusterIsoSumClusterEt = sum_Et;
3861 
3862  //determine isolation in track Et
3863  fClusterIsoSumTrackEt = ((AliCaloTrackMatcher*)((AliCaloPhotonCuts*)fClusterCutArray->At(fiCut))->GetCaloTrackMatcherInstance())->SumTrackEtAroundCluster(fInputEvent,clus->GetID(),0.2);
3864  //remove Et from matched track
3865  TLorentzVector vecTrack;
3866  vecTrack.SetPxPyPzE(currTrack->Px(),currTrack->Py(),currTrack->Pz(),currTrack->E());
3867  fClusterIsoSumTrackEt -= vecTrack.Et();
3868 
3869  //get cluster classification
3870  if(fIsMC > 0) fClusterClassification = ((AliCaloPhotonCuts*)fClusterCutArray->At(fiCut))->ClassifyClusterForTMEffi(clus,fInputEvent,fMCEvent,isESD);
3871 
3872  tClusterEOverP[fiCut]->Fill();
3873  delete clus;
3874  }
3875  mapIsClusterAcceptedWithoutTrackMatch.clear();
3876  }
3877 
3878  if(fProduceCellIDPlots || fProduceTreeEOverP) mapIsClusterAccepted.clear();
3879 
3880  if(fLocalDebugFlag == 2) EventDebugMethod();
3881 
3882  return;
3883 }
3884 
3885 //________________________________________________________________________
3887 
3888  // Loop over Photon Candidates allocated by ReaderV1
3889  for(Int_t i = 0; i < fReaderGammas->GetEntriesFast(); i++){
3890  AliAODConversionPhoton* PhotonCandidate = (AliAODConversionPhoton*) fReaderGammas->At(i);
3891  if(!PhotonCandidate) continue;
3892  if(!fConversionCuts->PhotonIsSelected(PhotonCandidate,fInputEvent)) continue;
3893  if(!fConversionCuts->InPlaneOutOfPlaneCut(PhotonCandidate->GetPhotonPhi(),fEventPlaneAngle)) continue;
3895  fGammaCandidates->Add(PhotonCandidate);
3896  }
3897  }
3898 }
3899 
3900 //________________________________________________________________________
3902 {
3904  if(fConvJetReader->GetNJets()>0){
3912  if(fIsMC > 0 && fConvJetReader->GetTrueNJets()>0){
3916  }
3918  fJetSector = 0;
3919  Double_t tempMaxJetPt = 0.;
3920  Int_t MaxPtJetID = 0;
3921  for(Int_t i=0; i<fConvJetReader->GetNJets(); i++){
3922  fHistoPtJet[fiCut]->Fill(fVectorJetPt.at(i));
3923  fHistoJetEta[fiCut]->Fill(fVectorJetEta.at(i));
3924  fHistoJetPhi[fiCut]->Fill(fVectorJetPhi.at(i));
3925  fHistoJetArea[fiCut]->Fill(fVectorJetArea.at(i));
3926  if(fIsMC > 0 && fConvJetReader->GetNJets()>0 && fConvJetReader->GetTrueNJets()>0){
3927  Double_t min = 100;
3928  Int_t match = 0;
3929  for(Int_t j = 0; j<fConvJetReader->GetTrueNJets(); j++){
3930  Double_t R_jetjet;
3931  Double_t DeltaEta = fVectorJetEta.at(i)-fTrueVectorJetEta.at(j);
3932  Double_t DeltaPhi = abs(fVectorJetPhi.at(i)-fTrueVectorJetPhi.at(j));
3933  if(DeltaPhi > M_PI) {
3934  DeltaPhi = 2*M_PI - DeltaPhi;
3935  }
3936  R_jetjet = TMath::Sqrt(pow((DeltaEta),2)+pow((DeltaPhi),2));
3937  if(R_jetjet < min){
3938  min = R_jetjet;
3939  match = j;
3940  }
3941  }
3943  }
3944  if(((AliConversionMesonCuts*)fMesonCutArray->At(fiCut))->DoSectorJetMixing()){ //Determine jet with max pt in event
3945  if(fVectorJetPt.at(i) > tempMaxJetPt){
3946  tempMaxJetPt = fVectorJetPt.at(i);
3947  MaxPtJetID = i;
3948  }
3949  }
3950  }
3951  fHistoEventwJets[fiCut]->Fill(0);
3952 
3953  if(((AliConversionMesonCuts*)fMesonCutArray->At(fiCut))->DoSectorJetMixing()){
3954  Double_t PtMaxPhi = fVectorJetPhi.at(MaxPtJetID);
3955  fJetSector = 0;
3956  if((PtMaxPhi > (TMath::Pi()/4.)) && (PtMaxPhi < (3*TMath::Pi()/4.))) fJetSector = 1;
3957  if((PtMaxPhi > (3*TMath::Pi()/4.)) && (PtMaxPhi < (5*TMath::Pi()/4.))) fJetSector = 2;
3958  if((PtMaxPhi > (5*TMath::Pi()/4.)) && (PtMaxPhi < (7*TMath::Pi()/4.))) fJetSector = 3;
3959  if((PtMaxPhi > (7*TMath::Pi()/4.)) && (PtMaxPhi < (TMath::Pi()/4.))) fJetSector = 4;
3960  if(fVectorJetEta.at(MaxPtJetID)>0) fJetSector += 4;
3961  }else if(((AliConversionMesonCuts*)fMesonCutArray->At(fiCut))->DoJetMixing()){
3962  Double_t MaxPt = 0.;
3963  for(Int_t k = 0; k < fConvJetReader->GetNJets(); k++){
3964  if(fVectorJetEta.at(k) > (-0.6687 -0.4) && fVectorJetEta.at(k) < (0.66465 + 0.4)){
3965  if(fVectorJetPhi.at(k) > (1.39626 -0.4) && fVectorJetPhi.at(k) < (3.15 + 0.4)){ //INSIDE EMCAL
3966  fJetNearEMCal = kTRUE;
3967  if(fVectorJetPhi.at(k) > MaxPt){
3968  MaxPt = fVectorJetPt.at(k);
3970  }
3971  }else fJetNearEMCal = kFALSE;
3972  }else fJetNearEMCal = kFALSE;
3973  }
3974  }
3975  }
3976  fVectorJetPt.clear();
3977  fVectorJetPx.clear();
3978  fVectorJetPy.clear();
3979  fVectorJetPz.clear();
3980  fVectorJetEta.clear();
3981  fVectorJetPhi.clear();
3982  fVectorJetArea.clear();
3983  if(fIsMC > 0 && fConvJetReader->GetTrueNJets()>0){
3984  fTrueVectorJetPt.clear();
3985  fTrueVectorJetEta.clear();
3986  fTrueVectorJetPhi.clear();
3987  }
3988  }
3989 }
3990 
3991 //________________________________________________________________________
3993 {
3994  const AliVVertex* primVtxMC = fMCEvent->GetPrimaryVertex();
3995  Double_t mcProdVtxX = primVtxMC->GetX();
3996  Double_t mcProdVtxY = primVtxMC->GetY();
3997  Double_t mcProdVtxZ = primVtxMC->GetZ();
3998 
3999  Double_t tempPhotonWeight = fWeightJetJetMC;
4000  TParticle *Photon = NULL;
4001  if (!TruePhotonCandidate->GetIsCaloPhoton()) AliFatal("CaloPhotonFlag has not been set task will abort");
4002  if (!fDoLightOutput && fDoClusterQA > 0) fHistoTrueNLabelsInClus[fiCut]->Fill(TruePhotonCandidate->GetNCaloPhotonMCLabels(), tempPhotonWeight);
4003 
4004  if (TruePhotonCandidate->GetCaloPhotonMCLabel(0) < 0) return;
4005  if (TruePhotonCandidate->GetNCaloPhotonMCLabels() > 0) Photon = fMCEvent->Particle(TruePhotonCandidate->GetCaloPhotonMCLabel(0));
4006  else return;
4007 
4008  if(Photon == NULL){
4009  // cout << "no photon" << endl;
4010  return;
4011  }
4012  // Set the jetjet weight to 1 in case the photon orignated from the minimum bias header
4013  if (fIsMC>0 && ((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetSignalRejection() == 4){
4014  if ( ((AliConvEventCuts*)fEventCutArray->At(fiCut))->IsParticleFromBGEvent(TruePhotonCandidate->GetCaloPhotonMCLabel(0), fMCEvent, fInputEvent) == 2) tempPhotonWeight = 1;
4015  }
4016 
4017  Int_t pdgCodeParticle = Photon->GetPdgCode();
4018  TruePhotonCandidate->SetCaloPhotonMCFlags(fMCEvent, fEnableSortForClusMC);
4019 
4020  // True Photon
4021 
4022  if (TruePhotonCandidate->IsLargestComponentPhoton() || (TruePhotonCandidate->IsLargestComponentElectron() && TruePhotonCandidate->IsConversion())) {
4023  fHistoTrueClusGammaPt[fiCut]->Fill(TruePhotonCandidate->Pt(), tempPhotonWeight);
4024  if (!fDoLightOutput && fDoClusterQA > 0) fHistoTrueClusGammaPtM02[fiCut]->Fill(TruePhotonCandidate->Pt(), clus->GetM02(), tempPhotonWeight);
4025  } else if (fDoClusterQA > 0) fHistoTrueClusEMNonLeadingPt[fiCut]->Fill(TruePhotonCandidate->Pt());
4026  if (fDoClusterQA > 0){
4027  if (TruePhotonCandidate->IsLargestComponentPhoton()){
4028  fHistoTrueClusUnConvGammaPt[fiCut]->Fill(TruePhotonCandidate->Pt(), tempPhotonWeight);
4029  fHistoTrueClusUnConvGammaMCPt[fiCut]->Fill(Photon->Pt(), tempPhotonWeight);
4030  if (!fDoLightOutput) fHistoTrueClusUnConvGammaPtM02[fiCut]->Fill(TruePhotonCandidate->Pt(), clus->GetM02(), tempPhotonWeight);
4031  }
4032  if (TruePhotonCandidate->IsLargestComponentElectron())
4033  fHistoTrueClusElectronPt[fiCut]->Fill(TruePhotonCandidate->Pt(), tempPhotonWeight);
4034  if (TruePhotonCandidate->IsLargestComponentElectron() && TruePhotonCandidate->IsConversion()){
4035  fHistoTrueClusConvGammaPt[fiCut]->Fill(TruePhotonCandidate->Pt(), tempPhotonWeight);
4036  if(Photon->GetMother(0) > -1){
4037  TParticle* motherPart = (TParticle*)fMCEvent->Particle(Photon->GetMother(0));
4038  fHistoTrueClusConvGammaMCPt[fiCut]->Fill(motherPart->Pt(), tempPhotonWeight);