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