AliPhysics  608b256 (608b256)
AliAnalysisTaskGammaCaloMerged.cxx
Go to the documentation of this file.
1 /**************************************************************************
2  * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3  * *
4  * Author: Friederike Bock *
5  * Version 1.0 *
6  * *
7  * *
8  * Permission to use, copy, modify and distribute this software and its *
9  * documentation strictly for non-commercial purposes is hereby granted *
10  * without fee, provided that the above copyright notice appears in all *
11  * copies and that both the copyright notice and this permission notice *
12  * appear in the supporting documentation. The authors make no claims *
13  * about the suitability of this software for any purpose. It is *
14  * provided "as is" without express or implied warranty. *
15  **************************************************************************/
16 
18 //----------------------------------------------------------------
19 // Class used to do analysis on conversion photons + calo photons
20 //----------------------------------------------------------------
22 #include "TChain.h"
23 #include "TTree.h"
24 #include "TBranch.h"
25 #include "TFile.h"
26 #include "TH1F.h"
27 #include "TH2F.h"
28 #include "TH3F.h"
29 #include "THnSparse.h"
30 #include "TCanvas.h"
31 #include "TNtuple.h"
32 #include "AliAnalysisTask.h"
33 #include "AliAnalysisManager.h"
34 #include "AliESDEvent.h"
35 #include "AliESDInputHandler.h"
36 #include "AliMCEventHandler.h"
37 #include "AliMCEvent.h"
38 #include "AliMCParticle.h"
39 #include "AliCentrality.h"
40 #include "AliESDVZERO.h"
41 #include "AliESDpid.h"
43 #include "AliVParticle.h"
44 #include "AliESDtrack.h"
45 #include "AliESDtrackCuts.h"
46 #include "AliKFVertex.h"
47 #include "AliV0ReaderV1.h"
48 #include "AliGenCocktailEventHeader.h"
49 #include "AliAODMCParticle.h"
50 #include "AliAODMCHeader.h"
51 #include "AliEventplane.h"
53 #include "AliAODEvent.h"
54 #include "AliAODInputHandler.h"
55 #include "AliESDEvent.h"
56 #include "AliESDInputHandler.h"
57 #include "AliInputEventHandler.h"
58 #include "AliCaloTrackMatcher.h"
59 #include <vector>
60 #include <map>
61 
63 
64 //________________________________________________________________________
66  fV0Reader(NULL),
67  fV0ReaderName("V0ReaderV1"),
68  fCorrTaskSetting(""),
69  fDoLightOutput(kFALSE),
70  fInputEvent(NULL),
71  fMCEvent(NULL),
72  fCutFolder(NULL),
73  fESDList(NULL),
74  fTrueList(NULL),
75  fMCList(NULL),
76  fHeaderNameList(NULL),
77  fOutputContainer(NULL),
78  fNClusterCandidates(0),
79  fNClusterMergedCandidates(0),
80  fEventCutArray(NULL),
81  fEventCuts(NULL),
82  fClusterCutArray(NULL),
83  fClusterMergedCutArray(NULL),
84  fMesonCutArray(NULL),
85  fMesonCuts(NULL),
86  fHistoMotherInvMassPt(NULL),
87  fHistoMotherPtY(NULL),
88  fHistoMotherPtAlpha(NULL),
89  fHistoClusGammaPt(NULL),
90  fHistoClusGammaE(NULL),
91  fHistoClusOverlapHeadersGammaPt(NULL),
92  fHistoClusNLMPt(NULL),
93  fHistoClusMergedPtvsM02(NULL),
94  fHistoClusMergedPtvsM02Accepted(NULL),
95  fHistoClusMergedEvsM02Accepted(NULL),
96  fHistoClusNCellsPt(NULL),
97  fHistoClusMergedNCellsPt(NULL),
98  fHistoClusMergedNParticlePt(NULL),
99  fHistoClusMergedNCellsAroundPt(NULL),
100  fHistoClusMergedNCellsAroundAndInPt(NULL),
101  fHistoClusMergedEAroundE(NULL),
102  fHistoMCHeaders(NULL),
103  fHistoMCPi0Pt(NULL),
104  fHistoMCPi0WOWeightPt(NULL),
105  fHistoMCPi0WOEvtWeightPt(NULL),
106  fHistoMCEtaPt(NULL),
107  fHistoMCEtaWOWeightPt(NULL),
108  fHistoMCEtaWOEvtWeightPt(NULL),
109  fHistoMCPi0DalitzPt(NULL),
110  fHistoMCPi0DalitzWOWeightPt(NULL),
111  fHistoMCPi0DalitzWOEvtWeightPt(NULL),
112  fHistoMCEtaDalitzPt(NULL),
113  fHistoMCEtaDalitzWOWeightPt(NULL),
114  fHistoMCEtaDalitzWOEvtWeightPt(NULL),
115  fHistoMCPi0InAccPt(NULL),
116  fHistoMCEtaInAccPt(NULL),
117  fHistoMCPi0WOEvtWeightInAccPt(NULL),
118  fHistoMCEtaWOEvtWeightInAccPt(NULL),
119  fHistoMCPi0DalitzInAccPt(NULL),
120  fHistoMCEtaDalitzInAccPt(NULL),
121  fHistoMCPi0DalitzWOEvtWeightInAccPt(NULL),
122  fHistoMCEtaDalitzWOEvtWeightInAccPt(NULL),
123  fHistoMCSecPi0PtvsSource(NULL),
124  fHistoMCSecPi0InAccPtvsSource(NULL),
125  fHistoMCPi0PtJetPt(NULL),
126  fHistoMCEtaPtJetPt(NULL),
127  fHistoMCPrimaryPtvsSource(NULL),
128  fHistoMCPrimaryYvsSource(NULL),
129  fHistoMCDecayGammaPt(NULL),
130  fHistoMCAllGammaPt(NULL),
131  fHistoTrueClusMergedPtvsM02(NULL),
132  fHistoTrueClusPi0PtvsM02(NULL),
133  fHistoTrueClusMultiplePi0PtvsM02(NULL),
134  fHistoTrueClusPi0DalitzPtvsM02(NULL),
135  fHistoTrueClusPrimPi0PtvsM02(NULL),
136  fHistoTrueClusMultiplePrimPi0PtvsM02(NULL),
137  fHistoTrueClusSecPi0PtvsM02(NULL),
138  fHistoTrueClusSecPi0FromK0sPtvsM02(NULL),
139  fHistoTrueClusSecPi0FromK0lPtvsM02(NULL),
140  fHistoTrueClusSecPi0FromLambdaPtvsM02(NULL),
141  fHistoTrueClusEtaPtvsM02(NULL),
142  fHistoTrueClusEtaDalitzPtvsM02(NULL),
143  fHistoTrueClusMergedPureFromPi0PtvsM02(NULL),
144  fHistoTrueClusMergedPureFromEtaPtvsM02(NULL),
145  fHistoTrueClusMergedPartConvFromPi0PtvsM02(NULL),
146  fHistoTrueClusMergedPartConvFromEtaPtvsM02(NULL),
147  fHistoNTrueMultiplePi0vsPt(NULL),
148  fHistoTrueClusGammaFromPi0PtvsM02(NULL),
149  fHistoTrueClusGammaFromEtaPtvsM02(NULL),
150  fHistoTrueClusElectronFromPi0PtvsM02(NULL),
151  fHistoTrueClusElectronFromEtaPtvsM02(NULL),
152  fHistoTrueSecPi0PtvsDiffReco(NULL),
153  fHistoTrueClusBGPtvsM02(NULL),
154  fHistoTrueClusGammaPtvsM02(NULL),
155  fHistoTrueClusGammaPartConvPtvsM02(NULL),
156  fHistoTrueClusElectronPtvsM02(NULL),
157  fHistoTrueClusElectronFromGammaPtvsM02(NULL),
158  fHistoTrueClusMergedInvMassvsPt(NULL),
159  fHistoTrueClusPi0InvMassvsPt(NULL),
160  fHistoTrueClusPrimPi0InvMassvsPt(NULL),
161  fHistoTrueClusEtaInvMassvsPt(NULL),
162  fHistoTrueClusBGInvMassvsPt(NULL),
163  fHistoTrueClusGammaInvMassvsPt(NULL),
164  fHistoTrueClusElectronInvMassvsPt(NULL),
165  fHistoTrueClusBGPtvsSource(NULL),
166  fHistoTrueClusGammaPtvsSource(NULL),
167  fHistoTrueClusElectronPtvsSource(NULL),
168 // fHistoTrueClusElectronPtvsMotherID(NULL),
169 // fHistoTrueClusElectronPtvsTopMotherID(NULL),
170 // fHistoTrueClusElectronPtvsConvPhotonTopMotherID(NULL),
171  fHistoTrueMergedMissedPDG(NULL),
172  fHistoTruePi0PtY(NULL),
173  fHistoTrueEtaPtY(NULL),
174  fHistoTruePi0PtAlpha(NULL),
175  fHistoTrueEtaPtAlpha(NULL),
176  fHistoTrueClusGammaEM02(NULL),
177  fHistoTrueClusElectronEM02(NULL),
178  fHistoTrueClusPi0EM02(NULL),
179  fHistoTrueClusEtaEM02(NULL),
180  fHistoTruePrimaryPi0PureMergedMCPtResolPt(NULL),
181  fHistoTruePrimaryPi0MergedPartConvMCPtResolPt(NULL),
182  fHistoTruePrimaryPi01GammaMCPtResolPt(NULL),
183  fHistoTruePrimaryPi01ElectronMCPtResolPt(NULL),
184  fHistoTruePrimaryEtaMCPtResolPt(NULL),
185  fHistoTrueSecondaryPi0MCPtResolPt(NULL),
186  fHistoDoubleCountTruePi0PtvsM02(NULL),
187  fHistoDoubleCountTrueSecPi0Pt(NULL),
188  fHistoDoubleCountTrueMultiplePi0PtvsM02(NULL),
189  fHistoDoubleCountTrueMultipleSecPi0Pt(NULL),
190  fHistoDoubleCountTrueEtaPtvsM02(NULL),
191  fVectorDoubleCountTruePi0s(0),
192  fVectorDoubleCountTrueMultilePi0s(0),
193  fVectorDoubleCountTrueEtas(0),
194  fHistoNEvents(NULL),
195  fHistoNEventsWOWeight(NULL),
196  fHistoNGoodESDTracks(NULL),
197  fHistoVertexZ(NULL),
198  fHistoNClusterCandidates(NULL),
199  fHistoNClusterMergedCandidates(NULL),
200  fHistoNGoodESDTracksVsNClusterCandidates(NULL),
201  fHistoSPDClusterTrackletBackground(NULL),
202  fHistoNV0Tracks(NULL),
203  fProfileEtaShift(NULL),
204  fProfileJetJetXSection(NULL),
205  fHistoJetJetNTrials(NULL),
206  fRandom(0),
207  fnCuts(0),
208  fiCut(0),
209  fIsHeavyIon(0),
210  fDoMesonQA(0),
211  fDoClusterQA(0),
212  fIsFromMBHeader(kTRUE),
213  fIsOverlappingWithOtherHeader(kFALSE),
214  fIsMC(0),
215  fSetPlotHistsExtQA(kFALSE),
216  fWeightJetJetMC(1),
217  fSelectedMesonID(0),
218  fEnableDetailedPrintOut(kFALSE),
219  fEnableSortForClusMC(kFALSE),
220  tBrokenFiles(NULL),
221  fFileNameBroken(NULL),
222  fDoDetailedM02(NULL),
223  fTrackMatcherRunningMode(0)
224 {
225 
226 }
227 
228 //________________________________________________________________________
230  AliAnalysisTaskSE(name),
231  fV0Reader(NULL),
232  fV0ReaderName("V0ReaderV1"),
233  fCorrTaskSetting(""),
234  fDoLightOutput(kFALSE),
235  fInputEvent(NULL),
236  fMCEvent(NULL),
237  fCutFolder(NULL),
238  fESDList(NULL),
239  fTrueList(NULL),
240  fMCList(NULL),
241  fHeaderNameList(NULL),
242  fOutputContainer(NULL),
243  fNClusterCandidates(0),
244  fNClusterMergedCandidates(0),
245  fEventCutArray(NULL),
246  fEventCuts(NULL),
247  fClusterCutArray(NULL),
248  fClusterMergedCutArray(NULL),
249  fMesonCutArray(NULL),
250  fMesonCuts(NULL),
251  fHistoMotherInvMassPt(NULL),
252  fHistoMotherPtY(NULL),
253  fHistoMotherPtAlpha(NULL),
254  fHistoClusGammaPt(NULL),
255  fHistoClusGammaE(NULL),
256  fHistoClusOverlapHeadersGammaPt(NULL),
257  fHistoClusNLMPt(NULL),
258  fHistoClusMergedPtvsM02(NULL),
259  fHistoClusMergedPtvsM02Accepted(NULL),
260  fHistoClusMergedEvsM02Accepted(NULL),
261  fHistoClusNCellsPt(NULL),
262  fHistoClusMergedNCellsPt(NULL),
263  fHistoClusMergedNParticlePt(NULL),
264  fHistoClusMergedNCellsAroundPt(NULL),
265  fHistoClusMergedNCellsAroundAndInPt(NULL),
266  fHistoClusMergedEAroundE(NULL),
267  fHistoMCHeaders(NULL),
268  fHistoMCPi0Pt(NULL),
269  fHistoMCPi0WOWeightPt(NULL),
270  fHistoMCPi0WOEvtWeightPt(NULL),
271  fHistoMCEtaPt(NULL),
272  fHistoMCEtaWOWeightPt(NULL),
273  fHistoMCEtaWOEvtWeightPt(NULL),
274  fHistoMCPi0DalitzPt(NULL),
275  fHistoMCPi0DalitzWOWeightPt(NULL),
276  fHistoMCPi0DalitzWOEvtWeightPt(NULL),
277  fHistoMCEtaDalitzPt(NULL),
278  fHistoMCEtaDalitzWOWeightPt(NULL),
279  fHistoMCEtaDalitzWOEvtWeightPt(NULL),
280  fHistoMCPi0InAccPt(NULL),
281  fHistoMCEtaInAccPt(NULL),
282  fHistoMCPi0WOEvtWeightInAccPt(NULL),
283  fHistoMCEtaWOEvtWeightInAccPt(NULL),
284  fHistoMCPi0DalitzInAccPt(NULL),
285  fHistoMCEtaDalitzInAccPt(NULL),
286  fHistoMCPi0DalitzWOEvtWeightInAccPt(NULL),
287  fHistoMCEtaDalitzWOEvtWeightInAccPt(NULL),
288  fHistoMCSecPi0PtvsSource(NULL),
289  fHistoMCSecPi0InAccPtvsSource(NULL),
290  fHistoMCPi0PtJetPt(NULL),
291  fHistoMCEtaPtJetPt(NULL),
292  fHistoMCPrimaryPtvsSource(NULL),
293  fHistoMCPrimaryYvsSource(NULL),
294  fHistoMCDecayGammaPt(NULL),
295  fHistoMCAllGammaPt(NULL),
296  fHistoTrueClusMergedPtvsM02(NULL),
297  fHistoTrueClusPi0PtvsM02(NULL),
298  fHistoTrueClusMultiplePi0PtvsM02(NULL),
299  fHistoTrueClusPi0DalitzPtvsM02(NULL),
300  fHistoTrueClusPrimPi0PtvsM02(NULL),
301  fHistoTrueClusMultiplePrimPi0PtvsM02(NULL),
302  fHistoTrueClusSecPi0PtvsM02(NULL),
303  fHistoTrueClusSecPi0FromK0sPtvsM02(NULL),
304  fHistoTrueClusSecPi0FromK0lPtvsM02(NULL),
305  fHistoTrueClusSecPi0FromLambdaPtvsM02(NULL),
306  fHistoTrueClusEtaPtvsM02(NULL),
307  fHistoTrueClusEtaDalitzPtvsM02(NULL),
308  fHistoTrueClusMergedPureFromPi0PtvsM02(NULL),
309  fHistoTrueClusMergedPureFromEtaPtvsM02(NULL),
310  fHistoTrueClusMergedPartConvFromPi0PtvsM02(NULL),
311  fHistoTrueClusMergedPartConvFromEtaPtvsM02(NULL),
312  fHistoNTrueMultiplePi0vsPt(NULL),
313  fHistoTrueClusGammaFromPi0PtvsM02(NULL),
314  fHistoTrueClusGammaFromEtaPtvsM02(NULL),
315  fHistoTrueClusElectronFromPi0PtvsM02(NULL),
316  fHistoTrueClusElectronFromEtaPtvsM02(NULL),
317  fHistoTrueSecPi0PtvsDiffReco(NULL),
318  fHistoTrueClusBGPtvsM02(NULL),
319  fHistoTrueClusGammaPtvsM02(NULL),
320  fHistoTrueClusGammaPartConvPtvsM02(NULL),
321  fHistoTrueClusElectronPtvsM02(NULL),
322  fHistoTrueClusElectronFromGammaPtvsM02(NULL),
323  fHistoTrueClusMergedInvMassvsPt(NULL),
324  fHistoTrueClusPi0InvMassvsPt(NULL),
325  fHistoTrueClusPrimPi0InvMassvsPt(NULL),
326  fHistoTrueClusEtaInvMassvsPt(NULL),
327  fHistoTrueClusBGInvMassvsPt(NULL),
328  fHistoTrueClusGammaInvMassvsPt(NULL),
329  fHistoTrueClusElectronInvMassvsPt(NULL),
330  fHistoTrueClusBGPtvsSource(NULL),
331  fHistoTrueClusGammaPtvsSource(NULL),
332  fHistoTrueClusElectronPtvsSource(NULL),
333 // fHistoTrueClusElectronPtvsMotherID(NULL),
334 // fHistoTrueClusElectronPtvsTopMotherID(NULL),
335 // fHistoTrueClusElectronPtvsConvPhotonTopMotherID(NULL),
336  fHistoTrueMergedMissedPDG(NULL),
337  fHistoTruePi0PtY(NULL),
338  fHistoTrueEtaPtY(NULL),
339  fHistoTruePi0PtAlpha(NULL),
340  fHistoTrueEtaPtAlpha(NULL),
341  fHistoTrueClusGammaEM02(NULL),
342  fHistoTrueClusElectronEM02(NULL),
343  fHistoTrueClusPi0EM02(NULL),
344  fHistoTrueClusEtaEM02(NULL),
345  fHistoTruePrimaryPi0PureMergedMCPtResolPt(NULL),
346  fHistoTruePrimaryPi0MergedPartConvMCPtResolPt(NULL),
347  fHistoTruePrimaryPi01GammaMCPtResolPt(NULL),
348  fHistoTruePrimaryPi01ElectronMCPtResolPt(NULL),
349  fHistoTruePrimaryEtaMCPtResolPt(NULL),
350  fHistoTrueSecondaryPi0MCPtResolPt(NULL),
351  fHistoDoubleCountTruePi0PtvsM02(NULL),
352  fHistoDoubleCountTrueSecPi0Pt(NULL),
353  fHistoDoubleCountTrueMultiplePi0PtvsM02(NULL),
354  fHistoDoubleCountTrueMultipleSecPi0Pt(NULL),
355  fHistoDoubleCountTrueEtaPtvsM02(NULL),
356  fVectorDoubleCountTruePi0s(0),
357  fVectorDoubleCountTrueMultilePi0s(0),
358  fVectorDoubleCountTrueEtas(0),
359  fHistoNEvents(NULL),
360  fHistoNEventsWOWeight(NULL),
361  fHistoNGoodESDTracks(NULL),
362  fHistoVertexZ(NULL),
363  fHistoNClusterCandidates(NULL),
364  fHistoNClusterMergedCandidates(NULL),
365  fHistoNGoodESDTracksVsNClusterCandidates(NULL),
366  fHistoSPDClusterTrackletBackground(NULL),
367  fHistoNV0Tracks(NULL),
368  fProfileEtaShift(NULL),
369  fProfileJetJetXSection(NULL),
370  fHistoJetJetNTrials(NULL),
371  fRandom(0),
372  fnCuts(0),
373  fiCut(0),
374  fIsHeavyIon(0),
375  fDoMesonQA(0),
376  fDoClusterQA(0),
377  fIsFromMBHeader(kTRUE),
378  fIsOverlappingWithOtherHeader(kFALSE),
379  fIsMC(0),
380  fSetPlotHistsExtQA(kFALSE),
381  fWeightJetJetMC(1),
382  fSelectedMesonID(0),
383  fEnableDetailedPrintOut(kFALSE),
384  fEnableSortForClusMC(kFALSE),
385  tBrokenFiles(NULL),
386  fFileNameBroken(NULL),
387  fDoDetailedM02(NULL),
388  fTrackMatcherRunningMode(0)
389 {
390  // Define output slots here
391  DefineOutput(1, TList::Class());
392 }
393 
395 {
396 
397 }
398 
399 //________________________________________________________________________
401 
402  fV0Reader=(AliV0ReaderV1*)AliAnalysisManager::GetAnalysisManager()->GetTask(fV0ReaderName.Data());
403  if(!fV0Reader){printf("Error: No V0 Reader");return;} // GetV0Reader
404 
405 
406  Int_t invMassBins = 800;
407  Float_t startMass = 0;
408  Float_t endMass = 0.8;
409  Double_t *arrPtBinning = new Double_t[1000];
410 
411  if (GetSelectedMesonID() == 1) {
412  invMassBins = 400;
413  startMass = 0;
414  endMass = 0.4;
415  } else if (GetSelectedMesonID() == 2) {
416  invMassBins = 800;
417  startMass = 0.;
418  endMass = 0.8;
419  }
420 
421  Int_t ptBinsDefClus = 500;
422  Float_t startPtDefClus = 0;
423  Float_t endPtDefClus = 50;
424 
425  Int_t ptBins = 400;
426  Float_t startPt = 10;
427  Float_t endPt = 50;
428 
429  Int_t ptBinsLog = 200;
430  Float_t startPtLog = 10;
431  Float_t endPtLog = 50;
432  if (GetSelectedMesonID() == 2 ) {
433  ptBins = 500;
434  startPt = 20;
435  endPt = 70;
436  for(Int_t i=0; i<ptBins+1;i++){
437  arrPtBinning[i] = 10.+((endPt-startPt)/ptBins)*i;
438  }
439  ptBinsLog = 250;
440  startPtLog = 20;
441  endPtLog = 70;
442  } else if (((AliConvEventCuts*)fV0Reader->GetEventCuts())->GetEnergyEnum() == AliConvEventCuts::k5TeV ||
443  ((AliConvEventCuts*)fV0Reader->GetEventCuts())->GetEnergyEnum() == AliConvEventCuts::k7TeV ||
444  ((AliConvEventCuts*)fV0Reader->GetEventCuts())->GetEnergyEnum() == AliConvEventCuts::k8TeV ||
448  ptBins = 610;
449  startPt = 10;
450  endPt = 200;
451  // pT dependet binning for very high pT analyses
452  for(Int_t i=0; i<ptBins+2;i++){
453  if(i<400)
454  arrPtBinning[i] = 10.+0.1*i;
455  else if(i<500)
456  arrPtBinning[i] = 50.+0.2*(i-400);
457  else if(i<540)
458  arrPtBinning[i] = 70.+0.5*(i-500);
459  else if(i<570)
460  arrPtBinning[i] = 90.+1.0*(i-540);
461  else
462  arrPtBinning[i] = 120+2.0*(i-570);
463  }
464  ptBinsLog = 475;
465  startPtLog = 10;
466  endPtLog = 200;
467  ptBinsDefClus = 1000;
468  startPtDefClus = 0;
469  endPtDefClus = 200;
470  } else if (((AliConvEventCuts*)fV0Reader->GetEventCuts())->GetEnergyEnum() == AliConvEventCuts::k13TeVLowB ||
472  ptBins = 900;
473  startPt = 10;
474  endPt = 100;
475  for(Int_t i=0; i<ptBins+1;i++){
476  arrPtBinning[i] = 10.+((endPt-startPt)/ptBins)*i;
477  }
478  ptBinsLog = 450;
479  startPtLog = 10;
480  endPtLog = 100;
481  ptBinsDefClus = 1000;
482  startPtDefClus = 0;
483  endPtDefClus = 100;
484  } else {
485  for(Int_t i=0; i<ptBins+1;i++){
486  arrPtBinning[i] = 10.+((endPt-startPt)/ptBins)*i;
487  }
488  }
489 
490  Int_t showerShapeBins = 500;
491  Float_t startShowerShape = 0;
492  Float_t endShowerShape = 5;
493 
494  if (fDoDetailedM02) showerShapeBins = 5000;
495 
496  // Create histograms
497  if(fOutputContainer != NULL){
498  delete fOutputContainer;
499  fOutputContainer = NULL;
500  }
501  if(fOutputContainer == NULL){
502  fOutputContainer = new TList();
503  fOutputContainer->SetOwner(kTRUE);
504  }
505 
506  fCutFolder = new TList*[fnCuts];
507  fESDList = new TList*[fnCuts];
508 
509  fHistoNEvents = new TH1F*[fnCuts];
510  if(fIsMC == 2){
511  fHistoNEventsWOWeight = new TH1F*[fnCuts];
512  fProfileJetJetXSection = new TProfile*[fnCuts];
513  fHistoJetJetNTrials = new TH1F*[fnCuts];
514  }
515 
516  fHistoNGoodESDTracks = new TH1F*[fnCuts];
517  fHistoVertexZ = new TH1F*[fnCuts];
518  fHistoNClusterCandidates = new TH1F*[fnCuts];
522  fHistoNV0Tracks = new TH1F*[fnCuts];
523  fProfileEtaShift = new TProfile*[fnCuts];
524 
526  if (fDoMesonQA > 0 ){
527  fHistoMotherPtY = new TH2F*[fnCuts];
529  }
530 
531  fHistoClusGammaPt = new TH1F*[fnCuts];
532  fHistoClusGammaE = new TH1F*[fnCuts];
537  fHistoClusNLMPt = new TH2F*[fnCuts];
538  if (fDoClusterQA > 0){
544 
545  if (fIsMC > 0){
547  }
548 
549  }
550 
551  for(Int_t iCut = 0; iCut<fnCuts;iCut++){
552  TString cutstringEvent = ((AliConvEventCuts*)fEventCutArray->At(iCut))->GetCutNumber();
553  TString cutstringCalo = ((AliCaloPhotonCuts*)fClusterCutArray->At(iCut))->GetCutNumber();
554  TString cutstringCaloMerged = ((AliCaloPhotonCuts*)fClusterMergedCutArray->At(iCut))->GetCutNumber();
555  TString cutstringMeson = ((AliConversionMesonCuts*)fMesonCutArray->At(iCut))->GetCutNumber();
556 
557  //Int_t nLMCut = ((AliCaloPhotonCuts*)fClusterMergedCutArray->At(iCut))->GetMinNLMCut();
558 
559  fCutFolder[iCut] = new TList();
560  fCutFolder[iCut]->SetName(Form("Cut Number %s_%s_%s_%s",cutstringEvent.Data(), cutstringCalo.Data(), cutstringCaloMerged.Data(), cutstringMeson.Data()));
561  fCutFolder[iCut]->SetOwner(kTRUE);
562  fOutputContainer->Add(fCutFolder[iCut]);
563  fESDList[iCut] = new TList();
564  fESDList[iCut]->SetName(Form("%s_%s_%s_%s ESD histograms",cutstringEvent.Data(), cutstringCalo.Data(), cutstringCaloMerged.Data(), cutstringMeson.Data()));
565  fESDList[iCut]->SetOwner(kTRUE);
566  fCutFolder[iCut]->Add(fESDList[iCut]);
567 
568  fHistoNEvents[iCut] = new TH1F("NEvents","NEvents",14,-0.5,13.5);
569  fHistoNEvents[iCut]->GetXaxis()->SetBinLabel(1,"Accepted");
570  fHistoNEvents[iCut]->GetXaxis()->SetBinLabel(2,"Centrality");
571  fHistoNEvents[iCut]->GetXaxis()->SetBinLabel(3,"Miss. MC or inc. ev.");
572  if (((AliConvEventCuts*)fEventCutArray->At(iCut))->IsSpecialTrigger() > 1 ){
573  TString TriggerNames = "Not Trigger: ";
574  TriggerNames = TriggerNames+ ( (AliConvEventCuts*)fEventCutArray->At(iCut))->GetSpecialTriggerName();
575  fHistoNEvents[iCut]->GetXaxis()->SetBinLabel(4,TriggerNames.Data());
576  } else {
577  fHistoNEvents[iCut]->GetXaxis()->SetBinLabel(4,"Trigger");
578  }
579  fHistoNEvents[iCut]->GetXaxis()->SetBinLabel(5,"Vertex Z");
580  fHistoNEvents[iCut]->GetXaxis()->SetBinLabel(6,"Cont. Vertex");
581  fHistoNEvents[iCut]->GetXaxis()->SetBinLabel(7,"Pile-Up");
582  fHistoNEvents[iCut]->GetXaxis()->SetBinLabel(8,"no SDD");
583  fHistoNEvents[iCut]->GetXaxis()->SetBinLabel(9,"no V0AND");
584  fHistoNEvents[iCut]->GetXaxis()->SetBinLabel(10,"EMCAL problems");
585  fHistoNEvents[iCut]->GetXaxis()->SetBinLabel(11,"rejectedForJetJetMC");
586  fHistoNEvents[iCut]->GetXaxis()->SetBinLabel(12,"SPD hits vs tracklet");
587  fHistoNEvents[iCut]->GetXaxis()->SetBinLabel(13,"Out-of-Bunch pileup Past-Future");
588  fHistoNEvents[iCut]->GetXaxis()->SetBinLabel(14,"Pileup V0M-TPCout Tracks");
589  fESDList[iCut]->Add(fHistoNEvents[iCut]);
590 
591  if (fIsMC == 2){
592  fHistoNEventsWOWeight[iCut] = new TH1F("NEventsWOWeight","NEventsWOWeight",14,-0.5,13.5);
593  fHistoNEventsWOWeight[iCut]->GetXaxis()->SetBinLabel(1,"Accepted");
594  fHistoNEventsWOWeight[iCut]->GetXaxis()->SetBinLabel(2,"Centrality");
595  fHistoNEventsWOWeight[iCut]->GetXaxis()->SetBinLabel(3,"Miss. MC or inc. ev.");
596  if (((AliConvEventCuts*)fEventCutArray->At(iCut))->IsSpecialTrigger() > 1 ){
597  TString TriggerNames = "Not Trigger: ";
598  TriggerNames = TriggerNames+ ( (AliConvEventCuts*)fEventCutArray->At(iCut))->GetSpecialTriggerName();
599  fHistoNEventsWOWeight[iCut]->GetXaxis()->SetBinLabel(4,TriggerNames.Data());
600  } else {
601  fHistoNEventsWOWeight[iCut]->GetXaxis()->SetBinLabel(4,"Trigger");
602  }
603  fHistoNEventsWOWeight[iCut]->GetXaxis()->SetBinLabel(5,"Vertex Z");
604  fHistoNEventsWOWeight[iCut]->GetXaxis()->SetBinLabel(6,"Cont. Vertex");
605  fHistoNEventsWOWeight[iCut]->GetXaxis()->SetBinLabel(7,"Pile-Up");
606  fHistoNEventsWOWeight[iCut]->GetXaxis()->SetBinLabel(8,"no SDD");
607  fHistoNEventsWOWeight[iCut]->GetXaxis()->SetBinLabel(9,"no V0AND");
608  fHistoNEventsWOWeight[iCut]->GetXaxis()->SetBinLabel(10,"EMCAL problem");
609  fHistoNEventsWOWeight[iCut]->GetXaxis()->SetBinLabel(11,"rejectedForJetJetMC");
610  fHistoNEventsWOWeight[iCut]->GetXaxis()->SetBinLabel(12,"SPD hits vs tracklet");
611  fHistoNEventsWOWeight[iCut]->GetXaxis()->SetBinLabel(13,"Out-of-Bunch pileup Past-Future");
612  fHistoNEventsWOWeight[iCut]->GetXaxis()->SetBinLabel(14,"Pileup V0M-TPCout Tracks");
613  fESDList[iCut]->Add(fHistoNEventsWOWeight[iCut]);
614 
615  fProfileJetJetXSection[iCut] = new TProfile("XSection","XSection",1,-0.5,0.5);
616  fESDList[iCut]->Add(fProfileJetJetXSection[iCut]);
617  fHistoJetJetNTrials[iCut] = new TH1F("NTrials","#sum{NTrials}",1,0,1);
618  fHistoJetJetNTrials[iCut]->GetXaxis()->SetBinLabel(1,"#sum{NTrials}");
619  fESDList[iCut]->Add(fHistoJetJetNTrials[iCut]);
620  }
621 
622  if(fIsHeavyIon == 1)
623  fHistoNGoodESDTracks[iCut] = new TH1F("GoodESDTracks","GoodESDTracks",4000,-0.5,3999.5);
624  else if(fIsHeavyIon == 2)
625  fHistoNGoodESDTracks[iCut] = new TH1F("GoodESDTracks","GoodESDTracks",400,-0.5,399.5);
626  else
627  fHistoNGoodESDTracks[iCut] = new TH1F("GoodESDTracks","GoodESDTracks",200,-0.5,199.5);
628  fESDList[iCut]->Add(fHistoNGoodESDTracks[iCut]);
629 
630  fHistoVertexZ[iCut] = new TH1F("VertexZ","VertexZ",1000,-50,50);
631  fESDList[iCut]->Add(fHistoVertexZ[iCut]);
632 
633  if(fIsHeavyIon == 1)
634  fHistoNClusterCandidates[iCut] = new TH1F("GammaCandidates","GammaCandidates",600,-0.5,599.5);
635  else if(fIsHeavyIon == 2)
636  fHistoNClusterCandidates[iCut] = new TH1F("GammaCandidates","GammaCandidates",400,-0.5,399.5);
637  else
638  fHistoNClusterCandidates[iCut] = new TH1F("GammaCandidates","GammaCandidates",100,-0.5,99.5);
639  fESDList[iCut]->Add(fHistoNClusterCandidates[iCut]);
640 
641  if(fIsHeavyIon == 1)
642  fHistoNClusterMergedCandidates[iCut] = new TH1F("MergedCandidates","MergedCandidates",300,-0.5,299.5);
643  else if(fIsHeavyIon == 2)
644  fHistoNClusterMergedCandidates[iCut] = new TH1F("MergedCandidates","MergedCandidates",200,-0.5,199.5);
645  else
646  fHistoNClusterMergedCandidates[iCut] = new TH1F("MergedCandidates","MergedCandidates",50,-0.5,49.5);
647  fESDList[iCut]->Add(fHistoNClusterMergedCandidates[iCut]);
648 
649 
650  if(fIsHeavyIon == 1)
651  fHistoNGoodESDTracksVsNClusterCandidates[iCut] = new TH2F("GoodESDTracksVsGammaCandidates","GoodESDTracksVsGammaCandidates",4000,-0.5,3999.5,600,-0.5,599.5);
652  else if(fIsHeavyIon == 2)
653  fHistoNGoodESDTracksVsNClusterCandidates[iCut] = new TH2F("GoodESDTracksVsGammaCandidates","GoodESDTracksVsGammaCandidates",400,-0.5,399.5,400,-0.5,399.5);
654  else
655  fHistoNGoodESDTracksVsNClusterCandidates[iCut] = new TH2F("GoodESDTracksVsGammaCandidates","GoodESDTracksVsGammaCandidates",200,-0.5,199.5,100,-0.5,99.5);
657 
658  fHistoSPDClusterTrackletBackground[iCut] = new TH2F("SPD tracklets vs SPD clusters","SPD tracklets vs SPD clusters",100,0,200,250,0,1000);
660 
661  if(fIsHeavyIon == 1)
662  fHistoNV0Tracks[iCut] = new TH1F("V0 Multiplicity","V0 Multiplicity",30000,-0.5,29999.5);
663  else if(fIsHeavyIon == 2)
664  fHistoNV0Tracks[iCut] = new TH1F("V0 Multiplicity","V0 Multiplicity",2500,-0.5,2499.5);
665  else
666  fHistoNV0Tracks[iCut] = new TH1F("V0 Multiplicity","V0 Multiplicity",1500,-0.5,1499.5);
667  fESDList[iCut]->Add(fHistoNV0Tracks[iCut]);
668  fProfileEtaShift[iCut] = new TProfile("Eta Shift","Eta Shift",1, -0.5,0.5);
669  fESDList[iCut]->Add(fProfileEtaShift[iCut]);
670 
671  if (fIsMC == 2){
672  fHistoNEvents[iCut]->Sumw2();
673  fHistoNGoodESDTracks[iCut]->Sumw2();
674  fHistoVertexZ[iCut]->Sumw2();
675  fHistoNClusterCandidates[iCut]->Sumw2();
677  fHistoSPDClusterTrackletBackground[iCut]->Sumw2();
678  fHistoNV0Tracks[iCut]->Sumw2();
679  fProfileEtaShift[iCut]->Sumw2();
680  }
681 
682  fHistoClusGammaPt[iCut] = new TH1F("ClusGamma_Pt","ClusGamma_Pt",ptBinsDefClus, startPtDefClus, endPtDefClus);
683  fESDList[iCut]->Add(fHistoClusGammaPt[iCut]);
684  fHistoClusGammaE[iCut] = new TH1F("ClusGamma_E","ClusGamma_E",ptBinsDefClus, startPtDefClus, endPtDefClus);
685  fESDList[iCut]->Add(fHistoClusGammaE[iCut]);
686  fHistoClusOverlapHeadersGammaPt[iCut] = new TH1F("ClusGammaOverlapHeaders_Pt","ClusGammaOverlapHeaders_Pt",ptBins, arrPtBinning);
687  fESDList[iCut]->Add(fHistoClusOverlapHeadersGammaPt[iCut]);
688  fHistoClusMergedPtvsM02[iCut] = new TH2F("ClusMerged_Pt_M02","ClusMerged_Pt_M02",ptBins, arrPtBinning,showerShapeBins, startShowerShape, endShowerShape);
689  fESDList[iCut]->Add(fHistoClusMergedPtvsM02[iCut]);
690  fHistoClusMergedPtvsM02Accepted[iCut] = new TH2F("ClusMerged_Pt_M02_AcceptedMeson","ClusMerged_Pt_M02_AcceptedMeson",ptBins, arrPtBinning,showerShapeBins, startShowerShape, endShowerShape);
691  fESDList[iCut]->Add(fHistoClusMergedPtvsM02Accepted[iCut]);
692  fHistoClusMergedEvsM02Accepted[iCut] = new TH2F("ClusMerged_E_M02_AcceptedMeson","ClusMerged_E_M02_AcceptedMeson",ptBins, arrPtBinning, showerShapeBins, startShowerShape, endShowerShape);
693  fESDList[iCut]->Add(fHistoClusMergedEvsM02Accepted[iCut]);
694  fHistoClusNLMPt[iCut] = new TH2F("ClusMerged_NLM_Pt_AcceptedMeson","ClusMerged_NLM_Pt_AcceptedMeson",12, -0.5, 11.5, ptBins, arrPtBinning);
695  fESDList[iCut]->Add(fHistoClusNLMPt[iCut]);
696 
697 
698  if (fIsMC == 2){
699  fHistoClusGammaPt[iCut]->Sumw2();
700  fHistoClusGammaE[iCut]->Sumw2();
701  fHistoClusOverlapHeadersGammaPt[iCut]->Sumw2();
702  fHistoClusMergedPtvsM02[iCut]->Sumw2();
703  fHistoClusMergedPtvsM02Accepted[iCut]->Sumw2();
704  fHistoClusMergedEvsM02Accepted[iCut]->Sumw2();
705  fHistoClusNLMPt[iCut]->Sumw2();
706  }
707 
708  if (fDoClusterQA > 0){
709  fHistoClusNCellsPt[iCut] = new TH2F("Clus_NCells_Pt","Clus_NCells_Pt",100,-0.5,99.5,ptBins, arrPtBinning);
710  fESDList[iCut]->Add(fHistoClusNCellsPt[iCut]);
711  fHistoClusMergedNCellsPt[iCut] = new TH2F("ClusMerged_NCells_Pt","ClusMerged_NCells_Pt",100,-0.5,99.5,ptBins, arrPtBinning);
712  fESDList[iCut]->Add(fHistoClusMergedNCellsPt[iCut]);
713  fHistoClusMergedNCellsAroundPt[iCut] = new TH2F("ClusMerged_NCellsAroundClus_Pt","ClusMerged_NCellsAroundClus_Pt",100,-0.5,99.5,ptBins, arrPtBinning);
714  fESDList[iCut]->Add(fHistoClusMergedNCellsAroundPt[iCut]);
715  fHistoClusMergedNCellsAroundAndInPt[iCut] = new TH2F("ClusMerged_NCellsAroundAndInClus_Pt","ClusMerged_NCellsAroundAndInClus_Pt",100,-0.5,99.5,ptBins, arrPtBinning);
717  fHistoClusMergedEAroundE[iCut] = new TH2F("ClusMerged_EAroundClus_E","ClusMerged_EAroundClus_E",ptBinsDefClus, startPtDefClus, endPtDefClus, ptBins, arrPtBinning);
718  fESDList[iCut]->Add(fHistoClusMergedEAroundE[iCut]);
719 
720  if (fIsMC > 0){
721  fHistoClusMergedNParticlePt[iCut] = new TH2F("ClusMerged_NPart_Pt","ClusMerged_NPart_Pt",100,-0.5,99.5,ptBins, arrPtBinning);
722  fESDList[iCut]->Add(fHistoClusMergedNParticlePt[iCut]);
723  if (fIsMC == 2){
724  fHistoClusNCellsPt[iCut]->Sumw2();
725  fHistoClusMergedNCellsPt[iCut]->Sumw2();
726  fHistoClusMergedNCellsAroundPt[iCut]->Sumw2();
728  fHistoClusMergedEAroundE[iCut]->Sumw2();
729  fHistoClusMergedNParticlePt[iCut]->Sumw2();
730  fHistoClusMergedEAroundE[iCut]->Sumw2();
731  }
732  }
733  }
734 
735  fHistoMotherInvMassPt[iCut] = new TH2F("ESD_Mother_InvMass_Pt","ESD_Mother_InvMass_Pt",invMassBins, startMass, endMass,ptBins, arrPtBinning);
736  fESDList[iCut]->Add(fHistoMotherInvMassPt[iCut]);
737 
738  if (fIsMC == 2){
739  fHistoMotherInvMassPt[iCut]->Sumw2();
740  }
741 
742  if (fDoMesonQA > 0 ){
743  fHistoMotherPtY[iCut] = new TH2F("ESD_Mother_Pt_Y","ESD_Mother_Pt_Y", ptBinsLog, startPtLog, endPtLog, 150, -1.5, 1.5);
745  fESDList[iCut]->Add(fHistoMotherPtY[iCut]);
746  fHistoMotherPtAlpha[iCut] = new TH2F("ESD_Mother_Pt_Alpha","ESD_Mother_Pt_Alpha", ptBinsLog, startPtLog, endPtLog, 100, 0, 1);
748  fESDList[iCut]->Add(fHistoMotherPtAlpha[iCut]);
749  if (fIsMC == 2){
750  fHistoMotherPtY[iCut]->Sumw2();
751  fHistoMotherPtAlpha[iCut]->Sumw2();
752  }
753  }
754  }
755 
756  if (fIsMC > 0){
757  fMCList = new TList*[fnCuts];
758  fTrueList = new TList*[fnCuts];
759 
760  fHistoMCHeaders = new TH1I*[fnCuts];
761  fHistoMCPi0Pt = new TH1F*[fnCuts];
762  fHistoMCEtaPt = new TH1F*[fnCuts];
765  fHistoMCDecayGammaPt = new TH1F*[fnCuts];
766  fHistoMCAllGammaPt = new TH1F*[fnCuts];
767  if (GetSelectedMesonID() != 2){
768  fHistoMCPi0WOWeightPt = new TH1F*[fnCuts];
769  fHistoMCPi0InAccPt = new TH1F*[fnCuts];
773  fHistoMCPi0DalitzPt = new TH1F*[fnCuts];
774  fHistoMCPi0DalitzWOWeightPt = new TH1F*[fnCuts];
775  fHistoMCPi0DalitzInAccPt = new TH1F*[fnCuts];
777  }
778  if (GetSelectedMesonID() != 1){
779  fHistoMCEtaWOWeightPt = new TH1F*[fnCuts];
780  fHistoMCEtaInAccPt = new TH1F*[fnCuts];
782  fHistoMCEtaDalitzPt = new TH1F*[fnCuts];
783  fHistoMCEtaDalitzWOWeightPt = new TH1F*[fnCuts];
784  fHistoMCEtaDalitzInAccPt = new TH1F*[fnCuts];
786  }
787  if (fIsMC == 2){
788  if (GetSelectedMesonID() != 2){
789  fHistoMCPi0WOEvtWeightPt = new TH1F*[fnCuts];
791  }
792  if (GetSelectedMesonID() != 1){
793  fHistoMCEtaWOEvtWeightPt = new TH1F*[fnCuts];
795  }
796  if (fDoMesonQA > 0){
797  if (GetSelectedMesonID() != 2)
799  if (GetSelectedMesonID() != 1)
801  }
802  }
803 
808  if (GetSelectedMesonID() < 2){
816  }
832 
836 // fHistoTrueClusElectronPtvsMotherID = new TH2F*[fnCuts];
837 // fHistoTrueClusElectronPtvsTopMotherID = new TH2F*[fnCuts];
838 // fHistoTrueClusElectronPtvsConvPhotonTopMotherID = new TH2F*[fnCuts];
839  fHistoTrueMergedMissedPDG = new TH1F*[fnCuts];
840 
846 
847  if (fDoMesonQA > 1){
854  if (GetSelectedMesonID() < 2){
856  }
857  }
858 
859  if (fDoMesonQA > 0){
864 
865  if (GetSelectedMesonID() != 2){
866  fHistoTruePi0PtY = new TH2F*[fnCuts];
873  }
874  if (GetSelectedMesonID() != 1){
875  fHistoTrueEtaPtY = new TH2F*[fnCuts];
878  }
879  }
880 
881  for(Int_t iCut = 0; iCut<fnCuts;iCut++){
882  TString cutstringEvent = ((AliConvEventCuts*)fEventCutArray->At(iCut))->GetCutNumber();
883  TString cutstringCalo = ((AliCaloPhotonCuts*)fClusterCutArray->At(iCut))->GetCutNumber();
884  TString cutstringCaloMerged = ((AliCaloPhotonCuts*)fClusterMergedCutArray->At(iCut))->GetCutNumber();
885  TString cutstringMeson = ((AliConversionMesonCuts*)fMesonCutArray->At(iCut))->GetCutNumber();
886 
887 
888  fMCList[iCut] = new TList();
889  fMCList[iCut]->SetName(Form("%s_%s_%s_%s MC histograms",cutstringEvent.Data(),cutstringCalo.Data(),cutstringCaloMerged.Data(), cutstringMeson.Data()));
890  fMCList[iCut]->SetOwner(kTRUE);
891  fCutFolder[iCut]->Add(fMCList[iCut]);
892  fHistoMCHeaders[iCut] = new TH1I("MC_Headers", "MC_Headers", 20, 0, 20);
893  fMCList[iCut]->Add(fHistoMCHeaders[iCut]);
894  fHistoMCPi0Pt[iCut] = new TH1F("MC_Pi0_Pt","MC_Pi0_Pt",ptBins, arrPtBinning);
895  fHistoMCPi0Pt[iCut]->Sumw2();
896  fMCList[iCut]->Add(fHistoMCPi0Pt[iCut]);
897  fHistoMCEtaPt[iCut] = new TH1F("MC_Eta_Pt","MC_Eta_Pt",ptBins, arrPtBinning);
898  fHistoMCEtaPt[iCut]->Sumw2();
899  fMCList[iCut]->Add(fHistoMCEtaPt[iCut]);
900 
901  fHistoMCPrimaryPtvsSource[iCut] = new TH2F("MC_Primary_Pt_Source","MC_Primary_Pt_Source",ptBins, arrPtBinning, 7, -0.5, 6.5);
902  fHistoMCPrimaryPtvsSource[iCut]->GetYaxis()->SetBinLabel(1,"Pi+");
903  fHistoMCPrimaryPtvsSource[iCut]->GetYaxis()->SetBinLabel(2,"Pi-");
904  fHistoMCPrimaryPtvsSource[iCut]->GetYaxis()->SetBinLabel(3,"K+");
905  fHistoMCPrimaryPtvsSource[iCut]->GetYaxis()->SetBinLabel(4,"K-");
906  fHistoMCPrimaryPtvsSource[iCut]->GetYaxis()->SetBinLabel(5,"K0s");
907  fHistoMCPrimaryPtvsSource[iCut]->GetYaxis()->SetBinLabel(6,"K0l");
908  fHistoMCPrimaryPtvsSource[iCut]->GetYaxis()->SetBinLabel(7,"Lambda");
909  fHistoMCPrimaryPtvsSource[iCut]->Sumw2();
910  fMCList[iCut]->Add(fHistoMCPrimaryPtvsSource[iCut]);
911 
912  fHistoMCPrimaryYvsSource[iCut] = new TH2F("MC_Primary_Y_Source","MC_Primary_Y_Source",400, -20, 20, 7, -0.5, 6.5);
913  fHistoMCPrimaryYvsSource[iCut]->GetYaxis()->SetBinLabel(1,"Pi+");
914  fHistoMCPrimaryYvsSource[iCut]->GetYaxis()->SetBinLabel(2,"Pi-");
915  fHistoMCPrimaryYvsSource[iCut]->GetYaxis()->SetBinLabel(3,"K+");
916  fHistoMCPrimaryYvsSource[iCut]->GetYaxis()->SetBinLabel(4,"K-");
917  fHistoMCPrimaryYvsSource[iCut]->GetYaxis()->SetBinLabel(5,"K0s");
918  fHistoMCPrimaryYvsSource[iCut]->GetYaxis()->SetBinLabel(6,"K0l");
919  fHistoMCPrimaryYvsSource[iCut]->GetYaxis()->SetBinLabel(7,"Lambda");
920  fHistoMCPrimaryYvsSource[iCut]->Sumw2();
921  fMCList[iCut]->Add(fHistoMCPrimaryYvsSource[iCut]);
922 
923  fHistoMCDecayGammaPt[iCut] = new TH1F("MC_DecayGamma_Pt","MC_DecayGamma_Pt",ptBins, arrPtBinning);
924  fHistoMCDecayGammaPt[iCut]->Sumw2();
925  fMCList[iCut]->Add(fHistoMCDecayGammaPt[iCut]);
926  fHistoMCAllGammaPt[iCut] = new TH1F("MC_AllGamma_Pt","MC_AllGamma_Pt",ptBins, arrPtBinning);
927  fHistoMCAllGammaPt[iCut]->Sumw2();
928  fMCList[iCut]->Add(fHistoMCAllGammaPt[iCut]);
929 
930  if (GetSelectedMesonID() != 2){
931  fHistoMCPi0WOWeightPt[iCut] = new TH1F("MC_Pi0_WOWeights_Pt","MC_Pi0_WOWeights_Pt",ptBins, arrPtBinning);
932  fMCList[iCut]->Add(fHistoMCPi0WOWeightPt[iCut]);
933  fHistoMCPi0InAccPt[iCut] = new TH1F("MC_Pi0InAcc_Pt","MC_Pi0InAcc_Pt",ptBins, arrPtBinning);
934  fHistoMCPi0InAccPt[iCut]->Sumw2();
935  fMCList[iCut]->Add(fHistoMCPi0InAccPt[iCut]);
936  fHistoMCPi0DalitzPt[iCut] = new TH1F("MC_Pi0Dalitz_Pt","MC_Pi0Dalitz_Pt",ptBins, arrPtBinning);
937  fHistoMCPi0DalitzPt[iCut]->Sumw2();
938  fMCList[iCut]->Add(fHistoMCPi0DalitzPt[iCut]);
939  fHistoMCPi0DalitzWOWeightPt[iCut] = new TH1F("MC_Pi0Dalitz_WOWeights_Pt","MC_Pi0Dalitz_WOWeights_Pt",ptBins, arrPtBinning);
940  fMCList[iCut]->Add(fHistoMCPi0DalitzWOWeightPt[iCut]);
941  fHistoMCPi0DalitzInAccPt[iCut] = new TH1F("MC_Pi0DalitzInAcc_Pt","MC_Pi0DalitzInAcc_Pt",ptBins, arrPtBinning);
942  fHistoMCPi0DalitzInAccPt[iCut]->Sumw2();
943  fMCList[iCut]->Add(fHistoMCPi0DalitzInAccPt[iCut]);
944 
945  // initialization for secondary histograms
946  fHistoMCSecPi0PtvsSource[iCut] = new TH2F("MC_SecPi0_Pt_Source","MC_SecPi0_Pt_Source", ptBins, arrPtBinning, 16, -0.5, 15.5);
947  fHistoMCSecPi0PtvsSource[iCut]->Sumw2();
948  fMCList[iCut]->Add(fHistoMCSecPi0PtvsSource[iCut]);
949  fHistoMCSecPi0InAccPtvsSource[iCut] = new TH2F("MC_SecPi0InAcc_Pt_Source","MC_SecPi0InAcc_Pt_Source", ptBins, arrPtBinning, 16, -0.5, 15.5);
950  fHistoMCSecPi0InAccPtvsSource[iCut]->Sumw2();
951  fMCList[iCut]->Add(fHistoMCSecPi0InAccPtvsSource[iCut]);
952  }
953 
954  if (GetSelectedMesonID() != 1){
955  fHistoMCEtaWOWeightPt[iCut] = new TH1F("MC_Eta_WOWeights_Pt","MC_Eta_WOWeights_Pt",ptBins, arrPtBinning);
956  fMCList[iCut]->Add(fHistoMCEtaWOWeightPt[iCut]);
957  fHistoMCEtaInAccPt[iCut] = new TH1F("MC_EtaInAcc_Pt","MC_EtaInAcc_Pt",ptBins, arrPtBinning);
958  fHistoMCEtaInAccPt[iCut]->Sumw2();
959  fMCList[iCut]->Add(fHistoMCEtaInAccPt[iCut]);
960  fHistoMCEtaDalitzPt[iCut] = new TH1F("MC_EtaDalitz_Pt","MC_EtaDalitz_Pt",ptBins, arrPtBinning);
961  fHistoMCEtaDalitzPt[iCut]->Sumw2();
962  fMCList[iCut]->Add(fHistoMCEtaDalitzPt[iCut]);
963  fHistoMCEtaDalitzWOWeightPt[iCut] = new TH1F("MC_EtaDalitz_WOWeights_Pt","MC_EtaDalitz_WOWeights_Pt",ptBins, arrPtBinning);
964  fMCList[iCut]->Add(fHistoMCEtaDalitzWOWeightPt[iCut]);
965  fHistoMCEtaDalitzInAccPt[iCut] = new TH1F("MC_EtaDalitzInAcc_Pt","MC_EtaDalitzInAcc_Pt",ptBins, arrPtBinning);
966  fHistoMCEtaDalitzInAccPt[iCut]->Sumw2();
967  fMCList[iCut]->Add(fHistoMCEtaDalitzInAccPt[iCut]);
968  }
969 
970  if (fIsMC == 2){
971  if (GetSelectedMesonID() != 2){
972  fHistoMCPi0WOWeightPt[iCut]->Sumw2();
973  fHistoMCPi0DalitzWOWeightPt[iCut]->Sumw2();
974  fHistoMCPi0WOEvtWeightPt[iCut] = new TH1F("MC_Pi0_WOEventWeights_Pt","MC_Pi0_WOEventWeights_Pt",ptBins, arrPtBinning);
975  fMCList[iCut]->Add(fHistoMCPi0WOEvtWeightPt[iCut]);
976  fHistoMCPi0DalitzWOEvtWeightPt[iCut] = new TH1F("MC_Pi0Dalitz_WOEventWeights_Pt","MC_Pi0Dalitz_WOEventWeights_Pt",ptBins, arrPtBinning);
977  fMCList[iCut]->Add(fHistoMCPi0DalitzWOEvtWeightPt[iCut]);
978  fHistoMCPi0DalitzWOEvtWeightInAccPt[iCut] = new TH1F("MC_Pi0DalitzWOEvtWeightInAcc_Pt","MC_Pi0DalitzWOEvtWeightInAcc_Pt",ptBins, arrPtBinning);
980  fHistoMCPi0WOEvtWeightInAccPt[iCut] = new TH1F("MC_Pi0WOEvtWeightInAcc_Pt","MC_Pi0WOEvtWeightInAcc_Pt",ptBins, arrPtBinning);
981  fMCList[iCut]->Add(fHistoMCPi0WOEvtWeightInAccPt[iCut]);
982 
983 
984  }
985  if (GetSelectedMesonID() != 1){
986  fHistoMCEtaWOWeightPt[iCut]->Sumw2();
987  fHistoMCEtaDalitzWOWeightPt[iCut]->Sumw2();
988  fHistoMCEtaWOEvtWeightPt[iCut] = new TH1F("MC_Eta_WOEventWeights_Pt","MC_Eta_WOEventWeights_Pt",ptBins, arrPtBinning);
989  fMCList[iCut]->Add(fHistoMCEtaWOEvtWeightPt[iCut]);
990  fHistoMCEtaDalitzWOEvtWeightPt[iCut] = new TH1F("MC_EtaDalitz_WOEventWeights_Pt","MC_EtaDalitz_WOEventWeights_Pt",ptBins, arrPtBinning);
991  fMCList[iCut]->Add(fHistoMCEtaDalitzWOEvtWeightPt[iCut]);
992  fHistoMCEtaWOEvtWeightInAccPt[iCut] = new TH1F("MC_EtaWOEvtWeightInAcc_Pt","MC_EtaWOEvtWeightInAcc_Pt",ptBins, arrPtBinning);
993  fMCList[iCut]->Add(fHistoMCEtaWOEvtWeightInAccPt[iCut]);
994  fHistoMCEtaDalitzWOEvtWeightInAccPt[iCut] = new TH1F("MC_EtaDalitzWOEvtWeightInAcc_Pt","MC_EtaDalitzWOEvtWeightInAcc_Pt",ptBins, arrPtBinning);
996  }
997  if (fDoMesonQA > 0){
998  if (GetSelectedMesonID() != 2){
999  fHistoMCPi0PtJetPt[iCut] = new TH2F("MC_Pi0_Pt_JetPt","MC_Pi0_Pt_JetPt", ptBinsLog, startPtLog, endPtLog, 200, -0.5, 199.5);
1000  fHistoMCPi0PtJetPt[iCut]->Sumw2();
1002  fMCList[iCut]->Add(fHistoMCPi0PtJetPt[iCut]);
1003  }
1004  if (GetSelectedMesonID() != 1){
1005  fHistoMCEtaPtJetPt[iCut] = new TH2F("MC_Eta_Pt_JetPt","MC_Eta_Pt_JetPt", ptBinsLog, startPtLog, endPtLog, 200, -0.5, 199.5);
1006  fHistoMCEtaPtJetPt[iCut]->Sumw2();
1008  fMCList[iCut]->Add(fHistoMCEtaPtJetPt[iCut]);
1009  }
1010  }
1011  }
1012 
1013  fTrueList[iCut] = new TList();
1014  fTrueList[iCut]->SetName(Form("%s_%s_%s_%s True histograms",cutstringEvent.Data(),cutstringCalo.Data(),cutstringCaloMerged.Data(), cutstringMeson.Data()));
1015  fTrueList[iCut]->SetOwner(kTRUE);
1016  fCutFolder[iCut]->Add(fTrueList[iCut]);
1017 
1018  fHistoTrueClusMergedPtvsM02[iCut] = new TH2F("ESD_TrueClusMerged_Pt_M02","ESD_TrueClusMerged_Pt_M02",ptBins, arrPtBinning,showerShapeBins, startShowerShape, endShowerShape);
1019  fTrueList[iCut]->Add(fHistoTrueClusMergedPtvsM02[iCut]);
1020  fHistoTrueClusPi0PtvsM02 [iCut] = new TH2F("ESD_TrueClusFromPi0_Pt_M02","ESD_TrueClusFromPi0_Pt_M02",ptBins, arrPtBinning,showerShapeBins, startShowerShape, endShowerShape);
1021  fTrueList[iCut]->Add(fHistoTrueClusPi0PtvsM02[iCut]);
1022  fHistoTrueClusMultiplePi0PtvsM02 [iCut] = new TH2F("ESD_TrueClusFromMultiplePi0_Pt_M02","ESD_TrueClusFromMultiplePi0_Pt_M02",ptBins, arrPtBinning,showerShapeBins, startShowerShape, endShowerShape);
1023  fTrueList[iCut]->Add(fHistoTrueClusMultiplePi0PtvsM02[iCut]);
1024  fHistoTrueClusPi0DalitzPtvsM02 [iCut] = new TH2F("ESD_TrueClusFromPi0Dalitz_Pt_M02","ESD_TrueClusFromPi0Dalitz_Pt_M02",ptBins, arrPtBinning,showerShapeBins, startShowerShape, endShowerShape);
1025  fTrueList[iCut]->Add(fHistoTrueClusPi0DalitzPtvsM02[iCut]);
1026  fHistoTrueClusEtaPtvsM02[iCut] = new TH2F("ESD_TrueClusFromEta_Pt_M02","ESD_TrueClusFromEta_Pt_M02",ptBins, arrPtBinning,showerShapeBins, startShowerShape, endShowerShape);
1027  fTrueList[iCut]->Add(fHistoTrueClusEtaPtvsM02[iCut]);
1028  fHistoTrueClusEtaDalitzPtvsM02[iCut] = new TH2F("ESD_TrueClusFromEtaDalitz_Pt_M02","ESD_TrueClusFromEtaDalitz_Pt_M02",ptBins, arrPtBinning,showerShapeBins, startShowerShape, endShowerShape);
1029  fTrueList[iCut]->Add(fHistoTrueClusEtaDalitzPtvsM02[iCut]);
1030  fHistoTrueClusMergedPureFromPi0PtvsM02[iCut] = new TH2F("ESD_TrueClusMergedPureFromPi0_Pt_M02","ESD_TrueClusMergedPureFromPi0_Pt_M02",ptBins, arrPtBinning,showerShapeBins, startShowerShape, endShowerShape);
1032  fHistoTrueClusMergedPureFromEtaPtvsM02[iCut] = new TH2F("ESD_TrueClusMergedPureFromEta_Pt_M02","ESD_TrueClusMergedPureFromEta_Pt_M02",ptBins, arrPtBinning,showerShapeBins, startShowerShape, endShowerShape);
1034  fHistoTrueClusMergedPartConvFromPi0PtvsM02[iCut] = new TH2F("ESD_TrueClusMergedPartConvFromPi0_Pt_M02","ESD_TrueClusMergedPartConvFromPi0_Pt_M02",ptBins, arrPtBinning,showerShapeBins, startShowerShape, endShowerShape);
1036  fHistoTrueClusMergedPartConvFromEtaPtvsM02[iCut] = new TH2F("ESD_TrueClusMergedPartConvFromEta_Pt_M02","ESD_TrueClusMergedPartConvFromEta_Pt_M02",ptBins, arrPtBinning,showerShapeBins, startShowerShape, endShowerShape);
1038  fHistoNTrueMultiplePi0vsPt [iCut] = new TH2F("ESD_TrueNumberOfMultiplePi0_Pt","ESD_TrueNumberOfMultiplePi0_Pt",ptBins, arrPtBinning,20, 0, 20);
1039  fTrueList[iCut]->Add(fHistoNTrueMultiplePi0vsPt[iCut]);
1040 
1041  fHistoTrueClusBGPtvsM02[iCut] = new TH2F("ESD_TrueClusBG_Pt_M02","ESD_TrueClusBG_Pt_M02",ptBins, arrPtBinning,showerShapeBins, startShowerShape, endShowerShape);
1042  fTrueList[iCut]->Add(fHistoTrueClusBGPtvsM02[iCut]);
1043  fHistoTrueClusGammaPtvsM02[iCut] = new TH2F("ESD_TrueClusGamma_Pt_M02","ESD_TrueClusGamma_Pt_M02",ptBins, arrPtBinning,showerShapeBins, startShowerShape, endShowerShape);
1044  fTrueList[iCut]->Add(fHistoTrueClusGammaPtvsM02[iCut]);
1045  fHistoTrueClusGammaFromPi0PtvsM02[iCut] = new TH2F("ESD_TrueClusGamma_FromPi0_Pt_M02","ESD_TrueClusGamma_FromPi0_Pt_M02",ptBins, arrPtBinning,showerShapeBins, startShowerShape, endShowerShape);
1046  fTrueList[iCut]->Add(fHistoTrueClusGammaFromPi0PtvsM02[iCut]);
1047  fHistoTrueClusGammaFromEtaPtvsM02[iCut] = new TH2F("ESD_TrueClusGamma_FromEta_Pt_M02","ESD_TrueClusGamma_FromEta_Pt_M02",ptBins, arrPtBinning,showerShapeBins, startShowerShape, endShowerShape);
1048  fTrueList[iCut]->Add(fHistoTrueClusGammaFromEtaPtvsM02[iCut]);
1049  fHistoTrueClusElectronPtvsM02[iCut] = new TH2F("ESD_TrueClusElectron_Pt_M02","ESD_TrueClusElectron_Pt_M02",ptBins, arrPtBinning,showerShapeBins, startShowerShape, endShowerShape);
1050  fTrueList[iCut]->Add(fHistoTrueClusElectronPtvsM02[iCut]);
1051  fHistoTrueClusElectronFromPi0PtvsM02[iCut] = new TH2F("ESD_TrueClusElectron_FromPi0_Pt_M02","ESD_TrueClusElectron_FromPi0_Pt_M02",ptBins, arrPtBinning,showerShapeBins, startShowerShape, endShowerShape);
1053  fHistoTrueClusElectronFromEtaPtvsM02[iCut] = new TH2F("ESD_TrueClusElectron_FromEta_Pt_M02","ESD_TrueClusElectron_FromEta_Pt_M02",ptBins, arrPtBinning,showerShapeBins, startShowerShape, endShowerShape);
1055  fHistoTrueClusElectronFromGammaPtvsM02[iCut] = new TH2F("ESD_TrueClusElectron_FromGamma_Pt_M02","ESD_TrueClusElectron_FromGamma_Pt_M02",ptBins, arrPtBinning,showerShapeBins, startShowerShape, endShowerShape);
1057 
1058  if (GetSelectedMesonID() < 2){
1059  fHistoTrueClusPrimPi0PtvsM02[iCut] = new TH2F("ESD_TrueClusFromPrimPi0_Pt_M02","ESD_TrueClusFromPrimPi0_Pt_M02",ptBins, arrPtBinning,showerShapeBins, startShowerShape, endShowerShape);
1060  fTrueList[iCut]->Add(fHistoTrueClusPrimPi0PtvsM02[iCut]);
1061  fHistoTrueClusMultiplePrimPi0PtvsM02[iCut] = new TH2F("ESD_TrueClusFromMultiplePrimPi0_Pt_M02","ESD_TrueClusFromMultiplePrimPi0_Pt_M02",ptBins, arrPtBinning,showerShapeBins, startShowerShape, endShowerShape);
1063  fHistoTrueClusSecPi0PtvsM02[iCut] = new TH2F("ESD_TrueClusFromSecPi0_Pt_M02","ESD_TrueClusFromSecPi0_Pt_M02",ptBins, arrPtBinning,showerShapeBins, startShowerShape, endShowerShape);
1064  fTrueList[iCut]->Add(fHistoTrueClusSecPi0PtvsM02[iCut]);
1065  fHistoTrueClusSecPi0FromK0sPtvsM02[iCut] = new TH2F("ESD_TrueClusFromSecPi0FromK0s_Pt_M02","ESD_TrueClusFromSecPi0FromK0s_Pt_M02",ptBins, arrPtBinning,showerShapeBins, startShowerShape, endShowerShape);
1067  fHistoTrueClusSecPi0FromK0lPtvsM02[iCut] = new TH2F("ESD_TrueClusFromSecPi0FromK0l_Pt_M02","ESD_TrueClusFromSecPi0FromK0l_Pt_M02",ptBins, arrPtBinning,showerShapeBins, startShowerShape, endShowerShape);
1069  fHistoTrueClusSecPi0FromLambdaPtvsM02[iCut] = new TH2F("ESD_TrueClusFromSecPi0FromLambda_Pt_M02","ESD_TrueClusFromSecPi0FromLambda_Pt_M02",ptBins, arrPtBinning,showerShapeBins, startShowerShape, endShowerShape);
1071  fHistoTrueSecPi0PtvsDiffReco[iCut] = new TH2F("ESD_TrueClusFromSecPi0_Pt_RecoMethod","ESD_TrueClusFromSecPi0_Pt_RecoMethod",ptBins, arrPtBinning, 4, -0.5, 3.5);
1072  fTrueList[iCut]->Add(fHistoTrueSecPi0PtvsDiffReco[iCut]);
1073  }
1074 
1075 
1076  fHistoTrueClusBGPtvsSource[iCut] = new TH2F("ESD_TrueClusBG_Pt_Source","ESD_TrueClusBG_Pt_Source",ptBins, arrPtBinning, 10, 0, 10);
1077  fTrueList[iCut]->Add(fHistoTrueClusBGPtvsSource[iCut]);
1078  fHistoTrueClusGammaPtvsSource[iCut] = new TH2F("ESD_TrueClusGamma_Pt_Source","ESD_TrueClusGamma_Pt_Source",ptBins, arrPtBinning, 8, 0, 8);
1079  fTrueList[iCut]->Add(fHistoTrueClusGammaPtvsSource[iCut]);
1080  fHistoTrueClusElectronPtvsSource[iCut] = new TH2F("ESD_TrueClusElectron_Pt_Source","ESD_TrueClusElectron_Pt_Source",ptBins, arrPtBinning, 9, 0, 9);
1081  fTrueList[iCut]->Add(fHistoTrueClusElectronPtvsSource[iCut]);
1082 // fHistoTrueClusElectronPtvsMotherID[iCut] = new TH2F("ESD_TrueClusElectron_Pt_MotherID","ESD_TrueClusElectron_Pt_MotherID",ptBins, arrPtBinning, 570, -1.5, 568.5);
1083 // fTrueList[iCut]->Add(fHistoTrueClusElectronPtvsMotherID[iCut]);
1084 // fHistoTrueClusElectronPtvsTopMotherID[iCut] = new TH2F("ESD_TrueClusElectron_Pt_TopMotherID","ESD_TrueClusElectron_Pt_TopMotherID",ptBins, arrPtBinning, 570, -1.5, 568.5);
1085 // fTrueList[iCut]->Add(fHistoTrueClusElectronPtvsTopMotherID[iCut]);
1086 // fHistoTrueClusElectronPtvsConvPhotonTopMotherID[iCut] = new TH2F("ESD_TrueClusElectron_Pt_ConvPhotonTopMotherID","ESD_TrueClusElectron_Pt_ConvPhotonTopMotherID",ptBins, arrPtBinning, 570, -1.5, 568.5);
1087 // fTrueList[iCut]->Add(fHistoTrueClusElectronPtvsConvPhotonTopMotherID[iCut]);
1088  fHistoTrueMergedMissedPDG[iCut] = new TH1F("ESD_TrueMergedMissed_PDG","ESD_TrueMergedMissed_PDG",10000, -1.5, 9998.5);
1089  fTrueList[iCut]->Add(fHistoTrueMergedMissedPDG[iCut]);
1090 
1091  fHistoDoubleCountTruePi0PtvsM02[iCut] = new TH2F("ESD_TrueDoubleCountPi0_Pt_M02","ESD_TrueDoubleCountPi0_Pt_M02",ptBins, arrPtBinning,showerShapeBins, startShowerShape, endShowerShape);
1092  fTrueList[iCut]->Add(fHistoDoubleCountTruePi0PtvsM02[iCut]);
1093  fHistoDoubleCountTrueSecPi0Pt[iCut] = new TH1F("ESD_TrueDoubleCountSecPi0_Pt","ESD_TrueDoubleCountSecPi0_Pt",ptBins, arrPtBinning);
1094  fTrueList[iCut]->Add(fHistoDoubleCountTrueSecPi0Pt[iCut]);
1095  fHistoDoubleCountTrueMultiplePi0PtvsM02[iCut] = new TH2F("ESD_TrueDoubleCountMultiplePi0_Pt_M02","ESD_TrueDoubleCountMultiplePi0_Pt_M02",ptBins, arrPtBinning,showerShapeBins, startShowerShape, endShowerShape);
1097  fHistoDoubleCountTrueMultipleSecPi0Pt[iCut] = new TH1F("ESD_TrueDoubleCountMultipleSecPi0_Pt","ESD_TrueDoubleCountMultipleSecPi0_Pt",ptBins, arrPtBinning);
1099  fHistoDoubleCountTrueEtaPtvsM02[iCut] = new TH2F("ESD_TrueDoubleCountEta_Pt_M02","ESD_TrueDoubleCountEta_Pt_M02",ptBins, arrPtBinning,showerShapeBins, startShowerShape, endShowerShape);
1100  fTrueList[iCut]->Add(fHistoDoubleCountTrueEtaPtvsM02[iCut]);
1101 
1102 
1103  if (fDoMesonQA > 1){
1104  fHistoTrueClusMergedInvMassvsPt[iCut] = new TH2F("ESD_TrueClusMerged_InvMass_Pt","ESD_TrueClusMerged_InvMass_Pt",invMassBins, startMass, endMass,ptBins, arrPtBinning);
1105  fTrueList[iCut]->Add(fHistoTrueClusMergedInvMassvsPt[iCut]);
1106  fHistoTrueClusPi0InvMassvsPt [iCut] = new TH2F("ESD_TrueClusFromPi0_InvMass_Pt","ESD_TrueClusFromPi0_InvMass_Pt",invMassBins, startMass, endMass,ptBins, arrPtBinning);
1107  fTrueList[iCut]->Add(fHistoTrueClusPi0InvMassvsPt[iCut]);
1108  fHistoTrueClusEtaInvMassvsPt[iCut] = new TH2F("ESD_TrueClusFromEta_InvMass_Pt","ESD_TrueClusFromEta_InvMass_Pt",invMassBins, startMass, endMass,ptBins, arrPtBinning);
1109  fTrueList[iCut]->Add(fHistoTrueClusEtaInvMassvsPt[iCut]);
1110  fHistoTrueClusBGInvMassvsPt[iCut] = new TH2F("ESD_TrueClusBG_InvMass_Pt","ESD_TrueClusBG_InvMass_Pt",invMassBins, startMass, endMass,ptBins, arrPtBinning);
1111  fTrueList[iCut]->Add(fHistoTrueClusBGInvMassvsPt[iCut]);
1112  fHistoTrueClusGammaInvMassvsPt[iCut] = new TH2F("ESD_TrueClusGamma_InvMass_Pt","ESD_TrueClusGamma_InvMass_Pt",invMassBins, startMass, endMass,ptBins, arrPtBinning);
1113  fTrueList[iCut]->Add(fHistoTrueClusGammaInvMassvsPt[iCut]);
1114  fHistoTrueClusElectronInvMassvsPt[iCut] = new TH2F("ESD_TrueClusElectron_InvMass_Pt","ESD_TrueClusElectron_InvMass_Pt",invMassBins, startMass, endMass,ptBins, arrPtBinning);
1115  fTrueList[iCut]->Add(fHistoTrueClusElectronInvMassvsPt[iCut]);
1116  if (GetSelectedMesonID() < 2){
1117  fHistoTrueClusPrimPi0InvMassvsPt[iCut] = new TH2F("ESD_TrueClusFromPrimPi0_InvMass_Pt","ESD_TrueClusFromPrimPi0_InvMass_Pt",invMassBins, startMass, endMass,ptBins, arrPtBinning);
1118  fTrueList[iCut]->Add(fHistoTrueClusPrimPi0InvMassvsPt[iCut]);
1119  }
1120  }
1121 
1122  if (fDoMesonQA > 0){
1123  fHistoTrueClusGammaEM02[iCut] = new TH2F("TrueClusGammaEM02","TrueClusGammaEM02",ptBins, arrPtBinning, showerShapeBins, startShowerShape, endShowerShape);
1124  fTrueList[iCut]->Add(fHistoTrueClusGammaEM02[iCut]);
1125  fHistoTrueClusElectronEM02[iCut] = new TH2F("TrueClusElectronEM02","TrueClusElectronEM02",ptBins, arrPtBinning, showerShapeBins, startShowerShape, endShowerShape);
1126  fTrueList[iCut]->Add(fHistoTrueClusElectronEM02[iCut]);
1127  fHistoTrueClusPi0EM02[iCut] = new TH2F("TrueClusPi0EM02","TrueClusPi0EM02",ptBins, arrPtBinning, showerShapeBins, startShowerShape, endShowerShape);
1128  fTrueList[iCut]->Add(fHistoTrueClusPi0EM02[iCut]);
1129  fHistoTrueClusEtaEM02[iCut] = new TH2F("TrueClusEtaEM02","TrueClusEtaEM02",ptBins, arrPtBinning, showerShapeBins, startShowerShape, endShowerShape);
1130  fTrueList[iCut]->Add(fHistoTrueClusEtaEM02[iCut]);
1131  if (GetSelectedMesonID() != 2){
1132  fHistoTruePi0PtY[iCut] = new TH2F("ESD_TruePi0_Pt_Y","ESD_TruePi0_Pt_Y",ptBinsLog, startPtLog, endPtLog,150,-1.5,1.5);
1134  fTrueList[iCut]->Add(fHistoTruePi0PtY[iCut]);
1135  fHistoTruePi0PtAlpha[iCut] = new TH2F("ESD_TruePi0_Pt_Alpha","ESD_TruePi0_Pt_Alpha",ptBinsLog, startPtLog, endPtLog,100,0,1);
1137  fTrueList[iCut]->Add(fHistoTruePi0PtAlpha[iCut]);
1138  fHistoTruePrimaryPi0PureMergedMCPtResolPt[iCut] = new TH2F("ESD_TruePrimaryPi0PureMerged_MCPt_ResolPt","ESD_TruePrimaryPi0PureMerged_ResolPt_MCPt",ptBinsLog, startPtLog, endPtLog,1000,-1.,1.);
1141  fHistoTruePrimaryPi0MergedPartConvMCPtResolPt[iCut] = new TH2F("ESD_TruePrimaryPi0MergedPartConv_MCPt_ResolPt","ESD_TruePrimaryPi0MergedPartConv_ResolPt_MCPt",ptBinsLog, startPtLog, endPtLog,1000,-1.,1.);
1144  fHistoTruePrimaryPi01GammaMCPtResolPt[iCut] = new TH2F("ESD_TruePrimaryPi01Gamma_MCPt_ResolPt","ESD_TruePrimaryPi01Gamma_ResolPt_MCPt",ptBinsLog, startPtLog, endPtLog,1000,-1.,1.);
1147  fHistoTruePrimaryPi01ElectronMCPtResolPt[iCut] = new TH2F("ESD_TruePrimaryPi01Electron_MCPt_ResolPt","ESD_TruePrimaryPi01Electron_ResolPt_MCPt",ptBinsLog, startPtLog, endPtLog,1000,-1.,1.);
1150  fHistoTrueSecondaryPi0MCPtResolPt[iCut] = new TH2F("ESD_TrueSecondaryPi0_MCPt_ResolPt","ESD_TrueSecondaryPi0_MCPt_ResolPt",ptBinsLog, startPtLog, endPtLog,2000,-10.,10.);
1152  fTrueList[iCut]->Add(fHistoTrueSecondaryPi0MCPtResolPt[iCut]);
1153  }
1154  if (GetSelectedMesonID() != 1){
1155  fHistoTrueEtaPtY[iCut] = new TH2F("ESD_TrueEta_Pt_Y","ESD_TrueEta_Pt_Y",ptBinsLog, startPtLog, endPtLog,150,-1.5,1.5);
1157  fTrueList[iCut]->Add(fHistoTrueEtaPtY[iCut]);
1158  fHistoTrueEtaPtAlpha[iCut] = new TH2F("ESD_TrueEta_Pt_Alpha","ESD_TrueEta_Pt_Alpha",ptBinsLog, startPtLog, endPtLog,100,0,0.5);
1160  fTrueList[iCut]->Add(fHistoTrueEtaPtAlpha[iCut]);
1161  fHistoTruePrimaryEtaMCPtResolPt[iCut] = new TH2F("ESD_TruePrimaryEta_MCPt_ResolPt","ESD_TruePrimaryEta_ResolPt_MCPt",ptBinsLog, startPtLog, endPtLog,1000,-1.,1.);
1163  fTrueList[iCut]->Add(fHistoTruePrimaryEtaMCPtResolPt[iCut]);
1164  }
1165  }
1166 
1167  if (fIsMC == 2){
1168  fHistoTrueClusMergedPtvsM02[iCut]->Sumw2();
1169  fHistoTrueClusPi0PtvsM02[iCut]->Sumw2();
1170  fHistoTrueClusMultiplePi0PtvsM02[iCut]->Sumw2();
1171  fHistoNTrueMultiplePi0vsPt[iCut]->Sumw2();
1172  fHistoTrueClusPi0DalitzPtvsM02[iCut]->Sumw2();
1173  fHistoTrueClusEtaPtvsM02[iCut]->Sumw2();
1174  fHistoTrueClusEtaDalitzPtvsM02[iCut]->Sumw2();
1179  fHistoTrueMergedMissedPDG[iCut]->Sumw2();
1180  fHistoTrueClusBGPtvsM02[iCut]->Sumw2();
1181  fHistoTrueClusGammaPtvsM02[iCut]->Sumw2();
1182  fHistoTrueClusGammaFromPi0PtvsM02[iCut]->Sumw2();
1183  fHistoTrueClusGammaFromEtaPtvsM02[iCut]->Sumw2();
1184  fHistoTrueClusElectronPtvsM02[iCut]->Sumw2();
1185  fHistoTrueClusElectronFromPi0PtvsM02[iCut]->Sumw2();
1186  fHistoTrueClusElectronFromEtaPtvsM02[iCut]->Sumw2();
1188  fHistoTrueClusBGPtvsSource[iCut]->Sumw2();
1189  fHistoTrueClusGammaPtvsSource[iCut]->Sumw2();
1190  fHistoTrueClusElectronPtvsSource[iCut]->Sumw2();
1191 // fHistoTrueClusElectronPtvsMotherID[iCut]->Sumw2();
1192 // fHistoTrueClusElectronPtvsTopMotherID[iCut]->Sumw2();
1193 // fHistoTrueClusElectronPtvsConvPhotonTopMotherID[iCut]->Sumw2();
1194  fHistoDoubleCountTruePi0PtvsM02[iCut]->Sumw2();
1195  fHistoDoubleCountTrueSecPi0Pt[iCut]->Sumw2();
1198  fHistoDoubleCountTrueEtaPtvsM02[iCut]->Sumw2();
1199 
1200  if (GetSelectedMesonID() < 2){
1201  fHistoTrueClusPrimPi0PtvsM02[iCut]->Sumw2();
1202  fHistoTrueClusMultiplePrimPi0PtvsM02[iCut]->Sumw2();
1203  fHistoTrueClusSecPi0PtvsM02[iCut]->Sumw2();
1204  fHistoTrueClusSecPi0FromK0sPtvsM02[iCut]->Sumw2();
1205  fHistoTrueClusSecPi0FromK0lPtvsM02[iCut]->Sumw2();
1207  fHistoTrueSecPi0PtvsDiffReco[iCut]->Sumw2();
1208  }
1209 
1210  if (fDoMesonQA > 1){
1211  fHistoTrueClusMergedInvMassvsPt[iCut]->Sumw2();
1212  fHistoTrueClusPi0InvMassvsPt[iCut]->Sumw2();
1213  fHistoTrueClusEtaInvMassvsPt[iCut]->Sumw2();
1214  fHistoTrueClusBGInvMassvsPt[iCut]->Sumw2();
1215  fHistoTrueClusGammaInvMassvsPt[iCut]->Sumw2();
1216  fHistoTrueClusElectronInvMassvsPt[iCut]->Sumw2();
1217  if (GetSelectedMesonID() < 2){
1218  fHistoTrueClusPrimPi0InvMassvsPt[iCut]->Sumw2();
1219  }
1220  }
1221 
1222  if (fDoMesonQA > 0 ){
1223  if (GetSelectedMesonID() != 2){
1224  fHistoTruePi0PtY[iCut]->Sumw2();
1225  fHistoTruePi0PtAlpha[iCut]->Sumw2();
1230  fHistoTrueSecondaryPi0MCPtResolPt[iCut]->Sumw2();
1231  fHistoTrueClusPi0EM02[iCut]->Sumw2();
1232  fHistoTrueClusEtaEM02[iCut]->Sumw2();
1233  fHistoTrueClusGammaEM02[iCut]->Sumw2();
1234  fHistoTrueClusElectronEM02[iCut]->Sumw2();
1235  }
1236  if (GetSelectedMesonID() != 1){
1237  fHistoTrueEtaPtY[iCut]->Sumw2();
1238  fHistoTrueEtaPtAlpha[iCut]->Sumw2();
1239  fHistoTruePrimaryEtaMCPtResolPt[iCut]->Sumw2();
1240  }
1241  }
1242  }
1243  }
1244 
1245  }
1246 
1247  if(fV0Reader)
1249  if(((AliConvEventCuts*)fV0Reader->GetEventCuts())->GetCutHistograms())
1250  fOutputContainer->Add(((AliConvEventCuts*)fV0Reader->GetEventCuts())->GetCutHistograms());
1251 
1252  for(Int_t iMatcherTask = 0; iMatcherTask < 5; iMatcherTask++){
1253  AliCaloTrackMatcher* temp = (AliCaloTrackMatcher*) (AliAnalysisManager::GetAnalysisManager()->GetTask(Form("CaloTrackMatcher_%i_%i",iMatcherTask,fTrackMatcherRunningMode)));
1254  if(temp) fOutputContainer->Add(temp->GetCaloTrackMatcherHistograms());
1255  }
1256 
1257 
1258  for(Int_t iCut = 0; iCut<fnCuts;iCut++){
1259  if(!((AliConvEventCuts*)fEventCutArray->At(iCut))) continue;
1260  if(((AliConvEventCuts*)fEventCutArray->At(iCut))->GetCutHistograms()){
1261  fCutFolder[iCut]->Add(((AliConvEventCuts*)fEventCutArray->At(iCut))->GetCutHistograms());
1262  }
1263  if(!((AliCaloPhotonCuts*)fClusterCutArray->At(iCut))) continue;
1264  if(((AliCaloPhotonCuts*)fClusterCutArray->At(iCut))->GetCutHistograms()){
1265  fCutFolder[iCut]->Add(((AliCaloPhotonCuts*)fClusterCutArray->At(iCut))->GetCutHistograms());
1266  }
1267  if(!((AliCaloPhotonCuts*)fClusterMergedCutArray->At(iCut))) continue;
1268  if(((AliCaloPhotonCuts*)fClusterMergedCutArray->At(iCut))->GetCutHistograms()){
1269  fCutFolder[iCut]->Add(((AliCaloPhotonCuts*)fClusterMergedCutArray->At(iCut))->GetCutHistograms());
1270  }
1271 
1272  if(fSetPlotHistsExtQA){
1273  if(!((AliCaloPhotonCuts*)fClusterCutArray->At(iCut))) continue;
1274  if(((AliCaloPhotonCuts*)fClusterCutArray->At(iCut))->GetExtQAHistograms()){
1275  fCutFolder[iCut]->Add(((AliCaloPhotonCuts*)fClusterCutArray->At(iCut))->GetExtQAHistograms());
1276  }
1277  }
1278  if(!((AliConversionMesonCuts*)fMesonCutArray->At(iCut))) continue;
1279  if(((AliConversionMesonCuts*)fMesonCutArray->At(iCut))->GetCutHistograms()){
1280  fCutFolder[iCut]->Add(((AliConversionMesonCuts*)fMesonCutArray->At(iCut))->GetCutHistograms());
1281  }
1282  }
1283 
1284  if (fIsMC > 0){
1285  tBrokenFiles = new TTree("BrokenFiles","BrokenFiles");
1286  tBrokenFiles->Branch("fileName",&fFileNameBroken);
1288  }
1289 
1290 
1291  PostData(1, fOutputContainer);
1292 }
1293 //_____________________________________________________________________________
1295 {
1296  for(Int_t iCut = 0; iCut<fnCuts;iCut++){
1297  if (((AliConvEventCuts*)fEventCutArray->At(iCut))->GetPeriodEnum() == AliConvEventCuts::kNoPeriod && ((AliConvEventCuts*)fV0Reader->GetEventCuts())->GetPeriodEnum() != AliConvEventCuts::kNoPeriod){
1298  ((AliConvEventCuts*)fEventCutArray->At(iCut))->SetPeriodEnumExplicit(((AliConvEventCuts*)fV0Reader->GetEventCuts())->GetPeriodEnum());
1299  } else if (((AliConvEventCuts*)fEventCutArray->At(iCut))->GetPeriodEnum() == AliConvEventCuts::kNoPeriod ){
1300  ((AliConvEventCuts*)fEventCutArray->At(iCut))->SetPeriodEnum(fV0Reader->GetPeriodName());
1301  }
1302 
1303  if(!((AliConvEventCuts*)fEventCutArray->At(iCut))->GetDoEtaShift()){
1304  fProfileEtaShift[iCut]->Fill(0.,(((AliConvEventCuts*)fEventCutArray->At(iCut))->GetEtaShift()));
1305  continue; // No Eta Shift requested, continue
1306  }
1307  if(((AliConvEventCuts*)fEventCutArray->At(iCut))->GetEtaShift() == 0.0){ // Eta Shift requested but not set, get shift automatically
1308  ((AliConvEventCuts*)fEventCutArray->At(iCut))->GetCorrectEtaShiftFromPeriod();
1309  fProfileEtaShift[iCut]->Fill(0.,(((AliConvEventCuts*)fEventCutArray->At(iCut))->GetEtaShift()));
1310  ((AliConvEventCuts*)fEventCutArray->At(iCut))->DoEtaShift(kFALSE); // Eta Shift Set, make sure that it is called only once
1311  continue;
1312  } else {
1313  printf(" Gamma Conversion Task %s :: Eta Shift Manually Set to %f \n\n",
1314  (((AliConvEventCuts*)fEventCutArray->At(iCut))->GetCutNumber()).Data(),((AliConvEventCuts*)fEventCutArray->At(iCut))->GetEtaShift());
1315  fProfileEtaShift[iCut]->Fill(0.,(((AliConvEventCuts*)fEventCutArray->At(iCut))->GetEtaShift()));
1316  ((AliConvEventCuts*)fEventCutArray->At(iCut))->DoEtaShift(kFALSE); // Eta Shift Set, make sure that it is called only once
1317  }
1318 
1319  // Check whether non linearity correction has been applied already
1320  Bool_t doNonLinCorr = kTRUE;
1321  if (((AliCaloPhotonCuts*)fClusterCutArray->At(iCut))->GetNonLinearity() == ((AliCaloPhotonCuts*)fClusterMergedCutArray->At(iCut))->GetNonLinearity()){
1322  doNonLinCorr = kFALSE;
1323  } else if (((AliCaloPhotonCuts*)fClusterCutArray->At(iCut))->GetNonLinearity() == 0 && ((AliCaloPhotonCuts*)fClusterMergedCutArray->At(iCut))->GetNonLinearity() > 0){
1324  doNonLinCorr = kTRUE;
1325  } else if (((AliCaloPhotonCuts*)fClusterCutArray->At(iCut))->GetNonLinearity() > 0 && ((AliCaloPhotonCuts*)fClusterMergedCutArray->At(iCut))->GetNonLinearity() == 0){
1326  doNonLinCorr = kTRUE;
1327  } else {
1328  doNonLinCorr = kFALSE;
1329  cout << "ERROR: something went wrong in the configuration, different non linearity corrections have been chosen in the standard and merged cluster, which are incompatible" << endl;
1330  cout << "INFO: switching off the non lin corr for merged cluster" << endl;
1331  }
1332  // check whether photon fullfill merged cluster cuts as well
1333  if (doNonLinCorr) ((AliCaloPhotonCuts*)fClusterMergedCutArray->At(fiCut))->SetUseNonLinearitySwitch(doNonLinCorr);
1334 
1335 
1336  }
1337  return kTRUE;
1338 }
1339 //_____________________________________________________________________________
1341 {
1342  //
1343  // Called for each event
1344  //
1345  fInputEvent = InputEvent();
1346 
1347  if(fIsMC> 0) fMCEvent = MCEvent();
1348 
1349  Int_t eventQuality = ((AliConvEventCuts*)fV0Reader->GetEventCuts())->GetEventQuality();
1350  if(fInputEvent->IsIncompleteDAQ()==kTRUE) eventQuality = 2; // incomplete event
1351 
1352  // Event Not Accepted due to MC event missing or wrong trigger for V0ReaderV1 or because it is incomplete => abort processing of this file/event
1353  if(eventQuality == 2 || eventQuality == 3){
1354  // write out name of broken file for first event
1355  if (fIsMC > 0){
1356  if (fInputEvent->IsA()==AliESDEvent::Class()){
1357  if (((AliESDEvent*)fInputEvent)->GetEventNumberInFile() == 0){
1358  fFileNameBroken = new TObjString(Form("%s",((TString)fV0Reader->GetCurrentFileName()).Data()));
1359  if (tBrokenFiles) tBrokenFiles->Fill();
1360  delete fFileNameBroken;
1361  }
1362  }
1363  }
1364 
1365  for(Int_t iCut = 0; iCut<fnCuts; iCut++){
1366  fHistoNEvents[iCut]->Fill(eventQuality);
1367  if (fIsMC==2)
1368  fHistoNEventsWOWeight[iCut]->Fill(eventQuality);
1369  }
1370  return;
1371  }
1372 
1373  // ------------------- BeginEvent ----------------------------
1374 
1375  for(Int_t iCut = 0; iCut<fnCuts; iCut++){
1376  fiCut = iCut;
1377 
1378  Bool_t isRunningEMCALrelAna = kFALSE;
1379  if (((AliCaloPhotonCuts*)fClusterCutArray->At(fiCut))->GetClusterType() == 1) isRunningEMCALrelAna = kTRUE;
1380 
1381  Int_t eventNotAccepted = ((AliConvEventCuts*)fEventCutArray->At(iCut))->IsEventAcceptedByCut(fV0Reader->GetEventCuts(),fInputEvent,fMCEvent,fIsHeavyIon, isRunningEMCALrelAna);
1382 
1383  if(fIsMC==2){
1384  Float_t xsection = -1.; Float_t ntrials = -1.;
1385  ((AliConvEventCuts*)fEventCutArray->At(iCut))->GetXSectionAndNTrials(fMCEvent,xsection,ntrials,fInputEvent);
1386  if((xsection==-1.) || (ntrials==-1.)) AliFatal(Form("ERROR: GetXSectionAndNTrials returned invalid xsection/ntrials, periodName from V0Reader: '%s'",fV0Reader->GetPeriodName().Data()));
1387  fProfileJetJetXSection[iCut]->Fill(0.,xsection);
1388  fHistoJetJetNTrials[iCut]->Fill("#sum{NTrials}",ntrials);
1389  }
1390 
1391  fWeightJetJetMC = 1;
1392  // cout << fMCEvent << endl;
1393  Bool_t isMCJet = ((AliConvEventCuts*)fEventCutArray->At(iCut))->IsJetJetMCEventAccepted( fMCEvent, fWeightJetJetMC, fInputEvent );
1394  if (!isMCJet){
1395  fHistoNEvents[iCut]->Fill(10,fWeightJetJetMC);
1396  if (fIsMC==2) fHistoNEventsWOWeight[iCut]->Fill(10);
1397  continue;
1398  }
1399 
1400  Bool_t triggered = kTRUE;
1401  if(eventNotAccepted!= 0){
1402  fHistoNEvents[iCut]->Fill(eventNotAccepted, fWeightJetJetMC); // Check Centrality, PileUp, SDD and V0AND --> Not Accepted => eventQuality = 1
1403  if (fIsMC>1) fHistoNEventsWOWeight[iCut]->Fill(eventNotAccepted);
1404  // cout << "event rejected due to wrong trigger: " <<eventNotAccepted << endl;
1405  if (eventNotAccepted==3 && fIsMC > 0){
1406  triggered = kFALSE;
1407  }else {
1408  continue;
1409  }
1410  }
1411 
1412  if(eventQuality != 0 && triggered== kTRUE){// Event Not Accepted
1413  //cout << "event rejected due to: " <<eventQuality << endl;
1414  fHistoNEvents[iCut]->Fill(eventQuality, fWeightJetJetMC);
1415  if (fIsMC==2) fHistoNEventsWOWeight[iCut]->Fill(eventQuality);
1416 
1417  continue;
1418  }
1419  if (triggered == kTRUE) {
1420  fHistoNEvents[iCut]->Fill(eventQuality, fWeightJetJetMC); // Should be 0 here
1421  if (fIsMC==2) fHistoNEventsWOWeight[iCut]->Fill(eventQuality); // Should be 0 here
1422 
1424  fWeightJetJetMC);
1425  fHistoVertexZ[iCut]->Fill( fInputEvent->GetPrimaryVertex()->GetZ(),
1426  fWeightJetJetMC);
1427  fHistoSPDClusterTrackletBackground[iCut]->Fill( fInputEvent->GetMultiplicity()->GetNumberOfTracklets(),
1428  (fInputEvent->GetNumberOfITSClusters(0)+fInputEvent->GetNumberOfITSClusters(1)),
1429  fWeightJetJetMC);
1430  if(((AliConvEventCuts*)fEventCutArray->At(iCut))->IsHeavyIon() == 2)
1431  fHistoNV0Tracks[iCut]->Fill(fInputEvent->GetVZEROData()->GetMTotV0A(),
1432  fWeightJetJetMC);
1433  else
1434  fHistoNV0Tracks[iCut]->Fill(fInputEvent->GetVZEROData()->GetMTotV0A()+fInputEvent->GetVZEROData()->GetMTotV0C(),
1435  fWeightJetJetMC);
1436  }
1437  if(fIsMC> 0){
1438  // Process MC Particle
1439  if(((AliConvEventCuts*)fEventCutArray->At(iCut))->GetSignalRejection() != 0){
1440  if(fInputEvent->IsA()==AliESDEvent::Class()){
1441  ((AliConvEventCuts*)fEventCutArray->At(iCut))->GetNotRejectedParticles(((AliConvEventCuts*)fEventCutArray->At(iCut))->GetSignalRejection(),
1442  ((AliConvEventCuts*)fEventCutArray->At(iCut))->GetAcceptedHeader(),
1443  fMCEvent);
1444  }
1445  else if(fInputEvent->IsA()==AliAODEvent::Class()){
1446  ((AliConvEventCuts*)fEventCutArray->At(iCut))->GetNotRejectedParticles(((AliConvEventCuts*)fEventCutArray->At(iCut))->GetSignalRejection(),
1447  ((AliConvEventCuts*)fEventCutArray->At(iCut))->GetAcceptedHeader(),
1448  fInputEvent);
1449  }
1450 
1451  if(((AliConvEventCuts*)fEventCutArray->At(iCut))->GetAcceptedHeader()){
1452  for(Int_t i = 0;i<(((AliConvEventCuts*)fEventCutArray->At(iCut))->GetAcceptedHeader())->GetEntries();i++){
1453  TString nameBin= fHistoMCHeaders[iCut]->GetXaxis()->GetBinLabel(i+1);
1454  if (nameBin.CompareTo("")== 0){
1455  TString nameHeader = ((TObjString*)((TList*)((AliConvEventCuts*)fEventCutArray->At(iCut))
1456  ->GetAcceptedHeader())->At(i))->GetString();
1457  fHistoMCHeaders[iCut]->GetXaxis()->SetBinLabel(i+1,nameHeader.Data());
1458  }
1459  }
1460  }
1461  }
1462  }
1463  if(fIsMC>0){
1464  if(fInputEvent->IsA()==AliESDEvent::Class())
1466  if(fInputEvent->IsA()==AliAODEvent::Class())
1468  }
1469 
1470  if (triggered==kFALSE) continue;
1471 
1472  // 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)
1473  ProcessClusters(); // process calo clusters
1474 
1476  fWeightJetJetMC);
1478  fWeightJetJetMC);
1479 
1482  fWeightJetJetMC);
1483 
1487 
1488  }
1489 
1490  PostData(1, fOutputContainer);
1491 }
1492 
1493 //________________________________________________________________________
1495 
1496  Int_t nclus = 0;
1497  TClonesArray * arrClustersProcess = NULL;
1498  if(!fCorrTaskSetting.CompareTo("")){
1499  nclus = fInputEvent->GetNumberOfCaloClusters();
1500  } else {
1501  arrClustersProcess = dynamic_cast<TClonesArray*>(fInputEvent->FindListObject(Form("%sClustersBranch",fCorrTaskSetting.Data())));
1502  if(!arrClustersProcess)
1503  AliFatal(Form("%sClustersBranch was not found in AliAnalysisTaskGammaCaloMerged! Check the correction framework settings!",fCorrTaskSetting.Data()));
1504  nclus = arrClustersProcess->GetEntries();
1505  }
1506 
1507 // cout << nclus << endl;
1508 
1509  if(nclus == 0) return;
1510 
1511 // cout << "new event with accepted clusters: \t trigger \t" << (((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetSpecialTriggerName()).Data() <<endl;
1512 
1513  fNClusterCandidates = 0;
1515 
1516  // plotting histograms on cell/tower level, only if extendedMatchAndQA > 1
1517  ((AliCaloPhotonCuts*)fClusterCutArray->At(fiCut))->FillHistogramsExtendedQA(fInputEvent,fIsMC);
1518 
1519  // match tracks to clusters
1520  ((AliCaloPhotonCuts*)fClusterCutArray->At(fiCut))->MatchTracksToClusters(fInputEvent, fWeightJetJetMC, kTRUE, fMCEvent);
1521  // match tracks to clusters also for mergedCutArray
1522  ((AliCaloPhotonCuts*)fClusterMergedCutArray->At(fiCut))->MatchTracksToClusters(fInputEvent, fWeightJetJetMC, kTRUE, fMCEvent);
1523 
1524  // vertex
1525  Double_t vertex[3] = {0};
1526  InputEvent()->GetPrimaryVertex()->GetXYZ(vertex);
1527 
1528  // Loop over EMCal clusters
1529  for(Long_t i = 0; i < nclus; i++){
1530 
1531  Double_t tempClusterWeight = fWeightJetJetMC;
1532  Double_t tempPhotonWeight = fWeightJetJetMC;
1533  // select clusters with open cuts for normalizations histos
1534  AliVCluster* clus = NULL;
1535  if(fInputEvent->IsA()==AliESDEvent::Class()){
1536  if(arrClustersProcess)
1537  clus = new AliESDCaloCluster(*(AliESDCaloCluster*)arrClustersProcess->At(i));
1538  else
1539  clus = new AliESDCaloCluster(*(AliESDCaloCluster*)fInputEvent->GetCaloCluster(i));
1540  } else if(fInputEvent->IsA()==AliAODEvent::Class()){
1541  if(arrClustersProcess)
1542  clus = new AliAODCaloCluster(*(AliAODCaloCluster*)arrClustersProcess->At(i));
1543  else
1544  clus = new AliAODCaloCluster(*(AliAODCaloCluster*)fInputEvent->GetCaloCluster(i));
1545  }
1546 
1547  if (!clus) continue;
1548 
1549  // Set the jetjet weight to 1 in case the cluster orignated from the minimum bias header
1550  if (fIsMC>0 && ((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetSignalRejection() == 4){
1551  if( ((AliConvEventCuts*)fEventCutArray->At(fiCut))->IsParticleFromBGEvent(clus->GetLabelAt(0), fMCEvent, fInputEvent) == 2)
1552  tempClusterWeight = 1;
1553  }
1554 
1555  // if open cluster cuts are not fullfilled I can abort
1556  if(!((AliCaloPhotonCuts*)fClusterCutArray->At(fiCut))->ClusterIsSelected(clus,fInputEvent,fMCEvent,fIsMC,tempClusterWeight, i)){
1557  delete clus;
1558  continue;
1559  }
1560 
1561  // TLorentzvector with cluster
1562  TLorentzVector clusterVector;
1563  clus->GetMomentum(clusterVector,vertex);
1564 
1565  TLorentzVector* tmpvec = new TLorentzVector();
1566  tmpvec->SetPxPyPzE(clusterVector.Px(),clusterVector.Py(),clusterVector.Pz(),clusterVector.E());
1567 
1568  // convert to AODConversionPhoton
1569  AliAODConversionPhoton *PhotonCandidate=new AliAODConversionPhoton(tmpvec);
1570  if(!PhotonCandidate){
1571  delete clus;
1572  delete tmpvec;
1573  continue;
1574  }
1575 
1576  // Flag Photon as CaloPhoton
1577  PhotonCandidate->SetIsCaloPhoton();
1578  PhotonCandidate->SetCaloClusterRef(i);
1579 
1580  // get MC label
1581  if(fIsMC> 0){
1582  Int_t* mclabelsCluster = clus->GetLabels();
1583 // cout << "cluster: " << i << endl;
1584  Int_t nValidClusters = 0;
1585 
1586  if (clus->GetNLabels()>0){
1587  for (Int_t k =0; k< (Int_t)clus->GetNLabels(); k++){
1588 // TParticle *dummy = NULL;
1589  if (mclabelsCluster[k]>0){
1590 // dummy = fMCEvent->Particle(mclabelsCluster[k]);
1591 // if (dummy->R() < 407.0){
1592  if (nValidClusters< 50)PhotonCandidate->SetCaloPhotonMCLabel(nValidClusters,mclabelsCluster[k]);
1593  nValidClusters++;
1594 // }
1595  }
1596  }
1597  }
1598  PhotonCandidate->SetNCaloPhotonMCLabels(nValidClusters);
1599 
1600  }
1601 
1602  fIsFromMBHeader = kTRUE;
1604 
1605  // test whether largest contribution to cluster orginates in added signals
1606  if (fIsMC>0 && ((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetSignalRejection() > 0){
1607  // Set the jetjet weight to 1 in case the photon candidate orignated from the minimum bias header
1608  if ( ((AliConvEventCuts*)fEventCutArray->At(fiCut))->IsParticleFromBGEvent(PhotonCandidate->GetCaloPhotonMCLabel(0), fMCEvent, fInputEvent) == 2 && ((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetSignalRejection() == 4) tempPhotonWeight = 1;
1609  if ( ((AliConvEventCuts*)fEventCutArray->At(fiCut))->IsParticleFromBGEvent(PhotonCandidate->GetCaloPhotonMCLabel(0), fMCEvent, fInputEvent) == 0) fIsFromMBHeader = kFALSE;
1610  if (clus->GetNLabels()>1){
1611  Int_t* mclabelsCluster = clus->GetLabels();
1612  for (Int_t l = 1; l < (Int_t)clus->GetNLabels(); l++ ){
1613  if (((AliConvEventCuts*)fEventCutArray->At(fiCut))->IsParticleFromBGEvent(mclabelsCluster[l], fMCEvent, fInputEvent) == 0) fIsOverlappingWithOtherHeader = kTRUE;
1614  }
1615  }
1616  }
1617 
1618  // check whether photon is from correct header
1620  fHistoClusOverlapHeadersGammaPt[fiCut]->Fill(PhotonCandidate->Pt(), tempPhotonWeight);
1621  }
1622  // only cluster candidates from correct header will be processed fully
1624  fHistoClusGammaPt[fiCut]->Fill(PhotonCandidate->Pt(), tempPhotonWeight);
1625  fHistoClusGammaE[fiCut]->Fill(PhotonCandidate->E(), tempPhotonWeight);
1626  if (fDoClusterQA > 0){
1627  fHistoClusNCellsPt[fiCut]->Fill(clus->GetNCells(), PhotonCandidate->Pt(), tempPhotonWeight);
1628  }
1630  } else {
1631  delete clus;
1632  delete tmpvec;
1633  delete PhotonCandidate;
1634  continue;
1635  }
1636 
1637  if(!((AliCaloPhotonCuts*)fClusterMergedCutArray->At(fiCut))->ClusterIsSelected(clus,fInputEvent,fMCEvent,fIsMC,tempPhotonWeight,i)){
1638  delete clus;
1639  delete tmpvec;
1640  delete PhotonCandidate;
1641  continue;
1642  }else {
1644  }
1645 
1646  AliAODCaloCluster* clusSub1 = new AliAODCaloCluster();
1647  AliAODCaloCluster* clusSub2 = new AliAODCaloCluster();
1648 
1649 
1650  // split clusters according to their shares in the cluster (NLM == 1) needs to be treated differently
1651  if (((AliCaloPhotonCuts*)fClusterMergedCutArray->At(fiCut))->GetMinNLMCut() == 1 &&
1652  ((AliCaloPhotonCuts*)fClusterMergedCutArray->At(fiCut))->GetMaxNLMCut() == 1 ){
1653 
1654  Int_t absCellIdFirst = ((AliCaloPhotonCuts*)fClusterCutArray->At(fiCut))->FindLargestCellInCluster(clus, fInputEvent);
1655  Int_t absCellIdSecond = ((AliCaloPhotonCuts*)fClusterCutArray->At(fiCut))->FindSecondLargestCellInCluster(clus, fInputEvent);
1656 
1657  ((AliCaloPhotonCuts*)fClusterCutArray->At(fiCut))->SplitEnergy(absCellIdFirst, absCellIdSecond,
1658  clus, fInputEvent, fIsMC, clusSub1, clusSub2);
1659 
1660 
1661  } else if (((AliCaloPhotonCuts*)fClusterMergedCutArray->At(fiCut))->GetMinNLMCut() > 1 ){
1662  const Int_t nc = clus->GetNCells();
1663  Int_t absCellIdList[nc];
1664  //Float_t maxEList[nc];
1665  //Int_t nlm = ((AliCaloPhotonCuts*)fClusterCutArray->At(fiCut))->GetNumberOfLocalMaxima(clus, fInputEvent, absCellIdList, maxEList);
1666  ((AliCaloPhotonCuts*)fClusterCutArray->At(fiCut))->SplitEnergy(absCellIdList[0], absCellIdList[1],
1667  clus, fInputEvent, fIsMC, clusSub1, clusSub2);
1668  }
1669  fHistoClusMergedPtvsM02[fiCut]->Fill( PhotonCandidate->Pt(),
1670  clus->GetM02(),
1671  tempPhotonWeight);
1672 
1673  // TLorentzvector with sub cluster 1
1674  TLorentzVector clusterVector1;
1675  clusSub1->GetMomentum(clusterVector1,vertex);
1676  TLorentzVector* tmpvec1 = new TLorentzVector();
1677  tmpvec1->SetPxPyPzE(clusterVector1.Px(),clusterVector1.Py(),clusterVector1.Pz(),clusterVector1.E());
1678  // convert to AODConversionPhoton
1679  AliAODConversionPhoton *PhotonCandidate1=new AliAODConversionPhoton(tmpvec1);
1680  if(!PhotonCandidate1){
1681  delete clusSub1;
1682  delete tmpvec1;
1683  continue;
1684  }
1685  // Flag Photon as CaloPhoton
1686  PhotonCandidate1->SetIsCaloPhoton();
1687 
1688  // TLorentzvector with sub cluster 2
1689  TLorentzVector clusterVector2;
1690  clusSub2->GetMomentum(clusterVector2,vertex);
1691  TLorentzVector* tmpvec2 = new TLorentzVector();
1692  tmpvec2->SetPxPyPzE(clusterVector2.Px(),clusterVector2.Py(),clusterVector2.Pz(),clusterVector2.E());
1693  // convert to AODConversionPhoton
1694  AliAODConversionPhoton *PhotonCandidate2=new AliAODConversionPhoton(tmpvec2);
1695  if(!PhotonCandidate2){
1696  delete clusSub2;
1697  delete tmpvec2;
1698  continue;
1699  }
1700  // Flag Photon as CaloPhoton
1701  PhotonCandidate2->SetIsCaloPhoton();
1702 
1703  // create pi0 candidate
1704  AliAODConversionMother *pi0cand = new AliAODConversionMother(PhotonCandidate1,PhotonCandidate2);
1705 
1706  if((((AliConversionMesonCuts*)fMesonCutArray->At(fiCut))->MesonIsSelected(pi0cand,kTRUE,((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetEtaShift()))){
1707  fHistoMotherInvMassPt[fiCut]->Fill(pi0cand->M(),PhotonCandidate->Pt(), tempPhotonWeight);
1708  fHistoClusMergedPtvsM02Accepted[fiCut]->Fill( PhotonCandidate->Pt(), clus->GetM02(), tempPhotonWeight);
1709  fHistoClusMergedEvsM02Accepted[fiCut]->Fill( PhotonCandidate->E(), clus->GetM02(), tempPhotonWeight);
1710  Int_t nlm = ((AliCaloPhotonCuts*)fClusterCutArray->At(fiCut))->GetNumberOfLocalMaxima(clus, fInputEvent);
1711  if ( nlm < 11 ){
1712  fHistoClusNLMPt[fiCut]->Fill( nlm, PhotonCandidate->Pt());
1713  } else {
1714  fHistoClusNLMPt[fiCut]->Fill( 11., PhotonCandidate->Pt());
1715  }
1716 
1717  if (fDoClusterQA > 0){
1718  fHistoClusMergedNCellsPt[fiCut]->Fill(clus->GetNCells(), PhotonCandidate->Pt(), tempPhotonWeight);
1719  Double_t energyAround = 0;
1720  Double_t nCellsAround = 0;
1721  for (Int_t j = 0; j < nclus; j++){
1722  if (j == i) continue;
1723  AliVCluster* clusTemp = NULL;
1724  if(fInputEvent->IsA()==AliESDEvent::Class()){
1725  if(arrClustersProcess)
1726  clusTemp = new AliESDCaloCluster(*(AliESDCaloCluster*)arrClustersProcess->At(j));
1727  else
1728  clusTemp = new AliESDCaloCluster(*(AliESDCaloCluster*)fInputEvent->GetCaloCluster(j));
1729  } else if(fInputEvent->IsA()==AliAODEvent::Class()){
1730  if(arrClustersProcess)
1731  clusTemp = new AliAODCaloCluster(*(AliAODCaloCluster*)arrClustersProcess->At(j));
1732  else
1733  clusTemp = new AliAODCaloCluster(*(AliAODCaloCluster*)fInputEvent->GetCaloCluster(j));
1734  }
1735 
1736  if (!clusTemp) continue;
1737 
1738  Double_t R = ((AliCaloPhotonCuts*)fClusterCutArray->At(fiCut))->GetDistanceBetweenClusters(clus, clusTemp);
1739 
1740  if (R < 0.15){
1741  nCellsAround = nCellsAround+clusTemp->GetNCells();
1742  energyAround = energyAround+clusTemp->E();
1743  }
1744  delete clusTemp;
1745  }
1746  fHistoClusMergedNCellsAroundPt[fiCut]->Fill(nCellsAround, PhotonCandidate->Pt(), tempPhotonWeight);
1747  fHistoClusMergedNCellsAroundAndInPt[fiCut]->Fill(nCellsAround+clus->GetNCells(), PhotonCandidate->Pt(), tempPhotonWeight);
1748  fHistoClusMergedEAroundE[fiCut]->Fill(energyAround, clus->E(), tempPhotonWeight);
1749  if (fIsMC > 0){
1750  fHistoClusMergedNParticlePt[fiCut]->Fill(clus->GetNLabels(), PhotonCandidate->Pt(), tempPhotonWeight);
1751  }
1752  }
1753  if (fDoMesonQA > 0 ){
1754  fHistoMotherPtY[fiCut]->Fill(PhotonCandidate->Pt(),pi0cand->Rapidity()-((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetEtaShift(), tempPhotonWeight);
1755  fHistoMotherPtAlpha[fiCut]->Fill(PhotonCandidate->Pt(),TMath::Abs(pi0cand->GetAlpha()), tempPhotonWeight);
1756  }
1757  if(fIsMC> 0 && PhotonCandidate && PhotonCandidate1 && PhotonCandidate2){
1758  if(fInputEvent->IsA()==AliESDEvent::Class())
1759  ProcessTrueClusterCandidates(PhotonCandidate, clus->GetM02(), PhotonCandidate1, PhotonCandidate2);
1760  if(fInputEvent->IsA()==AliAODEvent::Class())
1761  ProcessTrueClusterCandidatesAOD(PhotonCandidate, clus->GetM02(), PhotonCandidate1, PhotonCandidate2);
1762  }
1763  }
1764 
1765 
1766 
1767  delete pi0cand;
1768  delete clusSub1;
1769  delete tmpvec1;
1770  delete PhotonCandidate1;
1771  delete clusSub2;
1772  delete tmpvec2;
1773  delete PhotonCandidate2;
1774 
1775  delete clus;
1776  delete tmpvec;
1777  delete PhotonCandidate;
1778  }
1779 
1780 }
1781 
1782 //________________________________________________________________________
1784  AliAODConversionPhoton *TrueSubClusterCandidate1,
1785  AliAODConversionPhoton *TrueSubClusterCandidate2)
1786 {
1787 
1788  const AliVVertex* primVtxMC = fMCEvent->GetPrimaryVertex();
1789  Double_t mcProdVtxX = primVtxMC->GetX();
1790  Double_t mcProdVtxY = primVtxMC->GetY();
1791  Double_t mcProdVtxZ = primVtxMC->GetZ();
1792 
1793  Double_t tempClusterWeight = fWeightJetJetMC;
1794  TParticle *Photon = NULL;
1795  if (!TrueClusterCandidate->GetIsCaloPhoton()) AliFatal("CaloPhotonFlag has not been set task will abort");
1796  if (TrueClusterCandidate->GetCaloPhotonMCLabel(0) < 0) return;
1797 
1798  if (TrueClusterCandidate->GetNCaloPhotonMCLabels()>0) Photon = fMCEvent->Particle(TrueClusterCandidate->GetCaloPhotonMCLabel(0));
1799  else return;
1800 
1801  if(Photon == NULL){
1802  // cout << "no photon" << endl;
1803  return;
1804  }
1805 
1806  AliAODConversionMother *mesoncand = new AliAODConversionMother(TrueSubClusterCandidate1,TrueSubClusterCandidate2);
1807  Bool_t mesonIsSelected = (((AliConversionMesonCuts*)fMesonCutArray->At(fiCut))->MesonIsSelected(mesoncand,kTRUE,((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetEtaShift()));
1808  if (!mesonIsSelected){
1809  delete mesoncand;
1810  return;
1811  }
1812  Int_t pdgCodeParticle = Photon->GetPdgCode();
1813  TrueClusterCandidate->SetCaloPhotonMCFlags(fMCEvent, fEnableSortForClusMC, kTRUE);
1814  if (TrueClusterCandidate->GetNCaloPhotonMCLabels()>0 && fEnableDetailedPrintOut){
1815  cout << endl << endl << "Cluster energy: " << TrueClusterCandidate->E() << endl;;
1816  TrueClusterCandidate->PrintCaloMCLabelsAndInfo(fMCEvent);
1817  TrueClusterCandidate->PrintCaloMCFlags();
1818  }
1819 
1821  Int_t clusterClass = 0;
1822  Bool_t isPrimary = ((AliConvEventCuts*)fEventCutArray->At(fiCut))->IsConversionPrimaryESD( fMCEvent, TrueClusterCandidate->GetCaloPhotonMCLabel(0), mcProdVtxX, mcProdVtxY, mcProdVtxZ);
1823 
1824  // cluster classification:
1825  // 1 - nice merged cluster (2 gamma | contributions from 2 gamma) from pi0/eta
1826  // 2 - contribution from only 1 partner (1 gamma, 1 fully coverted gamma) from pi0/eta
1827  // 3 - contribution from part of 1 partner (1 electron) from pi0/eta
1828  Long_t motherLab = -1;
1829  if (TrueClusterCandidate->IsMerged() || TrueClusterCandidate->IsMergedPartConv()){
1830  clusterClass = 1;
1831  motherLab = TrueClusterCandidate->GetCaloPhotonMotherMCLabel(0);
1832  } else if (TrueClusterCandidate->GetNCaloPhotonMotherMCLabels()> 0){
1833  // cout << TrueClusterCandidate->GetCaloPhotonMotherMCLabel(0) << endl;
1834  if (TrueClusterCandidate->IsLargestComponentElectron() || TrueClusterCandidate->IsLargestComponentPhoton()){
1835  if (TrueClusterCandidate->GetCaloPhotonMotherMCLabel(0) > -1 && (fMCEvent->Particle(TrueClusterCandidate->GetCaloPhotonMotherMCLabel(0))->GetPdgCode() == 111 || fMCEvent->Particle(TrueClusterCandidate->GetCaloPhotonMotherMCLabel(0))->GetPdgCode() == 221) ){
1836  if ( TrueClusterCandidate->IsConversion() && !TrueClusterCandidate->IsConversionFullyContained() ){
1837  clusterClass = 3;
1838  motherLab = TrueClusterCandidate->GetCaloPhotonMotherMCLabel(0);
1839  } else {
1840  clusterClass = 2;
1841  motherLab = TrueClusterCandidate->GetCaloPhotonMotherMCLabel(0);
1842  }
1843  }
1844  } else if (TrueClusterCandidate->IsSubLeadingEM()){
1845  if (TrueClusterCandidate->GetNCaloPhotonMotherMCLabels()> 1){
1846  if (fEnableDetailedPrintOut) cout << "Is Subleading EM: "<< TrueClusterCandidate->GetCaloPhotonMotherMCLabel(1) << endl;
1847  if ( TrueClusterCandidate->GetCaloPhotonMotherMCLabel(1) > -1){
1848  if (fMCEvent->Particle(TrueClusterCandidate->GetCaloPhotonMotherMCLabel(1))->GetPdgCode() == 111 || fMCEvent->Particle(TrueClusterCandidate->GetCaloPhotonMotherMCLabel(1))->GetPdgCode() == 221 ){
1849  clusterClass = 2;
1850  motherLab = TrueClusterCandidate->GetCaloPhotonMotherMCLabel(1);
1851  }
1852  }
1853  }
1854  } else {
1855  motherLab = TrueClusterCandidate->GetCaloPhotonMotherMCLabel(0);
1856  }
1857  }
1858 
1859  // Get Mother particle
1860  TParticle *mother = NULL;
1861  Int_t motherPDG = -1;
1862  if (motherLab > -1){
1863  mother = fMCEvent->Particle(motherLab);
1864  }
1865  if (fEnableDetailedPrintOut) cout << "cluster class: " << clusterClass << "\t mother lab: "<< motherLab ;
1866  if (mother){
1867  motherPDG = TMath::Abs(mother->GetPdgCode());
1868  if (fEnableDetailedPrintOut) cout << "\t mother pdg: " << motherPDG << endl;
1869  } else {
1870  if (fEnableDetailedPrintOut) cout << endl;
1871  }
1872  // Set the jetjet weight to 1 in case the photon orignated from the minimum bias header
1873  if (fIsMC>0 && ((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetSignalRejection() == 4){
1874  if ( ((AliConvEventCuts*)fEventCutArray->At(fiCut))->IsParticleFromBGEvent(motherLab, fMCEvent, fInputEvent) == 2) tempClusterWeight = 1;
1875  }
1876 
1877  //
1878  if (clusterClass == 1 || clusterClass == 2 || clusterClass == 3 ){
1879  fHistoTrueClusMergedPtvsM02[fiCut]->Fill(TrueClusterCandidate->Pt(), m02, tempClusterWeight);
1880  if (fDoMesonQA > 1)fHistoTrueClusMergedInvMassvsPt[fiCut]->Fill(mesoncand->M(),TrueClusterCandidate->Pt(), tempClusterWeight);
1881 
1882  // separate different components
1883  if (clusterClass == 1 && TrueClusterCandidate->IsMerged()){
1884  if (motherPDG == 111){
1885  fHistoTrueClusMergedPureFromPi0PtvsM02[fiCut]->Fill(TrueClusterCandidate->Pt(), m02, tempClusterWeight);
1886  if (GetSelectedMesonID() < 2 && !isPrimary && m02 >= 0 && m02 <= 4.8 ){
1887  fHistoTrueSecPi0PtvsDiffReco[fiCut]->Fill(TrueClusterCandidate->Pt(), 0., tempClusterWeight);
1888  }
1889  }
1890  if (motherPDG == 221)
1891  fHistoTrueClusMergedPureFromEtaPtvsM02[fiCut]->Fill(TrueClusterCandidate->Pt(), m02, tempClusterWeight);
1892  } else if (clusterClass == 1 && TrueClusterCandidate->IsMergedPartConv()){
1893  if (motherPDG == 111){
1894  fHistoTrueClusMergedPartConvFromPi0PtvsM02[fiCut]->Fill(TrueClusterCandidate->Pt(), m02, tempClusterWeight);
1895  if (GetSelectedMesonID() < 2 && !isPrimary && m02 >= 0 && m02 <= 4.8 ){
1896  fHistoTrueSecPi0PtvsDiffReco[fiCut]->Fill(TrueClusterCandidate->Pt(), 1., tempClusterWeight);
1897  }
1898  }
1899  if (motherPDG == 221)
1900  fHistoTrueClusMergedPartConvFromEtaPtvsM02[fiCut]->Fill(TrueClusterCandidate->Pt(), m02, tempClusterWeight);
1901  } else if (clusterClass == 2){
1902  if (motherPDG == 111){
1903  fHistoTrueClusGammaFromPi0PtvsM02[fiCut]->Fill(TrueClusterCandidate->Pt(), m02, tempClusterWeight);
1904  if (GetSelectedMesonID() < 2 && !isPrimary && m02 >= 0 && m02 <= 4.8 ){
1905  fHistoTrueSecPi0PtvsDiffReco[fiCut]->Fill(TrueClusterCandidate->Pt(), 2., tempClusterWeight);
1906  }
1907  }if (motherPDG == 221)
1908  fHistoTrueClusGammaFromEtaPtvsM02[fiCut]->Fill(TrueClusterCandidate->Pt(), m02, tempClusterWeight);
1909  } else if (clusterClass == 3){
1910  if (motherPDG == 111) {
1911  fHistoTrueClusElectronFromPi0PtvsM02[fiCut]->Fill(TrueClusterCandidate->Pt(), m02, tempClusterWeight);
1912  if (GetSelectedMesonID() < 2 && !isPrimary && m02 >= 0 && m02 <= 4.8 ){
1913  fHistoTrueSecPi0PtvsDiffReco[fiCut]->Fill(TrueClusterCandidate->Pt(), 3., tempClusterWeight);
1914  }
1915  }
1916  if (motherPDG == 221)
1917  fHistoTrueClusElectronFromEtaPtvsM02[fiCut]->Fill(TrueClusterCandidate->Pt(), m02, tempClusterWeight);
1918  }
1919 
1920  // deal with pi0 only
1921  if (motherPDG == 111){
1922  fHistoTrueClusPi0PtvsM02[fiCut]->Fill(TrueClusterCandidate->Pt(), m02, tempClusterWeight);
1924  fHistoDoubleCountTruePi0PtvsM02[fiCut]->Fill(TrueClusterCandidate->Pt(), m02, tempClusterWeight);
1925  if (!isPrimary)
1926  fHistoDoubleCountTrueSecPi0Pt[fiCut]->Fill(TrueClusterCandidate->Pt(), tempClusterWeight);
1927  }
1928 
1929  // Treatment of multiple pi0 in cluster (filling of true candidates, amount of pions and double counting)
1930  if(TrueClusterCandidate->GetNNeutralPionMCLabels()>1){
1931  for(Int_t npion = 0; npion < TrueClusterCandidate->GetNNeutralPionMCLabels(); npion++){
1932  // fill multiple true pions in same cluster
1933  if(npion>0) fHistoTrueClusMultiplePi0PtvsM02[fiCut]->Fill(TrueClusterCandidate->Pt(), m02, tempClusterWeight);
1934 
1935  // check MC labels for double counting (each particle should only be reconstructed once)
1937  fHistoDoubleCountTrueMultiplePi0PtvsM02[fiCut]->Fill(TrueClusterCandidate->Pt(), m02, tempClusterWeight);
1938 
1939  // check if particle is not a primary -> secondary particle
1940  if(((AliConvEventCuts*)fEventCutArray->At(fiCut))->IsConversionPrimaryESD( fMCEvent, TrueClusterCandidate->GetNeutralPionMCLabel(npion), mcProdVtxX, mcProdVtxY, mcProdVtxZ)) // check if pion is primary
1941  fHistoDoubleCountTrueMultipleSecPi0Pt[fiCut]->Fill(TrueClusterCandidate->Pt(), tempClusterWeight);
1942  }
1943  }
1944  }
1945  fHistoNTrueMultiplePi0vsPt[fiCut]->Fill(TrueClusterCandidate->Pt(),TrueClusterCandidate->GetNNeutralPionMCLabels(), tempClusterWeight);
1946 
1947 
1948  if (TrueClusterCandidate->IsDalitz()){
1949  fHistoTrueClusPi0DalitzPtvsM02[fiCut]->Fill(TrueClusterCandidate->Pt(), m02, tempClusterWeight);
1950  }
1951  if (fDoMesonQA > 1)fHistoTrueClusPi0InvMassvsPt[fiCut]->Fill(mesoncand->M(),TrueClusterCandidate->Pt(), tempClusterWeight);
1952  if (fDoMesonQA > 0){
1953  fHistoTrueClusPi0EM02[fiCut]->Fill(TrueClusterCandidate->E(), m02, tempClusterWeight);
1954  }
1955  if (fDoMesonQA > 0 && GetSelectedMesonID() != 2){
1956  fHistoTruePi0PtY[fiCut]->Fill(TrueClusterCandidate->Pt(),mesoncand->Rapidity()-((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetEtaShift(), tempClusterWeight);
1957  fHistoTruePi0PtAlpha[fiCut]->Fill(TrueClusterCandidate->Pt(),TMath::Abs(mesoncand->GetAlpha()), tempClusterWeight);
1958  }
1959 
1960  if (GetSelectedMesonID() < 2) {
1961  if (isPrimary) {
1962  fHistoTrueClusPrimPi0PtvsM02[fiCut]->Fill(TrueClusterCandidate->Pt(), m02, tempClusterWeight);
1963  if(TrueClusterCandidate->GetNNeutralPionMCLabels()>1){
1964  for(Int_t npion = 1; npion < TrueClusterCandidate->GetNNeutralPionMCLabels(); npion++){
1965  if(((AliConvEventCuts*)fEventCutArray->At(fiCut))->IsConversionPrimaryESD( fMCEvent, TrueClusterCandidate->GetNeutralPionMCLabel(npion), mcProdVtxX, mcProdVtxY, mcProdVtxZ)) // check if pion is primary
1966  fHistoTrueClusMultiplePrimPi0PtvsM02[fiCut]->Fill(TrueClusterCandidate->Pt(), m02, tempClusterWeight);
1967  }
1968  }
1969  if (fDoMesonQA > 1) fHistoTrueClusPrimPi0InvMassvsPt[fiCut]->Fill(mesoncand->M(),TrueClusterCandidate->Pt(), tempClusterWeight);
1970  if (fDoMesonQA > 0 && mother->Pt()>0){
1971  if (clusterClass == 1 && TrueClusterCandidate->IsMerged())
1972  fHistoTruePrimaryPi0PureMergedMCPtResolPt[fiCut]->Fill(mother->Pt(),(TrueClusterCandidate->Pt()-mother->Pt())/mother->Pt(),tempClusterWeight);
1973  else if (clusterClass == 1 && TrueClusterCandidate->IsMergedPartConv())
1974  fHistoTruePrimaryPi0MergedPartConvMCPtResolPt[fiCut]->Fill(mother->Pt(),(TrueClusterCandidate->Pt()-mother->Pt())/mother->Pt(),tempClusterWeight);
1975  else if (clusterClass == 2)
1976  fHistoTruePrimaryPi01GammaMCPtResolPt[fiCut]->Fill(mother->Pt(),(TrueClusterCandidate->Pt()-mother->Pt())/mother->Pt(),tempClusterWeight);
1977  else if (clusterClass == 3)
1978  fHistoTruePrimaryPi01ElectronMCPtResolPt[fiCut]->Fill(mother->Pt(),(TrueClusterCandidate->Pt()-mother->Pt())/mother->Pt(),tempClusterWeight);
1979  }
1980  } else {
1981  fHistoTrueClusSecPi0PtvsM02[fiCut]->Fill(TrueClusterCandidate->Pt(), m02, tempClusterWeight);
1982  if (fDoMesonQA > 0 && mother->Pt()>0){
1983  fHistoTrueSecondaryPi0MCPtResolPt[fiCut]->Fill(mother->Pt(),(TrueClusterCandidate->Pt()-mother->Pt())/mother->Pt(),tempClusterWeight);
1984  }
1985  Int_t grandMaLab = mother->GetMother(0);
1986  if (grandMaLab > -1){
1987  if (TMath::Abs(fMCEvent->Particle(grandMaLab)->GetPdgCode()) == 310){
1988  fHistoTrueClusSecPi0FromK0sPtvsM02[fiCut]->Fill(TrueClusterCandidate->Pt(), m02, tempClusterWeight);
1989  } else if (TMath::Abs(fMCEvent->Particle(grandMaLab)->GetPdgCode()) == 130){
1990  fHistoTrueClusSecPi0FromK0lPtvsM02[fiCut]->Fill(TrueClusterCandidate->Pt(), m02, tempClusterWeight);
1991  } else if (TMath::Abs(fMCEvent->Particle(grandMaLab)->GetPdgCode()) == 3122){
1992  fHistoTrueClusSecPi0FromLambdaPtvsM02[fiCut]->Fill(TrueClusterCandidate->Pt(), m02, tempClusterWeight);
1993  }
1994  }
1995  }
1996  }
1997  // deal with eta only
1998  } else if (motherPDG == 221){
1999  fHistoTrueClusEtaPtvsM02[fiCut]->Fill(TrueClusterCandidate->Pt(), m02, tempClusterWeight);
2000  if (TrueClusterCandidate->IsDalitz()){
2001  fHistoTrueClusEtaDalitzPtvsM02[fiCut]->Fill(TrueClusterCandidate->Pt(), m02, tempClusterWeight);
2002  }
2003  if (CheckVectorForDoubleCount(fVectorDoubleCountTrueEtas,motherLab)) fHistoDoubleCountTrueEtaPtvsM02[fiCut]->Fill(TrueClusterCandidate->Pt(), m02, tempClusterWeight);
2004  if (fDoMesonQA > 1)fHistoTrueClusEtaInvMassvsPt[fiCut]->Fill(mesoncand->M(),TrueClusterCandidate->Pt(), tempClusterWeight);
2005  if (fDoMesonQA > 0){
2006  fHistoTrueClusEtaEM02[fiCut]->Fill(TrueClusterCandidate->E(), m02, tempClusterWeight);
2007  }
2008  if ( fDoMesonQA > 0 && GetSelectedMesonID() != 1 ){
2009  fHistoTrueEtaPtY[fiCut]->Fill(TrueClusterCandidate->Pt(),mesoncand->Rapidity()-((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetEtaShift(), tempClusterWeight);
2010  fHistoTrueEtaPtAlpha[fiCut]->Fill(TrueClusterCandidate->Pt(),TMath::Abs(mesoncand->GetAlpha()), tempClusterWeight);
2011  if( mother->Pt()>0)
2012  fHistoTruePrimaryEtaMCPtResolPt[fiCut]->Fill(mother->Pt(),(TrueClusterCandidate->Pt()-mother->Pt())/mother->Pt(),tempClusterWeight);
2013  }
2014  } else {
2015  fHistoTrueMergedMissedPDG[fiCut]->Fill(motherPDG, tempClusterWeight);
2016  }
2017 
2018  // leading particle is a photon or the conversion is fully contained and its not from pi0 || eta
2019  } else if (TrueClusterCandidate->IsLargestComponentPhoton() || TrueClusterCandidate->IsConversionFullyContained()
2020  || TrueClusterCandidate->IsElectronFromFragPhoton()){
2021  if (fEnableDetailedPrintOut) cout << "photon" << endl;
2022  fHistoTrueClusGammaPtvsM02[fiCut]->Fill(TrueClusterCandidate->Pt(), m02, tempClusterWeight);
2023  if (fDoMesonQA > 0){
2024  fHistoTrueClusGammaEM02[fiCut]->Fill(TrueClusterCandidate->E(), m02, tempClusterWeight);
2025  }
2026 
2027  if (fDoMesonQA > 1) fHistoTrueClusGammaInvMassvsPt[fiCut]->Fill(mesoncand->M(),TrueClusterCandidate->Pt(), tempClusterWeight);
2028  if (motherLab == -1){
2029  fHistoTrueClusGammaPtvsSource[fiCut]->Fill(TrueClusterCandidate->Pt(), 0.5, tempClusterWeight); // direct photon
2030  } else {
2031  if (motherPDG == 111)
2032  fHistoTrueClusGammaPtvsSource[fiCut]->Fill(TrueClusterCandidate->Pt(), 1.5, tempClusterWeight); // pi0
2033  else if (motherPDG == 221)
2034  fHistoTrueClusGammaPtvsSource[fiCut]->Fill(TrueClusterCandidate->Pt(), 2.5, tempClusterWeight); // eta
2035  else if (motherPDG == 331)
2036  fHistoTrueClusGammaPtvsSource[fiCut]->Fill(TrueClusterCandidate->Pt(), 3.5, tempClusterWeight); // eta'
2037  else if (motherPDG == 223)
2038  fHistoTrueClusGammaPtvsSource[fiCut]->Fill(TrueClusterCandidate->Pt(), 4.5, tempClusterWeight); // omega
2039  else if (motherPDG == 333)
2040  fHistoTrueClusGammaPtvsSource[fiCut]->Fill(TrueClusterCandidate->Pt(), 5.5, tempClusterWeight); // phi
2041  else if (motherPDG == 3122)
2042  fHistoTrueClusGammaPtvsSource[fiCut]->Fill(TrueClusterCandidate->Pt(), 6.5, tempClusterWeight); // Lambda
2043  else
2044  fHistoTrueClusGammaPtvsSource[fiCut]->Fill(TrueClusterCandidate->Pt(), 7.5, tempClusterWeight); // rest
2045  }
2046 
2047  // leading particle is an electron and its not from pi0 || eta and no electron from fragmentation photon conversion
2048  } else if (TrueClusterCandidate->IsLargestComponentElectron() &&
2049  !TrueClusterCandidate->IsElectronFromFragPhoton()){
2050  if (fEnableDetailedPrintOut) cout << "electron" << endl;
2051  fHistoTrueClusElectronPtvsM02[fiCut]->Fill(TrueClusterCandidate->Pt(), m02, tempClusterWeight);
2052  if (fDoMesonQA > 0){
2053  fHistoTrueClusElectronEM02[fiCut]->Fill(TrueClusterCandidate->E(), m02, tempClusterWeight);
2054  }
2055 
2056  if (fDoMesonQA > 1) fHistoTrueClusElectronInvMassvsPt[fiCut]->Fill(mesoncand->M(),TrueClusterCandidate->Pt(), tempClusterWeight);
2057  Int_t motherLab = Photon->GetMother(0);
2058  mother = fMCEvent->Particle(motherLab);
2059  if (mother){
2060  TrueClusterCandidate->GetLabel(0);
2061  motherPDG = TMath::Abs(mother->GetPdgCode());
2062  }
2063 
2064  if (motherLab == -1){
2065  fHistoTrueClusElectronPtvsSource[fiCut]->Fill(TrueClusterCandidate->Pt(), 0.5, tempClusterWeight); // direct electron
2066  } else {
2067  if (motherPDG == 22){
2068  fHistoTrueClusElectronPtvsSource[fiCut]->Fill(TrueClusterCandidate->Pt(), 1.5, tempClusterWeight); // gamma
2069  fHistoTrueClusElectronFromGammaPtvsM02[fiCut]->Fill(TrueClusterCandidate->Pt(), m02, tempClusterWeight);
2070  } else if (motherPDG == 111){
2071  fHistoTrueClusElectronPtvsSource[fiCut]->Fill(TrueClusterCandidate->Pt(), 2.5, tempClusterWeight); // pi0
2072  } else if (motherPDG == 221){
2073  fHistoTrueClusElectronPtvsSource[fiCut]->Fill(TrueClusterCandidate->Pt(), 3.5, tempClusterWeight); // eta
2074  } else if ( int(motherPDG/100.)==5 || int(motherPDG/1000.)==5 ){
2075  fHistoTrueClusElectronPtvsSource[fiCut]->Fill(TrueClusterCandidate->Pt(), 5.5, tempClusterWeight); // b
2076  } else if ( int(motherPDG/100.)==4 || int(motherPDG/1000.)==4 ){
2077  fHistoTrueClusElectronPtvsSource[fiCut]->Fill(TrueClusterCandidate->Pt(), 4.5, tempClusterWeight); // c
2078  } else if (motherPDG == 23 || motherPDG == 24){
2079  fHistoTrueClusElectronPtvsSource[fiCut]->Fill(TrueClusterCandidate->Pt(), 6.5, tempClusterWeight); // W/Z
2080  } else if (motherPDG == 15) {
2081  fHistoTrueClusElectronPtvsSource[fiCut]->Fill(TrueClusterCandidate->Pt(), 7.5, tempClusterWeight); // tau
2082  } else {
2083  fHistoTrueClusElectronPtvsSource[fiCut]->Fill(TrueClusterCandidate->Pt(), 8.5, tempClusterWeight); // rest
2084  }
2085  }
2086 
2087  // leading particle is a hadron
2088  } else {
2089  if (fEnableDetailedPrintOut) cout << "BG" << endl;
2090  fHistoTrueClusBGPtvsM02[fiCut]->Fill(TrueClusterCandidate->Pt(), m02, tempClusterWeight);
2091  if (fDoMesonQA > 1) fHistoTrueClusBGInvMassvsPt[fiCut]->Fill(mesoncand->M(),TrueClusterCandidate->Pt(), tempClusterWeight);
2092 
2093  Double_t maxM02 = 4.8;
2094  if (m02 >= 0 && m02 < maxM02){
2095  if (TMath::Abs(pdgCodeParticle) == 211) fHistoTrueClusBGPtvsSource[fiCut]->Fill(TrueClusterCandidate->Pt(), 0.5, tempClusterWeight); // pi+/-
2096  else if (TMath::Abs(pdgCodeParticle) == 2212) fHistoTrueClusBGPtvsSource[fiCut]->Fill(TrueClusterCandidate->Pt(), 1.5, tempClusterWeight); // p
2097  else if (TMath::Abs(pdgCodeParticle) == 321) fHistoTrueClusBGPtvsSource[fiCut]->Fill(TrueClusterCandidate->Pt(), 2.5, tempClusterWeight); // K+-
2098  else if (TMath::Abs(pdgCodeParticle) == 2112) fHistoTrueClusBGPtvsSource[fiCut]->Fill(TrueClusterCandidate->Pt(), 3.5, tempClusterWeight); // n
2099  else if (TMath::Abs(pdgCodeParticle) == 310) fHistoTrueClusBGPtvsSource[fiCut]->Fill(TrueClusterCandidate->Pt(), 4.5, tempClusterWeight); // K0s
2100  else if (TMath::Abs(pdgCodeParticle) == 3122) fHistoTrueClusBGPtvsSource[fiCut]->Fill(TrueClusterCandidate->Pt(), 5.5, tempClusterWeight); // Lambda
2101  else if (TMath::Abs(pdgCodeParticle) == 13) fHistoTrueClusBGPtvsSource[fiCut]->Fill(TrueClusterCandidate->Pt(), 6.5, tempClusterWeight); // mu+/-
2102  else if (TMath::Abs(pdgCodeParticle) == 130) fHistoTrueClusBGPtvsSource[fiCut]->Fill(TrueClusterCandidate->Pt(), 7.5, tempClusterWeight); // K0l
2103  else fHistoTrueClusBGPtvsSource[fiCut]->Fill(TrueClusterCandidate->Pt(), 8.5, tempClusterWeight); // Rest
2104  }
2105  }
2106  }
2107  delete mesoncand;
2108  return;
2109 }
2110 
2111 //________________________________________________________________________
2113  AliAODConversionPhoton *TrueSubClusterCandidate1,
2114  AliAODConversionPhoton *TrueSubClusterCandidate2)
2115 {
2116 
2117  const AliVVertex* primVtxMC = fMCEvent->GetPrimaryVertex();
2118  Double_t mcProdVtxX = primVtxMC->GetX();
2119  Double_t mcProdVtxY = primVtxMC->GetY();
2120  Double_t mcProdVtxZ = primVtxMC->GetZ();
2121 
2122  Double_t tempClusterWeight = fWeightJetJetMC;
2123  AliAODMCParticle *Photon = NULL;
2124  TClonesArray *AODMCTrackArray = dynamic_cast<TClonesArray*>(fInputEvent->FindListObject(AliAODMCParticle::StdBranchName()));
2125  if (AODMCTrackArray){
2126  if (!TrueClusterCandidate->GetIsCaloPhoton()) AliFatal("CaloPhotonFlag has not been set task will abort");
2127  if (TrueClusterCandidate->GetCaloPhotonMCLabel(0) < 0) return;
2128 
2129  if (TrueClusterCandidate->GetNCaloPhotonMCLabels()>0) Photon = (AliAODMCParticle*) AODMCTrackArray->At(TrueClusterCandidate->GetCaloPhotonMCLabel(0));
2130  else return;
2131  } else {
2132  AliInfo("AODMCTrackArray could not be loaded");
2133  return;
2134  }
2135 
2136  if(Photon == NULL){
2137  return;
2138  }
2139 
2140  AliAODConversionMother *mesoncand = new AliAODConversionMother(TrueSubClusterCandidate1,TrueSubClusterCandidate2);
2141  Bool_t mesonIsSelected = (((AliConversionMesonCuts*)fMesonCutArray->At(fiCut))->MesonIsSelected(mesoncand,kTRUE,((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetEtaShift()));
2142  if (!mesonIsSelected){
2143  delete mesoncand;
2144  return;
2145  }
2146  Int_t pdgCodeParticle = Photon->GetPdgCode();
2147  TrueClusterCandidate->SetCaloPhotonMCFlagsAOD(fInputEvent, fEnableSortForClusMC, kTRUE);
2148  if (TrueClusterCandidate->GetNCaloPhotonMCLabels()>0 && fEnableDetailedPrintOut){
2149  cout << endl << endl << "Cluster energy: " << TrueClusterCandidate->E() << endl;;
2150  //TrueClusterCandidate->PrintCaloMCLabelsAndInfo(fMCEvent);
2151  TrueClusterCandidate->PrintCaloMCFlags();
2152  }
2153 
2155  Int_t clusterClass = 0;
2156  Bool_t isPrimary = ((AliConvEventCuts*)fEventCutArray->At(fiCut))->IsConversionPrimaryAOD( fInputEvent, Photon, mcProdVtxX, mcProdVtxY, mcProdVtxZ);
2157 
2158  // cluster classification:
2159  // 1 - nice merged cluster (2 gamma | contributions from 2 gamma) from pi0/eta
2160  // 2 - contribution from only 1 partner (1 gamma, 1 fully coverted gamma) from pi0/eta
2161  // 3 - contribution from part of 1 partner (1 electron) from pi0/eta
2162  Long_t motherLab = -1;
2163  if (TrueClusterCandidate->IsMerged() || TrueClusterCandidate->IsMergedPartConv()){
2164  clusterClass = 1;
2165  motherLab = TrueClusterCandidate->GetCaloPhotonMotherMCLabel(0);
2166  } else if (TrueClusterCandidate->GetNCaloPhotonMotherMCLabels()> 0){
2167  // cout << TrueClusterCandidate->GetCaloPhotonMotherMCLabel(0) << endl;
2168  if (TrueClusterCandidate->IsLargestComponentElectron() || TrueClusterCandidate->IsLargestComponentPhoton()){
2169  if (TrueClusterCandidate->GetCaloPhotonMotherMCLabel(0) > -1 && (((AliAODMCParticle*) AODMCTrackArray->At(TrueClusterCandidate->GetCaloPhotonMotherMCLabel(0)))->GetPdgCode() == 111 || ((AliAODMCParticle*) AODMCTrackArray->At(TrueClusterCandidate->GetCaloPhotonMotherMCLabel(0)))->GetPdgCode() == 221) ){
2170  if ( TrueClusterCandidate->IsConversion() && !TrueClusterCandidate->IsConversionFullyContained() ){
2171  clusterClass = 3;
2172  motherLab = TrueClusterCandidate->GetCaloPhotonMotherMCLabel(0);
2173  } else {
2174  clusterClass = 2;
2175  motherLab = TrueClusterCandidate->GetCaloPhotonMotherMCLabel(0);
2176  }
2177  }
2178  } else if (TrueClusterCandidate->IsSubLeadingEM()){
2179  if (TrueClusterCandidate->GetNCaloPhotonMotherMCLabels()> 1){
2180  if (fEnableDetailedPrintOut) cout << "Is Subleading EM: "<< TrueClusterCandidate->GetCaloPhotonMotherMCLabel(1) << endl;
2181  if ( TrueClusterCandidate->GetCaloPhotonMotherMCLabel(1) > -1){
2182  if (TMath::Abs(((AliAODMCParticle*) AODMCTrackArray->At(TrueClusterCandidate->GetCaloPhotonMotherMCLabel(1)))->GetPdgCode()) == 111 || TMath::Abs(((AliAODMCParticle*) AODMCTrackArray->At(TrueClusterCandidate->GetCaloPhotonMotherMCLabel(1)))->GetPdgCode()) == 221 ){
2183  clusterClass = 2;
2184  motherLab = TrueClusterCandidate->GetCaloPhotonMotherMCLabel(1);
2185  }
2186  }
2187  }
2188  } else {
2189  motherLab = TrueClusterCandidate->GetCaloPhotonMotherMCLabel(0);
2190  }
2191  }
2192 
2193  // Get Mother particle
2194  AliAODMCParticle *mother = NULL;
2195  Int_t motherPDG = -1;
2196  if (motherLab > -1){
2197  mother = static_cast<AliAODMCParticle*>(AODMCTrackArray->At(motherLab));
2198  }
2199  if (fEnableDetailedPrintOut) cout << "cluster class: " << clusterClass << "\t mother lab: "<< motherLab ;
2200  if (mother){
2201  motherPDG = TMath::Abs(mother->GetPdgCode());
2202  if (fEnableDetailedPrintOut) cout << "\t mother pdg: " << motherPDG << endl;
2203  } else {
2204  if (fEnableDetailedPrintOut) cout << endl;
2205  }
2206 
2207  // Set the jetjet weight to 1 in case the cluster orignated from the minimum bias header
2208  if (fIsMC>0 && ((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetSignalRejection() == 4){
2209  if ( ((AliConvEventCuts*)fEventCutArray->At(fiCut))->IsParticleFromBGEvent(motherLab, fMCEvent, fInputEvent) == 2) tempClusterWeight = 1;
2210  }
2211 
2212  //
2213  if (clusterClass == 1 || clusterClass == 2 || clusterClass == 3 ){
2214  fHistoTrueClusMergedPtvsM02[fiCut]->Fill(TrueClusterCandidate->Pt(), m02, tempClusterWeight);
2215  if (fDoMesonQA > 1)fHistoTrueClusMergedInvMassvsPt[fiCut]->Fill(mesoncand->M(),TrueClusterCandidate->Pt(), tempClusterWeight);
2216 
2217  // separate different components
2218  if (clusterClass == 1 && TrueClusterCandidate->IsMerged()){
2219  if (motherPDG == 111){
2220  fHistoTrueClusMergedPureFromPi0PtvsM02[fiCut]->Fill(TrueClusterCandidate->Pt(), m02, tempClusterWeight);
2221  if (GetSelectedMesonID() < 2 && !isPrimary && m02 >= 0 && m02 <= 4.8 ){
2222  fHistoTrueSecPi0PtvsDiffReco[fiCut]->Fill(TrueClusterCandidate->Pt(), 0., tempClusterWeight);
2223  }
2224  }
2225  if (motherPDG == 221)
2226  fHistoTrueClusMergedPureFromEtaPtvsM02[fiCut]->Fill(TrueClusterCandidate->Pt(), m02, tempClusterWeight);
2227  } else if (clusterClass == 1 && TrueClusterCandidate->IsMergedPartConv()){
2228  if (motherPDG == 111){
2229  fHistoTrueClusMergedPartConvFromPi0PtvsM02[fiCut]->Fill(TrueClusterCandidate->Pt(), m02, tempClusterWeight);
2230  if (GetSelectedMesonID() < 2 && !isPrimary && m02 >= 0 && m02 <= 4.8 ){
2231  fHistoTrueSecPi0PtvsDiffReco[fiCut]->Fill(TrueClusterCandidate->Pt(), 1., tempClusterWeight);
2232  }
2233  }
2234  if (motherPDG == 221)
2235  fHistoTrueClusMergedPartConvFromEtaPtvsM02[fiCut]->Fill(TrueClusterCandidate->Pt(), m02, tempClusterWeight);
2236  } else if (clusterClass == 2){
2237  if (motherPDG == 111){
2238  fHistoTrueClusGammaFromPi0PtvsM02[fiCut]->Fill(TrueClusterCandidate->Pt(), m02, tempClusterWeight);
2239  if (GetSelectedMesonID() < 2 && !isPrimary && m02 >= 0 && m02 <= 4.8 ){
2240  fHistoTrueSecPi0PtvsDiffReco[fiCut]->Fill(TrueClusterCandidate->Pt(), 2., tempClusterWeight);
2241  }
2242  }if (motherPDG == 221)
2243  fHistoTrueClusGammaFromEtaPtvsM02[fiCut]->Fill(TrueClusterCandidate->Pt(), m02, tempClusterWeight);
2244  } else if (clusterClass == 3){
2245  if (motherPDG == 111) {
2246  fHistoTrueClusElectronFromPi0PtvsM02[fiCut]->Fill(TrueClusterCandidate->Pt(), m02, tempClusterWeight);
2247  if (GetSelectedMesonID() < 2 && !isPrimary && m02 >= 0 && m02 <= 4.8 ){
2248  fHistoTrueSecPi0PtvsDiffReco[fiCut]->Fill(TrueClusterCandidate->Pt(), 3., tempClusterWeight);
2249  }
2250  }
2251  if (motherPDG == 221)
2252  fHistoTrueClusElectronFromEtaPtvsM02[fiCut]->Fill(TrueClusterCandidate->Pt(), m02, tempClusterWeight);
2253  }
2254 
2255  // deal with pi0 only
2256  if (motherPDG == 111){
2257  fHistoTrueClusPi0PtvsM02[fiCut]->Fill(TrueClusterCandidate->Pt(), m02, tempClusterWeight);
2259  fHistoDoubleCountTruePi0PtvsM02[fiCut]->Fill(TrueClusterCandidate->Pt(), m02, tempClusterWeight);
2260  if (!isPrimary)
2261  fHistoDoubleCountTrueSecPi0Pt[fiCut]->Fill(TrueClusterCandidate->Pt(), tempClusterWeight);
2262  }
2263  // Treatment of multiple pi0 in cluster (filling of true candidates, amount of pions and double counting)
2264  if(TrueClusterCandidate->GetNNeutralPionMCLabels()>1){
2265  for(Int_t npion = 0; npion < TrueClusterCandidate->GetNNeutralPionMCLabels(); npion++){
2266  // fill multiple true pions in same cluster
2267  if(npion>0) fHistoTrueClusMultiplePi0PtvsM02[fiCut]->Fill(TrueClusterCandidate->Pt(), m02, tempClusterWeight);
2268 
2269  // check MC labels for double counting (each particle should only be reconstructed once)
2271  fHistoDoubleCountTrueMultiplePi0PtvsM02[fiCut]->Fill(TrueClusterCandidate->Pt(), m02, tempClusterWeight);
2272 
2273  AliAODMCParticle *PhotonDummyPrimary = (AliAODMCParticle*) AODMCTrackArray->At(TrueClusterCandidate->GetNeutralPionMCLabel(npion));
2274  // check if particle is not a primary -> secondary particle
2275  if(!((AliConvEventCuts*)fEventCutArray->At(fiCut))->IsConversionPrimaryAOD( fInputEvent, PhotonDummyPrimary, mcProdVtxX, mcProdVtxY, mcProdVtxZ))
2276  fHistoDoubleCountTrueMultipleSecPi0Pt[fiCut]->Fill(TrueClusterCandidate->Pt(), tempClusterWeight);
2277  }
2278  }
2279  }
2280  fHistoNTrueMultiplePi0vsPt[fiCut]->Fill(TrueClusterCandidate->Pt(),TrueClusterCandidate->GetNNeutralPionMCLabels(), tempClusterWeight);
2281 
2282  if (TrueClusterCandidate->IsDalitz()){
2283  fHistoTrueClusPi0DalitzPtvsM02[fiCut]->Fill(TrueClusterCandidate->Pt(), m02, tempClusterWeight);
2284  }
2285  if (fDoMesonQA > 1)fHistoTrueClusPi0InvMassvsPt[fiCut]->Fill(mesoncand->M(),TrueClusterCandidate->Pt(), tempClusterWeight);
2286  if (fDoMesonQA > 0){
2287  fHistoTrueClusPi0EM02[fiCut]->Fill(TrueClusterCandidate->E(), m02, tempClusterWeight);
2288  }
2289  if (fDoMesonQA > 0 && GetSelectedMesonID() != 2){
2290  fHistoTruePi0PtY[fiCut]->Fill(TrueClusterCandidate->Pt(),mesoncand->Rapidity()-((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetEtaShift(), tempClusterWeight);
2291  fHistoTruePi0PtAlpha[fiCut]->Fill(TrueClusterCandidate->Pt(),TMath::Abs(mesoncand->GetAlpha()), tempClusterWeight);
2292  }
2293 
2294  if (GetSelectedMesonID() < 2) {
2295  if (isPrimary) {
2296  fHistoTrueClusPrimPi0PtvsM02[fiCut]->Fill(TrueClusterCandidate->Pt(), m02, tempClusterWeight);
2297  if(TrueClusterCandidate->GetNNeutralPionMCLabels()>1){
2298  for(Int_t npion = 1; npion < TrueClusterCandidate->GetNNeutralPionMCLabels(); npion++){
2299  AliAODMCParticle *PhotonDummyPrimary = (AliAODMCParticle*) AODMCTrackArray->At(TrueClusterCandidate->GetNeutralPionMCLabel(npion));
2300  if(((AliConvEventCuts*)fEventCutArray->At(fiCut))->IsConversionPrimaryAOD( fInputEvent, PhotonDummyPrimary, mcProdVtxX, mcProdVtxY, mcProdVtxZ)) // check if pion is primary
2301  fHistoTrueClusMultiplePrimPi0PtvsM02[fiCut]->Fill(TrueClusterCandidate->Pt(), m02, tempClusterWeight);
2302  }
2303  }
2304  if (fDoMesonQA > 1) fHistoTrueClusPrimPi0InvMassvsPt[fiCut]->Fill(mesoncand->M(),TrueClusterCandidate->Pt(), tempClusterWeight);
2305  if (fDoMesonQA > 0){
2306  if(mother->Pt()>0){
2307  if (clusterClass == 1 && TrueClusterCandidate->IsMerged())
2308  fHistoTruePrimaryPi0PureMergedMCPtResolPt[fiCut]->Fill(mother->Pt(),(TrueClusterCandidate->Pt()-mother->Pt())/mother->Pt(),tempClusterWeight);
2309  else if (clusterClass == 1 && TrueClusterCandidate->IsMergedPartConv())
2310  fHistoTruePrimaryPi0MergedPartConvMCPtResolPt[fiCut]->Fill(mother->Pt(),(TrueClusterCandidate->Pt()-mother->Pt())/mother->Pt(),tempClusterWeight);
2311  else if (clusterClass == 2)
2312  fHistoTruePrimaryPi01GammaMCPtResolPt[fiCut]->Fill(mother->Pt(),(TrueClusterCandidate->Pt()-mother->Pt())/mother->Pt(),tempClusterWeight);
2313  else if (clusterClass == 3)
2314  fHistoTruePrimaryPi01ElectronMCPtResolPt[fiCut]->Fill(mother->Pt(),(TrueClusterCandidate->Pt()-mother->Pt())/mother->Pt(),tempClusterWeight);
2315  }
2316  }
2317  } else {
2318  fHistoTrueClusSecPi0PtvsM02[fiCut]->Fill(TrueClusterCandidate->Pt(), m02, tempClusterWeight);
2319  if (fDoMesonQA > 0 && mother->Pt()>0){
2320  fHistoTrueSecondaryPi0MCPtResolPt[fiCut]->Fill(mother->Pt(),(TrueClusterCandidate->Pt()-mother->Pt())/mother->Pt(),tempClusterWeight);
2321  }
2322  Int_t grandMaLab = mother->GetMother();
2323  if (grandMaLab > -1){
2324  if (TMath::Abs(static_cast<AliAODMCParticle*>(AODMCTrackArray->At(grandMaLab))->GetPdgCode()) == 310){
2325  fHistoTrueClusSecPi0FromK0sPtvsM02[fiCut]->Fill(TrueClusterCandidate->Pt(), m02, tempClusterWeight);
2326  } else if (TMath::Abs(static_cast<AliAODMCParticle*>(AODMCTrackArray->At(grandMaLab))->GetPdgCode()) == 130){
2327  fHistoTrueClusSecPi0FromK0lPtvsM02[fiCut]->Fill(TrueClusterCandidate->Pt(), m02, tempClusterWeight);
2328  } else if (TMath::Abs(static_cast<AliAODMCParticle*>(AODMCTrackArray->At(grandMaLab))->GetPdgCode()) == 3122){
2329  fHistoTrueClusSecPi0FromLambdaPtvsM02[fiCut]->Fill(TrueClusterCandidate->Pt(), m02, tempClusterWeight);
2330  }
2331  }
2332  }
2333  }
2334  // deal with eta only
2335  } else if (motherPDG == 221){
2336  fHistoTrueClusEtaPtvsM02[fiCut]->Fill(TrueClusterCandidate->Pt(), m02, tempClusterWeight);
2337  if (TrueClusterCandidate->IsDalitz()){
2338  fHistoTrueClusEtaDalitzPtvsM02[fiCut]->Fill(TrueClusterCandidate->Pt(), m02, tempClusterWeight);
2339  }
2340  if (CheckVectorForDoubleCount(fVectorDoubleCountTrueEtas,motherLab)) fHistoDoubleCountTrueEtaPtvsM02[fiCut]->Fill(TrueClusterCandidate->Pt(), m02, tempClusterWeight);
2341  if (fDoMesonQA > 1)fHistoTrueClusEtaInvMassvsPt[fiCut]->Fill(mesoncand->M(),TrueClusterCandidate->Pt(), tempClusterWeight);
2342  if (fDoMesonQA > 0){
2343  fHistoTrueClusEtaEM02[fiCut]->Fill(TrueClusterCandidate->E(), m02, tempClusterWeight);
2344  }
2345  if ( fDoMesonQA > 0 && GetSelectedMesonID() != 1 ){
2346  fHistoTrueEtaPtY[fiCut]->Fill(TrueClusterCandidate->Pt(),mesoncand->Rapidity()-((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetEtaShift(), tempClusterWeight);
2347  fHistoTrueEtaPtAlpha[fiCut]->Fill(TrueClusterCandidate->Pt(),TMath::Abs(mesoncand->GetAlpha()), tempClusterWeight);
2348  if(mother->Pt()>0)
2349  fHistoTruePrimaryEtaMCPtResolPt[fiCut]->Fill(mother->Pt(),(TrueClusterCandidate->Pt()-mother->Pt())/mother->Pt(),tempClusterWeight);
2350  }
2351  } else {
2352  fHistoTrueMergedMissedPDG[fiCut]->Fill(motherPDG, tempClusterWeight);
2353  }
2354 
2355  // leading particle is a photon or the conversion is fully contained and its not from pi0 || eta
2356  } else if (TrueClusterCandidate->IsLargestComponentPhoton() || TrueClusterCandidate->IsConversionFullyContained()){
2357  if (fEnableDetailedPrintOut) cout << "photon" << endl;
2358  fHistoTrueClusGammaPtvsM02[fiCut]->Fill(TrueClusterCandidate->Pt(), m02, tempClusterWeight);
2359  if (fDoMesonQA > 0){
2360  fHistoTrueClusGammaEM02[fiCut]->Fill(TrueClusterCandidate->E(), m02, tempClusterWeight);
2361  }
2362 
2363  if (fDoMesonQA > 1) fHistoTrueClusGammaInvMassvsPt[fiCut]->Fill(mesoncand->M(),TrueClusterCandidate->Pt(), tempClusterWeight);
2364  if (motherLab == -1){
2365  fHistoTrueClusGammaPtvsSource[fiCut]->Fill(TrueClusterCandidate->Pt(), 0.5, tempClusterWeight); // direct photon
2366  } else {
2367  if (motherPDG == 111)
2368  fHistoTrueClusGammaPtvsSource[fiCut]->Fill(TrueClusterCandidate->Pt(), 1.5, tempClusterWeight); // pi0
2369  else if (motherPDG == 221)
2370  fHistoTrueClusGammaPtvsSource[fiCut]->Fill(TrueClusterCandidate->Pt(), 2.5, tempClusterWeight); // eta
2371  else if (motherPDG == 331)
2372  fHistoTrueClusGammaPtvsSource[fiCut]->Fill(TrueClusterCandidate->Pt(), 3.5, tempClusterWeight); // eta'
2373  else if (motherPDG == 223)
2374  fHistoTrueClusGammaPtvsSource[fiCut]->Fill(TrueClusterCandidate->Pt(), 4.5, tempClusterWeight); // omega
2375  else if (motherPDG == 333)
2376  fHistoTrueClusGammaPtvsSource[fiCut]->Fill(TrueClusterCandidate->Pt(), 5.5, tempClusterWeight); // phi
2377  else if (motherPDG == 3122)
2378  fHistoTrueClusGammaPtvsSource[fiCut]->Fill(TrueClusterCandidate->Pt(), 6.5, tempClusterWeight); // Lambda
2379  else
2380  fHistoTrueClusGammaPtvsSource[fiCut]->Fill(TrueClusterCandidate->Pt(), 7.5, tempClusterWeight); // rest
2381  }
2382 
2383  // leading particle is an electron and its not from pi0 || eta
2384  } else if (TrueClusterCandidate->IsLargestComponentElectron()){
2385  if (fEnableDetailedPrintOut) cout << "electron" << endl;
2386  fHistoTrueClusElectronPtvsM02[fiCut]->Fill(TrueClusterCandidate->Pt(), m02, tempClusterWeight);
2387  if (fDoMesonQA > 0){
2388  fHistoTrueClusElectronEM02[fiCut]->Fill(TrueClusterCandidate->E(), m02, tempClusterWeight);
2389  }
2390 
2391  if (fDoMesonQA > 1) fHistoTrueClusElectronInvMassvsPt[fiCut]->Fill(mesoncand->M(),TrueClusterCandidate->Pt(), tempClusterWeight);
2392  Int_t motherLab = Photon->GetMother();
2393  if (motherLab == -1){
2394  fHistoTrueClusElectronPtvsSource[fiCut]->Fill(TrueClusterCandidate->Pt(), 0.5, tempClusterWeight); // direct electron
2395  } else {
2396  if (motherPDG == 22){
2397  fHistoTrueClusElectronPtvsSource[fiCut]->Fill(TrueClusterCandidate->Pt(), 1.5, tempClusterWeight); // gamma
2398  fHistoTrueClusElectronFromGammaPtvsM02[fiCut]->Fill(TrueClusterCandidate->Pt(), m02, tempClusterWeight);
2399  } else if (motherPDG == 111){
2400  fHistoTrueClusElectronPtvsSource[fiCut]->Fill(TrueClusterCandidate->Pt(), 2.5, tempClusterWeight); // pi0
2401  } else if (motherPDG == 221){
2402  fHistoTrueClusElectronPtvsSource[fiCut]->Fill(TrueClusterCandidate->Pt(), 3.5, tempClusterWeight); // eta
2403  } else if ( int(motherPDG/100.)==5 || int(motherPDG/1000.)==5 ){
2404  fHistoTrueClusElectronPtvsSource[fiCut]->Fill(TrueClusterCandidate->Pt(), 5.5, tempClusterWeight); // b
2405  } else if ( int(motherPDG/100.)==4 || int(motherPDG/1000.)==4 ){
2406  fHistoTrueClusElectronPtvsSource[fiCut]->Fill(TrueClusterCandidate->Pt(), 4.5, tempClusterWeight); // c
2407  } else if (motherPDG == 23 || motherPDG == 24){
2408  fHistoTrueClusElectronPtvsSource[fiCut]->Fill(TrueClusterCandidate->Pt(), 6.5, tempClusterWeight); // W/Z
2409  } else if (motherPDG == 15) {
2410  fHistoTrueClusElectronPtvsSource[fiCut]->Fill(TrueClusterCandidate->Pt(), 7.5, tempClusterWeight); // tau
2411  } else {
2412  fHistoTrueClusElectronPtvsSource[fiCut]->Fill(TrueClusterCandidate->Pt(), 8.5, tempClusterWeight); // rest
2413  }
2414  }
2415  // leading particle is a hadron
2416  } else {
2417  if (fEnableDetailedPrintOut) cout << "BG" << endl;
2418  fHistoTrueClusBGPtvsM02[fiCut]->Fill(TrueClusterCandidate->Pt(), m02, tempClusterWeight);
2419  if (fDoMesonQA > 1) fHistoTrueClusBGInvMassvsPt[fiCut]->Fill(mesoncand->M(),TrueClusterCandidate->Pt(), tempClusterWeight);
2420 
2421  Double_t maxM02 = 4.8;
2422  if (m02 >= 0 && m02 < maxM02){
2423  if (TMath::Abs(pdgCodeParticle) == 211) fHistoTrueClusBGPtvsSource[fiCut]->Fill(TrueClusterCandidate->Pt(), 0.5, tempClusterWeight); // pi+/-
2424  else if (TMath::Abs(pdgCodeParticle) == 2212) fHistoTrueClusBGPtvsSource[fiCut]->Fill(TrueClusterCandidate->Pt(), 1.5, tempClusterWeight); // p
2425  else if (TMath::Abs(pdgCodeParticle) == 321) fHistoTrueClusBGPtvsSource[fiCut]->Fill(TrueClusterCandidate->Pt(), 2.5, tempClusterWeight); // K+-
2426  else if (TMath::Abs(pdgCodeParticle) == 2112) fHistoTrueClusBGPtvsSource[fiCut]->Fill(TrueClusterCandidate->Pt(), 3.5, tempClusterWeight); // n
2427  else if (TMath::Abs(pdgCodeParticle) == 310) fHistoTrueClusBGPtvsSource[fiCut]->Fill(TrueClusterCandidate->Pt(), 4.5, tempClusterWeight); // K0s
2428  else if (TMath::Abs(pdgCodeParticle) == 3122) fHistoTrueClusBGPtvsSource[fiCut]->Fill(TrueClusterCandidate->Pt(), 5.5, tempClusterWeight); // Lambda
2429  else if (TMath::Abs(pdgCodeParticle) == 13) fHistoTrueClusBGPtvsSource[fiCut]->Fill(TrueClusterCandidate->Pt(), 6.5, tempClusterWeight); // mu+/-
2430  else if (TMath::Abs(pdgCodeParticle) == 130) fHistoTrueClusBGPtvsSource[fiCut]->Fill(TrueClusterCandidate->Pt(), 7.5, tempClusterWeight); // K0l
2431  else fHistoTrueClusBGPtvsSource[fiCut]->Fill(TrueClusterCandidate->Pt(), 8.5, tempClusterWeight); // Rest
2432  }
2433  }
2434  }
2435  delete mesoncand;
2436  return;
2437 }
2438 
2439 
2440 //________________________________________________________________________
2442 {
2443  const AliVVertex* primVtxMC = fMCEvent->GetPrimaryVertex();
2444  Double_t mcProdVtxX = primVtxMC->GetX();
2445  Double_t mcProdVtxY = primVtxMC->GetY();
2446  Double_t mcProdVtxZ = primVtxMC->GetZ();
2447 
2448  // Loop over all primary MC particle
2449  for(Long_t i = 0; i < fMCEvent->GetNumberOfTracks(); i++) {
2450  Double_t tempParticleWeight = fWeightJetJetMC;
2451  if (((AliConvEventCuts*)fEventCutArray->At(fiCut))->IsConversionPrimaryESD( fMCEvent, i, mcProdVtxX, mcProdVtxY, mcProdVtxZ)){
2452 
2453  TParticle* particle = (TParticle *)fMCEvent->Particle(i);
2454  if (!particle) continue;
2455 
2456  Int_t isMCFromMBHeader = -1;
2457  if(((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetSignalRejection() != 0){
2458  isMCFromMBHeader = ((AliConvEventCuts*)fEventCutArray->At(fiCut))->IsParticleFromBGEvent(i, fMCEvent, fInputEvent);
2459  if(isMCFromMBHeader == 0 && ((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetSignalRejection() != 3) continue;
2460  // Set the jetjet weight to 1 in case the particle orignated from the minimum bias header
2461  if(isMCFromMBHeader == 2 && ((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetSignalRejection() == 4) tempParticleWeight = 1;
2462  }
2463 
2464  Double_t mesonY = 1.e30;
2465  Double_t ratio = 0;
2466  if (particle->Energy() != TMath::Abs(particle->Pz())){
2467  ratio = (particle->Energy()+particle->Pz()) / (particle->Energy()-particle->Pz());
2468  }
2469  if( !(ratio <= 0) ){
2470  mesonY = particle->Y()-((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetEtaShift();
2471  }
2472 
2473  // fill Primary Y hist
2474  if ( particle->GetPdgCode() == 211 ){ // positve pions
2475  fHistoMCPrimaryYvsSource[fiCut]->Fill(mesonY, 0., tempParticleWeight);
2476  } else if ( particle->GetPdgCode() == -211 ){ // negative pions
2477  fHistoMCPrimaryYvsSource[fiCut]->Fill(mesonY, 1., tempParticleWeight);
2478  } else if ( particle->GetPdgCode() == 321 ){ // positve kaons
2479  fHistoMCPrimaryYvsSource[fiCut]->Fill(mesonY, 2., tempParticleWeight);
2480  } else if ( particle->GetPdgCode() == -321 ){ // negative kaons
2481  fHistoMCPrimaryYvsSource[fiCut]->Fill(mesonY, 3., tempParticleWeight);
2482  } else if ( TMath::Abs(particle->GetPdgCode()) == 310 ){ // K0s
2483  fHistoMCPrimaryYvsSource[fiCut]->Fill(mesonY, 4., tempParticleWeight);
2484  } else if ( TMath::Abs(particle->GetPdgCode()) == 130 ){ // K0l
2485  fHistoMCPrimaryYvsSource[fiCut]->Fill(mesonY, 5., tempParticleWeight);
2486  } else if ( TMath::Abs(particle->GetPdgCode()) == 3122 ){ // Lambda/ AntiLambda
2487  fHistoMCPrimaryYvsSource[fiCut]->Fill(mesonY, 6., tempParticleWeight);
2488  }
2489 
2490  if (TMath::Abs(mesonY) < ((AliConversionMesonCuts*)fMesonCutArray->At(fiCut))->GetRapidityCutValue()){
2491  if ( particle->GetPdgCode() == 211 ){ // positve pions
2492  fHistoMCPrimaryPtvsSource[fiCut]->Fill(particle->Pt(), 0., tempParticleWeight);
2493  } else if ( particle->GetPdgCode() == -211 ){ // negative pions
2494  fHistoMCPrimaryPtvsSource[fiCut]->Fill(particle->Pt(), 1., tempParticleWeight);
2495  } else if ( particle->GetPdgCode() == 321 ){ // positve kaons
2496  fHistoMCPrimaryPtvsSource[fiCut]->Fill(particle->Pt(), 2., tempParticleWeight);
2497  } else if ( particle->GetPdgCode() == -321 ){ // negative kaons
2498  fHistoMCPrimaryPtvsSource[fiCut]->Fill(particle->Pt(), 3., tempParticleWeight);
2499  } else if ( TMath::Abs(particle->GetPdgCode()) == 310 ){ // K0s
2500  fHistoMCPrimaryPtvsSource[fiCut]->Fill(particle->Pt(), 4., tempParticleWeight);
2501  } else if ( TMath::Abs(particle->GetPdgCode()) == 130 ){ // K0l
2502  fHistoMCPrimaryPtvsSource[fiCut]->Fill(particle->Pt(), 5., tempParticleWeight);
2503  } else if ( TMath::Abs(particle->GetPdgCode()) == 3122 ){ // Lambda/ AntiLambda
2504  fHistoMCPrimaryPtvsSource[fiCut]->Fill(particle->Pt(), 6., tempParticleWeight);
2505  } else if ( particle->GetPdgCode() == 22 ){ // photons
2506  fHistoMCAllGammaPt[fiCut]->Fill(particle->Pt(), tempParticleWeight); // direct photons
2507  if(particle->GetMother(0) > -1){
2508  TParticle* mother = (TParticle*)fMCEvent->Particle(particle->GetMother(0));
2509  if ( TMath::Abs(mother->GetPdgCode()) == 111 ||
2510  TMath::Abs(mother->GetPdgCode()) == 113 ||
2511  TMath::Abs(mother->GetPdgCode()) == 221 ||
2512  TMath::Abs(mother->GetPdgCode()) == 223 ||
2513  TMath::Abs(mother->GetPdgCode()) == 331 ||
2514  TMath::Abs(mother->GetPdgCode()) == 333 ||
2515  TMath::Abs(mother->GetPdgCode()) == 3212 ||
2516  TMath::Abs(mother->GetPdgCode()) == 213
2517  ){
2518  fHistoMCDecayGammaPt[fiCut]->Fill(particle->Pt(), tempParticleWeight); // decay photons
2519  }
2520  }
2521  }
2522  }
2523 
2524  // check if particle is pi0/eta from di-photon decay
2526  ->MesonIsSelectedMC(particle,fMCEvent,((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetEtaShift())){
2527  TParticle* daughter0 = (TParticle*)fMCEvent->Particle(particle->GetFirstDaughter());
2528  TParticle* daughter1 = (TParticle*)fMCEvent->Particle(particle->GetLastDaughter());
2529 
2530  Float_t weighted= 1;
2531  if(((AliConvEventCuts*)fEventCutArray->At(fiCut))->IsParticleFromBGEvent(i, fMCEvent, fInputEvent)){
2532  if (particle->Pt()>0.005){
2533  weighted= ((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetWeightForMeson(i, fMCEvent, fInputEvent);
2534  }
2535  }
2536 
2537  if( TMath::Abs(particle->GetPdgCode()) == 111 ){ // neutral pions
2538  fHistoMCPi0Pt[fiCut]->Fill(particle->Pt(),weighted* tempParticleWeight); // All MC Pi0
2539  if (GetSelectedMesonID() != 2){
2540  fHistoMCPi0WOWeightPt[fiCut]->Fill(particle->Pt(), tempParticleWeight);
2541  if (fIsMC==2)fHistoMCPi0WOEvtWeightPt[fiCut]->Fill(particle->Pt());
2542  if (fDoMesonQA > 0 ){
2543  if (fIsMC == 2) fHistoMCPi0PtJetPt[fiCut]->Fill(particle->Pt(),((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetMaxPtJet(),tempParticleWeight);
2544  }
2545  }
2546  } else if( TMath::Abs(particle->GetPdgCode()) == 221 ){ // eta mesons
2547  fHistoMCEtaPt[fiCut]->Fill(particle->Pt(),weighted* tempParticleWeight); // All MC Eta
2548  if (GetSelectedMesonID() != 1){
2549  fHistoMCEtaWOWeightPt[fiCut]->Fill(particle->Pt(), tempParticleWeight);
2550  if (fIsMC==2)fHistoMCEtaWOEvtWeightPt[fiCut]->Fill(particle->Pt());
2551  if (fDoMesonQA > 0 ){
2552  if (fIsMC == 2) fHistoMCEtaPtJetPt[fiCut]->Fill(particle->Pt(),((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetMaxPtJet(),tempParticleWeight);
2553  }
2554  }
2555  }
2556  // Check the acceptance for both gammas & whether they are counted as primaries as well
2557  Bool_t kDaughter0IsPrim = ((AliConvEventCuts*)fEventCutArray->At(fiCut))->IsConversionPrimaryESD( fMCEvent, particle->GetFirstDaughter(), mcProdVtxX, mcProdVtxY, mcProdVtxZ);
2558  Bool_t kDaughter1IsPrim = ((AliConvEventCuts*)fEventCutArray->At(fiCut))->IsConversionPrimaryESD( fMCEvent, particle->GetLastDaughter(), mcProdVtxX, mcProdVtxY, mcProdVtxZ);
2559 
2560  if( kDaughter0IsPrim && kDaughter1IsPrim &&
2561  (((AliCaloPhotonCuts*)fClusterCutArray->At(fiCut))->ClusterIsSelectedMC(daughter0,fMCEvent) ||
2562  ((AliCaloPhotonCuts*)fClusterCutArray->At(fiCut))->ClusterIsSelectedMC(daughter1,fMCEvent) ) ){
2563  if(particle->GetPdgCode() == 111 && GetSelectedMesonID() != 2){
2564  fHistoMCPi0InAccPt[fiCut]->Fill(particle->Pt(),weighted* tempParticleWeight); // MC Pi0 with gamma in acc
2565  if (fIsMC == 2)fHistoMCPi0WOEvtWeightInAccPt[fiCut]->Fill(particle->Pt()); // MC Pi0 w/o event weights with gamma in acc
2566  } else if(particle->GetPdgCode() == 221 && GetSelectedMesonID() != 1){
2567  fHistoMCEtaInAccPt[fiCut]->Fill(particle->Pt(),weighted* tempParticleWeight); // MC Eta with gamma in acc
2568  if (fIsMC == 2)fHistoMCEtaWOEvtWeightInAccPt[fiCut]->Fill(particle->Pt()); // MC Eta w/o event weights with gamma in acc
2569  }
2570  }
2571  }
2572  Int_t gammaLabel = -1;
2573  Int_t electronLabel = -1;
2574  Int_t positronLabel = -1;
2575  // check if particle is pi0/eta from Dalitz decay
2577  ->MesonIsSelectedMCDalitz(particle,fMCEvent, electronLabel, positronLabel, gammaLabel, ((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetEtaShift())){
2578  if( (gammaLabel > -1) && (electronLabel > -1) && (positronLabel > -1) ){
2579  TParticle* gamma = (TParticle*)fMCEvent->Particle(gammaLabel);
2580  TParticle* electron = (TParticle*)fMCEvent->Particle(electronLabel);
2581  TParticle* positron = (TParticle*)fMCEvent->Particle(positronLabel);
2582 
2583  Float_t weighted= 1;
2584  if(((AliConvEventCuts*)fEventCutArray->At(fiCut))->IsParticleFromBGEvent(i, fMCEvent, fInputEvent)){
2585  if (particle->Pt()>0.005){
2586  weighted= ((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetWeightForMeson(i, fMCEvent, fInputEvent);
2587  }
2588  }
2589 
2590  if(particle->GetPdgCode() == 111 && GetSelectedMesonID() != 2){
2591  fHistoMCPi0DalitzPt[fiCut]->Fill(particle->Pt(),weighted* tempParticleWeight); // All MC Pi0
2592  fHistoMCPi0DalitzWOWeightPt[fiCut]->Fill(particle->Pt(), tempParticleWeight);
2593  if (fIsMC==2)fHistoMCPi0DalitzWOEvtWeightPt[fiCut]->Fill(particle->Pt());
2594  if (fDoMesonQA > 0 ){
2595  if (fIsMC == 2) fHistoMCPi0PtJetPt[fiCut]->Fill(particle->Pt(),((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetMaxPtJet(),tempParticleWeight);
2596  }
2597  } else if(particle->GetPdgCode() == 221 && GetSelectedMesonID() != 1){
2598  fHistoMCEtaDalitzPt[fiCut]->Fill(particle->Pt(),weighted* tempParticleWeight); // All MC Eta
2599  fHistoMCEtaDalitzWOWeightPt[fiCut]->Fill(particle->Pt(), tempParticleWeight);
2600  if (fIsMC==2)fHistoMCEtaDalitzWOEvtWeightPt[fiCut]->Fill(particle->Pt());
2601  if (fDoMesonQA > 0 ){
2602  if (fIsMC == 2) fHistoMCEtaPtJetPt[fiCut]->Fill(particle->Pt(),((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetMaxPtJet(),tempParticleWeight);
2603  }
2604  }
2605 
2606  // Check the acceptance for both gammas & whether they are counted as primaries as well
2607  Bool_t kGammaIsPrim = ((AliConvEventCuts*)fEventCutArray->At(fiCut))->IsConversionPrimaryESD( fMCEvent, gammaLabel, mcProdVtxX, mcProdVtxY, mcProdVtxZ);
2608  Bool_t kElectronIsPrim = ((AliConvEventCuts*)fEventCutArray->At(fiCut))->IsConversionPrimaryESD( fMCEvent, electronLabel, mcProdVtxX, mcProdVtxY, mcProdVtxZ);
2609  Bool_t kPositronIsPrim = ((AliConvEventCuts*)fEventCutArray->At(fiCut))->IsConversionPrimaryESD( fMCEvent, positronLabel, mcProdVtxX, mcProdVtxY, mcProdVtxZ);
2610  if( kGammaIsPrim && kElectronIsPrim && kPositronIsPrim &&
2611  (((AliCaloPhotonCuts*)fClusterCutArray->At(fiCut))->ClusterIsSelectedMC(gamma,fMCEvent) ||
2612  ((AliCaloPhotonCuts*)fClusterCutArray->At(fiCut))->ClusterIsSelectedElecMC(electron,fMCEvent) ||
2613  ((AliCaloPhotonCuts*)fClusterCutArray->At(fiCut))->ClusterIsSelectedElecMC(positron,fMCEvent) )
2614  ){
2615  if(particle->GetPdgCode() == 111 && GetSelectedMesonID() != 2){
2616  fHistoMCPi0DalitzInAccPt[fiCut]->Fill(particle->Pt(),weighted* tempParticleWeight); // MC Pi0 with gamma in acc
2617  if (fIsMC == 2) fHistoMCPi0DalitzWOEvtWeightInAccPt[fiCut]->Fill(particle->Pt(),weighted* tempParticleWeight); // MC Pi0 with gamma in acc
2618  } else if(particle->GetPdgCode() == 221 && GetSelectedMesonID() != 1){
2619  fHistoMCEtaDalitzInAccPt[fiCut]->Fill(particle->Pt(),weighted* tempParticleWeight); // MC Eta with gamma in acc
2620  if (fIsMC == 2) fHistoMCEtaDalitzWOEvtWeightInAccPt[fiCut]->Fill(particle->Pt(),weighted* tempParticleWeight); // MC Pi0 with gamma in acc
2621  }
2622  }
2623  }
2624  }
2625  // End of primary threatment, now secondary treatment
2626  } else {
2627 
2628  TParticle* particle = (TParticle *)fMCEvent->Particle(i);
2629  if (!particle) continue;
2630 
2631  Int_t isMCFromMBHeader = -1;
2632  if(((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetSignalRejection() != 0){
2633  isMCFromMBHeader = ((AliConvEventCuts*)fEventCutArray->At(fiCut))->IsParticleFromBGEvent(i, fMCEvent, fInputEvent);
2634  if(isMCFromMBHeader == 0 && ((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetSignalRejection() != 3) continue;
2635  // Set the jetjet weight to 1 in case the particle orignated from the minimum bias header
2636  if(isMCFromMBHeader == 2 && ((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetSignalRejection() == 4) tempParticleWeight = 1;
2637  }
2638 
2639  // check if particle is pi0 from di-photon decay
2641  ->MesonIsSelectedMC(particle,fMCEvent,((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetEtaShift())){
2642  TParticle* daughter0 = (TParticle*)fMCEvent->Particle(particle->GetFirstDaughter());
2643  TParticle* daughter1 = (TParticle*)fMCEvent->Particle(particle->GetLastDaughter());
2644  TParticle* mother = NULL;
2645  Int_t motherPDG = -1000000;
2646  if (particle->GetMother(0) > -1){
2647  mother = (TParticle*)fMCEvent->Particle(particle->GetMother(0));
2648  if (mother)
2649  motherPDG = TMath::Abs(mother->GetPdgCode());
2650  }
2651 
2652  if( TMath::Abs(particle->GetPdgCode()) == 111 ){ // neutral pions
2653  Int_t source = GetSourceClassification(111,motherPDG);
2654  fHistoMCSecPi0PtvsSource[fiCut]->Fill(particle->Pt(),source, tempParticleWeight); // All secondary MC Pi0
2655  }
2656 
2657  // check whether pi0 landet in acceptance
2658  if( (((AliCaloPhotonCuts*)fClusterCutArray->At(fiCut))->ClusterIsSelectedMC(daughter0,fMCEvent) ||
2659  ((AliCaloPhotonCuts*)fClusterCutArray->At(fiCut))->ClusterIsSelectedMC(daughter1,fMCEvent) ) ){
2660  if( TMath::Abs(particle->GetPdgCode()) == 111 ){ // neutral pions
2661  Int_t source = GetSourceClassification(111,motherPDG);
2662  fHistoMCSecPi0InAccPtvsSource[fiCut]->Fill(particle->Pt(),source, tempParticleWeight); // All secondary MC Pi0
2663  }
2664  }
2665  }
2666 
2667  Int_t gammaLabel = -1;
2668  Int_t electronLabel = -1;
2669  Int_t positronLabel = -1;
2670  // check if particle is pi0/eta from Dalitz decay
2672  ->MesonIsSelectedMCDalitz(particle,fMCEvent, electronLabel, positronLabel, gammaLabel, ((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetEtaShift())){
2673  if( (gammaLabel > -1) && (electronLabel > -1) && (positronLabel > -1) ){
2674  TParticle* gamma = (TParticle*)fMCEvent->Particle(gammaLabel);
2675  TParticle* electron = (TParticle*)fMCEvent->Particle(electronLabel);
2676  TParticle* positron = (TParticle*)fMCEvent->Particle(positronLabel);
2677 
2678  TParticle* mother = NULL;
2679  Int_t motherPDG = -1000000;
2680  if (particle->GetMother(0) > -1){
2681  mother = (TParticle*)fMCEvent->Particle(particle->GetMother(0));
2682  if (mother)
2683  motherPDG = TMath::Abs(mother->GetPdgCode());
2684  }
2685 
2686  if( TMath::Abs(particle->GetPdgCode()) == 111 ){ // neutral pions
2687  Int_t source = GetSourceClassification(111,motherPDG);
2688  fHistoMCSecPi0PtvsSource[fiCut]->Fill(particle->Pt(),source, tempParticleWeight); // All secondary MC Pi0
2689  }
2690 
2691  // check whether pi0 landet in acceptance
2692  if( (((AliCaloPhotonCuts*)fClusterCutArray->At(fiCut))->ClusterIsSelectedMC(gamma,fMCEvent) ||
2693  ((AliCaloPhotonCuts*)fClusterCutArray->At(fiCut))->ClusterIsSelectedElecMC(electron,fMCEvent) ||
2694  ((AliCaloPhotonCuts*)fClusterCutArray->At(fiCut))->ClusterIsSelectedElecMC(positron,fMCEvent) ) ){
2695  if( TMath::Abs(particle->GetPdgCode()) == 111 ){ // neutral pions
2696  Int_t source = GetSourceClassification(111,motherPDG);
2697  fHistoMCSecPi0InAccPtvsSource[fiCut]->Fill(particle->Pt(),source, tempParticleWeight); // All secondary MC Pi0
2698  }
2699  }
2700  }
2701  }
2702  }
2703  } // end of particle loop
2704 }
2705 
2706 //________________________________________________________________________
2708 {
2709  const AliVVertex* primVtxMC = fMCEvent->GetPrimaryVertex();
2710  Double_t mcProdVtxX = primVtxMC->GetX();
2711  Double_t mcProdVtxY = primVtxMC->GetY();
2712  Double_t mcProdVtxZ = primVtxMC->GetZ();
2713 
2714  TClonesArray *AODMCTrackArray = dynamic_cast<TClonesArray*>(fInputEvent->FindListObject(AliAODMCParticle::StdBranchName()));
2715  if (AODMCTrackArray == NULL) return;
2716 
2717  // Loop over all primary MC particle
2718  for(Long_t i = 0; i < AODMCTrackArray->GetEntriesFast(); i++) {
2719  Double_t tempParticleWeight = fWeightJetJetMC;
2720  AliAODMCParticle* particle = static_cast<AliAODMCParticle*>(AODMCTrackArray->At(i));
2721  if (!particle) continue;
2722 
2723  Bool_t isPrimary = ((AliConvEventCuts*)fEventCutArray->At(fiCut))->IsConversionPrimaryAOD(fInputEvent, particle, mcProdVtxX, mcProdVtxY, mcProdVtxZ);
2724  if (isPrimary) {
2725 
2726  Int_t isMCFromMBHeader = -1;
2727  if(((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetSignalRejection() != 0){
2728  isMCFromMBHeader = ((AliConvEventCuts*)fEventCutArray->At(fiCut))->IsParticleFromBGEvent(i, fMCEvent, fInputEvent);
2729  if(isMCFromMBHeader == 0 && ((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetSignalRejection() != 3) continue;
2730  // Set the jetjet weight to 1 in case the particle orignated from the minimum bias header
2731  if(isMCFromMBHeader == 2 && ((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetSignalRejection() == 4) tempParticleWeight = 1;
2732  }
2733 
2734  Double_t mesonY = 1.e30;
2735  Double_t ratio = 0;
2736  if (particle->E() != TMath::Abs(particle->Pz())){
2737  ratio = (particle->E()+particle->Pz()) / (particle->E()-particle->Pz());
2738  }
2739  if( !(ratio <= 0) ){
2740  mesonY = particle->Y()-((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetEtaShift();
2741  }
2742 
2743  // fill Primary Y hist
2744  if ( particle->GetPdgCode() == 211 ){ // positve pions
2745  fHistoMCPrimaryYvsSource[fiCut]->Fill(mesonY, 0., tempParticleWeight);
2746  } else if ( particle->GetPdgCode() == -211 ){ // negative pions
2747  fHistoMCPrimaryYvsSource[fiCut]->Fill(mesonY, 1., tempParticleWeight);
2748  } else if ( particle->GetPdgCode() == 321 ){ // positve kaons
2749  fHistoMCPrimaryYvsSource[fiCut]->Fill(mesonY, 2., tempParticleWeight);
2750  } else if ( particle->GetPdgCode() == -321 ){ // negative kaons
2751  fHistoMCPrimaryYvsSource[fiCut]->Fill(mesonY, 3., tempParticleWeight);
2752  } else if ( TMath::Abs(particle->GetPdgCode()) == 310 ){ // K0s
2753  fHistoMCPrimaryYvsSource[fiCut]->Fill(mesonY, 4., tempParticleWeight);
2754  } else if ( TMath::Abs(particle->GetPdgCode()) == 130 ){ // K0l
2755  fHistoMCPrimaryYvsSource[fiCut]->Fill(mesonY, 5., tempParticleWeight);
2756  } else if ( TMath::Abs(particle->GetPdgCode()) == 3122 ){ // Lambda/ AntiLambda
2757  fHistoMCPrimaryYvsSource[fiCut]->Fill(mesonY, 6., tempParticleWeight);
2758  }
2759 
2760  if (TMath::Abs(mesonY) < ((AliConversionMesonCuts*)fMesonCutArray->At(fiCut))->GetRapidityCutValue()){
2761  if ( particle->GetPdgCode() == 211 ){ // positve pions
2762  fHistoMCPrimaryPtvsSource[fiCut]->Fill(particle->Pt(), 0., tempParticleWeight);
2763  } else if ( particle->GetPdgCode() == -211 ){ // negative pions
2764  fHistoMCPrimaryPtvsSource[fiCut]->Fill(particle->Pt(), 1., tempParticleWeight);
2765  } else if ( particle->GetPdgCode() == 321 ){ // positve kaons
2766  fHistoMCPrimaryPtvsSource[fiCut]->Fill(particle->Pt(), 2., tempParticleWeight);
2767  } else if ( particle->GetPdgCode() == -321 ){ // negative kaons
2768  fHistoMCPrimaryPtvsSource[fiCut]->Fill(particle->Pt(), 3., tempParticleWeight);
2769  } else if ( TMath::Abs(particle->GetPdgCode()) == 310 ){ // K0s
2770  fHistoMCPrimaryPtvsSource[fiCut]->Fill(particle->Pt(), 4., tempParticleWeight);
2771  } else if ( TMath::Abs(particle->GetPdgCode()) == 130 ){ // K0l
2772  fHistoMCPrimaryPtvsSource[fiCut]->Fill(particle->Pt(), 5., tempParticleWeight);
2773  } else if ( TMath::Abs(particle->GetPdgCode()) == 3122 ){ // Lambda/ AntiLambda
2774  fHistoMCPrimaryPtvsSource[fiCut]->Fill(particle->Pt(), 6., tempParticleWeight);
2775  } else if ( particle->GetPdgCode() == 22 ){ // photons
2776  fHistoMCAllGammaPt[fiCut]->Fill(particle->Pt(), tempParticleWeight); // direct photons
2777  if(particle->GetMother() > -1){
2778  AliAODMCParticle *mother = static_cast<AliAODMCParticle*>(AODMCTrackArray->At(particle->GetMother()));
2779  if ( TMath::Abs(mother->GetPdgCode()) == 111 ||
2780  TMath::Abs(mother->GetPdgCode()) == 113 ||
2781  TMath::Abs(mother->GetPdgCode()) == 221 ||
2782  TMath::Abs(mother->GetPdgCode()) == 223 ||
2783  TMath::Abs(mother->GetPdgCode()) == 331 ||
2784  TMath::Abs(mother->GetPdgCode()) == 333 ||
2785  TMath::Abs(mother->GetPdgCode()) == 3212 ||
2786  TMath::Abs(mother->GetPdgCode()) == 213
2787  ){
2788  fHistoMCDecayGammaPt[fiCut]->Fill(particle->Pt(), tempParticleWeight); // decay photons
2789  }
2790  }
2791  }
2792  }
2793 
2794  // check if particle is pi0/eta from di-photon decay
2796  ->MesonIsSelectedAODMC(particle,AODMCTrackArray,((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetEtaShift())){
2797  AliAODMCParticle* daughter0 = static_cast<AliAODMCParticle*>(AODMCTrackArray->At(particle->GetDaughterLabel(0)));
2798  AliAODMCParticle* daughter1 = static_cast<AliAODMCParticle*>(AODMCTrackArray->At(particle->GetDaughterLabel(1)));
2799 
2800  Float_t weighted= 1;
2801  if(((AliConvEventCuts*)fEventCutArray->At(fiCut))->IsParticleFromBGEvent(i, fMCEvent, fInputEvent)){
2802  if (particle->Pt()>0.005){
2803  weighted= ((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetWeightForMeson(i, 0x0, fInputEvent);
2804  }
2805  }
2806 
2807  if( TMath::Abs(particle->GetPdgCode()) == 111 ){ // neutral pions
2808  fHistoMCPi0Pt[fiCut]->Fill(particle->Pt(),weighted* tempParticleWeight); // All MC Pi0
2809  if (GetSelectedMesonID() != 2){
2810  fHistoMCPi0WOWeightPt[fiCut]->Fill(particle->Pt(), tempParticleWeight);
2811  if (fIsMC==2)fHistoMCPi0WOEvtWeightPt[fiCut]->Fill(particle->Pt());
2812  if (fDoMesonQA > 0 ){
2813  if (fIsMC == 2) fHistoMCPi0PtJetPt[fiCut]->Fill(particle->Pt(),((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetMaxPtJet(),tempParticleWeight);
2814  }
2815  }
2816  } else if( TMath::Abs(particle->GetPdgCode()) == 221 ){ // eta mesons
2817  fHistoMCEtaPt[fiCut]->Fill(particle->Pt(),weighted* tempParticleWeight); // All MC Eta
2818  if (GetSelectedMesonID() != 1){
2819  fHistoMCEtaWOWeightPt[fiCut]->Fill(particle->Pt(), tempParticleWeight);
2820  if (fIsMC==2)fHistoMCEtaWOEvtWeightPt[fiCut]->Fill(particle->Pt());
2821  if (fDoMesonQA > 0 ){
2822  if (fIsMC == 2) fHistoMCEtaPtJetPt[fiCut]->Fill(particle->Pt(),((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetMaxPtJet(),tempParticleWeight);
2823  }
2824  }
2825  }
2826  // Check the acceptance for both gammas & whether they are counted as primaries as well
2827  Bool_t kDaughter0IsPrim = ((AliConvEventCuts*)fEventCutArray->At(fiCut))->IsConversionPrimaryAOD( fInputEvent, daughter0, mcProdVtxX, mcProdVtxY, mcProdVtxZ);
2828  Bool_t kDaughter1IsPrim = ((AliConvEventCuts*)fEventCutArray->At(fiCut))->IsConversionPrimaryAOD( fInputEvent, daughter1, mcProdVtxX, mcProdVtxY, mcProdVtxZ);
2829 
2830  if( kDaughter0IsPrim && kDaughter1IsPrim &&
2831  (((AliCaloPhotonCuts*)fClusterCutArray->At(fiCut))->ClusterIsSelectedAODMC(daughter0,AODMCTrackArray) ||
2832  ((AliCaloPhotonCuts*)fClusterCutArray->At(fiCut))->ClusterIsSelectedAODMC(daughter1,AODMCTrackArray) ) ){
2833  if(particle->GetPdgCode() == 111 && GetSelectedMesonID() != 2){
2834  fHistoMCPi0InAccPt[fiCut]->Fill(particle->Pt(),weighted* tempParticleWeight); // MC Pi0 with gamma in acc
2835  if (fIsMC == 2)fHistoMCPi0WOEvtWeightInAccPt[fiCut]->Fill(particle->Pt()); // MC Pi0 w/o event weights with gamma in acc
2836  } else if(particle->GetPdgCode() == 221 && GetSelectedMesonID() != 1){
2837  fHistoMCEtaInAccPt[fiCut]->Fill(particle->Pt(),weighted* tempParticleWeight); // MC Eta with gamma in acc
2838  if (fIsMC == 2)fHistoMCEtaWOEvtWeightInAccPt[fiCut]->Fill(particle->Pt()); // MC Eta w/o event weights with gamma in acc
2839  }
2840  }
2841  }
2842  Int_t gammaLabel = -1;
2843  Int_t electronLabel = -1;
2844  Int_t positronLabel = -1;
2845  // check if particle is pi0/eta from Dalitz decay
2847  ->MesonIsSelectedAODMCDalitz(particle,AODMCTrackArray, electronLabel, positronLabel, gammaLabel, ((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetEtaShift())){
2848  if( (gammaLabel > -1) && (electronLabel > -1) && (positronLabel > -1) ){
2849  AliAODMCParticle* gamma = static_cast<AliAODMCParticle*>(AODMCTrackArray->At(gammaLabel));
2850  AliAODMCParticle* electron = static_cast<AliAODMCParticle*>(AODMCTrackArray->At(electronLabel));
2851  AliAODMCParticle* positron = static_cast<AliAODMCParticle*>(AODMCTrackArray->At(positronLabel));
2852 
2853  Float_t weighted= 1;
2854  if(((AliConvEventCuts*)fEventCutArray->At(fiCut))->IsParticleFromBGEvent(i, fMCEvent, fInputEvent)){
2855  if (particle->Pt()>0.005){
2856  weighted= ((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetWeightForMeson(i, fMCEvent, fInputEvent);
2857  }
2858  }
2859 
2860  if(particle->GetPdgCode() == 111 && GetSelectedMesonID() != 2){
2861  fHistoMCPi0DalitzPt[fiCut]->Fill(particle->Pt(),weighted* tempParticleWeight); // All MC Pi0
2862  fHistoMCPi0DalitzWOWeightPt[fiCut]->Fill(particle->Pt(), tempParticleWeight);
2863  if (fIsMC==2)fHistoMCPi0DalitzWOEvtWeightPt[fiCut]->Fill(particle->Pt());
2864  if (fDoMesonQA > 0 ){
2865  if (fIsMC == 2) fHistoMCPi0PtJetPt[fiCut]->Fill(particle->Pt(),((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetMaxPtJet(),tempParticleWeight);
2866  }
2867  } else if(particle->GetPdgCode() == 221 && GetSelectedMesonID() != 1){
2868  fHistoMCEtaDalitzPt[fiCut]->Fill(particle->Pt(),weighted* tempParticleWeight); // All MC Eta
2869  fHistoMCEtaDalitzWOWeightPt[fiCut]->Fill(particle->Pt(), tempParticleWeight);
2870  if (fIsMC==2)fHistoMCEtaDalitzWOEvtWeightPt[fiCut]->Fill(particle->Pt());
2871  if (fDoMesonQA > 0 ){
2872  if (fIsMC == 2) fHistoMCEtaPtJetPt[fiCut]->Fill(particle->Pt(),((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetMaxPtJet(),tempParticleWeight);
2873  }
2874  }
2875 
2876  // Check the acceptance for both gammas & whether they are counted as primaries as well
2877  Bool_t kGammaIsPrim = ((AliConvEventCuts*)fEventCutArray->At(fiCut))->IsConversionPrimaryAOD( fInputEvent, gamma, mcProdVtxX, mcProdVtxY, mcProdVtxZ);
2878  Bool_t kElectronIsPrim = ((AliConvEventCuts*)fEventCutArray->At(fiCut))->IsConversionPrimaryAOD( fInputEvent, electron, mcProdVtxX, mcProdVtxY, mcProdVtxZ);
2879  Bool_t kPositronIsPrim = ((AliConvEventCuts*)fEventCutArray->At(fiCut))->IsConversionPrimaryAOD( fInputEvent, positron, mcProdVtxX, mcProdVtxY, mcProdVtxZ);
2880  if( kGammaIsPrim && kElectronIsPrim && kPositronIsPrim &&
2881  (((AliCaloPhotonCuts*)fClusterCutArray->At(fiCut))->ClusterIsSelectedAODMC(gamma,AODMCTrackArray) ||
2882  ((AliCaloPhotonCuts*)fClusterCutArray->At(fiCut))->ClusterIsSelectedElecAODMC(electron,AODMCTrackArray) ||
2883  ((AliCaloPhotonCuts*)fClusterCutArray->At(fiCut))->ClusterIsSelectedElecAODMC(positron,AODMCTrackArray) )
2884  ){
2885  if(particle->GetPdgCode() == 111 && GetSelectedMesonID() != 2){
2886  fHistoMCPi0DalitzInAccPt[fiCut]->Fill(particle->Pt(),weighted* tempParticleWeight); // MC Pi0 with gamma in acc
2887  if (fIsMC == 2) fHistoMCPi0DalitzWOEvtWeightInAccPt[fiCut]->Fill(particle->Pt(),weighted* tempParticleWeight); // MC Pi0 with gamma in acc
2888  } else if(particle->GetPdgCode() == 221 && GetSelectedMesonID() != 1){
2889  fHistoMCEtaDalitzInAccPt[fiCut]->Fill(particle->Pt(),weighted* tempParticleWeight); // MC Eta with gamma in acc
2890  if (fIsMC == 2) fHistoMCEtaDalitzWOEvtWeightInAccPt[fiCut]->Fill(particle->Pt(),weighted* tempParticleWeight); // MC Pi0 with gamma in acc
2891  }
2892  }
2893  }
2894  }
2895  // End of primary threatment, now secondary treatment
2896  } else {
2897 
2898  AliAODMCParticle* particle = static_cast<AliAODMCParticle*>(AODMCTrackArray->At(i));
2899  if (!particle) continue;
2900 
2901  Int_t isMCFromMBHeader = -1;
2902  if(((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetSignalRejection() != 0){
2903  isMCFromMBHeader = ((AliConvEventCuts*)fEventCutArray->At(fiCut))->IsParticleFromBGEvent(i, fMCEvent, fInputEvent);
2904  if(isMCFromMBHeader == 0 && ((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetSignalRejection() != 3) continue;
2905  if(isMCFromMBHeader == 2 && ((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetSignalRejection() == 4) tempParticleWeight = 1;
2906  }
2907 
2908  // check if particle is pi0 from di-photon decay
2910  ->MesonIsSelectedAODMC(particle,AODMCTrackArray,((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetEtaShift())){
2911  AliAODMCParticle* daughter0 = static_cast<AliAODMCParticle*>(AODMCTrackArray->At(particle->GetDaughterLabel(0)));
2912  AliAODMCParticle* daughter1 = static_cast<AliAODMCParticle*>(AODMCTrackArray->At(particle->GetDaughterLabel(1)));
2913  AliAODMCParticle* mother = NULL;
2914  Int_t motherPDG = -1000000;
2915  if (particle->GetMother() > -1){
2916  mother = static_cast<AliAODMCParticle*>(AODMCTrackArray->At(particle->GetMother()));
2917  if (mother)
2918  motherPDG = TMath::Abs(mother->GetPdgCode());
2919  }
2920 
2921  if( TMath::Abs(particle->GetPdgCode()) == 111 ){ // neutral pions
2922  Int_t source = GetSourceClassification(111,motherPDG);
2923  fHistoMCSecPi0PtvsSource[fiCut]->Fill(particle->Pt(),source, tempParticleWeight); // All secondary MC Pi0
2924  }
2925 
2926  // check whether pi0 landet in acceptance
2927  if( (((AliCaloPhotonCuts*)fClusterCutArray->At(fiCut))->ClusterIsSelectedAODMC(daughter0,AODMCTrackArray) ||
2928  ((AliCaloPhotonCuts*)fClusterCutArray->At(fiCut))->ClusterIsSelectedAODMC(daughter1,AODMCTrackArray) ) ){
2929  if( TMath::Abs(particle->GetPdgCode()) == 111 ){ // neutral pions
2930  Int_t source = GetSourceClassification(111,motherPDG);
2931  fHistoMCSecPi0InAccPtvsSource[fiCut]->Fill(particle->Pt(),source, tempParticleWeight); // All secondary MC Pi0
2932  }
2933  }
2934  }
2935 
2936  Int_t gammaLabel = -1;
2937  Int_t electronLabel = -1;
2938  Int_t positronLabel = -1;
2939  // check if particle is pi0/eta from Dalitz decay
2941  ->MesonIsSelectedAODMCDalitz(particle,AODMCTrackArray, electronLabel, positronLabel, gammaLabel, ((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetEtaShift())){
2942  if( (gammaLabel > -1) && (electronLabel > -1) && (positronLabel > -1) ){
2943  AliAODMCParticle* gamma = static_cast<AliAODMCParticle*>(AODMCTrackArray->At(gammaLabel));
2944  AliAODMCParticle* electron = static_cast<AliAODMCParticle*>(AODMCTrackArray->At(electronLabel));
2945  AliAODMCParticle* positron = static_cast<AliAODMCParticle*>(AODMCTrackArray->At(positronLabel));
2946 
2947  AliAODMCParticle* mother = NULL;
2948  Int_t motherPDG = -1000000;
2949  if (particle->GetMother() > -1){
2950  mother = static_cast<AliAODMCParticle*>(AODMCTrackArray->At(particle->GetMother()));
2951  if (mother)
2952  motherPDG = TMath::Abs(mother->GetPdgCode());
2953  }
2954 
2955  if( TMath::Abs(particle->GetPdgCode()) == 111 ){ // neutral pions
2956  Int_t source = GetSourceClassification(111,motherPDG);
2957  fHistoMCSecPi0PtvsSource[fiCut]->Fill(particle->Pt(),source, tempParticleWeight); // All secondary MC Pi0
2958  }
2959 
2960  // check whether pi0 landet in acceptance
2961  if( (((AliCaloPhotonCuts*)fClusterCutArray->At(fiCut))->ClusterIsSelectedAODMC(gamma,AODMCTrackArray) ||
2962  ((AliCaloPhotonCuts*)fClusterCutArray->At(fiCut))->ClusterIsSelectedElecAODMC(electron,AODMCTrackArray) ||
2963  ((AliCaloPhotonCuts*)fClusterCutArray->At(fiCut))->ClusterIsSelectedElecAODMC(positron,AODMCTrackArray) ) ){
2964  if( TMath::Abs(particle->GetPdgCode()) == 111 ){ // neutral pions
2965  Int_t source = GetSourceClassification(111,motherPDG);
2966  fHistoMCSecPi0InAccPtvsSource[fiCut]->Fill(particle->Pt(),source, tempParticleWeight); // All secondary MC Pi0
2967  }
2968  }
2969  }
2970  }
2971  }
2972  } // end of particle loop
2973  return;
2974 }
2975 
2976 //_________________________________________________________________________________
2978  TAxis *axisafter = histoRebin->GetXaxis();
2979  Int_t bins = axisafter->GetNbins();
2980  Double_t from = axisafter->GetXmin();
2981  Double_t to = axisafter->GetXmax();
2982  Double_t *newbins = new Double_t[bins+1];
2983  newbins[0] = from;
2984  Double_t factor = TMath::Power(to/from, 1./bins);
2985  for(Int_t i=1; i<=bins; ++i) newbins[i] = factor * newbins[i-1];
2986  axisafter->Set(bins, newbins);
2987  delete [] newbins;
2988 }
2989 
2990 //_________________________________________________________________________________
2992 {
2993  if(tobechecked > -1)
2994  {
2995  vector<Int_t>::iterator it;
2996  it = find (vec.begin(), vec.end(), tobechecked);
2997  if (it != vec.end()) return true;
2998  else{
2999  vec.push_back(tobechecked);
3000  return false;
3001  }
3002  }
3003  return false;
3004 }
3005 
3006 //________________________________________________________________________
3008 {
3009 
3010  //fOutputContainer->Print(); // Will crash on GRID
3011 }
3012 
3013 
3014 //_________________________________________________________________________________
3015 void AliAnalysisTaskGammaCaloMerged::FillMultipleCountMap(map<Int_t,Int_t> &ma, Int_t tobechecked){
3016  if( ma.find(tobechecked) != ma.end() ) ma[tobechecked] += 1;
3017  else ma[tobechecked] = 2;
3018  return;
3019 }
3020 
3021 //_________________________________________________________________________________
3023  map<Int_t, Int_t>::iterator it;
3024  for (it = ma.begin(); it != ma.end(); it++){
3025  hist->Fill(it->second, fWeightJetJetMC);
3026  }
3027  ma.clear();
3028  return;
3029 }
3030 
3031 
3032 //________________________________________________________________________
3034 
3035  if (daughter == 111) {
3036  if (TMath::Abs(pdgCode) == 310) return 1; // k0s
3037  else if (TMath::Abs(pdgCode) == 3122) return 2; // Lambda
3038  else if (TMath::Abs(pdgCode) == 130) return 3; // K0L
3039  else if (TMath::Abs(pdgCode) == 2212) return 4; // proton
3040  else if (TMath::Abs(pdgCode) == 2112) return 5; // neutron
3041  else if (TMath::Abs(pdgCode) == 211) return 6; // pion
3042  else if (TMath::Abs(pdgCode) == 321) return 7; // kaon
3043  else if (TMath::Abs(pdgCode) == 113 || TMath::Abs(pdgCode) == 213 ) return 8; // rho 0,+,-
3044  else if (TMath::Abs(pdgCode) == 3222 || TMath::Abs(pdgCode) == 3212 || TMath::Abs(pdgCode) == 3112 ) return 9; // Sigma
3045  else if (TMath::Abs(pdgCode) == 2224 || TMath::Abs(pdgCode) == 2214 || TMath::Abs(pdgCode) == 2114 || TMath::Abs(pdgCode) == 1114 ) return 10; // Delta
3046  else if (TMath::Abs(pdgCode) == 313 || TMath::Abs(pdgCode) == 323 ) return 11; // K*
3047  else return 15;
3048  }
3049  return 15;
3050 
3051 }
TH2F ** fHistoClusMergedNCellsPt
array of histos with cluster NCells vs Pt
TH1F ** fHistoNGoodESDTracks
array of histos with event information without event weights
Int_t GetNeutralPionMCLabel(Int_t i)
TH1F ** fHistoMCPi0DalitzInAccPt
array of histos without evt weight eta in acceptance, pT
TH2F ** fHistoTruePrimaryEtaMCPtResolPt
array of histos with validated weighted primary pi0, MCpt, resol pt
TH2F ** fHistoClusMergedNCellsAroundPt
array of histos with merged cluster N MC paricles in cluster vs Pt
TH2F ** fHistoTruePi0PtAlpha
array of histos with validated eta, pt, Y
void SetCaloClusterRef(Long_t ref)
TH1F ** fHistoClusOverlapHeadersGammaPt
array of histos with cluster, E
double Double_t
Definition: External.C:58
void FillMultipleCountHistoAndClear(map< Int_t, Int_t > &ma, TH1F *hist)
Definition: External.C:236
vector< Int_t > fVectorDoubleCountTrueMultilePi0s
vector containing labels of validated pi0
TH2F ** fHistoMotherPtAlpha
array of histograms with signal +BG pt, Y
TH1F ** fHistoMCPi0InAccPt
array of histos without event weights eta Dalitz, pT
TH2F ** fHistoTruePrimaryPi0MergedPartConvMCPtResolPt
array of histos with validated weighted primary pi0, MCpt, resol pt
TH1F ** fHistoMCEtaDalitzWOWeightPt
array of histos with weighted eta Dalitz, pT
TH2F ** fHistoTrueEtaPtAlpha
array of histos with validated pi0, pt, alpha
TH1F ** fHistoMCPi0DalitzPt
array of histos without event weights eta, pT
TH1F ** fHistoMCAllGammaPt
array of histos with weighted decay gamma
Int_t GetNumberOfPrimaryTracks()
TH1F ** fHistoClusGammaE
array of histos with cluster, pt
TH2F ** fHistoMCPrimaryPtvsSource
array of histos with weighted eta, pT, hardest jet pt
TH2F ** fHistoSPDClusterTrackletBackground
array of histos with number of good tracks vs gamma candidates
TH2F ** fHistoMCSecPi0InAccPtvsSource
array of histos with weighted pi0 from sec, pT for different sources
TString GetCurrentFileName()
Definition: AliV0ReaderV1.h:95
TString GetPeriodName()
TH1F ** fHistoNEvents
vector containing labels of validated eta
virtual Int_t GetLabel(Int_t i) const
TH2F ** fHistoTrueClusEtaEM02
array of histos with validated pi0, E, m02
TH1F ** fHistoNEventsWOWeight
array of histos with event information
void SetCaloPhotonMCLabel(Int_t i, Int_t labelCaloPhoton)
TH2F ** fHistoClusMergedNCellsAroundAndInPt
array of histos with number of cells surrounding merged cluster vs merged cluster Pt ...
TH1F ** fHistoClusGammaPt
array of histograms with signal +BG pt, alpha
Int_t GetCaloPhotonMotherMCLabel(Int_t i)
TH1F ** fHistoMCEtaWOEvtWeightPt
array of histos with unweighted eta, pT
TH1I ** fHistoMCHeaders
array of histos with E surrounding merged cluster vs merged cluster E
TH1F ** fHistoMCDecayGammaPt
array of histos with weighted primary particles, Y vs source
void PrintCaloMCLabelsAndInfo(AliMCEvent *mcEvent)
TH2F ** fHistoClusNCellsPt
array of histos with cluster merged accepted mesons, E vs M02
TH1F ** fHistoMCPi0DalitzWOWeightPt
array of histos with weighted pi0 Dalitz, pT
TH2F ** fHistoClusMergedEvsM02Accepted
array of histos with cluster merged accepted mesons, pt vs M02
int Int_t
Definition: External.C:63
void SetCaloPhotonMCFlags(AliMCEvent *mcEvent, Bool_t enableSort, Bool_t mergedAnalysis=kFALSE)
TH2F ** fHistoClusMergedPtvsM02Accepted
array of histos with cluster merged, pt vs M02
TH1F ** fHistoMCEtaDalitzPt
array of histos without event weights pi0 Dalitz, pT
Class handling all kinds of selection cuts for Gamma Calo analysis.
TH2F ** fHistoClusMergedEAroundE
array of histos with number of cells surrounding merged cluster + Ncells in clus vs merged cluster Pt...
Definition: External.C:204
TH1F ** fHistoNClusterMergedCandidates
array of histos with number of cluster candidates per event
TH2F ** fHistoMCPrimaryYvsSource
array of histos with weighted primary particles, pT vs source
TH1F ** fHistoMCEtaDalitzWOEvtWeightPt
array of histos with unweighted eta Dalitz, pT
float Float_t
Definition: External.C:68
TH1F ** fHistoMCPi0WOWeightPt
array of histos with weighted pi0, pT
Bool_t CheckVectorForDoubleCount(vector< Int_t > &vec, Int_t tobechecked)
TH1F ** fHistoMCPi0WOEvtWeightPt
array of histos with unweighted pi0, pT
TH1F ** fHistoNClusterCandidates
array of histos with vertex z distribution for selected events
Int_t fNClusterMergedCandidates
current number of cluster candidates
TH1F ** fHistoMCPi0WOEvtWeightInAccPt
array of histos with weighted eta in acceptance, pT
TH2F ** fHistoMotherPtY
array of histogram with signal + BG for same event photon pairs, inv Mass, pt
void ProcessTrueClusterCandidatesAOD(AliAODConversionPhoton *TruePhotonCandidate, Float_t m02, AliAODConversionPhoton *TrueSubClusterCandidate1, AliAODConversionPhoton *TrueSubClusterCandidate2)
TH2F ** fHistoMCPi0PtJetPt
array of histos with weighted pi0 from sec in acceptance, pT for different sources ...
TH1F ** fHistoNV0Tracks
array of histos with SPD tracklets vs SPD clusters for background rejection
TH2F ** fHistoTrueSecondaryPi0MCPtResolPt
array of histos with validated weighted primary eta, MCpt, resol pt
TH1F ** fHistoJetJetNTrials
array of profiles with xsection for jetjet
TH2F ** fHistoTruePrimaryPi01GammaMCPtResolPt
array of histos with validated weighted primary pi0, MCpt, resol pt
TH1F ** fHistoMCEtaDalitzInAccPt
array of histos with weighted pi0 dalitz in acceptance, pT
TH1F ** fHistoMCPi0Pt
array of histos for header names
TH1F ** fHistoMCEtaDalitzWOEvtWeightInAccPt
array of histos without evt weight pi0 in acceptance, pT
TH2F ** fHistoTrueClusPi0EM02
array of histos with validated electrons, E, m02
Bool_t Data(TH1F *h, Double_t *rangefit, Bool_t writefit, Double_t &sgn, Double_t &errsgn, Double_t &bkg, Double_t &errbkg, Double_t &sgnf, Double_t &errsgnf, Double_t &sigmafit, Int_t &status)
TH2F ** fHistoClusMergedNParticlePt
array of histos with merged cluster NCells vs Pt
TH1F ** fHistoMCEtaWOEvtWeightInAccPt
array of histos without evt weight pi0 in acceptance, pT
Int_t GetSourceClassification(Int_t daughter, Int_t pdgCode)
TH2F ** fHistoTrueClusGammaEM02
array of histos with validated eta, pt, alpha
TList * GetCaloTrackMatcherHistograms()
TH2F ** fHistoDoubleCountTrueEtaPtvsM02
array of histos with double counted secondary pi0s, pT, M02
TH2F ** fHistoClusMergedPtvsM02
array of histos with cluster NLM vs Pt
TProfile ** fProfileEtaShift
array of histos with V0 counts
Definition: External.C:220
Class handling all kinds of selection cuts for Gamma Conversion analysis.
TH2F ** fHistoMCEtaPtJetPt
array of histos with weighted pi0, pT, hardest jet pt
TH1F ** fHistoDoubleCountTrueMultipleSecPi0Pt
array of histos with double counted pi0s, pT, M02
TH2F ** fHistoDoubleCountTruePi0PtvsM02
array of histos with validated weighted secondary pi0, MCpt, resol pt
TH2F ** fHistoTrueClusMergedPtvsM02
array of histos with weighted all gamma
void SetNCaloPhotonMCLabels(Int_t nLabels)
TH1F ** fHistoDoubleCountTrueSecPi0Pt
array of histos with double counted pi0s, pT, M02
TH1F ** fHistoMCEtaPt
array of histos without event weights pi0, pT
TH1F ** fHistoMCEtaWOWeightPt
array of histos with weighted eta, pT
void ProcessTrueClusterCandidates(AliAODConversionPhoton *TruePhotonCandidate, Float_t m02, AliAODConversionPhoton *TrueSubClusterCandidate1, AliAODConversionPhoton *TrueSubClusterCandidate2)
Class handling all kinds of selection cuts for Gamma Conversion analysis.
TH1F ** fHistoMCPi0DalitzWOEvtWeightInAccPt
array of histos with weighted eta dalitz in acceptance, pT
TH2F ** fHistoNGoodESDTracksVsNClusterCandidates
array of histos with number of merged cluster candidates per event
TH2F ** fHistoMCSecPi0PtvsSource
array of histos without evt weight eta in acceptance, pT
TH1F ** fHistoMCPi0DalitzWOEvtWeightPt
array of histos with unweighted pi0 Dalitz, pT
AliConvEventCuts * GetEventCuts()
Definition: AliV0ReaderV1.h:90
const char Option_t
Definition: External.C:48
TList * fEventCutArray
current number of merged cluster candidates
void SetCaloPhotonMCFlagsAOD(AliVEvent *event, Bool_t enableSort, Bool_t mergedAnalysis=kFALSE)
TH1F ** fHistoMCEtaInAccPt
array of histos with weighted pi0 in acceptance, pT
bool Bool_t
Definition: External.C:53
TH2F ** fHistoTruePrimaryPi01ElectronMCPtResolPt
array of histos with validated weighted primary pi0, MCpt, resol pt
TProfile ** fProfileJetJetXSection
array of profiles with eta shift
vector< Int_t > fVectorDoubleCountTrueEtas
vector containing labels of validated pi0
TH1F ** fHistoVertexZ
array of histos with number of good tracks (2010 Standard track cuts)
vector< Int_t > fVectorDoubleCountTruePi0s
array of histos with double counted etas, pT, M02
TH2F ** fHistoDoubleCountTrueMultiplePi0PtvsM02
array of histos with double counted secondary pi0s, pT, M02
TH2F ** fHistoTruePrimaryPi0PureMergedMCPtResolPt
array of histos with validated eta, E, m02
TH2F ** fHistoClusNLMPt
array of histos with cluster, pt overlapping with other headers
TH2F ** fHistoTrueEtaPtY
array of histos with validated pi0, pt, Y
void FillMultipleCountMap(map< Int_t, Int_t > &ma, Int_t tobechecked)
TH2F ** fHistoTrueClusElectronEM02
array of histos with validated gamma, E, m02