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