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