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