]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWG4/macros/ConfigGammaConversion.C
1b9f24771e9159962cbf22dbf3d1fb7449cd4d5d
[u/mrichter/AliRoot.git] / PWG4 / macros / ConfigGammaConversion.C
1 /** VERSION NUMBER 1.1 */
2
3 /**************************************************************************
4  * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
5  *                                                                        *
6  * Author: Ana Marin, Kathrin Koch, Kenneth Aamodt
7  * Contact: kenneth.aamodt@cern.ch
8  * Version 1.1                                                            *
9  *                                                                        *
10  * Permission to use, copy, modify and distribute this software and its   *
11  * documentation strictly for non-commercial purposes is hereby granted   *
12  * without fee, provided that the above copyright notice appears in all   *
13  * copies and that both the copyright notice and this permission notice   *
14  * appear in the supporting documentation. The authors make no claims     *
15  * about the suitability of this software for any purpose. It is          *
16  * provided "as is" without express or implied warranty.                  *
17  **************************************************************************/
18 const int c_array_size = 10;
19
20 class AliAnalysisDataContainer;
21 class AliGammaConversionHistograms;
22 class AliAnalysisTaskGammaConversion;
23
24 // set this to a number if you want to analyze a set number of files
25 // if it is 0 it will analyze the files listed in the data list
26 Int_t kGCnumberOfFilesToAnalyze=0;
27
28 Bool_t kGCrunNeutralMeson = kTRUE;
29 Bool_t kGCrunJet          = kFALSE;
30 Bool_t kGCrunChic         = kFALSE;
31 Bool_t kGCrunCF           = kFALSE;
32 Bool_t kGCcalculateBackground = kTRUE;
33 Bool_t kGCdoNeutralMesonV0MCCheck =kFALSE;
34 Bool_t kGCrunOmegaMeson = kFALSE;
35 Bool_t kGCrunRES = kFALSE;
36
37 /** ---------------------------------- define cuts here ------------------------------------*/
38
39 TString kGCAnalysisCutSelectionId="9010111000"; // do not cheange here, use -set-cut-selection in argument instead
40
41 Int_t kGCpidOfNegativeTrack=11;
42 Int_t kGCpidOfPositiveTrack=-11;
43
44 Double_t kGCmaxRCut   = 180.;
45 Double_t kGCetaCut    = 0.9;
46 Double_t kGCptCut     = 0.02;
47 Double_t kGCsingleptCut = 0.02;
48 Double_t kGCmaxZCut     = 240.;
49 Double_t kGCminClsTPCCut= 0.;
50 Double_t kGCchi2CutConversion   = 30.;
51 Double_t kGCchi2CutMeson   = 50.;
52
53 Double_t kGCLineCutZRSlope = tan(2*atan(exp(-kGCetaCut)));
54 Double_t kGCLineCutZValue = 7.;
55
56
57 Double_t kGCxVertexCut = 0.;
58 Double_t kGCyVertexCut = 0.;
59 Double_t kGCzVertexCut = 0.;
60
61 Double_t kGCsigmaCutGammaMass=0.0001;
62
63 Bool_t kGCuseImprovedVertex = kTRUE;
64
65 Bool_t kGCUseOnFlyV0Finder = kTRUE;
66
67 // define masses of different particles, this will be used by the KF particle
68 // together with the width to set mass constraints. Units in GeV.
69 Double_t kGCelectronMass = 0.00051099892;
70 Double_t kGCgammaMass    = 0.;
71 Double_t kGCpi0Mass      = 0.1349766;
72 Double_t kGCetaMass      = 0.54751;
73
74 // define the width constraint used by KF particle.
75 Double_t kGCgammaWidth = 0.01;
76 Double_t kGCpi0Width   = 0.01;
77 Double_t kGCetaWidth   = 0.01;
78
79 // define the probability of track being an electron
80 Double_t kGCprobElectron = 0.000;
81
82 Double_t kGCminOpeningAngleGhostCut = 0.005;
83
84 /** ----------------------------------end define cuts here----------------------------------*/
85
86 /** -------------------------------- Phi/R Mapping ---------------------------------------*/
87 Int_t kGCnPhiIndex = 8;
88 Int_t kGCnRIndex   = 14;
89
90 Double_t kGCminRadius   = 0.;
91 Double_t kGCmaxRadius   = 200.;
92 Double_t kGCminPhi      = -TMath::Pi();
93 Double_t kGCmaxPhi      = TMath::Pi();
94 /** ------------------------------- end Phi/R Mapping ------------------------------------*/
95
96 Bool_t kGCdoOwnXYZCalculation = kFALSE;
97
98 Bool_t kGCWriteStandardAOD =kFALSE; // need to be true for train running? CKB
99
100 /** ------------------- define which histograms to plot here --------------------------------*/
101 /**   NB: to change the bin numbers, see below the histogram flags                           */
102
103 // NEUTRAL MESON PLOTS
104 Bool_t kGCplotMCConversionR             = kTRUE;
105 Bool_t kGCplotMCConversionZR            = kTRUE;
106 Bool_t kGCplotMCConversionXY            = kTRUE;
107 Bool_t kGCplotMCConversionOpeningAngle  = kTRUE;
108 Bool_t kGCplotMCConvGammaEAsymmetryP    = kTRUE;
109 Bool_t kGCplotMCConvGammaPAsymmetryP    = kTRUE;
110
111
112 Bool_t kGCplotMCEEnergy  = kFALSE;
113 Bool_t kGCplotMCEPt      = kTRUE;
114 Bool_t kGCplotMCEEta     = kTRUE;
115 Bool_t kGCplotMCEPhi     = kTRUE;
116 Bool_t kGCplotMCENTPCClusters = kTRUE;
117 Bool_t kGCplotMCENITSClusters = kTRUE;
118
119 Bool_t kGCplotMCPEnergy  = kFALSE;
120 Bool_t kGCplotMCPPt      = kTRUE;
121 Bool_t kGCplotMCPEta     = kTRUE;
122 Bool_t kGCplotMCPPhi     = kTRUE;
123 Bool_t kGCplotMCPNTPCClusters = kTRUE;
124 Bool_t kGCplotMCPNITSClusters = kTRUE;
125
126 Bool_t kGCplotMCallGammaEnergy = kFALSE;
127 Bool_t kGCplotMCallGammaPt     = kTRUE;
128 Bool_t kGCplotMCallGammaEta    = kTRUE;
129 Bool_t kGCplotMCallGammaPhi    = kTRUE;
130 Bool_t kGCplotMCallGammaRapid  = kTRUE;
131
132
133 Bool_t kGCplotMCConvGammaEnergy  = kFALSE;
134 Bool_t kGCplotMCConvGammaPt      = kTRUE;
135 Bool_t kGCplotMCConvGammaEta     = kTRUE;
136 Bool_t kGCplotMCConvGammaPhi     = kTRUE;
137 Bool_t kGCplotMCConvGammaRapid   = kTRUE;
138 Bool_t kGCplotMCConvGammaPtvsEta = kTRUE;
139
140 Bool_t kGCplotMCallDirectGammaEnergy  = kFALSE;
141 Bool_t kGCplotMCallDirectGammaPt      = kTRUE;
142 Bool_t kGCplotMCallDirectGammaEta     = kTRUE;
143 Bool_t kGCplotMCallDirectGammaPhi     = kTRUE;
144 Bool_t kGCplotMCallDirectGammaRapid   = kTRUE;
145
146 Bool_t kGCplotMCConvDirectGammaEnergy  = kFALSE;
147 Bool_t kGCplotMCConvDirectGammaPt      = kTRUE;
148 Bool_t kGCplotMCConvDirectGammaEta     = kTRUE;
149 Bool_t kGCplotMCConvDirectGammaPhi     = kTRUE;
150 Bool_t kGCplotMCConvDirectGammaRapid   = kTRUE;
151
152 Bool_t kGCplotMCMotherEta                                       = kTRUE;
153 Bool_t kGCplotMCMotherRapid                                = kTRUE;
154 Bool_t kGCplotMCMotherPhi                                       = kTRUE;
155 Bool_t kGCplotMCMotherPt                                        = kTRUE;
156 Bool_t kGCplotMCMotherEnergy                            = kFALSE;
157 Bool_t kGCplotMCMotherMass                                      = kTRUE;
158 Bool_t kGCplotMCMotherOpeningAngle                              = kTRUE;
159 Bool_t kGCplotMCMotherR                                 = kTRUE;
160 Bool_t kGCplotMCMotherZR                                        = kFALSE;
161 Bool_t kGCplotMCMotherXY                                        = kFALSE;
162 Bool_t kGCplotMCMotherPtvsEtaWithinAcceptance              = kTRUE;
163 Bool_t kGCplotMCMotherPtvsRapidWithinAcceptance            = kTRUE;
164 Bool_t kGCplotMCMotherPtvsEtaConvGammaWithinAcceptance     = kTRUE;
165 Bool_t kGCplotMCMotherPtvsRapidConvGammaWithinAcceptance   = kTRUE;
166 Bool_t kGCplotMCMotherSpectra                           = kTRUE;
167
168 Bool_t kGCplotMCPi0Eta                                  = kTRUE;
169 Bool_t kGCplotMCPi0Rapid                                   = kTRUE;
170 Bool_t kGCplotMCPi0Phi                                     = kTRUE;
171 Bool_t kGCplotMCPi0Pt                                      = kTRUE;
172 Bool_t kGCplotMCPi0PtFiducial                              = kTRUE;
173 Bool_t kGCplotMCPi0PtWithinAcceptanceFiducial              = kTRUE;
174 Bool_t kGCplotMCPi0PtConvGammaWithinAcceptanceFiducial     = kTRUE;
175 Bool_t kGCplotMCPi0Energy                                  = kFALSE;
176 Bool_t kGCplotMCPi0Mass                                    = kTRUE;
177 Bool_t kGCplotMCPi0Alpha                                   = kTRUE;
178 Bool_t kGCplotMCPi0OpeningAngle                            = kTRUE;
179 Bool_t kGCplotMCPi0R                                       = kTRUE;
180 Bool_t kGCplotMCPi0ZR                                      = kFALSE;
181 Bool_t kGCplotMCPi0XY                                      = kFALSE;
182 Bool_t kGCplotMCPi0PtvsEtaWithinAcceptance                 = kTRUE;
183 Bool_t kGCplotMCPi0PtvsRapidWithinAcceptance               = kTRUE;
184 Bool_t kGCplotMCPi0PtvsEtaConvGammaWithinAcceptance        = kTRUE;
185 Bool_t kGCplotMCPi0PtvsRapidConvGammaWithinAcceptance      = kTRUE;
186 Bool_t kGCplotMCPi0ZRConvGammaWithinAcceptance          = kTRUE;
187
188 Bool_t kGCplotMCPi0SecondaryEta                                = kTRUE;
189 Bool_t kGCplotMCPi0SecondaryRapid                              = kTRUE;
190 Bool_t kGCplotMCPi0SecondaryPhi                                = kTRUE;
191 Bool_t kGCplotMCPi0SecondaryPt                                 = kTRUE;
192 Bool_t kGCplotMCPi0SecondaryEnergy                             = kFALSE;
193 Bool_t kGCplotMCPi0SecondaryMass                               = kTRUE;
194 Bool_t kGCplotMCPi0SecondaryOpeningAngle                       = kTRUE;
195 Bool_t kGCplotMCPi0SecondaryR                                  = kTRUE;
196 Bool_t kGCplotMCPi0SecondaryZR                                 = kFALSE;
197 Bool_t kGCplotMCPi0SecondaryXY                                 = kFALSE;
198 Bool_t kGCplotMCPi0SecondaryPtvsEtaWithinAcceptance            = kTRUE;
199 Bool_t kGCplotMCPi0SecondaryPtvsRapidWithinAcceptance          = kTRUE;
200 Bool_t kGCplotMCPi0SecondaryPtvsEtaConvGammaWithinAcceptance   = kTRUE;
201 Bool_t kGCplotMCPi0SecondaryPtvsRapidConvGammaWithinAcceptance = kTRUE;
202
203 Bool_t kGCplotMCEtaEta                                = kTRUE;
204 Bool_t kGCplotMCEtaRapid                              = kTRUE;
205 Bool_t kGCplotMCEtaPhi                                = kTRUE;
206 Bool_t kGCplotMCEtaPt                                 = kTRUE;
207 Bool_t kGCplotMCEtaEnergy                             = kFALSE;
208 Bool_t kGCplotMCEtaMass                               = kTRUE;
209 Bool_t kGCplotMCEtaOpeningAngleGamma                  = kTRUE;
210 Bool_t kGCplotMCEtaR                                  = kTRUE;
211 Bool_t kGCplotMCEtaZR                                 = kFALSE;
212 Bool_t kGCplotMCEtaXY                                 = kFALSE;
213 Bool_t kGCplotMCEtaPtvsEtaWithinAcceptance                 = kTRUE;
214 Bool_t kGCplotMCEtaPtvsRapidWithinAcceptance       = kTRUE;
215 Bool_t kGCplotMCEtaPtvsEtaConvGammaWithinAcceptance   = kTRUE;
216 Bool_t kGCplotMCEtaPtvsRapidConvGammaWithinAcceptance = kTRUE;
217 Bool_t kGCplotMCEtaZRConvGammaWithinAcceptance = kTRUE;
218
219 // Histograms from esd tracks
220 Bool_t kGCplotESDConversionR                   = kTRUE;
221 Bool_t kGCplotESDConversionZR                  = kTRUE;
222 Bool_t kGCplotESDConversionXY                  = kTRUE;
223 Bool_t kGCplotESDConversionOpeningAngle        = kTRUE;
224 Bool_t kGCplotESDConvGammaCosPointingAngle     = kTRUE;
225 Bool_t kGCplotESDConvGammaDcaDaugthers         = kTRUE;
226 Bool_t kGCplotESDConvGammaNormDcaDistDaugthers = kTRUE;
227 Bool_t kGCplotESDConvGammaLikelihoodAP         = kTRUE;
228 Bool_t kGCplotESDConvGammaEAsymmetryP         = kTRUE;
229 Bool_t kGCplotESDConvGammaPAsymmetryP         = kTRUE;
230 Bool_t kGCplotESDConvGammaEdEdxP         = kTRUE;
231 Bool_t kGCplotESDConvGammaPdEdxP         = kTRUE;
232 Bool_t kGCplotESDConvGammaQtAlfa         = kTRUE;
233
234
235 Bool_t kGCplotESDEEnergy = kFALSE;
236 Bool_t kGCplotESDEPt     = kTRUE;
237 Bool_t kGCplotESDEEta    = kTRUE;
238 Bool_t kGCplotESDEPhi    = kTRUE;
239 Bool_t kGCplotESDENTPCClusters = kTRUE;
240 Bool_t kGCplotESDENITSClusters = kTRUE;
241
242 Bool_t kGCplotESDPEnergy = kFALSE;
243 Bool_t kGCplotESDPPt     = kTRUE;
244 Bool_t kGCplotESDPEta    = kTRUE;
245 Bool_t kGCplotESDPPhi    = kTRUE;
246 Bool_t kGCplotESDPNTPCClusters = kTRUE;
247 Bool_t kGCplotESDPNITSClusters = kTRUE;
248
249 Bool_t kGCplotESDConvGammaEnergy = kFALSE;
250 Bool_t kGCplotESDConvGammaPt     = kTRUE;
251 Bool_t kGCplotESDConvGammaEta    = kTRUE;
252 Bool_t kGCplotESDConvGammaPhi    = kTRUE;
253 Bool_t kGCplotESDConvGammaMass   = kTRUE;
254 Bool_t kGCplotESDConvGammaWidth  = kTRUE;
255 Bool_t kGCplotESDConvGammaChi2   = kTRUE;
256 Bool_t kGCplotESDConvGammaNDF    = kTRUE;
257 Bool_t kGCplotESDConvGammaRapid  = kTRUE;
258 Bool_t kGCplotESDConvGammaPtvsEta = kTRUE;
259 Bool_t kGCplotESDConvGammaPtvsChi2 = kTRUE;
260 Bool_t kGCplotESDConvGammaEtavsChi2 = kTRUE;
261
262
263 Bool_t kGCplotESDTrueDalitzContaminationR    = kTRUE;
264 Bool_t kGCplotESDTrueConvGammaEnergy         = kFALSE;
265 Bool_t kGCplotESDTrueConvGammaPt             = kTRUE;
266 Bool_t kGCplotESDTrueConvGammaEta            = kTRUE;
267 Bool_t kGCplotESDTrueConvGammaPhi            = kTRUE;
268 Bool_t kGCplotESDTrueConvGammaMass           = kTRUE;
269 Bool_t kGCplotESDTrueConvGammaWidth          = kTRUE;
270 Bool_t kGCplotESDTrueConvGammaChi2           = kTRUE;
271 Bool_t kGCplotESDTrueConvGammaNDF            = kTRUE;
272 Bool_t kGCplotESDTrueConvGammaRapid          = kTRUE;
273 Bool_t kGCplotESDTrueConvGammaPtvsEta        = kTRUE;
274 Bool_t kGCplotESDTrueConversionR             = kTRUE;
275 Bool_t kGCplotESDTrueConversionZR            = kFALSE;
276 Bool_t kGCplotESDTrueConversionXY            = kFALSE;
277 Bool_t kGCplotESDTrueConversionOpeningAngle  = kTRUE;
278 Bool_t kGCplotESDTrueConvGammaCosPointingAngle     = kTRUE;
279 Bool_t kGCplotESDTrueConvGammaDcaDaugthers         = kTRUE;
280 Bool_t kGCplotESDTrueConvGammaNormDcaDistDaugthers = kTRUE;
281 Bool_t kGCplotESDTrueConvGammaLikelihoodAP         = kTRUE;
282 Bool_t kGCplotESDTrueConvGammaEAsymmetryP         = kTRUE;
283 Bool_t kGCplotESDTrueConvGammaPAsymmetryP         = kTRUE;
284 Bool_t kGCplotESDTrueConvGammaEdEdxP         = kTRUE;
285 Bool_t kGCplotESDTrueConvGammaPdEdxP         = kTRUE;
286
287
288 Bool_t kGCplotESDTrueConvGammaPtvsChi2       = kTRUE;
289 Bool_t kGCplotESDTrueConvGammaEtavsChi2      = kTRUE;
290 Bool_t kGCplotESDTrueConvGammaMCPtEta        = kTRUE;
291 Bool_t kGCplotESDTrueConversionMCZR          = kFALSE;
292 Bool_t kGCplotESDTrueConversionMCXY          = kFALSE;
293
294 Bool_t kGCplotESDNoCutConvGammaEnergy         = kFALSE;
295 Bool_t kGCplotESDNoCutConvGammaPt             = kTRUE;
296 Bool_t kGCplotESDNoCutConvGammaEta            = kTRUE;
297 Bool_t kGCplotESDNoCutConvGammaPhi            = kTRUE;
298 Bool_t kGCplotESDNoCutConvGammaMass           = kTRUE;
299 Bool_t kGCplotESDNoCutConvGammaWidth          = kTRUE;
300 Bool_t kGCplotESDNoCutConvGammaChi2           = kTRUE;
301 Bool_t kGCplotESDNoCutConvGammaNDF            = kTRUE;
302 Bool_t kGCplotESDNoCutConvGammaRapid          = kTRUE;
303 Bool_t kGCplotESDNoCutConvGammaPtvsEta        = kTRUE;
304 Bool_t kGCplotESDNoCutConversionR             = kTRUE;
305 Bool_t kGCplotESDNoCutConversionZR            = kFALSE;
306 Bool_t kGCplotESDNoCutConversionXY            = kFALSE;
307 Bool_t kGCplotESDNoCutConversionOpeningAngle  = kTRUE;
308 Bool_t kGCplotESDNoCutConvGammaCosPointingAngle     = kTRUE;
309 Bool_t kGCplotESDNoCutConvGammaDcaDaugthers         = kTRUE;
310 Bool_t kGCplotESDNoCutConvGammaNormDcaDistDaugthers = kTRUE;
311 Bool_t kGCplotESDNoCutConvGammaLikelihoodAP         = kTRUE;
312
313 Bool_t kGCplotESDNoCutConvGammaEAsymmetryP         = kTRUE;
314 Bool_t kGCplotESDNoCutConvGammaPAsymmetryP         = kTRUE;
315 Bool_t kGCplotESDNoCutConvGammaEdEdxP         = kTRUE;
316 Bool_t kGCplotESDNoCutConvGammaPdEdxP         = kTRUE;
317 Bool_t kGCplotESDNoCutConvGammaPtvsChi2       = kTRUE;
318 Bool_t kGCplotESDNoCutConvGammaEtavsChi2      = kTRUE;
319 Bool_t kGCplotESDNoCutConvGammaMCPtEta        = kTRUE;
320 Bool_t kGCplotESDNoCutConversionMCZR          = kFALSE;
321 Bool_t kGCplotESDNoCutConversionMCXY          = kFALSE;
322
323 Bool_t kGCplotESDMotherOpeningAngleGamma = kTRUE;
324 Bool_t kGCplotESDMotherEnergy            = kFALSE;
325 Bool_t kGCplotESDMotherPt                = kFALSE;
326 Bool_t kGCplotESDMotherEta               = kTRUE;
327 Bool_t kGCplotESDMotherPhi               = kFALSE;
328 Bool_t kGCplotESDMotherMass              = kFALSE;
329 Bool_t kGCplotESDMotherR                 = kFALSE;
330 Bool_t kGCplotESDMotherZR                = kFALSE;
331 Bool_t kGCplotESDMotherXY                = kFALSE;
332 Bool_t kGCplotESDMotherRapid             = kTRUE;
333
334 Bool_t kGCplotESDBackgroundOpeningAngleGamma = kTRUE;
335 Bool_t kGCplotESDBackgroundEnergy            = kFALSE;
336 Bool_t kGCplotESDBackgroundPt                = kFALSE;
337 Bool_t kGCplotESDBackgroundEta               = kFALSE;
338 Bool_t kGCplotESDBackgroundPhi               = kFALSE;
339 Bool_t kGCplotESDBackgroundMass              = kFALSE;
340 Bool_t kGCplotESDBackgroundR                 = kFALSE;
341 Bool_t kGCplotESDBackgroundZR                = kFALSE;
342 Bool_t kGCplotESDBackgroundXY                = kFALSE;
343 Bool_t kGCplotESDBackgroundRapid             = kFALSE;
344
345 Bool_t kGCplotMapping = kTRUE;       
346
347 Bool_t kGCplotResolutiondPt = kTRUE;
348 Bool_t kGCplotResolutiondR  = kTRUE;
349 Bool_t kGCplotResolutiondZ  = kTRUE;
350
351 Bool_t kGCplotResolutiondRAbs  = kTRUE;
352 Bool_t kGCplotResolutiondZAbs  = kTRUE;
353 Bool_t kGCplotResolutiondPhiAbs  = kTRUE;
354
355 Bool_t kGCplotResolutiondRdPt = kTRUE;
356
357 Bool_t kGCplotResolutionMCPt = kTRUE;
358 Bool_t kGCplotResolutionMCR  = kTRUE;
359 Bool_t kGCplotResolutionMCZ  = kTRUE;
360
361 Bool_t kGCplotResolutionESDPt = kTRUE;
362 Bool_t kGCplotResolutionESDR  = kTRUE;
363 Bool_t kGCplotResolutionESDZ  = kTRUE;
364
365 Bool_t kGCplotResolutionPtdPt = kTRUE;
366
367 Bool_t kGCplotESDNumberOfV0s          = kTRUE;
368 Bool_t kGCplotESDNumberOfSurvivingV0s = kTRUE;
369 Bool_t kGCplotESDNumberOfContributorsVtx = kTRUE;
370 Bool_t kGCplotESDNumberOfGoodESDTracks = kTRUE;
371
372 //  debug histograms
373 Bool_t kGCplotESDCutGetOnFly      = kTRUE;
374 Bool_t kGCplotESDCutNContributors = kTRUE;
375 Bool_t kGCplotESDCutLikeSign      = kTRUE;
376 Bool_t kGCplotESDCutRefit         = kTRUE;
377 Bool_t kGCplotESDCutKink          = kTRUE;
378 Bool_t kGCplotESDCutPIDProb       = kTRUE;
379 Bool_t kGCplotESDCutdedxSigmaElectronLine=kTRUE;
380 Bool_t kGCplotESDCutdedxSigmaPionLine=kTRUE;
381 Bool_t kGCplotESDCutR             = kTRUE;
382 Bool_t kGCplotESDCutLine          = kTRUE;
383 Bool_t kGCplotESDCutZ             = kTRUE;
384 Bool_t kGCplotESDCutMinClsTPC     = kTRUE;
385 Bool_t kGCplotESDGoodV0s          = kTRUE;
386 Bool_t kGCplotESDAllV0s           = kTRUE;
387 Bool_t kGCplotESDAllV0sCurrentFinder = kTRUE;
388 Bool_t kGCplotESDAllV0sCurrentFinderQtAlfa = kTRUE;
389
390 Bool_t kGCplotESDCutNDF           = kTRUE;
391 Bool_t kGCplotESDCutChi2          = kTRUE;
392 Bool_t kGCplotESDCutEta           = kTRUE;
393 Bool_t kGCplotESDCutPt            = kTRUE;
394 Bool_t kGCplotESDTrueConvGammaTrackLength =kFALSE;
395 Bool_t kGCplotESDTrueConvGammaTrackLengthVSInvMass =kFALSE;
396
397 Bool_t kGCplotPi0Spectra = kTRUE;
398 Bool_t kGCplotEtaSpectra = kTRUE;
399 Bool_t kGCplotOmegaSpectra = kTRUE;
400
401 /////////////Chi_c Analysis//////////////////////////
402 Bool_t kGCplotStatsElectrons                                  = kTRUE;
403 Bool_t kGCplotRecENegJPsiPtDiff                               = kTRUE;
404 Bool_t kGCplotRecEPosJPsiPtDiff                               = kTRUE;
405 Bool_t kGCplotRecEPosENegR                                    = kTRUE;
406 Bool_t kGCplotRecEPosENegEta                                  = kTRUE;
407 Bool_t kGCplotESDInvMassePluseMinus                           = kTRUE;
408 Bool_t kGCplotESDInvMassGammaePluseMinusChiC                  = kTRUE;
409 Bool_t kGCplotESDInvMassGammaePluseMinusPi0                   = kTRUE;
410 Bool_t kGCplotESDElectronPosNegPt                             = kTRUE;
411 Bool_t kGCplotESDElectronPosNegEta                            = kTRUE;
412 Bool_t kGCplotESDElectronPosNegAngle                          = kTRUE;
413 Bool_t kGCplotMCElectronPosNegPt                              = kTRUE;
414 Bool_t kGCplotMCElectronPosNegEta                             = kTRUE;
415 Bool_t kGCplotMCElectronPosNegJPsiAngle                       = kTRUE;
416 Bool_t kGCplotESDElectronPosNegPi0Angle                       = kTRUE;
417 Bool_t kGCplotMCElectronPosNegPi0Angle                        = kTRUE;
418 Bool_t kGCplotTableElectrons                                  = kTRUE;
419 Bool_t kGCplotESDEPosBackground                               = kTRUE;
420 Bool_t kGCplotESDENegBackground                               = kTRUE;
421 Bool_t kGCplotESDEPosENegBackground                           = kTRUE;
422 Bool_t kGCplotESDEPosENegBackgroundCut                        = kTRUE;
423 Bool_t kGCplotESDePoseNegAngle                                = kTRUE;
424 Bool_t kGCplotESDEPosENegGammaBackgroundMX                    = kTRUE;
425 Bool_t kGCplotMCLabels                                        = kTRUE;
426 ///////////////////////////////////////////////////////////////////
427
428 //---------------- Gamma Jet analysis ----------------------------
429 Bool_t kGCplotdPhiHdrGam            = kTRUE;
430 Bool_t kGCplotdPhiHdrGamIsolated    = kTRUE;
431 Bool_t kGCplotMinimumIsoDistance    = kTRUE;
432 Bool_t kGCplotFFzHdrGam             = kTRUE;
433 Bool_t kGCplotImbalanceHdrGam       = kTRUE;
434 //----------------------------------------------------------------
435
436
437 /** ----------------- end define which histograms to plot here -------------------------------*/
438
439
440
441 /** ----------- Define the binning for the different plot types here -------------------------*/
442 //R-plots
443 Int_t kGCnXBinsR = 400;
444 Double_t kGCfirstXBinR = 0.;
445 Double_t kGClastXBinR = 200.;
446
447 //ZR-plots
448 Int_t kGCnXBinsZR = 1000;
449 Double_t kGCfirstXBinZR = -250.;
450 Double_t kGClastXBinZR = 250.;
451 Int_t kGCnYBinsZR = 400;
452 Double_t kGCfirstYBinZR = 0.;
453 Double_t kGClastYBinZR = 200.;
454
455 //XY-plots
456 Int_t kGCnXBinsXY = 800;
457 Double_t kGCfirstXBinXY = -200.;
458 Double_t kGClastXBinXY = 200.;
459 Int_t kGCnYBinsXY = 800;
460 Double_t kGCfirstYBinXY = -200.;
461 Double_t kGClastYBinXY = 200.;
462
463 //OpenAngle-plots
464 Int_t kGCnXBinsOpeningAngle = 400;
465 Double_t kGCfirstXBinOpeningAngle = 0.;
466 Double_t kGClastXBinOpeningAngle = TMath::Pi();
467
468 //CosPointingAngle-plots
469 Int_t kGCnXBinsCosPointingAngle = 400;
470 Double_t kGCfirstXBinCosPointingAngle = 0.99;
471 Double_t kGClastXBinCosPointingAngle = 1.01;
472
473 //DCA Daugthers-plots
474 Int_t kGCnXBinsDcaDaughters = 400;
475 Double_t kGCfirstXBinDcaDaughters= 0.;
476 Double_t kGClastXBinDcaDaughters = 5.;
477
478 //Norm DCA dist Daugthers-plots
479 Int_t kGCnXBinsNormDcaDistDaughters = 400;
480 Double_t kGCfirstXBinNormDcaDistDaughters= 0.;
481 Double_t kGClastXBinNormDcaDistDaughters = 10.;
482
483 //LikelihoodAP Plots
484 Int_t kGCnXBinsLikelihoodAP = 400;
485 Double_t kGCfirstXBinLikelihoodAP= 0.;
486 Double_t kGClastXBinLikelihoodAP = 2.;
487
488
489 //Energy-plots
490 Int_t kGCnXBinsEnergy = 200;
491 Double_t kGCfirstXBinEnergy = 0.;
492 Double_t kGClastXBinEnergy = 50.;
493
494 //P-plots
495 Int_t kGCnXBinsP = 200;
496 Double_t kGCfirstXBinP = 0.;
497 Double_t kGClastXBinP = 50.;
498
499 //dEdx-plots
500 Int_t kGCnYBinsdEdx = 200;
501 Double_t kGCfirstYBindEdx = 0.;
502 Double_t kGClastYBindEdx = 200.;
503
504 //Qt-plots
505 Int_t kGCnYBinsQt = 250;
506 Double_t kGCfirstYBinQt = 0.;
507 Double_t kGClastYBinQt = 0.25;
508
509
510
511 //Asymmetry-plots
512 Int_t kGCnYBinsAsymmetry = 200;
513 Double_t kGCfirstYBinAsymmetry = 0.;
514 Double_t kGClastYBinAsymmetry = 1.;
515
516
517 //Pt-plots
518 Int_t kGCnXBinsPt = 500;
519 Double_t kGCfirstXBinPt = 0.;
520 Double_t kGClastXBinPt = 50.;
521
522 //Eta-plots
523 Int_t kGCnXBinsEta = 40;
524 Double_t kGCfirstXBinEta = -2.;
525 Double_t kGClastXBinEta = 2.;
526
527 //Rapidity
528 Int_t kGCnXBinsRapid = 200;
529 Double_t kGCfirstXBinRapid = -10.;
530 Double_t kGClastXBinRapid = 10.;
531
532 //Phi-plots
533 Int_t kGCnXBinsPhi = 72;
534 Double_t kGCfirstXBinPhi = -TMath::Pi();
535 Double_t kGClastXBinPhi = TMath::Pi();
536
537 //nTPCCluster-plots
538 Int_t kGCnXBinsNTPCClusters = 201;
539 Double_t kGCfirstXBinNTPCClusters = -0.5;
540 Double_t kGClastXBinNTPCClusters = 200.5;
541
542 //nITSCluster-plots
543 Int_t kGCnXBinsNITSClusters = 7;
544 Double_t kGCfirstXBinNITSClusters = -0.5;
545 Double_t kGClastXBinNITSClusters = 6.5;
546
547
548
549 //Mapping-plots
550 Int_t kGCnXBinsMapping = 800;
551 Double_t kGCfirstXBinMapping = -100.;
552 Double_t kGClastXBinMapping = 100.;
553 Int_t kGCnYBinsMapping = 40;
554 Double_t kGCfirstYBinMapping = -2;
555 Double_t kGClastYBinMapping = 2;
556
557 //ResolutionPlots
558 //RESdPt
559 Int_t kGCnXBinsResdPt=1000;
560 Int_t kGCfirstXBinResdPt= 0;
561 Int_t kGClastXBinResdPt=100;
562 Int_t kGCnYBinsResdPt=500;
563 Int_t kGCfirstYBinResdPt= -10;
564 Int_t kGClastYBinResdPt=10;
565
566 //RESdR
567 Int_t kGCnXBinsResdR=500;
568 Int_t kGCfirstXBinResdR= 0;
569 Int_t kGClastXBinResdR=250;
570 Int_t kGCnYBinsResdR=100;
571 Int_t kGCfirstYBinResdR= -25;
572 Int_t kGClastYBinResdR=25;
573
574 //RESdZ
575 Int_t kGCnXBinsResdZ=80;
576 Int_t kGCfirstXBinResdZ= -20;
577 Int_t kGClastXBinResdZ=20;
578 Int_t kGCnYBinsResdZ=80;
579 Int_t kGCfirstYBinResdZ= -20;
580 Int_t kGClastYBinResdZ=20;
581
582 //RESdRdPt
583 Int_t kGCnYBinsResdRdPt=400;
584 Int_t kGCfirstYBinResdRdPt= -10;
585 Int_t kGClastYBinResdRdPt=10;
586
587 //RESMCPt
588 Int_t kGCnXBinsResPt=500;
589 Int_t kGCfirstXBinResPt= 0;
590 Int_t kGClastXBinResPt=100;
591
592 //RESMCR
593 Int_t kGCnXBinsResR=500;
594 Int_t kGCfirstXBinResR= 0;
595 Int_t kGClastXBinResR=250;
596
597 //RESMCZ
598 Int_t kGCnXBinsResZ=500;
599 Int_t kGCfirstXBinResZ= 0;
600 Int_t kGClastXBinResZ=250;
601
602 //GammaMass-plots
603 Int_t kGCnXBinsGammaMass = 4000;
604 Double_t kGCfirstXBinGammaMass = 0.;
605 Double_t kGClastXBinGammaMass = 1.;
606
607 //Pi0Mass-plots
608 Int_t kGCnXBinsPi0Mass = 1000;
609 Double_t kGCfirstXBinPi0Mass = 0.;
610 Double_t kGClastXBinPi0Mass = 1.;
611 Double_t kGCfirstXBinPi0Alpha = -1.;
612 Double_t kGClastXBinPi0Alpha = 1.;
613
614
615 //EtaMass-plots
616 Int_t kGCnXBinsEtaMass = 1000;
617 Double_t kGCfirstXBinEtaMass = 0.;
618 Double_t kGClastXBinEtaMass = 1.;
619
620 //GammaWidth-plots
621 Int_t kGCnXBinsGammaWidth = 100;
622 Double_t kGCfirstXBinGammaWidth = 0.;
623 Double_t kGClastXBinGammaWidth = 1.;
624
625 //GammaChi2-plots
626 Int_t kGCnXBinsGammaChi2 = 100;
627 Double_t kGCfirstXBinGammaChi2 = 0;
628 Double_t kGClastXBinGammaChi2 = 200.;
629
630 //GammaNDF-plots
631 Int_t kGCnXBinsGammaNDF = 10;
632 Double_t kGCfirstXBinGammaNDF = 0.;
633 Double_t kGClastXBinGammaNDF = 10.;
634
635 //Spectra-plots
636 Int_t kGCnXBinsSpectra = 1000;
637 Double_t kGCfirstXBinSpectra = 0.;
638 Double_t kGClastXBinSpectra = 1.;
639 Int_t kGCnYBinsSpectra = 250;
640 Double_t kGCfirstYBinSpectra = 0.;
641 Double_t kGClastYBinSpectra = 25.;
642
643 Double_t kGCfirstXBinAlpha = -1.;
644 Double_t kGClastXBinAlpha = 1.;
645
646 //track length plots
647 Int_t kGCnXBinsTrackLength = 1000;
648 Double_t kGCfirstXBinTrackLength = 0;
649 Double_t kGClastXBinTrackLength = 500;
650
651 /////////Chic_Analysis///////////////////////////////////
652 Int_t kGCnXBinsEPt = 1000;
653 Double_t kGCfirstXBinEPt = 0.;
654 Double_t kGClastXBinJPsiPt  = 10;
655
656 Int_t kGCnXBinsJPsiMass = 1000;
657 Double_t kGCfirstXBinJPsiMass = 0.;
658 Double_t kGClastXBinJPsiMass = 10.;
659
660 Int_t kGCnXBinsChicMass = 1000;
661 Double_t kGCfirstXBinChicMass = 0.;
662 Double_t kGClastXBinChicMass  = 10.;
663
664 Int_t kGCnXBinsPi0Mass  = 1000;
665 Double_t kGCfirstXBinPi0Mass = 0.;
666 Double_t kGClastXBinPi0Mass  = 1.;
667
668 Int_t kGCnXBinsEPosNegPt = 1000;
669 Double_t kGCfirstXBinEPosNegPt = 0.;
670 Double_t kGClastXBinEPosNegPt  = 10.;
671
672 Int_t kGCnXBinsEPosNegEta = 200;
673 Double_t kGCfirstXBinEPosNegEta = -1.2;
674 Double_t kGClastXBinEPosNegEta  = 1.2;
675
676 Int_t kGCnXBinsEPosNegAngle = 200;
677 Double_t kGCfirstXBinEPosNegAngle = 0.;
678 Double_t kGClastXBinEPosNegAngle = TMath::Pi();
679
680 Int_t kGCnXBinsEBackground = 1000;
681 Double_t kGCfirstXBinEBackground = 0.;
682 Double_t kGClastXBinEBackground  = 10.;
683
684 Int_t kGCnXBinsEBackgroundCut = 100;
685 Double_t kGCfirstXBinEBackgroundCut = 0.;
686 Double_t kGClastXBinEBackgroundCut  = 0.015.;
687
688 Int_t kGCnXBinsMCLabels = 10;
689 Double_t kGCfirstXBinMCLabels = 0.;
690 Double_t kGClastXBinMCLabels  = 10.;
691
692 Int_t kGCnElementsElectronTable = 19;
693
694 //18 elements
695 const char * kGCelectronTable[] = {
696   "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",
697   "ESDtracks",    "Kink Cut",
698   "Vertex Cut","TRDOut","TRDrefit","TPCrefit",
699   "ITSrefit","TRDout+TPC+TPC+ITS+nsigma>3 Pass","pid!=0","ESDElec","ESD e+ JPsi",
700   "ESD e- JPsi","ESD e+ e- JPSI","MC: gamma < 1.2","e+,e- < 0.9 g <1.2"
701 };
702
703
704 // for Gamma Jet analysis
705 Int_t kGCnXBinsdphiHdrGam = 100;
706 Double_t kGCfirstXBindphiHdrGam = -TMath::PiOver2();
707 Double_t kGClastXBindphiHdrGam = 3*TMath::PiOver2();
708
709 Int_t kGCnXBinsMinimumIsoDistance = 100;
710 Double_t kGCfirstXBinMinimumIsoDistance = 0.;
711 Double_t kGClastXBinMinimumIsoDistance = TMath::PiOver2();
712
713 Int_t kGCnXBinsFFzHdrGam = 100;
714 Double_t kGCfirstXBinFFzHdrGam = 0.;
715 Double_t kGClastXBinFFzHdrGam = 5;
716
717 Int_t kGCnXBinsImbalanceHdrGam = 100;
718 Double_t kGCfirstXBinImbalanceHdrGam = -5.;
719 Double_t kGClastXBinImbalanceHdrGam = 5.;
720 ////////////////////////////////////////////////////////
721
722
723 /** ---------- end Define the binning for the different plot types here ----------------------*/
724
725
726 /************************************************************************************************
727  *                                                                                              *
728  *                                                                                              *
729  *                     EVERYTHING BELOW IS FOR DEVELOPERS ONLY                                  *
730  *                                                                                              *
731  *                                                                                              *
732  ************************************************************************************************/
733 TString kGCoutputFileName = "histogramsGammaConversion";
734 TString kGCoutputFileAppendix = "";
735 TString kGCdataList = "";
736 Bool_t kGCwriteNtuple = kFALSE;
737 // WE DOO NOT NEED TO CHANGE THIS (kGCusePWG4PartCorr) ANYMORE SINCE IT IS TAKEN CARE OF AUTOMATICALLY NOW
738 Bool_t kGCusePWG4PartCorr = kTRUE;
739
740 /** Flag to enable running on train  */
741 Bool_t kGCrunOnTrain = kFALSE;
742
743 /** ------------------------------ Monte Carlo flag -----------------------------------------*/
744 Bool_t kGCdoMCTruth = kTRUE;
745 /** ---------------------------- end Monte Carlo flag ---------------------------------------*/
746
747 /** ------------------------------ Selecting trigger CINT1B -----------------------------------*/
748 Bool_t kGCtriggerCINT1B = kFALSE;
749 /** ---------------------------- end Monte Carlo flag ---------------------------------------*/
750
751 /** ------------------------- Choose KFParticle OR ESDTrack  --------------------------------*/
752 Bool_t kGCuseKFParticle = kTRUE;
753 Bool_t kGCuseESDTrack   = kFALSE;
754 /** ----------------------- end Choose KFParticle OR ESDTrack  -----------------------------*/
755
756 /**------------------------------Flag to apply dEdx cut base on sigmas to electron line----------*/
757 Bool_t kGCdodEdxSigmaCut= kTRUE;
758 /**------------------------------end Flag to apply NsigmadEdx cut ----------*/
759 Double_t kGCPIDnSigmaAboveElectronLine=5;
760 Double_t kGCPIDnSigmaBelowElectronLine=-3;
761 Double_t kGCPIDnSigmaAbovePionLine=0;
762 Double_t kGCPIDMinPnSigmaAbovePionLine=1;
763  
764
765
766
767 Bool_t scanArguments(TString arguments){
768   
769   Bool_t iResult = kTRUE;
770         
771   TString allArgs=arguments;
772   TString argument;
773   int bMissingParam=0;
774
775   cout<<"Arguments received: "<<allArgs.Data()<<endl;
776         
777   TObjArray* pTokens=allArgs.Tokenize(" ");
778   if (pTokens) {
779                 
780     for(int i=0; i<pTokens->GetEntries() && iResult==kTRUE; i++) {
781       argument=((TObjString*)pTokens->At(i))->GetString();
782                         
783       if(argument.IsNull()) continue;
784       // -- deconvolute-time option
785       if(argument.CompareTo("-data-list") == 0){
786         if((bMissingParam=(++i>=pTokens->GetEntries()))) break;
787         kGCdataList = ((TObjString*)pTokens->At(i))->GetString();
788         if(kGCdataList.IsNull()){
789           cout<<"-data-list is NULL"<<endl;
790           iResult=kFALSE;
791         }
792         else{
793           cout<<"Data list is set to: "<<kGCdataList<<endl;
794         }
795       }
796       else if(argument.CompareTo("-output-file-name") == 0){
797         if((bMissingParam=(++i>=pTokens->GetEntries()))) break;
798         kGCoutputFileName = ((TObjString*)pTokens->At(i))->GetString();
799         if(kGCoutputFileName.IsNull()){
800           cout<<"-output-file-name is NULL"<<endl;
801           iResult=kFALSE;
802         }
803         else{
804           cout<<"Setting output file name to: "<<kGCoutputFileName<<endl;
805         }
806       }
807       else if (argument.CompareTo("-bg-off") == 0){
808         kGCcalculateBackground =kFALSE;
809       }
810       else if (argument.CompareTo("-check-neutralmeson-pi0s") == 0){
811         kGCdoNeutralMesonV0MCCheck=kTRUE;
812       }
813       else if (argument.CompareTo("-use-offline-finder") == 0){
814         kGCUseOnFlyV0Finder = kFALSE;
815       }
816       else if (argument.CompareTo("-write-ntuple") == 0){
817         cout<<"Writing ntuple to file."<<endl;
818         kGCwriteNtuple = kTRUE;
819       }
820       else if (argument.CompareTo("-run-on-train") == 0){
821         cout<<"Running on train"<<endl;
822         kGCWriteStandardAOD=kTRUE;
823         kGCrunOnTrain = kTRUE;
824       }
825       else if (argument.CompareTo("-run-on-gsi-train") == 0){
826         cout<<"Running on gsi train"<<endl;
827         kGCWriteStandardAOD=kFALSE;
828         kGCrunOnTrain = kTRUE;
829       }
830       else if (argument.CompareTo("-run-jet") == 0){
831         cout<<"Running jet analysis"<<endl;
832         kGCrunJet = kTRUE;
833       }
834       else if (argument.CompareTo("-run-neutralmeson") == 0){
835         cout<<"Running neutral meson analysis"<<endl;
836         kGCrunNeutralMeson = kTRUE;
837       }
838       else if (argument.CompareTo("-run-neutral-meson") == 0){
839         cout<<"Running neutral meson analysis"<<endl;
840         kGCrunNeutralMeson = kTRUE;
841       }
842       else if (argument.CompareTo("-run-omega-meson") == 0){
843         cout<<"Running omega meson analysis"<<endl;
844         kGCrunOmegaMeson = kTRUE;
845       }
846       else if (argument.CompareTo("-run-chic") == 0){
847         cout<<"Running Chi_c analysis"<<endl;
848         kGCrunChic = kTRUE;
849       }
850       else if (argument.CompareTo("-run-cf") == 0){
851         cout<<"Running CF"<<endl;
852         kGCrunCF = kTRUE;
853       }
854       else if (argument.CompareTo("-run-resolution") == 0){
855         cout<<"Running Resolution"<<endl;
856         kGCrunRES = kTRUE;
857       }
858       else if (argument.CompareTo("-jet-off") == 0){
859         cout<<"Skipping jet analysis"<<endl;
860         kGCrunJet = kFALSE;
861       }
862       else if (argument.CompareTo("-neutralmeson-off") == 0){
863         cout<<"Skipping neutral meson analysis"<<endl;
864         kGCrunNeutralMeson = kFALSE;
865       }
866       else if (argument.CompareTo("-neutral-meson-off") == 0){
867         cout<<"Skipping neutral meson analysis"<<endl;
868         kGCrunNeutralMeson = kFALSE;
869       }
870       else if (argument.CompareTo("-chic-off") == 0){
871         cout<<"Skipping Chi_c analysis"<<endl;
872         kGCrunChic = kFALSE;
873       }
874       else if (argument.CompareTo("-mc-off") == 0){
875         cout<<"Switching off kGCdoMCTruth"<<endl;
876         kGCdoMCTruth = kFALSE;
877       }
878       else if (argument.CompareTo("-trigger-CINT1B") == 0){
879         cout<<"Selecting ONLY kGCtriggerCINT1B"<<endl;
880         kGCtriggerCINT1B = kTRUE;
881       }
882       else if (argument.CompareTo("-use-own-xyz") == 0){
883         cout<<"Switching on use own xyz calculation"<<endl;
884         kGCdoOwnXYZCalculation = kTRUE;
885       }
886       else if(argument.CompareTo("-append-to-output-file") == 0){
887         if((bMissingParam=(++i>=pTokens->GetEntries()))) break;
888         kGCoutputFileAppendix = TString("_")+((TObjString*)pTokens->At(i))->GetString();
889         if(kGCoutputFileAppendix.IsNull()){
890           cout<<"-appending-to-output-file is NULL"<<endl;
891           iResult=kFALSE;
892         }
893         else{
894           cout<<"Appending to the output file: "<<kGCoutputFileAppendix<<endl;
895         }
896       }
897       else if(argument.CompareTo("-set-cut-selection") == 0){
898         if((bMissingParam=(++i>=pTokens->GetEntries()))) break;
899         kGCAnalysisCutSelectionId = ((TObjString*)pTokens->At(i))->GetString();
900         cout<<"The analysis cut selection is set to: "<<kGCAnalysisCutSelectionId.Data()<<endl;
901       }
902     }
903     delete pTokens;
904   }
905   if (bMissingParam) {
906     cout<<"Missing parameter for argument "<< argument.Data()<<endl;
907     iResult=kFALSE;
908   }
909   return iResult;
910 }
911
912 void SetVersionLibrary(){
913   // Check if the file $ALICE_ROOT/PWG4/GammaConv/AliAnalysisTaskGammaConversion.cxx exists.
914   // If yes, we set kGCusePWG4PartCorr to false since we have a newer version
915   // If no, kGCusePWG4PartCorr is true.
916         
917   TString file = gSystem->Getenv("ALICE_ROOT");
918   file+="/PWG4/PartCorr/AliAnalysisTaskGammaConversion.cxx";
919         
920   ifstream stream;
921   stream.open(file.Data());
922         
923   if(!stream){
924     kGCusePWG4PartCorr=kFALSE;
925   }
926   else{
927     kGCusePWG4PartCorr=kTRUE;
928   }
929   stream.close();
930 }
931
932
933
934 AliAnalysisTaskGammaConversion* ConfigGammaConversion(TString arguments, AliAnalysisDataContainer *cin_esd=NULL){ 
935                                                       
936         
937   
938   if(!scanArguments(arguments)){
939     break;
940   }
941         
942   SetVersionLibrary(); // checks if PWG4GammaConv or PWG4PartCorr is used
943         
944   if(cin_esd == NULL && kGCrunOnTrain == kTRUE){
945     cout<<"Error: kGCrunOnTrain flag is set to true but the input AliAnalysisDataContainer is NULL"<<endl;
946     cout<<"       you must also supply the AliAnalysisDataContainer as an argument"<<endl;
947     return;
948   }
949         
950   if(cin_esd != NULL && kGCrunOnTrain == kFALSE){
951     cout<<"Error: kGCrunOnTrain flag is set to false but the input AliAnalysisDataContainer is not null"<<endl;
952     cout<<"       add -run-on-train to the arguments to turn switch kGCrunOnTrain to kTRUE"<<endl;
953     return;
954   }
955   if(kGCrunOnTrain == kFALSE){
956     if(kGCnumberOfFilesToAnalyze==0){
957       ifstream dataInStream;
958       dataInStream.open(kGCdataList.Data());
959       if ( !dataInStream ){
960         cout<<"Data list file does not exist: "<<kGCdataList.Data()<<endl;
961         return 0;
962       }
963       string line;
964       while ( !dataInStream.eof() )
965         {
966           getline(dataInStream, line);
967           if(line.compare("") != 0){//checks if there is an empty line in the data list
968             kGCnumberOfFilesToAnalyze++;
969           }
970         }
971     }
972     cout<<"Number Of files to analyze: "<<kGCnumberOfFilesToAnalyze<<endl;
973                 
974     build();//build (if necessary) and load the libraries needed
975
976     gROOT->LoadMacro("$ALICE_ROOT/PWG0/CreateESDChain.C"); // load the CreateChain macro
977   }
978                 
979   if(!kGCrunOnTrain){
980     // for the train leave this to the steering macro
981     AliLog::SetGlobalDebugLevel(0);
982     AliLog::SetGlobalLogLevel(AliLog::kFatal);
983   }
984   // ------------------------------------------------------------------------
985                 
986     // for CF
987                 
988     //Container def.
989     const Double_t ptmin = kGCfirstXBinPt;
990     const Double_t ptmax = kGClastXBinPt;
991     const Double_t etamin = kGCfirstXBinEta;
992     const Double_t etamax = kGClastXBinEta;
993     const Double_t massmin = kGCfirstXBinPi0Mass;
994     const Double_t massmax = kGClastXBinPi0Mass;
995                 
996                 
997     // sensitive variables
998     UInt_t ipt = 0;
999     UInt_t ieta = 1;
1000     UInt_t imass = 2;   
1001                 
1002     //how many selection steps 
1003     UInt_t nstep = 20;
1004     const Int_t nvar = 3;
1005
1006     Int_t kGCnXBinsPtCF=40;
1007     Int_t kGCnXBinsEtaCF=8;
1008     Int_t kGCnXBinsPi0MassCF=10;
1009
1010     if(!kGCrunCF){
1011       nstep=1;
1012       kGCnXBinsPtCF=1;
1013       kGCnXBinsEtaCF=1;
1014       kGCnXBinsPi0MassCF=1;
1015     }
1016     const Int_t nbin0 = kGCnXBinsPtCF;  // do not use same variable for CF than for histogram
1017     const Int_t nbin1 = kGCnXBinsEtaCF; // do not use same variable for CF than for histogram
1018     const Int_t nbin2 = kGCnXBinsPi0MassCF; // do not use same variable for CF than for histogram               
1019                 
1020     //arrays for the number of bins in each dimension
1021     Int_t iBin[nvar];
1022     iBin[0] = nbin0;
1023     iBin[1] = nbin1;
1024     iBin[2] = nbin2;    
1025                 
1026     //arrays for lower bounds
1027     Double_t *binLim0 = new Double_t[nbin0+1];
1028     Double_t *binLim1 = new Double_t[nbin1+1];  
1029     Double_t *binLim2 = new Double_t[nbin2+1];  
1030                 
1031     // values for lower bounds
1032     for(Int_t i = 0; i <= nbin0; i++) binLim0[i] = ptmin + (ptmax - ptmin)/nbin0*i;
1033     for(Int_t i = 0; i <= nbin1; i++) binLim1[i] = etamin + (etamax - etamin)/nbin1*i;
1034     for(Int_t i = 0; i <= nbin2; i++) binLim2[i] = massmin + (massmax - massmin)/nbin2*i;
1035                 
1036     // create container
1037     AliCFContainer *container = new AliCFContainer("container","container for gammaconversion", nstep,nvar,iBin);
1038     container->SetBinLimits(ipt,binLim0);
1039     container->SetBinLimits(ieta,binLim1);
1040     container->SetBinLimits(imass,binLim2);     
1041                 
1042     AliCFManager *man = new AliCFManager();
1043     man->SetParticleContainer(container);
1044     for(int i = 0;i<nstep;i++){
1045       TObjArray *tmp = new TObjArray(0);
1046       man->SetParticleCutsList(i,tmp) ;
1047     } 
1048     // end ---------------------------------------------------------------------------
1049                 
1050                 
1051
1052         
1053   AliGammaConversionHistograms* histograms = new AliGammaConversionHistograms();  
1054   AddHistograms(histograms);
1055         
1056   // Create the Analysis manager
1057   AliAnalysisManager *mgr =NULL;
1058   if(kGCrunOnTrain == kFALSE){
1059     mgr  = new AliAnalysisManager("My Manager", "My Analysis");
1060   }
1061   else{
1062     mgr = AliAnalysisManager::GetAnalysisManager();
1063   }
1064         
1065   if (!mgr) {
1066     ::Error("ConfigGammaConversion", "No analysis manager to connect to.");
1067     return NULL;
1068   }
1069   if(kGCrunOnTrain == kTRUE){
1070     if (!mgr->GetInputEventHandler()) {
1071       ::Error("ConfigGammaConversion", "This task requires an input event handler");
1072       return NULL;
1073     }
1074   }
1075   AliESDInputHandler* inpHandler = NULL;
1076         
1077   if(kGCrunOnTrain == kFALSE){
1078     // Define Input Event Handler 
1079     inpHandler = new AliESDInputHandler();
1080   }
1081   // Define MC Truth Event Handler
1082   AliMCEventHandler* mcHandler = NULL;
1083   if(kGCdoMCTruth){
1084     if(kGCrunOnTrain == kFALSE){
1085       mcHandler = new AliMCEventHandler();
1086     }
1087     else{
1088       mcHandler = (AliMCEventHandler*)mgr->GetMCtruthEventHandler();
1089     }
1090     if (!mcHandler) {
1091       ::Error("", "No MC handler connected");
1092       return NULL;
1093     }
1094   }
1095         
1096   // Define Output Event Handler and ad
1097   if(kGCrunOnTrain == kFALSE){
1098     if(kGCWriteStandardAOD == kTRUE){
1099       AliAODHandler* aodHandler = new AliAODHandler();
1100       TString fileOutAOD = "AOD_"+ kGCoutputFileName + kGCoutputFileAppendix + ".root";
1101       aodHandler->SetOutputFileName(fileOutAOD);
1102       mgr->SetOutputEventHandler (aodHandler);
1103     }
1104   }
1105         
1106   if(kGCrunOnTrain == kFALSE){
1107     mgr->SetInputEventHandler  (inpHandler);
1108     mgr->SetMCtruthEventHandler(mcHandler);
1109   }
1110   // Be sure you are told what you are doing
1111   // mgr->SetDebugLevel(10);
1112         
1113   // Declare Common Input Tchain
1114   AliAnalysisDataContainer *cinput1 = NULL;
1115   if(kGCusePWG4PartCorr){
1116     if(kGCrunOnTrain == kFALSE){
1117       cinput1 = mgr->CreateContainer("GammaConvChain",TChain::Class(),AliAnalysisManager::kInputContainer);
1118     }
1119     else{
1120       cinput1 = cin_esd;
1121     }
1122   }
1123   else{
1124       cinput1 = mgr->GetCommonInputContainer();
1125   }
1126         
1127   // Common Output Tree in common Ã¢\80\98defaultâ\80\99 output file
1128   // CKB kGCusePWG4PartCorr and writestandard are not mutually exclusive?
1129   AliAnalysisDataContainer *coutput1 = NULL;
1130   if(kGCusePWG4PartCorr){
1131     //    coutput1 = mgr->CreateContainer("GammaConvTree",TTree::Class(),AliAnalysisManager::kOutputContainer, "default");
1132     coutput1 = mgr->CreateContainer("GammaConvTree",TTree::Class(),AliAnalysisManager::kOutputContainer, "default");
1133   }
1134   else{
1135     if(kGCWriteStandardAOD){
1136       coutput1 = mgr->GetCommonOutputContainer();
1137     }
1138   }
1139         
1140   // Private output objects
1141   if(kGCoutputFileName.Contains(".root")){
1142     kGCoutputFileName.ReplaceAll(".root","");
1143   }
1144   if(kGCoutputFileAppendix.Contains(".root")){
1145     kGCoutputFileAppendix.ReplaceAll(".root","");
1146   }
1147   //TString fileOut = kGCoutputFileName + kGCoutputFileAppendix + ".root";
1148
1149   
1150   TString outputfile = AliAnalysisManager::GetCommonFileName();
1151   cout<<"Analyis cut selection ID is: "<<kGCAnalysisCutSelectionId.Data()<<endl;
1152   //  outputfile += Form(":PWG4_GammaConversion_%s",kGCAnalysisCutSelectionId.Data());
1153   outputfile += Form(":PWG4_GammaConversion");
1154   /*  
1155   // this is not really needed
1156   if(kGCrunNeutralMeson==kTRUE) outputfile +="1";  else outputfile +="0";
1157
1158   if(kGCrunJet==kTRUE) outputfile +="1"; else outputfile +="0";
1159
1160   if(kGCrunChic==kTRUE) outputfile +="1"; else outputfile +="0";
1161
1162   if(kGCrunCF==kTRUE) outputfile +="1"; else outputfile +="0";
1163
1164   if(kGCcalculateBackground==kTRUE) outputfile +="1"; else outputfile +="0";
1165
1166   if(kGCdoNeutralMesonV0MCCheck==kTRUE) outputfile +="1"; else outputfile +="0";
1167
1168   if(kGCrunOmegaMeson==kTRUE) outputfile +="1"; else outputfile +="0";
1169
1170   if(kGCrunRES==kTRUE) outputfile +="1"; else outputfile +="0";
1171   */
1172   outputfile += Form("_%s",kGCAnalysisCutSelectionId.Data());
1173
1174   cout<<"Ouput file::"<<  outputfile <<endl;
1175   AliAnalysisDataContainer *coutput2 = mgr->CreateContainer(Form("histogramsAliGammaConversion_%s",kGCAnalysisCutSelectionId.Data()), TList::Class(),AliAnalysisManager::kOutputContainer, outputfile);
1176   // for CF
1177   AliAnalysisDataContainer *coutput3 = mgr->CreateContainer(Form("GammaConvccontainer0_%s",kGCAnalysisCutSelectionId.Data()),AliCFContainer::Class(),AliAnalysisManager::kOutputContainer,outputfile);
1178         
1179   //------------------------ END: Define input/output handlers ---------------------------------------------------
1180         
1181   //check for errors in the specified data
1182   if(kGCuseKFParticle == kTRUE && kGCuseESDTrack == kTRUE){
1183     //Print warning, cannot use both
1184     ::Error("ConfigGammaConversion","Both kGCuseKFParticle and kGCuseESDTracks can be true at the same time")
1185       }
1186   if(kGCuseKFParticle == kFALSE && kGCuseESDTrack == kFALSE){
1187     //Print warning, one have to be specified
1188     ::Error("ConfigGammaConversion","Both kGCuseKFParticle and kGCuseESDTracks can be false at the same time")
1189       }
1190         
1191
1192   if(!SetAnalysisCutSelection(kGCAnalysisCutSelectionId)){
1193     return 0;
1194   }
1195         
1196   //Create the V0Reader
1197   AliV0Reader * v0Reader = new AliV0Reader();
1198   if(kGCuseKFParticle){
1199     v0Reader->UseKFParticle();
1200   }
1201   else if(kGCuseESDTrack){
1202     v0Reader->UseESDTrack();
1203   }
1204   v0Reader->SetNegativeTrackPID(kGCpidOfNegativeTrack);
1205   v0Reader->SetPositiveTrackPID(kGCpidOfPositiveTrack);
1206   v0Reader->SetMaxRCut(kGCmaxRCut);
1207   v0Reader->SetEtaCut(kGCetaCut);
1208   v0Reader->SetPtCut(kGCptCut);
1209   v0Reader->SetSinglePtCut(kGCsingleptCut);
1210   v0Reader->SetLineCutZRSlope(kGCLineCutZRSlope);
1211   v0Reader->SetLineCutZValue(kGCLineCutZValue); 
1212   v0Reader->SetMaxZCut(kGCmaxZCut);     
1213   v0Reader->SetMinClsTPCCut(kGCminClsTPCCut);   
1214   v0Reader->SetChi2CutConversion(kGCchi2CutConversion);
1215   v0Reader->SetChi2CutMeson(kGCchi2CutMeson);
1216   v0Reader->SetPIDProbability(kGCprobElectron);
1217   v0Reader->SetXVertexCut(kGCxVertexCut);
1218   v0Reader->SetYVertexCut(kGCyVertexCut);
1219   v0Reader->SetZVertexCut(kGCzVertexCut);
1220   v0Reader->SetSigmaMass(kGCsigmaCutGammaMass);
1221   v0Reader->SetUseImprovedVertex(kGCuseImprovedVertex);
1222   v0Reader->SetDoMCTruth(kGCdoMCTruth);
1223   v0Reader->SetUseOwnXYZCalculation(kGCdoOwnXYZCalculation);
1224
1225   // for CF
1226   v0Reader->SetCFManager(man);
1227         
1228   // for dEdx N sigma Cut
1229   v0Reader->SetDodEdxSigmaCut(kGCdodEdxSigmaCut);
1230   v0Reader->SetPIDnSigmaAboveElectronLine(kGCPIDnSigmaAboveElectronLine);
1231   v0Reader->SetPIDnSigmaBelowElectronLine(kGCPIDnSigmaBelowElectronLine);
1232   v0Reader->SetPIDnSigmaAbovePionLine(kGCPIDnSigmaAbovePionLine);
1233   v0Reader->SetPIDMinPnSigmaAbovePionLine(kGCPIDMinPnSigmaAbovePionLine);
1234   v0Reader->SetOnFlyFlag(kGCUseOnFlyV0Finder);
1235   v0Reader->SetCalculateBackground(kGCcalculateBackground);
1236
1237
1238   // Create the GammaConversionTask
1239
1240
1241   AliAnalysisTaskGammaConversion *gammaconversion = 
1242     new AliAnalysisTaskGammaConversion(Form("GammaConversionTask_%s",kGCAnalysisCutSelectionId.Data()));
1243
1244   cout<<"name of Task::"<< Form("GammaConversionTask_%s",kGCAnalysisCutSelectionId.Data())<< " "<<gammaconversion->GetName() <<endl;
1245   gammaconversion->SetDebugLevel(0);
1246         
1247   gammaconversion->SetWriteNtuple(kGCwriteNtuple);
1248         
1249   gammaconversion->SetV0Reader(v0Reader);
1250   gammaconversion->SetCalculateBackground(kGCcalculateBackground);
1251   gammaconversion->Init();
1252         
1253   gammaconversion->SetElectronMass(kGCelectronMass);
1254   gammaconversion->SetGammaMass(kGCgammaMass);
1255   gammaconversion->SetPi0Mass(kGCpi0Mass);
1256   gammaconversion->SetEtaMass(kGCetaMass);
1257         
1258   gammaconversion->SetGammaWidth(kGCgammaWidth);
1259   gammaconversion->SetPi0Width(kGCpi0Width);
1260   gammaconversion->SetEtaWidth(kGCetaWidth);
1261         
1262   gammaconversion->SetMinOpeningAngleGhostCut(kGCminOpeningAngleGhostCut);
1263         
1264   Double_t lowPtMapping=0.4;
1265   Double_t highPtMapping=1.5;
1266   gammaconversion->SetLowPtMapping(lowPtMapping);
1267   gammaconversion->SetHighPtMapping(highPtMapping);
1268
1269   // define the width constraint used by KF particle.
1270   Double_t gammaWidth = 0.01;
1271   Double_t pi0Width   = 0.01;
1272   Double_t etaWidth   = 0.01;
1273         
1274   gammaconversion->SetHistograms(histograms);
1275   v0Reader->SetHistograms(histograms);// also give the pointer to the v0reader, for debugging cuts
1276
1277   gammaconversion->SetTriggerCINT1B(kGCtriggerCINT1B);
1278   gammaconversion->SetDoMCTruth(kGCdoMCTruth);
1279         
1280   gammaconversion->SetDoNeutralMeson(kGCrunNeutralMeson);
1281   gammaconversion->SetDoNeutralMesonV0MCCheck(kGCdoNeutralMesonV0MCCheck);
1282   gammaconversion->SetDoJet(kGCrunJet);
1283   gammaconversion->SetDoChic(kGCrunChic);
1284   gammaconversion->SetDoOmegaMeson(kGCrunOmegaMeson);
1285
1286   // for CF
1287   gammaconversion->SetCFManager(man);
1288   gammaconversion->SetDoCF(kGCrunCF);
1289   v0Reader->SetDoCF(kGCrunCF);
1290         
1291   // Add task to the manager 
1292   mgr->AddTask(gammaconversion);
1293         
1294   // Connect I/O to the task
1295   mgr->ConnectInput (gammaconversion, 0, cinput1);
1296   
1297
1298   // CKB Output slot 0 is NOT connected if WriteStandardAOD is false?
1299   if(kGCWriteStandardAOD){
1300     mgr->ConnectOutput(gammaconversion, 0, coutput1);
1301   }
1302   mgr->ConnectOutput(gammaconversion, 1, coutput2);
1303   mgr->ConnectOutput(gammaconversion, 2, coutput3);
1304
1305   if(kGCrunOnTrain == kFALSE){
1306     if(kGCdataList.IsNull()){
1307       cout<<"Data list is not set, aborting."<<endl;
1308       return;
1309     }
1310     /*
1311       gROOT->LoadMacro("$ALICE_ROOT/ANALYSIS/macros/AddTaskPhysicsSelection.C");
1312       AliPhysicsSelectionTask* physSelTask = AddTaskPhysicsSelection();
1313       if(kGCdoMCTruth)physSelTask->GetPhysicsSelection()->SetAnalyzeMC();
1314       physSelTask->GetPhysicsSelection()->AddBackgroundIdentification(new AliBackgroundSelection());
1315       gammaconversion->SelectCollisionCandidates();     
1316     */
1317
1318     gROOT->LoadMacro("$ALICE_ROOT/ANALYSIS/macros/AddTaskPhysicsSelection.C");
1319     AliPhysicsSelectionTask* physSelTask = AddTaskPhysicsSelection(kGCdoMCTruth,kTRUE);
1320     gammaconversion->SelectCollisionCandidates(); 
1321
1322     //    if(kGCrunOnTrain == kFALSE){
1323       TChain* chain= CreateESDChain(kGCdataList,kGCnumberOfFilesToAnalyze);
1324                         
1325       mgr->InitAnalysis();
1326                         
1327       mgr->PrintStatus();
1328                         
1329       mgr->StartAnalysis("local",chain);
1330       //    }
1331   }
1332   return gammaconversion;
1333 }
1334
1335 void build() {
1336         
1337   TStopwatch timer;
1338   timer.Start();
1339   gSystem->Load("libTree.so");
1340   gSystem->Load("libGeom");
1341         
1342   ////
1343   //Setting up ESD.par//
1344   ////
1345   cout<<"compiling ESD"<<endl;
1346   setupPar("ESD");
1347   gSystem->Load("libVMC.so");
1348   gSystem->Load("libESD.so");
1349         
1350   ////
1351   ////
1352   //Setting up STEERBase.par//
1353   ////
1354   cout<<"compiling STEERBase"<<endl;
1355   setupPar("STEERBase");
1356   gSystem->Load("libSTEERBase.so");
1357         
1358   ////
1359   //Setting up AOD.par//
1360   ////
1361   cout<<"compiling AOD"<<endl;
1362   setupPar("AOD");
1363   gSystem->Load("libAOD.so");
1364         
1365   ////
1366   //Setting up ANALYSIS.par//
1367   ////
1368   cout<<"compiling ANALYSIS"<<endl;
1369   setupPar("ANALYSIS");
1370   gSystem->Load("libANALYSIS.so");
1371         
1372   ////
1373   //Setting up ANALYSISalice.par//
1374   ////
1375   cout<<"compiling ANALYSISalice"<<endl;
1376   setupPar("ANALYSISalice");
1377   gSystem->Load("libANALYSISalice.so");
1378         
1379   ////
1380   //Setting up CORRFW.par//
1381   ////
1382   cout<<"compiling CORRFW"<<endl;
1383   setupPar("CORRFW");
1384   gSystem->Load("CORRFW.so");
1385         
1386   ////
1387   //Setting up PWG4GammaConv.par//
1388   ////
1389   cout<<"compiling PWG4GammaConv"<<endl;
1390   setupPar("PWG4GammaConv");
1391   gSystem->Load("libPWG4GammaConv.so");
1392 }
1393
1394 Int_t setupPar(const char* pararchivename) {
1395   ///////////////////
1396   // Setup PAR File//
1397   ///////////////////
1398   if (pararchivename) {
1399     char processline[1024];
1400     sprintf(processline,".! tar xvzf %s.par",pararchivename);
1401     gROOT->ProcessLine(processline);
1402     const char* ocwd = gSystem->WorkingDirectory();
1403     gSystem->ChangeDirectory(pararchivename);
1404                 
1405     // check for BUILD.sh and execute
1406     if (!gSystem->AccessPathName("PROOF-INF/BUILD.sh")) {
1407       printf("*******************************\n");
1408       printf("*** Building PAR archive    ***\n");
1409       printf("*******************************\n");
1410                         
1411       if (gSystem->Exec("PROOF-INF/BUILD.sh")) {
1412         Error("runAnalysis","Cannot Build the PAR Archive! - Abort!");
1413         return -1;
1414       }
1415     }
1416     // check for SETUP.C and execute
1417     if (!gSystem->AccessPathName("PROOF-INF/SETUP.C")) {
1418       printf("*******************************\n");
1419       printf("*** Setup PAR archive       ***\n");
1420       printf("*******************************\n");
1421       gROOT->Macro("PROOF-INF/SETUP.C");
1422     }
1423                 
1424     gSystem->ChangeDirectory("../");
1425   }                                                                                                                                               
1426   return 1;
1427 }
1428
1429
1430
1431 void AddHistograms(AliGammaConversionHistograms *histograms){
1432   //---------------------------------------------- Jets ---------------------------------------------------------
1433   if(kGCrunJet == kTRUE){
1434     if (kGCplotdPhiHdrGam == kTRUE){
1435       histograms->AddHistogram("ESD_dphiHdrGam","ESD_dphiHdrGam", kGCnXBinsdphiHdrGam,kGCfirstXBindphiHdrGam,kGClastXBindphiHdrGam,"dphiHdrGam (rad)","Counts");
1436     }
1437                 
1438     if (kGCplotdPhiHdrGamIsolated == kTRUE){
1439       histograms->AddHistogram("ESD_dphiHdrGamIsolated","ESD_dphiHdrGamIsolated",  kGCnXBinsdphiHdrGam,kGCfirstXBindphiHdrGam,kGClastXBindphiHdrGam,"dphiHdrGamIsolated (rad)","Counts");
1440     }
1441                 
1442     if (kGCplotMinimumIsoDistance == kTRUE){
1443       histograms->AddHistogram("ESD_MinimumIsoDistance","ESD_MinimumIsoDistance", kGCnXBinsMinimumIsoDistance,kGCfirstXBinMinimumIsoDistance,kGClastXBinMinimumIsoDistance,"Minimum Iso Distance (rad)","Counts");
1444     }
1445                 
1446     if (kGCplotFFzHdrGam == kTRUE){
1447       histograms->AddHistogram("ESD_FFzHdrGam","ESD_FFzHdrGam", kGCnXBinsFFzHdrGam, kGCfirstXBinFFzHdrGam,kGClastXBinFFzHdrGam,"FFz Hdr Gam","Counts");
1448     }
1449                 
1450     if (kGCplotImbalanceHdrGam == kTRUE){
1451       histograms->AddHistogram("ESD_ImbalanceHdrGam","ESD_ImbalanceHdrGam", kGCnXBinsImbalanceHdrGam, kGCfirstXBinImbalanceHdrGam,kGClastXBinImbalanceHdrGam,"Imbalance Hdr Gam","Counts");
1452     }
1453   }//end if(kGCrunJet)
1454         
1455   //---------------------------------------------- Chi_c ---------------------------------------------------------
1456   if(kGCrunChic){
1457                 
1458     if(kGCplotESDInvMassePluseMinus == kTRUE){histograms->AddHistogram("ESD_InvMass_ePluseMinus","",kGCnXBinsJPsiMass, kGCfirstXBinJPsiMass, kGClastXBinJPsiMass, "",
1459                                                                        "");}
1460     if(kGCplotESDInvMassePluseMinus == kTRUE){histograms->AddHistogram("ESD_InvMass_ePluseMinusTest","",kGCnXBinsJPsiMass, kGCfirstXBinJPsiMass, kGClastXBinJPsiMass,
1461                                                                        "","");}
1462     if(kGCplotESDInvMassePluseMinus == kTRUE){histograms->AddHistogram("ESD_InvMass_xPlusxMinus","",kGCnXBinsJPsiMass, kGCfirstXBinJPsiMass, kGClastXBinJPsiMass, "",
1463                                                                        "");}
1464     if(kGCplotESDElectronPosNegPt == kTRUE){histograms->AddHistogram("ESD_ElectronPosNegPt","",kGCnXBinsEPosNegPt,kGCfirstXBinEPosNegPt,kGClastXBinEPosNegPt,"","");}
1465     if(kGCplotESDElectronPosNegEta == kTRUE){histograms->AddHistogram("ESD_ElectronPosNegEta","",kGCnXBinsEPosNegEta,kGCfirstXBinEPosNegEta,kGClastXBinEPosNegEta,"","
1466                                                                                                                                                   ");}
1467                 
1468     if(kGCplotESDElectronPosNegPt == kTRUE){histograms->AddHistogram("ESD_ElectronPosPt","",kGCnXBinsEPosNegPt,kGCfirstXBinEPosNegPt,kGClastXBinEPosNegPt,"","");}
1469     if(kGCplotESDElectronPosNegPt == kTRUE){histograms->AddHistogram("ESD_ElectronNegPt","",kGCnXBinsEPosNegPt,kGCfirstXBinEPosNegPt,kGClastXBinEPosNegPt,"","");}
1470                 
1471     if(kGCplotESDElectronPosNegAngle == kTRUE){histograms->AddHistogram("ESD_ElectronPosNegJPsiAngle","",kGCnXBinsEPosNegAngle,kGCfirstXBinEPosNegAngle,kGClastXBinEPosNegAngle,"","");}
1472
1473     if(kGCplotESDePoseNegAngle == kTRUE){histograms->AddHistogram("ESD_eNegePosAngleBeforeCut","",kGCnXBinsEPosNegAngle,kGCfirstXBinEPosNegAngle,kGClastXBinEPosNegAngle,"","");}
1474     if(kGCplotESDePoseNegAngle == kTRUE){histograms->AddHistogram("ESD_eNegePosAngleAfterCut","",kGCnXBinsEPosNegAngle,kGCfirstXBinEPosNegAngle,kGClastXBinEPosNegAngle,"","");}
1475     if(kGCplotESDInvMassGammaePluseMinusChiC == kTRUE) {histograms->AddHistogram("ESD_InvMass_GammaePluseMinusChiC","",kGCnXBinsChicMass,kGCfirstXBinChicMass,kGClastXBinChicMass,"","");}
1476     if(kGCplotESDInvMassGammaePluseMinusChiC == kTRUE) {histograms->AddHistogram("ESD_InvMass_GammaePluseMinusChiCDiff","",kGCnXBinsChicMass,kGCfirstXBinChicMass,kGClastXBinChicMass,"","");}
1477     if(kGCplotESDInvMassGammaePluseMinusPi0 == kTRUE) {histograms->AddHistogram("ESD_InvMass_GammaePluseMinusPi0","",kGCnXBinsPi0Mass,kGCfirstXBinPi0Mass,kGClastXBinPi0Mass,"","");}
1478     if(kGCplotESDElectronPosNegPi0Angle == kTRUE){histograms->AddHistogram("ESD_ElectronPosNegPi0Angle","",kGCnXBinsEPosNegAngle,kGCfirstXBinEPosNegAngle,kGClastXBinEPosNegAngle,"","");}
1479                 
1480     if(kGCplotESDEPosBackground == kTRUE){histograms->AddHistogram("ESD_EPosBackground","",kGCnXBinsEBackground,kGCfirstXBinEBackground,kGClastXBinEBackground,"","");}
1481                 
1482     if(kGCplotESDEPosBackground == kTRUE){histograms->AddHistogram("ESD_EPosENegNoJPsiBG","",kGCnXBinsEBackground,kGCfirstXBinEBackground,kGClastXBinEBackground,"","");}
1483                 
1484                 
1485     if(kGCplotESDENegBackground == kTRUE){histograms->AddHistogram("ESD_ENegBackground","",kGCnXBinsEBackground,kGCfirstXBinEBackground,kGClastXBinEBackground,"","");}
1486     if(kGCplotESDEPosENegBackground == kTRUE){histograms->AddHistogram("ESD_EPosENegBackground","",kGCnXBinsEBackground,kGCfirstXBinEBackground,kGClastXBinEBackground,"","");}
1487     if(kGCplotESDEPosENegBackgroundCut == kTRUE){histograms->AddHistogram("ESD_EPosENegBackgroundCut","",kGCnXBinsEBackgroundCut,kGCfirstXBinEBackgroundCut,kGClastXBinEBackgroundCut,"","");}
1488                 
1489     if(kGCplotESDEPosENegGammaBackgroundMX == kTRUE){histograms->AddHistogram("ESD_EPosENegGammaBackgroundMX","",kGCnXBinsEBackground,kGCfirstXBinEBackground,kGClastXBinEBackground,"","");}
1490     if(kGCplotESDEPosENegGammaBackgroundMX == kTRUE){histograms->AddHistogram("ESD_EPosENegGammaBackgroundMXDiff","",kGCnXBinsEBackground,kGCfirstXBinEBackground,kGClastXBinEBackground,"","");}
1491                 
1492     if(kGCplotTableElectrons == kTRUE){ histograms->AddTable("Table_Electrons","",kGCnElementsElectronTable,kGCelectronTable);}
1493
1494     if(kGCdoMCTruth){
1495       if(kGCplotMCElectronPosNegPt == kTRUE){histograms->AddHistogram("MC_ElectronPosNegPt","",kGCnXBinsEPosNegPt,kGCfirstXBinEPosNegPt,kGClastXBinEPosNegPt,"","");}
1496       if(kGCplotMCElectronPosNegEta == kTRUE){histograms->AddHistogram("MC_ElectronPosNegEta","",kGCnXBinsEPosNegEta,kGCfirstXBinEPosNegEta,kGClastXBinEPosNegEta,"","");}
1497       if(kGCplotMCElectronPosNegJPsiAngle == kTRUE){histograms->AddHistogram("MC_ElectronPosNegJPsiAngle","",kGCnXBinsEPosNegAngle,kGCfirstXBinEPosNegAngle,kGClastXBinEPosNegAngle,"","");}
1498       if(kGCplotMCElectronPosNegPi0Angle == kTRUE){histograms->AddHistogram("MC_ElectronPosNegPi0Angle","",kGCnXBinsEPosNegAngle,kGCfirstXBinEPosNegAngle,kGClastXBinEPosNegAngle,"","");}
1499     }
1500
1501   }// end kGCrunChic
1502         
1503   //---------------------------------------------- Neutral Meson ---------------------------------------------------------
1504   if(kGCrunNeutralMeson){
1505                 
1506     // Histograms from esd tracks       
1507     if(kGCplotESDEEnergy == kTRUE){ histograms->AddHistogram("ESD_E_Energy" ,"" , kGCnXBinsEnergy, kGCfirstXBinEnergy, kGClastXBinEnergy, "", "");}
1508     if(kGCplotESDEPt == kTRUE){ histograms->AddHistogram("ESD_E_Pt" ,"" , kGCnXBinsPt, kGCfirstXBinPt, kGClastXBinPt, "", "");}
1509     if(kGCplotESDEEta == kTRUE){ histograms->AddHistogram("ESD_E_Eta" ,"" , kGCnXBinsEta, kGCfirstXBinEta, kGClastXBinEta, "", "");}
1510     if(kGCplotESDEPhi == kTRUE){ histograms->AddHistogram("ESD_E_Phi" ,"" , kGCnXBinsPhi, kGCfirstXBinPhi, kGClastXBinPhi, "", "");}
1511     if(kGCplotESDENTPCClusters == kTRUE){ histograms->AddHistogram("ESD_E_nTPCClusters" ,"" , kGCnXBinsNTPCClusters, kGCfirstXBinNTPCClusters, kGClastXBinNTPCClusters, "", "");}
1512     if(kGCplotESDENITSClusters == kTRUE){ histograms->AddHistogram("ESD_E_nITSClusters" ,"" , kGCnXBinsNITSClusters, kGCfirstXBinNITSClusters, kGClastXBinNITSClusters, "", "");}
1513                 
1514     if(kGCplotESDPEnergy == kTRUE){ histograms->AddHistogram("ESD_P_Energy" ,"" , kGCnXBinsEnergy, kGCfirstXBinEnergy, kGClastXBinEnergy, "", "");}
1515     if(kGCplotESDPPt == kTRUE){ histograms->AddHistogram("ESD_P_Pt" ,"" , kGCnXBinsPt, kGCfirstXBinPt, kGClastXBinPt, "", "");}
1516     if(kGCplotESDPEta == kTRUE){ histograms->AddHistogram("ESD_P_Eta" ,"" , kGCnXBinsEta, kGCfirstXBinEta, kGClastXBinEta, "", "");}
1517     if(kGCplotESDPPhi == kTRUE){ histograms->AddHistogram("ESD_P_Phi" ,"" , kGCnXBinsPhi, kGCfirstXBinPhi, kGClastXBinPhi, "", "");}
1518     if(kGCplotESDPNTPCClusters == kTRUE){ histograms->AddHistogram("ESD_P_nTPCClusters" ,"" , kGCnXBinsNTPCClusters, kGCfirstXBinNTPCClusters, kGClastXBinNTPCClusters, "", "");}
1519     if(kGCplotESDPNITSClusters == kTRUE){ histograms->AddHistogram("ESD_P_nITSClusters" ,"" , kGCnXBinsNITSClusters, kGCfirstXBinNITSClusters, kGClastXBinNITSClusters, "", "");}
1520                 
1521     if(kGCplotESDConvGammaEnergy == kTRUE){ histograms->AddHistogram("ESD_ConvGamma_Energy" ,"" , kGCnXBinsEnergy, kGCfirstXBinEnergy, kGClastXBinEnergy, "", "");}
1522     if(kGCplotESDConvGammaPt == kTRUE){ histograms->AddHistogram("ESD_ConvGamma_Pt" ,"" , kGCnXBinsPt, kGCfirstXBinPt, kGClastXBinPt, "", "");}
1523     if(kGCplotESDConvGammaEta == kTRUE){ histograms->AddHistogram("ESD_ConvGamma_Eta" ,"" , kGCnXBinsEta, kGCfirstXBinEta, kGClastXBinEta, "", "");}
1524     if(kGCplotESDConvGammaPhi == kTRUE){ histograms->AddHistogram("ESD_ConvGamma_Phi" ,"" , kGCnXBinsPhi, kGCfirstXBinPhi, kGClastXBinPhi, "", "");}
1525     if(kGCplotESDConvGammaMass == kTRUE){ histograms->AddHistogram("ESD_ConvGamma_Mass" ,"" ,  kGCnXBinsGammaMass, kGCfirstXBinGammaMass, kGClastXBinGammaMass, "", "");}
1526     if(kGCplotESDConvGammaWidth == kTRUE){ histograms->AddHistogram("ESD_ConvGamma_Width" ,"" , kGCnXBinsGammaWidth, kGCfirstXBinGammaWidth, kGClastXBinGammaWidth, "", "");}
1527     if(kGCplotESDConvGammaChi2 == kTRUE){ histograms->AddHistogram("ESD_ConvGamma_Chi2" ,"" , kGCnXBinsGammaChi2, kGCfirstXBinGammaChi2, kGClastXBinGammaChi2, "", "");}
1528     if(kGCplotESDConvGammaNDF == kTRUE){ histograms->AddHistogram("ESD_ConvGamma_NDF" ,"" , kGCnXBinsGammaNDF, kGCfirstXBinGammaNDF, kGClastXBinGammaNDF, "", "");}
1529     if(kGCplotESDConvGammaRapid == kTRUE){ histograms->AddHistogram("ESD_ConvGamma_Rapid" ,"" , kGCnXBinsRapid, kGCfirstXBinRapid, kGClastXBinRapid, "", "");}
1530     if(kGCplotESDConvGammaPtvsEta == kTRUE){ histograms->AddHistogram("ESD_ConvGamma_Pt_Eta","", kGCnXBinsPt, kGCfirstXBinPt, kGClastXBinPt,kGCnXBinsEta, kGCfirstXBinEta, kGClastXBinEta,"","" );}
1531     if(kGCplotESDConvGammaPtvsChi2 == kTRUE){ histograms->AddHistogram("ESD_ConvGamma_Pt_Chi2" ,"" ,kGCnXBinsPt, kGCfirstXBinPt, kGClastXBinPt, kGCnXBinsGammaChi2, kGCfirstXBinGammaChi2, kGClastXBinGammaChi2, "", "");}
1532     if(kGCplotESDConvGammaEtavsChi2 == kTRUE){ histograms->AddHistogram("ESD_ConvGamma_Eta_Chi2" ,"" ,kGCnXBinsEta, kGCfirstXBinEta, kGClastXBinEta, kGCnXBinsGammaChi2, kGCfirstXBinGammaChi2, kGClastXBinGammaChi2, "", "");}
1533                 
1534                 
1535                 
1536     if(kGCplotESDConversionR == kTRUE){ histograms->AddHistogram("ESD_Conversion_R" ,"" , kGCnXBinsR, kGCfirstXBinR, kGClastXBinR, "", "");}
1537     if(kGCplotESDConversionZR == kTRUE){ histograms->AddHistogram("ESD_Conversion_ZR" ,"" , kGCnXBinsZR, kGCfirstXBinZR, kGClastXBinZR, kGCnYBinsZR, kGCfirstYBinZR, kGClastYBinZR, "", "");}
1538     if(kGCplotESDConversionXY == kTRUE){ histograms->AddHistogram("ESD_Conversion_XY" ,"" , kGCnXBinsXY, kGCfirstXBinXY, kGClastXBinXY, kGCnYBinsXY, kGCfirstYBinXY, kGClastYBinXY, "", "");}
1539     if(kGCplotESDConversionOpeningAngle == kTRUE){ histograms->AddHistogram("ESD_Conversion_OpeningAngle" ,"" , kGCnXBinsOpeningAngle, kGCfirstXBinOpeningAngle, kGClastXBinOpeningAngle, "", "");}
1540
1541     if(kGCplotESDConvGammaCosPointingAngle == kTRUE){ histograms->AddHistogram("ESD_ConvGamma_CosPointingAngle" ,"" , kGCnXBinsCosPointingAngle, kGCfirstXBinCosPointingAngle, kGClastXBinCosPointingAngle, "", "");}
1542     if(kGCplotESDConvGammaDcaDaugthers == kTRUE){ histograms->AddHistogram("ESD_ConvGamma_DcaDaughters" ,"" , kGCnXBinsDcaDaughters, kGCfirstXBinDcaDaughters, kGClastXBinDcaDaughters, "", "");}
1543     if(kGCplotESDConvGammaNormDcaDistDaugthers == kTRUE){ histograms->AddHistogram("ESD_ConvGamma_NormDcaDistDaughters" ,"" , kGCnXBinsNormDcaDistDaughters, kGCfirstXBinNormDcaDistDaughters, kGClastXBinNormDcaDistDaughters, "", "");}
1544     if(kGCplotESDConvGammaLikelihoodAP == kTRUE){ histograms->AddHistogram("ESD_ConvGamma_LikelihoodAP" ,"" , kGCnXBinsLikelihoodAP, kGCfirstXBinLikelihoodAP, kGClastXBinLikelihoodAP, "", "");}
1545     if(kGCplotESDConvGammaEAsymmetryP== kTRUE){ histograms->AddHistogram("ESD_ConvGamma_E_AsymmetryP" ,"" ,kGCnXBinsP, kGCfirstXBinP, kGClastXBinP,kGCnYBinsAsymmetry, kGCfirstYBinAsymmetry, kGClastYBinAsymmetry,"", "");}
1546     if(kGCplotESDConvGammaPAsymmetryP== kTRUE){ histograms->AddHistogram("ESD_ConvGamma_P_AsymmetryP" ,"" ,kGCnXBinsP, kGCfirstXBinP, kGClastXBinP,kGCnYBinsAsymmetry, kGCfirstYBinAsymmetry, kGClastYBinAsymmetry,"", "");}
1547     if(kGCplotESDConvGammaEdEdxP== kTRUE){ histograms->AddHistogram("ESD_ConvGamma_E_dEdxP" ,"" ,kGCnXBinsP, kGCfirstXBinP, kGClastXBinP,kGCnYBinsdEdx, kGCfirstYBindEdx, kGClastYBindEdx,"", "");}
1548     if(kGCplotESDConvGammaPdEdxP== kTRUE){ histograms->AddHistogram("ESD_ConvGamma_P_dEdxP" ,"" ,kGCnXBinsP, kGCfirstXBinP, kGClastXBinP,kGCnYBinsdEdx, kGCfirstYBindEdx, kGClastYBindEdx,"", "");}
1549
1550     if(kGCplotESDConvGammaQtAlfa== kTRUE){ histograms->AddHistogram("ESD_ConvGamma_alfa_qt" ,"" ,kGCnXBinsP, kGCfirstXBinAlpha, kGClastXBinAlpha,kGCnYBinsQt, kGCfirstYBinQt, kGClastYBinQt,"", "");}
1551
1552
1553                 
1554     if(kGCplotESDTrueDalitzContaminationR == kTRUE){ histograms->AddHistogram("ESD_TrueDalitzContamination_R" ,"" , kGCnXBinsR, kGCfirstXBinR, kGClastXBinR, "", "");}
1555                 
1556     if(kGCplotESDTrueConvGammaEnergy == kTRUE){ histograms->AddHistogram("ESD_TrueConvGamma_Energy" ,"" , kGCnXBinsEnergy, kGCfirstXBinEnergy, kGClastXBinEnergy, "", "");}
1557     if(kGCplotESDTrueConvGammaPt == kTRUE){ histograms->AddHistogram("ESD_TrueConvGamma_Pt" ,"" , kGCnXBinsPt, kGCfirstXBinPt, kGClastXBinPt, "", "");}
1558     if(kGCplotESDTrueConvGammaEta == kTRUE){ histograms->AddHistogram("ESD_TrueConvGamma_Eta" ,"" , kGCnXBinsEta, kGCfirstXBinEta, kGClastXBinEta, "", "");}
1559     if(kGCplotESDTrueConvGammaPhi == kTRUE){ histograms->AddHistogram("ESD_TrueConvGamma_Phi" ,"" , kGCnXBinsPhi, kGCfirstXBinPhi, kGClastXBinPhi, "", "");}
1560     if(kGCplotESDTrueConvGammaMass == kTRUE){ histograms->AddHistogram("ESD_TrueConvGamma_Mass" ,"" ,  kGCnXBinsGammaMass, kGCfirstXBinGammaMass, kGClastXBinGammaMass, "", "");}
1561     if(kGCplotESDTrueConvGammaWidth == kTRUE){ histograms->AddHistogram("ESD_TrueConvGamma_Width" ,"" , kGCnXBinsGammaWidth, kGCfirstXBinGammaWidth, kGClastXBinGammaWidth, "", "");}
1562     if(kGCplotESDTrueConvGammaChi2 == kTRUE){ histograms->AddHistogram("ESD_TrueConvGamma_Chi2" ,"" , kGCnXBinsGammaChi2, kGCfirstXBinGammaChi2, kGClastXBinGammaChi2, "", "");}
1563     if(kGCplotESDTrueConvGammaNDF == kTRUE){ histograms->AddHistogram("ESD_TrueConvGamma_NDF" ,"" , kGCnXBinsGammaNDF, kGCfirstXBinGammaNDF, kGClastXBinGammaNDF, "", "");}
1564     if(kGCplotESDTrueConvGammaRapid == kTRUE){ histograms->AddHistogram("ESD_TrueConvGamma_Rapid" ,"" , kGCnXBinsRapid, kGCfirstXBinRapid, kGClastXBinRapid, "", "");}
1565     if(kGCplotESDTrueConvGammaPtvsEta == kTRUE){ histograms->AddHistogram("ESD_TrueConvGamma_Pt_Eta" ,"" , kGCnXBinsPt, kGCfirstXBinPt, kGClastXBinPt,kGCnXBinsEta, kGCfirstXBinEta, kGClastXBinEta, "", "");}
1566     if(kGCplotESDTrueConvGammaPtvsChi2 == kTRUE){ histograms->AddHistogram("ESD_TrueConvGamma_Pt_Chi2" ,"" ,kGCnXBinsPt, kGCfirstXBinPt, kGClastXBinPt, kGCnXBinsGammaChi2, kGCfirstXBinGammaChi2, kGClastXBinGammaChi2, "", "");}
1567     if(kGCplotESDTrueConvGammaEtavsChi2 == kTRUE){ histograms->AddHistogram("ESD_TrueConvGamma_Eta_Chi2" ,"" ,kGCnXBinsEta, kGCfirstXBinEta, kGClastXBinEta, kGCnXBinsGammaChi2, kGCfirstXBinGammaChi2, kGClastXBinGammaChi2, "", "");}
1568                 
1569     if(kGCplotESDTrueConversionR == kTRUE){ histograms->AddHistogram("ESD_TrueConversion_R" ,"" , kGCnXBinsR, kGCfirstXBinR, kGClastXBinR, "", "");}
1570     if(kGCplotESDTrueConversionZR == kTRUE){ histograms->AddHistogram("ESD_TrueConversion_ZR" ,"" , kGCnXBinsZR, kGCfirstXBinZR, kGClastXBinZR, kGCnYBinsZR, kGCfirstYBinZR, kGClastYBinZR, "", "");}
1571     if(kGCplotESDTrueConversionXY == kTRUE){ histograms->AddHistogram("ESD_TrueConversion_XY" ,"" , kGCnXBinsXY, kGCfirstXBinXY, kGClastXBinXY, kGCnYBinsXY, kGCfirstYBinXY, kGClastYBinXY, "", "");}
1572     if(kGCplotESDTrueConversionOpeningAngle == kTRUE){ histograms->AddHistogram("ESD_TrueConversion_OpeningAngle" ,"" , kGCnXBinsOpeningAngle, kGCfirstXBinOpeningAngle, kGClastXBinOpeningAngle, "", "");}
1573
1574     if(kGCplotESDTrueConvGammaCosPointingAngle == kTRUE){ histograms->AddHistogram("ESD_TrueConvGamma_CosPointingAngle" ,"" , kGCnXBinsCosPointingAngle, kGCfirstXBinCosPointingAngle, kGClastXBinCosPointingAngle, "", "");}
1575     if(kGCplotESDTrueConvGammaDcaDaugthers == kTRUE){ histograms->AddHistogram("ESD_TrueConvGamma_DcaDaughters" ,"" , kGCnXBinsDcaDaughters, kGCfirstXBinDcaDaughters, kGClastXBinDcaDaughters, "", "");}
1576     if(kGCplotESDTrueConvGammaNormDcaDistDaugthers == kTRUE){ histograms->AddHistogram("ESD_TrueConvGamma_NormDcaDistDaughters" ,"" , kGCnXBinsNormDcaDistDaughters, kGCfirstXBinNormDcaDistDaughters, kGClastXBinNormDcaDistDaughters, "", "");}
1577     if(kGCplotESDTrueConvGammaLikelihoodAP == kTRUE){ histograms->AddHistogram("ESD_TrueConvGamma_LikelihoodAP" ,"" , kGCnXBinsLikelihoodAP, kGCfirstXBinLikelihoodAP, kGClastXBinLikelihoodAP, "", "");}
1578     if(kGCplotESDTrueConvGammaEAsymmetryP== kTRUE){ histograms->AddHistogram("ESD_TrueConvGamma_E_AsymmetryP" ,"" ,kGCnXBinsP, kGCfirstXBinP, kGClastXBinP,kGCnYBinsAsymmetry, kGCfirstYBinAsymmetry, kGClastYBinAsymmetry,"", "");}
1579     if(kGCplotESDTrueConvGammaPAsymmetryP== kTRUE){ histograms->AddHistogram("ESD_TrueConvGamma_P_AsymmetryP" ,"" ,kGCnXBinsP, kGCfirstXBinP, kGClastXBinP,kGCnYBinsAsymmetry, kGCfirstYBinAsymmetry, kGClastYBinAsymmetry,"", "");}
1580     if(kGCplotESDTrueConvGammaEdEdxP== kTRUE){ histograms->AddHistogram("ESD_TrueConvGamma_E_dEdxP" ,"" ,kGCnXBinsP, kGCfirstXBinP, kGClastXBinP,kGCnYBinsdEdx, kGCfirstYBindEdx, kGClastYBindEdx,"", "");}
1581     if(kGCplotESDTrueConvGammaPdEdxP== kTRUE){ histograms->AddHistogram("ESD_TrueConvGamma_P_dEdxP" ,"" ,kGCnXBinsP, kGCfirstXBinP, kGClastXBinP,kGCnYBinsdEdx, kGCfirstYBindEdx, kGClastYBindEdx,"", "");}
1582
1583                 
1584     if(kGCplotESDTrueConvGammaMCPtEta == kTRUE){ histograms->AddHistogram("ESD_TrueConvGamma_MC_Pt_Eta" ,"" , kGCnXBinsPt, kGCfirstXBinPt, kGClastXBinPt, kGCnXBinsEta, kGCfirstXBinEta, kGClastXBinEta, "", "");}
1585     if(kGCplotESDTrueConversionMCZR == kTRUE){ histograms->AddHistogram("ESD_TrueConversion_MC_ZR" ,"" , kGCnXBinsZR, kGCfirstXBinZR, kGClastXBinZR, kGCnYBinsZR, kGCfirstYBinZR, kGClastYBinZR, "", "");}
1586     if(kGCplotESDTrueConversionMCXY == kTRUE){ histograms->AddHistogram("ESD_TrueConversion_MC_XY" ,"" , kGCnXBinsXY, kGCfirstXBinXY, kGClastXBinXY, kGCnYBinsXY, kGCfirstYBinXY, kGClastYBinXY, "", "");}
1587                 
1588                 
1589                 
1590     if(kGCplotESDNoCutConvGammaEnergy == kTRUE){ histograms->AddHistogram("ESD_NoCutConvGamma_Energy" ,"" , kGCnXBinsEnergy, kGCfirstXBinEnergy, kGClastXBinEnergy, "", "");}
1591     if(kGCplotESDNoCutConvGammaPt == kTRUE){ histograms->AddHistogram("ESD_NoCutConvGamma_Pt" ,"" , kGCnXBinsPt, kGCfirstXBinPt, kGClastXBinPt, "", "");}
1592     if(kGCplotESDNoCutConvGammaEta == kTRUE){ histograms->AddHistogram("ESD_NoCutConvGamma_Eta" ,"" , kGCnXBinsEta, kGCfirstXBinEta, kGClastXBinEta, "", "");}
1593     if(kGCplotESDNoCutConvGammaPhi == kTRUE){ histograms->AddHistogram("ESD_NoCutConvGamma_Phi" ,"" , kGCnXBinsPhi, kGCfirstXBinPhi, kGClastXBinPhi, "", "");}
1594     if(kGCplotESDNoCutConvGammaMass == kTRUE){ histograms->AddHistogram("ESD_NoCutConvGamma_Mass" ,"" ,  kGCnXBinsGammaMass, kGCfirstXBinGammaMass, kGClastXBinGammaMass, "", "");}
1595     if(kGCplotESDNoCutConvGammaWidth == kTRUE){ histograms->AddHistogram("ESD_NoCutConvGamma_Width" ,"" , kGCnXBinsGammaWidth, kGCfirstXBinGammaWidth, kGClastXBinGammaWidth, "", "");}
1596     if(kGCplotESDNoCutConvGammaChi2 == kTRUE){ histograms->AddHistogram("ESD_NoCutConvGamma_Chi2" ,"" , kGCnXBinsGammaChi2, kGCfirstXBinGammaChi2, kGClastXBinGammaChi2, "", "");}
1597     if(kGCplotESDNoCutConvGammaNDF == kTRUE){ histograms->AddHistogram("ESD_NoCutConvGamma_NDF" ,"" , kGCnXBinsGammaNDF, kGCfirstXBinGammaNDF, kGClastXBinGammaNDF, "", "");}
1598     if(kGCplotESDNoCutConvGammaRapid == kTRUE){ histograms->AddHistogram("ESD_NoCutConvGamma_Rapid" ,"" , kGCnXBinsRapid, kGCfirstXBinRapid, kGClastXBinRapid, "", "");}
1599     if(kGCplotESDNoCutConvGammaPtvsEta == kTRUE){ histograms->AddHistogram("ESD_NoCutConvGamma_Pt_Eta" ,"" , kGCnXBinsPt, kGCfirstXBinPt, kGClastXBinPt,kGCnXBinsEta, kGCfirstXBinEta, kGClastXBinEta, "", "");}
1600     if(kGCplotESDNoCutConvGammaPtvsChi2 == kTRUE){ histograms->AddHistogram("ESD_NoCutConvGamma_Pt_Chi2" ,"" ,kGCnXBinsPt, kGCfirstXBinPt, kGClastXBinPt, kGCnXBinsGammaChi2, kGCfirstXBinGammaChi2, kGClastXBinGammaChi2, "", "");}
1601     if(kGCplotESDNoCutConvGammaEtavsChi2 == kTRUE){ histograms->AddHistogram("ESD_NoCutConvGamma_Eta_Chi2" ,"" ,kGCnXBinsEta, kGCfirstXBinEta, kGClastXBinEta, kGCnXBinsGammaChi2, kGCfirstXBinGammaChi2, kGClastXBinGammaChi2, "", "");}
1602                 
1603     if(kGCplotESDNoCutConversionR == kTRUE){ histograms->AddHistogram("ESD_NoCutConversion_R" ,"" , kGCnXBinsR, kGCfirstXBinR, kGClastXBinR, "", "");}
1604     if(kGCplotESDNoCutConversionZR == kTRUE){ histograms->AddHistogram("ESD_NoCutConversion_ZR" ,"" , kGCnXBinsZR, kGCfirstXBinZR, kGClastXBinZR, kGCnYBinsZR, kGCfirstYBinZR, kGClastYBinZR, "", "");}
1605     if(kGCplotESDNoCutConversionXY == kTRUE){ histograms->AddHistogram("ESD_NoCutConversion_XY" ,"" , kGCnXBinsXY, kGCfirstXBinXY, kGClastXBinXY, kGCnYBinsXY, kGCfirstYBinXY, kGClastYBinXY, "", "");}
1606     if(kGCplotESDNoCutConversionOpeningAngle == kTRUE){ histograms->AddHistogram("ESD_NoCutConversion_OpeningAngle" ,"" , kGCnXBinsOpeningAngle, kGCfirstXBinOpeningAngle, kGClastXBinOpeningAngle, "", "");}
1607
1608     if(kGCplotESDNoCutConvGammaCosPointingAngle == kTRUE){ histograms->AddHistogram("ESD_NoCutConvGamma_CosPointingAngle" ,"" , kGCnXBinsCosPointingAngle, kGCfirstXBinCosPointingAngle, kGClastXBinCosPointingAngle, "", "");}
1609     if(kGCplotESDNoCutConvGammaDcaDaugthers == kTRUE){ histograms->AddHistogram("ESD_NoCutConvGamma_DcaDaughters" ,"" , kGCnXBinsDcaDaughters, kGCfirstXBinDcaDaughters, kGClastXBinDcaDaughters, "", "");}
1610     if(kGCplotESDNoCutConvGammaNormDcaDistDaugthers == kTRUE){ histograms->AddHistogram("ESD_NoCutConvGamma_NormDcaDistDaughters" ,"" , kGCnXBinsNormDcaDistDaughters, kGCfirstXBinNormDcaDistDaughters, kGClastXBinNormDcaDistDaughters, "", "");}
1611     if(kGCplotESDNoCutConvGammaLikelihoodAP == kTRUE){ histograms->AddHistogram("ESD_NoCutConvGamma_LikelihoodAP" ,"" , kGCnXBinsLikelihoodAP, kGCfirstXBinLikelihoodAP, kGClastXBinLikelihoodAP, "", "");}
1612     if(kGCplotESDNoCutConvGammaEAsymmetryP== kTRUE){ histograms->AddHistogram("ESD_NoCutConvGamma_E_AsymmetryP" ,"" ,kGCnXBinsP, kGCfirstXBinP, kGClastXBinP,kGCnYBinsAsymmetry, kGCfirstYBinAsymmetry, kGClastYBinAsymmetry,"", "");}
1613     if(kGCplotESDNoCutConvGammaPAsymmetryP== kTRUE){ histograms->AddHistogram("ESD_NoCutConvGamma_P_AsymmetryP" ,"" ,kGCnXBinsP, kGCfirstXBinP, kGClastXBinP,kGCnYBinsAsymmetry, kGCfirstYBinAsymmetry, kGClastYBinAsymmetry,"", "");}
1614
1615
1616     if(kGCplotESDNoCutConvGammaEdEdxP== kTRUE){ histograms->AddHistogram("ESD_NoCutConvGamma_E_dEdxP" ,"" ,kGCnXBinsP, kGCfirstXBinP, kGClastXBinP,kGCnYBinsdEdx, kGCfirstYBindEdx, kGClastYBindEdx,"", "");}
1617     if(kGCplotESDNoCutConvGammaPdEdxP== kTRUE){ histograms->AddHistogram("ESD_NoCutConvGamma_P_dEdxP" ,"" ,kGCnXBinsP, kGCfirstXBinP, kGClastXBinP,kGCnYBinsdEdx, kGCfirstYBindEdx, kGClastYBindEdx,"", "");}
1618
1619     if(kGCplotESDNoCutConvGammaMCPtEta == kTRUE){ histograms->AddHistogram("ESD_NoCutConvGamma_MC_Pt_Eta" ,"" , kGCnXBinsPt, kGCfirstXBinPt, kGClastXBinPt, kGCnXBinsEta, kGCfirstXBinEta, kGClastXBinEta, "", "");}
1620     if(kGCplotESDNoCutConversionMCZR == kTRUE){ histograms->AddHistogram("ESD_NoCutConversion_MC_ZR" ,"" , kGCnXBinsZR, kGCfirstXBinZR, kGClastXBinZR, kGCnYBinsZR, kGCfirstYBinZR, kGClastYBinZR, "", "");}
1621     if(kGCplotESDNoCutConversionMCXY == kTRUE){ histograms->AddHistogram("ESD_NoCutConversion_MC_XY" ,"" , kGCnXBinsXY, kGCfirstXBinXY, kGClastXBinXY, kGCnYBinsXY, kGCfirstYBinXY, kGClastYBinXY, "", "");}
1622                 
1623                 
1624                 
1625     if(kGCplotESDMotherOpeningAngleGamma == kTRUE){ histograms->AddHistogram("ESD_Mother_GammaDaughter_OpeningAngle" ,"" , kGCnXBinsOpeningAngle, kGCfirstXBinOpeningAngle, kGClastXBinOpeningAngle, "", "");}
1626     if(kGCplotESDMotherEnergy == kTRUE){ histograms->AddHistogram("ESD_Mother_Energy" ,"" , kGCnXBinsEnergy, kGCfirstXBinEnergy, kGClastXBinEnergy, "", "");}
1627     if(kGCplotESDMotherPt == kTRUE){ histograms->AddHistogram("ESD_Mother_Pt" ,"" , kGCnXBinsPt, kGCfirstXBinPt, kGClastXBinPt, "", "");}
1628     if(kGCplotESDMotherEta == kTRUE){ histograms->AddHistogram("ESD_Mother_Eta" ,"" , kGCnXBinsEta, kGCfirstXBinEta, kGClastXBinEta, "", "");}
1629     if(kGCplotESDMotherPhi == kTRUE){ histograms->AddHistogram("ESD_Mother_Phi" ,"" , kGCnXBinsPhi, kGCfirstXBinPhi, kGClastXBinPhi, "", "");}
1630     if(kGCplotESDMotherMass == kTRUE){ histograms->AddHistogram("ESD_Mother_Mass" ,"" , kGCnXBinsPi0Mass, kGCfirstXBinPi0Mass, kGClastXBinPi0Mass, "", "");}
1631     if(kGCplotESDMotherR == kTRUE){ histograms->AddHistogram("ESD_Mother_R" ,"" , kGCnXBinsR, kGCfirstXBinR, kGClastXBinR, "", "");}
1632     if(kGCplotESDMotherZR == kTRUE){ histograms->AddHistogram("ESD_Mother_ZR" ,"" , kGCnXBinsZR, kGCfirstXBinZR, kGClastXBinZR, kGCnYBinsZR, kGCfirstYBinZR, kGClastYBinZR, "", "");}
1633     if(kGCplotESDMotherXY == kTRUE){ histograms->AddHistogram("ESD_Mother_XY" ,"" , kGCnXBinsXY, kGCfirstXBinXY, kGClastXBinXY, kGCnYBinsXY, kGCfirstYBinXY, kGClastYBinXY, "", "");}
1634     if(kGCplotESDMotherRapid == kTRUE){ histograms->AddHistogram("ESD_Mother_Rapid" ,"" , kGCnXBinsRapid, kGCfirstXBinRapid, kGClastXBinRapid, "", "");}
1635                 
1636     for(Int_t z=0;z<8;z++){
1637       for(Int_t m=0;m<4;m++){
1638         if(kGCplotESDBackgroundOpeningAngleGamma == kTRUE){ histograms->AddHistogram(Form("%d%dESD_Background_GammaDaughter_OpeningAngle",z,m) ,"" , kGCnXBinsOpeningAngle, kGCfirstXBinOpeningAngle, kGClastXBinOpeningAngle, "", "");}
1639         if(kGCplotESDBackgroundEnergy == kTRUE){ histograms->AddHistogram(Form("%d%dESD_Background_Energy",z,m) ,"" , kGCnXBinsEnergy, kGCfirstXBinEnergy, kGClastXBinEnergy, "", "");}
1640         if(kGCplotESDBackgroundPt == kTRUE){ histograms->AddHistogram(Form("%d%dESD_Background_Pt",z,m) ,"" , kGCnXBinsPt, kGCfirstXBinPt, kGClastXBinPt, "", "");}
1641         if(kGCplotESDBackgroundEta == kTRUE){ histograms->AddHistogram(Form("%d%dESD_Background_Eta",z,m) ,"" , kGCnXBinsEta, kGCfirstXBinEta, kGClastXBinEta, "", "");}
1642         if(kGCplotESDBackgroundPhi == kTRUE){ histograms->AddHistogram(Form("%d%dESD_Background_Phi",z,m) ,"" , kGCnXBinsPhi, kGCfirstXBinPhi, kGClastXBinPhi, "", "");}
1643         if(kGCplotESDBackgroundMass == kTRUE){ histograms->AddHistogram(Form("%d%dESD_Background_Mass",z,m) ,"" , kGCnXBinsEtaMass, kGCfirstXBinEtaMass, kGClastXBinEtaMass, "", "");}
1644         if(kGCplotESDBackgroundR == kTRUE){ histograms->AddHistogram(Form("%d%dESD_Background_R",z,m) ,"" , kGCnXBinsR, kGCfirstXBinR, kGClastXBinR, "", "");}
1645         if(kGCplotESDBackgroundZR == kTRUE){ histograms->AddHistogram(Form("%d%dESD_Background_ZR",z,m) ,"" , kGCnXBinsZR, kGCfirstXBinZR, kGClastXBinZR, kGCnYBinsZR, kGCfirstYBinZR, kGClastYBinZR, "", "");}
1646         if(kGCplotESDBackgroundXY == kTRUE){ histograms->AddHistogram(Form("%d%dESD_Background_XY",z,m) ,"" , kGCnXBinsXY, kGCfirstXBinXY, kGClastXBinXY, kGCnYBinsXY, kGCfirstYBinXY, kGClastYBinXY, "", "");}
1647         if(kGCplotESDBackgroundRapid == kTRUE){ histograms->AddHistogram(Form("%d%dESD_Background_Rapid",z,m) ,"" , kGCnXBinsRapid, kGCfirstXBinRapid, kGClastXBinRapid, "", "");}
1648       }
1649     }
1650
1651     if(kGCplotESDBackgroundOpeningAngleGamma == kTRUE){ histograms->AddHistogram("ESD_Background_GammaDaughter_OpeningAngle" ,"" , kGCnXBinsOpeningAngle, kGCfirstXBinOpeningAngle, kGClastXBinOpeningAngle, "", "");}
1652     if(kGCplotESDBackgroundEnergy == kTRUE){ histograms->AddHistogram("ESD_Background_Energy" ,"" , kGCnXBinsEnergy, kGCfirstXBinEnergy, kGClastXBinEnergy, "", "");}
1653     if(kGCplotESDBackgroundPt == kTRUE){ histograms->AddHistogram("ESD_Background_Pt" ,"" , kGCnXBinsPt, kGCfirstXBinPt, kGClastXBinPt, "", "");}
1654     if(kGCplotESDBackgroundEta == kTRUE){ histograms->AddHistogram("ESD_Background_Eta" ,"" , kGCnXBinsEta, kGCfirstXBinEta, kGClastXBinEta, "", "");}
1655     if(kGCplotESDBackgroundPhi == kTRUE){ histograms->AddHistogram("ESD_Background_Phi" ,"" , kGCnXBinsPhi, kGCfirstXBinPhi, kGClastXBinPhi, "", "");}
1656     if(kGCplotESDBackgroundMass == kTRUE){ histograms->AddHistogram("ESD_Background_Mass" ,"" , kGCnXBinsEtaMass, kGCfirstXBinEtaMass, kGClastXBinEtaMass, "", "");}
1657     if(kGCplotESDBackgroundR == kTRUE){ histograms->AddHistogram("ESD_Background_R" ,"" , kGCnXBinsR, kGCfirstXBinR, kGClastXBinR, "", "");}
1658     if(kGCplotESDBackgroundZR == kTRUE){ histograms->AddHistogram("ESD_Background_ZR" ,"" , kGCnXBinsZR, kGCfirstXBinZR, kGClastXBinZR, kGCnYBinsZR, kGCfirstYBinZR, kGClastYBinZR, "", "");}
1659     if(kGCplotESDBackgroundXY == kTRUE){ histograms->AddHistogram("ESD_Background_XY" ,"" , kGCnXBinsXY, kGCfirstXBinXY, kGClastXBinXY, kGCnYBinsXY, kGCfirstYBinXY, kGClastYBinXY, "", "");}
1660     if(kGCplotESDBackgroundRapid == kTRUE){ histograms->AddHistogram("ESD_Background_Rapid" ,"" , kGCnXBinsRapid, kGCfirstXBinRapid, kGClastXBinRapid, "", "");}
1661                 
1662                 
1663     if(kGCplotMapping == kTRUE){
1664       histograms->InitializeMappingValues(kGCnPhiIndex,kGCnRIndex,kGCnXBinsMapping,kGCminRadius,kGCmaxRadius,kGCnYBinsMapping,kGCminPhi,kGCmaxPhi);
1665       histograms->AddMappingHistograms(kGCnPhiIndex,kGCnRIndex,kGCnXBinsMapping,kGCfirstXBinMapping,kGClastXBinMapping,kGCnYBinsMapping,kGCfirstYBinMapping,kGClastYBinMapping);
1666       //      histograms->AddMappingHistograms(kGCnPhiIndex,kGCnRIndex,kGCnXBinsMapping,kGCminRadius,kGCmaxRadius,kGCnYBinsMapping,kGCminPhi,kGCmaxPhi);
1667     }
1668
1669     //
1670     //************************************* Defining Resolution histograms *******************************************************/
1671     //
1672     // written by Friederike Bock 
1673     // contact: Friederike.Bock@cern.ch
1674     //
1675
1676     if(kGCrunRES == kTRUE){
1677         //------------------------------------------ Absolute Resolutions --------------------------------------------------------
1678     if(kGCplotResolutiondRAbs== kTRUE){
1679                 histograms->AddHistogram("Resolution_dRAbs_VS_R","" ,kGCnXBinsResdR, kGCfirstXBinResdR, kGClastXBinResdR,kGCnYBinsResdR,kGCfirstYBinResdR, kGClastYBinResdR, "", "");}
1680     if(kGCplotResolutiondZAbs== kTRUE){
1681                 histograms->AddHistogram("Resolution_dZAbs_VS_R","" ,kGCnXBinsResdR, kGCfirstXBinResdR, kGClastXBinResdR,kGCnYBinsResdR,kGCfirstYBinResdR, kGClastYBinResdR, "", "");}
1682     if(kGCplotResolutiondPhiAbs== kTRUE){
1683                 histograms->AddHistogram("Resolution_dPhiAbs_VS_R","" ,kGCnXBinsResdR, kGCfirstXBinResdR, kGClastXBinResdR,kGCnYBinsResdR, -TMath::Pi()/30., TMath::Pi()/30., "", "");}
1684
1685         //------------------------------------------ Relative Resolutions --------------------------------------------------------
1686     if(kGCplotResolutiondR == kTRUE){
1687                 histograms->AddHistogram("Resolution_dR" ,"" , kGCnXBinsResdR, kGCfirstXBinResdR, kGClastXBinResdR, kGCnYBinsResdR, kGCfirstYBinResdR, kGClastYBinResdR, "", "");}
1688     if(kGCplotResolutiondZ == kTRUE){
1689                 histograms->AddHistogram("Resolution_dZ" ,"" , kGCnXBinsResdZ, kGCfirstXBinResdZ, kGClastXBinResdZ, kGCnYBinsResdZ, kGCfirstYBinResdZ, kGClastYBinResdZ, "", "");}
1690
1691         //------------------------------------------- Pt vs R ---------------------------------------------------------------------             
1692     if(kGCplotResolutiondRdPt == kTRUE){
1693                 histograms->AddHistogram("Resolution_R_dPt" ,"" , kGCnXBinsResdR, kGCfirstXBinResdR, kGClastXBinResdR, kGCnYBinsResdRdPt, kGCfirstYBinResdRdPt, kGClastYBinResdRdPt, "", "");}
1694
1695
1696         // ------------------------------------------- Reconstruction Plots for Resolution ----------------------------------------             
1697     if(kGCplotResolutionMCPt == kTRUE){
1698                 histograms->AddHistogram("Resolution_MC_Pt" ,"" , kGCnXBinsResPt, kGCfirstXBinResPt, kGClastXBinResPt,"","");}
1699     if(kGCplotResolutionMCR == kTRUE){
1700                 histograms->AddHistogram("Resolution_MC_R" ,"" , kGCnXBinsResR, kGCfirstXBinResR, kGClastXBinResR,"","");}
1701     if(kGCplotResolutionMCZ == kTRUE){
1702                 histograms->AddHistogram("Resolution_MC_Z" ,"" , kGCnXBinsResZ, kGCfirstXBinResZ, kGClastXBinResZ,"","");}
1703                 
1704     if(kGCplotResolutionESDPt == kTRUE){
1705                 histograms->AddHistogram("Resolution_ESD_Pt" ,"" , kGCnXBinsResPt, kGCfirstXBinResPt, kGClastXBinResPt,"","");}
1706     if(kGCplotResolutionESDR == kTRUE){
1707                 histograms->AddHistogram("Resolution_ESD_R" ,"" , kGCnXBinsResR, kGCfirstXBinResR, kGClastXBinResR,"","");}
1708     if(kGCplotResolutionESDZ == kTRUE){
1709                 histograms->AddHistogram("Resolution_ESD_Z" ,"" , kGCnXBinsResZ, kGCfirstXBinResZ, kGClastXBinResZ,"","");}
1710
1711         // ------------------------------------------- Plots for specific Gamma Trigger Studies -----------------------------------     
1712     if(kGCplotResolutionPtdPt = kTRUE){
1713                 // ::::::::::::::::::::::::::::::::::::::: histograms for gammas ::::::::::::::::::::::::::::::::::::::::::::::::::::::
1714                 histograms->AddHistogram("Resolution_Gamma_dPt_Pt" ,"" ,kGCnYBinsResdPt, kGCfirstXBinResdPt, kGClastXBinResdPt, kGCnYBinsResdPt, kGCfirstYBinResdPt, kGClastYBinResdPt, "", "");
1715                 histograms->AddHistogram("Resolution_Gamma_dPt_Phi" ,"" , kGCnYBinsResdR, -TMath::Pi(), TMath::Pi(), kGCnYBinsResdPt, kGCfirstYBinResdPt, kGClastYBinResdPt, "", "");
1716                 
1717                 // ::::::::::::::::::::::::::::::::::::::: histograms for electrons :::::::::::::::::::::::::::::::::::::::::::::::::::
1718                 histograms->AddHistogram("Resolution_E_dPt_Pt" ,"" ,kGCnYBinsResdPt, kGCfirstXBinResdPt, kGClastXBinResdPt, kGCnYBinsResdPt, kGCfirstYBinResdPt, kGClastYBinResdPt, "", "");
1719                 histograms->AddHistogram("Resolution_E_dPt_Pt_ITS0" ,"" ,kGCnYBinsResdPt, kGCfirstXBinResdPt, kGClastXBinResdPt, kGCnYBinsResdPt, kGCfirstYBinResdPt, kGClastYBinResdPt, "", "");
1720                 histograms->AddHistogram("Resolution_E_dPt_Pt_ITS1" ,"" ,kGCnYBinsResdPt, kGCfirstXBinResdPt, kGClastXBinResdPt, kGCnYBinsResdPt, kGCfirstYBinResdPt, kGClastYBinResdPt, "", "");
1721                 histograms->AddHistogram("Resolution_E_dPt_Pt_ITS2" ,"" ,kGCnYBinsResdPt, kGCfirstXBinResdPt, kGClastXBinResdPt, kGCnYBinsResdPt, kGCfirstYBinResdPt, kGClastYBinResdPt, "", "");
1722                 histograms->AddHistogram("Resolution_E_dPt_Pt_ITS3" ,"" ,kGCnYBinsResdPt, kGCfirstXBinResdPt, kGClastXBinResdPt, kGCnYBinsResdPt, kGCfirstYBinResdPt, kGClastYBinResdPt, "", "");
1723                 histograms->AddHistogram("Resolution_E_dPt_Pt_ITS4" ,"" ,kGCnYBinsResdPt, kGCfirstXBinResdPt, kGClastXBinResdPt, kGCnYBinsResdPt, kGCfirstYBinResdPt, kGClastYBinResdPt, "", "");
1724                 histograms->AddHistogram("Resolution_E_dPt_Pt_ITS5" ,"" ,kGCnYBinsResdPt, kGCfirstXBinResdPt, kGClastXBinResdPt, kGCnYBinsResdPt, kGCfirstYBinResdPt, kGClastYBinResdPt, "", "");
1725                 histograms->AddHistogram("Resolution_E_dPt_Pt_ITS6" ,"" ,kGCnYBinsResdPt, kGCfirstXBinResdPt, kGClastXBinResdPt, kGCnYBinsResdPt, kGCfirstYBinResdPt, kGClastYBinResdPt, "", "");
1726                 histograms->AddHistogram("Resolution_E_dPt_Phi" ,"" , kGCnYBinsResdR, -TMath::Pi(), TMath::Pi(), kGCnYBinsResdPt, kGCfirstYBinResdPt, kGClastYBinResdPt, "", "");
1727                 histograms->AddHistogram("Resolution_E_nTRDtracklets_ESDPt" ,"" ,kGCnXBinsResdPt, kGCfirstXBinResdPt, kGClastXBinResdPt, 7.5, -0.5, 8.,"", "");
1728                 histograms->AddHistogram("Resolution_E_nTRDtracklets_MCPt","" ,kGCnXBinsResdPt, kGCfirstXBinResdPt, kGClastXBinResdPt, 7.5, -0.5, 8.,"", "");   
1729                 histograms->AddHistogram("Resolution_E_nTRDclusters_ESDPt","",kGCnXBinsResdPt, kGCfirstXBinResdPt, kGClastXBinResdPt, 200.5, -0.5, 201,"", "");
1730                 histograms->AddHistogram("Resolution_E_nTRDclusters_MCPt","",kGCnXBinsResdPt, kGCfirstXBinResdPt, kGClastXBinResdPt, 200.5, -0.5, 201.,"", "");
1731                 //              histograms->AddHistogram("Resolution_E_TRDsignal_ESDPt","", fV0Reader->GetNegativeTrackPt(), fV0Reader->GetNegativeESDTrack()->GetTRDsignal());
1732                 
1733                 // :::::::::::::::::::::::::::::::::::::::: histograms for positrons :::::::::::::::::::::::::::::::::::::::::::::::::::
1734                 histograms->AddHistogram("Resolution_P_dPt_Pt" ,"" , kGCnYBinsResdPt, kGCfirstXBinResdPt, kGClastXBinResdPt, kGCnYBinsResdPt, kGCfirstYBinResdPt, kGClastYBinResdPt, "", "");
1735                 histograms->AddHistogram("Resolution_P_dPt_Pt_ITS0" ,"" ,kGCnYBinsResdPt, kGCfirstXBinResdPt, kGClastXBinResdPt, kGCnYBinsResdPt, kGCfirstYBinResdPt, kGClastYBinResdPt, "", "");
1736                 histograms->AddHistogram("Resolution_P_dPt_Pt_ITS1" ,"" ,kGCnYBinsResdPt, kGCfirstXBinResdPt, kGClastXBinResdPt, kGCnYBinsResdPt, kGCfirstYBinResdPt, kGClastYBinResdPt, "", "");
1737                 histograms->AddHistogram("Resolution_P_dPt_Pt_ITS2" ,"" ,kGCnYBinsResdPt, kGCfirstXBinResdPt, kGClastXBinResdPt, kGCnYBinsResdPt, kGCfirstYBinResdPt, kGClastYBinResdPt, "", "");
1738                 histograms->AddHistogram("Resolution_P_dPt_Pt_ITS3" ,"" ,kGCnYBinsResdPt, kGCfirstXBinResdPt, kGClastXBinResdPt, kGCnYBinsResdPt, kGCfirstYBinResdPt, kGClastYBinResdPt, "", "");
1739                 histograms->AddHistogram("Resolution_P_dPt_Pt_ITS4" ,"" ,kGCnYBinsResdPt, kGCfirstXBinResdPt, kGClastXBinResdPt, kGCnYBinsResdPt, kGCfirstYBinResdPt, kGClastYBinResdPt, "", "");
1740                 histograms->AddHistogram("Resolution_P_dPt_Pt_ITS5" ,"" ,kGCnYBinsResdPt, kGCfirstXBinResdPt, kGClastXBinResdPt, kGCnYBinsResdPt, kGCfirstYBinResdPt, kGClastYBinResdPt, "", "");
1741                 histograms->AddHistogram("Resolution_P_dPt_Pt_ITS6" ,"" ,kGCnYBinsResdPt, kGCfirstXBinResdPt, kGClastXBinResdPt, kGCnYBinsResdPt, kGCfirstYBinResdPt, kGClastYBinResdPt, "", "");
1742                 histograms->AddHistogram("Resolution_P_dPt_Phi" ,"" , kGCnYBinsResdR, -TMath::Pi(), TMath::Pi(), kGCnYBinsResdPt, kGCfirstYBinResdPt, kGClastYBinResdPt, "", "");
1743                 histograms->AddHistogram("Resolution_P_nTRDtracklets_ESDPt" ,"" ,kGCnXBinsResdPt, kGCfirstXBinResdPt, kGClastXBinResdPt, 7.5, -0.5, 8.,"", "");   
1744                 histograms->AddHistogram("Resolution_P_nTRDtracklets_MCPt","", kGCnXBinsResdPt, kGCfirstXBinResdPt, kGClastXBinResdPt, 7.5, -0.5, 8.,"", "");
1745                 histograms->AddHistogram("Resolution_P_nTRDclusters_ESDPt","",kGCnXBinsResdPt, kGCfirstXBinResdPt, kGClastXBinResdPt, 200.5, -0.5, 201.,"", "");
1746                 histograms->AddHistogram("Resolution_P_nTRDclusters_MCPt","",kGCnXBinsResdPt, kGCfirstXBinResdPt, kGClastXBinResdPt, 200.5,-0.5, 201.0,"", "");
1747                 //              histograms->AddHistogram("Resolution_P_TRDsignal_ESDPt", "",fV0Reader->GetPositiveTrackPt(), fV0Reader->GetPositiveESDTrack()->GetTRDsignal());
1748     } //end of specific trigger study resolution plots
1749     } //end if(kGCrunRES=true)
1750     
1751     // ___________________________________________________________________________________________________________________________________________________
1752
1753     if(kGCplotESDNumberOfV0s == kTRUE){histograms->AddHistogram("ESD_NumberOfV0s","Number of v0s",100, -0.5, 99.5,"","");}
1754     if(kGCplotESDNumberOfSurvivingV0s == kTRUE){histograms->AddHistogram("ESD_NumberOfSurvivingV0s","Number of surviving v0s",100, -0.5, 99.5,"","");}
1755     if(kGCplotESDNumberOfContributorsVtx == kTRUE){histograms->AddHistogram("ESD_NumberOfContributorsVtx","Number of contributors to vertex",100, -0.5, 99.5,"","");}
1756     if(kGCplotESDNumberOfGoodESDTracks == kTRUE){histograms->AddHistogram("ESD_NumberOfGoodESDTracks","Number of Good ESD tracks",100, -0.5, 99.5,"","");}
1757     if(kGCplotESDNumberOfGoodESDTracks == kTRUE){histograms->AddHistogram("ESD_NumberOfGoodESDTracksVtx","Number of Good ESD tracks",100, -0.5, 99.5,"","");}   
1758         
1759     //  debug histograms
1760     if(kGCplotESDCutGetOnFly == kTRUE){histograms->AddHistogram("ESD_CutGetOnFly_InvMass" ,"Not GetOnFly" , kGCnXBinsGammaMass, kGCfirstXBinGammaMass, kGClastXBinGammaMass,"","");}
1761     if(kGCplotESDCutNContributors == kTRUE){histograms->AddHistogram("ESD_CutNContributors_InvMass" ,"NContributors <= 0" , kGCnXBinsGammaMass, kGCfirstXBinGammaMass, kGClastXBinGammaMass,"","");}
1762     if(kGCplotESDCutLikeSign == kTRUE){histograms->AddHistogram("ESD_CutLikeSign_InvMass" ,"LikeSign" , kGCnXBinsGammaMass, kGCfirstXBinGammaMass, kGClastXBinGammaMass,"","");}
1763     if(kGCplotESDCutRefit == kTRUE){histograms->AddHistogram("ESD_CutRefit_InvMass" ,"No TPC refit" , kGCnXBinsGammaMass, kGCfirstXBinGammaMass, kGClastXBinGammaMass,"","");}
1764     if(kGCplotESDCutKink == kTRUE){histograms->AddHistogram("ESD_CutKink_InvMass" ,"Kinks" , kGCnXBinsGammaMass, kGCfirstXBinGammaMass, kGClastXBinGammaMass,"","");}
1765     if(kGCplotESDCutPIDProb == kTRUE){histograms->AddHistogram("ESD_CutPIDProb_InvMass" ,"wrong TPC PID" , kGCnXBinsGammaMass, kGCfirstXBinGammaMass, kGClastXBinGammaMass,"","");}
1766
1767     if(kGCplotESDCutdedxSigmaElectronLine == kTRUE){histograms->AddHistogram("ESD_CutdEdxSigmaElectronLine_InvMass" ,"dedx ElectronLine" , kGCnXBinsGammaMass, kGCfirstXBinGammaMass, kGClastXBinGammaMass,"","");}
1768     if(kGCplotESDCutdedxSigmaPionLine == kTRUE){histograms->AddHistogram("ESD_CutdEdxSigmaPionLine_InvMass" ,"dedx PionLine" , kGCnXBinsGammaMass, kGCfirstXBinGammaMass, kGClastXBinGammaMass,"","");}
1769
1770     if(kGCplotESDCutR == kTRUE){histograms->AddHistogram("ESD_CutR_InvMass" ,"Above RMax" , kGCnXBinsGammaMass, kGCfirstXBinGammaMass, kGClastXBinGammaMass,"","");}
1771     if(kGCplotESDCutNDF == kTRUE){histograms->AddHistogram("ESD_CutNDF_InvMass" ,"NDF <= 0" , kGCnXBinsGammaMass, kGCfirstXBinGammaMass, kGClastXBinGammaMass,"","");}
1772     if(kGCplotESDCutChi2 == kTRUE){histograms->AddHistogram("ESD_CutChi2_InvMass" ,"#chi^{2} > Max" , kGCnXBinsGammaMass, kGCfirstXBinGammaMass, kGClastXBinGammaMass,"","");}
1773     if(kGCplotESDCutEta == kTRUE){histograms->AddHistogram("ESD_CutEta_InvMass" ,"Above #eta max" , kGCnXBinsGammaMass, kGCfirstXBinGammaMass, kGClastXBinGammaMass,"","");}
1774     if(kGCplotESDCutPt == kTRUE){histograms->AddHistogram("ESD_CutPt_InvMass" ,"Below p_{t} min" , kGCnXBinsGammaMass, kGCfirstXBinGammaMass, kGClastXBinGammaMass,"","");}
1775     if(kGCplotESDCutLine == kTRUE){histograms->AddHistogram("ESD_CutLine_InvMass" ,"Out of reconstruction area" , kGCnXBinsGammaMass, kGCfirstXBinGammaMass, kGClastXBinGammaMass,"","");}
1776     if(kGCplotESDCutZ == kTRUE){histograms->AddHistogram("ESD_CutZ_InvMass" ,"Out of reconstruction area" , kGCnXBinsGammaMass, kGCfirstXBinGammaMass, kGClastXBinGammaMass,"","");}
1777     if(kGCplotESDCutMinClsTPC == kTRUE){histograms->AddHistogram("ESD_CutMinNClsTPC_InvMass" ,"Out of reconstruction area" , kGCnXBinsGammaMass, kGCfirstXBinGammaMass, kGClastXBinGammaMass,"","");}
1778
1779     if(kGCplotESDGoodV0s == kTRUE){histograms->AddHistogram("ESD_GoodV0s_InvMass" ,"Good V0s" , kGCnXBinsGammaMass, kGCfirstXBinGammaMass, kGClastXBinGammaMass,"","");}
1780     if(kGCplotESDAllV0s == kTRUE){histograms->AddHistogram("ESD_AllV0s_InvMass" ,"All V0s" , kGCnXBinsGammaMass, kGCfirstXBinGammaMass, kGClastXBinGammaMass,"","");}
1781     if(kGCplotESDAllV0sCurrentFinder == kTRUE){histograms->AddHistogram("ESD_AllV0sCurrentFinder_InvMass" ,"All V0s Current Finder" , kGCnXBinsGammaMass, kGCfirstXBinGammaMass, kGClastXBinGammaMass,"","");}
1782
1783     if(kGCplotESDAllV0sCurrentFinderQtAlfa== kTRUE){ histograms->AddHistogram("ESD_AllV0sCurrentFinder_alfa_qt" ,"" ,kGCnXBinsP, kGCfirstXBinAlpha, kGClastXBinAlpha,kGCnYBinsQt, kGCfirstYBinQt, kGClastYBinQt,"", "");}
1784
1785     if(kGCplotESDTrueConvGammaTrackLength == kTRUE){histograms->AddHistogram("ESD_TrueConvGamma_TrackLength","Track length of TrueConvGamma",kGCnXBinsTrackLength,kGCfirstXBinTrackLength,kGClastXBinTrackLength,"","");}
1786     if(kGCplotESDTrueConvGammaTrackLengthVSInvMass == kTRUE){histograms->AddHistogram("ESD_TrueConvGamma_TrackLengthVSInvMass","Track length of TrueConvGamma vs Inv mass",kGCnXBinsTrackLength,kGCfirstXBinTrackLength,kGClastXBinTrackLength,kGCnXBinsPt, kGCfirstXBinPt, kGClastXBinPt,"","");}
1787                 
1788     if(kGCplotOmegaSpectra == kTRUE){
1789       histograms->AddHistogram("ESD_Omega_InvMass_vs_Pt" ,"Invariant Mass vs Pt" , kGCnXBinsSpectra, kGCfirstXBinSpectra, kGClastXBinSpectra,kGCnYBinsSpectra, kGCfirstYBinSpectra, kGClastYBinSpectra,"InvMass [GeV]","Pt [GeV]");
1790       histograms->AddHistogram("ESD_Omega_InvMass","Invariant mass",kGCnXBinsSpectra,kGCfirstXBinSpectra, kGClastXBinSpectra,"InvMass [GeV]","Counts");
1791
1792       histograms->AddHistogram("ESD_Omega_Bck_InvMass_vs_Pt" ,"Invariant Mass vs Pt" , kGCnXBinsSpectra, kGCfirstXBinSpectra, kGClastXBinSpectra,kGCnYBinsSpectra, kGCfirstYBinSpectra, kGClastYBinSpectra,"InvMass [GeV]","Pt [GeV]");
1793       histograms->AddHistogram("ESD_Omega_Bck_InvMass","Invariant mass",kGCnXBinsSpectra,kGCfirstXBinSpectra, kGClastXBinSpectra,"InvMass [GeV]","Counts");
1794       histograms->AddHistogram("ESD_OmegaPipPinPi0_InvMass_vs_Pt" ,"Invariant Mass vs Pt" , kGCnXBinsSpectra, kGCfirstXBinSpectra, kGClastXBinSpectra,kGCnYBinsSpectra, kGCfirstYBinSpectra, kGClastYBinSpectra,"InvMass [GeV]","Pt [GeV]");
1795       histograms->AddHistogram("ESD_OmegaPipPinPi0_InvMass","Invariant mass",kGCnXBinsSpectra,kGCfirstXBinSpectra, kGClastXBinSpectra,"InvMass [GeV]","Counts");
1796
1797     }
1798
1799     if(kGCplotPi0Spectra == kTRUE){
1800       histograms->AddHistogram("ESD_Mother_alfa","Invariant mass",kGCnXBinsSpectra,kGCfirstXBinAlpha, kGClastXBinAlpha,"#alfa","Counts");
1801
1802       histograms->AddHistogram("ESD_Mother_InvMass_vs_Pt" ,"Invariant Mass vs Pt" , kGCnXBinsSpectra, kGCfirstXBinSpectra, kGClastXBinSpectra,kGCnYBinsSpectra, kGCfirstYBinSpectra, kGClastYBinSpectra,"InvMass [GeV]","Pt [GeV]");
1803       histograms->AddHistogram("ESD_Mother_InvMass","Invariant mass",kGCnXBinsSpectra,kGCfirstXBinSpectra, kGClastXBinSpectra,"InvMass [GeV]","Counts");
1804       histograms->AddHistogram("ESD_Mother_InvMass_1212","Invariant mass",kGCnXBinsSpectra,kGCfirstXBinSpectra, kGClastXBinSpectra,"InvMass [GeV]","Counts");
1805       histograms->AddHistogram("ESD_Mother_InvMass_0912","Invariant mass",kGCnXBinsSpectra,kGCfirstXBinSpectra, kGClastXBinSpectra,"InvMass [GeV]","Counts");
1806       histograms->AddHistogram("ESD_Mother_InvMass_0909","Invariant mass",kGCnXBinsSpectra,kGCfirstXBinSpectra, kGClastXBinSpectra,"InvMass [GeV]","Counts");
1807       histograms->AddHistogram("ESD_Mother_InvMass_vs_Pt1212" ,"Invariant Mass vs Pt" , kGCnXBinsSpectra, kGCfirstXBinSpectra, kGClastXBinSpectra,kGCnYBinsSpectra, kGCfirstYBinSpectra, kGClastYBinSpectra,"InvMass [GeV]","Pt [GeV]");
1808       histograms->AddHistogram("ESD_Mother_InvMass_vs_Pt0912" ,"Invariant Mass vs Pt" , kGCnXBinsSpectra, kGCfirstXBinSpectra, kGClastXBinSpectra,kGCnYBinsSpectra, kGCfirstYBinSpectra, kGClastYBinSpectra,"InvMass [GeV]","Pt [GeV]");
1809       histograms->AddHistogram("ESD_Mother_InvMass_vs_Pt0909" ,"Invariant Mass vs Pt" , kGCnXBinsSpectra, kGCfirstXBinSpectra, kGClastXBinSpectra,kGCnYBinsSpectra, kGCfirstYBinSpectra, kGClastYBinSpectra,"InvMass [GeV]","Pt [GeV]");
1810
1811
1812       histograms->AddHistogram("ESD_Mother_InvMass_GammaConvPHOS","Invariant mass",kGCnXBinsSpectra,kGCfirstXBinSpectra, kGClastXBinSpectra,"InvMass [GeV]","Counts");
1813       histograms->AddHistogram("ESD_Mother_InvMass_vs_Pt_GammaConvPHOS" ,"Invariant Mass vs Pt" , kGCnXBinsSpectra, kGCfirstXBinSpectra, kGClastXBinSpectra,kGCnYBinsSpectra, kGCfirstYBinSpectra, kGClastYBinSpectra,"InvMass [GeV]","Pt [GeV]");
1814       histograms->AddHistogram("ESD_Mother_InvMass_GammaConvPHOS_OpanLow","Invariant mass",kGCnXBinsSpectra,kGCfirstXBinSpectra, kGClastXBinSpectra,"InvMass [GeV]","Counts");
1815       histograms->AddHistogram("ESD_Mother_InvMass_GammaConvPHOS_OpanHigh","Invariant mass",kGCnXBinsSpectra,kGCfirstXBinSpectra, kGClastXBinSpectra,"InvMass [GeV]","Counts");
1816
1817       histograms->AddHistogram("ESD_Mother_InvMass_GammaConvEMCAL","Invariant mass",kGCnXBinsSpectra,kGCfirstXBinSpectra, kGClastXBinSpectra,"InvMass [GeV]","Counts");
1818  histograms->AddHistogram("ESD_Mother_InvMass_GammaConvEMCAL_Bck","Invariant mass",kGCnXBinsSpectra,kGCfirstXBinSpectra, kGClastXBinSpectra,"InvMass [GeV]","Counts");
1819
1820       histograms->AddHistogram("ESD_Mother_InvMass_vs_Pt_GammaConvEMCAL" ,"Invariant Mass vs Pt" , kGCnXBinsSpectra, kGCfirstXBinSpectra, kGClastXBinSpectra,kGCnYBinsSpectra, kGCfirstYBinSpectra, kGClastYBinSpectra,"InvMass [GeV]","Pt [GeV]");
1821       histograms->AddHistogram("ESD_Mother_InvMass_vs_Pt_GammaConvEMCAL_Bck" ,"Invariant Mass vs Pt" , kGCnXBinsSpectra, kGCfirstXBinSpectra, kGClastXBinSpectra,kGCnYBinsSpectra, kGCfirstYBinSpectra, kGClastYBinSpectra,"InvMass [GeV]","Pt [GeV]");
1822
1823
1824       histograms->AddHistogram("ESD_Mother_InvMass_GammaConvEMCAL_OpanLow","Invariant mass",kGCnXBinsSpectra,kGCfirstXBinSpectra, kGClastXBinSpectra,"InvMass [GeV]","Counts");
1825       histograms->AddHistogram("ESD_Mother_InvMass_GammaConvEMCAL_OpanHigh","Invariant mass",kGCnXBinsSpectra,kGCfirstXBinSpectra, kGClastXBinSpectra,"InvMass [GeV]","Counts");
1826
1827
1828       //      if(kGCdoNeutralMesonV0MCCheck == kTRUE){
1829         histograms->AddHistogram("ESD_TruePi0_InvMass","Invariant mass",kGCnXBinsSpectra,kGCfirstXBinSpectra, kGClastXBinSpectra,"InvMass [GeV]","Counts");
1830         histograms->AddHistogram("ESD_TruePi0_InvMass_1212","Invariant mass",kGCnXBinsSpectra,kGCfirstXBinSpectra, kGClastXBinSpectra,"InvMass [GeV]","Counts");
1831         histograms->AddHistogram("ESD_TruePi0_InvMass_0912","Invariant mass",kGCnXBinsSpectra,kGCfirstXBinSpectra, kGClastXBinSpectra,"InvMass [GeV]","Counts");
1832         histograms->AddHistogram("ESD_TruePi0_InvMass_0909","Invariant mass",kGCnXBinsSpectra,kGCfirstXBinSpectra, kGClastXBinSpectra,"InvMass [GeV]","Counts");
1833         histograms->AddHistogram("ESD_TruePi0_OpeningAngle_1212" ,"" , kGCnXBinsOpeningAngle, kGCfirstXBinOpeningAngle, kGClastXBinOpeningAngle, "", "");
1834         histograms->AddHistogram("ESD_TruePi0_OpeningAngle_0912" ,"" , kGCnXBinsOpeningAngle, kGCfirstXBinOpeningAngle, kGClastXBinOpeningAngle, "", "");
1835         histograms->AddHistogram("ESD_TruePi0_OpeningAngle_0909" ,"" , kGCnXBinsOpeningAngle, kGCfirstXBinOpeningAngle, kGClastXBinOpeningAngle, "", "");
1836         histograms->AddHistogram("ESD_TruePi0_InvMass_vs_Pt" ,"Invariant Mass vs Pt" , kGCnXBinsSpectra, kGCfirstXBinSpectra, kGClastXBinSpectra,kGCnYBinsSpectra, kGCfirstYBinSpectra, kGClastYBinSpectra,"InvMass [GeV]","Pt [GeV]");
1837         histograms->AddHistogram("ESD_TruePi0_InvMass_vs_Pt1212" ,"Invariant Mass vs Pt" , kGCnXBinsSpectra, kGCfirstXBinSpectra, kGClastXBinSpectra,kGCnYBinsSpectra, kGCfirstYBinSpectra, kGClastYBinSpectra,"InvMass [GeV]","Pt [GeV]");
1838         histograms->AddHistogram("ESD_TruePi0_InvMass_vs_Pt0912" ,"Invariant Mass vs Pt" , kGCnXBinsSpectra, kGCfirstXBinSpectra, kGClastXBinSpectra,kGCnYBinsSpectra, kGCfirstYBinSpectra, kGClastYBinSpectra,"InvMass [GeV]","Pt [GeV]");
1839         histograms->AddHistogram("ESD_TruePi0_InvMass_vs_Pt0909" ,"Invariant Mass vs Pt" , kGCnXBinsSpectra, kGCfirstXBinSpectra, kGClastXBinSpectra,kGCnYBinsSpectra, kGCfirstYBinSpectra, kGClastYBinSpectra,"InvMass [GeV]","Pt [GeV]");
1840         //}
1841
1842       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]");
1843       histograms->AddHistogram("ESD_Mother_InvMass_Fiducial","Invariant mass |eta|<0.9",kGCnXBinsSpectra,kGCfirstXBinSpectra, kGClastXBinSpectra,"InvMass [GeV]","Counts");
1844
1845
1846     }
1847
1848     if(kGCplotPi0Spectra == kTRUE && kGCcalculateBackground == kTRUE){
1849       for(Int_t z=0;z<8;z++){
1850         for(Int_t m=0;m<4;m++){
1851           histograms->AddHistogram(Form("%d%dESD_Background_InvMass_vs_Pt",z,m) ,"Background Invariant Mass vs Pt" , kGCnXBinsSpectra, kGCfirstXBinSpectra, kGClastXBinSpectra,kGCnYBinsSpectra, kGCfirstYBinSpectra, kGClastYBinSpectra,"InvMass [GeV]","Pt [GeV]");
1852
1853           
1854           histograms->AddHistogram(Form("%d%dESD_Background_InvMass",z,m),"Invariant mass background",kGCnXBinsSpectra,kGCfirstXBinSpectra, kGClastXBinSpectra,"InvMass BG [GeV]","Counts");
1855
1856
1857           histograms->AddHistogram(Form("%d%dESD_Background_InvMassvsPtFid",z,m) ,"Background Invariant Mass vs Pt |eta|<0.9" , kGCnXBinsSpectra, kGCfirstXBinSpectra, kGClastXBinSpectra,kGCnYBinsSpectra, kGCfirstYBinSpectra, kGClastYBinSpectra,"InvMass [GeV]","Pt [GeV]");
1858
1859          
1860           histograms->AddHistogram(Form("%d%dESD_Background_InvMass_Fiducial",z,m),"Invariant mass background |eta|<0.9",kGCnXBinsSpectra,kGCfirstXBinSpectra, kGClastXBinSpectra,"InvMass BG [GeV]","Counts");
1861         }
1862       }
1863     
1864       histograms->AddHistogram("ESD_Background_InvMass_vs_Pt" ,"Background Invariant Mass vs Pt" , kGCnXBinsSpectra, kGCfirstXBinSpectra, kGClastXBinSpectra,kGCnYBinsSpectra, kGCfirstYBinSpectra, kGClastYBinSpectra,"InvMass [GeV]","Pt [GeV]");
1865       histograms->AddHistogram("ESD_Background_InvMass","Invariant mass background",kGCnXBinsSpectra,kGCfirstXBinSpectra, kGClastXBinSpectra,"InvMass BG [GeV]","Counts");
1866
1867       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]");
1868       histograms->AddHistogram("ESD_Background_InvMass_Fiducial","Invariant mass background |eta|<0.9",kGCnXBinsSpectra,kGCfirstXBinSpectra, kGClastXBinSpectra,"InvMass BG [GeV]","Counts");
1869     
1870     }
1871     
1872     if(kGCdoMCTruth){
1873       if(kGCplotMCConversionR == kTRUE){ histograms->AddHistogram("MC_Conversion_R","Radius of gamma conversion points",kGCnXBinsR, kGCfirstXBinR, kGClastXBinR,"counts","cm");}
1874       if(kGCplotMCConversionZR == kTRUE){ histograms->AddHistogram("MC_Conversion_ZR","Radius of gamma conversion points vs Z",kGCnXBinsZR, kGCfirstXBinZR, kGClastXBinZR, kGCnYBinsZR, kGCfirstYBinZR, kGClastYBinZR, "cm", "cm");}
1875       if(kGCplotMCConversionXY == kTRUE){ histograms->AddHistogram("MC_Conversion_XY","Gamma XY converison point.",kGCnXBinsXY, kGCfirstXBinXY, kGClastXBinXY, kGCnYBinsXY, kGCfirstYBinXY, kGClastYBinXY, "cm", "cm");}
1876       if(kGCplotMCConversionOpeningAngle == kTRUE){ histograms->AddHistogram("MC_Conversion_OpeningAngle","Opening angle of e+e- pairs from gamma conversion",kGCnXBinsOpeningAngle, kGCfirstXBinOpeningAngle, kGClastXBinOpeningAngle, "counts", "cm");}
1877       if(kGCplotMCConvGammaEAsymmetryP== kTRUE){ histograms->AddHistogram("MC_ConvGamma_E_AsymmetryP" ,"" ,kGCnXBinsP, kGCfirstXBinP, kGClastXBinP,kGCnYBinsAsymmetry, kGCfirstYBinAsymmetry, kGClastYBinAsymmetry,"", "");}
1878       if(kGCplotMCConvGammaPAsymmetryP== kTRUE){ histograms->AddHistogram("MC_ConvGamma_P_AsymmetryP" ,"" ,kGCnXBinsP, kGCfirstXBinP, kGClastXBinP,kGCnYBinsAsymmetry, kGCfirstYBinAsymmetry, kGClastYBinAsymmetry,"", "");}
1879                 
1880
1881       if(kGCplotMCEEnergy == kTRUE){ histograms->AddHistogram("MC_E_Energy" ,"" , kGCnXBinsEnergy, kGCfirstXBinEnergy, kGClastXBinEnergy, "", "");}
1882       if(kGCplotMCEPt == kTRUE){ histograms->AddHistogram("MC_E_Pt" ,"" , kGCnXBinsPt, kGCfirstXBinPt, kGClastXBinPt, "", "");}
1883       if(kGCplotMCEEta == kTRUE){ histograms->AddHistogram("MC_E_Eta" ,"" , kGCnXBinsEta, kGCfirstXBinEta, kGClastXBinEta, "", "");}
1884       if(kGCplotMCEPhi == kTRUE){ histograms->AddHistogram("MC_E_Phi" ,"" , kGCnXBinsPhi, kGCfirstXBinPhi, kGClastXBinPhi, "", "");}
1885       if(kGCplotMCENTPCClusters == kTRUE){ histograms->AddHistogram("MC_E_nTPCClusters" ,"" , kGCnXBinsNTPCClusters, kGCfirstXBinNTPCClusters, kGClastXBinNTPCClusters, "", "");}
1886       if(kGCplotMCENITSClusters == kTRUE){ histograms->AddHistogram("MC_E_nITSClusters" ,"" , kGCnXBinsNITSClusters, kGCfirstXBinNITSClusters, kGClastXBinNITSClusters, "", "");}
1887                 
1888       if(kGCplotMCPEnergy == kTRUE){ histograms->AddHistogram("MC_P_Energy" ,"" , kGCnXBinsEnergy, kGCfirstXBinEnergy, kGClastXBinEnergy, "", "");}
1889       if(kGCplotMCPPt == kTRUE){ histograms->AddHistogram("MC_P_Pt" ,"" , kGCnXBinsPt, kGCfirstXBinPt, kGClastXBinPt, "", "");}
1890       if(kGCplotMCPEta == kTRUE){ histograms->AddHistogram("MC_P_Eta" ,"" , kGCnXBinsEta, kGCfirstXBinEta, kGClastXBinEta, "", "");}
1891       if(kGCplotMCPPhi == kTRUE){ histograms->AddHistogram("MC_P_Phi" ,"" , kGCnXBinsPhi, kGCfirstXBinPhi, kGClastXBinPhi, "", "");}
1892       if(kGCplotMCPNTPCClusters == kTRUE){ histograms->AddHistogram("MC_P_nTPCClusters" ,"" , kGCnXBinsNTPCClusters, kGCfirstXBinNTPCClusters, kGClastXBinNTPCClusters, "", "");}
1893       if(kGCplotMCPNITSClusters == kTRUE){ histograms->AddHistogram("MC_P_nITSClusters" ,"" , kGCnXBinsNITSClusters, kGCfirstXBinNITSClusters, kGClastXBinNITSClusters, "", "");}
1894                 
1895       if(kGCplotMCallGammaEnergy == kTRUE){ histograms->AddHistogram("MC_allGamma_Energy" ,"" , kGCnXBinsEnergy, kGCfirstXBinEnergy, kGClastXBinEnergy, "", "");}
1896       if(kGCplotMCallGammaPt == kTRUE){ histograms->AddHistogram("MC_allGamma_Pt" ,"" , kGCnXBinsPt, kGCfirstXBinPt, kGClastXBinPt, "", "");}
1897       if(kGCplotMCallGammaEta == kTRUE){ histograms->AddHistogram("MC_allGamma_Eta" ,"" , kGCnXBinsEta, kGCfirstXBinEta, kGClastXBinEta, "", "");}
1898       if(kGCplotMCallGammaPhi == kTRUE){ histograms->AddHistogram("MC_allGamma_Phi" ,"" , kGCnXBinsPhi, kGCfirstXBinPhi, kGClastXBinPhi, "", "");}
1899       if(kGCplotMCallGammaRapid == kTRUE){ histograms->AddHistogram("MC_allGamma_Rapid" ,"" , kGCnXBinsRapid, kGCfirstXBinRapid, kGClastXBinRapid, "", "");}
1900                 
1901       if(kGCplotMCConvGammaEnergy == kTRUE){ histograms->AddHistogram("MC_ConvGamma_Energy" ,"" , kGCnXBinsEnergy, kGCfirstXBinEnergy, kGClastXBinEnergy, "", "");}
1902       if(kGCplotMCConvGammaPt == kTRUE){ histograms->AddHistogram("MC_ConvGamma_Pt" ,"" , kGCnXBinsPt, kGCfirstXBinPt, kGClastXBinPt, "", "");}
1903       if(kGCplotMCConvGammaEta == kTRUE){ histograms->AddHistogram("MC_ConvGamma_Eta" ,"" , kGCnXBinsEta, kGCfirstXBinEta, kGClastXBinEta, "", "");}
1904       if(kGCplotMCConvGammaPhi == kTRUE){ histograms->AddHistogram("MC_ConvGamma_Phi" ,"" , kGCnXBinsPhi, kGCfirstXBinPhi, kGClastXBinPhi, "", "");}
1905       if(kGCplotMCConvGammaRapid == kTRUE){ histograms->AddHistogram("MC_ConvGamma_Rapid" ,"" , kGCnXBinsRapid, kGCfirstXBinRapid, kGClastXBinRapid, "", "");}
1906       if(kGCplotMCConvGammaPtvsEta == kTRUE){ histograms->AddHistogram("MC_ConvGamma_Pt_Eta","", kGCnXBinsPt, kGCfirstXBinPt, kGClastXBinPt,kGCnXBinsEta, kGCfirstXBinEta, kGClastXBinEta,"","");}
1907                 
1908       if(kGCplotMCallDirectGammaEnergy == kTRUE){ histograms->AddHistogram("MC_allDirectGamma_Energy" ,"" , kGCnXBinsEnergy, kGCfirstXBinEnergy, kGClastXBinEnergy, "", "");}
1909       if(kGCplotMCallDirectGammaPt == kTRUE){ histograms->AddHistogram("MC_allDirectGamma_Pt" ,"" , kGCnXBinsPt, kGCfirstXBinPt, kGClastXBinPt, "", "");}
1910       if(kGCplotMCallDirectGammaEta == kTRUE){ histograms->AddHistogram("MC_allDirectGamma_Eta" ,"" , kGCnXBinsEta, kGCfirstXBinEta, kGClastXBinEta, "", "");}
1911       if(kGCplotMCallDirectGammaPhi == kTRUE){ histograms->AddHistogram("MC_allDirectGamma_Phi" ,"" , kGCnXBinsPhi, kGCfirstXBinPhi, kGClastXBinPhi, "", "");}
1912       if(kGCplotMCallDirectGammaRapid == kTRUE){ histograms->AddHistogram("MC_allDirectGamma_Rapid" ,"" , kGCnXBinsRapid, kGCfirstXBinRapid, kGClastXBinRapid, "", "");}
1913                 
1914       if(kGCplotMCConvDirectGammaEnergy == kTRUE){ histograms->AddHistogram("MC_ConvDirectGamma_Energy" ,"" , kGCnXBinsEnergy, kGCfirstXBinEnergy, kGClastXBinEnergy, "", "");}
1915       if(kGCplotMCConvDirectGammaPt == kTRUE){ histograms->AddHistogram("MC_ConvDirectGamma_Pt" ,"" , kGCnXBinsPt, kGCfirstXBinPt, kGClastXBinPt, "", "");}
1916       if(kGCplotMCConvDirectGammaEta == kTRUE){ histograms->AddHistogram("MC_ConvDirectGamma_Eta" ,"" , kGCnXBinsEta, kGCfirstXBinEta, kGClastXBinEta, "", "");}
1917       if(kGCplotMCConvDirectGammaPhi == kTRUE){ histograms->AddHistogram("MC_ConvDirectGamma_Phi" ,"" , kGCnXBinsPhi, kGCfirstXBinPhi, kGClastXBinPhi, "", "");}
1918       if(kGCplotMCConvDirectGammaRapid == kTRUE){ histograms->AddHistogram("MC_ConvDirectGamma_Rapid" ,"" , kGCnXBinsRapid, kGCfirstXBinRapid, kGClastXBinRapid, "", "");}
1919                 
1920       if(kGCplotMCMotherEta == kTRUE){ histograms->AddHistogram("MC_Mother_Eta" ,"" , kGCnXBinsEta, kGCfirstXBinEta, kGClastXBinEta, "", "");}
1921       if(kGCplotMCMotherPhi == kTRUE){ histograms->AddHistogram("MC_Mother_Phi" ,"" , kGCnXBinsPhi, kGCfirstXBinPhi, kGClastXBinPhi, "", "");}
1922       if(kGCplotMCMotherRapid == kTRUE){ histograms->AddHistogram("MC_Mother_Rapid" ,"" , kGCnXBinsRapid, kGCfirstXBinRapid, kGClastXBinRapid, "", "");}
1923       if(kGCplotMCMotherPt == kTRUE){ histograms->AddHistogram("MC_Mother_Pt" ,"" , kGCnXBinsPt, kGCfirstXBinPt, kGClastXBinPt, "", "");}
1924       if(kGCplotMCMotherEnergy == kTRUE){ histograms->AddHistogram("MC_Mother_Energy" ,"" , kGCnXBinsEnergy, kGCfirstXBinEnergy, kGClastXBinEnergy, "", "");}
1925       if(kGCplotMCMotherMass == kTRUE){ histograms->AddHistogram("MC_Mother_Mass" ,"" , kGCnXBinsGammaMass, kGCfirstXBinGammaMass, kGClastXBinGammaMass, "", "");}
1926       if(kGCplotMCMotherOpeningAngle == kTRUE){ histograms->AddHistogram("MC_Mother_GammaDaughter_OpeningAngle" ,"" , kGCnXBinsOpeningAngle, kGCfirstXBinOpeningAngle, kGClastXBinOpeningAngle, "", "");}
1927       if(kGCplotMCMotherR == kTRUE){ histograms->AddHistogram("MC_Mother_R" ,"" , kGCnXBinsR, kGCfirstXBinR, kGClastXBinR, "", "");}
1928       if(kGCplotMCMotherZR == kTRUE){ histograms->AddHistogram("MC_Mother_ZR" ,"" , kGCnXBinsZR, kGCfirstXBinZR, kGClastXBinZR, kGCnYBinsZR, kGCfirstYBinZR, kGClastYBinZR, "", "");}
1929       if(kGCplotMCMotherXY == kTRUE){ histograms->AddHistogram("MC_Mother_XY" ,"" , kGCnXBinsXY, kGCfirstXBinXY, kGClastXBinXY, kGCnYBinsXY, kGCfirstYBinXY, kGClastYBinXY, "", "");}
1930       if(kGCplotMCMotherPtvsEtaWithinAcceptance == kTRUE){ histograms->AddHistogram("MC_Mother_Pt_Eta_withinAcceptance" ,"" , kGCnXBinsPt, kGCfirstXBinPt, kGClastXBinPt, kGCnXBinsEta, kGCfirstXBinEta, kGClastXBinEta, "", "");}
1931       if(kGCplotMCMotherPtvsRapidWithinAcceptance == kTRUE){ histograms->AddHistogram("MC_Mother_Pt_Rapid_withinAcceptance" ,"" , kGCnXBinsPt, kGCfirstXBinPt, kGClastXBinPt, kGCnXBinsRapid, kGCfirstXBinRapid, kGClastXBinRapid, "", "");}
1932       if(kGCplotMCMotherPtvsEtaConvGammaWithinAcceptance == kTRUE){ histograms->AddHistogram("MC_Mother_Pt_Eta_ConvGamma_withinAcceptance" ,"" , kGCnXBinsPt, kGCfirstXBinPt, kGClastXBinPt, kGCnXBinsEta, kGCfirstXBinEta, kGClastXBinEta, "", "");}
1933       if(kGCplotMCMotherPtvsRapidConvGammaWithinAcceptance == kTRUE){ histograms->AddHistogram("MC_Mother_Pt_Rapid_ConvGamma_withinAcceptance" ,"" , kGCnXBinsPt, kGCfirstXBinPt, kGClastXBinPt, kGCnXBinsRapid, kGCfirstXBinRapid, kGClastXBinRapid, "", "");}
1934                 
1935       if(kGCplotMCMotherSpectra == kTRUE){ 
1936         histograms->AddHistogram("MC_Mother_InvMass_vs_Pt" ,"" ,kGCnXBinsSpectra, kGCfirstXBinSpectra, kGClastXBinSpectra, kGCnYBinsSpectra, kGCfirstYBinSpectra, kGClastYBinSpectra, "", "");
1937         histograms->AddHistogram("MC_Mother_InvMass_vs_Pt_withinAcceptance" ,"" ,kGCnXBinsSpectra, kGCfirstXBinSpectra, kGClastXBinSpectra, kGCnYBinsSpectra, kGCfirstYBinSpectra, kGClastYBinSpectra, "", "");
1938         histograms->AddHistogram("MC_Mother_InvMass_vs_Pt_ConvGamma_withinAcceptance" ,"" ,kGCnXBinsSpectra, kGCfirstXBinSpectra, kGClastXBinSpectra, kGCnYBinsSpectra, kGCfirstYBinSpectra, kGClastYBinSpectra, "", "");
1939       }
1940                 
1941                 
1942       if(kGCplotMCPi0Eta == kTRUE){ histograms->AddHistogram("MC_Pi0_Eta" ,"" , kGCnXBinsEta, kGCfirstXBinEta, kGClastXBinEta, "", "");}        
1943       if(kGCplotMCPi0Rapid == kTRUE){ histograms->AddHistogram("MC_Pi0_Rapid" ,"" , kGCnXBinsRapid, kGCfirstXBinRapid, kGClastXBinRapid, "", "");}      
1944       if(kGCplotMCPi0Phi == kTRUE){ histograms->AddHistogram("MC_Pi0_Phi" ,"" , kGCnXBinsPhi, kGCfirstXBinPhi, kGClastXBinPhi, "", "");}
1945       if(kGCplotMCPi0Pt == kTRUE){ histograms->AddHistogram("MC_Pi0_Pt" ,"" , kGCnXBinsPt, kGCfirstXBinPt, kGClastXBinPt, "", "");}
1946       if(kGCplotMCPi0PtFiducial == kTRUE){ histograms->AddHistogram("MC_Pi0_Pt_Fiducial" ,"" , kGCnXBinsPt, kGCfirstXBinPt, kGClastXBinPt, "", "");}
1947       if(kGCplotMCPi0PtWithinAcceptanceFiducial == kTRUE){ histograms->AddHistogram("MC_Pi0_Pt_withinAcceptance_Fiducial" ,"" , kGCnXBinsPt,kGCfirstXBinPt, kGClastXBinPt, "", "");}
1948       if(kGCplotMCPi0PtConvGammaWithinAcceptanceFiducial == kTRUE){ histograms->AddHistogram("MC_Pi0_Pt_ConvGamma_withinAcceptance_Fiducial","" , kGCnXBinsPt, kGCfirstXBinPt, kGClastXBinPt, "", "");}
1949
1950       if(kGCplotMCPi0Energy == kTRUE){ histograms->AddHistogram("MC_Pi0_Energy" ,"" , kGCnXBinsEnergy, kGCfirstXBinEnergy, kGClastXBinEnergy, "", "");}
1951       if(kGCplotMCPi0Mass == kTRUE){ histograms->AddHistogram("MC_Pi0_Mass" ,"" , kGCnXBinsPi0Mass, kGCfirstXBinPi0Mass, kGClastXBinPi0Mass, "", "");}
1952       if(kGCplotMCPi0Alpha == kTRUE){ histograms->AddHistogram("MC_Pi0_alpha" ,"" , kGCnXBinsPi0Mass, kGCfirstXBinPi0Alpha, kGClastXBinPi0Alpha, "", "");}
1953
1954       if(kGCplotMCPi0OpeningAngle == kTRUE){ histograms->AddHistogram("MC_Pi0_GammaDaughter_OpeningAngle" ,"" , kGCnXBinsOpeningAngle, kGCfirstXBinOpeningAngle, kGClastXBinOpeningAngle, "", "");}
1955       if(kGCplotMCPi0R == kTRUE){ histograms->AddHistogram("MC_Pi0_R" ,"" , kGCnXBinsR, kGCfirstXBinR, kGClastXBinR, "", "");}
1956       if(kGCplotMCPi0ZR == kTRUE){ histograms->AddHistogram("MC_Pi0_ZR" ,"" , kGCnXBinsZR, kGCfirstXBinZR, kGClastXBinZR, kGCnYBinsZR, kGCfirstYBinZR, kGClastYBinZR, "", "");}
1957       if(kGCplotMCPi0XY == kTRUE){ histograms->AddHistogram("MC_Pi0_XY" ,"" , kGCnXBinsXY, kGCfirstXBinXY, kGClastXBinXY, kGCnYBinsXY, kGCfirstYBinXY, kGClastYBinXY, "", "");}
1958       if(kGCplotMCPi0PtvsEtaWithinAcceptance == kTRUE){ histograms->AddHistogram("MC_Pi0_Pt_Eta_withinAcceptance" ,"" , kGCnXBinsPt, kGCfirstXBinPt, kGClastXBinPt, kGCnXBinsEta, kGCfirstXBinEta, kGClastXBinEta, "", "");}
1959       if(kGCplotMCPi0PtvsRapidWithinAcceptance == kTRUE){ histograms->AddHistogram("MC_Pi0_Pt_Rapid_withinAcceptance" ,"" , kGCnXBinsPt, kGCfirstXBinPt, kGClastXBinPt, kGCnXBinsRapid, kGCfirstXBinRapid, kGClastXBinRapid, "", "");}
1960       if(kGCplotMCPi0PtvsEtaConvGammaWithinAcceptance == kTRUE){ histograms->AddHistogram("MC_Pi0_Pt_Eta_ConvGamma_withinAcceptance" ,"" , kGCnXBinsPt, kGCfirstXBinPt, kGClastXBinPt, kGCnXBinsEta, kGCfirstXBinEta, kGClastXBinEta, "", "");}
1961       if(kGCplotMCPi0PtvsRapidConvGammaWithinAcceptance == kTRUE){ histograms->AddHistogram("MC_Pi0_Pt_Rapid_ConvGamma_withinAcceptance" ,"" , kGCnXBinsPt, kGCfirstXBinPt, kGClastXBinPt, kGCnXBinsRapid, kGCfirstXBinRapid, kGClastXBinRapid, "", "");}
1962       if(kGCplotMCPi0ZRConvGammaWithinAcceptance == kTRUE){ histograms->AddHistogram("MC_Pi0_ZR_ConvGamma_withinAcceptance" ,"" , kGCnXBinsZR, kGCfirstXBinZR, kGClastXBinZR, kGCnYBinsZR, kGCfirstYBinZR, kGClastYBinZR, "", "");}
1963                 
1964                 
1965       if(kGCplotMCPi0SecondaryEta == kTRUE){ histograms->AddHistogram("MC_Pi0_Secondaries_Eta" ,"" , kGCnXBinsEta, kGCfirstXBinEta, kGClastXBinEta, "", "");}
1966       if(kGCplotMCPi0SecondaryRapid == kTRUE){ histograms->AddHistogram("MC_Pi0_Secondaries_Rapid" ,"" , kGCnXBinsRapid, kGCfirstXBinRapid, kGClastXBinRapid, "", "");}
1967       if(kGCplotMCPi0SecondaryPhi == kTRUE){ histograms->AddHistogram("MC_Pi0_Secondaries_Phi" ,"" , kGCnXBinsPhi, kGCfirstXBinPhi, kGClastXBinPhi, "", "");}
1968       if(kGCplotMCPi0SecondaryPt == kTRUE){ histograms->AddHistogram("MC_Pi0_Secondaries_Pt" ,"" , kGCnXBinsPt, kGCfirstXBinPt, kGClastXBinPt, "", "");}
1969       if(kGCplotMCPi0SecondaryEnergy == kTRUE){ histograms->AddHistogram("MC_Pi0_Secondaries_Energy" ,"" , kGCnXBinsEnergy, kGCfirstXBinEnergy, kGClastXBinEnergy, "", "");}
1970       if(kGCplotMCPi0SecondaryMass == kTRUE){ histograms->AddHistogram("MC_Pi0_Secondaries_Mass" ,"" , kGCnXBinsPi0Mass, kGCfirstXBinPi0Mass, kGClastXBinPi0Mass, "", "");}
1971       if(kGCplotMCPi0SecondaryOpeningAngle == kTRUE){ histograms->AddHistogram("MC_Pi0_Secondaries_GammaDaughter_OpeningAngle" ,"" , kGCnXBinsOpeningAngle, kGCfirstXBinOpeningAngle, kGClastXBinOpeningAngle, "", "");}
1972       if(kGCplotMCPi0SecondaryR == kTRUE){ histograms->AddHistogram("MC_Pi0_Secondaries_R" ,"" , kGCnXBinsR, kGCfirstXBinR, kGClastXBinR, "", "");}
1973       if(kGCplotMCPi0SecondaryZR == kTRUE){ histograms->AddHistogram("MC_Pi0_Secondaries_ZR" ,"" , kGCnXBinsZR, kGCfirstXBinZR, kGClastXBinZR, kGCnYBinsZR, kGCfirstYBinZR, kGClastYBinZR, "", "");}
1974       if(kGCplotMCPi0SecondaryXY == kTRUE){ histograms->AddHistogram("MC_Pi0_Secondaries_XY" ,"" , kGCnXBinsXY, kGCfirstXBinXY, kGClastXBinXY, kGCnYBinsXY, kGCfirstYBinXY, kGClastYBinXY, "", "");}
1975       if(kGCplotMCPi0SecondaryPtvsEtaWithinAcceptance == kTRUE){ histograms->AddHistogram("MC_Pi0_Secondaries_Pt_Eta_withinAcceptance" ,"" , kGCnXBinsPt, kGCfirstXBinPt, kGClastXBinPt, kGCnXBinsEta, kGCfirstXBinEta, kGClastXBinEta, "", "");}
1976       if(kGCplotMCPi0SecondaryPtvsRapidWithinAcceptance == kTRUE){ histograms->AddHistogram("MC_Pi0_Secondaries_Pt_Rapid_withinAcceptance" ,"" , kGCnXBinsPt, kGCfirstXBinPt, kGClastXBinPt, kGCnXBinsRapid, kGCfirstXBinRapid, kGClastXBinRapid, "", "");}
1977       if(kGCplotMCPi0SecondaryPtvsEtaConvGammaWithinAcceptance == kTRUE){ histograms->AddHistogram("MC_Pi0_Secondaries_Pt_Eta_ConvGamma_withinAcceptance" ,"" , kGCnXBinsPt, kGCfirstXBinPt, kGClastXBinPt, kGCnXBinsEta, kGCfirstXBinEta, kGClastXBinEta, "", "");}
1978       if(kGCplotMCPi0SecondaryPtvsRapidConvGammaWithinAcceptance == kTRUE){ histograms->AddHistogram("MC_Pi0_Secondaries_Pt_Rapid_ConvGamma_withinAcceptance" ,"" , kGCnXBinsPt, kGCfirstXBinPt, kGClastXBinPt, kGCnXBinsRapid, kGCfirstXBinRapid, kGClastXBinRapid, "", "");}
1979                 
1980                 
1981                 
1982       if(kGCplotMCEtaEta == kTRUE){ histograms->AddHistogram("MC_Eta_Eta" ,"" , kGCnXBinsEta, kGCfirstXBinEta, kGClastXBinEta, "", "");}
1983       if(kGCplotMCEtaRapid == kTRUE){ histograms->AddHistogram("MC_Eta_Rapid" ,"" , kGCnXBinsRapid, kGCfirstXBinRapid, kGClastXBinRapid, "", "");}
1984       if(kGCplotMCEtaPhi == kTRUE){ histograms->AddHistogram("MC_Eta_Phi" ,"" , kGCnXBinsPhi, kGCfirstXBinPhi, kGClastXBinPhi, "", "");}
1985       if(kGCplotMCEtaPt == kTRUE){ histograms->AddHistogram("MC_Eta_Pt" ,"" , kGCnXBinsPt, kGCfirstXBinPt, kGClastXBinPt, "", "");}
1986       if(kGCplotMCEtaEnergy == kTRUE){ histograms->AddHistogram("MC_Eta_Energy" ,"" , kGCnXBinsEnergy, kGCfirstXBinEnergy, kGClastXBinEnergy, "", "");}
1987       if(kGCplotMCEtaMass == kTRUE){ histograms->AddHistogram("MC_Eta_Mass" ,"" , kGCnXBinsEtaMass, kGCfirstXBinEtaMass, kGClastXBinEtaMass, "", "");}
1988       if(kGCplotMCEtaOpeningAngleGamma == kTRUE){ histograms->AddHistogram("MC_Eta_GammaDaughter_OpeningAngle" ,"" , kGCnXBinsOpeningAngle, kGCfirstXBinOpeningAngle, kGClastXBinOpeningAngle, "", "");}
1989       if(kGCplotMCEtaR == kTRUE){ histograms->AddHistogram("MC_Eta_R" ,"" , kGCnXBinsR, kGCfirstXBinR, kGClastXBinR, "", "");}
1990       if(kGCplotMCEtaZR == kTRUE){ histograms->AddHistogram("MC_Eta_ZR" ,"" , kGCnXBinsZR, kGCfirstXBinZR, kGClastXBinZR, kGCnYBinsZR, kGCfirstYBinZR, kGClastYBinZR, "", "");}
1991       if(kGCplotMCEtaXY == kTRUE){ histograms->AddHistogram("MC_Eta_XY" ,"" , kGCnXBinsXY, kGCfirstXBinXY, kGClastXBinXY, kGCnYBinsXY, kGCfirstYBinXY, kGClastYBinXY, "", "");}
1992       if(kGCplotMCEtaPtvsEtaWithinAcceptance == kTRUE){ histograms->AddHistogram("MC_Eta_Pt_Eta_withinAcceptance" ,"" , kGCnXBinsPt, kGCfirstXBinPt, kGClastXBinPt, kGCnXBinsEta, kGCfirstXBinEta, kGClastXBinEta, "", "");}
1993       if(kGCplotMCEtaPtvsRapidWithinAcceptance == kTRUE){ histograms->AddHistogram("MC_Eta_Pt_Rapid_withinAcceptance" ,"" , kGCnXBinsPt, kGCfirstXBinPt, kGClastXBinPt, kGCnXBinsRapid, kGCfirstXBinRapid, kGClastXBinRapid, "", "");}
1994       if(kGCplotMCEtaPtvsEtaConvGammaWithinAcceptance == kTRUE){ histograms->AddHistogram("MC_Eta_Pt_Eta_ConvGamma_withinAcceptance" ,"" , kGCnXBinsPt, kGCfirstXBinPt, kGClastXBinPt, kGCnXBinsEta, kGCfirstXBinEta, kGClastXBinEta, "", "");}
1995       if(kGCplotMCEtaPtvsRapidConvGammaWithinAcceptance == kTRUE){ histograms->AddHistogram("MC_Eta_Pt_Rapid_ConvGamma_withinAcceptance" ,"" , kGCnXBinsPt, kGCfirstXBinPt, kGClastXBinPt, kGCnXBinsRapid, kGCfirstXBinRapid, kGClastXBinRapid, "", "");}
1996       if(kGCplotMCEtaZRConvGammaWithinAcceptance == kTRUE){ histograms->AddHistogram("MC_Eta_ZR_ConvGamma_withinAcceptance" ,"" , kGCnXBinsZR, kGCfirstXBinZR, kGClastXBinZR, kGCnYBinsZR, kGCfirstYBinZR, kGClastYBinZR, "", "");} 
1997     }
1998     
1999   }// end kGCrunNeutralMeson
2000
2001   
2002   //---------------------------------------------------  2 gamma Background -------------------------------------------------------
2003
2004   if(kGCcalculateBackground==kTRUE){
2005     histograms->AddHistogram("ESD_Z_distribution" ,"Z primary vertex" , 2000, -30, 30,"Z[cm]","counts");
2006     histograms->AddHistogram("ESD_multiplicity_distribution" ,"multiplicity distribution" , 200, 0, 200,"counts","Multiplicity");
2007     histograms->AddHistogram("ESD_ZvsMultiplicity" ,"Z vs Multiplicity" , 1000, -10, 10,200,0,200,"Z[cm]","Multiplicity");
2008   }
2009 }
2010
2011
2012
2013 Int_t SetAnalysisCutSelection(TString analysisCutSelection){
2014   Int_t iResult=0;
2015   
2016   // set the cuts depending on the Cut Selection Id
2017   // first number is dummy always set to 9 
2018   //  const char* cutSelection = analysisCutSelection.Data(); 
2019   if(analysisCutSelection.Length()!=10){
2020     cout<<"Cut selection has the wrong length!"<<endl;
2021     return 0;
2022   }
2023
2024   char cutSelection[] = analysisCutSelection.Data();
2025   int array[c_array_size];
2026   const int N = sizeof(array) / sizeof(int);
2027   string2array( cutSelection, array );
2028
2029
2030
2031   Int_t goodId=array[0];
2032   Int_t v0FinderType=array[1];
2033   Int_t eProbCut=array[2];
2034   Int_t ededxSigmaCut=array[3];
2035   Int_t pidedxSigmaCut=array[4];
2036   Int_t piMomdedxSigmaCut=array[5];
2037   Int_t chi2GammaCut=array[6];
2038   Int_t singlePtCut=array[7];
2039   Int_t clsTPCCut=array[8];
2040   Int_t etaCut=array[9];
2041
2042
2043
2044   cout<<"etaCut: "<<etaCut<<endl;
2045   cout<<"clsTPCCut: "<<clsTPCCut<<endl;
2046   cout<<"singlePtCut: "<<singlePtCut<<endl;
2047   cout<<"chi2GammaCut: "<<chi2GammaCut<<endl;
2048   cout<<"piMomdedxSigmaCut: "<<piMomdedxSigmaCut<<endl;
2049   cout<<"pidedxSigmaCut: "<<pidedxSigmaCut <<endl;
2050   cout<<"ededxSigmaCut: "<<ededxSigmaCut <<endl;
2051   cout<<"eProbCut: "<< eProbCut<<endl;
2052   cout<<"v0FinderType: "<<v0FinderType <<endl;
2053   cout<<"goodId: "<<goodId <<endl;
2054
2055   if(goodId !=9){
2056     cout<<"Analysis Cut Selection too short or does not start with 9"<<endl;
2057     return iResult;
2058   }
2059
2060   switch (v0FinderType){
2061   case 0:  // on fly V0 finder
2062     kGCUseOnFlyV0Finder=kTRUE;
2063     break;
2064   case 1:  // offline V0 finder
2065     kGCUseOnFlyV0Finder=kFALSE;
2066     break;
2067   default:
2068     return iResult;
2069   }
2070   switch(eProbCut){
2071   case 0:  // 0.
2072     kGCprobElectron = 0.000;
2073     break;
2074   case 1:  // 0.001
2075     kGCprobElectron = 0.001;
2076     break;
2077   case 2:  // 0.01
2078     kGCprobElectron = 0.01;
2079     break;
2080   default:
2081     return iResult;
2082   }
2083
2084   switch(ededxSigmaCut){
2085   case 0: // -10,10
2086     kGCPIDnSigmaBelowElectronLine=-10;
2087     kGCPIDnSigmaAboveElectronLine=10;
2088     break;
2089   case 1: // -5,5 
2090     kGCPIDnSigmaBelowElectronLine=-5;
2091     kGCPIDnSigmaAboveElectronLine=5;
2092     break;
2093   case 2: // -3,5
2094     kGCPIDnSigmaBelowElectronLine=-3;
2095     kGCPIDnSigmaAboveElectronLine=5;
2096     break;
2097   default:
2098     return iResult;
2099   }
2100   
2101   switch(pidedxSigmaCut){
2102   case 0:  // -10
2103     kGCPIDnSigmaAbovePionLine=-10;
2104     break;
2105   case 1:   // 0
2106     kGCPIDnSigmaAbovePionLine=0;
2107     break;
2108   case 2:  // 1
2109     kGCPIDnSigmaAbovePionLine=1;
2110     break;
2111   default:
2112     return iResult;
2113   }
2114   
2115   switch(piMomdedxSigmaCut){
2116   case 0:  // 0.5 GeV
2117     kGCPIDMinPnSigmaAbovePionLine=0.5;
2118     break;
2119   case 1:  // 1. GeV
2120     kGCPIDMinPnSigmaAbovePionLine=1.;
2121     break;
2122   case 2:  // 1.5 GeV
2123     kGCPIDMinPnSigmaAbovePionLine=1.5;
2124     break;
2125   default:
2126     return iResult;
2127   }
2128   
2129   switch(chi2GammaCut){
2130   case 0: // 100
2131     kGCchi2CutConversion = 100.;
2132     break;
2133   case 1:  // 50
2134     kGCchi2CutConversion = 50.;
2135     break;
2136   case 2:  // 30
2137     kGCchi2CutConversion = 30.;
2138     break;
2139   default:
2140     return iResult;
2141   }
2142
2143   switch(singlePtCut){
2144   case 0: // 0.050 GeV
2145     kGCsingleptCut = 0.050;
2146     break;
2147   case 1:  // 0.100 GeV
2148     kGCsingleptCut = 0.100;
2149     break;
2150   case 2:  // 0.150 GeV
2151     kGCsingleptCut = 0.150;
2152     break;
2153   case 3:  // 0.200 GeV
2154     kGCsingleptCut = 0.200;
2155     break;
2156   default:
2157     return iResult;
2158  }
2159
2160   switch(clsTPCCut){
2161   case 0: // 0 
2162     kGCminClsTPCCut= 0.;
2163     break;
2164   case 1:  // 70 
2165     kGCminClsTPCCut= 70.;
2166     break;
2167   case 2:  // 80 
2168     kGCminClsTPCCut= 80.;
2169     break;
2170   case 3:  // 100 
2171     kGCminClsTPCCut= 100.;
2172     break;
2173   default:
2174     return iResult;
2175   }
2176
2177   switch(etaCut){
2178   case 0: // 0.9 
2179     kGCetaCut    = 0.9;
2180     kGCLineCutZRSlope = tan(2*atan(exp(-kGCetaCut)));
2181     break;
2182   case 1:  // 1.2
2183     kGCetaCut    = 1.2;
2184     kGCLineCutZRSlope = tan(2*atan(exp(-kGCetaCut)));
2185     break;
2186   case 2:  // 1.4
2187     kGCetaCut    = 1.4;
2188     kGCLineCutZRSlope = tan(2*atan(exp(-kGCetaCut)));
2189     break;
2190   default:
2191     return iResult;
2192   }
2193
2194   iResult=1;
2195   return iResult;
2196 }
2197
2198
2199 void string2array(const std::string& number, int a[c_array_size]) 
2200 {
2201     if (number.size() == c_array_size) {
2202 #define ASSIGNARRAY(i)  a[i] = number[i] - '0'
2203         ASSIGNARRAY(0);
2204         ASSIGNARRAY(1);
2205         ASSIGNARRAY(2);
2206         ASSIGNARRAY(3);
2207         ASSIGNARRAY(4);
2208         ASSIGNARRAY(5);
2209         ASSIGNARRAY(6);
2210         ASSIGNARRAY(7);
2211         ASSIGNARRAY(8);
2212         ASSIGNARRAY(9);
2213   }
2214 }
2215
2216
2217
2218