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