]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWG4/macros/ConfigGammaConversion.C
Removed debug level line.
[u/mrichter/AliRoot.git] / PWG4 / macros / ConfigGammaConversion.C
1 /** VERSION NUMBER 1.1 */
2
3 class AliAnalysisDataContainer;
4 class AliGammaConversionHistograms;
5 class AliAnalysisTaskGammaConversion;
6
7 // set this to a number if you want to analyze a set number of files
8 // if it is 0 it will analyze the files listed in the data list
9 Int_t kGCnumberOfFilesToAnalyze=0;
10
11 Bool_t kGCrunNeutralMeson = kTRUE;
12 Bool_t kGCrunJet          = kFALSE;
13 Bool_t kGCrunChic         = kFALSE;
14 Bool_t kGCrunCF           = kFALSE;
15
16 /** ---------------------------------- define cuts here ------------------------------------*/
17
18 Int_t kGCpidOfNegativeTrack=11;
19 Int_t kGCpidOfPositiveTrack=-11;
20
21 Double_t kGCLineCutZRSlope = 0.662487;
22 Double_t kGCLineCutZValue = 7.;
23
24 Double_t kGCmaxRCut   = 180.;
25 Double_t kGCetaCut    = 1.2;
26 Double_t kGCptCut     = 0.02;
27 Double_t kGCmaxZCut     = 240.;
28 Double_t kGCchi2CutConversion   = 30.;
29 Double_t kGCchi2CutMeson   = 50.;
30
31 Double_t kGCxVertexCut = 0.;
32 Double_t kGCyVertexCut = 0.;
33 Double_t kGCzVertexCut = 0.;
34
35 Double_t kGCsigmaCutGammaMass=0.0001;
36
37 Bool_t kGCuseImprovedVertex = kTRUE;
38
39 // define masses of different particles, this will be used by the KF particle
40 // together with the width to set mass constraints. Units in GeV.
41 Double_t kGCelectronMass = 0.00051099892;
42 Double_t kGCgammaMass    = 0.;
43 Double_t kGCpi0Mass      = 0.1349766;
44 Double_t kGCetaMass      = 0.54751;
45
46 // define the width constraint used by KF particle.
47 Double_t kGCgammaWidth = 0.01;
48 Double_t kGCpi0Width   = 0.01;
49 Double_t kGCetaWidth   = 0.01;
50
51 // define the probability of track being an electron
52 Double_t kGCprobElectron = 0.002;
53
54 Double_t kGCminOpeningAngleGhostCut = 0.01;
55
56 /** ----------------------------------end define cuts here----------------------------------*/
57
58 /** -------------------------------- Phi/R Mapping ---------------------------------------*/
59 Int_t kGCnPhiIndex = 8;
60 Int_t kGCnRIndex   = 7;
61
62 Double_t kGCminRadius   = 0.;
63 Double_t kGCmaxRadius   = 200.;
64 Double_t kGCminPhi      = -TMath::Pi();
65 Double_t kGCmaxPhi      = TMath::Pi();
66 /** ------------------------------- end Phi/R Mapping ------------------------------------*/
67
68 Bool_t kGCdoOwnXYZCalculation = kFALSE;
69
70 Bool_t fWriteStandardAOD =kFALSE;
71
72 /** ------------------- define which histograms to plot here --------------------------------*/
73 /**   NB: to change the bin numbers, see below the histogram flags                           */
74
75 // NEUTRAL MESON PLOTS
76 Bool_t kGCplotMCConversionR             = kTRUE;
77 Bool_t kGCplotMCConversionZR            = kTRUE;
78 Bool_t kGCplotMCConversionXY            = kTRUE;
79 Bool_t kGCplotMCConversionOpeningAngle  = kTRUE;
80 Bool_t kGCplotMCConvGammaEAsymmetryP    = kTRUE;
81 Bool_t kGCplotMCConvGammaPAsymmetryP    = kTRUE;
82
83
84 Bool_t kGCplotMCEEnergy  = kTRUE;
85 Bool_t kGCplotMCEPt      = kTRUE;
86 Bool_t kGCplotMCEEta     = kTRUE;
87 Bool_t kGCplotMCEPhi     = kTRUE;
88
89 Bool_t kGCplotMCPEnergy  = kTRUE;
90 Bool_t kGCplotMCPPt      = kTRUE;
91 Bool_t kGCplotMCPEta     = kTRUE;
92 Bool_t kGCplotMCPPhi     = kTRUE;
93
94 Bool_t kGCplotMCallGammaEnergy = kTRUE;
95 Bool_t kGCplotMCallGammaPt     = kTRUE;
96 Bool_t kGCplotMCallGammaEta    = kTRUE;
97 Bool_t kGCplotMCallGammaPhi    = kTRUE;
98 Bool_t kGCplotMCallGammaRapid  = kTRUE;
99
100
101 Bool_t kGCplotMCConvGammaEnergy  = kTRUE;
102 Bool_t kGCplotMCConvGammaPt      = kTRUE;
103 Bool_t kGCplotMCConvGammaEta     = kTRUE;
104 Bool_t kGCplotMCConvGammaPhi     = kTRUE;
105 Bool_t kGCplotMCConvGammaRapid   = kTRUE;
106 Bool_t kGCplotMCConvGammaPtvsEta = kTRUE;
107
108 Bool_t kGCplotMCallDirectGammaEnergy  = kTRUE;
109 Bool_t kGCplotMCallDirectGammaPt      = kTRUE;
110 Bool_t kGCplotMCallDirectGammaEta     = kTRUE;
111 Bool_t kGCplotMCallDirectGammaPhi     = kTRUE;
112 Bool_t kGCplotMCallDirectGammaRapid   = kTRUE;
113
114 Bool_t kGCplotMCConvDirectGammaEnergy  = kTRUE;
115 Bool_t kGCplotMCConvDirectGammaPt      = kTRUE;
116 Bool_t kGCplotMCConvDirectGammaEta     = kTRUE;
117 Bool_t kGCplotMCConvDirectGammaPhi     = kTRUE;
118 Bool_t kGCplotMCConvDirectGammaRapid   = kTRUE;
119
120 Bool_t kGCplotMCMotherEta                                       = kTRUE;
121 Bool_t kGCplotMCMotherRapid                                = kTRUE;
122 Bool_t kGCplotMCMotherPhi                                       = kTRUE;
123 Bool_t kGCplotMCMotherPt                                        = kTRUE;
124 Bool_t kGCplotMCMotherEnergy                            = kTRUE;
125 Bool_t kGCplotMCMotherMass                                      = kTRUE;
126 Bool_t kGCplotMCMotherOpeningAngle                              = kTRUE;
127 Bool_t kGCplotMCMotherR                                 = kTRUE;
128 Bool_t kGCplotMCMotherZR                                        = kTRUE;
129 Bool_t kGCplotMCMotherXY                                        = kTRUE;
130 Bool_t kGCplotMCMotherPtvsEtaWithinAcceptance              = kTRUE;
131 Bool_t kGCplotMCMotherPtvsRapidWithinAcceptance            = kTRUE;
132 Bool_t kGCplotMCMotherPtvsEtaConvGammaWithinAcceptance     = kTRUE;
133 Bool_t kGCplotMCMotherPtvsRapidConvGammaWithinAcceptance   = kTRUE;
134 Bool_t kGCplotMCMotherSpectra                           = kTRUE;
135
136 Bool_t kGCplotMCPi0Eta                                  = kTRUE;
137 Bool_t kGCplotMCPi0Rapid                                   = kTRUE;
138 Bool_t kGCplotMCPi0Phi                                     = kTRUE;
139 Bool_t kGCplotMCPi0Pt                                      = kTRUE;
140 Bool_t kGCplotMCPi0Energy                                  = kTRUE;
141 Bool_t kGCplotMCPi0Mass                                    = kTRUE;
142 Bool_t kGCplotMCPi0OpeningAngle                            = kTRUE;
143 Bool_t kGCplotMCPi0R                                       = kTRUE;
144 Bool_t kGCplotMCPi0ZR                                      = kTRUE;
145 Bool_t kGCplotMCPi0XY                                      = kTRUE;
146 Bool_t kGCplotMCPi0PtvsEtaWithinAcceptance                 = kTRUE;
147 Bool_t kGCplotMCPi0PtvsRapidWithinAcceptance               = kTRUE;
148 Bool_t kGCplotMCPi0PtvsEtaConvGammaWithinAcceptance        = kTRUE;
149 Bool_t kGCplotMCPi0PtvsRapidConvGammaWithinAcceptance      = kTRUE;
150 Bool_t kGCplotMCPi0ZRConvGammaWithinAcceptance          = kTRUE;
151
152 Bool_t kGCplotMCPi0SecondaryEta                                = kTRUE;
153 Bool_t kGCplotMCPi0SecondaryRapid                              = kTRUE;
154 Bool_t kGCplotMCPi0SecondaryPhi                                = kTRUE;
155 Bool_t kGCplotMCPi0SecondaryPt                                 = kTRUE;
156 Bool_t kGCplotMCPi0SecondaryEnergy                             = kTRUE;
157 Bool_t kGCplotMCPi0SecondaryMass                               = kTRUE;
158 Bool_t kGCplotMCPi0SecondaryOpeningAngle                       = kTRUE;
159 Bool_t kGCplotMCPi0SecondaryR                                  = kTRUE;
160 Bool_t kGCplotMCPi0SecondaryZR                                 = kTRUE;
161 Bool_t kGCplotMCPi0SecondaryXY                                 = kTRUE;
162 Bool_t kGCplotMCPi0SecondaryPtvsEtaWithinAcceptance            = kTRUE;
163 Bool_t kGCplotMCPi0SecondaryPtvsRapidWithinAcceptance          = kTRUE;
164 Bool_t kGCplotMCPi0SecondaryPtvsEtaConvGammaWithinAcceptance   = kTRUE;
165 Bool_t kGCplotMCPi0SecondaryPtvsRapidConvGammaWithinAcceptance = kTRUE;
166
167 Bool_t kGCplotMCEtaEta                                = kTRUE;
168 Bool_t kGCplotMCEtaRapid                              = kTRUE;
169 Bool_t kGCplotMCEtaPhi                                = kTRUE;
170 Bool_t kGCplotMCEtaPt                                 = kTRUE;
171 Bool_t kGCplotMCEtaEnergy                             = kTRUE;
172 Bool_t kGCplotMCEtaMass                               = kTRUE;
173 Bool_t kGCplotMCEtaOpeningAngleGamma                  = kTRUE;
174 Bool_t kGCplotMCEtaR                                  = kTRUE;
175 Bool_t kGCplotMCEtaZR                                 = kTRUE;
176 Bool_t kGCplotMCEtaXY                                 = kTRUE;
177 Bool_t kGCplotMCEtaPtvsEtaWithinAcceptance                 = kTRUE;
178 Bool_t kGCplotMCEtaPtvsRapidWithinAcceptance       = kTRUE;
179 Bool_t kGCplotMCEtaPtvsEtaConvGammaWithinAcceptance   = kTRUE;
180 Bool_t kGCplotMCEtaPtvsRapidConvGammaWithinAcceptance = kTRUE;
181 Bool_t kGCplotMCEtaZRConvGammaWithinAcceptance = kTRUE;
182
183 // Histograms from esd tracks
184 Bool_t kGCplotESDConversionR                   = kTRUE;
185 Bool_t kGCplotESDConversionZR                  = kTRUE;
186 Bool_t kGCplotESDConversionXY                  = kTRUE;
187 Bool_t kGCplotESDConversionOpeningAngle        = kTRUE;
188 Bool_t kGCplotESDConvGammaCosPointingAngle     = kTRUE;
189 Bool_t kGCplotESDConvGammaDcaDaugthers         = kTRUE;
190 Bool_t kGCplotESDConvGammaNormDcaDistDaugthers = kTRUE;
191 Bool_t kGCplotESDConvGammaLikelihoodAP         = kTRUE;
192 Bool_t kGCplotESDConvGammaEAsymmetryP         = kTRUE;
193 Bool_t kGCplotESDConvGammaPAsymmetryP         = kTRUE;
194 Bool_t kGCplotESDConvGammaEdEdxP         = kTRUE;
195 Bool_t kGCplotESDConvGammaPdEdxP         = kTRUE;
196
197
198 Bool_t kGCplotESDEEnergy = kTRUE;
199 Bool_t kGCplotESDEPt     = kTRUE;
200 Bool_t kGCplotESDEEta    = kTRUE;
201 Bool_t kGCplotESDEPhi    = kTRUE;
202
203 Bool_t kGCplotESDPEnergy = kTRUE;
204 Bool_t kGCplotESDPPt     = kTRUE;
205 Bool_t kGCplotESDPEta    = kTRUE;
206 Bool_t kGCplotESDPPhi    = kTRUE;
207
208 Bool_t kGCplotESDConvGammaEnergy = kTRUE;
209 Bool_t kGCplotESDConvGammaPt     = kTRUE;
210 Bool_t kGCplotESDConvGammaEta    = kTRUE;
211 Bool_t kGCplotESDConvGammaPhi    = kTRUE;
212 Bool_t kGCplotESDConvGammaMass   = kTRUE;
213 Bool_t kGCplotESDConvGammaWidth  = kTRUE;
214 Bool_t kGCplotESDConvGammaChi2   = kTRUE;
215 Bool_t kGCplotESDConvGammaNDF    = kTRUE;
216 Bool_t kGCplotESDConvGammaRapid  = kTRUE;
217 Bool_t kGCplotESDConvGammaPtvsEta = kTRUE;
218 Bool_t kGCplotESDConvGammaPtvsChi2 = kTRUE;
219 Bool_t kGCplotESDConvGammaEtavsChi2 = kTRUE;
220
221
222
223 Bool_t kGCplotESDTrueConvGammaEnergy         = kTRUE;
224 Bool_t kGCplotESDTrueConvGammaPt             = kTRUE;
225 Bool_t kGCplotESDTrueConvGammaEta            = kTRUE;
226 Bool_t kGCplotESDTrueConvGammaPhi            = kTRUE;
227 Bool_t kGCplotESDTrueConvGammaMass           = kTRUE;
228 Bool_t kGCplotESDTrueConvGammaWidth          = kTRUE;
229 Bool_t kGCplotESDTrueConvGammaChi2           = kTRUE;
230 Bool_t kGCplotESDTrueConvGammaNDF            = kTRUE;
231 Bool_t kGCplotESDTrueConvGammaRapid          = kTRUE;
232 Bool_t kGCplotESDTrueConvGammaPtvsEta        = kTRUE;
233 Bool_t kGCplotESDTrueConversionR             = kTRUE;
234 Bool_t kGCplotESDTrueConversionZR            = kTRUE;
235 Bool_t kGCplotESDTrueConversionXY            = kTRUE;
236 Bool_t kGCplotESDTrueConversionOpeningAngle  = kTRUE;
237 Bool_t kGCplotESDTrueConvGammaCosPointingAngle     = kTRUE;
238 Bool_t kGCplotESDTrueConvGammaDcaDaugthers         = kTRUE;
239 Bool_t kGCplotESDTrueConvGammaNormDcaDistDaugthers = kTRUE;
240 Bool_t kGCplotESDTrueConvGammaLikelihoodAP         = kTRUE;
241 Bool_t kGCplotESDTrueConvGammaEAsymmetryP         = kTRUE;
242 Bool_t kGCplotESDTrueConvGammaPAsymmetryP         = kTRUE;
243 Bool_t kGCplotESDTrueConvGammaEdEdxP         = kTRUE;
244 Bool_t kGCplotESDTrueConvGammaPdEdxP         = kTRUE;
245
246
247 Bool_t kGCplotESDTrueConvGammaPtvsChi2       = kTRUE;
248 Bool_t kGCplotESDTrueConvGammaEtavsChi2      = kTRUE;
249 Bool_t kGCplotESDTrueConvGammaMCPtEta        = kTRUE;
250 Bool_t kGCplotESDTrueConversionMCZR          = kTRUE;
251 Bool_t kGCplotESDTrueConversionMCXY          = kTRUE;
252
253 Bool_t kGCplotESDNoCutConvGammaEnergy         = kTRUE;
254 Bool_t kGCplotESDNoCutConvGammaPt             = kTRUE;
255 Bool_t kGCplotESDNoCutConvGammaEta            = kTRUE;
256 Bool_t kGCplotESDNoCutConvGammaPhi            = kTRUE;
257 Bool_t kGCplotESDNoCutConvGammaMass           = kTRUE;
258 Bool_t kGCplotESDNoCutConvGammaWidth          = kTRUE;
259 Bool_t kGCplotESDNoCutConvGammaChi2           = kTRUE;
260 Bool_t kGCplotESDNoCutConvGammaNDF            = kTRUE;
261 Bool_t kGCplotESDNoCutConvGammaRapid          = kTRUE;
262 Bool_t kGCplotESDNoCutConvGammaPtvsEta        = kTRUE;
263 Bool_t kGCplotESDNoCutConversionR             = kTRUE;
264 Bool_t kGCplotESDNoCutConversionZR            = kTRUE;
265 Bool_t kGCplotESDNoCutConversionXY            = kTRUE;
266 Bool_t kGCplotESDNoCutConversionOpeningAngle  = kTRUE;
267 Bool_t kGCplotESDNoCutConvGammaCosPointingAngle     = kTRUE;
268 Bool_t kGCplotESDNoCutConvGammaDcaDaugthers         = kTRUE;
269 Bool_t kGCplotESDNoCutConvGammaNormDcaDistDaugthers = kTRUE;
270 Bool_t kGCplotESDNoCutConvGammaLikelihoodAP         = kTRUE;
271
272 Bool_t kGCplotESDNoCutConvGammaEAsymmetryP         = kTRUE;
273 Bool_t kGCplotESDNoCutConvGammaPAsymmetryP         = kTRUE;
274 Bool_t kGCplotESDNoCutConvGammaEdEdxP         = kTRUE;
275 Bool_t kGCplotESDNoCutConvGammaPdEdxP         = kTRUE;
276 Bool_t kGCplotESDNoCutConvGammaPtvsChi2       = kTRUE;
277 Bool_t kGCplotESDNoCutConvGammaEtavsChi2      = kTRUE;
278 Bool_t kGCplotESDNoCutConvGammaMCPtEta        = kTRUE;
279 Bool_t kGCplotESDNoCutConversionMCZR          = kTRUE;
280 Bool_t kGCplotESDNoCutConversionMCXY          = kTRUE;
281
282 Bool_t kGCplotESDMotherOpeningAngleGamma = kTRUE;
283 Bool_t kGCplotESDMotherEnergy            = kTRUE;
284 Bool_t kGCplotESDMotherPt                = kTRUE;
285 Bool_t kGCplotESDMotherEta               = kTRUE;
286 Bool_t kGCplotESDMotherPhi               = kTRUE;
287 Bool_t kGCplotESDMotherMass              = kTRUE;
288 Bool_t kGCplotESDMotherR                 = kTRUE;
289 Bool_t kGCplotESDMotherZR                = kTRUE;
290 Bool_t kGCplotESDMotherXY                = kTRUE;
291 Bool_t kGCplotESDMotherRapid             = kTRUE;
292
293 Bool_t kGCplotESDBackgroundOpeningAngleGamma = kTRUE;
294 Bool_t kGCplotESDBackgroundEnergy            = kTRUE;
295 Bool_t kGCplotESDBackgroundPt                = kTRUE;
296 Bool_t kGCplotESDBackgroundEta               = kTRUE;
297 Bool_t kGCplotESDBackgroundPhi               = kTRUE;
298 Bool_t kGCplotESDBackgroundMass              = kTRUE;
299 Bool_t kGCplotESDBackgroundR                 = kTRUE;
300 Bool_t kGCplotESDBackgroundZR                = kTRUE;
301 Bool_t kGCplotESDBackgroundXY                = kTRUE;
302 Bool_t kGCplotESDBackgroundRapid             = kTRUE;
303
304 Bool_t kGCplotMapping = kTRUE;       
305
306 Bool_t kGCplotResolutiondPt = kTRUE;
307 Bool_t kGCplotResolutiondR  = kTRUE;
308 Bool_t kGCplotResolutiondZ  = kTRUE;
309
310 Bool_t kGCplotResolutiondRdPt = kTRUE;
311
312 Bool_t kGCplotResolutionMCPt = kTRUE;
313 Bool_t kGCplotResolutionMCR  = kTRUE;
314 Bool_t kGCplotResolutionMCZ  = kTRUE;
315
316 Bool_t kGCplotResolutionESDPt = kTRUE;
317 Bool_t kGCplotResolutionESDR  = kTRUE;
318 Bool_t kGCplotResolutionESDZ  = kTRUE;
319
320 Bool_t kGCplotESDNumberOfV0s          = kTRUE;
321 Bool_t kGCplotESDNumberOfSurvivingV0s = kTRUE;
322
323 //  debug histograms
324 Bool_t kGCplotESDCutGetOnFly      = kTRUE;
325 Bool_t kGCplotESDCutNContributors = kTRUE;
326 Bool_t kGCplotESDCutLikeSign      = kTRUE;
327 Bool_t kGCplotESDCutRefit         = kTRUE;
328 Bool_t kGCplotESDCutKink          = kTRUE;
329 Bool_t kGCplotESDCutPIDProb       = kTRUE;
330 Bool_t kGCplotESDCutdedxSigmaElectronLine=kTRUE;
331 Bool_t kGCplotESDCutdedxSigmaPionLine=kTRUE;
332 Bool_t kGCplotESDCutR             = kTRUE;
333 Bool_t kGCplotESDCutLine          = kTRUE;
334 Bool_t kGCplotESDGoodV0s          = kTRUE;
335 Bool_t kGCplotESDCutNDF           = kTRUE;
336 Bool_t kGCplotESDCutChi2          = kTRUE;
337 Bool_t kGCplotESDCutEta           = kTRUE;
338 Bool_t kGCplotESDCutPt            = kTRUE;
339 Bool_t kGCplotESDTrueConvGammaTrackLength =kTRUE;
340 Bool_t kGCplotESDTrueConvGammaTrackLengthVSInvMass =kTRUE;
341
342 Bool_t kGCplotPi0Spectra = kTRUE;
343 Bool_t kGCplotEtaSpectra = kTRUE;
344
345 /////////////Chi_c Analysis//////////////////////////
346 Bool_t kGCplotStatsElectrons                                  = kTRUE;
347 Bool_t kGCplotRecENegJPsiPtDiff                               = kTRUE;
348 Bool_t kGCplotRecEPosJPsiPtDiff                               = kTRUE;
349 Bool_t kGCplotRecEPosENegR                                    = kTRUE;
350 Bool_t kGCplotRecEPosENegEta                                  = kTRUE;
351 Bool_t kGCplotESDInvMassePluseMinus                           = kTRUE;
352 Bool_t kGCplotESDInvMassGammaePluseMinusChiC                  = kTRUE;
353 Bool_t kGCplotESDInvMassGammaePluseMinusPi0                   = kTRUE;
354 Bool_t kGCplotESDElectronPosNegPt                             = kTRUE;
355 Bool_t kGCplotESDElectronPosNegEta                            = kTRUE;
356 Bool_t kGCplotESDElectronPosNegAngle                          = kTRUE;
357 Bool_t kGCplotMCElectronPosNegPt                              = kTRUE;
358 Bool_t kGCplotMCElectronPosNegEta                             = kTRUE;
359 Bool_t kGCplotMCElectronPosNegJPsiAngle                       = kTRUE;
360 Bool_t kGCplotESDElectronPosNegPi0Angle                       = kTRUE;
361 Bool_t kGCplotMCElectronPosNegPi0Angle                        = kTRUE;
362 Bool_t kGCplotTableElectrons                                  = kTRUE;
363 Bool_t kGCplotESDEPosBackground                               = kTRUE;
364 Bool_t kGCplotESDENegBackground                               = kTRUE;
365 Bool_t kGCplotESDEPosENegBackground                           = kTRUE;
366 Bool_t kGCplotESDEPosENegBackgroundCut                        = kTRUE;
367 Bool_t kGCplotESDePoseNegAngle                                = kTRUE;
368 Bool_t kGCplotESDEPosENegGammaBackgroundMX                    = kTRUE;
369 Bool_t kGCplotMCLabels                                        = kTRUE;
370 ///////////////////////////////////////////////////////////////////
371
372 //---------------- Gamma Jet analysis ----------------------------
373 Bool_t kGCplotdPhiHdrGam            = kTRUE;
374 Bool_t kGCplotdPhiHdrGamIsolated    = kTRUE;
375 Bool_t kGCplotMinimumIsoDistance    = kTRUE;
376 Bool_t kGCplotFFzHdrGam             = kTRUE;
377 Bool_t kGCplotImbalanceHdrGam       = kTRUE;
378 //----------------------------------------------------------------
379
380
381 /** ----------------- end define which histograms to plot here -------------------------------*/
382
383
384
385 /** ----------- Define the binning for the different plot types here -------------------------*/
386 //R-plots
387 Int_t kGCnXBinsR = 500;
388 Double_t kGCfirstXBinR = 0.;
389 Double_t kGClastXBinR = 250.;
390
391 //ZR-plots
392 Int_t kGCnXBinsZR = 1200;
393 Double_t kGCfirstXBinZR = -300.;
394 Double_t kGClastXBinZR = 300.;
395 Int_t kGCnYBinsZR = 500;
396 Double_t kGCfirstYBinZR = 0.;
397 Double_t kGClastYBinZR = 250.;
398
399 //XY-plots
400 Int_t kGCnXBinsXY = 1000;
401 Double_t kGCfirstXBinXY = -250.;
402 Double_t kGClastXBinXY = 250.;
403 Int_t kGCnYBinsXY = 1000;
404 Double_t kGCfirstYBinXY = -250.;
405 Double_t kGClastYBinXY = 250.;
406
407 //OpenAngle-plots
408 Int_t kGCnXBinsOpeningAngle = 400;
409 Double_t kGCfirstXBinOpeningAngle = 0.;
410 Double_t kGClastXBinOpeningAngle = TMath::Pi();
411
412 //CosPointingAngle-plots
413 Int_t kGCnXBinsCosPointingAngle = 400;
414 Double_t kGCfirstXBinCosPointingAngle = 0.99;
415 Double_t kGClastXBinCosPointingAngle = 1.01;
416
417 //DCA Daugthers-plots
418 Int_t kGCnXBinsDcaDaughters = 400;
419 Double_t kGCfirstXBinDcaDaughters= 0.;
420 Double_t kGClastXBinDcaDaughters = 5.;
421
422 //Norm DCA dist Daugthers-plots
423 Int_t kGCnXBinsNormDcaDistDaughters = 400;
424 Double_t kGCfirstXBinNormDcaDistDaughters= 0.;
425 Double_t kGClastXBinNormDcaDistDaughters = 10.;
426
427 //LikelihoodAP Plots
428 Int_t kGCnXBinsLikelihoodAP = 400;
429 Double_t kGCfirstXBinLikelihoodAP= 0.;
430 Double_t kGClastXBinLikelihoodAP = 2.;
431
432
433 //Energy-plots
434 Int_t kGCnXBinsEnergy = 200;
435 Double_t kGCfirstXBinEnergy = 0.;
436 Double_t kGClastXBinEnergy = 50.;
437
438 //P-plots
439 Int_t kGCnXBinsP = 200;
440 Double_t kGCfirstXBinP = 0.;
441 Double_t kGClastXBinP = 50.;
442
443 //dEdx-plots
444 Int_t kGCnYBinsdEdx = 400;
445 Double_t kGCfirstYBindEdx = 0.;
446 Double_t kGClastYBindEdx = 400.;
447
448 //Asymmetry-plots
449 Int_t kGCnYBinsAsymmetry = 200;
450 Double_t kGCfirstYBinAsymmetry = 0.;
451 Double_t kGClastYBinAsymmetry = 1.;
452
453
454 //Pt-plots
455 Int_t kGCnXBinsPt = 200;
456 Double_t kGCfirstXBinPt = 0.;
457 Double_t kGClastXBinPt = 50.;
458
459 //Eta-plots
460 Int_t kGCnXBinsEta = 40;
461 Double_t kGCfirstXBinEta = -2.;
462 Double_t kGClastXBinEta = 2.;
463
464 //Rapidity
465 Int_t kGCnXBinsRapid = 200;
466 Double_t kGCfirstXBinRapid = -10.;
467 Double_t kGClastXBinRapid = 10.;
468
469 //Phi-plots
470 Int_t kGCnXBinsPhi = 72;
471 Double_t kGCfirstXBinPhi = -TMath::Pi();
472 Double_t kGClastXBinPhi = TMath::Pi();
473
474 //Mapping-plots
475 Int_t kGCnXBinsMapping = 400;
476 Double_t kGCfirstXBinMapping = -100.;
477 Double_t kGClastXBinMapping = 100.;
478 Int_t kGCnYBinsMapping = 40;
479 Double_t kGCfirstYBinMapping = -2;
480 Double_t kGClastYBinMapping = 2;
481
482 //ResolutionPlots
483 //RESdPt
484 Int_t kGCnXBinsResdPt=500;
485 Int_t kGCfirstXBinResdPt= 0;
486 Int_t kGClastXBinResdPt=5;
487 Int_t kGCnYBinsResdPt=1000;
488 Int_t kGCfirstYBinResdPt= -5;
489 Int_t kGClastYBinResdPt=5;
490
491 //RESdR
492 Int_t kGCnXBinsResdR=500;
493 Int_t kGCfirstXBinResdR= 0;
494 Int_t kGClastXBinResdR=250;
495 Int_t kGCnYBinsResdR=100;
496 Int_t kGCfirstYBinResdR= -25;
497 Int_t kGClastYBinResdR=25;
498
499 //RESdZ
500 Int_t kGCnXBinsResdZ=80;
501 Int_t kGCfirstXBinResdZ= -20;
502 Int_t kGClastXBinResdZ=20;
503 Int_t kGCnYBinsResdZ=80;
504 Int_t kGCfirstYBinResdZ= -20;
505 Int_t kGClastYBinResdZ=20;
506
507 //RESdRdPt
508 Int_t kGCnXBinsResdRdPt=440;
509 Int_t kGCfirstXBinResdRdPt= -22;
510 Int_t kGClastXBinResdRdPt=22;
511 Int_t kGCnYBinsResdRdPt=100;
512 Int_t kGCfirstYBinResdRdPt= -5;
513 Int_t kGClastYBinResdRdPt=5;
514
515 //RESMCPt
516 Int_t kGCnXBinsResPt=100;
517 Int_t kGCfirstXBinResPt= 0;
518 Int_t kGClastXBinResPt=5;
519
520 //RESMCR
521 Int_t kGCnXBinsResR=500;
522 Int_t kGCfirstXBinResR= 0;
523 Int_t kGClastXBinResR=250;
524
525 //RESMCZ
526 Int_t kGCnXBinsResZ=500;
527 Int_t kGCfirstXBinResZ= 0;
528 Int_t kGClastXBinResZ=250;
529
530 //GammaMass-plots
531 Int_t kGCnXBinsGammaMass = 4000;
532 Double_t kGCfirstXBinGammaMass = 0.;
533 Double_t kGClastXBinGammaMass = 1.;
534
535 //Pi0Mass-plots
536 Int_t kGCnXBinsPi0Mass = 100;
537 Double_t kGCfirstXBinPi0Mass = 0.;
538 Double_t kGClastXBinPi0Mass = 1.;
539
540 //EtaMass-plots
541 Int_t kGCnXBinsEtaMass = 100;
542 Double_t kGCfirstXBinEtaMass = 0.;
543 Double_t kGClastXBinEtaMass = 1.;
544
545 //GammaWidth-plots
546 Int_t kGCnXBinsGammaWidth = 100;
547 Double_t kGCfirstXBinGammaWidth = 0.;
548 Double_t kGClastXBinGammaWidth = 1.;
549
550 //GammaChi2-plots
551 Int_t kGCnXBinsGammaChi2 = 100;
552 Double_t kGCfirstXBinGammaChi2 = 0;
553 Double_t kGClastXBinGammaChi2 = 100.;
554
555 //GammaNDF-plots
556 Int_t kGCnXBinsGammaNDF = 10;
557 Double_t kGCfirstXBinGammaNDF = 0.;
558 Double_t kGClastXBinGammaNDF = 10.;
559
560 //Spectra-plots
561 Int_t kGCnXBinsSpectra = 500;
562 Double_t kGCfirstXBinSpectra = 0.;
563 Double_t kGClastXBinSpectra = 1.;
564 Int_t kGCnYBinsSpectra = 100;
565 Double_t kGCfirstYBinSpectra = 0.;
566 Double_t kGClastYBinSpectra = 50.;
567
568 //track length plots
569 Int_t kGCnXBinsTrackLength = 1000;
570 Double_t kGCfirstXBinTrackLength = 0;
571 Double_t kGClastXBinTrackLength = 500;
572
573 /////////Chic_Analysis///////////////////////////////////
574 Int_t kGCnXBinsEPt = 1000;
575 Double_t kGCfirstXBinEPt = 0.;
576 Double_t kGClastXBinJPsiPt  = 10;
577
578 Int_t kGCnXBinsJPsiMass = 1000;
579 Double_t kGCfirstXBinJPsiMass = 0.;
580 Double_t kGClastXBinJPsiMass = 10.;
581
582 Int_t kGCnXBinsChicMass = 1000;
583 Double_t kGCfirstXBinChicMass = 0.;
584 Double_t kGClastXBinChicMass  = 10.;
585
586 Int_t kGCnXBinsPi0Mass  = 1000;
587 Double_t kGCfirstXBinPi0Mass = 0.;
588 Double_t kGClastXBinPi0Mass  = 1.;
589
590 Int_t kGCnXBinsEPosNegPt = 1000;
591 Double_t kGCfirstXBinEPosNegPt = 0.;
592 Double_t kGClastXBinEPosNegPt  = 10.;
593
594 Int_t kGCnXBinsEPosNegEta = 200;
595 Double_t kGCfirstXBinEPosNegEta = -1.2;
596 Double_t kGClastXBinEPosNegEta  = 1.2;
597
598 Int_t kGCnXBinsEPosNegAngle = 200;
599 Double_t kGCfirstXBinEPosNegAngle = 0.;
600 Double_t kGClastXBinEPosNegAngle = TMath::Pi();
601
602 Int_t kGCnXBinsEBackground = 1000;
603 Double_t kGCfirstXBinEBackground = 0.;
604 Double_t kGClastXBinEBackground  = 10.;
605
606 Int_t kGCnXBinsEBackgroundCut = 100;
607 Double_t kGCfirstXBinEBackgroundCut = 0.;
608 Double_t kGClastXBinEBackgroundCut  = 0.015.;
609
610 Int_t kGCnXBinsMCLabels = 10;
611 Double_t kGCfirstXBinMCLabels = 0.;
612 Double_t kGClastXBinMCLabels  = 10.;
613
614 Int_t kGCnElementsElectronTable = 19;
615
616 //18 elements
617 const char * kGCelectronTable[] = {
618   "Num. Events",  "MC e+ J/Psi |\\eta|<0.9","MC e- J/Psi |\\eta|<0.9","MC e+ e+ from J/Psi |\\eta|<0.9",
619   "ESDtracks",    "Kink Cut",
620   "Vertex Cut","TRDOut","TRDrefit","TPCrefit",
621   "ITSrefit","TRDout+TPC+TPC+ITS+nsigma>3 Pass","pid!=0","ESDElec","ESD e+ JPsi",
622   "ESD e- JPsi","ESD e+ e- JPSI","MC: gamma < 1.2","e+,e- < 0.9 g <1.2"
623 };
624
625
626 // for Gamma Jet analysis
627 Int_t kGCnXBinsdphiHdrGam = 100;
628 Double_t kGCfirstXBindphiHdrGam = -TMath::PiOver2();
629 Double_t kGClastXBindphiHdrGam = 3*TMath::PiOver2();
630
631 Int_t kGCnXBinsMinimumIsoDistance = 100;
632 Double_t kGCfirstXBinMinimumIsoDistance = 0.;
633 Double_t kGClastXBinMinimumIsoDistance = TMath::PiOver2();
634
635 Int_t kGCnXBinsFFzHdrGam = 100;
636 Double_t kGCfirstXBinFFzHdrGam = 0.;
637 Double_t kGClastXBinFFzHdrGam = 5;
638
639 Int_t kGCnXBinsImbalanceHdrGam = 100;
640 Double_t kGCfirstXBinImbalanceHdrGam = -5.;
641 Double_t kGClastXBinImbalanceHdrGam = 5.;
642 ////////////////////////////////////////////////////////
643
644
645 /** ---------- end Define the binning for the different plot types here ----------------------*/
646
647
648 /************************************************************************************************
649  *                                                                                              *
650  *                                                                                              *
651  *                     EVERYTHING BELOW IS FOR DEVELOPERS ONLY                                  *
652  *                                                                                              *
653  *                                                                                              *
654  ************************************************************************************************/
655 TString kGCoutputFileName = "histogramsGammaConversion";
656 TString kGCoutputFileAppendix = "";
657 TString kGCdataList = "";
658 Bool_t kGCwriteNtuple = kFALSE;
659 // WE DOO NOT NEED TO CHANGE THIS (kGCusePWG4PartCorr) ANYMORE SINCE IT IS TAKEN CARE OF AUTOMATICALLY NOW
660 Bool_t kGCusePWG4PartCorr = kTRUE;
661
662 /** Flag to enable running on train  */
663 Bool_t kGCrunOnTrain = kFALSE;
664
665 /** ------------------------------ Monte Carlo flag -----------------------------------------*/
666 Bool_t kGCdoMCTruth = kTRUE;
667 /** ---------------------------- end Monte Carlo flag ---------------------------------------*/
668
669 /** ------------------------- Choose KFParticle OR ESDTrack  --------------------------------*/
670 Bool_t kGCuseKFParticle = kTRUE;
671 Bool_t kGCuseESDTrack   = kFALSE;
672 /** ----------------------- end Choose KFParticle OR ESDTrack  -----------------------------*/
673
674 /**------------------------------Flag to apply dEdx cut base on sigmas to electron line----------*/
675 Bool_t kGCdodEdxSigmaCut= kTRUE;
676 /**------------------------------end Flag to apply NsigmadEdx cut ----------*/
677 Double_t kGCPIDnSigmaAboveElectronLine=6;
678 Double_t kGCPIDnSigmaBelowElectronLine=-4;
679 Double_t kGCPIDnSigmaAbovePionLine=0;
680 Double_t kGCPIDMinPnSigmaAbovePionLine=5;
681  
682
683
684 Bool_t kGCcalculateBackground = kTRUE;
685
686 Bool_t scanArguments(TString arguments){
687   Bool_t iResult = kTRUE;
688         
689   TString allArgs=arguments;
690   TString argument;
691   int bMissingParam=0;
692         
693   TObjArray* pTokens=allArgs.Tokenize(" ");
694   if (pTokens) {
695                 
696     for(int i=0; i<pTokens->GetEntries() && iResult==kTRUE; i++) {
697       argument=((TObjString*)pTokens->At(i))->GetString();
698                         
699       if(argument.IsNull()) continue;
700       // -- deconvolute-time option
701       if(argument.CompareTo("-data-list") == 0){
702         if((bMissingParam=(++i>=pTokens->GetEntries()))) break;
703         kGCdataList = ((TObjString*)pTokens->At(i))->GetString();
704         if(kGCdataList.IsNull()){
705           cout<<"-data-list is NULL"<<endl;
706           iResult=kFALSE;
707         }
708         else{
709           cout<<"Data list is set to: "<<kGCdataList<<endl;
710         }
711       }
712       else if(argument.CompareTo("-output-file-name") == 0){
713         if((bMissingParam=(++i>=pTokens->GetEntries()))) break;
714         kGCoutputFileName = ((TObjString*)pTokens->At(i))->GetString();
715         if(kGCoutputFileName.IsNull()){
716           cout<<"-output-file-name is NULL"<<endl;
717           iResult=kFALSE;
718         }
719         else{
720           cout<<"Setting output file name to: "<<kGCoutputFileName<<endl;
721         }
722       }
723       else if (argument.CompareTo("-write-ntuple") == 0){
724         cout<<"Writing ntuple to file."<<endl;
725         kGCwriteNtuple = kTRUE;
726       }
727       else if (argument.CompareTo("-run-on-train") == 0){
728         cout<<"Running on train"<<endl;
729         kGCrunOnTrain = kTRUE;
730       }
731       else if (argument.CompareTo("-run-jet") == 0){
732         cout<<"Running jet analysis"<<endl;
733         kGCrunJet = kTRUE;
734       }
735       else if (argument.CompareTo("-run-neutralmeson") == 0){
736         cout<<"Running neutral meson analysis"<<endl;
737         kGCrunNeutralMeson = kTRUE;
738       }
739       else if (argument.CompareTo("-run-neutral-meson") == 0){
740         cout<<"Running neutral meson analysis"<<endl;
741         kGCrunNeutralMeson = kTRUE;
742       }
743       else if (argument.CompareTo("-run-chic") == 0){
744         cout<<"Running Chi_c analysis"<<endl;
745         kGCrunChic = kTRUE;
746       }
747       else if (argument.CompareTo("-run-cf") == 0){
748         cout<<"Running CF"<<endl;
749         kGCrunCF = kTRUE;
750       }
751
752       else if (argument.CompareTo("-jet-off") == 0){
753         cout<<"Skipping jet analysis"<<endl;
754         kGCrunJet = kFALSE;
755       }
756       else if (argument.CompareTo("-neutralmeson-off") == 0){
757         cout<<"Skipping neutral meson analysis"<<endl;
758         kGCrunNeutralMeson = kFALSE;
759       }
760       else if (argument.CompareTo("-neutral-meson-off") == 0){
761         cout<<"Skipping neutral meson analysis"<<endl;
762         kGCrunNeutralMeson = kFALSE;
763       }
764       else if (argument.CompareTo("-chic-off") == 0){
765         cout<<"Skipping Chi_c analysis"<<endl;
766         kGCrunChic = kFALSE;
767       }
768       else if (argument.CompareTo("-mc-off") == 0){
769         cout<<"Switching off kGCdoMCTruth"<<endl;
770         kGCdoMCTruth = kFALSE;
771       }
772       else if (argument.CompareTo("-use-own-xyz") == 0){
773         cout<<"Switching on use own xyz calculation"<<endl;
774         kGCdoOwnXYZCalculation = kTRUE;
775       }
776       else if(argument.CompareTo("-append-to-output-file") == 0){
777         if((bMissingParam=(++i>=pTokens->GetEntries()))) break;
778         kGCoutputFileAppendix = TString("_")+((TObjString*)pTokens->At(i))->GetString();
779         if(kGCoutputFileAppendix.IsNull()){
780           cout<<"-appending-to-output-file is NULL"<<endl;
781           iResult=kFALSE;
782         }
783         else{
784           cout<<"Appending to the output file: "<<kGCoutputFileAppendix<<endl;
785         }
786       }
787     }
788     delete pTokens;
789   }
790   if (bMissingParam) {
791     cout<<"Missing parameter for argument "<< argument.Data()<<endl;
792     iResult=kFALSE;
793   }
794   return iResult;
795 }
796
797 void SetVersionLibrary(){
798   // Check if the file $ALICE_ROOT/PWG4/GammaConv/AliAnalysisTaskGammaConversion.cxx exists.
799   // If yes, we set kGCusePWG4PartCorr to false since we have a newer version
800   // If no, kGCusePWG4PartCorr is true.
801         
802   TString file = gSystem->Getenv("ALICE_ROOT");
803   file+="/PWG4/PartCorr/AliAnalysisTaskGammaConversion.cxx";
804         
805   ifstream stream;
806   stream.open(file.Data());
807         
808   if(!stream){
809     kGCusePWG4PartCorr=kFALSE;
810   }
811   else{
812     kGCusePWG4PartCorr=kTRUE;
813   }
814   stream.close();
815 }
816
817
818
819 AliAnalysisTaskGammaConversion* ConfigGammaConversion(TString arguments,AliAnalysisDataContainer *cin_esd=NULL){
820         
821   if(!scanArguments(arguments)){
822     break;
823   }
824         
825   SetVersionLibrary(); // checks if PWG4GammaConv or PWG4PartCorr is used
826         
827   if(cin_esd == NULL && kGCrunOnTrain == kTRUE){
828     cout<<"Error: kGCrunOnTrain flag is set to true but the input AliAnalysisDataContainer is NULL"<<endl;
829     cout<<"       you must also supply the AliAnalysisDataContainer as an argument"<<endl;
830     return;
831   }
832         
833   if(cin_esd != NULL && kGCrunOnTrain == kFALSE){
834     cout<<"Error: kGCrunOnTrain flag is set to false but the input AliAnalysisDataContainer is not null"<<endl;
835     cout<<"       add -run-on-train to the arguments to turn switch kGCrunOnTrain to kTRUE"<<endl;
836     return;
837   }
838   if(kGCrunOnTrain == kFALSE){
839     if(kGCnumberOfFilesToAnalyze==0){
840       ifstream dataInStream;
841       dataInStream.open(kGCdataList.Data());
842       if ( !dataInStream ){
843         cout<<"Data list file does not exist: "<<kGCdataList.Data()<<endl;
844         return 0;
845       }
846       string line;
847       while ( !dataInStream.eof() )
848         {
849           getline(dataInStream, line);
850           if(line.compare("") != 0){//checks if there is an empty line in the data list
851             kGCnumberOfFilesToAnalyze++;
852           }
853         }
854     }
855     cout<<"Number Of files to analyze: "<<kGCnumberOfFilesToAnalyze<<endl;
856                 
857     build();//build (if necessary) and load the libraries needed
858                 
859     gROOT->LoadMacro("$ALICE_ROOT/PWG0/CreateESDChain.C"); // load the CreateChain macro
860   }
861                 
862
863     AliLog::SetGlobalDebugLevel(0);
864     AliLog::SetGlobalLogLevel(AliLog::kError);
865                 
866     // ------------------------------------------------------------------------
867                 
868     // for CF
869                 
870     //Container def.
871     const Double_t ptmin = kGCfirstXBinPt;
872     const Double_t ptmax = kGClastXBinPt;
873     const Double_t etamin = kGCfirstXBinEta;
874     const Double_t etamax = kGClastXBinEta;
875     const Double_t massmin = kGCfirstXBinPi0Mass;
876     const Double_t massmax = kGClastXBinPi0Mass;
877                 
878                 
879     // sensitive variables
880     UInt_t ipt = 0;
881     UInt_t ieta = 1;
882     UInt_t imass = 2;   
883                 
884     //how many selection steps 
885     UInt_t nstep = 15;
886     const Int_t nvar = 3;
887     const Int_t nbin0 = kGCnXBinsPt; 
888     const Int_t nbin1 = kGCnXBinsEta;
889     const Int_t nbin2 = kGCnXBinsPi0Mass;               
890                 
891     //arrays for the number of bins in each dimension
892     Int_t iBin[nvar];
893     iBin[0] = nbin0;
894     iBin[1] = nbin1;
895     iBin[2] = nbin2;    
896                 
897     //arrays for lower bounds
898     Double_t *binLim0 = new Double_t[nbin0+1];
899     Double_t *binLim1 = new Double_t[nbin1+1];  
900     Double_t *binLim2 = new Double_t[nbin2+1];  
901                 
902     // values for lower bounds
903     for(Int_t i = 0; i <= nbin0; i++) binLim0[i] = ptmin + (ptmax - ptmin)/nbin0*i;
904     for(Int_t i = 0; i <= nbin1; i++) binLim1[i] = etamin + (etamax - etamin)/nbin1*i;
905     for(Int_t i = 0; i <= nbin2; i++) binLim2[i] = massmin + (massmax - massmin)/nbin2*i;
906                 
907     // create container
908     AliCFContainer *container = new AliCFContainer("container","container for gammaconversion", nstep,nvar,iBin);
909     container->SetBinLimits(ipt,binLim0);
910     container->SetBinLimits(ieta,binLim1);
911     container->SetBinLimits(imass,binLim2);     
912                 
913     AliCFManager *man = new AliCFManager();
914     man->SetParticleContainer(container);
915                 
916     // end ---------------------------------------------------------------------------
917                 
918                 
919
920         
921   AliGammaConversionHistograms* histograms = new AliGammaConversionHistograms();  
922   AddHistograms(histograms);
923         
924   // Create the Analysis manager
925   AliAnalysisManager *mgr =NULL;
926   if(kGCrunOnTrain == kFALSE){
927     mgr  = new AliAnalysisManager("My Manager", "My Analysis");
928   }
929   else{
930     mgr = AliAnalysisManager::GetAnalysisManager();
931   }
932         
933   if (!mgr) {
934     ::Error("ConfigGammaConversion", "No analysis manager to connect to.");
935     return NULL;
936   }
937   if(kGCrunOnTrain == kTRUE){
938     if (!mgr->GetInputEventHandler()) {
939       ::Error("ConfigGammaConversion", "This task requires an input event handler");
940       return NULL;
941     }
942   }
943   AliESDInputHandler* inpHandler = NULL;
944         
945   if(kGCrunOnTrain == kFALSE){
946     // Define Input Event Handler 
947     inpHandler = new AliESDInputHandler();
948   }
949   // Define MC Truth Event Handler
950   AliMCEventHandler* mcHandler = NULL;
951   if(kGCdoMCTruth){
952     if(kGCrunOnTrain == kFALSE){
953       mcHandler = new AliMCEventHandler();
954     }
955     else{
956       mcHandler = (AliMCEventHandler*)mgr->GetMCtruthEventHandler();
957     }
958     if (!mcHandler) {
959       ::Error("", "No MC handler connected");
960       return NULL;
961     }
962   }
963         
964   // Define Output Event Handler and ad
965   //  if(kGCrunOnTrain == kFALSE){
966     if(fWriteStandardAOD == kTRUE){
967     AliAODHandler* aodHandler = new AliAODHandler();
968     TString fileOutAOD = "AOD_"+ kGCoutputFileName + kGCoutputFileAppendix + ".root";
969     aodHandler->SetOutputFileName(fileOutAOD);
970     mgr->SetOutputEventHandler (aodHandler);
971   }
972         
973   if(kGCrunOnTrain == kFALSE){
974     mgr->SetInputEventHandler  (inpHandler);
975     mgr->SetMCtruthEventHandler(mcHandler);
976   }
977   // Be sure you are told what you are doing
978   // mgr->SetDebugLevel(10);
979         
980   // Declare Common Input Tchain
981   AliAnalysisDataContainer *cinput1 = NULL;
982   if(kGCusePWG4PartCorr){
983     if(kGCrunOnTrain == kFALSE){
984       cinput1 = mgr->CreateContainer("Chain",TChain::Class(),AliAnalysisManager::kInputContainer);
985     }
986     else{
987       cinput1 = cin_esd;
988     }
989   }
990   else{
991     if(kGCrunOnTrain == kFALSE){
992       cinput1 = mgr->GetCommonInputContainer(); // added by kenneth to avoid writing the standard AOD
993     }
994     else{
995       //      cinput = cin_esd;
996       cinput1 = mgr->GetCommonInputContainer();
997     }
998   }
999         
1000   // Common Output Tree in common Ã¢\80\98defaultâ\80\99 output file
1001   AliAnalysisDataContainer *coutput1 = NULL;
1002   if(kGCusePWG4PartCorr){
1003     coutput1 = mgr->CreateContainer("tree",TTree::Class(),AliAnalysisManager::kOutputContainer, "default");
1004   }
1005   else{
1006     if(fWriteStandardAOD){
1007       coutput1 = mgr->GetCommonOutputContainer();
1008     }
1009   }
1010         
1011   // Private output objects
1012   if(kGCoutputFileName.Contains(".root")){
1013     kGCoutputFileName.ReplaceAll(".root","");
1014   }
1015   if(kGCoutputFileAppendix.Contains(".root")){
1016     kGCoutputFileAppendix.ReplaceAll(".root","");
1017   }
1018   TString fileOut = kGCoutputFileName + kGCoutputFileAppendix + ".root";
1019         
1020   AliAnalysisDataContainer *coutput2 = mgr->CreateContainer("histogramsAliGammaConversion", TList::Class(),AliAnalysisManager::kOutputContainer, fileOut);
1021   // for CF
1022   AliAnalysisDataContainer *coutput3 = mgr->CreateContainer("ccontainer0",AliCFContainer::Class(),AliAnalysisManager::kOutputContainer,fileOut);
1023         
1024   //------------------------ END: Define input/output handlers ---------------------------------------------------
1025         
1026   //check for errors in the specified data
1027   if(kGCuseKFParticle == kTRUE && kGCuseESDTrack == kTRUE){
1028     //Print warning, cannot use both
1029     ::Error("ConfigGammaConversion","Both kGCuseKFParticle and kGCuseESDTracks can be true at the same time")
1030       }
1031   if(kGCuseKFParticle == kFALSE && kGCuseESDTrack == kFALSE){
1032     //Print warning, one have to be specified
1033     ::Error("ConfigGammaConversion","Both kGCuseKFParticle and kGCuseESDTracks can be false at the same time")
1034       }
1035         
1036         
1037   //Create the V0Reader
1038   AliV0Reader * v0Reader = new AliV0Reader();
1039   if(kGCuseKFParticle){
1040     v0Reader->UseKFParticle();
1041   }
1042   else if(kGCuseESDTrack){
1043     v0Reader->UseESDTrack();
1044   }
1045   v0Reader->SetNegativeTrackPID(kGCpidOfNegativeTrack);
1046   v0Reader->SetPositiveTrackPID(kGCpidOfPositiveTrack);
1047   v0Reader->SetMaxRCut(kGCmaxRCut);
1048   v0Reader->SetEtaCut(kGCetaCut);
1049   v0Reader->SetPtCut(kGCptCut);
1050   v0Reader->SetLineCutZRSlope(kGCLineCutZRSlope);
1051   v0Reader->SetLineCutZValue(kGCLineCutZValue); 
1052   v0Reader->SetMaxZCut(kGCmaxZCut);     
1053   v0Reader->SetChi2CutConversion(kGCchi2CutConversion);
1054   v0Reader->SetChi2CutMeson(kGCchi2CutMeson);
1055   v0Reader->SetPIDProbability(kGCprobElectron);
1056   v0Reader->SetXVertexCut(kGCxVertexCut);
1057   v0Reader->SetYVertexCut(kGCyVertexCut);
1058   v0Reader->SetZVertexCut(kGCzVertexCut);
1059   v0Reader->SetSigmaMass(kGCsigmaCutGammaMass);
1060   v0Reader->SetUseImprovedVertex(kGCuseImprovedVertex);
1061   v0Reader->SetDoMCTruth(kGCdoMCTruth);
1062   v0Reader->SetUseOwnXYZCalculation(kGCdoOwnXYZCalculation);
1063   // for CF
1064   v0Reader->SetCFManager(man);
1065         
1066   // for dEdx N sigma Cut
1067   v0Reader->SetDodEdxSigmaCut(kGCdodEdxSigmaCut);
1068   v0Reader->SetPIDnSigmaAboveElectronLine(kGCPIDnSigmaAboveElectronLine);
1069   v0Reader->SetPIDnSigmaBelowElectronLine(kGCPIDnSigmaBelowElectronLine);
1070   v0Reader->SetPIDnSigmaAbovePionLine(kGCPIDnSigmaAbovePionLine);
1071   v0Reader->SetPIDMinPnSigmaAbovePionLine(kGCPIDMinPnSigmaAbovePionLine);
1072  
1073         
1074   // Create the GammaConversionTask
1075   AliAnalysisTaskGammaConversion *gammaconversion = new AliAnalysisTaskGammaConversion("GammaConversionTask");
1076   gammaconversion->SetDebugLevel(10);
1077         
1078   gammaconversion->SetWriteNtuple(kGCwriteNtuple);
1079         
1080   gammaconversion->SetV0Reader(v0Reader);
1081   gammaconversion->SetCalculateBackground(kGCcalculateBackground);
1082   gammaconversion->Init();
1083         
1084   gammaconversion->SetElectronMass(kGCelectronMass);
1085   gammaconversion->SetGammaMass(kGCgammaMass);
1086   gammaconversion->SetPi0Mass(kGCpi0Mass);
1087   gammaconversion->SetEtaMass(kGCetaMass);
1088         
1089   gammaconversion->SetGammaWidth(kGCgammaWidth);
1090   gammaconversion->SetPi0Width(kGCpi0Width);
1091   gammaconversion->SetEtaWidth(kGCetaWidth);
1092         
1093   gammaconversion->SetMinOpeningAngleGhostCut(kGCminOpeningAngleGhostCut);
1094         
1095   // define the width constraint used by KF particle.
1096   Double_t gammaWidth = 0.01;
1097   Double_t pi0Width   = 0.01;
1098   Double_t etaWidth   = 0.01;
1099         
1100   gammaconversion->SetHistograms(histograms);
1101   v0Reader->SetHistograms(histograms);// also give the pointer to the v0reader, for debugging cuts
1102         
1103   gammaconversion->SetDoMCTruth(kGCdoMCTruth);
1104         
1105   gammaconversion->SetDoNeutralMeson(kGCrunNeutralMeson);
1106   gammaconversion->SetDoJet(kGCrunJet);
1107   gammaconversion->SetDoChic(kGCrunChic);
1108
1109   // for CF
1110   gammaconversion->SetCFManager(man);
1111   gammaconversion->SetDoCF(kGCrunCF);
1112   v0Reader->SetDoCF(kGCrunCF);
1113         
1114   // Add task to the manager 
1115   mgr->AddTask(gammaconversion);
1116         
1117   // Connect I/O to the task
1118   mgr->ConnectInput (gammaconversion, 0, cinput1);
1119         
1120   if(fWriteStandardAOD){
1121     mgr->ConnectOutput(gammaconversion, 0, coutput1);
1122   }
1123   mgr->ConnectOutput(gammaconversion, 1, coutput2);
1124   mgr->ConnectOutput(gammaconversion, 2, coutput3);
1125
1126   if(kGCrunOnTrain == kFALSE){
1127     if(kGCdataList.IsNull()){
1128       cout<<"Data list is not set, aborting."<<endl;
1129       return;
1130     }
1131                 
1132     if(kGCrunOnTrain == kFALSE){
1133       TChain* chain= CreateESDChain(kGCdataList,kGCnumberOfFilesToAnalyze);
1134                         
1135       mgr->InitAnalysis();
1136                         
1137       mgr->PrintStatus();
1138                         
1139       mgr->StartAnalysis("local",chain);
1140     }
1141   }
1142   return gammaconversion;
1143 }
1144
1145 void build() {
1146         
1147   TStopwatch timer;
1148   timer.Start();
1149   gSystem->Load("libTree.so");
1150   gSystem->Load("libGeom");
1151         
1152   ////
1153   //Setting up ESD.par//
1154   ////
1155   cout<<"compiling ESD"<<endl;
1156   setupPar("ESD");
1157   gSystem->Load("libVMC.so");
1158   gSystem->Load("libESD.so");
1159         
1160   ////
1161   ////
1162   //Setting up STEERBase.par//
1163   ////
1164   cout<<"compiling STEERBase"<<endl;
1165   setupPar("STEERBase");
1166   gSystem->Load("libSTEERBase.so");
1167         
1168   ////
1169   //Setting up AOD.par//
1170   ////
1171   cout<<"compiling AOD"<<endl;
1172   setupPar("AOD");
1173   gSystem->Load("libAOD.so");
1174         
1175   ////
1176   //Setting up ANALYSIS.par//
1177   ////
1178   cout<<"compiling ANALYSIS"<<endl;
1179   setupPar("ANALYSIS");
1180   gSystem->Load("libANALYSIS.so");
1181         
1182   ////
1183   //Setting up ANALYSISalice.par//
1184   ////
1185   cout<<"compiling ANALYSISalice"<<endl;
1186   setupPar("ANALYSISalice");
1187   gSystem->Load("libANALYSISalice.so");
1188         
1189   ////
1190   //Setting up CORRFW.par//
1191   ////
1192   cout<<"compiling CORRFW"<<endl;
1193   setupPar("CORRFW");
1194   gSystem->Load("CORRFW.so");
1195         
1196   ////
1197   //Setting up PWG4GammaConv.par//
1198   ////
1199   cout<<"compiling PWG4GammaConv"<<endl;
1200   setupPar("PWG4GammaConv");
1201   gSystem->Load("libPWG4GammaConv.so");
1202 }
1203
1204 Int_t setupPar(const char* pararchivename) {
1205   ///////////////////
1206   // Setup PAR File//
1207   ///////////////////
1208   if (pararchivename) {
1209     char processline[1024];
1210     sprintf(processline,".! tar xvzf %s.par",pararchivename);
1211     gROOT->ProcessLine(processline);
1212     const char* ocwd = gSystem->WorkingDirectory();
1213     gSystem->ChangeDirectory(pararchivename);
1214                 
1215     // check for BUILD.sh and execute
1216     if (!gSystem->AccessPathName("PROOF-INF/BUILD.sh")) {
1217       printf("*******************************\n");
1218       printf("*** Building PAR archive    ***\n");
1219       printf("*******************************\n");
1220                         
1221       if (gSystem->Exec("PROOF-INF/BUILD.sh")) {
1222         Error("runAnalysis","Cannot Build the PAR Archive! - Abort!");
1223         return -1;
1224       }
1225     }
1226     // check for SETUP.C and execute
1227     if (!gSystem->AccessPathName("PROOF-INF/SETUP.C")) {
1228       printf("*******************************\n");
1229       printf("*** Setup PAR archive       ***\n");
1230       printf("*******************************\n");
1231       gROOT->Macro("PROOF-INF/SETUP.C");
1232     }
1233                 
1234     gSystem->ChangeDirectory("../");
1235   }                                                                                                                                               
1236   return 1;
1237 }
1238
1239
1240
1241 void AddHistograms(AliGammaConversionHistograms *histograms){
1242   //---------------------------------------------- Jets ---------------------------------------------------------
1243   if(kGCrunJet == kTRUE){
1244     if (kGCplotdPhiHdrGam == kTRUE){
1245       histograms->AddHistogram("ESD_dphiHdrGam","ESD_dphiHdrGam", kGCnXBinsdphiHdrGam,kGCfirstXBindphiHdrGam,kGClastXBindphiHdrGam,"dphiHdrGam (rad)","Counts");
1246     }
1247                 
1248     if (kGCplotdPhiHdrGamIsolated == kTRUE){
1249       histograms->AddHistogram("ESD_dphiHdrGamIsolated","ESD_dphiHdrGamIsolated",  kGCnXBinsdphiHdrGam,kGCfirstXBindphiHdrGam,kGClastXBindphiHdrGam,"dphiHdrGamIsolated (rad)","Counts");
1250     }
1251                 
1252     if (kGCplotMinimumIsoDistance == kTRUE){
1253       histograms->AddHistogram("ESD_MinimumIsoDistance","ESD_MinimumIsoDistance", kGCnXBinsMinimumIsoDistance,kGCfirstXBinMinimumIsoDistance,kGClastXBinMinimumIsoDistance,"Minimum Iso Distance (rad)","Counts");
1254     }
1255                 
1256     if (kGCplotFFzHdrGam == kTRUE){
1257       histograms->AddHistogram("ESD_FFzHdrGam","ESD_FFzHdrGam", kGCnXBinsFFzHdrGam, kGCfirstXBinFFzHdrGam,kGClastXBinFFzHdrGam,"FFz Hdr Gam","Counts");
1258     }
1259                 
1260     if (kGCplotImbalanceHdrGam == kTRUE){
1261       histograms->AddHistogram("ESD_ImbalanceHdrGam","ESD_ImbalanceHdrGam", kGCnXBinsImbalanceHdrGam, kGCfirstXBinImbalanceHdrGam,kGClastXBinImbalanceHdrGam,"Imbalance Hdr Gam","Counts");
1262     }
1263   }//end if(kGCrunJet)
1264         
1265   //---------------------------------------------- Chi_c ---------------------------------------------------------
1266   if(kGCrunChic){
1267                 
1268     if(kGCplotESDInvMassePluseMinus == kTRUE){histograms->AddHistogram("ESD_InvMass_ePluseMinus","",kGCnXBinsJPsiMass, kGCfirstXBinJPsiMass, kGClastXBinJPsiMass, "",
1269                                                                        "");}
1270     if(kGCplotESDInvMassePluseMinus == kTRUE){histograms->AddHistogram("ESD_InvMass_ePluseMinusTest","",kGCnXBinsJPsiMass, kGCfirstXBinJPsiMass, kGClastXBinJPsiMass,
1271                                                                        "","");}
1272     if(kGCplotESDInvMassePluseMinus == kTRUE){histograms->AddHistogram("ESD_InvMass_xPlusxMinus","",kGCnXBinsJPsiMass, kGCfirstXBinJPsiMass, kGClastXBinJPsiMass, "",
1273                                                                        "");}
1274     if(kGCplotESDElectronPosNegPt == kTRUE){histograms->AddHistogram("ESD_ElectronPosNegPt","",kGCnXBinsEPosNegPt,kGCfirstXBinEPosNegPt,kGClastXBinEPosNegPt,"","");}
1275     if(kGCplotESDElectronPosNegEta == kTRUE){histograms->AddHistogram("ESD_ElectronPosNegEta","",kGCnXBinsEPosNegEta,kGCfirstXBinEPosNegEta,kGClastXBinEPosNegEta,"","
1276                                                                                                                                                   ");}
1277                 
1278     if(kGCplotESDElectronPosNegPt == kTRUE){histograms->AddHistogram("ESD_ElectronPosPt","",kGCnXBinsEPosNegPt,kGCfirstXBinEPosNegPt,kGClastXBinEPosNegPt,"","");}
1279     if(kGCplotESDElectronPosNegPt == kTRUE){histograms->AddHistogram("ESD_ElectronNegPt","",kGCnXBinsEPosNegPt,kGCfirstXBinEPosNegPt,kGClastXBinEPosNegPt,"","");}
1280                 
1281     if(kGCplotESDElectronPosNegAngle == kTRUE){histograms->AddHistogram("ESD_ElectronPosNegJPsiAngle","",kGCnXBinsEPosNegAngle,kGCfirstXBinEPosNegAngle,kGClastXBinEPo
1282                                                                         sNegAngle,"","");}
1283     if(kGCplotMCElectronPosNegPt == kTRUE){histograms->AddHistogram("MC_ElectronPosNegPt","",kGCnXBinsEPosNegPt,kGCfirstXBinEPosNegPt,kGClastXBinEPosNegPt,"","");}
1284     if(kGCplotMCElectronPosNegEta == kTRUE){histograms->AddHistogram("MC_ElectronPosNegEta","",kGCnXBinsEPosNegEta,kGCfirstXBinEPosNegEta,kGClastXBinEPosNegEta,"","")
1285         ;}
1286     if(kGCplotMCElectronPosNegJPsiAngle == kTRUE){histograms->AddHistogram("MC_ElectronPosNegJPsiAngle","",kGCnXBinsEPosNegAngle,kGCfirstXBinEPosNegAngle,kGClastXBinE
1287                                                                            PosNegAngle,"","");}
1288     if(kGCplotESDePoseNegAngle == kTRUE){histograms->AddHistogram("ESD_eNegePosAngleBeforeCut","",kGCnXBinsEPosNegAngle,kGCfirstXBinEPosNegAngle,kGClastXBinEPosNegAngle,"","");}
1289     if(kGCplotESDePoseNegAngle == kTRUE){histograms->AddHistogram("ESD_eNegePosAngleAfterCut","",kGCnXBinsEPosNegAngle,kGCfirstXBinEPosNegAngle,kGClastXBinEPosNegAngle,"","");}
1290     if(kGCplotESDInvMassGammaePluseMinusChiC == kTRUE) {histograms->AddHistogram("ESD_InvMass_GammaePluseMinusChiC","",kGCnXBinsChicMass,kGCfirstXBinChicMass,kGClastXBinChicMass,"","");}
1291     if(kGCplotESDInvMassGammaePluseMinusChiC == kTRUE) {histograms->AddHistogram("ESD_InvMass_GammaePluseMinusChiCDiff","",kGCnXBinsChicMass,kGCfirstXBinChicMass,kGClastXBinChicMass,"","");}
1292     if(kGCplotESDInvMassGammaePluseMinusPi0 == kTRUE) {histograms->AddHistogram("ESD_InvMass_GammaePluseMinusPi0","",kGCnXBinsPi0Mass,kGCfirstXBinPi0Mass,kGClastXBinPi0Mass,"","");}
1293     if(kGCplotESDElectronPosNegPi0Angle == kTRUE){histograms->AddHistogram("ESD_ElectronPosNegPi0Angle","",kGCnXBinsEPosNegAngle,kGCfirstXBinEPosNegAngle,kGClastXBinEPosNegAngle,"","");}
1294     if(kGCplotMCElectronPosNegPi0Angle == kTRUE){histograms->AddHistogram("MC_ElectronPosNegPi0Angle","",kGCnXBinsEPosNegAngle,kGCfirstXBinEPosNegAngle,kGClastXBinEPosNegAngle,"","");}
1295                 
1296     if(kGCplotESDEPosBackground == kTRUE){histograms->AddHistogram("ESD_EPosBackground","",kGCnXBinsEBackground,kGCfirstXBinEBackground,kGClastXBinEBackground,"","");}
1297                 
1298     if(kGCplotESDEPosBackground == kTRUE){histograms->AddHistogram("ESD_EPosENegNoJPsiBG","",kGCnXBinsEBackground,kGCfirstXBinEBackground,kGClastXBinEBackground,"","");}
1299                 
1300                 
1301     if(kGCplotESDENegBackground == kTRUE){histograms->AddHistogram("ESD_ENegBackground","",kGCnXBinsEBackground,kGCfirstXBinEBackground,kGClastXBinEBackground,"","");}
1302     if(kGCplotESDEPosENegBackground == kTRUE){histograms->AddHistogram("ESD_EPosENegBackground","",kGCnXBinsEBackground,kGCfirstXBinEBackground,kGClastXBinEBackground,"","");}
1303     if(kGCplotESDEPosENegBackgroundCut == kTRUE){histograms->AddHistogram("ESD_EPosENegBackgroundCut","",kGCnXBinsEBackgroundCut,kGCfirstXBinEBackgroundCut,kGClastXBinEBackgroundCut,"","");}
1304                 
1305     if(kGCplotESDEPosENegGammaBackgroundMX == kTRUE){histograms->AddHistogram("ESD_EPosENegGammaBackgroundMX","",kGCnXBinsEBackground,kGCfirstXBinEBackground,kGClastXBinEBackground,"","");}
1306     if(kGCplotESDEPosENegGammaBackgroundMX == kTRUE){histograms->AddHistogram("ESD_EPosENegGammaBackgroundMXDiff","",kGCnXBinsEBackground,kGCfirstXBinEBackground,kGClastXBinEBackground,"","");}
1307                 
1308     if(kGCplotTableElectrons == kTRUE){ histograms->AddTable("Table_Electrons","",kGCnElementsElectronTable,kGCelectronTable);}
1309   }// end kGCrunChic
1310         
1311   //---------------------------------------------- Neutral Meson ---------------------------------------------------------
1312   if(kGCrunNeutralMeson){
1313     if(kGCplotMCConversionR == kTRUE){ histograms->AddHistogram("MC_Conversion_R","Radius of gamma conversion points",kGCnXBinsR, kGCfirstXBinR, kGClastXBinR,"counts","cm");}
1314     if(kGCplotMCConversionZR == kTRUE){ histograms->AddHistogram("MC_Conversion_ZR","Radius of gamma conversion points vs Z",kGCnXBinsZR, kGCfirstXBinZR, kGClastXBinZR, kGCnYBinsZR, kGCfirstYBinZR, kGClastYBinZR, "cm", "cm");}
1315     if(kGCplotMCConversionXY == kTRUE){ histograms->AddHistogram("MC_Conversion_XY","Gamma XY converison point.",kGCnXBinsXY, kGCfirstXBinXY, kGClastXBinXY, kGCnYBinsXY, kGCfirstYBinXY, kGClastYBinXY, "cm", "cm");}
1316     if(kGCplotMCConversionOpeningAngle == kTRUE){ histograms->AddHistogram("MC_Conversion_OpeningAngle","Opening angle of e+e- pairs from gamma conversion",kGCnXBinsOpeningAngle, kGCfirstXBinOpeningAngle, kGClastXBinOpeningAngle, "counts", "cm");}
1317     if(kGCplotMCConvGammaEAsymmetryP== kTRUE){ histograms->AddHistogram("MC_ConvGamma_E_AsymmetryP" ,"" ,kGCnXBinsP, kGCfirstXBinP, kGClastXBinP,kGCnYBinsAsymmetry, kGCfirstYBinAsymmetry, kGClastYBinAsymmetry,"", "");}
1318     if(kGCplotMCConvGammaPAsymmetryP== kTRUE){ histograms->AddHistogram("MC_ConvGamma_P_AsymmetryP" ,"" ,kGCnXBinsP, kGCfirstXBinP, kGClastXBinP,kGCnYBinsAsymmetry, kGCfirstYBinAsymmetry, kGClastYBinAsymmetry,"", "");}
1319                 
1320
1321     if(kGCplotMCEEnergy == kTRUE){ histograms->AddHistogram("MC_E_Energy" ,"" , kGCnXBinsEnergy, kGCfirstXBinEnergy, kGClastXBinEnergy, "", "");}
1322     if(kGCplotMCEPt == kTRUE){ histograms->AddHistogram("MC_E_Pt" ,"" , kGCnXBinsPt, kGCfirstXBinPt, kGClastXBinPt, "", "");}
1323     if(kGCplotMCEEta == kTRUE){ histograms->AddHistogram("MC_E_Eta" ,"" , kGCnXBinsEta, kGCfirstXBinEta, kGClastXBinEta, "", "");}
1324     if(kGCplotMCEPhi == kTRUE){ histograms->AddHistogram("MC_E_Phi" ,"" , kGCnXBinsPhi, kGCfirstXBinPhi, kGClastXBinPhi, "", "");}
1325                 
1326     if(kGCplotMCPEnergy == kTRUE){ histograms->AddHistogram("MC_P_Energy" ,"" , kGCnXBinsEnergy, kGCfirstXBinEnergy, kGClastXBinEnergy, "", "");}
1327     if(kGCplotMCPPt == kTRUE){ histograms->AddHistogram("MC_P_Pt" ,"" , kGCnXBinsPt, kGCfirstXBinPt, kGClastXBinPt, "", "");}
1328     if(kGCplotMCPEta == kTRUE){ histograms->AddHistogram("MC_P_Eta" ,"" , kGCnXBinsEta, kGCfirstXBinEta, kGClastXBinEta, "", "");}
1329     if(kGCplotMCPPhi == kTRUE){ histograms->AddHistogram("MC_P_Phi" ,"" , kGCnXBinsPhi, kGCfirstXBinPhi, kGClastXBinPhi, "", "");}
1330                 
1331     if(kGCplotMCallGammaEnergy == kTRUE){ histograms->AddHistogram("MC_allGamma_Energy" ,"" , kGCnXBinsEnergy, kGCfirstXBinEnergy, kGClastXBinEnergy, "", "");}
1332     if(kGCplotMCallGammaPt == kTRUE){ histograms->AddHistogram("MC_allGamma_Pt" ,"" , kGCnXBinsPt, kGCfirstXBinPt, kGClastXBinPt, "", "");}
1333     if(kGCplotMCallGammaEta == kTRUE){ histograms->AddHistogram("MC_allGamma_Eta" ,"" , kGCnXBinsEta, kGCfirstXBinEta, kGClastXBinEta, "", "");}
1334     if(kGCplotMCallGammaPhi == kTRUE){ histograms->AddHistogram("MC_allGamma_Phi" ,"" , kGCnXBinsPhi, kGCfirstXBinPhi, kGClastXBinPhi, "", "");}
1335     if(kGCplotMCallGammaRapid == kTRUE){ histograms->AddHistogram("MC_allGamma_Rapid" ,"" , kGCnXBinsRapid, kGCfirstXBinRapid, kGClastXBinRapid, "", "");}
1336                 
1337     if(kGCplotMCConvGammaEnergy == kTRUE){ histograms->AddHistogram("MC_ConvGamma_Energy" ,"" , kGCnXBinsEnergy, kGCfirstXBinEnergy, kGClastXBinEnergy, "", "");}
1338     if(kGCplotMCConvGammaPt == kTRUE){ histograms->AddHistogram("MC_ConvGamma_Pt" ,"" , kGCnXBinsPt, kGCfirstXBinPt, kGClastXBinPt, "", "");}
1339     if(kGCplotMCConvGammaEta == kTRUE){ histograms->AddHistogram("MC_ConvGamma_Eta" ,"" , kGCnXBinsEta, kGCfirstXBinEta, kGClastXBinEta, "", "");}
1340     if(kGCplotMCConvGammaPhi == kTRUE){ histograms->AddHistogram("MC_ConvGamma_Phi" ,"" , kGCnXBinsPhi, kGCfirstXBinPhi, kGClastXBinPhi, "", "");}
1341     if(kGCplotMCConvGammaRapid == kTRUE){ histograms->AddHistogram("MC_ConvGamma_Rapid" ,"" , kGCnXBinsRapid, kGCfirstXBinRapid, kGClastXBinRapid, "", "");}
1342     if(kGCplotMCConvGammaPtvsEta == kTRUE){ histograms->AddHistogram("MC_ConvGamma_Pt_Eta","", kGCnXBinsPt, kGCfirstXBinPt, kGClastXBinPt,kGCnXBinsEta, kGCfirstXBinEta, kGClastXBinEta,"","");}
1343                 
1344     if(kGCplotMCallDirectGammaEnergy == kTRUE){ histograms->AddHistogram("MC_allDirectGamma_Energy" ,"" , kGCnXBinsEnergy, kGCfirstXBinEnergy, kGClastXBinEnergy, "", "");}
1345     if(kGCplotMCallDirectGammaPt == kTRUE){ histograms->AddHistogram("MC_allDirectGamma_Pt" ,"" , kGCnXBinsPt, kGCfirstXBinPt, kGClastXBinPt, "", "");}
1346     if(kGCplotMCallDirectGammaEta == kTRUE){ histograms->AddHistogram("MC_allDirectGamma_Eta" ,"" , kGCnXBinsEta, kGCfirstXBinEta, kGClastXBinEta, "", "");}
1347     if(kGCplotMCallDirectGammaPhi == kTRUE){ histograms->AddHistogram("MC_allDirectGamma_Phi" ,"" , kGCnXBinsPhi, kGCfirstXBinPhi, kGClastXBinPhi, "", "");}
1348     if(kGCplotMCallDirectGammaRapid == kTRUE){ histograms->AddHistogram("MC_allDirectGamma_Rapid" ,"" , kGCnXBinsRapid, kGCfirstXBinRapid, kGClastXBinRapid, "", "");}
1349                 
1350     if(kGCplotMCConvDirectGammaEnergy == kTRUE){ histograms->AddHistogram("MC_ConvDirectGamma_Energy" ,"" , kGCnXBinsEnergy, kGCfirstXBinEnergy, kGClastXBinEnergy, "", "");}
1351     if(kGCplotMCConvDirectGammaPt == kTRUE){ histograms->AddHistogram("MC_ConvDirectGamma_Pt" ,"" , kGCnXBinsPt, kGCfirstXBinPt, kGClastXBinPt, "", "");}
1352     if(kGCplotMCConvDirectGammaEta == kTRUE){ histograms->AddHistogram("MC_ConvDirectGamma_Eta" ,"" , kGCnXBinsEta, kGCfirstXBinEta, kGClastXBinEta, "", "");}
1353     if(kGCplotMCConvDirectGammaPhi == kTRUE){ histograms->AddHistogram("MC_ConvDirectGamma_Phi" ,"" , kGCnXBinsPhi, kGCfirstXBinPhi, kGClastXBinPhi, "", "");}
1354     if(kGCplotMCConvDirectGammaRapid == kTRUE){ histograms->AddHistogram("MC_ConvDirectGamma_Rapid" ,"" , kGCnXBinsRapid, kGCfirstXBinRapid, kGClastXBinRapid, "", "");}
1355                 
1356     if(kGCplotMCMotherEta == kTRUE){ histograms->AddHistogram("MC_Mother_Eta" ,"" , kGCnXBinsEta, kGCfirstXBinEta, kGClastXBinEta, "", "");}
1357     if(kGCplotMCMotherPhi == kTRUE){ histograms->AddHistogram("MC_Mother_Phi" ,"" , kGCnXBinsPhi, kGCfirstXBinPhi, kGClastXBinPhi, "", "");}
1358     if(kGCplotMCMotherRapid == kTRUE){ histograms->AddHistogram("MC_Mother_Rapid" ,"" , kGCnXBinsRapid, kGCfirstXBinRapid, kGClastXBinRapid, "", "");}
1359     if(kGCplotMCMotherPt == kTRUE){ histograms->AddHistogram("MC_Mother_Pt" ,"" , kGCnXBinsPt, kGCfirstXBinPt, kGClastXBinPt, "", "");}
1360     if(kGCplotMCMotherEnergy == kTRUE){ histograms->AddHistogram("MC_Mother_Energy" ,"" , kGCnXBinsEnergy, kGCfirstXBinEnergy, kGClastXBinEnergy, "", "");}
1361     if(kGCplotMCMotherMass == kTRUE){ histograms->AddHistogram("MC_Mother_Mass" ,"" , kGCnXBinsGammaMass, kGCfirstXBinGammaMass, kGClastXBinGammaMass, "", "");}
1362     if(kGCplotMCMotherOpeningAngle == kTRUE){ histograms->AddHistogram("MC_Mother_GammaDaughter_OpeningAngle" ,"" , kGCnXBinsOpeningAngle, kGCfirstXBinOpeningAngle, kGClastXBinOpeningAngle, "", "");}
1363     if(kGCplotMCMotherR == kTRUE){ histograms->AddHistogram("MC_Mother_R" ,"" , kGCnXBinsR, kGCfirstXBinR, kGClastXBinR, "", "");}
1364     if(kGCplotMCMotherZR == kTRUE){ histograms->AddHistogram("MC_Mother_ZR" ,"" , kGCnXBinsZR, kGCfirstXBinZR, kGClastXBinZR, kGCnYBinsZR, kGCfirstYBinZR, kGClastYBinZR, "", "");}
1365     if(kGCplotMCMotherXY == kTRUE){ histograms->AddHistogram("MC_Mother_XY" ,"" , kGCnXBinsXY, kGCfirstXBinXY, kGClastXBinXY, kGCnYBinsXY, kGCfirstYBinXY, kGClastYBinXY, "", "");}
1366     if(kGCplotMCMotherPtvsEtaWithinAcceptance == kTRUE){ histograms->AddHistogram("MC_Mother_Pt_Eta_withinAcceptance" ,"" , kGCnXBinsPt, kGCfirstXBinPt, kGClastXBinPt, kGCnXBinsEta, kGCfirstXBinEta, kGClastXBinEta, "", "");}
1367     if(kGCplotMCMotherPtvsRapidWithinAcceptance == kTRUE){ histograms->AddHistogram("MC_Mother_Pt_Rapid_withinAcceptance" ,"" , kGCnXBinsPt, kGCfirstXBinPt, kGClastXBinPt, kGCnXBinsRapid, kGCfirstXBinRapid, kGClastXBinRapid, "", "");}
1368     if(kGCplotMCMotherPtvsEtaConvGammaWithinAcceptance == kTRUE){ histograms->AddHistogram("MC_Mother_Pt_Eta_ConvGamma_withinAcceptance" ,"" , kGCnXBinsPt, kGCfirstXBinPt, kGClastXBinPt, kGCnXBinsEta, kGCfirstXBinEta, kGClastXBinEta, "", "");}
1369     if(kGCplotMCMotherPtvsRapidConvGammaWithinAcceptance == kTRUE){ histograms->AddHistogram("MC_Mother_Pt_Rapid_ConvGamma_withinAcceptance" ,"" , kGCnXBinsPt, kGCfirstXBinPt, kGClastXBinPt, kGCnXBinsRapid, kGCfirstXBinRapid, kGClastXBinRapid, "", "");}
1370                 
1371     if(kGCplotMCMotherSpectra == kTRUE){ 
1372       histograms->AddHistogram("MC_Mother_InvMass_vs_Pt" ,"" ,kGCnXBinsSpectra, kGCfirstXBinSpectra, kGClastXBinSpectra, kGCnYBinsSpectra, kGCfirstYBinSpectra, kGClastYBinSpectra, "", "");
1373       histograms->AddHistogram("MC_Mother_InvMass_vs_Pt_withinAcceptance" ,"" ,kGCnXBinsSpectra, kGCfirstXBinSpectra, kGClastXBinSpectra, kGCnYBinsSpectra, kGCfirstYBinSpectra, kGClastYBinSpectra, "", "");
1374       histograms->AddHistogram("MC_Mother_InvMass_vs_Pt_ConvGamma_withinAcceptance" ,"" ,kGCnXBinsSpectra, kGCfirstXBinSpectra, kGClastXBinSpectra, kGCnYBinsSpectra, kGCfirstYBinSpectra, kGClastYBinSpectra, "", "");
1375     }
1376                 
1377                 
1378     if(kGCplotMCPi0Eta == kTRUE){ histograms->AddHistogram("MC_Pi0_Eta" ,"" , kGCnXBinsEta, kGCfirstXBinEta, kGClastXBinEta, "", "");}  
1379     if(kGCplotMCPi0Rapid == kTRUE){ histograms->AddHistogram("MC_Pi0_Rapid" ,"" , kGCnXBinsRapid, kGCfirstXBinRapid, kGClastXBinRapid, "", "");}        
1380     if(kGCplotMCPi0Phi == kTRUE){ histograms->AddHistogram("MC_Pi0_Phi" ,"" , kGCnXBinsPhi, kGCfirstXBinPhi, kGClastXBinPhi, "", "");}
1381     if(kGCplotMCPi0Pt == kTRUE){ histograms->AddHistogram("MC_Pi0_Pt" ,"" , kGCnXBinsPt, kGCfirstXBinPt, kGClastXBinPt, "", "");}
1382     if(kGCplotMCPi0Energy == kTRUE){ histograms->AddHistogram("MC_Pi0_Energy" ,"" , kGCnXBinsEnergy, kGCfirstXBinEnergy, kGClastXBinEnergy, "", "");}
1383     if(kGCplotMCPi0Mass == kTRUE){ histograms->AddHistogram("MC_Pi0_Mass" ,"" , kGCnXBinsPi0Mass, kGCfirstXBinPi0Mass, kGClastXBinPi0Mass, "", "");}
1384     if(kGCplotMCPi0OpeningAngle == kTRUE){ histograms->AddHistogram("MC_Pi0_GammaDaughter_OpeningAngle" ,"" , kGCnXBinsOpeningAngle, kGCfirstXBinOpeningAngle, kGClastXBinOpeningAngle, "", "");}
1385     if(kGCplotMCPi0R == kTRUE){ histograms->AddHistogram("MC_Pi0_R" ,"" , kGCnXBinsR, kGCfirstXBinR, kGClastXBinR, "", "");}
1386     if(kGCplotMCPi0ZR == kTRUE){ histograms->AddHistogram("MC_Pi0_ZR" ,"" , kGCnXBinsZR, kGCfirstXBinZR, kGClastXBinZR, kGCnYBinsZR, kGCfirstYBinZR, kGClastYBinZR, "", "");}
1387     if(kGCplotMCPi0XY == kTRUE){ histograms->AddHistogram("MC_Pi0_XY" ,"" , kGCnXBinsXY, kGCfirstXBinXY, kGClastXBinXY, kGCnYBinsXY, kGCfirstYBinXY, kGClastYBinXY, "", "");}
1388     if(kGCplotMCPi0PtvsEtaWithinAcceptance == kTRUE){ histograms->AddHistogram("MC_Pi0_Pt_Eta_withinAcceptance" ,"" , kGCnXBinsPt, kGCfirstXBinPt, kGClastXBinPt, kGCnXBinsEta, kGCfirstXBinEta, kGClastXBinEta, "", "");}
1389     if(kGCplotMCPi0PtvsRapidWithinAcceptance == kTRUE){ histograms->AddHistogram("MC_Pi0_Pt_Rapid_withinAcceptance" ,"" , kGCnXBinsPt, kGCfirstXBinPt, kGClastXBinPt, kGCnXBinsRapid, kGCfirstXBinRapid, kGClastXBinRapid, "", "");}
1390     if(kGCplotMCPi0PtvsEtaConvGammaWithinAcceptance == kTRUE){ histograms->AddHistogram("MC_Pi0_Pt_Eta_ConvGamma_withinAcceptance" ,"" , kGCnXBinsPt, kGCfirstXBinPt, kGClastXBinPt, kGCnXBinsEta, kGCfirstXBinEta, kGClastXBinEta, "", "");}
1391     if(kGCplotMCPi0PtvsRapidConvGammaWithinAcceptance == kTRUE){ histograms->AddHistogram("MC_Pi0_Pt_Rapid_ConvGamma_withinAcceptance" ,"" , kGCnXBinsPt, kGCfirstXBinPt, kGClastXBinPt, kGCnXBinsRapid, kGCfirstXBinRapid, kGClastXBinRapid, "", "");}
1392     if(kGCplotMCPi0ZRConvGammaWithinAcceptance == kTRUE){ histograms->AddHistogram("MC_Pi0_ZR_ConvGamma_withinAcceptance" ,"" , kGCnXBinsZR, kGCfirstXBinZR, kGClastXBinZR, kGCnYBinsZR, kGCfirstYBinZR, kGClastYBinZR, "", "");}
1393                 
1394                 
1395     if(kGCplotMCPi0SecondaryEta == kTRUE){ histograms->AddHistogram("MC_Pi0_Secondaries_Eta" ,"" , kGCnXBinsEta, kGCfirstXBinEta, kGClastXBinEta, "", "");}
1396     if(kGCplotMCPi0SecondaryRapid == kTRUE){ histograms->AddHistogram("MC_Pi0_Secondaries_Rapid" ,"" , kGCnXBinsRapid, kGCfirstXBinRapid, kGClastXBinRapid, "", "");}
1397     if(kGCplotMCPi0SecondaryPhi == kTRUE){ histograms->AddHistogram("MC_Pi0_Secondaries_Phi" ,"" , kGCnXBinsPhi, kGCfirstXBinPhi, kGClastXBinPhi, "", "");}
1398     if(kGCplotMCPi0SecondaryPt == kTRUE){ histograms->AddHistogram("MC_Pi0_Secondaries_Pt" ,"" , kGCnXBinsPt, kGCfirstXBinPt, kGClastXBinPt, "", "");}
1399     if(kGCplotMCPi0SecondaryEnergy == kTRUE){ histograms->AddHistogram("MC_Pi0_Secondaries_Energy" ,"" , kGCnXBinsEnergy, kGCfirstXBinEnergy, kGClastXBinEnergy, "", "");}
1400     if(kGCplotMCPi0SecondaryMass == kTRUE){ histograms->AddHistogram("MC_Pi0_Secondaries_Mass" ,"" , kGCnXBinsPi0Mass, kGCfirstXBinPi0Mass, kGClastXBinPi0Mass, "", "");}
1401     if(kGCplotMCPi0SecondaryOpeningAngle == kTRUE){ histograms->AddHistogram("MC_Pi0_Secondaries_GammaDaughter_OpeningAngle" ,"" , kGCnXBinsOpeningAngle, kGCfirstXBinOpeningAngle, kGClastXBinOpeningAngle, "", "");}
1402     if(kGCplotMCPi0SecondaryR == kTRUE){ histograms->AddHistogram("MC_Pi0_Secondaries_R" ,"" , kGCnXBinsR, kGCfirstXBinR, kGClastXBinR, "", "");}
1403     if(kGCplotMCPi0SecondaryZR == kTRUE){ histograms->AddHistogram("MC_Pi0_Secondaries_ZR" ,"" , kGCnXBinsZR, kGCfirstXBinZR, kGClastXBinZR, kGCnYBinsZR, kGCfirstYBinZR, kGClastYBinZR, "", "");}
1404     if(kGCplotMCPi0SecondaryXY == kTRUE){ histograms->AddHistogram("MC_Pi0_Secondaries_XY" ,"" , kGCnXBinsXY, kGCfirstXBinXY, kGClastXBinXY, kGCnYBinsXY, kGCfirstYBinXY, kGClastYBinXY, "", "");}
1405     if(kGCplotMCPi0SecondaryPtvsEtaWithinAcceptance == kTRUE){ histograms->AddHistogram("MC_Pi0_Secondaries_Pt_Eta_withinAcceptance" ,"" , kGCnXBinsPt, kGCfirstXBinPt, kGClastXBinPt, kGCnXBinsEta, kGCfirstXBinEta, kGClastXBinEta, "", "");}
1406     if(kGCplotMCPi0SecondaryPtvsRapidWithinAcceptance == kTRUE){ histograms->AddHistogram("MC_Pi0_Secondaries_Pt_Rapid_withinAcceptance" ,"" , kGCnXBinsPt, kGCfirstXBinPt, kGClastXBinPt, kGCnXBinsRapid, kGCfirstXBinRapid, kGClastXBinRapid, "", "");}
1407     if(kGCplotMCPi0SecondaryPtvsEtaConvGammaWithinAcceptance == kTRUE){ histograms->AddHistogram("MC_Pi0_Secondaries_Pt_Eta_ConvGamma_withinAcceptance" ,"" , kGCnXBinsPt, kGCfirstXBinPt, kGClastXBinPt, kGCnXBinsEta, kGCfirstXBinEta, kGClastXBinEta, "", "");}
1408     if(kGCplotMCPi0SecondaryPtvsRapidConvGammaWithinAcceptance == kTRUE){ histograms->AddHistogram("MC_Pi0_Secondaries_Pt_Rapid_ConvGamma_withinAcceptance" ,"" , kGCnXBinsPt, kGCfirstXBinPt, kGClastXBinPt, kGCnXBinsRapid, kGCfirstXBinRapid, kGClastXBinRapid, "", "");}
1409                 
1410                 
1411                 
1412     if(kGCplotMCEtaEta == kTRUE){ histograms->AddHistogram("MC_Eta_Eta" ,"" , kGCnXBinsEta, kGCfirstXBinEta, kGClastXBinEta, "", "");}
1413     if(kGCplotMCEtaRapid == kTRUE){ histograms->AddHistogram("MC_Eta_Rapid" ,"" , kGCnXBinsRapid, kGCfirstXBinRapid, kGClastXBinRapid, "", "");}
1414     if(kGCplotMCEtaPhi == kTRUE){ histograms->AddHistogram("MC_Eta_Phi" ,"" , kGCnXBinsPhi, kGCfirstXBinPhi, kGClastXBinPhi, "", "");}
1415     if(kGCplotMCEtaPt == kTRUE){ histograms->AddHistogram("MC_Eta_Pt" ,"" , kGCnXBinsPt, kGCfirstXBinPt, kGClastXBinPt, "", "");}
1416     if(kGCplotMCEtaEnergy == kTRUE){ histograms->AddHistogram("MC_Eta_Energy" ,"" , kGCnXBinsEnergy, kGCfirstXBinEnergy, kGClastXBinEnergy, "", "");}
1417     if(kGCplotMCEtaMass == kTRUE){ histograms->AddHistogram("MC_Eta_Mass" ,"" , kGCnXBinsEtaMass, kGCfirstXBinEtaMass, kGClastXBinEtaMass, "", "");}
1418     if(kGCplotMCEtaOpeningAngleGamma == kTRUE){ histograms->AddHistogram("MC_Eta_GammaDaughter_OpeningAngle" ,"" , kGCnXBinsOpeningAngle, kGCfirstXBinOpeningAngle, kGClastXBinOpeningAngle, "", "");}
1419     if(kGCplotMCEtaR == kTRUE){ histograms->AddHistogram("MC_Eta_R" ,"" , kGCnXBinsR, kGCfirstXBinR, kGClastXBinR, "", "");}
1420     if(kGCplotMCEtaZR == kTRUE){ histograms->AddHistogram("MC_Eta_ZR" ,"" , kGCnXBinsZR, kGCfirstXBinZR, kGClastXBinZR, kGCnYBinsZR, kGCfirstYBinZR, kGClastYBinZR, "", "");}
1421     if(kGCplotMCEtaXY == kTRUE){ histograms->AddHistogram("MC_Eta_XY" ,"" , kGCnXBinsXY, kGCfirstXBinXY, kGClastXBinXY, kGCnYBinsXY, kGCfirstYBinXY, kGClastYBinXY, "", "");}
1422     if(kGCplotMCEtaPtvsEtaWithinAcceptance == kTRUE){ histograms->AddHistogram("MC_Eta_Pt_Eta_withinAcceptance" ,"" , kGCnXBinsPt, kGCfirstXBinPt, kGClastXBinPt, kGCnXBinsEta, kGCfirstXBinEta, kGClastXBinEta, "", "");}
1423     if(kGCplotMCEtaPtvsRapidWithinAcceptance == kTRUE){ histograms->AddHistogram("MC_Eta_Pt_Rapid_withinAcceptance" ,"" , kGCnXBinsPt, kGCfirstXBinPt, kGClastXBinPt, kGCnXBinsRapid, kGCfirstXBinRapid, kGClastXBinRapid, "", "");}
1424     if(kGCplotMCEtaPtvsEtaConvGammaWithinAcceptance == kTRUE){ histograms->AddHistogram("MC_Eta_Pt_Eta_ConvGamma_withinAcceptance" ,"" , kGCnXBinsPt, kGCfirstXBinPt, kGClastXBinPt, kGCnXBinsEta, kGCfirstXBinEta, kGClastXBinEta, "", "");}
1425     if(kGCplotMCEtaPtvsRapidConvGammaWithinAcceptance == kTRUE){ histograms->AddHistogram("MC_Eta_Pt_Rapid_ConvGamma_withinAcceptance" ,"" , kGCnXBinsPt, kGCfirstXBinPt, kGClastXBinPt, kGCnXBinsRapid, kGCfirstXBinRapid, kGClastXBinRapid, "", "");}
1426     if(kGCplotMCEtaZRConvGammaWithinAcceptance == kTRUE){ histograms->AddHistogram("MC_Eta_ZR_ConvGamma_withinAcceptance" ,"" , kGCnXBinsZR, kGCfirstXBinZR, kGClastXBinZR, kGCnYBinsZR, kGCfirstYBinZR, kGClastYBinZR, "", "");}
1427                 
1428                 
1429     // Histograms from esd tracks       
1430     if(kGCplotESDEEnergy == kTRUE){ histograms->AddHistogram("ESD_E_Energy" ,"" , kGCnXBinsEnergy, kGCfirstXBinEnergy, kGClastXBinEnergy, "", "");}
1431     if(kGCplotESDEPt == kTRUE){ histograms->AddHistogram("ESD_E_Pt" ,"" , kGCnXBinsPt, kGCfirstXBinPt, kGClastXBinPt, "", "");}
1432     if(kGCplotESDEEta == kTRUE){ histograms->AddHistogram("ESD_E_Eta" ,"" , kGCnXBinsEta, kGCfirstXBinEta, kGClastXBinEta, "", "");}
1433     if(kGCplotESDEPhi == kTRUE){ histograms->AddHistogram("ESD_E_Phi" ,"" , kGCnXBinsPhi, kGCfirstXBinPhi, kGClastXBinPhi, "", "");}
1434                 
1435     if(kGCplotESDPEnergy == kTRUE){ histograms->AddHistogram("ESD_P_Energy" ,"" , kGCnXBinsEnergy, kGCfirstXBinEnergy, kGClastXBinEnergy, "", "");}
1436     if(kGCplotESDPPt == kTRUE){ histograms->AddHistogram("ESD_P_Pt" ,"" , kGCnXBinsPt, kGCfirstXBinPt, kGClastXBinPt, "", "");}
1437     if(kGCplotESDPEta == kTRUE){ histograms->AddHistogram("ESD_P_Eta" ,"" , kGCnXBinsEta, kGCfirstXBinEta, kGClastXBinEta, "", "");}
1438     if(kGCplotESDPPhi == kTRUE){ histograms->AddHistogram("ESD_P_Phi" ,"" , kGCnXBinsPhi, kGCfirstXBinPhi, kGClastXBinPhi, "", "");}
1439                 
1440     if(kGCplotESDConvGammaEnergy == kTRUE){ histograms->AddHistogram("ESD_ConvGamma_Energy" ,"" , kGCnXBinsEnergy, kGCfirstXBinEnergy, kGClastXBinEnergy, "", "");}
1441     if(kGCplotESDConvGammaPt == kTRUE){ histograms->AddHistogram("ESD_ConvGamma_Pt" ,"" , kGCnXBinsPt, kGCfirstXBinPt, kGClastXBinPt, "", "");}
1442     if(kGCplotESDConvGammaEta == kTRUE){ histograms->AddHistogram("ESD_ConvGamma_Eta" ,"" , kGCnXBinsEta, kGCfirstXBinEta, kGClastXBinEta, "", "");}
1443     if(kGCplotESDConvGammaPhi == kTRUE){ histograms->AddHistogram("ESD_ConvGamma_Phi" ,"" , kGCnXBinsPhi, kGCfirstXBinPhi, kGClastXBinPhi, "", "");}
1444     if(kGCplotESDConvGammaMass == kTRUE){ histograms->AddHistogram("ESD_ConvGamma_Mass" ,"" ,  kGCnXBinsGammaMass, kGCfirstXBinGammaMass, kGClastXBinGammaMass, "", "");}
1445     if(kGCplotESDConvGammaWidth == kTRUE){ histograms->AddHistogram("ESD_ConvGamma_Width" ,"" , kGCnXBinsGammaWidth, kGCfirstXBinGammaWidth, kGClastXBinGammaWidth, "", "");}
1446     if(kGCplotESDConvGammaChi2 == kTRUE){ histograms->AddHistogram("ESD_ConvGamma_Chi2" ,"" , kGCnXBinsGammaChi2, kGCfirstXBinGammaChi2, kGClastXBinGammaChi2, "", "");}
1447     if(kGCplotESDConvGammaNDF == kTRUE){ histograms->AddHistogram("ESD_ConvGamma_NDF" ,"" , kGCnXBinsGammaNDF, kGCfirstXBinGammaNDF, kGClastXBinGammaNDF, "", "");}
1448     if(kGCplotESDConvGammaRapid == kTRUE){ histograms->AddHistogram("ESD_ConvGamma_Rapid" ,"" , kGCnXBinsRapid, kGCfirstXBinRapid, kGClastXBinRapid, "", "");}
1449     if(kGCplotESDConvGammaPtvsEta == kTRUE){ histograms->AddHistogram("ESD_ConvGamma_Pt_Eta","", kGCnXBinsPt, kGCfirstXBinPt, kGClastXBinPt,kGCnXBinsEta, kGCfirstXBinEta, kGClastXBinEta,"","" );}
1450     if(kGCplotESDConvGammaPtvsChi2 == kTRUE){ histograms->AddHistogram("ESD_ConvGamma_Pt_Chi2" ,"" ,kGCnXBinsPt, kGCfirstXBinPt, kGClastXBinPt, kGCnXBinsGammaChi2, kGCfirstXBinGammaChi2, kGClastXBinGammaChi2, "", "");}
1451     if(kGCplotESDConvGammaEtavsChi2 == kTRUE){ histograms->AddHistogram("ESD_ConvGamma_Eta_Chi2" ,"" ,kGCnXBinsEta, kGCfirstXBinEta, kGClastXBinEta, kGCnXBinsGammaChi2, kGCfirstXBinGammaChi2, kGClastXBinGammaChi2, "", "");}
1452                 
1453                 
1454                 
1455     if(kGCplotESDConversionR == kTRUE){ histograms->AddHistogram("ESD_Conversion_R" ,"" , kGCnXBinsR, kGCfirstXBinR, kGClastXBinR, "", "");}
1456     if(kGCplotESDConversionZR == kTRUE){ histograms->AddHistogram("ESD_Conversion_ZR" ,"" , kGCnXBinsZR, kGCfirstXBinZR, kGClastXBinZR, kGCnYBinsZR, kGCfirstYBinZR, kGClastYBinZR, "", "");}
1457     if(kGCplotESDConversionXY == kTRUE){ histograms->AddHistogram("ESD_Conversion_XY" ,"" , kGCnXBinsXY, kGCfirstXBinXY, kGClastXBinXY, kGCnYBinsXY, kGCfirstYBinXY, kGClastYBinXY, "", "");}
1458     if(kGCplotESDConversionOpeningAngle == kTRUE){ histograms->AddHistogram("ESD_Conversion_OpeningAngle" ,"" , kGCnXBinsOpeningAngle, kGCfirstXBinOpeningAngle, kGClastXBinOpeningAngle, "", "");}
1459
1460     if(kGCplotESDConvGammaCosPointingAngle == kTRUE){ histograms->AddHistogram("ESD_ConvGamma_CosPointingAngle" ,"" , kGCnXBinsCosPointingAngle, kGCfirstXBinCosPointingAngle, kGClastXBinCosPointingAngle, "", "");}
1461     if(kGCplotESDConvGammaDcaDaugthers == kTRUE){ histograms->AddHistogram("ESD_ConvGamma_DcaDaughters" ,"" , kGCnXBinsDcaDaughters, kGCfirstXBinDcaDaughters, kGClastXBinDcaDaughters, "", "");}
1462     if(kGCplotESDConvGammaNormDcaDistDaugthers == kTRUE){ histograms->AddHistogram("ESD_ConvGamma_NormDcaDistDaughters" ,"" , kGCnXBinsNormDcaDistDaughters, kGCfirstXBinNormDcaDistDaughters, kGClastXBinNormDcaDistDaughters, "", "");}
1463     if(kGCplotESDConvGammaLikelihoodAP == kTRUE){ histograms->AddHistogram("ESD_ConvGamma_LikelihoodAP" ,"" , kGCnXBinsLikelihoodAP, kGCfirstXBinLikelihoodAP, kGClastXBinLikelihoodAP, "", "");}
1464     if(kGCplotESDConvGammaEAsymmetryP== kTRUE){ histograms->AddHistogram("ESD_ConvGamma_E_AsymmetryP" ,"" ,kGCnXBinsP, kGCfirstXBinP, kGClastXBinP,kGCnYBinsAsymmetry, kGCfirstYBinAsymmetry, kGClastYBinAsymmetry,"", "");}
1465     if(kGCplotESDConvGammaPAsymmetryP== kTRUE){ histograms->AddHistogram("ESD_ConvGamma_P_AsymmetryP" ,"" ,kGCnXBinsP, kGCfirstXBinP, kGClastXBinP,kGCnYBinsAsymmetry, kGCfirstYBinAsymmetry, kGClastYBinAsymmetry,"", "");}
1466     if(kGCplotESDConvGammaEdEdxP== kTRUE){ histograms->AddHistogram("ESD_ConvGamma_E_dEdxP" ,"" ,kGCnXBinsP, kGCfirstXBinP, kGClastXBinP,kGCnYBinsdEdx, kGCfirstYBindEdx, kGClastYBindEdx,"", "");}
1467     if(kGCplotESDConvGammaPdEdxP== kTRUE){ histograms->AddHistogram("ESD_ConvGamma_P_dEdxP" ,"" ,kGCnXBinsP, kGCfirstXBinP, kGClastXBinP,kGCnYBinsdEdx, kGCfirstYBindEdx, kGClastYBindEdx,"", "");}
1468
1469
1470                 
1471                 
1472     if(kGCplotESDTrueConvGammaEnergy == kTRUE){ histograms->AddHistogram("ESD_TrueConvGamma_Energy" ,"" , kGCnXBinsEnergy, kGCfirstXBinEnergy, kGClastXBinEnergy, "", "");}
1473     if(kGCplotESDTrueConvGammaPt == kTRUE){ histograms->AddHistogram("ESD_TrueConvGamma_Pt" ,"" , kGCnXBinsPt, kGCfirstXBinPt, kGClastXBinPt, "", "");}
1474     if(kGCplotESDTrueConvGammaEta == kTRUE){ histograms->AddHistogram("ESD_TrueConvGamma_Eta" ,"" , kGCnXBinsEta, kGCfirstXBinEta, kGClastXBinEta, "", "");}
1475     if(kGCplotESDTrueConvGammaPhi == kTRUE){ histograms->AddHistogram("ESD_TrueConvGamma_Phi" ,"" , kGCnXBinsPhi, kGCfirstXBinPhi, kGClastXBinPhi, "", "");}
1476     if(kGCplotESDTrueConvGammaMass == kTRUE){ histograms->AddHistogram("ESD_TrueConvGamma_Mass" ,"" ,  kGCnXBinsGammaMass, kGCfirstXBinGammaMass, kGClastXBinGammaMass, "", "");}
1477     if(kGCplotESDTrueConvGammaWidth == kTRUE){ histograms->AddHistogram("ESD_TrueConvGamma_Width" ,"" , kGCnXBinsGammaWidth, kGCfirstXBinGammaWidth, kGClastXBinGammaWidth, "", "");}
1478     if(kGCplotESDTrueConvGammaChi2 == kTRUE){ histograms->AddHistogram("ESD_TrueConvGamma_Chi2" ,"" , kGCnXBinsGammaChi2, kGCfirstXBinGammaChi2, kGClastXBinGammaChi2, "", "");}
1479     if(kGCplotESDTrueConvGammaNDF == kTRUE){ histograms->AddHistogram("ESD_TrueConvGamma_NDF" ,"" , kGCnXBinsGammaNDF, kGCfirstXBinGammaNDF, kGClastXBinGammaNDF, "", "");}
1480     if(kGCplotESDTrueConvGammaRapid == kTRUE){ histograms->AddHistogram("ESD_TrueConvGamma_Rapid" ,"" , kGCnXBinsRapid, kGCfirstXBinRapid, kGClastXBinRapid, "", "");}
1481     if(kGCplotESDTrueConvGammaPtvsEta == kTRUE){ histograms->AddHistogram("ESD_TrueConvGamma_Pt_Eta" ,"" , kGCnXBinsPt, kGCfirstXBinPt, kGClastXBinPt,kGCnXBinsEta, kGCfirstXBinEta, kGClastXBinEta, "", "");}
1482     if(kGCplotESDTrueConvGammaPtvsChi2 == kTRUE){ histograms->AddHistogram("ESD_TrueConvGamma_Pt_Chi2" ,"" ,kGCnXBinsPt, kGCfirstXBinPt, kGClastXBinPt, kGCnXBinsGammaChi2, kGCfirstXBinGammaChi2, kGClastXBinGammaChi2, "", "");}
1483     if(kGCplotESDTrueConvGammaEtavsChi2 == kTRUE){ histograms->AddHistogram("ESD_TrueConvGamma_Eta_Chi2" ,"" ,kGCnXBinsEta, kGCfirstXBinEta, kGClastXBinEta, kGCnXBinsGammaChi2, kGCfirstXBinGammaChi2, kGClastXBinGammaChi2, "", "");}
1484                 
1485     if(kGCplotESDTrueConversionR == kTRUE){ histograms->AddHistogram("ESD_TrueConversion_R" ,"" , kGCnXBinsR, kGCfirstXBinR, kGClastXBinR, "", "");}
1486     if(kGCplotESDTrueConversionZR == kTRUE){ histograms->AddHistogram("ESD_TrueConversion_ZR" ,"" , kGCnXBinsZR, kGCfirstXBinZR, kGClastXBinZR, kGCnYBinsZR, kGCfirstYBinZR, kGClastYBinZR, "", "");}
1487     if(kGCplotESDTrueConversionXY == kTRUE){ histograms->AddHistogram("ESD_TrueConversion_XY" ,"" , kGCnXBinsXY, kGCfirstXBinXY, kGClastXBinXY, kGCnYBinsXY, kGCfirstYBinXY, kGClastYBinXY, "", "");}
1488     if(kGCplotESDTrueConversionOpeningAngle == kTRUE){ histograms->AddHistogram("ESD_TrueConversion_OpeningAngle" ,"" , kGCnXBinsOpeningAngle, kGCfirstXBinOpeningAngle, kGClastXBinOpeningAngle, "", "");}
1489
1490     if(kGCplotESDTrueConvGammaCosPointingAngle == kTRUE){ histograms->AddHistogram("ESD_TrueConvGamma_CosPointingAngle" ,"" , kGCnXBinsCosPointingAngle, kGCfirstXBinCosPointingAngle, kGClastXBinCosPointingAngle, "", "");}
1491     if(kGCplotESDTrueConvGammaDcaDaugthers == kTRUE){ histograms->AddHistogram("ESD_TrueConvGamma_DcaDaughters" ,"" , kGCnXBinsDcaDaughters, kGCfirstXBinDcaDaughters, kGClastXBinDcaDaughters, "", "");}
1492     if(kGCplotESDTrueConvGammaNormDcaDistDaugthers == kTRUE){ histograms->AddHistogram("ESD_TrueConvGamma_NormDcaDistDaughters" ,"" , kGCnXBinsNormDcaDistDaughters, kGCfirstXBinNormDcaDistDaughters, kGClastXBinNormDcaDistDaughters, "", "");}
1493     if(kGCplotESDTrueConvGammaLikelihoodAP == kTRUE){ histograms->AddHistogram("ESD_TrueConvGamma_LikelihoodAP" ,"" , kGCnXBinsLikelihoodAP, kGCfirstXBinLikelihoodAP, kGClastXBinLikelihoodAP, "", "");}
1494     if(kGCplotESDTrueConvGammaEAsymmetryP== kTRUE){ histograms->AddHistogram("ESD_TrueConvGamma_E_AsymmetryP" ,"" ,kGCnXBinsP, kGCfirstXBinP, kGClastXBinP,kGCnYBinsAsymmetry, kGCfirstYBinAsymmetry, kGClastYBinAsymmetry,"", "");}
1495     if(kGCplotESDTrueConvGammaPAsymmetryP== kTRUE){ histograms->AddHistogram("ESD_TrueConvGamma_P_AsymmetryP" ,"" ,kGCnXBinsP, kGCfirstXBinP, kGClastXBinP,kGCnYBinsAsymmetry, kGCfirstYBinAsymmetry, kGClastYBinAsymmetry,"", "");}
1496     if(kGCplotESDTrueConvGammaEdEdxP== kTRUE){ histograms->AddHistogram("ESD_TrueConvGamma_E_dEdxP" ,"" ,kGCnXBinsP, kGCfirstXBinP, kGClastXBinP,kGCnYBinsdEdx, kGCfirstYBindEdx, kGClastYBindEdx,"", "");}
1497     if(kGCplotESDTrueConvGammaPdEdxP== kTRUE){ histograms->AddHistogram("ESD_TrueConvGamma_P_dEdxP" ,"" ,kGCnXBinsP, kGCfirstXBinP, kGClastXBinP,kGCnYBinsdEdx, kGCfirstYBindEdx, kGClastYBindEdx,"", "");}
1498
1499                 
1500     if(kGCplotESDTrueConvGammaMCPtEta == kTRUE){ histograms->AddHistogram("ESD_TrueConvGamma_MC_Pt_Eta" ,"" , kGCnXBinsPt, kGCfirstXBinPt, kGClastXBinPt, kGCnXBinsEta, kGCfirstXBinEta, kGClastXBinEta, "", "");}
1501     if(kGCplotESDTrueConversionMCZR == kTRUE){ histograms->AddHistogram("ESD_TrueConversion_MC_ZR" ,"" , kGCnXBinsZR, kGCfirstXBinZR, kGClastXBinZR, kGCnYBinsZR, kGCfirstYBinZR, kGClastYBinZR, "", "");}
1502     if(kGCplotESDTrueConversionMCXY == kTRUE){ histograms->AddHistogram("ESD_TrueConversion_MC_XY" ,"" , kGCnXBinsXY, kGCfirstXBinXY, kGClastXBinXY, kGCnYBinsXY, kGCfirstYBinXY, kGClastYBinXY, "", "");}
1503                 
1504                 
1505                 
1506     if(kGCplotESDNoCutConvGammaEnergy == kTRUE){ histograms->AddHistogram("ESD_NoCutConvGamma_Energy" ,"" , kGCnXBinsEnergy, kGCfirstXBinEnergy, kGClastXBinEnergy, "", "");}
1507     if(kGCplotESDNoCutConvGammaPt == kTRUE){ histograms->AddHistogram("ESD_NoCutConvGamma_Pt" ,"" , kGCnXBinsPt, kGCfirstXBinPt, kGClastXBinPt, "", "");}
1508     if(kGCplotESDNoCutConvGammaEta == kTRUE){ histograms->AddHistogram("ESD_NoCutConvGamma_Eta" ,"" , kGCnXBinsEta, kGCfirstXBinEta, kGClastXBinEta, "", "");}
1509     if(kGCplotESDNoCutConvGammaPhi == kTRUE){ histograms->AddHistogram("ESD_NoCutConvGamma_Phi" ,"" , kGCnXBinsPhi, kGCfirstXBinPhi, kGClastXBinPhi, "", "");}
1510     if(kGCplotESDNoCutConvGammaMass == kTRUE){ histograms->AddHistogram("ESD_NoCutConvGamma_Mass" ,"" ,  kGCnXBinsGammaMass, kGCfirstXBinGammaMass, kGClastXBinGammaMass, "", "");}
1511     if(kGCplotESDNoCutConvGammaWidth == kTRUE){ histograms->AddHistogram("ESD_NoCutConvGamma_Width" ,"" , kGCnXBinsGammaWidth, kGCfirstXBinGammaWidth, kGClastXBinGammaWidth, "", "");}
1512     if(kGCplotESDNoCutConvGammaChi2 == kTRUE){ histograms->AddHistogram("ESD_NoCutConvGamma_Chi2" ,"" , kGCnXBinsGammaChi2, kGCfirstXBinGammaChi2, kGClastXBinGammaChi2, "", "");}
1513     if(kGCplotESDNoCutConvGammaNDF == kTRUE){ histograms->AddHistogram("ESD_NoCutConvGamma_NDF" ,"" , kGCnXBinsGammaNDF, kGCfirstXBinGammaNDF, kGClastXBinGammaNDF, "", "");}
1514     if(kGCplotESDNoCutConvGammaRapid == kTRUE){ histograms->AddHistogram("ESD_NoCutConvGamma_Rapid" ,"" , kGCnXBinsRapid, kGCfirstXBinRapid, kGClastXBinRapid, "", "");}
1515     if(kGCplotESDNoCutConvGammaPtvsEta == kTRUE){ histograms->AddHistogram("ESD_NoCutConvGamma_Pt_Eta" ,"" , kGCnXBinsPt, kGCfirstXBinPt, kGClastXBinPt,kGCnXBinsEta, kGCfirstXBinEta, kGClastXBinEta, "", "");}
1516     if(kGCplotESDNoCutConvGammaPtvsChi2 == kTRUE){ histograms->AddHistogram("ESD_NoCutConvGamma_Pt_Chi2" ,"" ,kGCnXBinsPt, kGCfirstXBinPt, kGClastXBinPt, kGCnXBinsGammaChi2, kGCfirstXBinGammaChi2, kGClastXBinGammaChi2, "", "");}
1517     if(kGCplotESDNoCutConvGammaEtavsChi2 == kTRUE){ histograms->AddHistogram("ESD_NoCutConvGamma_Eta_Chi2" ,"" ,kGCnXBinsEta, kGCfirstXBinEta, kGClastXBinEta, kGCnXBinsGammaChi2, kGCfirstXBinGammaChi2, kGClastXBinGammaChi2, "", "");}
1518                 
1519     if(kGCplotESDNoCutConversionR == kTRUE){ histograms->AddHistogram("ESD_NoCutConversion_R" ,"" , kGCnXBinsR, kGCfirstXBinR, kGClastXBinR, "", "");}
1520     if(kGCplotESDNoCutConversionZR == kTRUE){ histograms->AddHistogram("ESD_NoCutConversion_ZR" ,"" , kGCnXBinsZR, kGCfirstXBinZR, kGClastXBinZR, kGCnYBinsZR, kGCfirstYBinZR, kGClastYBinZR, "", "");}
1521     if(kGCplotESDNoCutConversionXY == kTRUE){ histograms->AddHistogram("ESD_NoCutConversion_XY" ,"" , kGCnXBinsXY, kGCfirstXBinXY, kGClastXBinXY, kGCnYBinsXY, kGCfirstYBinXY, kGClastYBinXY, "", "");}
1522     if(kGCplotESDNoCutConversionOpeningAngle == kTRUE){ histograms->AddHistogram("ESD_NoCutConversion_OpeningAngle" ,"" , kGCnXBinsOpeningAngle, kGCfirstXBinOpeningAngle, kGClastXBinOpeningAngle, "", "");}
1523
1524     if(kGCplotESDNoCutConvGammaCosPointingAngle == kTRUE){ histograms->AddHistogram("ESD_NoCutConvGamma_CosPointingAngle" ,"" , kGCnXBinsCosPointingAngle, kGCfirstXBinCosPointingAngle, kGClastXBinCosPointingAngle, "", "");}
1525     if(kGCplotESDNoCutConvGammaDcaDaugthers == kTRUE){ histograms->AddHistogram("ESD_NoCutConvGamma_DcaDaughters" ,"" , kGCnXBinsDcaDaughters, kGCfirstXBinDcaDaughters, kGClastXBinDcaDaughters, "", "");}
1526     if(kGCplotESDNoCutConvGammaNormDcaDistDaugthers == kTRUE){ histograms->AddHistogram("ESD_NoCutConvGamma_NormDcaDistDaughters" ,"" , kGCnXBinsNormDcaDistDaughters, kGCfirstXBinNormDcaDistDaughters, kGClastXBinNormDcaDistDaughters, "", "");}
1527     if(kGCplotESDNoCutConvGammaLikelihoodAP == kTRUE){ histograms->AddHistogram("ESD_NoCutConvGamma_LikelihoodAP" ,"" , kGCnXBinsLikelihoodAP, kGCfirstXBinLikelihoodAP, kGClastXBinLikelihoodAP, "", "");}
1528     if(kGCplotESDNoCutConvGammaEAsymmetryP== kTRUE){ histograms->AddHistogram("ESD_NoCutConvGamma_E_AsymmetryP" ,"" ,kGCnXBinsP, kGCfirstXBinP, kGClastXBinP,kGCnYBinsAsymmetry, kGCfirstYBinAsymmetry, kGClastYBinAsymmetry,"", "");}
1529     if(kGCplotESDNoCutConvGammaPAsymmetryP== kTRUE){ histograms->AddHistogram("ESD_NoCutConvGamma_P_AsymmetryP" ,"" ,kGCnXBinsP, kGCfirstXBinP, kGClastXBinP,kGCnYBinsAsymmetry, kGCfirstYBinAsymmetry, kGClastYBinAsymmetry,"", "");}
1530
1531
1532     if(kGCplotESDNoCutConvGammaEdEdxP== kTRUE){ histograms->AddHistogram("ESD_NoCutConvGamma_E_dEdxP" ,"" ,kGCnXBinsP, kGCfirstXBinP, kGClastXBinP,kGCnYBinsdEdx, kGCfirstYBindEdx, kGClastYBindEdx,"", "");}
1533     if(kGCplotESDNoCutConvGammaPdEdxP== kTRUE){ histograms->AddHistogram("ESD_NoCutConvGamma_P_dEdxP" ,"" ,kGCnXBinsP, kGCfirstXBinP, kGClastXBinP,kGCnYBinsdEdx, kGCfirstYBindEdx, kGClastYBindEdx,"", "");}
1534
1535     if(kGCplotESDNoCutConvGammaMCPtEta == kTRUE){ histograms->AddHistogram("ESD_NoCutConvGamma_MC_Pt_Eta" ,"" , kGCnXBinsPt, kGCfirstXBinPt, kGClastXBinPt, kGCnXBinsEta, kGCfirstXBinEta, kGClastXBinEta, "", "");}
1536     if(kGCplotESDNoCutConversionMCZR == kTRUE){ histograms->AddHistogram("ESD_NoCutConversion_MC_ZR" ,"" , kGCnXBinsZR, kGCfirstXBinZR, kGClastXBinZR, kGCnYBinsZR, kGCfirstYBinZR, kGClastYBinZR, "", "");}
1537     if(kGCplotESDNoCutConversionMCXY == kTRUE){ histograms->AddHistogram("ESD_NoCutConversion_MC_XY" ,"" , kGCnXBinsXY, kGCfirstXBinXY, kGClastXBinXY, kGCnYBinsXY, kGCfirstYBinXY, kGClastYBinXY, "", "");}
1538                 
1539                 
1540                 
1541     if(kGCplotESDMotherOpeningAngleGamma == kTRUE){ histograms->AddHistogram("ESD_Mother_GammaDaughter_OpeningAngle" ,"" , kGCnXBinsOpeningAngle, kGCfirstXBinOpeningAngle, kGClastXBinOpeningAngle, "", "");}
1542     if(kGCplotESDMotherEnergy == kTRUE){ histograms->AddHistogram("ESD_Mother_Energy" ,"" , kGCnXBinsEnergy, kGCfirstXBinEnergy, kGClastXBinEnergy, "", "");}
1543     if(kGCplotESDMotherPt == kTRUE){ histograms->AddHistogram("ESD_Mother_Pt" ,"" , kGCnXBinsPt, kGCfirstXBinPt, kGClastXBinPt, "", "");}
1544     if(kGCplotESDMotherEta == kTRUE){ histograms->AddHistogram("ESD_Mother_Eta" ,"" , kGCnXBinsEta, kGCfirstXBinEta, kGClastXBinEta, "", "");}
1545     if(kGCplotESDMotherPhi == kTRUE){ histograms->AddHistogram("ESD_Mother_Phi" ,"" , kGCnXBinsPhi, kGCfirstXBinPhi, kGClastXBinPhi, "", "");}
1546     if(kGCplotESDMotherMass == kTRUE){ histograms->AddHistogram("ESD_Mother_Mass" ,"" , kGCnXBinsPi0Mass, kGCfirstXBinPi0Mass, kGClastXBinPi0Mass, "", "");}
1547     if(kGCplotESDMotherR == kTRUE){ histograms->AddHistogram("ESD_Mother_R" ,"" , kGCnXBinsR, kGCfirstXBinR, kGClastXBinR, "", "");}
1548     if(kGCplotESDMotherZR == kTRUE){ histograms->AddHistogram("ESD_Mother_ZR" ,"" , kGCnXBinsZR, kGCfirstXBinZR, kGClastXBinZR, kGCnYBinsZR, kGCfirstYBinZR, kGClastYBinZR, "", "");}
1549     if(kGCplotESDMotherXY == kTRUE){ histograms->AddHistogram("ESD_Mother_XY" ,"" , kGCnXBinsXY, kGCfirstXBinXY, kGClastXBinXY, kGCnYBinsXY, kGCfirstYBinXY, kGClastYBinXY, "", "");}
1550     if(kGCplotESDMotherRapid == kTRUE){ histograms->AddHistogram("ESD_Mother_Rapid" ,"" , kGCnXBinsRapid, kGCfirstXBinRapid, kGClastXBinRapid, "", "");}
1551                 
1552                 
1553     if(kGCplotESDBackgroundOpeningAngleGamma == kTRUE){ histograms->AddHistogram("ESD_Background_GammaDaughter_OpeningAngle" ,"" , kGCnXBinsOpeningAngle, kGCfirstXBinOpeningAngle, kGClastXBinOpeningAngle, "", "");}
1554     if(kGCplotESDBackgroundEnergy == kTRUE){ histograms->AddHistogram("ESD_Background_Energy" ,"" , kGCnXBinsEnergy, kGCfirstXBinEnergy, kGClastXBinEnergy, "", "");}
1555     if(kGCplotESDBackgroundPt == kTRUE){ histograms->AddHistogram("ESD_Background_Pt" ,"" , kGCnXBinsPt, kGCfirstXBinPt, kGClastXBinPt, "", "");}
1556     if(kGCplotESDBackgroundEta == kTRUE){ histograms->AddHistogram("ESD_Background_Eta" ,"" , kGCnXBinsEta, kGCfirstXBinEta, kGClastXBinEta, "", "");}
1557     if(kGCplotESDBackgroundPhi == kTRUE){ histograms->AddHistogram("ESD_Background_Phi" ,"" , kGCnXBinsPhi, kGCfirstXBinPhi, kGClastXBinPhi, "", "");}
1558     if(kGCplotESDBackgroundMass == kTRUE){ histograms->AddHistogram("ESD_Background_Mass" ,"" , kGCnXBinsEtaMass, kGCfirstXBinEtaMass, kGClastXBinEtaMass, "", "");}
1559     if(kGCplotESDBackgroundR == kTRUE){ histograms->AddHistogram("ESD_Background_R" ,"" , kGCnXBinsR, kGCfirstXBinR, kGClastXBinR, "", "");}
1560     if(kGCplotESDBackgroundZR == kTRUE){ histograms->AddHistogram("ESD_Background_ZR" ,"" , kGCnXBinsZR, kGCfirstXBinZR, kGClastXBinZR, kGCnYBinsZR, kGCfirstYBinZR, kGClastYBinZR, "", "");}
1561     if(kGCplotESDBackgroundXY == kTRUE){ histograms->AddHistogram("ESD_Background_XY" ,"" , kGCnXBinsXY, kGCfirstXBinXY, kGClastXBinXY, kGCnYBinsXY, kGCfirstYBinXY, kGClastYBinXY, "", "");}
1562     if(kGCplotESDBackgroundRapid == kTRUE){ histograms->AddHistogram("ESD_Background_Rapid" ,"" , kGCnXBinsRapid, kGCfirstXBinRapid, kGClastXBinRapid, "", "");}
1563                 
1564                 
1565     if(kGCplotMapping == kTRUE){
1566       histograms->InitializeMappingValues(kGCnPhiIndex,kGCnRIndex,kGCnXBinsMapping,kGCminRadius,kGCmaxRadius,kGCnYBinsMapping,kGCminPhi,kGCmaxPhi);
1567       histograms->AddMappingHistograms(kGCnPhiIndex,kGCnRIndex,kGCnXBinsMapping,kGCfirstXBinMapping,kGClastXBinMapping,kGCnYBinsMapping,kGCfirstYBinMapping,kGClastYBinMapping);
1568       //      histograms->AddMappingHistograms(kGCnPhiIndex,kGCnRIndex,kGCnXBinsMapping,kGCminRadius,kGCmaxRadius,kGCnYBinsMapping,kGCminPhi,kGCmaxPhi);
1569     }
1570                 
1571     if(kGCplotResolutiondPt == kTRUE){histograms->AddHistogram("Resolution_dPt" ,"" , kGCnXBinsResdPt, kGCfirstXBinResdPt, kGClastXBinResdPt, kGCnYBinsResdPt, kGCfirstYBinResdPt, kGClastYBinResdPt, "", "");}
1572     if(kGCplotResolutiondR == kTRUE){histograms->AddHistogram("Resolution_dR" ,"" , kGCnXBinsResdR, kGCfirstXBinResdR, kGClastXBinResdR, kGCnYBinsResdR, kGCfirstYBinResdR, kGClastYBinResdR, "", "");}
1573     if(kGCplotResolutiondZ == kTRUE){histograms->AddHistogram("Resolution_dZ" ,"" , kGCnXBinsResdZ, kGCfirstXBinResdZ, kGClastXBinResdZ, kGCnYBinsResdZ, kGCfirstYBinResdZ, kGClastYBinResdZ, "", "");}
1574                 
1575     if(kGCplotResolutiondRdPt == kTRUE){histograms->AddHistogram("Resolution_dR_dPt" ,"" , kGCnXBinsResdRdPt, kGCfirstXBinResdRdPt, kGClastXBinResdRdPt, kGCnYBinsResdRdPt, kGCfirstYBinResdRdPt, kGClastYBinResdRdPt, "", "");}
1576                 
1577     if(kGCplotResolutionMCPt == kTRUE){histograms->AddHistogram("Resolution_MC_Pt" ,"" , kGCnXBinsResPt, kGCfirstXBinResPt, kGClastXBinResPt,"","");}
1578     if(kGCplotResolutionMCR == kTRUE){histograms->AddHistogram("Resolution_MC_R" ,"" , kGCnXBinsResR, kGCfirstXBinResR, kGClastXBinResR,"","");}
1579     if(kGCplotResolutionMCZ == kTRUE){histograms->AddHistogram("Resolution_MC_Z" ,"" , kGCnXBinsResZ, kGCfirstXBinResZ, kGClastXBinResZ,"","");}
1580                 
1581     if(kGCplotResolutionESDPt == kTRUE){histograms->AddHistogram("Resolution_ESD_Pt" ,"" , kGCnXBinsResPt, kGCfirstXBinResPt, kGClastXBinResPt,"","");}
1582     if(kGCplotResolutionESDR == kTRUE){histograms->AddHistogram("Resolution_ESD_R" ,"" , kGCnXBinsResR, kGCfirstXBinResR, kGClastXBinResR,"","");}
1583     if(kGCplotResolutionESDZ == kTRUE){histograms->AddHistogram("Resolution_ESD_Z" ,"" , kGCnXBinsResZ, kGCfirstXBinResZ, kGClastXBinResZ,"","");}
1584                 
1585     if(kGCplotESDNumberOfV0s == kTRUE){histograms->AddHistogram("ESD_NumberOfV0s","Number of v0s",100, 0, 100,"","");}
1586     if(kGCplotESDNumberOfSurvivingV0s == kTRUE){histograms->AddHistogram("ESD_NumberOfSurvivingV0s","Number of surviving v0s",100, 0, 100,"","");}
1587                 
1588     //  debug histograms
1589     if(kGCplotESDCutGetOnFly == kTRUE){histograms->AddHistogram("ESD_CutGetOnFly_InvMass" ,"Not GetOnFly" , kGCnXBinsGammaMass, kGCfirstXBinGammaMass, kGClastXBinGammaMass,"","");}
1590     if(kGCplotESDCutNContributors == kTRUE){histograms->AddHistogram("ESD_CutNContributors_InvMass" ,"NContributors <= 0" , kGCnXBinsGammaMass, kGCfirstXBinGammaMass, kGClastXBinGammaMass,"","");}
1591     if(kGCplotESDCutLikeSign == kTRUE){histograms->AddHistogram("ESD_CutLikeSign_InvMass" ,"LikeSign" , kGCnXBinsGammaMass, kGCfirstXBinGammaMass, kGClastXBinGammaMass,"","");}
1592     if(kGCplotESDCutRefit == kTRUE){histograms->AddHistogram("ESD_CutRefit_InvMass" ,"No TPC refit" , kGCnXBinsGammaMass, kGCfirstXBinGammaMass, kGClastXBinGammaMass,"","");}
1593     if(kGCplotESDCutKink == kTRUE){histograms->AddHistogram("ESD_CutKink_InvMass" ,"Kinks" , kGCnXBinsGammaMass, kGCfirstXBinGammaMass, kGClastXBinGammaMass,"","");}
1594     if(kGCplotESDCutPIDProb == kTRUE){histograms->AddHistogram("ESD_CutPIDProb_InvMass" ,"wrong TPC PID" , kGCnXBinsGammaMass, kGCfirstXBinGammaMass, kGClastXBinGammaMass,"","");}
1595
1596     if(kGCplotESDCutdedxSigmaElectronLine == kTRUE){histograms->AddHistogram("ESD_CutdEdxSigmaElectronLine_InvMass" ,"dedx ElectronLine" , kGCnXBinsGammaMass, kGCfirstXBinGammaMass, kGClastXBinGammaMass,"","");}
1597     if(kGCplotESDCutdedxSigmaPionLine == kTRUE){histograms->AddHistogram("ESD_CutdEdxSigmaPionLine_InvMass" ,"dedx PionLine" , kGCnXBinsGammaMass, kGCfirstXBinGammaMass, kGClastXBinGammaMass,"","");}
1598
1599     if(kGCplotESDCutR == kTRUE){histograms->AddHistogram("ESD_CutR_InvMass" ,"Above RMax" , kGCnXBinsGammaMass, kGCfirstXBinGammaMass, kGClastXBinGammaMass,"","");}
1600     if(kGCplotESDCutNDF == kTRUE){histograms->AddHistogram("ESD_CutNDF_InvMass" ,"NDF <= 0" , kGCnXBinsGammaMass, kGCfirstXBinGammaMass, kGClastXBinGammaMass,"","");}
1601     if(kGCplotESDCutChi2 == kTRUE){histograms->AddHistogram("ESD_CutChi2_InvMass" ,"#chi^{2} > Max" , kGCnXBinsGammaMass, kGCfirstXBinGammaMass, kGClastXBinGammaMass,"","");}
1602     if(kGCplotESDCutEta == kTRUE){histograms->AddHistogram("ESD_CutEta_InvMass" ,"Above #eta max" , kGCnXBinsGammaMass, kGCfirstXBinGammaMass, kGClastXBinGammaMass,"","");}
1603     if(kGCplotESDCutPt == kTRUE){histograms->AddHistogram("ESD_CutPt_InvMass" ,"Below p_{t} min" , kGCnXBinsGammaMass, kGCfirstXBinGammaMass, kGClastXBinGammaMass,"","");}
1604     if(kGCplotESDCutLine == kTRUE){histograms->AddHistogram("ESD_CutLine_InvMass" ,"Out of reconstruction area" , kGCnXBinsGammaMass, kGCfirstXBinGammaMass, kGClastXBinGammaMass,"","");}
1605     if(kGCplotESDGoodV0s == kTRUE){histograms->AddHistogram("ESD_GoodV0s_InvMass" ,"Good V0s" , kGCnXBinsGammaMass, kGCfirstXBinGammaMass, kGClastXBinGammaMass,"","");}
1606
1607     if(kGCplotESDTrueConvGammaTrackLength == kTRUE){histograms->AddHistogram("ESD_TrueConvGamma_TrackLength","Track length of TrueConvGamma",kGCnXBinsTrackLength,kGCfirstXBinTrackLength,kGClastXBinTrackLength,"","");}
1608     if(kGCplotESDTrueConvGammaTrackLengthVSInvMass == kTRUE){histograms->AddHistogram("ESD_TrueConvGamma_TrackLengthVSInvMass","Track length of TrueConvGamma vs Inv mass",kGCnXBinsTrackLength,kGCfirstXBinTrackLength,kGClastXBinTrackLength,kGCnXBinsPt, kGCfirstXBinPt, kGClastXBinPt,"","");}
1609                 
1610                 
1611     if(kGCplotPi0Spectra == kTRUE){
1612       histograms->AddHistogram("ESD_Mother_InvMass_vs_Pt" ,"Invariant Mass vs Pt" , kGCnXBinsSpectra, kGCfirstXBinSpectra, kGClastXBinSpectra,kGCnYBinsSpectra, kGCfirstYBinSpectra, kGClastYBinSpectra,"InvMass [GeV]","Pt [GeV]");
1613       histograms->AddHistogram("ESD_Mother_InvMass","Invariant mass",kGCnXBinsSpectra,kGCfirstXBinSpectra, kGClastXBinSpectra,"InvMass [GeV]","Counts");
1614
1615       histograms->AddHistogram("ESD_Mother_InvMass_vs_Pt_Fiducial" ,"Invariant Mass vs Pt |eta|<0.9" , kGCnXBinsSpectra, kGCfirstXBinSpectra, kGClastXBinSpectra,kGCnYBinsSpectra, kGCfirstYBinSpectra, kGClastYBinSpectra,"InvMass [GeV]","Pt [GeV]");
1616       histograms->AddHistogram("ESD_Mother_InvMass_Fiducial","Invariant mass |eta|<0.9",kGCnXBinsSpectra,kGCfirstXBinSpectra, kGClastXBinSpectra,"InvMass [GeV]","Counts");
1617
1618
1619     }
1620     if(kGCplotPi0Spectra == kTRUE && kGCcalculateBackground == kTRUE){
1621       histograms->AddHistogram("ESD_Background_InvMass_vs_Pt" ,"Background Invariant Mass vs Pt" , kGCnXBinsSpectra, kGCfirstXBinSpectra, kGClastXBinSpectra,kGCnYBinsSpectra, kGCfirstYBinSpectra, kGClastYBinSpectra,"InvMass [GeV]","Pt [GeV]");
1622       histograms->AddHistogram("ESD_Background_InvMass","Invariant mass background",kGCnXBinsSpectra,kGCfirstXBinSpectra, kGClastXBinSpectra,"InvMass BG [GeV]","Counts");
1623
1624       histograms->AddHistogram("ESD_Background_InvMass_vs_Pt_Fiducial" ,"Background Invariant Mass vs Pt |eta|<0.9" , kGCnXBinsSpectra, kGCfirstXBinSpectra, kGClastXBinSpectra,kGCnYBinsSpectra, kGCfirstYBinSpectra, kGClastYBinSpectra,"InvMass [GeV]","Pt [GeV]");
1625       histograms->AddHistogram("ESD_Background_InvMass_Fiducial","Invariant mass background |eta|<0.9",kGCnXBinsSpectra,kGCfirstXBinSpectra, kGClastXBinSpectra,"InvMass BG [GeV]","Counts");
1626
1627     }
1628   }// end kGCrunNeutralMeson
1629 }