]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWG4/macros/ConfigGammaConversion.C
Adding the possibility to read additional tracks or MC information to the AOD momentu...
[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 = 26;
19
20 class AliAnalysisDataContainer;
21 class AliGammaConversionHistograms;
22 class AliAnalysisTaskGammaConversion;
23 class AliAnalysisTaskGammaJet;
24
25 // set this to a number if you want to analyze a set number of files
26 // if it is 0 it will analyze the files listed in the data list
27 Int_t kGCnumberOfFilesToAnalyze=0;
28
29 Bool_t kGCrunNeutralMeson = kTRUE;
30 Bool_t kGCrunJet          = kFALSE;
31 Bool_t kGCrunChic         = kFALSE;
32 Bool_t kGCrunDalitz       = kFALSE;
33 Bool_t kGCrunCF           = kFALSE;
34 Bool_t kGCcalculateBackground = kTRUE;
35 Bool_t kGCdoNeutralMesonV0MCCheck =kFALSE;
36 Bool_t kGCrunOmegaMeson = kFALSE;
37 Bool_t kGCrunRES = kFALSE;
38 Bool_t kGCRecalculateV0ForGamma = kFALSE;
39 Bool_t kGCUseTrackMultiplicityForBG = kTRUE;
40 Bool_t kGCMoveParticlesAccordingToVertex = kFALSE;
41 Bool_t kGCLowMemoryConsumption = kFALSE;
42 Bool_t kGCApplyChi2Cut = kFALSE;
43
44 Bool_t kGCUseRotationMethodInBG=kTRUE;
45 Int_t kGCnDegreeRotationPMForBG=15;
46 Int_t kGCnumberOfRotationEventsForBG=15;
47 Bool_t kGCdoBGProbability=kFALSE;
48 //Svein 
49 Bool_t kGCRunGammaJetTask = kFALSE;
50 /** ---------------------------------- define cuts here ------------------------------------*/
51 TString kGCAnalysisCutSelectionId="90035620401003321022000000"; // do not change here, use -set-cut-selection in argument instead
52
53 Int_t kGCNEventsForBGCalculation=20;
54
55 Int_t kGCpidOfNegativeTrack=11;
56 Int_t kGCpidOfPositiveTrack=-11;
57
58 Double_t kGCmaxVertexZ   = 10.;
59 Double_t kGCmaxRCut   = 180.;
60 Double_t kGCminRCut   = 2.8;
61 Double_t kGCetaCut    = 0.9;
62 Double_t kGCptCut     = 0.02;
63 Double_t kGCsingleptCut = 0.02;
64 Double_t kGCmaxZCut     = 240.;
65 Double_t kGCminClsTPCCut= 0.;
66 Double_t kGCminClsTPCCutToF= 0.;
67 Double_t kGCchi2CutConversion   = 30.;
68 Double_t kGCchi2CutMeson   = 50.;
69 Double_t kGCalphaCutMeson   = 0.7;
70 Double_t kGCalphaMinCutMeson   = 0.0;
71 Double_t kGCrapidityCutMeson    = 0.9;
72
73 Double_t kGCLineCutZRSlope = tan(2*atan(exp(-kGCetaCut)));
74 Double_t kGCLineCutZValue = 7.;
75
76
77 Double_t kGCxVertexCut = 0.;
78 Double_t kGCyVertexCut = 0.;
79 Double_t kGCzVertexCut = 0.;
80
81 Double_t kGCsigmaCutGammaMass=0.0001;
82
83 Bool_t kGCuseImprovedVertex = kTRUE;
84
85 Bool_t kGCUseOnFlyV0Finder = kTRUE;
86
87 // define masses of different particles, this will be used by the KF particle
88 // together with the width to set mass constraints. Units in GeV.
89 Double_t kGCelectronMass = 0.00051099892;
90 Double_t kGCgammaMass    = 0.;
91 Double_t kGCpi0Mass      = 0.1349766;
92 Double_t kGCetaMass      = 0.54751;
93
94 // define the width constraint used by KF particle.
95 Double_t kGCgammaWidth = 0.01;
96 Double_t kGCpi0Width   = 0.01;
97 Double_t kGCetaWidth   = 0.01;
98
99 // define the probability of track being an electron
100 Double_t kGCprobElectron = 0.000;
101
102 Double_t kGCminOpeningAngleGhostCut = 0.005;
103
104 Bool_t kGCRemovePileUp = kFALSE;
105
106 Bool_t kGCSelectV0AND = kFALSE;
107 Bool_t kGCUseMultiplicity = kFALSE;
108 Int_t  kGCUseMultiplicityBin=0;
109
110 Int_t kGCIsHeavyIon = 0;
111 Int_t kGCUseCentrality = 0;
112 Int_t  kGCUseCentralityBin = 0;
113
114
115
116 /** ---------------------------------- define pi0 dalitz cuts here ------------------------------------*/
117
118 Bool_t kGCRunStandalone    = kTRUE;
119 Bool_t kGCUseBayesPID      = kFALSE;
120 Bool_t kGCUseTrackIndexCut = kTRUE;
121 Bool_t kGCUsePsiPairCut    = kTRUE;
122 Bool_t kGCUseMassCut       = kFALSE;
123 Bool_t kGCUseGammaCut      = kFALSE;
124 Bool_t kGCReadMagFieldSign = kTRUE;
125 Bool_t kGCUseAliKF         = kFALSE;
126
127 Double_t kGCPsiPairCut                 = 0.45;
128 Double_t kGCDeltaPhiCutMin             = 0.;
129 Double_t kGCDeltaPhiCutMax             = 0.12;
130 Double_t kGCMassCutMin                 = 0.;
131 Double_t kGCMassCutMax                 = 0.1;
132 Double_t kGCNSigmaBelowElecTPCbethe    = -2.;
133 Double_t kGCNSigmaAboveElecTPCbethe    = 3.;
134 Double_t kGCNSigmaAbovePionTPCbethe    = 2.;
135 Double_t kGCNSigmaAboveKaonTPCbethe    = 2.;
136 Double_t kGCNSigmaAboveProtonTPCbethe  = 2.;
137
138 Int_t kGCTrkSelectionCriteria          = 1;     // kITSsaTrack=0, kGlobalTrack=1, kITSsaGlobalTrack=2
139 // NOTE: for details in the track cuts and defined histograms see AddGammaConvDalitz.C
140
141 /** ----------------------------------end define cuts here----------------------------------*/
142
143 /** -------------------------------- Phi/R Mapping ---------------------------------------*/
144 Int_t kGCnPhiIndex = 8;
145 Int_t kGCnRIndex   = 14;
146
147 Double_t kGCminRadius   = 0.;
148 Double_t kGCmaxRadius   = 200.;
149 Double_t kGCminPhi      = -TMath::Pi();
150 Double_t kGCmaxPhi      = TMath::Pi();
151 /** ------------------------------- end Phi/R Mapping ------------------------------------*/
152
153 Bool_t kGCdoOwnXYZCalculation = kFALSE;
154 Bool_t kGCdoConstructGamma = kFALSE;
155
156 /** -------------AOD stuff ---------------------------------------------------------------*/
157 TString kGCDeltaAODFilename = "AliAODGammaConversion.root";  //If empty, writes to standard common aod file.
158 Bool_t kGCWriteAOD =kTRUE;    // Turn on AOD 
159 Bool_t kGCForceAOD = kFALSE;  // Call AliAnalysisManager::SetFillAOD(kTRUE) every ESD event. 
160
161 /** ------------------- define which histograms to plot here --------------------------------*/
162 /**   NB: to change the bin numbers, see below the histogram flags                           */
163
164 Bool_t kGCplotEventQuality              = kTRUE;
165
166
167 // MC GAMMA DECAY PLOTS
168 Bool_t kGCplotMCGammaFromDecay          = kTRUE;
169 // NEUTRAL MESON PLOTS
170 Bool_t kGCplotMCConversionR             = kTRUE;
171 Bool_t kGCplotMCConversionZR            = kTRUE;
172 Bool_t kGCplotMCConversionXY            = kTRUE;
173 Bool_t kGCplotMCConversionOpeningAngle  = kTRUE;
174 Bool_t kGCplotMCConvGammaEAsymmetryP    = kTRUE;
175 Bool_t kGCplotMCConvGammaPAsymmetryP    = kTRUE;
176
177
178 Bool_t kGCplotMCEEnergy  = kFALSE;
179 Bool_t kGCplotMCEPt      = kTRUE;
180 Bool_t kGCplotMCEEta     = kTRUE;
181 Bool_t kGCplotMCEPhi     = kTRUE;
182 Bool_t kGCplotMCENTPCClusters = kTRUE;
183 Bool_t kGCplotMCENITSClusters = kTRUE;
184
185 Bool_t kGCplotMCPEnergy  = kFALSE;
186 Bool_t kGCplotMCPPt      = kTRUE;
187 Bool_t kGCplotMCPEta     = kTRUE;
188 Bool_t kGCplotMCPPhi     = kTRUE;
189 Bool_t kGCplotMCPNTPCClusters = kTRUE;
190 Bool_t kGCplotMCPNITSClusters = kTRUE;
191
192 Bool_t kGCplotMCallGammaEnergy = kFALSE;
193 Bool_t kGCplotMCallGammaPt     = kTRUE;
194 Bool_t kGCplotMCallGammaEta    = kTRUE;
195 Bool_t kGCplotMCallGammaPhi    = kTRUE;
196 Bool_t kGCplotMCallGammaRapid  = kTRUE;
197
198
199 Bool_t kGCplotMCConvGammaEnergy  = kFALSE;
200 Bool_t kGCplotMCConvGammaPt      = kTRUE;
201 Bool_t kGCplotMCConvGammaEta     = kTRUE;
202 Bool_t kGCplotMCConvGammaPhi     = kTRUE;
203 Bool_t kGCplotMCConvGammaRapid   = kTRUE;
204 Bool_t kGCplotMCConvGammaPtvsEta = kTRUE;
205
206 Bool_t kGCplotMCallDirectGammaEnergy  = kFALSE;
207 Bool_t kGCplotMCallDirectGammaPt      = kTRUE;
208 Bool_t kGCplotMCallDirectGammaEta     = kTRUE;
209 Bool_t kGCplotMCallDirectGammaPhi     = kTRUE;
210 Bool_t kGCplotMCallDirectGammaRapid   = kTRUE;
211
212 Bool_t kGCplotMCConvDirectGammaEnergy  = kFALSE;
213 Bool_t kGCplotMCConvDirectGammaPt      = kTRUE;
214 Bool_t kGCplotMCConvDirectGammaEta     = kTRUE;
215 Bool_t kGCplotMCConvDirectGammaPhi     = kTRUE;
216 Bool_t kGCplotMCConvDirectGammaRapid   = kTRUE;
217
218 Bool_t kGCplotMCMotherEta                                       = kTRUE;
219 Bool_t kGCplotMCMotherRapid                                = kTRUE;
220 Bool_t kGCplotMCMotherPhi                                       = kTRUE;
221 Bool_t kGCplotMCMotherPt                                        = kTRUE;
222 Bool_t kGCplotMCMotherEnergy                            = kFALSE;
223 Bool_t kGCplotMCMotherMass                                      = kTRUE;
224 Bool_t kGCplotMCMotherOpeningAngle                              = kTRUE;
225 Bool_t kGCplotMCMotherR                                 = kTRUE;
226 Bool_t kGCplotMCMotherZR                                        = kFALSE;
227 Bool_t kGCplotMCMotherXY                                        = kFALSE;
228 Bool_t kGCplotMCMotherPtvsEtaWithinAcceptance              = kTRUE;
229 Bool_t kGCplotMCMotherPtvsRapidWithinAcceptance            = kTRUE;
230 Bool_t kGCplotMCMotherPtvsEtaConvGammaWithinAcceptance     = kTRUE;
231 Bool_t kGCplotMCMotherPtvsRapidConvGammaWithinAcceptance   = kTRUE;
232 Bool_t kGCplotMCMotherSpectra                           = kTRUE;
233
234 Bool_t kGCplotMCPhysicalPrimaryChargedPt                = kTRUE;
235
236 Bool_t kGCplotMCPi0Eta                                  = kTRUE;
237 Bool_t kGCplotMCPi0Rapid                                   = kTRUE;
238 Bool_t kGCplotMCPi0PtvsRapid                               = kTRUE;
239 Bool_t kGCplotMCPi0Phi                                     = kTRUE;
240 Bool_t kGCplotMCPi0Pt                                      = kTRUE;
241 Bool_t kGCplotMCPi0PtFiducial                              = kTRUE;
242 Bool_t kGCplotMCPi0PtWithinAcceptanceFiducial              = kTRUE;
243 Bool_t kGCplotMCPi0PtConvGammaWithinAcceptanceFiducial     = kTRUE;
244 Bool_t kGCplotMCPi0OpeningPtConvGammaWithinAcceptance      = kTRUE;
245 Bool_t kGCplotMCPi0PtGammaPtConvGammaWithinAcceptance = kTRUE;
246 Bool_t kGCplotMCPi0Energy                                  = kFALSE;
247 Bool_t kGCplotMCPi0Mass                                    = kTRUE;
248 Bool_t kGCplotMCPi0Alpha                                   = kTRUE;
249 Bool_t kGCplotMCPi0OpeningAngle                            = kTRUE;
250 Bool_t kGCplotMCPi0R                                       = kTRUE;
251 Bool_t kGCplotMCPi0ZR                                      = kFALSE;
252 Bool_t kGCplotMCPi0XY                                      = kFALSE;
253 Bool_t kGCplotMCPi0PtvsEtaWithinAcceptance                 = kTRUE;
254 Bool_t kGCplotMCPi0PtvsRapidWithinAcceptance               = kTRUE;
255 Bool_t kGCplotMCPi0PtvsEtaConvGammaWithinAcceptance        = kTRUE;
256 Bool_t kGCplotMCPi0PtvsRapidConvGammaWithinAcceptance      = kTRUE;
257 Bool_t kGCplotMCPi0ZRConvGammaWithinAcceptance          = kTRUE;
258
259 Bool_t kGCplotMCPi0SecondaryEta                                = kTRUE;
260 Bool_t kGCplotMCPi0SecondaryRapid                              = kTRUE;
261 Bool_t kGCplotMCPi0SecondaryPhi                                = kTRUE;
262 Bool_t kGCplotMCPi0SecondaryPt                                 = kTRUE;
263 Bool_t kGCplotMCPi0SecondaryEnergy                             = kFALSE;
264 Bool_t kGCplotMCPi0SecondaryMass                               = kTRUE;
265 Bool_t kGCplotMCPi0SecondaryOpeningAngle                       = kTRUE;
266 Bool_t kGCplotMCPi0SecondaryR                                  = kTRUE;
267 Bool_t kGCplotMCPi0SecondaryZR                                 = kFALSE;
268 Bool_t kGCplotMCPi0SecondaryXY                                 = kFALSE;
269 Bool_t kGCplotMCPi0SecondaryPtvsEtaWithinAcceptance            = kTRUE;
270 Bool_t kGCplotMCPi0SecondaryPtvsRapidWithinAcceptance          = kTRUE;
271 Bool_t kGCplotMCPi0SecondaryPtvsEtaConvGammaWithinAcceptance   = kTRUE;
272 Bool_t kGCplotMCPi0SecondaryPtvsRapidConvGammaWithinAcceptance = kTRUE;
273
274 Bool_t kGCplotMCEtaEta                                = kTRUE;
275 Bool_t kGCplotMCEtaRapid                              = kTRUE;
276 Bool_t kGCplotMCEtaPtvsRapid                          = kTRUE;
277 Bool_t kGCplotMCEtaPhi                                = kTRUE;
278 Bool_t kGCplotMCEtaPt                                 = kTRUE;
279 Bool_t kGCplotMCEtaEnergy                             = kFALSE;
280 Bool_t kGCplotMCEtaMass                               = kTRUE;
281 Bool_t kGCplotMCEtaOpeningAngleGamma                  = kTRUE;
282 Bool_t kGCplotMCEtaR                                  = kTRUE;
283 Bool_t kGCplotMCEtaZR                                 = kFALSE;
284 Bool_t kGCplotMCEtaXY                                 = kFALSE;
285 Bool_t kGCplotMCEtaPtvsEtaWithinAcceptance                 = kTRUE;
286 Bool_t kGCplotMCEtaPtvsRapidWithinAcceptance       = kTRUE;
287 Bool_t kGCplotMCEtaPtvsEtaConvGammaWithinAcceptance   = kTRUE;
288 Bool_t kGCplotMCEtaPtvsRapidConvGammaWithinAcceptance = kTRUE;
289 Bool_t kGCplotMCEtaOpeningPtConvGammaWithinAcceptance = kTRUE;
290 Bool_t kGCplotMCEtaPtGammaPtConvGammaWithinAcceptance = kTRUE;
291 Bool_t kGCplotMCEtaZRConvGammaWithinAcceptance = kTRUE;
292
293 // Histograms from esd tracks
294 Bool_t kGCplotESDConversionR                   = kTRUE;
295 Bool_t kGCplotESDConversionZR                  = kTRUE;
296 Bool_t kGCplotESDConversionXY                  = kTRUE;
297 Bool_t kGCplotESDConversionXYBeamPipe          = kTRUE;
298 Bool_t kGCplotESDConversionRPhiBeamPipe        = kTRUE;
299 Bool_t kGCplotESDConversionOpeningAngle        = kTRUE;
300 Bool_t kGCplotESDConvGammaCosPointingAngle     = kTRUE;
301 Bool_t kGCplotESDConvGammaDcaDaugthers         = kTRUE;
302 Bool_t kGCplotESDConvGammaNormDcaDistDaugthers = kTRUE;
303 Bool_t kGCplotESDConvGammaLikelihoodAP         = kTRUE;
304 Bool_t kGCplotESDConvGammaEAsymmetryP         = kTRUE;
305 Bool_t kGCplotESDConvGammaPAsymmetryP         = kTRUE;
306 Bool_t kGCplotESDConvGammaEdEdxP         = kTRUE;
307 Bool_t kGCplotESDConvGammaPdEdxP         = kTRUE;
308 Bool_t kGCplotESDConvGammaEeProbP         = kTRUE;
309 Bool_t kGCplotESDConvGammaPeProbP         = kTRUE;
310 Bool_t kGCplotESDConvGammaEmupiProbP         = kTRUE;
311 Bool_t kGCplotESDConvGammaPmupiProbP         = kTRUE;
312
313 Bool_t kGCplotESDConvGammaQtAlfa         = kTRUE;
314
315
316 Bool_t kGCplotESDEEnergy = kFALSE;
317 Bool_t kGCplotESDEPt     = kTRUE;
318 Bool_t kGCplotESDEEta    = kTRUE;
319 Bool_t kGCplotESDEPhi    = kTRUE;
320 Bool_t kGCplotESDENTPCClusters = kTRUE;
321 Bool_t kGCplotESDENITSClusters = kTRUE;
322 Bool_t kGCplotESDENTPCClustersToFP = kTRUE;
323 Bool_t kGCplotESDETPCchi2 = kTRUE;
324
325 Bool_t kGCplotESDPEnergy = kFALSE;
326 Bool_t kGCplotESDPPt     = kTRUE;
327 Bool_t kGCplotESDPEta    = kTRUE;
328 Bool_t kGCplotESDPPhi    = kTRUE;
329 Bool_t kGCplotESDPNTPCClusters = kTRUE; 
330 Bool_t kGCplotESDPNITSClusters = kTRUE;
331 Bool_t kGCplotESDPNTPCClustersToFP = kTRUE;
332 Bool_t kGCplotESDPTPCchi2 = kTRUE;
333
334 Bool_t kGCplotESDConvGammaEnergy = kFALSE;
335 Bool_t kGCplotESDConvGammaPt     = kTRUE;
336 Bool_t kGCplotESDConvGammaEta    = kTRUE;
337 Bool_t kGCplotESDConvGammaPhi    = kTRUE;
338 Bool_t kGCplotESDConvGammaMass   = kTRUE;
339 Bool_t kGCplotESDConvGammaWidth  = kTRUE;
340 Bool_t kGCplotESDConvGammaChi2   = kTRUE;
341 Bool_t kGCplotESDConvGammaNDF    = kTRUE;
342 Bool_t kGCplotESDConvGammaRapid  = kTRUE;
343 Bool_t kGCplotESDConvGammaPtvsEta = kTRUE;
344 Bool_t kGCplotESDConvGammaPtvsChi2 = kTRUE;
345 Bool_t kGCplotESDConvGammaEtavsChi2 = kTRUE;
346
347
348 Bool_t kGCplotESDTrueDalitzContaminationR    = kTRUE;
349 Bool_t kGCplotESDTruePi0DalitzContaminationR = kTRUE;
350 Bool_t kGCplotESDTrueEtaDalitzContaminationR = kTRUE;
351 Bool_t kGCplotESDTrueCombinatorialContaminationR = kTRUE;
352 Bool_t kGCplotESDTrueCombinatorialElecContaminationR = kTRUE;
353
354 Bool_t kGCplotESDTrueConvGammaEnergy         = kFALSE;
355 Bool_t kGCplotESDTrueConvGammaPt             = kTRUE;
356 Bool_t kGCplotESDTrueConvGammaEta            = kTRUE;
357 Bool_t kGCplotESDTrueConvGammaPhi            = kTRUE;
358 Bool_t kGCplotESDTrueConvGammaMass           = kTRUE;
359 Bool_t kGCplotESDTrueConvGammaWidth          = kTRUE;
360 Bool_t kGCplotESDTrueConvGammaChi2           = kTRUE;
361 Bool_t kGCplotESDTrueConvGammaNDF            = kTRUE;
362 Bool_t kGCplotESDTrueConvGammaRapid          = kTRUE;
363 Bool_t kGCplotESDTrueConvGammaPtvsEta        = kTRUE;
364 Bool_t kGCplotESDTrueConversionR             = kTRUE;
365 Bool_t kGCplotESDTrueConversionZR            = kFALSE;
366 Bool_t kGCplotESDTrueConversionXY            = kFALSE;
367 Bool_t kGCplotESDTrueConversionOpeningAngle  = kTRUE;
368 Bool_t kGCplotESDTrueConvGammaCosPointingAngle     = kTRUE;
369 Bool_t kGCplotESDTrueConvGammaDcaDaugthers         = kTRUE;
370 Bool_t kGCplotESDTrueConvGammaNormDcaDistDaugthers = kTRUE;
371 Bool_t kGCplotESDTrueConvGammaLikelihoodAP         = kTRUE;
372 Bool_t kGCplotESDTrueConvGammaEAsymmetryP         = kTRUE;
373 Bool_t kGCplotESDTrueConvGammaPAsymmetryP         = kTRUE;
374 Bool_t kGCplotESDTrueConvGammaEdEdxP         = kTRUE;
375 Bool_t kGCplotESDTrueConvGammaPdEdxP         = kTRUE;
376 Bool_t kGCplotESDTrueConvGammaQtAlfa         = kTRUE;
377
378 Bool_t kGCplotESDTrueConvGammaPtvsChi2       = kTRUE;
379 Bool_t kGCplotESDTrueConvGammaEtavsChi2      = kTRUE;
380 Bool_t kGCplotESDTrueConvGammaMCPtEta        = kTRUE;
381 Bool_t kGCplotESDTrueConversionMCZR          = kFALSE;
382 Bool_t kGCplotESDTrueConversionMCXY          = kFALSE;
383
384 Bool_t kGCplotESDNoCutConvGammaEnergy         = kFALSE;
385 Bool_t kGCplotESDNoCutConvGammaPt             = kTRUE;
386 Bool_t kGCplotESDNoCutConvGammaEta            = kTRUE;
387 Bool_t kGCplotESDNoCutConvGammaPhi            = kTRUE;
388 Bool_t kGCplotESDNoCutConvGammaMass           = kTRUE;
389 Bool_t kGCplotESDNoCutConvGammaWidth          = kTRUE;
390 Bool_t kGCplotESDNoCutConvGammaChi2           = kTRUE;
391 Bool_t kGCplotESDNoCutConvGammaNDF            = kTRUE;
392 Bool_t kGCplotESDNoCutConvGammaRapid          = kTRUE;
393 Bool_t kGCplotESDNoCutConvGammaPtvsEta        = kTRUE;
394 Bool_t kGCplotESDNoCutConversionR             = kTRUE;
395 Bool_t kGCplotESDNoCutConversionZR            = kFALSE;
396 Bool_t kGCplotESDNoCutConversionXY            = kFALSE;
397 Bool_t kGCplotESDNoCutConversionOpeningAngle  = kTRUE;
398 Bool_t kGCplotESDNoCutConvGammaCosPointingAngle     = kTRUE;
399 Bool_t kGCplotESDNoCutConvGammaDcaDaugthers         = kTRUE;
400 Bool_t kGCplotESDNoCutConvGammaNormDcaDistDaugthers = kTRUE;
401 Bool_t kGCplotESDNoCutConvGammaLikelihoodAP         = kTRUE;
402
403 Bool_t kGCplotESDNoCutConvGammaEAsymmetryP         = kTRUE;
404 Bool_t kGCplotESDNoCutConvGammaPAsymmetryP         = kTRUE;
405 Bool_t kGCplotESDNoCutConvGammaEdEdxP         = kTRUE;
406 Bool_t kGCplotESDNoCutConvGammaPdEdxP         = kTRUE;
407 Bool_t kGCplotESDNoCutConvGammaPtvsChi2       = kTRUE;
408 Bool_t kGCplotESDNoCutConvGammaEtavsChi2      = kTRUE;
409 Bool_t kGCplotESDNoCutConvGammaMCPtEta        = kTRUE;
410 Bool_t kGCplotESDNoCutConversionMCZR          = kFALSE;
411 Bool_t kGCplotESDNoCutConversionMCXY          = kFALSE;
412
413 Bool_t kGCplotESDMotherChi2 = kTRUE;
414 Bool_t kGCplotESDMotherOpeningAngleGamma = kTRUE;
415 Bool_t kGCplotESDMotherEnergy            = kFALSE;
416 Bool_t kGCplotESDMotherPt                = kFALSE;
417 Bool_t kGCplotESDMotherEta               = kTRUE;
418 Bool_t kGCplotESDMotherPhi               = kFALSE;
419 Bool_t kGCplotESDMotherMass              = kFALSE;
420 Bool_t kGCplotESDMotherR                 = kFALSE;
421 Bool_t kGCplotESDMotherZR                = kFALSE;
422 Bool_t kGCplotESDMotherXY                = kFALSE;
423 Bool_t kGCplotESDMotherRapid             = kTRUE;
424
425 Bool_t kGCplotESDBackgroundOpeningAngleGamma = kTRUE;
426 Bool_t kGCplotESDBackgroundEnergy            = kFALSE;
427 Bool_t kGCplotESDBackgroundPt                = kFALSE;
428 Bool_t kGCplotESDBackgroundEta               = kFALSE;
429 Bool_t kGCplotESDBackgroundPhi               = kFALSE;
430 Bool_t kGCplotESDBackgroundMass              = kFALSE;
431 Bool_t kGCplotESDBackgroundR                 = kFALSE;
432 Bool_t kGCplotESDBackgroundZR                = kFALSE;
433 Bool_t kGCplotESDBackgroundXY                = kFALSE;
434 Bool_t kGCplotESDBackgroundRapid             = kFALSE;
435
436 Bool_t kGCplotMapping = kTRUE;       
437
438 Bool_t kGCplotResolutiondPt = kTRUE;
439 Bool_t kGCplotResolutiondR  = kTRUE;
440 Bool_t kGCplotResolutiondZ  = kTRUE;
441
442 Bool_t kGCplotResolutiondRAbs  = kTRUE;
443 Bool_t kGCplotResolutiondZAbs  = kTRUE;
444 Bool_t kGCplotResolutiondPhiAbs  = kTRUE;
445
446 Bool_t kGCplotResolutiondRdPt = kTRUE;
447
448 Bool_t kGCplotResolutionMCPt = kTRUE;
449 Bool_t kGCplotResolutionMCR  = kTRUE;
450 Bool_t kGCplotResolutionMCZ  = kTRUE;
451
452 Bool_t kGCplotResolutionESDPt = kTRUE;
453 Bool_t kGCplotResolutionESDR  = kTRUE;
454 Bool_t kGCplotResolutionESDZ  = kTRUE;
455
456 Bool_t kGCplotResolutionPtdPt = kTRUE;
457
458 Bool_t kGCplotESDNumberOfV0s          = kTRUE;
459 Bool_t kGCplotESDNumberOfSurvivingV0s = kTRUE;
460 Bool_t kGCplotESDNumberOfContributorsVtx = kTRUE;
461 Bool_t kGCplotESDNumberOfGoodESDTracks = kTRUE;
462
463 //  debug histograms
464 Bool_t kGCplotESDCutGetOnFly      = kTRUE;
465 Bool_t kGCplotESDCutNContributors = kTRUE;
466 Bool_t kGCplotESDCutLikeSign      = kTRUE;
467 Bool_t kGCplotESDCutRefit         = kTRUE;
468 Bool_t kGCplotESDCutKink          = kTRUE;
469 Bool_t kGCplotESDCutPIDProb       = kTRUE;
470 Bool_t kGCplotESDCutdedxSigmaElectronLine=kTRUE;
471 Bool_t kGCplotESDCutdedxSigmaPionLine=kTRUE;
472 Bool_t kGCplotESDCutPionRejectionLowP  =kTRUE;
473 Bool_t kGCplotESDCutProtonRejectionLowP=kTRUE;
474 Bool_t kGCplotESDCutKaonRejectionLowP  =kTRUE;
475 Bool_t kGCplotESDCutQtGammaSelection=kTRUE;
476 Bool_t kGCplotESDCutR             = kTRUE;
477 Bool_t kGCplotESDCutMinR          = kTRUE;
478 Bool_t kGCplotESDCutLine          = kTRUE;
479 Bool_t kGCplotESDCutZ             = kTRUE;
480 Bool_t kGCplotESDCutMinClsTPC     = kTRUE;
481 Bool_t kGCplotESDCutMinClsTPCToF  = kTRUE;
482 Bool_t kGCplotESDGoodV0s          = kTRUE;
483 Bool_t kGCplotESDAllV0s           = kTRUE;
484 Bool_t kGCplotESDAllV0sCurrentFinder = kTRUE;
485 Bool_t kGCplotESDAllV0sCurrentFinderQtAlfa = kTRUE;
486
487 Bool_t kGCplotESDCutNDF           = kTRUE;
488 Bool_t kGCplotESDCutChi2          = kTRUE;
489 Bool_t kGCplotESDCutEta           = kTRUE;
490 Bool_t kGCplotESDCutPt            = kTRUE;
491 Bool_t kGCplotESDCutSinglePt      = kTRUE;
492 Bool_t kGCplotESDTrueConvGammaTrackLength =kFALSE;
493 Bool_t kGCplotESDTrueConvGammaTrackLengthVSInvMass =kFALSE;
494
495 Bool_t kGCplotPi0Spectra = kTRUE;
496 Bool_t kGCplotEtaSpectra = kTRUE;
497 Bool_t kGCplotOmegaSpectra = kTRUE;
498
499 /////////////Chi_c Analysis//////////////////////////
500 Bool_t kGCplotStatsElectrons                                  = kTRUE;
501 Bool_t kGCplotRecENegJPsiPtDiff                               = kTRUE;
502 Bool_t kGCplotRecEPosJPsiPtDiff                               = kTRUE;
503 Bool_t kGCplotRecEPosENegR                                    = kTRUE;
504 Bool_t kGCplotRecEPosENegEta                                  = kTRUE;
505 Bool_t kGCplotESDInvMassePluseMinus                           = kTRUE;
506 Bool_t kGCplotESDInvMassGammaePluseMinusChiC                  = kTRUE;
507 Bool_t kGCplotESDInvMassGammaePluseMinusPi0                   = kTRUE;
508 Bool_t kGCplotESDElectronPosNegPt                             = kTRUE;
509 Bool_t kGCplotESDElectronPosNegEta                            = kTRUE;
510 Bool_t kGCplotESDElectronPosNegAngle                          = kTRUE;
511 Bool_t kGCplotMCElectronPosNegPt                              = kTRUE;
512 Bool_t kGCplotMCElectronPosNegEta                             = kTRUE;
513 Bool_t kGCplotMCElectronPosNegJPsiAngle                       = kTRUE;
514 Bool_t kGCplotESDElectronPosNegPi0Angle                       = kTRUE;
515 Bool_t kGCplotMCElectronPosNegPi0Angle                        = kTRUE;
516 Bool_t kGCplotTableElectrons                                  = kTRUE;
517 Bool_t kGCplotESDEPosBackground                               = kTRUE;
518 Bool_t kGCplotESDENegBackground                               = kTRUE;
519 Bool_t kGCplotESDEPosENegBackground                           = kTRUE;
520 Bool_t kGCplotESDEPosENegBackgroundCut                        = kTRUE;
521 Bool_t kGCplotESDePoseNegAngle                                = kTRUE;
522 Bool_t kGCplotESDEPosENegGammaBackgroundMX                    = kTRUE;
523 Bool_t kGCplotMCLabels                                        = kTRUE;
524 ///////////////////////////////////////////////////////////////////
525
526 //---------------- Gamma Jet analysis ----------------------------
527 Bool_t kGCplotdPhiHdrGam            = kTRUE;
528 Bool_t kGCplotdPhiHdrGamIsolated    = kTRUE;
529 Bool_t kGCplotMinimumIsoDistance    = kTRUE;
530 Bool_t kGCplotFFzHdrGam             = kTRUE;
531 Bool_t kGCplotImbalanceHdrGam       = kTRUE;
532 //----------------------------------------------------------------
533
534
535 /** ----------------- end define which histograms to plot here -------------------------------*/
536
537
538
539 /** ----------- Define the binning for the different plot types here -------------------------*/
540 // Number of V0s-plot
541 Int_t kGCnXBinsNV0        = 1000;
542 Double_t kGCfirstXBinNV0  = -0.5;
543 Double_t kGClastXBinNV0   =  999.5;
544
545
546 // Number of ESD track-Plot
547 Int_t kGCnXBinsESDtrk      = 10000;
548 Double_t kGCfirstXBinESDtrk= -0.5;
549 Double_t kGClastXBinESDtrk = 9999.5;
550
551
552 //EventQuality-plot
553 Int_t kGCnXBinsEvtQ= 9;
554 Double_t kGCfirstXBinEvtQ=-1.5;
555 Double_t kGClastXBinEvtQ=7.5;
556
557 //R-plots
558 Int_t kGCnXBinsR = 400;
559 Double_t kGCfirstXBinR = 0.;
560 Double_t kGClastXBinR = 200.;
561
562 //ZR-plots
563 Int_t kGCnXBinsZR = 1000;
564 Double_t kGCfirstXBinZR = -250.;
565 Double_t kGClastXBinZR = 250.;
566 Int_t kGCnYBinsZR = 400;
567 Double_t kGCfirstYBinZR = 0.;
568 Double_t kGClastYBinZR = 200.;
569
570 //XY-plots
571 Int_t kGCnXBinsXY = 800;
572 Double_t kGCfirstXBinXY = -200.;
573 Double_t kGClastXBinXY = 200.;
574 Int_t kGCnYBinsXY = 800;
575 Double_t kGCfirstYBinXY = -200.;
576 Double_t kGClastYBinXY = 200.;
577
578 //XY-plots-BeamPipe
579 Int_t kGCnXBinsXYBP = 200;
580 Double_t kGCfirstXBinXYBP = -10.;
581 Double_t kGClastXBinXYBP = 10.;
582 Int_t kGCnYBinsXYBP = 200;
583 Double_t kGCfirstYBinXYBP = -10.;
584 Double_t kGClastYBinXYBP = 10.;
585
586 //Rphi-plots-BeamPipe
587 Int_t kGCnXBinsRPhiBP = 200;
588 Double_t kGCfirstXBinRPhiBP = -TMath::Pi();
589 Double_t kGClastXBinRPhiBP = TMath::Pi();
590 Int_t kGCnYBinsRPhiBP = 200;
591 Double_t kGCfirstYBinRPhiBP = 0.;
592 Double_t kGClastYBinRPhiBP = 10.;
593
594
595
596 //OpenAngle-plots
597 Int_t kGCnXBinsOpeningAngle = 400;
598 Double_t kGCfirstXBinOpeningAngle = 0.;
599 Double_t kGClastXBinOpeningAngle = TMath::Pi();
600
601 //CosPointingAngle-plots
602 Int_t kGCnXBinsCosPointingAngle = 400;
603 Double_t kGCfirstXBinCosPointingAngle = 0.99;
604 Double_t kGClastXBinCosPointingAngle = 1.01;
605
606 //DCA Daugthers-plots
607 Int_t kGCnXBinsDcaDaughters = 400;
608 Double_t kGCfirstXBinDcaDaughters= 0.;
609 Double_t kGClastXBinDcaDaughters = 5.;
610
611 //Norm DCA dist Daugthers-plots
612 Int_t kGCnXBinsNormDcaDistDaughters = 400;
613 Double_t kGCfirstXBinNormDcaDistDaughters= 0.;
614 Double_t kGClastXBinNormDcaDistDaughters = 10.;
615
616 //LikelihoodAP Plots
617 Int_t kGCnXBinsLikelihoodAP = 400;
618 Double_t kGCfirstXBinLikelihoodAP= 0.;
619 Double_t kGClastXBinLikelihoodAP = 2.;
620
621
622 //Energy-plots
623 Int_t kGCnXBinsEnergy = 200;
624 Double_t kGCfirstXBinEnergy = 0.;
625 Double_t kGClastXBinEnergy = 50.;
626
627 //P-plots
628 Int_t kGCnXBinsP = 200;
629 Double_t kGCfirstXBinP = 0.05;
630 Double_t kGClastXBinP = 50.;
631
632 //dEdx-plots
633 Int_t kGCnYBinsdEdx = 200;
634 Double_t kGCfirstYBindEdx = 0.;
635 Double_t kGClastYBindEdx = 200.;
636
637 //EProb-plots
638 Int_t kGCnYBinsEProb = 200;
639 Double_t kGCfirstYBinEProb = 0.;
640 Double_t kGClastYBinEProb = 1.;
641
642 //Qt-plots
643 Int_t kGCnYBinsQt = 250;
644 Double_t kGCfirstYBinQt = 0.;
645 Double_t kGClastYBinQt = 0.25;
646
647
648
649 //Asymmetry-plots
650 Int_t kGCnYBinsAsymmetry = 200;
651 Double_t kGCfirstYBinAsymmetry = 0.;
652 Double_t kGClastYBinAsymmetry = 1.;
653
654
655 //Pt-plots
656 Int_t kGCnXBinsPt = 500;
657 Double_t kGCfirstXBinPt = 0.;
658 Double_t kGClastXBinPt = 50.;
659
660 //Eta-plots
661 Int_t kGCnXBinsEta = 40;
662 Double_t kGCfirstXBinEta = -2.;
663 Double_t kGClastXBinEta = 2.;
664
665 //Rapidity
666 Int_t kGCnXBinsRapid = 200;
667 Double_t kGCfirstXBinRapid = -10.;
668 Double_t kGClastXBinRapid = 10.;
669
670 //Phi-plots
671 Int_t kGCnXBinsPhi = 72;
672 Double_t kGCfirstXBinPhi = -TMath::Pi();
673 Double_t kGClastXBinPhi = TMath::Pi();
674
675 //nTPCCluster-plots
676 Int_t kGCnXBinsNTPCClusters = 201;
677 Double_t kGCfirstXBinNTPCClusters = -0.5;
678 Double_t kGClastXBinNTPCClusters = 200.5;
679
680 //nITSCluster-plots
681 Int_t kGCnXBinsNITSClusters = 7;
682 Double_t kGCfirstXBinNITSClusters = -0.5;
683 Double_t kGClastXBinNITSClusters = 6.5;
684
685 //TPCcluster to Findable-plots
686 Int_t kGCnYBinsClsToF = 120;
687 Double_t kGCfirstYBinClsToF = 0.;
688 Double_t kGClastYBinClsToF = 1.2;
689
690 //TPCchi2 -plots
691 Int_t kGCnXBinsTPCchi2 = 100;
692 Double_t kGCfirstXBinTPCchi2 = 0.;
693 Double_t kGClastXBinTPCchi2 = 10;
694
695
696 //Mapping-plots
697 Int_t kGCnXBinsMapping = 800;
698 Double_t kGCfirstXBinMapping = -100.;
699 Double_t kGClastXBinMapping = 100.;
700 Int_t kGCnYBinsMapping = 40;
701 Double_t kGCfirstYBinMapping = -2;
702 Double_t kGClastYBinMapping = 2;
703
704 //ResolutionPlots
705 //RESdPt
706 Int_t kGCnXBinsResdPt=500;
707 Int_t kGCfirstXBinResdPt= 0;
708 Int_t kGClastXBinResdPt=100;
709 Int_t kGCnYBinsResdPt=200;
710 Int_t kGCfirstYBinResdPt= -10;
711 Int_t kGClastYBinResdPt=10;
712
713 //RESdR
714 Int_t kGCnXBinsResdR=400;
715 Int_t kGCfirstXBinResdR= 0;
716 Int_t kGClastXBinResdR=200;
717 Int_t kGCnYBinsResdR=100;
718 Int_t kGCfirstYBinResdR= -25;
719 Int_t kGClastYBinResdR=25;
720
721 //RESdZ
722 Int_t kGCnXBinsResdZ=80;
723 Int_t kGCfirstXBinResdZ= -20;
724 Int_t kGClastXBinResdZ=20;
725 Int_t kGCnYBinsResdZ=80;
726 Int_t kGCfirstYBinResdZ= -20;
727 Int_t kGClastYBinResdZ=20;
728
729 //RESdRdPt
730 Int_t kGCnYBinsResdRdPt=400;
731 Int_t kGCfirstYBinResdRdPt= -10;
732 Int_t kGClastYBinResdRdPt=10;
733
734 //RESMCPt
735 Int_t kGCnXBinsResPt=500;
736 Int_t kGCfirstXBinResPt= 0;
737 Int_t kGClastXBinResPt=100;
738
739 //RESMCR
740 Int_t kGCnXBinsResR=500;
741 Int_t kGCfirstXBinResR= 0;
742 Int_t kGClastXBinResR=250;
743
744 //RESMCZ
745 Int_t kGCnXBinsResZ=500;
746 Int_t kGCfirstXBinResZ= 0;
747 Int_t kGClastXBinResZ=250;
748
749 //GammaMass-plots
750 Int_t kGCnXBinsGammaMass = 4000;
751 Double_t kGCfirstXBinGammaMass = 0.;
752 Double_t kGClastXBinGammaMass = 1.;
753
754 //Pi0Mass-plots
755 Int_t kGCnXBinsPi0Mass = 1000;
756 Double_t kGCfirstXBinPi0Mass = 0.;
757 Double_t kGClastXBinPi0Mass = 1.;
758 Double_t kGCfirstXBinPi0Alpha = 0.;
759 Double_t kGClastXBinPi0Alpha = 1.;
760
761
762 //EtaMass-plots
763 Int_t kGCnXBinsEtaMass = 1000;
764 Double_t kGCfirstXBinEtaMass = 0.;
765 Double_t kGClastXBinEtaMass = 1.;
766
767 //GammaWidth-plots
768 Int_t kGCnXBinsGammaWidth = 100;
769 Double_t kGCfirstXBinGammaWidth = 0.;
770 Double_t kGClastXBinGammaWidth = 1.;
771
772 //GammaChi2-plots
773 Int_t kGCnXBinsMesonChi2 = 200;
774 Int_t kGCnXBinsGammaChi2 = 100;
775 Double_t kGCfirstXBinGammaChi2 = 0;
776 Double_t kGClastXBinGammaChi2 = 200.;
777
778 //GammaNDF-plots
779 Int_t kGCnXBinsGammaNDF = 10;
780 Double_t kGCfirstXBinGammaNDF = 0.;
781 Double_t kGClastXBinGammaNDF = 10.;
782
783 //Spectra-plots
784 Int_t kGCnXBinsSpectra = 500;
785 Double_t kGCfirstXBinSpectra = 0.;
786 Double_t kGClastXBinSpectra = 1.;
787 Int_t kGCnYBinsSpectra = 250;
788 Double_t kGCfirstYBinSpectra = 0.;
789 Double_t kGClastYBinSpectra = 25.;
790
791 Double_t kGCfirstXBinAlphaG = -1.;
792 Double_t kGCfirstXBinAlpha = 0.;
793 Double_t kGClastXBinAlpha = 1.;
794
795 //track length plots
796 Int_t kGCnXBinsTrackLength = 1000;
797 Double_t kGCfirstXBinTrackLength = 0;
798 Double_t kGClastXBinTrackLength = 500;
799
800 /////////Pi0 Dalitz decay AnalysisTask ///////////////////////////////////
801
802 Int_t kGCnXBinsDalitzMass = 4000;
803 Double_t kGCfirstXBinDalitzMass = 0.;
804 Double_t kGClastXBinDalitzMass = 4.;
805
806 Int_t kGCnXBinsPi0DalitzMass = 4000;
807 Double_t kGCfirstXBinPi0DalitzMass = 0.;
808 Double_t kGClastXBinPi0DalitzMass = 4.;
809
810 /////////Chic_Analysis///////////////////////////////////
811 Int_t kGCnXBinsEPt = 1000;
812 Double_t kGCfirstXBinEPt = 0.;
813 Double_t kGClastXBinJPsiPt  = 10;
814
815 Int_t kGCnXBinsJPsiMass = 1000;
816 Double_t kGCfirstXBinJPsiMass = 0.;
817 Double_t kGClastXBinJPsiMass = 10.;
818
819 Int_t kGCnXBinsChicMass = 1000;
820 Double_t kGCfirstXBinChicMass = 0.;
821 Double_t kGClastXBinChicMass  = 10.;
822
823 Int_t kGCnXBinsPi0Mass  = 1000;
824 Double_t kGCfirstXBinPi0Mass = 0.;
825 Double_t kGClastXBinPi0Mass  = 1.;
826
827 Int_t kGCnXBinsEPosNegPt = 1000;
828 Double_t kGCfirstXBinEPosNegPt = 0.;
829 Double_t kGClastXBinEPosNegPt  = 10.;
830
831 Int_t kGCnXBinsEPosNegEta = 200;
832 Double_t kGCfirstXBinEPosNegEta = -1.2;
833 Double_t kGClastXBinEPosNegEta  = 1.2;
834
835 Int_t kGCnXBinsEPosNegAngle = 200;
836 Double_t kGCfirstXBinEPosNegAngle = 0.;
837 Double_t kGClastXBinEPosNegAngle = TMath::Pi();
838
839 Int_t kGCnXBinsEBackground = 1000;
840 Double_t kGCfirstXBinEBackground = 0.;
841 Double_t kGClastXBinEBackground  = 10.;
842
843 Int_t kGCnXBinsEBackgroundCut = 100;
844 Double_t kGCfirstXBinEBackgroundCut = 0.;
845 Double_t kGClastXBinEBackgroundCut  = 0.015.;
846
847 Int_t kGCnXBinsMCLabels = 10;
848 Double_t kGCfirstXBinMCLabels = 0.;
849 Double_t kGClastXBinMCLabels  = 10.;
850
851 Int_t kGCnElementsElectronTable = 19;
852
853 //18 elements
854 const char * kGCelectronTable[] = {
855   "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",
856   "ESDtracks",    "Kink Cut",
857   "Vertex Cut","TRDOut","TRDrefit","TPCrefit",
858   "ITSrefit","TRDout+TPC+TPC+ITS+nsigma>3 Pass","pid!=0","ESDElec","ESD e+ JPsi",
859   "ESD e- JPsi","ESD e+ e- JPSI","MC: gamma < 1.2","e+,e- < 0.9 g <1.2"
860 };
861
862
863 // for Gamma Jet analysis
864 Int_t kGCnXBinsdphiHdrGam = 100;
865 Double_t kGCfirstXBindphiHdrGam = -TMath::PiOver2();
866 Double_t kGClastXBindphiHdrGam = 3*TMath::PiOver2();
867
868 Int_t kGCnXBinsMinimumIsoDistance = 100;
869 Double_t kGCfirstXBinMinimumIsoDistance = 0.;
870 Double_t kGClastXBinMinimumIsoDistance = TMath::PiOver2();
871
872 Int_t kGCnXBinsFFzHdrGam = 100;
873 Double_t kGCfirstXBinFFzHdrGam = 0.;
874 Double_t kGClastXBinFFzHdrGam = 5;
875
876 Int_t kGCnXBinsImbalanceHdrGam = 100;
877 Double_t kGCfirstXBinImbalanceHdrGam = -5.;
878 Double_t kGClastXBinImbalanceHdrGam = 5.;
879 ////////////////////////////////////////////////////////
880
881
882 /** ---------- end Define the binning for the different plot types here ----------------------*/
883
884
885 /************************************************************************************************
886  *                                                                                              *
887  *                                                                                              *
888  *                     EVERYTHING BELOW IS FOR DEVELOPERS ONLY                                  *
889  *                                                                                              *
890  *                                                                                              *
891  ************************************************************************************************/
892 TString kGCoutputFileName = "histogramsGammaConversion";
893 TString kGCoutputFileAppendix = "";
894 TString kGCdataList = "";
895 Bool_t kGCwriteNtuple = kFALSE;
896 // WE DOO NOT NEED TO CHANGE THIS (kGCusePWG4PartCorr) ANYMORE SINCE IT IS TAKEN CARE OF AUTOMATICALLY NOW
897 Bool_t kGCusePWG4PartCorr = kTRUE;
898
899 /** Flag to enable running on train  */
900 Bool_t kGCrunOnTrain = kFALSE;
901 Bool_t kGCrunOnGsiTrain = kFALSE;
902
903 /** ------------------------------ Monte Carlo flag -----------------------------------------*/
904 Bool_t kGCdoMCTruth = kTRUE;
905 /** ---------------------------- end Monte Carlo flag ---------------------------------------*/
906
907 /** ------------------------------ Selecting trigger CINT1B -----------------------------------*/
908 Bool_t kGCtriggerCINT1B = kFALSE;
909 /** ---------------------------- end Monte Carlo flag ---------------------------------------*/
910
911 /** ------------------------- Choose KFParticle OR ESDTrack  --------------------------------*/
912 Bool_t kGCuseKFParticle = kTRUE;
913 Bool_t kGCuseESDTrack   = kFALSE;
914 /** ----------------------- end Choose KFParticle OR ESDTrack  -----------------------------*/
915
916 /**------------------------------Flag to apply dEdx cut base on sigmas to electron line----------*/
917 Bool_t kGCdodEdxSigmaCut= kTRUE;
918 /**------------------------------end Flag to apply NsigmadEdx cut ----------*/
919
920 Double_t kGCPIDnSigmaAboveElectronLine=5;
921 Double_t kGCPIDnSigmaBelowElectronLine=-3;
922 Double_t kGCPIDnSigmaAbovePionLine=0;
923 Double_t kGCPIDMinPnSigmaAbovePionLine=1.;
924 Double_t kGCPIDMaxPnSigmaAbovePionLine=3.;
925
926 /**------- Flag to apply rejection at LowP of Kaons, protons , pions------------*/
927 Bool_t kGCdoPionRejectionLowP=kTRUE;
928 Bool_t kGCdoKaonRejectionLowP=kTRUE;
929 Bool_t kGCdoProtonRejectionLowP=kTRUE;
930 /**---------------------------------------*/
931
932 Double_t kGCPIDnSigmaAtLowPAroundKaonLine=0;
933 Double_t kGCPIDnSigmaAtLowPAroundProtonLine=0;
934 Double_t kGCPIDnSigmaAtLowPAroundPionLine=0;
935
936 Double_t kGCPIDMinPKaonRejectionLowP=1.5;
937 Double_t kGCPIDMinPProtonRejectionLowP=2.;
938 Double_t kGCPIDMinPPionRejectionLowP=0.5;
939
940
941 Bool_t kGCdoQtGammaSelection=kTRUE;
942 Double_t kGCQtMax=100.;
943
944
945
946 Bool_t scanArguments(TString arguments){
947   
948   Bool_t iResult = kTRUE;
949         
950   TString allArgs=arguments;
951   TString argument;
952   int bMissingParam=0;
953
954   cout<<"Arguments received: "<<allArgs.Data()<<endl;
955         
956   TObjArray* pTokens=allArgs.Tokenize(" ");
957   if (pTokens) {
958                 
959     for(int i=0; i<pTokens->GetEntries() && iResult==kTRUE; i++) {
960       argument=((TObjString*)pTokens->At(i))->GetString();
961                         
962       if(argument.IsNull()) continue;
963       // -- deconvolute-time option
964       if(argument.CompareTo("-data-list") == 0){
965         if((bMissingParam=(++i>=pTokens->GetEntries()))) break;
966         kGCdataList = ((TObjString*)pTokens->At(i))->GetString();
967         if(kGCdataList.IsNull()){
968           cout<<"-data-list is NULL"<<endl;
969           iResult=kFALSE;
970         }
971         else{
972           cout<<"Data list is set to: "<<kGCdataList<<endl;
973         }
974       }
975       else if(argument.CompareTo("-output-file-name") == 0){
976         if((bMissingParam=(++i>=pTokens->GetEntries()))) break;
977         kGCoutputFileName = ((TObjString*)pTokens->At(i))->GetString();
978         if(kGCoutputFileName.IsNull()){
979           cout<<"-output-file-name is NULL"<<endl;
980           iResult=kFALSE;
981         }
982         else{
983           cout<<"Setting output file name to: "<<kGCoutputFileName<<endl;
984         }
985       }
986       else if (argument.CompareTo("-bg-off") == 0){
987         kGCcalculateBackground =kFALSE;
988       }
989       else if (argument.CompareTo("-bg-prob-off") == 0){
990         kGCdoBGProbability = kFALSE;
991       }
992       else if (argument.CompareTo("-bg-prob-on") == 0){
993         kGCdoBGProbability = kTRUE;
994       }
995       else if (argument.CompareTo("-bg-rotation-off") == 0){
996         kGCUseRotationMethodInBG = kFALSE;
997       }
998       else if (argument.CompareTo("-use-v0-multiplicity") == 0){
999         kGCUseTrackMultiplicityForBG = kFALSE;
1000       }
1001       else if (argument.CompareTo("-apply-chi2-cut") == 0){
1002         kGCApplyChi2Cut = kTRUE;
1003       }
1004       else if(argument.CompareTo("-set-number-of-rotations") == 0){
1005         if((bMissingParam=(++i>=pTokens->GetEntries()))) break;
1006         kGCnumberOfRotationEventsForBG = ((TObjString*)pTokens->At(i))->GetString().Atoi();
1007       }
1008       else if(argument.CompareTo("-set-number-of-degrees") == 0){
1009         if((bMissingParam=(++i>=pTokens->GetEntries()))) break;
1010         kGCnDegreeRotationPMForBG = ((TObjString*)pTokens->At(i))->GetString().Atoi();
1011       }
1012       else if (argument.CompareTo("-low-memory") == 0){
1013         kGCLowMemoryConsumption = kTRUE;
1014       }
1015       else if (argument.CompareTo("-move-bg-vertex") == 0){
1016         kGCMoveParticlesAccordingToVertex = kTRUE;
1017       }
1018       else if (argument.CompareTo("-check-neutralmeson-pi0s") == 0){
1019         kGCdoNeutralMesonV0MCCheck=kTRUE;
1020       }
1021       else if (argument.CompareTo("-use-offline-finder") == 0){
1022         kGCUseOnFlyV0Finder = kFALSE;
1023       }
1024       else if (argument.CompareTo("-write-ntuple") == 0){
1025         cout<<"Writing ntuple to file."<<endl;
1026         kGCwriteNtuple = kTRUE;
1027       }
1028       else if (argument.CompareTo("-run-on-train") == 0){
1029         cout<<"Running on train"<<endl;
1030         //kGCWriteStandardAOD=kTRUE;
1031         kGCDeltaAODFilename="";
1032         kGCrunOnTrain = kTRUE;
1033       }
1034       else if (argument.CompareTo("-run-on-gsi-train") == 0){
1035         cout<<"Running on gsi train"<<endl;
1036         //kGCWriteStandardAOD=kFALSE;
1037         kGCrunOnTrain = kTRUE;
1038         kGCrunOnGsiTrain = kTRUE;
1039       }
1040       else if (argument.CompareTo("-run-jet") == 0){
1041         cout<<"Running jet analysis"<<endl;
1042         kGCrunJet = kTRUE;
1043       }
1044       else if (argument.CompareTo("-run-gamma-jet-task") == 0){
1045         cout<<"Running gamma jet task"<<endl;
1046         kGCRunGammaJetTask= kTRUE;
1047       }
1048       else if (argument.CompareTo("-run-neutralmeson") == 0){
1049         cout<<"Running neutral meson analysis"<<endl;
1050         kGCrunNeutralMeson = kTRUE;
1051       }
1052       else if (argument.CompareTo("-run-neutral-meson") == 0){
1053         cout<<"Running neutral meson analysis"<<endl;
1054         kGCrunNeutralMeson = kTRUE;
1055       }
1056       else if (argument.CompareTo("-run-omega-meson") == 0){
1057         cout<<"Running omega meson analysis"<<endl;
1058         kGCrunOmegaMeson = kTRUE;
1059       }
1060       else if (argument.CompareTo("-run-chic") == 0){
1061         cout<<"Running Chi_c analysis"<<endl;
1062         kGCrunChic = kTRUE;
1063       }
1064       else if (argument.CompareTo("-run-dalitz") == 0){
1065         cout<<"Running Dalitz analysis"<<endl;
1066         kGCrunDalitz = kTRUE;
1067       }
1068       else if (argument.CompareTo("-run-cf") == 0){
1069         cout<<"Running CF"<<endl;
1070         kGCrunCF = kTRUE;
1071       }
1072       else if (argument.CompareTo("-run-resolution") == 0){
1073         cout<<"Running Resolution"<<endl;
1074         kGCrunRES = kTRUE;
1075       }
1076       else if (argument.CompareTo("-run-recalculateV0") == 0){
1077         cout<<"Running RecalculateV0ForGamma"<<endl;
1078         kGCRecalculateV0ForGamma=kTRUE;
1079       }
1080       else if (argument.CompareTo("-jet-off") == 0){
1081         cout<<"Skipping jet analysis"<<endl;
1082         kGCrunJet = kFALSE;
1083       }
1084       else if (argument.CompareTo("-neutralmeson-off") == 0){
1085         cout<<"Skipping neutral meson analysis"<<endl;
1086         kGCrunNeutralMeson = kFALSE;
1087       }
1088       else if (argument.CompareTo("-neutral-meson-off") == 0){
1089         cout<<"Skipping neutral meson analysis"<<endl;
1090         kGCrunNeutralMeson = kFALSE;
1091       }
1092       else if (argument.CompareTo("-chic-off") == 0){
1093         cout<<"Skipping Chi_c analysis"<<endl;
1094         kGCrunChic = kFALSE;
1095       }
1096       else if (argument.CompareTo("-mc-off") == 0){
1097         cout<<"Switching off kGCdoMCTruth"<<endl;
1098         kGCdoMCTruth = kFALSE;
1099       }
1100       else if (argument.CompareTo("-trigger-CINT1B") == 0){
1101         cout<<"Selecting ONLY kGCtriggerCINT1B"<<endl;
1102         kGCtriggerCINT1B = kTRUE;
1103       }
1104       else if (argument.CompareTo("-use-own-xyz") == 0){
1105         cout<<"Switching on use own xyz calculation"<<endl;
1106         kGCdoOwnXYZCalculation = kTRUE;
1107       }
1108       else if (argument.CompareTo("-use-ConstructGamma") == 0){
1109         cout<<"Switching on use ConstructGamma and OFF own xyz calculation"<<endl;
1110         kGCdoOwnXYZCalculation = kFALSE;
1111         kGCdoConstructGamma = kTRUE;
1112       }
1113       else if (argument.CompareTo("-no-aod") == 0){
1114         cout<<"Turning off AOD"<<endl;
1115         kGCWriteAOD = kFALSE;
1116       }
1117       else if (argument.CompareTo("-force-aod") == 0){
1118         cout<<"Turning on FillAOD = kTRUE every event; If running in common train this should probably not be done!!!"<<endl;
1119         kGCForceAOD = kTRUE;
1120       }
1121       else if (argument.CompareTo("-standard-aod") == 0){
1122         cout<<"Writing to standard AOD, will only work on train"<<endl;
1123         kGCDeltaAODFilename = "";
1124       }
1125       else if(argument.CompareTo("-append-to-output-file") == 0){
1126         if((bMissingParam=(++i>=pTokens->GetEntries()))) break;
1127         kGCoutputFileAppendix = TString("_")+((TObjString*)pTokens->At(i))->GetString();
1128         if(kGCoutputFileAppendix.IsNull()){
1129           cout<<"-appending-to-output-file is NULL"<<endl;
1130           iResult=kFALSE;
1131         }
1132         else{
1133           cout<<"Appending to the output file: "<<kGCoutputFileAppendix<<endl;
1134         }
1135       }
1136       else if(argument.CompareTo("-set-cut-selection") == 0){
1137         if((bMissingParam=(++i>=pTokens->GetEntries()))) break;
1138         kGCAnalysisCutSelectionId = ((TObjString*)pTokens->At(i))->GetString();
1139         cout<<"The analysis cut selection is set to: "<<kGCAnalysisCutSelectionId.Data()<<endl;
1140       }
1141     }
1142     delete pTokens;
1143   }
1144   if (bMissingParam) {
1145     cout<<"Missing parameter for argument "<< argument.Data()<<endl;
1146     iResult=kFALSE;
1147   }
1148   return iResult;
1149 }
1150
1151 void SetVersionLibrary(){
1152   // Check if the file $ALICE_ROOT/PWG4/GammaConv/AliAnalysisTaskGammaConversion.cxx exists.
1153   // If yes, we set kGCusePWG4PartCorr to false since we have a newer version
1154   // If no, kGCusePWG4PartCorr is true.
1155         
1156   TString file = gSystem->Getenv("ALICE_ROOT");
1157   file+="/PWG4/PartCorr/AliAnalysisTaskGammaConversion.cxx";
1158         
1159   ifstream stream;
1160   stream.open(file.Data());
1161         
1162   if(!stream){
1163     kGCusePWG4PartCorr=kFALSE;
1164   }
1165   else{
1166     kGCusePWG4PartCorr=kTRUE;
1167   }
1168   stream.close();
1169 }
1170
1171
1172 AliAnalysisTaskGammaConversion* ConfigGammaConversion(TString arguments, AliAnalysisDataContainer *cin_esd=NULL){
1173
1174                                                       
1175         
1176   
1177   if(!scanArguments(arguments)){
1178     break;
1179   }
1180         
1181   SetVersionLibrary(); // checks if PWG4GammaConv or PWG4PartCorr is used
1182         
1183   if(cin_esd == NULL && kGCrunOnTrain == kTRUE){
1184     cout<<"Error: kGCrunOnTrain flag is set to true but the input AliAnalysisDataContainer is NULL"<<endl;
1185     cout<<"       you must also supply the AliAnalysisDataContainer as an argument"<<endl;
1186     return;
1187   }
1188         
1189   if(cin_esd != NULL && kGCrunOnTrain == kFALSE){
1190     cout<<"Error: kGCrunOnTrain flag is set to false but the input AliAnalysisDataContainer is not null"<<endl;
1191     cout<<"       add -run-on-train to the arguments to turn switch kGCrunOnTrain to kTRUE"<<endl;
1192     return;
1193   }
1194   if(kGCrunOnTrain == kFALSE){
1195     if(kGCnumberOfFilesToAnalyze==0){
1196       ifstream dataInStream;
1197       dataInStream.open(kGCdataList.Data());
1198       if ( !dataInStream ){
1199         cout<<"Data list file does not exist: "<<kGCdataList.Data()<<endl;
1200         return 0;
1201       }
1202       string line;
1203       while ( !dataInStream.eof() )
1204         {
1205           getline(dataInStream, line);
1206           if(line.compare("") != 0){//checks if there is an empty line in the data list
1207             kGCnumberOfFilesToAnalyze++;
1208           }
1209         }
1210     }
1211     cout<<"Number Of files to analyze: "<<kGCnumberOfFilesToAnalyze<<endl;
1212                 
1213     build();//build (if necessary) and load the libraries needed
1214
1215     gROOT->LoadMacro("$ALICE_ROOT/PWG0/CreateESDChain.C"); // load the CreateChain macro
1216   }
1217                 
1218   if(!kGCrunOnTrain){
1219     // for the train leave this to the steering macro
1220     AliLog::SetGlobalDebugLevel(0);
1221     AliLog::SetGlobalLogLevel(AliLog::kFatal);
1222   }
1223   // ------------------------------------------------------------------------
1224                 
1225     // for CF
1226                 
1227     //Container def.
1228     const Double_t ptmin = kGCfirstXBinPt;
1229     const Double_t ptmax = kGClastXBinPt;
1230     const Double_t etamin = kGCfirstXBinEta;
1231     const Double_t etamax = kGClastXBinEta;
1232     const Double_t massmin = kGCfirstXBinPi0Mass;
1233     const Double_t massmax = kGClastXBinPi0Mass;
1234                 
1235                 
1236     // sensitive variables
1237     UInt_t ipt = 0;
1238     UInt_t ieta = 1;
1239     UInt_t imass = 2;   
1240                 
1241     //how many selection steps 
1242     UInt_t nstep = 20;
1243     const Int_t nvar = 3;
1244
1245     Int_t kGCnXBinsPtCF=40;
1246     Int_t kGCnXBinsEtaCF=8;
1247     Int_t kGCnXBinsPi0MassCF=10;
1248
1249     if(!kGCrunCF){
1250       nstep=1;
1251       kGCnXBinsPtCF=1;
1252       kGCnXBinsEtaCF=1;
1253       kGCnXBinsPi0MassCF=1;
1254     }
1255     const Int_t nbin0 = kGCnXBinsPtCF;  // do not use same variable for CF than for histogram
1256     const Int_t nbin1 = kGCnXBinsEtaCF; // do not use same variable for CF than for histogram
1257     const Int_t nbin2 = kGCnXBinsPi0MassCF; // do not use same variable for CF than for histogram               
1258                 
1259     //arrays for the number of bins in each dimension
1260     Int_t iBin[nvar];
1261     iBin[0] = nbin0;
1262     iBin[1] = nbin1;
1263     iBin[2] = nbin2;    
1264                 
1265     //arrays for lower bounds
1266     Double_t *binLim0 = new Double_t[nbin0+1];
1267     Double_t *binLim1 = new Double_t[nbin1+1];  
1268     Double_t *binLim2 = new Double_t[nbin2+1];  
1269                 
1270     // values for lower bounds
1271     for(Int_t i = 0; i <= nbin0; i++) binLim0[i] = ptmin + (ptmax - ptmin)/nbin0*i;
1272     for(Int_t i = 0; i <= nbin1; i++) binLim1[i] = etamin + (etamax - etamin)/nbin1*i;
1273     for(Int_t i = 0; i <= nbin2; i++) binLim2[i] = massmin + (massmax - massmin)/nbin2*i;
1274                 
1275     // create container
1276     AliCFContainer *container = new AliCFContainer("container","container for gammaconversion", nstep,nvar,iBin);
1277     container->SetBinLimits(ipt,binLim0);
1278     container->SetBinLimits(ieta,binLim1);
1279     container->SetBinLimits(imass,binLim2);     
1280                 
1281     AliCFManager *man = new AliCFManager();
1282     man->SetParticleContainer(container);
1283     for(int i = 0;i<nstep;i++){
1284       TObjArray *tmp = new TObjArray(0);
1285       man->SetParticleCutsList(i,tmp) ;
1286     }
1287
1288     // end ---------------------------------------------------------------------------
1289                 
1290                 
1291
1292         
1293   AliGammaConversionHistograms* histograms = new AliGammaConversionHistograms();  
1294   AddHistograms(histograms);
1295         
1296   // Create the Analysis manager
1297   AliAnalysisManager *mgr =NULL;
1298   if(kGCrunOnTrain == kFALSE){
1299     mgr  = new AliAnalysisManager("My Manager", "My Analysis");
1300   }
1301   else{
1302     mgr = AliAnalysisManager::GetAnalysisManager();
1303   }
1304         
1305   if (!mgr) {
1306     ::Error("ConfigGammaConversion", "No analysis manager to connect to.");
1307     return NULL;
1308   }
1309   if(kGCrunOnTrain == kTRUE){
1310     if (!mgr->GetInputEventHandler()) {
1311       ::Error("ConfigGammaConversion", "This task requires an input event handler");
1312       return NULL;
1313     }
1314   }
1315   AliESDInputHandler* inpHandler = NULL;
1316         
1317   if(kGCrunOnTrain == kFALSE){
1318     // Define Input Event Handler 
1319     inpHandler = new AliESDInputHandler();
1320   }
1321   // Define MC Truth Event Handler
1322   AliMCEventHandler* mcHandler = NULL;
1323   if(kGCdoMCTruth){
1324     if(kGCrunOnTrain == kFALSE){
1325       mcHandler = new AliMCEventHandler();
1326     }
1327     else{
1328       mcHandler = (AliMCEventHandler*)mgr->GetMCtruthEventHandler();
1329     }
1330     if (!mcHandler) {
1331       ::Error("", "No MC handler connected");
1332       return NULL;
1333     }
1334   }
1335         
1336
1337         
1338   if(kGCrunOnTrain == kFALSE){
1339     mgr->SetInputEventHandler  (inpHandler);
1340     mgr->SetMCtruthEventHandler(mcHandler);
1341   }
1342   // Be sure you are told what you are doing
1343   // mgr->SetDebugLevel(10);
1344         
1345   // Declare Common Input Tchain
1346   AliAnalysisDataContainer *cinput1 = NULL;
1347   
1348   if(kGCusePWG4PartCorr){
1349   
1350     if(kGCrunOnTrain == kFALSE){
1351       cinput1 = mgr->CreateContainer("GammaConvChain",TChain::Class(),AliAnalysisManager::kInputContainer);
1352     
1353     } else{
1354       cinput1 = cin_esd;
1355     
1356     }
1357   }
1358   else{
1359       cinput1 = mgr->GetCommonInputContainer();
1360   }
1361         
1362   // Common Output Tree in common ??????default?????? output file
1363   // CKB kGCusePWG4PartCorr and writestandard are not mutually exclusive?
1364   AliAnalysisDataContainer *coutput1 = NULL;
1365
1366   if(kGCWriteAOD) {
1367     if(kGCrunOnTrain && !(kGCrunOnGsiTrain)) {
1368       coutput1 = mgr->GetCommonOutputContainer();
1369     } else {
1370       coutput1 = mgr->CreateContainer("GammaConvTree",TTree::Class(),AliAnalysisManager::kOutputContainer, "default");  
1371     }
1372   }
1373         
1374   // Private output objects
1375   if(kGCoutputFileName.Contains(".root")){
1376     kGCoutputFileName.ReplaceAll(".root","");
1377   }
1378   if(kGCoutputFileAppendix.Contains(".root")){
1379     kGCoutputFileAppendix.ReplaceAll(".root","");
1380   }
1381   //TString fileOut = kGCoutputFileName + kGCoutputFileAppendix + ".root";
1382
1383   
1384   TString outputfile = AliAnalysisManager::GetCommonFileName();
1385   cout<<"Analyis cut selection ID is: "<<kGCAnalysisCutSelectionId.Data()<<endl;
1386   //  outputfile += Form(":PWG4_GammaConversion_%s",kGCAnalysisCutSelectionId.Data());
1387   outputfile += Form(":PWG4_GammaConversion");
1388
1389 //   if(kGCrunNeutralMeson==kTRUE) outputfile +="1";  else outputfile +="0";
1390
1391 //   if(kGCrunJet==kTRUE) outputfile +="1"; else outputfile +="0";
1392
1393 //   if(kGCrunChic==kTRUE) outputfile +="1"; else outputfile +="0";
1394
1395 //   if(kGCrunCF==kTRUE) outputfile +="1"; else outputfile +="0";
1396
1397 //   if(kGCcalculateBackground==kTRUE) outputfile +="1"; else outputfile +="0";
1398
1399 //   if(kGCdoNeutralMesonV0MCCheck==kTRUE) outputfile +="1"; else outputfile +="0";
1400
1401 //   if(kGCrunOmegaMeson==kTRUE) outputfile +="1"; else outputfile +="0";
1402
1403 //   if(kGCrunRES==kTRUE) outputfile +="1"; else outputfile +="0";
1404
1405   outputfile += Form("_%s",kGCAnalysisCutSelectionId.Data());
1406
1407   cout<<"Ouput file::"<<  outputfile <<endl;
1408   AliAnalysisDataContainer *coutput2 = mgr->CreateContainer(Form("histogramsAliGammaConversion_%s",kGCAnalysisCutSelectionId.Data()), TList::Class(),AliAnalysisManager::kOutputContainer, outputfile);
1409   // for CF
1410   AliAnalysisDataContainer *coutput3 = mgr->CreateContainer(Form("GammaConvccontainer0_%s",kGCAnalysisCutSelectionId.Data()),AliCFContainer::Class(),AliAnalysisManager::kOutputContainer,outputfile);
1411         
1412   //------------------------ END: Define input/output handlers ---------------------------------------------------
1413         
1414   //check for errors in the specified data
1415   if(kGCuseKFParticle == kTRUE && kGCuseESDTrack == kTRUE){
1416     //Print warning, cannot use both
1417     ::Error("ConfigGammaConversion","Both kGCuseKFParticle and kGCuseESDTracks can be true at the same time")
1418       }
1419   if(kGCuseKFParticle == kFALSE && kGCuseESDTrack == kFALSE){
1420     //Print warning, one have to be specified
1421     ::Error("ConfigGammaConversion","Both kGCuseKFParticle and kGCuseESDTracks can be false at the same time")
1422       }
1423         
1424
1425   if(!SetAnalysisCutSelection(kGCAnalysisCutSelectionId)){
1426     cout<<"Error in analysis cut selection"<<endl;
1427     return 0;
1428   }
1429         
1430   //Create the V0Reader
1431   AliV0Reader * v0Reader = new AliV0Reader();
1432   if(kGCuseKFParticle){
1433     v0Reader->UseKFParticle();
1434   }
1435   else if(kGCuseESDTrack){
1436     v0Reader->UseESDTrack();
1437   }
1438
1439   v0Reader->SetMaxVertexZ(kGCmaxVertexZ);
1440   v0Reader->SetNegativeTrackPID(kGCpidOfNegativeTrack);
1441   v0Reader->SetPositiveTrackPID(kGCpidOfPositiveTrack);
1442   v0Reader->SetMaxRCut(kGCmaxRCut);
1443   v0Reader->SetMinRCut(kGCminRCut);
1444   v0Reader->SetEtaCut(kGCetaCut);
1445   v0Reader->SetRapidityMesonCut(kGCrapidityCutMeson);
1446   v0Reader->SetPtCut(kGCptCut);
1447   v0Reader->SetSinglePtCut(kGCsingleptCut);
1448   v0Reader->SetLineCutZRSlope(kGCLineCutZRSlope);
1449   v0Reader->SetLineCutZValue(kGCLineCutZValue); 
1450   v0Reader->SetMaxZCut(kGCmaxZCut);     
1451   v0Reader->SetMinClsTPCCut(kGCminClsTPCCut);   
1452   v0Reader->SetMinClsTPCCutToF(kGCminClsTPCCutToF);     
1453   v0Reader->SetChi2CutConversion(kGCchi2CutConversion);
1454   v0Reader->SetChi2CutMeson(kGCchi2CutMeson);
1455   v0Reader->SetAlphaCutMeson(kGCalphaCutMeson);
1456   v0Reader->SetAlphaMinCutMeson(kGCalphaMinCutMeson);
1457   v0Reader->SetPIDProbability(kGCprobElectron);
1458   v0Reader->SetXVertexCut(kGCxVertexCut);
1459   v0Reader->SetYVertexCut(kGCyVertexCut);
1460   v0Reader->SetZVertexCut(kGCzVertexCut);
1461   v0Reader->SetSigmaMass(kGCsigmaCutGammaMass);
1462   v0Reader->SetUseImprovedVertex(kGCuseImprovedVertex);
1463   v0Reader->SetDoMCTruth(kGCdoMCTruth);
1464   v0Reader->SetUseOwnXYZCalculation(kGCdoOwnXYZCalculation);
1465   v0Reader->SetUseChargedTracksMultiplicityForBG(kGCUseTrackMultiplicityForBG);
1466   // for CF
1467   v0Reader->SetCFManager(man);
1468         
1469   // for dEdx N sigma Cut
1470   v0Reader->SetDodEdxSigmaCut(kGCdodEdxSigmaCut);
1471   v0Reader->SetPIDnSigmaAboveElectronLine(kGCPIDnSigmaAboveElectronLine);
1472   v0Reader->SetPIDnSigmaBelowElectronLine(kGCPIDnSigmaBelowElectronLine);
1473   v0Reader->SetPIDnSigmaAbovePionLine(kGCPIDnSigmaAbovePionLine);
1474   v0Reader->SetPIDMinPnSigmaAbovePionLine(kGCPIDMinPnSigmaAbovePionLine);
1475   v0Reader->SetPIDMaxPnSigmaAbovePionLine(kGCPIDMaxPnSigmaAbovePionLine);
1476   v0Reader->SetOnFlyFlag(kGCUseOnFlyV0Finder);
1477   v0Reader->SetCalculateBackground(kGCcalculateBackground);
1478
1479   // for the rejection at LowP based on Dedx signal
1480
1481   v0Reader->SetDoKaonRejectionLowP(kGCdoKaonRejectionLowP);
1482   v0Reader->SetDoProtonRejectionLowP(kGCdoProtonRejectionLowP);
1483   v0Reader->SetDoPionRejectionLowP(kGCdoPionRejectionLowP);
1484   v0Reader->SetPIDnSigmaAtLowPAroundKaonLine(kGCPIDnSigmaAtLowPAroundKaonLine);
1485   v0Reader->SetPIDnSigmaAtLowPAroundProtonLine(kGCPIDnSigmaAtLowPAroundProtonLine);
1486   v0Reader->SetPIDnSigmaAtLowPAroundPionLine(kGCPIDnSigmaAtLowPAroundPionLine);
1487   v0Reader->SetPIDMinPKaonRejectionLowP(kGCPIDMinPKaonRejectionLowP);
1488   v0Reader->SetPIDMinPProtonRejectionLowP(kGCPIDMinPProtonRejectionLowP);
1489   v0Reader->SetPIDMinPPionRejectionLowP(kGCPIDMinPPionRejectionLowP);
1490   v0Reader->SetDoQtGammaSelection(kGCdoQtGammaSelection);
1491   v0Reader->SetQtMax(kGCQtMax);
1492   v0Reader->SetNEventsForBG(kGCNEventsForBGCalculation);
1493
1494   // Create the GammaConversionTask
1495
1496
1497   AliAnalysisTaskGammaConversion *gammaconversion = 
1498     new AliAnalysisTaskGammaConversion(Form("GammaConversionTask_%s",kGCAnalysisCutSelectionId.Data()));
1499
1500   cout<<"name of Task::"<< Form("GammaConversionTask_%s",kGCAnalysisCutSelectionId.Data())<< " "<<gammaconversion->GetName() <<endl;
1501   gammaconversion->SetDebugLevel(0);
1502         
1503   gammaconversion->SetWriteNtuple(kGCwriteNtuple);
1504         
1505   gammaconversion->SetV0Reader(v0Reader);
1506   gammaconversion->SetCalculateBackground(kGCcalculateBackground);
1507   gammaconversion->Init();
1508         
1509   gammaconversion->SetElectronMass(kGCelectronMass);
1510   gammaconversion->SetGammaMass(kGCgammaMass);
1511   gammaconversion->SetPi0Mass(kGCpi0Mass);
1512   gammaconversion->SetEtaMass(kGCetaMass);
1513         
1514   gammaconversion->SetGammaWidth(kGCgammaWidth);
1515   gammaconversion->SetPi0Width(kGCpi0Width);
1516   gammaconversion->SetEtaWidth(kGCetaWidth);
1517         
1518   gammaconversion->SetMinOpeningAngleGhostCut(kGCminOpeningAngleGhostCut);
1519   
1520         
1521   Double_t lowPtMapping=0.4;
1522   Double_t highPtMapping=1.5;
1523   gammaconversion->SetLowPtMapping(lowPtMapping);
1524   gammaconversion->SetHighPtMapping(highPtMapping);
1525
1526   // define the width constraint used by KF particle.
1527   Double_t gammaWidth = 0.01;
1528   Double_t pi0Width   = 0.01;
1529   Double_t etaWidth   = 0.01;
1530         
1531   gammaconversion->SetHistograms(histograms);
1532   v0Reader->SetHistograms(histograms);// also give the pointer to the v0reader, for debugging cuts
1533
1534   gammaconversion->SetTriggerCINT1B(kGCtriggerCINT1B);
1535   gammaconversion->SetDoMCTruth(kGCdoMCTruth);
1536         
1537   gammaconversion->SetDoNeutralMeson(kGCrunNeutralMeson);
1538   gammaconversion->SetDoNeutralMesonV0MCCheck(kGCdoNeutralMesonV0MCCheck);
1539   gammaconversion->SetDoJet(kGCrunJet);
1540   gammaconversion->SetDoChic(kGCrunChic);
1541   gammaconversion->SetDoOmegaMeson(kGCrunOmegaMeson);
1542   gammaconversion->SetRecalculateV0ForGamma(kGCRecalculateV0ForGamma);
1543   gammaconversion->SetUseChargedTracksMultiplicityForBG(kGCUseTrackMultiplicityForBG);
1544   gammaconversion->SetMoveParticleAccordingToVertex(kGCMoveParticlesAccordingToVertex);
1545   gammaconversion->SetApplyChi2Cut(kGCApplyChi2Cut);
1546   cout<<"NumberOfDegrees in rotatation method set to: "<<kGCnDegreeRotationPMForBG<<endl;
1547   gammaconversion->SetPMDegreesBG(kGCnDegreeRotationPMForBG);
1548   if(kGCUseRotationMethodInBG){
1549     cout<<"Using rotation method for bg."<<endl;
1550   }
1551   else{
1552     cout<<"Using mixed event for bg."<<endl;
1553   }
1554   gammaconversion->SetDoRotation(kGCUseRotationMethodInBG);
1555   cout<<"Using :"<<kGCnumberOfRotationEventsForBG<<" rotations in bg calculation"<<endl;
1556   gammaconversion->SetNumberOfRotationsBG(kGCnumberOfRotationEventsForBG);
1557   gammaconversion->SetCheckBGProbability(kGCdoBGProbability);
1558
1559   gammaconversion->SetRemovePileUp(kGCRemovePileUp);
1560   gammaconversion->SetSelectV0AND(kGCSelectV0AND);
1561   gammaconversion->SetUseMultiplicity(kGCUseMultiplicity);
1562   gammaconversion->SetUseMultiplicityBin(kGCUseMultiplicityBin);
1563
1564   v0Reader->SetIsHeavyIon(kGCIsHeavyIon);
1565   gammaconversion->SetUseCentrality(kGCUseCentrality);
1566   if(kGCUseCentrality){
1567     gammaconversion->SetUseCentralityBin(kGCUseCentralityBin);
1568   }
1569
1570
1571
1572
1573   // for CF
1574   gammaconversion->SetCFManager(man);
1575   gammaconversion->SetDoCF(kGCrunCF);
1576   v0Reader->SetDoCF(kGCrunCF);
1577
1578   // Add task to the manager 
1579   mgr->AddTask(gammaconversion);
1580
1581
1582   // Define Output Event Handler and add
1583   if(kGCWriteAOD){
1584     gammaconversion->SetForceAOD(kGCForceAOD);
1585
1586     if( kGCrunOnTrain ) {
1587
1588       AliAODHandler * aodHandler = dynamic_cast<AliAODHandler*>(mgr->GetOutputEventHandler());
1589       if(!aodHandler) {
1590         ::Error("This task requires an AOD handler");
1591         return -1;
1592       }
1593
1594       gammaconversion->SetDeltaAODFileName(kGCDeltaAODFilename);
1595       
1596       if(kGCDeltaAODFilename.Length() > 0) {
1597         mgr->RegisterExtraFile(kGCDeltaAODFilename.Data());
1598       }
1599       
1600     } else {
1601       if(kGCDeltaAODFilename.Length() == 0 ) {
1602         cout << "Error:: Need a file name for the AOD"<<endl;
1603         return;
1604       }
1605       AliAODHandler* aodHandler = new AliAODHandler();
1606       aodHandler->SetOutputFileName(kGCDeltaAODFilename);
1607       aodHandler->SetCreateNonStandardAOD();
1608       mgr->SetOutputEventHandler(aodHandler);   
1609     }
1610   }
1611
1612   // Connect I/O to the task
1613   mgr->ConnectInput (gammaconversion, 0, cinput1);
1614   if(mgr->GetCommonOutputContainer())
1615     mgr->ConnectOutput(gammaconversion, 0, mgr->GetCommonOutputContainer());
1616
1617   mgr->ConnectOutput(gammaconversion, 1, coutput2);
1618   mgr->ConnectOutput(gammaconversion, 2, coutput3);
1619
1620   if(kGCRunGammaJetTask) {
1621     AliAnalysisTaskGammaJet * gammaJetTask = new AliAnalysisTaskGammaJet("GammaJetTask");
1622     if(kGCrunOnTrain) {
1623       gammaJetTask->SetDeltaAODFileName(kGCDeltaAODFileName);
1624     }
1625     
1626     mgr->ConnectInput(gammaJetTask, 0, cinput1);
1627     AliAnalysisDataContainer *coutputgj = mgr->CreateContainer("chistpt", TList::Class(), AliAnalysisManager::kOutputContainer, "AnalysisResultsConvJets.root");
1628     mgr->ConnectOutput(gammaJetTask, 1, coutputgj);
1629   }
1630
1631
1632   if( kGCrunDalitz ){
1633    
1634    gROOT->LoadMacro("$ALICE_ROOT/PWG4/macros/AddTaskGammaConvDalitz.C");
1635    AddTaskGammaConvDalitz( v0Reader, kGCcalculateBackground, kGCRunStandalone );
1636
1637   }
1638
1639   if(kGCrunOnTrain == kFALSE){
1640     if(kGCdataList.IsNull()){
1641       cout<<"Data list is not set, aborting."<<endl;
1642       return;
1643     }
1644     /*
1645       gROOT->LoadMacro("$ALICE_ROOT/ANALYSIS/macros/AddTaskPhysicsSelection.C");
1646       AliPhysicsSelectionTask* physSelTask = AddTaskPhysicsSelection();
1647       if(kGCdoMCTruth)physSelTask->GetPhysicsSelection()->SetAnalyzeMC();
1648       physSelTask->GetPhysicsSelection()->AddBackgroundIdentification(new AliBackgroundSelection());
1649       gammaconversion->SelectCollisionCandidates();     
1650     */
1651
1652     gROOT->LoadMacro("$ALICE_ROOT/ANALYSIS/macros/AddTaskPhysicsSelection.C");
1653     AliPhysicsSelectionTask* physSelTask = AddTaskPhysicsSelection(kGCdoMCTruth,kTRUE);
1654     gammaconversion->SelectCollisionCandidates(); 
1655
1656     //    if(kGCrunOnTrain == kFALSE){
1657       TChain* chain= CreateESDChain(kGCdataList,kGCnumberOfFilesToAnalyze);
1658                         
1659       mgr->InitAnalysis();
1660                         
1661       mgr->PrintStatus();
1662                         
1663       mgr->StartAnalysis("local",chain);
1664       //    }
1665   }
1666   return gammaconversion;
1667 }
1668
1669 void build() {
1670         
1671   TStopwatch timer;
1672   timer.Start();
1673   gSystem->Load("libTree.so");
1674   gSystem->Load("libGeom");
1675         
1676   TString pwd = gSystem->WorkingDirectory();
1677         
1678   ////
1679   //Setting up STEERBase.par//
1680   ////
1681   cout<<"compiling STEERBase"<<endl;
1682   setupPar("STEERBase");
1683   gSystem->Load("libSTEERBase.so");
1684
1685
1686    ////
1687   //Setting up ESD.par//
1688   ////
1689   cout<<"compiling ESD"<<endl;
1690   setupPar("ESD");
1691   gSystem->Load("libVMC.so");
1692   gSystem->Load("libESD.so");
1693
1694         
1695   ////
1696   //Setting up AOD.par//
1697   ////
1698   cout<<"compiling AOD"<<endl;
1699   setupPar("AOD");
1700   gSystem->Load("libAOD.so");
1701         
1702   ////
1703   //Setting up ANALYSIS.par//
1704   ////
1705   cout<<"compiling ANALYSIS"<<endl;
1706   setupPar("ANALYSIS");
1707   gSystem->Load("libANALYSIS.so");
1708         
1709   ////
1710   //Setting up ANALYSISalice.par//
1711   ////
1712   cout<<"compiling ANALYSISalice"<<endl;
1713   setupPar("ANALYSISalice");
1714   gSystem->Load("libANALYSISalice.so");
1715         
1716   ////
1717   //Setting up CORRFW.par//
1718   ////
1719   cout<<"compiling CORRFW"<<endl;
1720   setupPar("CORRFW");
1721   gSystem->Load("libCORRFW.so");
1722         
1723   ////
1724   //Setting up PWG4GammaConv.par//
1725   ////
1726   cout<<"compiling PWG4GammaConv"<<endl;
1727   setupPar("PWG4GammaConv");
1728   gSystem->Load("libPWG4GammaConv.so");
1729   
1730   gSystem->ChangeDirectory(pwd.Data());
1731 }
1732
1733 Int_t setupPar(const char* pararchivename) {
1734   ///////////////////
1735   // Setup PAR File//
1736   ///////////////////
1737   if (pararchivename) {
1738     char processline[1024];
1739     sprintf(processline,".! tar xvzf %s.par",pararchivename);
1740     gROOT->ProcessLine(processline);
1741     const char* ocwd = gSystem->WorkingDirectory();
1742     gSystem->ChangeDirectory(pararchivename);
1743                 
1744     // check for BUILD.sh and execute
1745     if (!gSystem->AccessPathName("PROOF-INF/BUILD.sh")) {
1746       printf("*******************************\n");
1747       printf("*** Building PAR archive    ***\n");
1748       printf("*******************************\n");
1749                         
1750       if (gSystem->Exec("PROOF-INF/BUILD.sh")) {
1751         Error("runAnalysis","Cannot Build the PAR Archive! - Abort!");
1752         return -1;
1753       }
1754     }
1755     // check for SETUP.C and execute
1756     if (!gSystem->AccessPathName("PROOF-INF/SETUP.C")) {
1757       printf("*******************************\n");
1758       printf("*** Setup PAR archive       ***\n");
1759       printf("*******************************\n");
1760       gROOT->Macro("PROOF-INF/SETUP.C");
1761     }
1762                 
1763     gSystem->ChangeDirectory("../");
1764   }                                                                                                                                               
1765   return 1;
1766 }
1767
1768
1769
1770 void AddHistograms(AliGammaConversionHistograms *histograms){
1771   //---------------------------------------------- Jets ---------------------------------------------------------
1772   if(kGCrunJet == kTRUE){
1773     if (kGCplotdPhiHdrGam == kTRUE){
1774       histograms->AddHistogram("ESD_dphiHdrGam","ESD_dphiHdrGam", kGCnXBinsdphiHdrGam,kGCfirstXBindphiHdrGam,kGClastXBindphiHdrGam,"dphiHdrGam (rad)","Counts");
1775     }
1776                 
1777     if (kGCplotdPhiHdrGamIsolated == kTRUE){
1778       histograms->AddHistogram("ESD_dphiHdrGamIsolated","ESD_dphiHdrGamIsolated",  kGCnXBinsdphiHdrGam,kGCfirstXBindphiHdrGam,kGClastXBindphiHdrGam,"dphiHdrGamIsolated (rad)","Counts");
1779     }
1780                 
1781     if (kGCplotMinimumIsoDistance == kTRUE){
1782       histograms->AddHistogram("ESD_MinimumIsoDistance","ESD_MinimumIsoDistance", kGCnXBinsMinimumIsoDistance,kGCfirstXBinMinimumIsoDistance,kGClastXBinMinimumIsoDistance,"Minimum Iso Distance (rad)","Counts");
1783     }
1784                 
1785     if (kGCplotFFzHdrGam == kTRUE){
1786       histograms->AddHistogram("ESD_FFzHdrGam","ESD_FFzHdrGam", kGCnXBinsFFzHdrGam, kGCfirstXBinFFzHdrGam,kGClastXBinFFzHdrGam,"FFz Hdr Gam","Counts");
1787     }
1788                 
1789     if (kGCplotImbalanceHdrGam == kTRUE){
1790       histograms->AddHistogram("ESD_ImbalanceHdrGam","ESD_ImbalanceHdrGam", kGCnXBinsImbalanceHdrGam, kGCfirstXBinImbalanceHdrGam,kGClastXBinImbalanceHdrGam,"Imbalance Hdr Gam","Counts");
1791     }
1792   }//end if(kGCrunJet)
1793         
1794   //---------------------------------------------- Chi_c ---------------------------------------------------------
1795   if(kGCrunChic){
1796                 
1797     if(kGCplotESDInvMassePluseMinus == kTRUE){histograms->AddHistogram("ESD_InvMass_ePluseMinus","",kGCnXBinsJPsiMass, kGCfirstXBinJPsiMass, kGClastXBinJPsiMass, "",
1798                                                                        "");}
1799     if(kGCplotESDInvMassePluseMinus == kTRUE){histograms->AddHistogram("ESD_InvMass_ePluseMinusTest","",kGCnXBinsJPsiMass, kGCfirstXBinJPsiMass, kGClastXBinJPsiMass,
1800                                                                        "","");}
1801     if(kGCplotESDInvMassePluseMinus == kTRUE){histograms->AddHistogram("ESD_InvMass_xPlusxMinus","",kGCnXBinsJPsiMass, kGCfirstXBinJPsiMass, kGClastXBinJPsiMass, "",
1802                                                                        "");}
1803     if(kGCplotESDElectronPosNegPt == kTRUE){histograms->AddHistogram("ESD_ElectronPosNegPt","",kGCnXBinsEPosNegPt,kGCfirstXBinEPosNegPt,kGClastXBinEPosNegPt,"","");}
1804     if(kGCplotESDElectronPosNegEta == kTRUE){histograms->AddHistogram("ESD_ElectronPosNegEta","",kGCnXBinsEPosNegEta,kGCfirstXBinEPosNegEta,kGClastXBinEPosNegEta,"","
1805                                                                                                                                                   ");}
1806                 
1807     if(kGCplotESDElectronPosNegPt == kTRUE){histograms->AddHistogram("ESD_ElectronPosPt","",kGCnXBinsEPosNegPt,kGCfirstXBinEPosNegPt,kGClastXBinEPosNegPt,"","");}
1808     if(kGCplotESDElectronPosNegPt == kTRUE){histograms->AddHistogram("ESD_ElectronNegPt","",kGCnXBinsEPosNegPt,kGCfirstXBinEPosNegPt,kGClastXBinEPosNegPt,"","");}
1809                 
1810     if(kGCplotESDElectronPosNegAngle == kTRUE){histograms->AddHistogram("ESD_ElectronPosNegJPsiAngle","",kGCnXBinsEPosNegAngle,kGCfirstXBinEPosNegAngle,kGClastXBinEPosNegAngle,"","");}
1811
1812     if(kGCplotESDePoseNegAngle == kTRUE){histograms->AddHistogram("ESD_eNegePosAngleBeforeCut","",kGCnXBinsEPosNegAngle,kGCfirstXBinEPosNegAngle,kGClastXBinEPosNegAngle,"","");}
1813     if(kGCplotESDePoseNegAngle == kTRUE){histograms->AddHistogram("ESD_eNegePosAngleAfterCut","",kGCnXBinsEPosNegAngle,kGCfirstXBinEPosNegAngle,kGClastXBinEPosNegAngle,"","");}
1814     if(kGCplotESDInvMassGammaePluseMinusChiC == kTRUE) {histograms->AddHistogram("ESD_InvMass_GammaePluseMinusChiC","",kGCnXBinsChicMass,kGCfirstXBinChicMass,kGClastXBinChicMass,"","");}
1815     if(kGCplotESDInvMassGammaePluseMinusChiC == kTRUE) {histograms->AddHistogram("ESD_InvMass_GammaePluseMinusChiCDiff","",kGCnXBinsChicMass,kGCfirstXBinChicMass,kGClastXBinChicMass,"","");}
1816     if(kGCplotESDInvMassGammaePluseMinusPi0 == kTRUE) {histograms->AddHistogram("ESD_InvMass_GammaePluseMinusPi0","",kGCnXBinsPi0Mass,kGCfirstXBinPi0Mass,kGClastXBinPi0Mass,"","");}
1817     if(kGCplotESDElectronPosNegPi0Angle == kTRUE){histograms->AddHistogram("ESD_ElectronPosNegPi0Angle","",kGCnXBinsEPosNegAngle,kGCfirstXBinEPosNegAngle,kGClastXBinEPosNegAngle,"","");}
1818                 
1819     if(kGCplotESDEPosBackground == kTRUE){histograms->AddHistogram("ESD_EPosBackground","",kGCnXBinsEBackground,kGCfirstXBinEBackground,kGClastXBinEBackground,"","");}
1820                 
1821     if(kGCplotESDEPosBackground == kTRUE){histograms->AddHistogram("ESD_EPosENegNoJPsiBG","",kGCnXBinsEBackground,kGCfirstXBinEBackground,kGClastXBinEBackground,"","");}
1822                 
1823                 
1824     if(kGCplotESDENegBackground == kTRUE){histograms->AddHistogram("ESD_ENegBackground","",kGCnXBinsEBackground,kGCfirstXBinEBackground,kGClastXBinEBackground,"","");}
1825     if(kGCplotESDEPosENegBackground == kTRUE){histograms->AddHistogram("ESD_EPosENegBackground","",kGCnXBinsEBackground,kGCfirstXBinEBackground,kGClastXBinEBackground,"","");}
1826     if(kGCplotESDEPosENegBackgroundCut == kTRUE){histograms->AddHistogram("ESD_EPosENegBackgroundCut","",kGCnXBinsEBackgroundCut,kGCfirstXBinEBackgroundCut,kGClastXBinEBackgroundCut,"","");}
1827                 
1828     if(kGCplotESDEPosENegGammaBackgroundMX == kTRUE){histograms->AddHistogram("ESD_EPosENegGammaBackgroundMX","",kGCnXBinsEBackground,kGCfirstXBinEBackground,kGClastXBinEBackground,"","");}
1829     if(kGCplotESDEPosENegGammaBackgroundMX == kTRUE){histograms->AddHistogram("ESD_EPosENegGammaBackgroundMXDiff","",kGCnXBinsEBackground,kGCfirstXBinEBackground,kGClastXBinEBackground,"","");}
1830                 
1831     if(kGCplotTableElectrons == kTRUE){ histograms->AddTable("Table_Electrons","",kGCnElementsElectronTable,kGCelectronTable);}
1832
1833     if(kGCdoMCTruth){
1834       if(kGCplotMCElectronPosNegPt == kTRUE){histograms->AddHistogram("MC_ElectronPosNegPt","",kGCnXBinsEPosNegPt,kGCfirstXBinEPosNegPt,kGClastXBinEPosNegPt,"","");}
1835       if(kGCplotMCElectronPosNegEta == kTRUE){histograms->AddHistogram("MC_ElectronPosNegEta","",kGCnXBinsEPosNegEta,kGCfirstXBinEPosNegEta,kGClastXBinEPosNegEta,"","");}
1836       if(kGCplotMCElectronPosNegJPsiAngle == kTRUE){histograms->AddHistogram("MC_ElectronPosNegJPsiAngle","",kGCnXBinsEPosNegAngle,kGCfirstXBinEPosNegAngle,kGClastXBinEPosNegAngle,"","");}
1837       if(kGCplotMCElectronPosNegPi0Angle == kTRUE){histograms->AddHistogram("MC_ElectronPosNegPi0Angle","",kGCnXBinsEPosNegAngle,kGCfirstXBinEPosNegAngle,kGClastXBinEPosNegAngle,"","");}
1838     }
1839
1840   }// end kGCrunChic
1841         
1842
1843   //---------------------------------------------- Gamma from Decay ----------------------------------------------------
1844   if(kGCplotMCGammaFromDecay == kTRUE && kGCdoMCTruth == kTRUE){
1845      histograms->AddHistogram("MC_DecayPi0Gamma_Pt" ,"" , kGCnXBinsPt, kGCfirstXBinPt, kGClastXBinPt, "", "");  
1846      histograms->AddHistogram("MC_DecayRho0Gamma_Pt" ,"" , kGCnXBinsPt, kGCfirstXBinPt, kGClastXBinPt, "", "");
1847      histograms->AddHistogram("MC_DecayEtaGamma_Pt" ,"" , kGCnXBinsPt, kGCfirstXBinPt, kGClastXBinPt, "", "");
1848      histograms->AddHistogram("MC_DecayOmegaGamma_Pt" ,"" , kGCnXBinsPt, kGCfirstXBinPt, kGClastXBinPt, "", "");
1849      histograms->AddHistogram("MC_DecayK0sGamma_Pt" ,"" , kGCnXBinsPt, kGCfirstXBinPt, kGClastXBinPt, "", "");
1850      histograms->AddHistogram("MC_DecayEtapGamma_Pt" ,"" , kGCnXBinsPt, kGCfirstXBinPt, kGClastXBinPt, "", "");
1851      histograms->AddHistogram("MC_DecayAllGamma_Pt" ,"" , kGCnXBinsPt, kGCfirstXBinPt, kGClastXBinPt, "", "");
1852   }
1853
1854   //---------------------------------------------- Neutral Meson ---------------------------------------------------------
1855   if(kGCrunNeutralMeson){
1856                 
1857     // Histograms from esd tracks       
1858     if(kGCplotESDEEnergy == kTRUE){ histograms->AddHistogram("ESD_E_Energy" ,"" , kGCnXBinsEnergy, kGCfirstXBinEnergy, kGClastXBinEnergy, "", "");}
1859     if(kGCplotESDEPt == kTRUE){ histograms->AddHistogram("ESD_E_Pt" ,"" , kGCnXBinsPt, kGCfirstXBinPt, kGClastXBinPt, "", "");}
1860     if(kGCplotESDEEta == kTRUE){ histograms->AddHistogram("ESD_E_Eta" ,"" , kGCnXBinsEta, kGCfirstXBinEta, kGClastXBinEta, "", "");}
1861     if(kGCplotESDEPhi == kTRUE){ histograms->AddHistogram("ESD_E_Phi" ,"" , kGCnXBinsPhi, kGCfirstXBinPhi, kGClastXBinPhi, "", "");}
1862     if(kGCplotESDENTPCClusters == kTRUE){ histograms->AddHistogram("ESD_E_nTPCClusters" ,"" , kGCnXBinsNTPCClusters, kGCfirstXBinNTPCClusters, kGClastXBinNTPCClusters, "", "");}
1863     if(kGCplotESDENITSClusters == kTRUE){ histograms->AddHistogram("ESD_E_nITSClusters" ,"" , kGCnXBinsNITSClusters, kGCfirstXBinNITSClusters, kGClastXBinNITSClusters, "", "");}
1864     if(kGCplotESDENTPCClustersToFP== kTRUE){ histograms->AddHistogram("ESD_E_nTPCClustersToFP" ,"" ,kGCnXBinsP, kGCfirstXBinP, kGClastXBinP,kGCnYBinsClsToF, kGCfirstYBinClsToF, kGClastYBinClsToF,"", "",0);}
1865     if(kGCplotESDETPCchi2 == kTRUE){ histograms->AddHistogram("ESD_E_TPCchi2" ,"" , kGCnXBinsTPCchi2, kGCfirstXBinTPCchi2, kGClastXBinTPCchi2, "", "");}
1866
1867                 
1868     if(kGCplotESDPEnergy == kTRUE){ histograms->AddHistogram("ESD_P_Energy" ,"" , kGCnXBinsEnergy, kGCfirstXBinEnergy, kGClastXBinEnergy, "", "");}
1869     if(kGCplotESDPPt == kTRUE){ histograms->AddHistogram("ESD_P_Pt" ,"" , kGCnXBinsPt, kGCfirstXBinPt, kGClastXBinPt, "", "");}
1870     if(kGCplotESDPEta == kTRUE){ histograms->AddHistogram("ESD_P_Eta" ,"" , kGCnXBinsEta, kGCfirstXBinEta, kGClastXBinEta, "", "");}
1871     if(kGCplotESDPPhi == kTRUE){ histograms->AddHistogram("ESD_P_Phi" ,"" , kGCnXBinsPhi, kGCfirstXBinPhi, kGClastXBinPhi, "", "");}
1872     if(kGCplotESDPNTPCClusters == kTRUE){ histograms->AddHistogram("ESD_P_nTPCClusters" ,"" , kGCnXBinsNTPCClusters, kGCfirstXBinNTPCClusters, kGClastXBinNTPCClusters, "", "");}
1873     if(kGCplotESDPNITSClusters == kTRUE){ histograms->AddHistogram("ESD_P_nITSClusters" ,"" , kGCnXBinsNITSClusters, kGCfirstXBinNITSClusters, kGClastXBinNITSClusters, "", "");}
1874     if(kGCplotESDPNTPCClustersToFP== kTRUE){ histograms->AddHistogram("ESD_P_nTPCClustersToFP" ,"" ,kGCnXBinsP, kGCfirstXBinP, kGClastXBinP,kGCnYBinsClsToF, kGCfirstYBinClsToF, kGClastYBinClsToF,"", "",0);}  
1875     if(kGCplotESDPTPCchi2 == kTRUE){ histograms->AddHistogram("ESD_P_TPCchi2" ,"" , kGCnXBinsTPCchi2, kGCfirstXBinTPCchi2, kGClastXBinTPCchi2, "", "");}
1876
1877     if(kGCplotESDConvGammaEnergy == kTRUE){ histograms->AddHistogram("ESD_ConvGamma_Energy" ,"" , kGCnXBinsEnergy, kGCfirstXBinEnergy, kGClastXBinEnergy, "", "");}
1878     if(kGCplotESDConvGammaPt == kTRUE){ histograms->AddHistogram("ESD_ConvGamma_Pt" ,"" , kGCnXBinsPt, kGCfirstXBinPt, kGClastXBinPt, "", "");}
1879     if(kGCplotESDConvGammaEta == kTRUE){ histograms->AddHistogram("ESD_ConvGamma_Eta" ,"" , kGCnXBinsEta, kGCfirstXBinEta, kGClastXBinEta, "", "");}
1880     if(kGCplotESDConvGammaPhi == kTRUE){ histograms->AddHistogram("ESD_ConvGamma_Phi" ,"" , kGCnXBinsPhi, kGCfirstXBinPhi, kGClastXBinPhi, "", "");}
1881     if(kGCplotESDConvGammaMass == kTRUE){ histograms->AddHistogram("ESD_ConvGamma_Mass" ,"" ,  kGCnXBinsGammaMass, kGCfirstXBinGammaMass, kGClastXBinGammaMass, "", "");}
1882     if(kGCplotESDConvGammaWidth == kTRUE){ histograms->AddHistogram("ESD_ConvGamma_Width" ,"" , kGCnXBinsGammaWidth, kGCfirstXBinGammaWidth, kGClastXBinGammaWidth, "", "");}
1883     if(kGCplotESDConvGammaChi2 == kTRUE){ histograms->AddHistogram("ESD_ConvGamma_Chi2" ,"" , kGCnXBinsGammaChi2, kGCfirstXBinGammaChi2, kGClastXBinGammaChi2, "", "");}
1884     if(kGCplotESDConvGammaNDF == kTRUE){ histograms->AddHistogram("ESD_ConvGamma_NDF" ,"" , kGCnXBinsGammaNDF, kGCfirstXBinGammaNDF, kGClastXBinGammaNDF, "", "");}
1885     if(kGCplotESDConvGammaRapid == kTRUE){ histograms->AddHistogram("ESD_ConvGamma_Rapid" ,"" , kGCnXBinsRapid, kGCfirstXBinRapid, kGClastXBinRapid, "", "");}
1886     if(kGCplotESDConvGammaPtvsEta == kTRUE){ histograms->AddHistogram("ESD_ConvGamma_Pt_Eta","", kGCnXBinsPt, kGCfirstXBinPt, kGClastXBinPt,kGCnXBinsEta, kGCfirstXBinEta, kGClastXBinEta,"","" );}
1887     if(kGCplotESDConvGammaPtvsChi2 == kTRUE){ histograms->AddHistogram("ESD_ConvGamma_Pt_Chi2" ,"" ,kGCnXBinsPt, kGCfirstXBinPt, kGClastXBinPt, kGCnXBinsGammaChi2, kGCfirstXBinGammaChi2, kGClastXBinGammaChi2, "", "");}
1888     if(kGCplotESDConvGammaEtavsChi2 == kTRUE){ histograms->AddHistogram("ESD_ConvGamma_Eta_Chi2" ,"" ,kGCnXBinsEta, kGCfirstXBinEta, kGClastXBinEta, kGCnXBinsGammaChi2, kGCfirstXBinGammaChi2, kGClastXBinGammaChi2, "", "");}
1889                 
1890                 
1891                 
1892     if(kGCplotESDConversionR == kTRUE){ histograms->AddHistogram("ESD_Conversion_R" ,"" , kGCnXBinsR, kGCfirstXBinR, kGClastXBinR, "", "");}
1893     if(kGCplotESDConversionZR == kTRUE){ histograms->AddHistogram("ESD_Conversion_ZR" ,"" , kGCnXBinsZR, kGCfirstXBinZR, kGClastXBinZR, kGCnYBinsZR, kGCfirstYBinZR, kGClastYBinZR, "", "");}
1894     if(kGCplotESDConversionXY == kTRUE){ histograms->AddHistogram("ESD_Conversion_XY" ,"" , kGCnXBinsXY, kGCfirstXBinXY, kGClastXBinXY, kGCnYBinsXY, kGCfirstYBinXY, kGClastYBinXY, "", "");}
1895     if(kGCplotESDConversionXYBeamPipe == kTRUE && kGCLowMemoryConsumption == kFALSE){ histograms->AddHistogram("ESD_Conversion_XY_BeamPipe" ,"" , kGCnXBinsXYBP, kGCfirstXBinXYBP, kGClastXBinXYBP, kGCnYBinsXYBP, kGCfirstYBinXYBP, kGClastYBinXYBP, "", "");}
1896     if(kGCplotESDConversionRPhiBeamPipe == kTRUE && kGCLowMemoryConsumption == kFALSE){ histograms->AddHistogram("ESD_Conversion_RPhi_BeamPipe" ,"" , kGCnXBinsRPhiBP, kGCfirstXBinRPhiBP, kGClastXBinRPhiBP, kGCnYBinsRPhiBP, kGCfirstYBinRPhiBP, kGClastYBinRPhiBP, "", "");}
1897     if(kGCplotESDConversionOpeningAngle == kTRUE){ histograms->AddHistogram("ESD_Conversion_OpeningAngle" ,"" , kGCnXBinsOpeningAngle, kGCfirstXBinOpeningAngle, kGClastXBinOpeningAngle, "", "");}
1898
1899     if(kGCplotESDConvGammaCosPointingAngle == kTRUE){ histograms->AddHistogram("ESD_ConvGamma_CosPointingAngle" ,"" , kGCnXBinsCosPointingAngle, kGCfirstXBinCosPointingAngle, kGClastXBinCosPointingAngle, "", "");}
1900     if(kGCplotESDConvGammaDcaDaugthers == kTRUE){ histograms->AddHistogram("ESD_ConvGamma_DcaDaughters" ,"" , kGCnXBinsDcaDaughters, kGCfirstXBinDcaDaughters, kGClastXBinDcaDaughters, "", "");}
1901     if(kGCplotESDConvGammaNormDcaDistDaugthers == kTRUE){ histograms->AddHistogram("ESD_ConvGamma_NormDcaDistDaughters" ,"" , kGCnXBinsNormDcaDistDaughters, kGCfirstXBinNormDcaDistDaughters, kGClastXBinNormDcaDistDaughters, "", "");}
1902     if(kGCplotESDConvGammaLikelihoodAP == kTRUE){ histograms->AddHistogram("ESD_ConvGamma_LikelihoodAP" ,"" , kGCnXBinsLikelihoodAP, kGCfirstXBinLikelihoodAP, kGClastXBinLikelihoodAP, "", "");}
1903     if(kGCplotESDConvGammaEAsymmetryP== kTRUE){ histograms->AddHistogram("ESD_ConvGamma_E_AsymmetryP" ,"" ,kGCnXBinsP, kGCfirstXBinP, kGClastXBinP,kGCnYBinsAsymmetry, kGCfirstYBinAsymmetry, kGClastYBinAsymmetry,"", "");}
1904     if(kGCplotESDConvGammaPAsymmetryP== kTRUE){ histograms->AddHistogram("ESD_ConvGamma_P_AsymmetryP" ,"" ,kGCnXBinsP, kGCfirstXBinP, kGClastXBinP,kGCnYBinsAsymmetry, kGCfirstYBinAsymmetry, kGClastYBinAsymmetry,"", "");}
1905     if(kGCplotESDConvGammaEdEdxP== kTRUE){ histograms->AddHistogram("ESD_ConvGamma_E_dEdxP" ,"" ,kGCnXBinsP, kGCfirstXBinP, kGClastXBinP,kGCnYBinsdEdx, kGCfirstYBindEdx, kGClastYBindEdx,"", "",0);}
1906     if(kGCplotESDConvGammaPdEdxP== kTRUE){ histograms->AddHistogram("ESD_ConvGamma_P_dEdxP" ,"" ,kGCnXBinsP, kGCfirstXBinP, kGClastXBinP,kGCnYBinsdEdx, kGCfirstYBindEdx, kGClastYBindEdx,"", "",0);}
1907
1908     if(kGCplotESDConvGammaEeProbP== kTRUE){ histograms->AddHistogram("ESD_ConvGamma_E_EProbP" ,"" ,kGCnXBinsP, kGCfirstXBinP, kGClastXBinP,kGCnYBinsEProb, kGCfirstYBinEProb, kGClastYBinEProb,"", "",0);}
1909     if(kGCplotESDConvGammaPeProbP== kTRUE){ histograms->AddHistogram("ESD_ConvGamma_P_EProbP" ,"" ,kGCnXBinsP, kGCfirstXBinP, kGClastXBinP,kGCnYBinsEProb, kGCfirstYBinEProb, kGClastYBinEProb,"", "",0);}
1910     if(kGCplotESDConvGammaEmupiProbP== kTRUE){ histograms->AddHistogram("ESD_ConvGamma_E_mupiProbP" ,"" ,kGCnXBinsP, kGCfirstXBinP, kGClastXBinP,kGCnYBinsEProb, kGCfirstYBinEProb, kGClastYBinEProb,"", "",0);}
1911     if(kGCplotESDConvGammaPmupiProbP== kTRUE){ histograms->AddHistogram("ESD_ConvGamma_P_mupiProbP" ,"" ,kGCnXBinsP, kGCfirstXBinP, kGClastXBinP,kGCnYBinsEProb, kGCfirstYBinEProb, kGClastYBinEProb,"", "",0);}
1912
1913     if(kGCplotESDConvGammaQtAlfa== kTRUE){ histograms->AddHistogram("ESD_ConvGamma_alfa_qt" ,"" ,kGCnXBinsP, kGCfirstXBinAlphaG, kGClastXBinAlpha,kGCnYBinsQt, kGCfirstYBinQt, kGClastYBinQt,"", "");}
1914
1915
1916                 
1917     if(kGCplotESDTrueDalitzContaminationR == kTRUE){ histograms->AddHistogram("ESD_TrueDalitzContamination_R" ,"" , kGCnXBinsR, kGCfirstXBinR, kGClastXBinR, "", "");}
1918     if(kGCplotESDTruePi0DalitzContaminationR == kTRUE){ histograms->AddHistogram("ESD_TrueConvDalitzPi0_R" ,"" , kGCnXBinsR, kGCfirstXBinR, kGClastXBinR, "", "");}
1919     if(kGCplotESDTrueEtaDalitzContaminationR == kTRUE){ histograms->AddHistogram("ESD_TrueConvDalitzEta_R" ,"" , kGCnXBinsR, kGCfirstXBinR, kGClastXBinR, "", "");}
1920     if(kGCplotESDTrueCombinatorialContaminationR == kTRUE){ histograms->AddHistogram("ESD_TrueConvCombinatorial_R" ,"" , kGCnXBinsR, kGCfirstXBinR, kGClastXBinR, "", "");}
1921     if(kGCplotESDTrueCombinatorialElecContaminationR == kTRUE){ histograms->AddHistogram("ESD_TrueConvCombinatorialElec_R" ,"" , kGCnXBinsR, kGCfirstXBinR, kGClastXBinR, "", "");}
1922
1923     if(kGCplotESDTrueConvGammaEnergy == kTRUE){ histograms->AddHistogram("ESD_TrueConvGamma_Energy" ,"" , kGCnXBinsEnergy, kGCfirstXBinEnergy, kGClastXBinEnergy, "", "");}
1924     if(kGCplotESDTrueConvGammaPt == kTRUE){ histograms->AddHistogram("ESD_TrueConvGamma_Pt" ,"" , kGCnXBinsPt, kGCfirstXBinPt, kGClastXBinPt, "", "");}
1925     if(kGCplotESDTrueConvGammaEta == kTRUE){ histograms->AddHistogram("ESD_TrueConvGamma_Eta" ,"" , kGCnXBinsEta, kGCfirstXBinEta, kGClastXBinEta, "", "");}
1926     if(kGCplotESDTrueConvGammaPhi == kTRUE){ histograms->AddHistogram("ESD_TrueConvGamma_Phi" ,"" , kGCnXBinsPhi, kGCfirstXBinPhi, kGClastXBinPhi, "", "");}
1927     if(kGCplotESDTrueConvGammaMass == kTRUE){ histograms->AddHistogram("ESD_TrueConvGamma_Mass" ,"" ,  kGCnXBinsGammaMass, kGCfirstXBinGammaMass, kGClastXBinGammaMass, "", "");}
1928     if(kGCplotESDTrueConvGammaWidth == kTRUE){ histograms->AddHistogram("ESD_TrueConvGamma_Width" ,"" , kGCnXBinsGammaWidth, kGCfirstXBinGammaWidth, kGClastXBinGammaWidth, "", "");}
1929     if(kGCplotESDTrueConvGammaChi2 == kTRUE){ histograms->AddHistogram("ESD_TrueConvGamma_Chi2" ,"" , kGCnXBinsGammaChi2, kGCfirstXBinGammaChi2, kGClastXBinGammaChi2, "", "");}
1930     if(kGCplotESDTrueConvGammaNDF == kTRUE){ histograms->AddHistogram("ESD_TrueConvGamma_NDF" ,"" , kGCnXBinsGammaNDF, kGCfirstXBinGammaNDF, kGClastXBinGammaNDF, "", "");}
1931     if(kGCplotESDTrueConvGammaRapid == kTRUE){ histograms->AddHistogram("ESD_TrueConvGamma_Rapid" ,"" , kGCnXBinsRapid, kGCfirstXBinRapid, kGClastXBinRapid, "", "");}
1932     if(kGCplotESDTrueConvGammaPtvsEta == kTRUE){ histograms->AddHistogram("ESD_TrueConvGamma_Pt_Eta" ,"" , kGCnXBinsPt, kGCfirstXBinPt, kGClastXBinPt,kGCnXBinsEta, kGCfirstXBinEta, kGClastXBinEta, "", "");}
1933     if(kGCplotESDTrueConvGammaPtvsChi2 == kTRUE){ histograms->AddHistogram("ESD_TrueConvGamma_Pt_Chi2" ,"" ,kGCnXBinsPt, kGCfirstXBinPt, kGClastXBinPt, kGCnXBinsGammaChi2, kGCfirstXBinGammaChi2, kGClastXBinGammaChi2, "", "");}
1934     if(kGCplotESDTrueConvGammaEtavsChi2 == kTRUE){ histograms->AddHistogram("ESD_TrueConvGamma_Eta_Chi2" ,"" ,kGCnXBinsEta, kGCfirstXBinEta, kGClastXBinEta, kGCnXBinsGammaChi2, kGCfirstXBinGammaChi2, kGClastXBinGammaChi2, "", "");}
1935                 
1936     if(kGCplotESDTrueConversionR == kTRUE){ histograms->AddHistogram("ESD_TrueConversion_R" ,"" , kGCnXBinsR, kGCfirstXBinR, kGClastXBinR, "", "");}
1937     if(kGCplotESDTrueConversionZR == kTRUE){ histograms->AddHistogram("ESD_TrueConversion_ZR" ,"" , kGCnXBinsZR, kGCfirstXBinZR, kGClastXBinZR, kGCnYBinsZR, kGCfirstYBinZR, kGClastYBinZR, "", "");}
1938     if(kGCplotESDTrueConversionXY == kTRUE){ histograms->AddHistogram("ESD_TrueConversion_XY" ,"" , kGCnXBinsXY, kGCfirstXBinXY, kGClastXBinXY, kGCnYBinsXY, kGCfirstYBinXY, kGClastYBinXY, "", "");}
1939     if(kGCplotESDTrueConversionOpeningAngle == kTRUE){ histograms->AddHistogram("ESD_TrueConversion_OpeningAngle" ,"" , kGCnXBinsOpeningAngle, kGCfirstXBinOpeningAngle, kGClastXBinOpeningAngle, "", "");}
1940
1941     if(kGCplotESDTrueConvGammaCosPointingAngle == kTRUE){ histograms->AddHistogram("ESD_TrueConvGamma_CosPointingAngle" ,"" , kGCnXBinsCosPointingAngle, kGCfirstXBinCosPointingAngle, kGClastXBinCosPointingAngle, "", "");}
1942     if(kGCplotESDTrueConvGammaDcaDaugthers == kTRUE){ histograms->AddHistogram("ESD_TrueConvGamma_DcaDaughters" ,"" , kGCnXBinsDcaDaughters, kGCfirstXBinDcaDaughters, kGClastXBinDcaDaughters, "", "");}
1943     if(kGCplotESDTrueConvGammaNormDcaDistDaugthers == kTRUE){ histograms->AddHistogram("ESD_TrueConvGamma_NormDcaDistDaughters" ,"" , kGCnXBinsNormDcaDistDaughters, kGCfirstXBinNormDcaDistDaughters, kGClastXBinNormDcaDistDaughters, "", "");}
1944     if(kGCplotESDTrueConvGammaLikelihoodAP == kTRUE){ histograms->AddHistogram("ESD_TrueConvGamma_LikelihoodAP" ,"" , kGCnXBinsLikelihoodAP, kGCfirstXBinLikelihoodAP, kGClastXBinLikelihoodAP, "", "");}
1945     if(kGCplotESDTrueConvGammaEAsymmetryP== kTRUE){ histograms->AddHistogram("ESD_TrueConvGamma_E_AsymmetryP" ,"" ,kGCnXBinsP, kGCfirstXBinP, kGClastXBinP,kGCnYBinsAsymmetry, kGCfirstYBinAsymmetry, kGClastYBinAsymmetry,"", "");}
1946     if(kGCplotESDTrueConvGammaPAsymmetryP== kTRUE){ histograms->AddHistogram("ESD_TrueConvGamma_P_AsymmetryP" ,"" ,kGCnXBinsP, kGCfirstXBinP, kGClastXBinP,kGCnYBinsAsymmetry, kGCfirstYBinAsymmetry, kGClastYBinAsymmetry,"", "");}
1947     if(kGCplotESDTrueConvGammaEdEdxP== kTRUE){ histograms->AddHistogram("ESD_TrueConvGamma_E_dEdxP" ,"" ,kGCnXBinsP, kGCfirstXBinP, kGClastXBinP,kGCnYBinsdEdx, kGCfirstYBindEdx, kGClastYBindEdx,"", "",0);}
1948     if(kGCplotESDTrueConvGammaPdEdxP== kTRUE){ histograms->AddHistogram("ESD_TrueConvGamma_P_dEdxP" ,"" ,kGCnXBinsP, kGCfirstXBinP, kGClastXBinP,kGCnYBinsdEdx, kGCfirstYBindEdx, kGClastYBindEdx,"", "",0);}
1949     if(kGCplotESDTrueConvGammaQtAlfa== kTRUE){ histograms->AddHistogram("ESD_TrueConvGamma_alfa_qt" ,"" ,kGCnXBinsP, kGCfirstXBinAlphaG, kGClastXBinAlpha,kGCnYBinsQt, kGCfirstYBinQt, kGClastYBinQt,"", "");}
1950                 
1951     if(kGCplotESDTrueConvGammaMCPtEta == kTRUE){ histograms->AddHistogram("ESD_TrueConvGamma_MC_Pt_Eta" ,"" , kGCnXBinsPt, kGCfirstXBinPt, kGClastXBinPt, kGCnXBinsEta, kGCfirstXBinEta, kGClastXBinEta, "", "");}
1952     if(kGCplotESDTrueConversionMCZR == kTRUE){ histograms->AddHistogram("ESD_TrueConversion_MC_ZR" ,"" , kGCnXBinsZR, kGCfirstXBinZR, kGClastXBinZR, kGCnYBinsZR, kGCfirstYBinZR, kGClastYBinZR, "", "");}
1953     if(kGCplotESDTrueConversionMCXY == kTRUE){ histograms->AddHistogram("ESD_TrueConversion_MC_XY" ,"" , kGCnXBinsXY, kGCfirstXBinXY, kGClastXBinXY, kGCnYBinsXY, kGCfirstYBinXY, kGClastYBinXY, "", "");}
1954                 
1955                 
1956                 
1957     if(kGCplotESDNoCutConvGammaEnergy == kTRUE){ histograms->AddHistogram("ESD_NoCutConvGamma_Energy" ,"" , kGCnXBinsEnergy, kGCfirstXBinEnergy, kGClastXBinEnergy, "", "");}
1958     if(kGCplotESDNoCutConvGammaPt == kTRUE){ histograms->AddHistogram("ESD_NoCutConvGamma_Pt" ,"" , kGCnXBinsPt, kGCfirstXBinPt, kGClastXBinPt, "", "");}
1959     if(kGCplotESDNoCutConvGammaEta == kTRUE){ histograms->AddHistogram("ESD_NoCutConvGamma_Eta" ,"" , kGCnXBinsEta, kGCfirstXBinEta, kGClastXBinEta, "", "");}
1960     if(kGCplotESDNoCutConvGammaPhi == kTRUE){ histograms->AddHistogram("ESD_NoCutConvGamma_Phi" ,"" , kGCnXBinsPhi, kGCfirstXBinPhi, kGClastXBinPhi, "", "");}
1961     if(kGCplotESDNoCutConvGammaMass == kTRUE){ histograms->AddHistogram("ESD_NoCutConvGamma_Mass" ,"" ,  kGCnXBinsGammaMass, kGCfirstXBinGammaMass, kGClastXBinGammaMass, "", "");}
1962     if(kGCplotESDNoCutConvGammaWidth == kTRUE){ histograms->AddHistogram("ESD_NoCutConvGamma_Width" ,"" , kGCnXBinsGammaWidth, kGCfirstXBinGammaWidth, kGClastXBinGammaWidth, "", "");}
1963     if(kGCplotESDNoCutConvGammaChi2 == kTRUE){ histograms->AddHistogram("ESD_NoCutConvGamma_Chi2" ,"" , kGCnXBinsGammaChi2, kGCfirstXBinGammaChi2, kGClastXBinGammaChi2, "", "");}
1964     if(kGCplotESDNoCutConvGammaNDF == kTRUE){ histograms->AddHistogram("ESD_NoCutConvGamma_NDF" ,"" , kGCnXBinsGammaNDF, kGCfirstXBinGammaNDF, kGClastXBinGammaNDF, "", "");}
1965     if(kGCplotESDNoCutConvGammaRapid == kTRUE){ histograms->AddHistogram("ESD_NoCutConvGamma_Rapid" ,"" , kGCnXBinsRapid, kGCfirstXBinRapid, kGClastXBinRapid, "", "");}
1966     if(kGCplotESDNoCutConvGammaPtvsEta == kTRUE){ histograms->AddHistogram("ESD_NoCutConvGamma_Pt_Eta" ,"" , kGCnXBinsPt, kGCfirstXBinPt, kGClastXBinPt,kGCnXBinsEta, kGCfirstXBinEta, kGClastXBinEta, "", "");}
1967     if(kGCplotESDNoCutConvGammaPtvsChi2 == kTRUE){ histograms->AddHistogram("ESD_NoCutConvGamma_Pt_Chi2" ,"" ,kGCnXBinsPt, kGCfirstXBinPt, kGClastXBinPt, kGCnXBinsGammaChi2, kGCfirstXBinGammaChi2, kGClastXBinGammaChi2, "", "");}
1968     if(kGCplotESDNoCutConvGammaEtavsChi2 == kTRUE){ histograms->AddHistogram("ESD_NoCutConvGamma_Eta_Chi2" ,"" ,kGCnXBinsEta, kGCfirstXBinEta, kGClastXBinEta, kGCnXBinsGammaChi2, kGCfirstXBinGammaChi2, kGClastXBinGammaChi2, "", "");}
1969                 
1970     if(kGCplotESDNoCutConversionR == kTRUE){ histograms->AddHistogram("ESD_NoCutConversion_R" ,"" , kGCnXBinsR, kGCfirstXBinR, kGClastXBinR, "", "");}
1971     if(kGCplotESDNoCutConversionZR == kTRUE){ histograms->AddHistogram("ESD_NoCutConversion_ZR" ,"" , kGCnXBinsZR, kGCfirstXBinZR, kGClastXBinZR, kGCnYBinsZR, kGCfirstYBinZR, kGClastYBinZR, "", "");}
1972     if(kGCplotESDNoCutConversionXY == kTRUE){ histograms->AddHistogram("ESD_NoCutConversion_XY" ,"" , kGCnXBinsXY, kGCfirstXBinXY, kGClastXBinXY, kGCnYBinsXY, kGCfirstYBinXY, kGClastYBinXY, "", "");}
1973     if(kGCplotESDNoCutConversionOpeningAngle == kTRUE){ histograms->AddHistogram("ESD_NoCutConversion_OpeningAngle" ,"" , kGCnXBinsOpeningAngle, kGCfirstXBinOpeningAngle, kGClastXBinOpeningAngle, "", "");}
1974
1975     if(kGCplotESDNoCutConvGammaCosPointingAngle == kTRUE){ histograms->AddHistogram("ESD_NoCutConvGamma_CosPointingAngle" ,"" , kGCnXBinsCosPointingAngle, kGCfirstXBinCosPointingAngle, kGClastXBinCosPointingAngle, "", "");}
1976     if(kGCplotESDNoCutConvGammaDcaDaugthers == kTRUE){ histograms->AddHistogram("ESD_NoCutConvGamma_DcaDaughters" ,"" , kGCnXBinsDcaDaughters, kGCfirstXBinDcaDaughters, kGClastXBinDcaDaughters, "", "");}
1977     if(kGCplotESDNoCutConvGammaNormDcaDistDaugthers == kTRUE){ histograms->AddHistogram("ESD_NoCutConvGamma_NormDcaDistDaughters" ,"" , kGCnXBinsNormDcaDistDaughters, kGCfirstXBinNormDcaDistDaughters, kGClastXBinNormDcaDistDaughters, "", "");}
1978     if(kGCplotESDNoCutConvGammaLikelihoodAP == kTRUE){ histograms->AddHistogram("ESD_NoCutConvGamma_LikelihoodAP" ,"" , kGCnXBinsLikelihoodAP, kGCfirstXBinLikelihoodAP, kGClastXBinLikelihoodAP, "", "");}
1979     if(kGCplotESDNoCutConvGammaEAsymmetryP== kTRUE){ histograms->AddHistogram("ESD_NoCutConvGamma_E_AsymmetryP" ,"" ,kGCnXBinsP, kGCfirstXBinP, kGClastXBinP,kGCnYBinsAsymmetry, kGCfirstYBinAsymmetry, kGClastYBinAsymmetry,"", "");}
1980     if(kGCplotESDNoCutConvGammaPAsymmetryP== kTRUE){ histograms->AddHistogram("ESD_NoCutConvGamma_P_AsymmetryP" ,"" ,kGCnXBinsP, kGCfirstXBinP, kGClastXBinP,kGCnYBinsAsymmetry, kGCfirstYBinAsymmetry, kGClastYBinAsymmetry,"", "");}
1981
1982
1983     if(kGCplotESDNoCutConvGammaEdEdxP== kTRUE){ histograms->AddHistogram("ESD_NoCutConvGamma_E_dEdxP" ,"" ,kGCnXBinsP, kGCfirstXBinP, kGClastXBinP,kGCnYBinsdEdx, kGCfirstYBindEdx, kGClastYBindEdx,"", "",0);}
1984     if(kGCplotESDNoCutConvGammaPdEdxP== kTRUE){ histograms->AddHistogram("ESD_NoCutConvGamma_P_dEdxP" ,"" ,kGCnXBinsP, kGCfirstXBinP, kGClastXBinP,kGCnYBinsdEdx, kGCfirstYBindEdx, kGClastYBindEdx,"", "",0);}
1985
1986     if(kGCplotESDNoCutConvGammaMCPtEta == kTRUE){ histograms->AddHistogram("ESD_NoCutConvGamma_MC_Pt_Eta" ,"" , kGCnXBinsPt, kGCfirstXBinPt, kGClastXBinPt, kGCnXBinsEta, kGCfirstXBinEta, kGClastXBinEta, "", "");}
1987     if(kGCplotESDNoCutConversionMCZR == kTRUE){ histograms->AddHistogram("ESD_NoCutConversion_MC_ZR" ,"" , kGCnXBinsZR, kGCfirstXBinZR, kGClastXBinZR, kGCnYBinsZR, kGCfirstYBinZR, kGClastYBinZR, "", "");}
1988     if(kGCplotESDNoCutConversionMCXY == kTRUE){ histograms->AddHistogram("ESD_NoCutConversion_MC_XY" ,"" , kGCnXBinsXY, kGCfirstXBinXY, kGClastXBinXY, kGCnYBinsXY, kGCfirstYBinXY, kGClastYBinXY, "", "");}
1989                 
1990                 
1991     if(kGCplotESDMotherChi2 == kTRUE){ histograms->AddHistogram("ESD_Mother_Chi2","" , kGCnXBinsMesonChi2, kGCfirstXBinGammaChi2, kGClastXBinGammaChi2, "", "");}
1992     if(kGCplotESDMotherOpeningAngleGamma == kTRUE){ histograms->AddHistogram("ESD_Mother_GammaDaughter_OpeningAngle" ,"" , kGCnXBinsOpeningAngle, kGCfirstXBinOpeningAngle, kGClastXBinOpeningAngle, "", "");}
1993     if(kGCplotESDMotherEnergy == kTRUE){ histograms->AddHistogram("ESD_Mother_Energy" ,"" , kGCnXBinsEnergy, kGCfirstXBinEnergy, kGClastXBinEnergy, "", "");}
1994     if(kGCplotESDMotherPt == kTRUE){ histograms->AddHistogram("ESD_Mother_Pt" ,"" , kGCnXBinsPt, kGCfirstXBinPt, kGClastXBinPt, "", "");}
1995     if(kGCplotESDMotherEta == kTRUE){ histograms->AddHistogram("ESD_Mother_Eta" ,"" , kGCnXBinsEta, kGCfirstXBinEta, kGClastXBinEta, "", "");}
1996     if(kGCplotESDMotherPhi == kTRUE){ histograms->AddHistogram("ESD_Mother_Phi" ,"" , kGCnXBinsPhi, kGCfirstXBinPhi, kGClastXBinPhi, "", "");}
1997     if(kGCplotESDMotherMass == kTRUE){ histograms->AddHistogram("ESD_Mother_Mass" ,"" , kGCnXBinsPi0Mass, kGCfirstXBinPi0Mass, kGClastXBinPi0Mass, "", "");}
1998     if(kGCplotESDMotherR == kTRUE){ histograms->AddHistogram("ESD_Mother_R" ,"" , kGCnXBinsR, kGCfirstXBinR, kGClastXBinR, "", "");}
1999     if(kGCplotESDMotherZR == kTRUE){ histograms->AddHistogram("ESD_Mother_ZR" ,"" , kGCnXBinsZR, kGCfirstXBinZR, kGClastXBinZR, kGCnYBinsZR, kGCfirstYBinZR, kGClastYBinZR, "", "");}
2000     if(kGCplotESDMotherXY == kTRUE){ histograms->AddHistogram("ESD_Mother_XY" ,"" , kGCnXBinsXY, kGCfirstXBinXY, kGClastXBinXY, kGCnYBinsXY, kGCfirstYBinXY, kGClastYBinXY, "", "");}
2001     if(kGCplotESDMotherRapid == kTRUE){ histograms->AddHistogram("ESD_Mother_Rapid" ,"" , kGCnXBinsRapid, kGCfirstXBinRapid, kGClastXBinRapid, "", "");}
2002                 
2003     for(Int_t z=0;z<8;z++){
2004       for(Int_t m=0;m<6;m++){
2005         if(kGCplotESDBackgroundOpeningAngleGamma == kTRUE){ histograms->AddHistogram(Form("%d%dESD_Background_GammaDaughter_OpeningAngle",z,m) ,"" , kGCnXBinsOpeningAngle, kGCfirstXBinOpeningAngle, kGClastXBinOpeningAngle, "", "");}
2006         if(kGCplotESDBackgroundEnergy == kTRUE){ histograms->AddHistogram(Form("%d%dESD_Background_Energy",z,m) ,"" , kGCnXBinsEnergy, kGCfirstXBinEnergy, kGClastXBinEnergy, "", "");}
2007         if(kGCplotESDBackgroundPt == kTRUE){ histograms->AddHistogram(Form("%d%dESD_Background_Pt",z,m) ,"" , kGCnXBinsPt, kGCfirstXBinPt, kGClastXBinPt, "", "");}
2008         if(kGCplotESDBackgroundEta == kTRUE){ histograms->AddHistogram(Form("%d%dESD_Background_Eta",z,m) ,"" , kGCnXBinsEta, kGCfirstXBinEta, kGClastXBinEta, "", "");}
2009         if(kGCplotESDBackgroundPhi == kTRUE){ histograms->AddHistogram(Form("%d%dESD_Background_Phi",z,m) ,"" , kGCnXBinsPhi, kGCfirstXBinPhi, kGClastXBinPhi, "", "");}
2010         if(kGCplotESDBackgroundMass == kTRUE){ histograms->AddHistogram(Form("%d%dESD_Background_Mass",z,m) ,"" , kGCnXBinsEtaMass, kGCfirstXBinEtaMass, kGClastXBinEtaMass, "", "");}
2011         if(kGCplotESDBackgroundR == kTRUE){ histograms->AddHistogram(Form("%d%dESD_Background_R",z,m) ,"" , kGCnXBinsR, kGCfirstXBinR, kGClastXBinR, "", "");}
2012         if(kGCplotESDBackgroundZR == kTRUE){ histograms->AddHistogram(Form("%d%dESD_Background_ZR",z,m) ,"" , kGCnXBinsZR, kGCfirstXBinZR, kGClastXBinZR, kGCnYBinsZR, kGCfirstYBinZR, kGClastYBinZR, "", "");}
2013         if(kGCplotESDBackgroundXY == kTRUE){ histograms->AddHistogram(Form("%d%dESD_Background_XY",z,m) ,"" , kGCnXBinsXY, kGCfirstXBinXY, kGClastXBinXY, kGCnYBinsXY, kGCfirstYBinXY, kGClastYBinXY, "", "");}
2014         if(kGCplotESDBackgroundRapid == kTRUE){ histograms->AddHistogram(Form("%d%dESD_Background_Rapid",z,m) ,"" , kGCnXBinsRapid, kGCfirstXBinRapid, kGClastXBinRapid, "", "");}
2015       }
2016     }
2017
2018     if(kGCplotESDBackgroundOpeningAngleGamma == kTRUE){ histograms->AddHistogram("ESD_Background_GammaDaughter_OpeningAngle" ,"" , kGCnXBinsOpeningAngle, kGCfirstXBinOpeningAngle, kGClastXBinOpeningAngle, "", "");}
2019     if(kGCplotESDBackgroundEnergy == kTRUE){ histograms->AddHistogram("ESD_Background_Energy" ,"" , kGCnXBinsEnergy, kGCfirstXBinEnergy, kGClastXBinEnergy, "", "");}
2020     if(kGCplotESDBackgroundPt == kTRUE){ histograms->AddHistogram("ESD_Background_Pt" ,"" , kGCnXBinsPt, kGCfirstXBinPt, kGClastXBinPt, "", "");}
2021     if(kGCplotESDBackgroundEta == kTRUE){ histograms->AddHistogram("ESD_Background_Eta" ,"" , kGCnXBinsEta, kGCfirstXBinEta, kGClastXBinEta, "", "");}
2022     if(kGCplotESDBackgroundPhi == kTRUE){ histograms->AddHistogram("ESD_Background_Phi" ,"" , kGCnXBinsPhi, kGCfirstXBinPhi, kGClastXBinPhi, "", "");}
2023     if(kGCplotESDBackgroundMass == kTRUE){ histograms->AddHistogram("ESD_Background_Mass" ,"" , kGCnXBinsEtaMass, kGCfirstXBinEtaMass, kGClastXBinEtaMass, "", "");}
2024     if(kGCplotESDBackgroundR == kTRUE){ histograms->AddHistogram("ESD_Background_R" ,"" , kGCnXBinsR, kGCfirstXBinR, kGClastXBinR, "", "");}
2025     if(kGCplotESDBackgroundZR == kTRUE){ histograms->AddHistogram("ESD_Background_ZR" ,"" , kGCnXBinsZR, kGCfirstXBinZR, kGClastXBinZR, kGCnYBinsZR, kGCfirstYBinZR, kGClastYBinZR, "", "");}
2026     if(kGCplotESDBackgroundXY == kTRUE){ histograms->AddHistogram("ESD_Background_XY" ,"" , kGCnXBinsXY, kGCfirstXBinXY, kGClastXBinXY, kGCnYBinsXY, kGCfirstYBinXY, kGClastYBinXY, "", "");}
2027     if(kGCplotESDBackgroundRapid == kTRUE){ histograms->AddHistogram("ESD_Background_Rapid" ,"" , kGCnXBinsRapid, kGCfirstXBinRapid, kGClastXBinRapid, "", "");}
2028                 
2029                 
2030     if(kGCplotMapping == kTRUE){
2031       histograms->InitializeMappingValues(kGCnPhiIndex,kGCnRIndex,kGCnXBinsMapping,kGCminRadius,kGCmaxRadius,kGCnYBinsMapping,kGCminPhi,kGCmaxPhi);
2032       histograms->AddMappingHistograms(kGCnPhiIndex,kGCnRIndex,kGCnXBinsMapping,kGCfirstXBinMapping,kGClastXBinMapping,kGCnYBinsMapping,kGCfirstYBinMapping,kGClastYBinMapping);
2033       //      histograms->AddMappingHistograms(kGCnPhiIndex,kGCnRIndex,kGCnXBinsMapping,kGCminRadius,kGCmaxRadius,kGCnYBinsMapping,kGCminPhi,kGCmaxPhi);
2034     }
2035
2036     //
2037     //************************************* Defining Resolution histograms *******************************************************/
2038     //
2039     // written by Friederike Bock 
2040     // contact: Friederike.Bock@cern.ch
2041     //
2042
2043     if(kGCrunRES == kTRUE){
2044         //------------------------------------------ Absolute Resolutions --------------------------------------------------------
2045     if(kGCplotResolutiondRAbs== kTRUE){
2046                 histograms->AddHistogram("Resolution_dRAbs_VS_R","" ,kGCnXBinsResdR, kGCfirstXBinResdR, kGClastXBinResdR,kGCnYBinsResdR,kGCfirstYBinResdR, kGClastYBinResdR, "", "");}
2047     if(kGCplotResolutiondZAbs== kTRUE){
2048                 histograms->AddHistogram("Resolution_dZAbs_VS_R","" ,kGCnXBinsResdR, kGCfirstXBinResdR, kGClastXBinResdR,kGCnYBinsResdR,kGCfirstYBinResdR, kGClastYBinResdR, "", "");}
2049     if(kGCplotResolutiondPhiAbs== kTRUE){
2050                 histograms->AddHistogram("Resolution_dPhiAbs_VS_R","" ,kGCnXBinsResdR, kGCfirstXBinResdR, kGClastXBinResdR,kGCnYBinsResdR, -TMath::Pi()/30., TMath::Pi()/30., "", "");}
2051
2052         //------------------------------------------ Relative Resolutions --------------------------------------------------------
2053     if(kGCplotResolutiondR == kTRUE){
2054                 histograms->AddHistogram("Resolution_dR" ,"" , kGCnXBinsResdR, kGCfirstXBinResdR, kGClastXBinResdR, kGCnYBinsResdR, kGCfirstYBinResdR, kGClastYBinResdR, "", "");}
2055     if(kGCplotResolutiondZ == kTRUE){
2056                 histograms->AddHistogram("Resolution_dZ" ,"" , kGCnXBinsResdZ, kGCfirstXBinResdZ, kGClastXBinResdZ, kGCnYBinsResdZ, kGCfirstYBinResdZ, kGClastYBinResdZ, "", "");}
2057
2058         //------------------------------------------- Pt vs R ---------------------------------------------------------------------             
2059     if(kGCplotResolutiondRdPt == kTRUE){
2060                 histograms->AddHistogram("Resolution_R_dPt" ,"" , kGCnXBinsResdR, kGCfirstXBinResdR, kGClastXBinResdR, kGCnYBinsResdRdPt, kGCfirstYBinResdRdPt, kGClastYBinResdRdPt, "", "");}
2061
2062
2063         // ------------------------------------------- Reconstruction Plots for Resolution ----------------------------------------             
2064     if(kGCplotResolutionMCPt == kTRUE){
2065                 histograms->AddHistogram("Resolution_MC_Pt" ,"" , kGCnXBinsResPt, kGCfirstXBinResPt, kGClastXBinResPt,"","");}
2066     if(kGCplotResolutionMCR == kTRUE){
2067                 histograms->AddHistogram("Resolution_MC_R" ,"" , kGCnXBinsResR, kGCfirstXBinResR, kGClastXBinResR,"","");}
2068     if(kGCplotResolutionMCZ == kTRUE){
2069                 histograms->AddHistogram("Resolution_MC_Z" ,"" , kGCnXBinsResZ, kGCfirstXBinResZ, kGClastXBinResZ,"","");}
2070                 
2071     if(kGCplotResolutionESDPt == kTRUE){
2072                 histograms->AddHistogram("Resolution_ESD_Pt" ,"" , kGCnXBinsResPt, kGCfirstXBinResPt, kGClastXBinResPt,"","");}
2073     if(kGCplotResolutionESDR == kTRUE){
2074                 histograms->AddHistogram("Resolution_ESD_R" ,"" , kGCnXBinsResR, kGCfirstXBinResR, kGClastXBinResR,"","");}
2075     if(kGCplotResolutionESDZ == kTRUE){
2076                 histograms->AddHistogram("Resolution_ESD_Z" ,"" , kGCnXBinsResZ, kGCfirstXBinResZ, kGClastXBinResZ,"","");}
2077
2078         // ------------------------------------------- Plots for specific Gamma Trigger Studies -----------------------------------     
2079     if(kGCplotResolutionPtdPt = kTRUE){
2080                 // ::::::::::::::::::::::::::::::::::::::: histograms for gammas ::::::::::::::::::::::::::::::::::::::::::::::::::::::
2081                 histograms->AddHistogram("Resolution_Gamma_dPt_Pt" ,"" ,kGCnYBinsResdPt, kGCfirstXBinResdPt, kGClastXBinResdPt, kGCnYBinsResdPt, kGCfirstYBinResdPt, kGClastYBinResdPt, "", "");
2082                 histograms->AddHistogram("Resolution_Gamma_dPt_Phi" ,"" , kGCnYBinsResdR, -TMath::Pi(), TMath::Pi(), kGCnYBinsResdPt, kGCfirstYBinResdPt, kGClastYBinResdPt, "", "");
2083                 
2084                 // ::::::::::::::::::::::::::::::::::::::: histograms for electrons :::::::::::::::::::::::::::::::::::::::::::::::::::
2085                 histograms->AddHistogram("Resolution_E_dPt_Pt" ,"" ,kGCnYBinsResdPt, kGCfirstXBinResdPt, kGClastXBinResdPt, kGCnYBinsResdPt, kGCfirstYBinResdPt, kGClastYBinResdPt, "", "");
2086                 histograms->AddHistogram("Resolution_E_dPt_Pt_ITS0" ,"" ,kGCnYBinsResdPt, kGCfirstXBinResdPt, kGClastXBinResdPt, kGCnYBinsResdPt, kGCfirstYBinResdPt, kGClastYBinResdPt, "", "");
2087                 histograms->AddHistogram("Resolution_E_dPt_Pt_ITS1" ,"" ,kGCnYBinsResdPt, kGCfirstXBinResdPt, kGClastXBinResdPt, kGCnYBinsResdPt, kGCfirstYBinResdPt, kGClastYBinResdPt, "", "");
2088                 histograms->AddHistogram("Resolution_E_dPt_Pt_ITS2" ,"" ,kGCnYBinsResdPt, kGCfirstXBinResdPt, kGClastXBinResdPt, kGCnYBinsResdPt, kGCfirstYBinResdPt, kGClastYBinResdPt, "", "");
2089                 histograms->AddHistogram("Resolution_E_dPt_Pt_ITS3" ,"" ,kGCnYBinsResdPt, kGCfirstXBinResdPt, kGClastXBinResdPt, kGCnYBinsResdPt, kGCfirstYBinResdPt, kGClastYBinResdPt, "", "");
2090                 histograms->AddHistogram("Resolution_E_dPt_Pt_ITS4" ,"" ,kGCnYBinsResdPt, kGCfirstXBinResdPt, kGClastXBinResdPt, kGCnYBinsResdPt, kGCfirstYBinResdPt, kGClastYBinResdPt, "", "");
2091                 histograms->AddHistogram("Resolution_E_dPt_Pt_ITS5" ,"" ,kGCnYBinsResdPt, kGCfirstXBinResdPt, kGClastXBinResdPt, kGCnYBinsResdPt, kGCfirstYBinResdPt, kGClastYBinResdPt, "", "");
2092                 histograms->AddHistogram("Resolution_E_dPt_Pt_ITS6" ,"" ,kGCnYBinsResdPt, kGCfirstXBinResdPt, kGClastXBinResdPt, kGCnYBinsResdPt, kGCfirstYBinResdPt, kGClastYBinResdPt, "", "");
2093                 histograms->AddHistogram("Resolution_E_dPt_Phi" ,"" , kGCnYBinsResdR, -TMath::Pi(), TMath::Pi(), kGCnYBinsResdPt, kGCfirstYBinResdPt, kGClastYBinResdPt, "", "");
2094                 histograms->AddHistogram("Resolution_E_nTRDtracklets_ESDPt" ,"" ,kGCnXBinsResdPt, kGCfirstXBinResdPt, kGClastXBinResdPt, 8, -0.5, 7.5,"", "");
2095                 histograms->AddHistogram("Resolution_E_nTRDtracklets_MCPt","" ,kGCnXBinsResdPt, kGCfirstXBinResdPt, kGClastXBinResdPt, 8, -0.5, 7.5,"", "");    
2096                 histograms->AddHistogram("Resolution_E_nTRDclusters_ESDPt","",kGCnXBinsResdPt, kGCfirstXBinResdPt, kGClastXBinResdPt, 201, -0.5, 200.5,"", "");
2097                 histograms->AddHistogram("Resolution_E_nTRDclusters_MCPt","",kGCnXBinsResdPt, kGCfirstXBinResdPt, kGClastXBinResdPt, 201, -0.5, 200.5,"", "");
2098                 //              histograms->AddHistogram("Resolution_E_TRDsignal_ESDPt","", fV0Reader->GetNegativeTrackPt(), fV0Reader->GetNegativeESDTrack()->GetTRDsignal());
2099                 
2100                 // :::::::::::::::::::::::::::::::::::::::: histograms for positrons :::::::::::::::::::::::::::::::::::::::::::::::::::
2101                 histograms->AddHistogram("Resolution_P_dPt_Pt" ,"" , kGCnYBinsResdPt, kGCfirstXBinResdPt, kGClastXBinResdPt, kGCnYBinsResdPt, kGCfirstYBinResdPt, kGClastYBinResdPt, "", "");
2102                 histograms->AddHistogram("Resolution_P_dPt_Pt_ITS0" ,"" ,kGCnYBinsResdPt, kGCfirstXBinResdPt, kGClastXBinResdPt, kGCnYBinsResdPt, kGCfirstYBinResdPt, kGClastYBinResdPt, "", "");
2103                 histograms->AddHistogram("Resolution_P_dPt_Pt_ITS1" ,"" ,kGCnYBinsResdPt, kGCfirstXBinResdPt, kGClastXBinResdPt, kGCnYBinsResdPt, kGCfirstYBinResdPt, kGClastYBinResdPt, "", "");
2104                 histograms->AddHistogram("Resolution_P_dPt_Pt_ITS2" ,"" ,kGCnYBinsResdPt, kGCfirstXBinResdPt, kGClastXBinResdPt, kGCnYBinsResdPt, kGCfirstYBinResdPt, kGClastYBinResdPt, "", "");
2105                 histograms->AddHistogram("Resolution_P_dPt_Pt_ITS3" ,"" ,kGCnYBinsResdPt, kGCfirstXBinResdPt, kGClastXBinResdPt, kGCnYBinsResdPt, kGCfirstYBinResdPt, kGClastYBinResdPt, "", "");
2106                 histograms->AddHistogram("Resolution_P_dPt_Pt_ITS4" ,"" ,kGCnYBinsResdPt, kGCfirstXBinResdPt, kGClastXBinResdPt, kGCnYBinsResdPt, kGCfirstYBinResdPt, kGClastYBinResdPt, "", "");
2107                 histograms->AddHistogram("Resolution_P_dPt_Pt_ITS5" ,"" ,kGCnYBinsResdPt, kGCfirstXBinResdPt, kGClastXBinResdPt, kGCnYBinsResdPt, kGCfirstYBinResdPt, kGClastYBinResdPt, "", "");
2108                 histograms->AddHistogram("Resolution_P_dPt_Pt_ITS6" ,"" ,kGCnYBinsResdPt, kGCfirstXBinResdPt, kGClastXBinResdPt, kGCnYBinsResdPt, kGCfirstYBinResdPt, kGClastYBinResdPt, "", "");
2109                 histograms->AddHistogram("Resolution_P_dPt_Phi" ,"" , kGCnYBinsResdR, -TMath::Pi(), TMath::Pi(), kGCnYBinsResdPt, kGCfirstYBinResdPt, kGClastYBinResdPt, "", "");
2110                 histograms->AddHistogram("Resolution_P_nTRDtracklets_ESDPt" ,"" ,kGCnXBinsResdPt, kGCfirstXBinResdPt, kGClastXBinResdPt, 8, -0.5, 7.5,"", "");   
2111                 histograms->AddHistogram("Resolution_P_nTRDtracklets_MCPt","", kGCnXBinsResdPt, kGCfirstXBinResdPt, kGClastXBinResdPt, 8, -0.5, 7.5,"", "");
2112                 histograms->AddHistogram("Resolution_P_nTRDclusters_ESDPt","",kGCnXBinsResdPt, kGCfirstXBinResdPt, kGClastXBinResdPt, 201, -0.5, 200.5,"", "");
2113                 histograms->AddHistogram("Resolution_P_nTRDclusters_MCPt","",kGCnXBinsResdPt, kGCfirstXBinResdPt, kGClastXBinResdPt, 201,-0.5, 200.5,"", "");
2114                 //              histograms->AddHistogram("Resolution_P_TRDsignal_ESDPt", "",fV0Reader->GetPositiveTrackPt(), fV0Reader->GetPositiveESDTrack()->GetTRDsignal());
2115     } //end of specific trigger study resolution plots
2116     } //end if(kGCrunRES=true)
2117     
2118     // ___________________________________________________________________________________________________________________________________________________
2119
2120     if(kGCplotEventQuality == kTRUE){histograms->AddHistogram("ESD_EventQuality","ESD_EventQuality",kGCnXBinsEvtQ,kGCfirstXBinEvtQ,kGClastXBinEvtQ,"","");}
2121     if(kGCplotESDNumberOfV0s == kTRUE){histograms->AddHistogram("ESD_NumberOfV0s","Number of v0s",kGCnXBinsNV0,kGCfirstXBinNV0 ,kGClastXBinNV0 ,"","");}
2122     if(kGCplotESDNumberOfSurvivingV0s == kTRUE){histograms->AddHistogram("ESD_NumberOfSurvivingV0s","Number of surviving v0s",kGCnXBinsNV0, kGCfirstXBinNV0 , kGClastXBinNV0,"","");}
2123     if(kGCplotESDNumberOfContributorsVtx == kTRUE){histograms->AddHistogram("ESD_NumberOfContributorsVtx","Number of contributors to vertex",kGCnXBinsESDtrk, kGCfirstXBinESDtrk, kGClastXBinESDtrk,"","");}
2124     if(kGCplotESDNumberOfGoodESDTracks == kTRUE){histograms->AddHistogram("ESD_NumberOfGoodESDTracks","Number of Good ESD tracks",kGCnXBinsESDtrk, kGCfirstXBinESDtrk, kGClastXBinESDtrk,"","");}
2125     if(kGCplotESDNumberOfGoodESDTracks == kTRUE){histograms->AddHistogram("ESD_NumberOfGoodESDTracksVtx","Number of Good ESD tracks",kGCnXBinsESDtrk, kGCfirstXBinESDtrk, kGClastXBinESDtrk,"","");}    
2126         
2127     //  debug histograms
2128     if(kGCplotESDCutGetOnFly == kTRUE){histograms->AddHistogram("ESD_CutGetOnFly_InvMass" ,"Not GetOnFly" , kGCnXBinsGammaMass, kGCfirstXBinGammaMass, kGClastXBinGammaMass,"","");}
2129     if(kGCplotESDCutNContributors == kTRUE){histograms->AddHistogram("ESD_CutNContributors_InvMass" ,"NContributors <= 0" , kGCnXBinsGammaMass, kGCfirstXBinGammaMass, kGClastXBinGammaMass,"","");}
2130     if(kGCplotESDCutLikeSign == kTRUE){histograms->AddHistogram("ESD_CutLikeSign_InvMass" ,"LikeSign" , kGCnXBinsGammaMass, kGCfirstXBinGammaMass, kGClastXBinGammaMass,"","");}
2131     if(kGCplotESDCutRefit == kTRUE){histograms->AddHistogram("ESD_CutRefit_InvMass" ,"No TPC refit" , kGCnXBinsGammaMass, kGCfirstXBinGammaMass, kGClastXBinGammaMass,"","");}
2132     if(kGCplotESDCutKink == kTRUE){histograms->AddHistogram("ESD_CutKink_InvMass" ,"Kinks" , kGCnXBinsGammaMass, kGCfirstXBinGammaMass, kGClastXBinGammaMass,"","");}
2133     if(kGCplotESDCutPIDProb == kTRUE){histograms->AddHistogram("ESD_CutPIDProb_InvMass" ,"wrong TPC PID" , kGCnXBinsGammaMass, kGCfirstXBinGammaMass, kGClastXBinGammaMass,"","");}
2134
2135     if(kGCplotESDCutdedxSigmaElectronLine == kTRUE){histograms->AddHistogram("ESD_CutdEdxSigmaElectronLine_InvMass" ,"dedx ElectronLine" , kGCnXBinsGammaMass, kGCfirstXBinGammaMass, kGClastXBinGammaMass,"","");}
2136     if(kGCplotESDCutdedxSigmaPionLine == kTRUE){histograms->AddHistogram("ESD_CutdEdxSigmaPionLine_InvMass" ,"dedx PionLine" , kGCnXBinsGammaMass, kGCfirstXBinGammaMass, kGClastXBinGammaMass,"","");}
2137     if(kGCplotESDCutPionRejectionLowP==kTRUE){histograms->AddHistogram("ESD_CutPionRejectionLowP_InvMass" ,"dedx PionRejection LowP" , kGCnXBinsGammaMass, kGCfirstXBinGammaMass, kGClastXBinGammaMass,"","");}
2138     if(kGCplotESDCutKaonRejectionLowP==kTRUE){histograms->AddHistogram("ESD_CutKaonRejectionLowP_InvMass" ,"dedx KaonRejection LowP" , kGCnXBinsGammaMass, kGCfirstXBinGammaMass, kGClastXBinGammaMass,"","");}
2139     if(kGCplotESDCutQtGammaSelection==kTRUE){histograms->AddHistogram("ESD_CutQt_InvMass","ESD_CutQt_InvMass",kGCnXBinsGammaMass, kGCfirstXBinGammaMass, kGClastXBinGammaMass,"","");}
2140
2141     if(kGCplotESDCutProtonRejectionLowP==kTRUE){histograms->AddHistogram("ESD_CutProtonRejectionLowP_InvMass" ,"dedx ProtonRejection LowP" , kGCnXBinsGammaMass, kGCfirstXBinGammaMass, kGClastXBinGammaMass,"","");}
2142     if(kGCplotESDCutR == kTRUE){histograms->AddHistogram("ESD_CutR_InvMass" ,"Above RMax" , kGCnXBinsGammaMass, kGCfirstXBinGammaMass, kGClastXBinGammaMass,"","");}
2143     if(kGCplotESDCutMinR == kTRUE){histograms->AddHistogram("ESD_CutMinR_InvMass" ,"Above RMax" , kGCnXBinsGammaMass, kGCfirstXBinGammaMass, kGClastXBinGammaMass,"","");}
2144     if(kGCplotESDCutNDF == kTRUE){histograms->AddHistogram("ESD_CutNDF_InvMass" ,"NDF <= 0" , kGCnXBinsGammaMass, kGCfirstXBinGammaMass, kGClastXBinGammaMass,"","");}
2145     if(kGCplotESDCutChi2 == kTRUE){histograms->AddHistogram("ESD_CutChi2_InvMass" ,"#chi^{2} > Max" , kGCnXBinsGammaMass, kGCfirstXBinGammaMass, kGClastXBinGammaMass,"","");}
2146     if(kGCplotESDCutEta == kTRUE){histograms->AddHistogram("ESD_CutEta_InvMass" ,"Above #eta max" , kGCnXBinsGammaMass, kGCfirstXBinGammaMass, kGClastXBinGammaMass,"","");}
2147     if(kGCplotESDCutSinglePt == kTRUE){histograms->AddHistogram("ESD_CutSinglePt_InvMass" ,"Below p_{t} min" , kGCnXBinsGammaMass, kGCfirstXBinGammaMass, kGClastXBinGammaMass,"","");}
2148     if(kGCplotESDCutPt == kTRUE){histograms->AddHistogram("ESD_CutPt_InvMass" ,"Below p_{t} min" , kGCnXBinsGammaMass, kGCfirstXBinGammaMass, kGClastXBinGammaMass,"","");}
2149     if(kGCplotESDCutLine == kTRUE){histograms->AddHistogram("ESD_CutLine_InvMass" ,"Out of reconstruction area" , kGCnXBinsGammaMass, kGCfirstXBinGammaMass, kGClastXBinGammaMass,"","");}
2150     if(kGCplotESDCutZ == kTRUE){histograms->AddHistogram("ESD_CutZ_InvMass" ,"Out of reconstruction area" , kGCnXBinsGammaMass, kGCfirstXBinGammaMass, kGClastXBinGammaMass,"","");}
2151     if(kGCplotESDCutMinClsTPC == kTRUE){histograms->AddHistogram("ESD_CutMinNClsTPC_InvMass" ,"Out of reconstruction area" , kGCnXBinsGammaMass, kGCfirstXBinGammaMass, kGClastXBinGammaMass,"","");}
2152     if(kGCplotESDCutMinClsTPCToF == kTRUE){histograms->AddHistogram("ESD_CutMinNClsTPCToF_InvMass" ,"Out of reconstruction area" , kGCnXBinsGammaMass, kGCfirstXBinGammaMass, kGClastXBinGammaMass,"","");}
2153
2154     if(kGCplotESDGoodV0s == kTRUE){histograms->AddHistogram("ESD_GoodV0s_InvMass" ,"Good V0s" , kGCnXBinsGammaMass, kGCfirstXBinGammaMass, kGClastXBinGammaMass,"","");}
2155     if(kGCplotESDAllV0s == kTRUE){histograms->AddHistogram("ESD_AllV0s_InvMass" ,"All V0s" , kGCnXBinsGammaMass, kGCfirstXBinGammaMass, kGClastXBinGammaMass,"","");}
2156     if(kGCplotESDAllV0sCurrentFinder == kTRUE){histograms->AddHistogram("ESD_AllV0sCurrentFinder_InvMass" ,"All V0s Current Finder" , kGCnXBinsGammaMass, kGCfirstXBinGammaMass, kGClastXBinGammaMass,"","");}
2157
2158     if(kGCplotESDAllV0sCurrentFinderQtAlfa== kTRUE){ histograms->AddHistogram("ESD_AllV0sCurrentFinder_alfa_qt" ,"" ,kGCnXBinsP, kGCfirstXBinAlphaG, kGClastXBinAlpha,kGCnYBinsQt, kGCfirstYBinQt, kGClastYBinQt,"", "");}
2159     if(kGCplotESDAllV0sCurrentFinderQtAlfa== kTRUE){ histograms->AddHistogram("ESD_AllV0sCurrentFinder_goodtracks_alfa_qt" ,"" ,kGCnXBinsP, kGCfirstXBinAlphaG, kGClastXBinAlpha,kGCnYBinsQt, kGCfirstYBinQt, kGClastYBinQt,"", "");}
2160
2161     if(kGCplotESDTrueConvGammaTrackLength == kTRUE){histograms->AddHistogram("ESD_TrueConvGamma_TrackLength","Track length of TrueConvGamma",kGCnXBinsTrackLength,kGCfirstXBinTrackLength,kGClastXBinTrackLength,"","");}
2162     if(kGCplotESDTrueConvGammaTrackLengthVSInvMass == kTRUE){histograms->AddHistogram("ESD_TrueConvGamma_TrackLengthVSInvMass","Track length of TrueConvGamma vs Inv mass",kGCnXBinsTrackLength,kGCfirstXBinTrackLength,kGClastXBinTrackLength,kGCnXBinsPt, kGCfirstXBinPt, kGClastXBinPt,"","");}
2163                 
2164     if(kGCplotOmegaSpectra == kTRUE){
2165       histograms->AddHistogram("ESD_Omega_InvMass_vs_Pt" ,"Invariant Mass vs Pt" , kGCnXBinsSpectra, kGCfirstXBinSpectra, kGClastXBinSpectra,kGCnYBinsSpectra, kGCfirstYBinSpectra, kGClastYBinSpectra,"InvMass [GeV]","Pt [GeV]");
2166       histograms->AddHistogram("ESD_Omega_InvMass","Invariant mass",kGCnXBinsSpectra,kGCfirstXBinSpectra, kGClastXBinSpectra,"InvMass [GeV]","Counts");
2167
2168       histograms->AddHistogram("ESD_Omega_Bck_InvMass_vs_Pt" ,"Invariant Mass vs Pt" , kGCnXBinsSpectra, kGCfirstXBinSpectra, kGClastXBinSpectra,kGCnYBinsSpectra, kGCfirstYBinSpectra, kGClastYBinSpectra,"InvMass [GeV]","Pt [GeV]");
2169       histograms->AddHistogram("ESD_Omega_Bck_InvMass","Invariant mass",kGCnXBinsSpectra,kGCfirstXBinSpectra, kGClastXBinSpectra,"InvMass [GeV]","Counts");
2170       histograms->AddHistogram("ESD_OmegaPipPinPi0_InvMass_vs_Pt" ,"Invariant Mass vs Pt" , kGCnXBinsSpectra, kGCfirstXBinSpectra, kGClastXBinSpectra,kGCnYBinsSpectra, kGCfirstYBinSpectra, kGClastYBinSpectra,"InvMass [GeV]","Pt [GeV]");
2171       histograms->AddHistogram("ESD_OmegaPipPinPi0_InvMass","Invariant mass",kGCnXBinsSpectra,kGCfirstXBinSpectra, kGClastXBinSpectra,"InvMass [GeV]","Counts");
2172
2173     }
2174
2175     if(kGCplotPi0Spectra == kTRUE){
2176       histograms->AddHistogram("ESD_Mother_alfa","Invariant mass",kGCnXBinsSpectra,kGCfirstXBinAlpha, kGClastXBinAlpha,"#alpha","Counts");
2177       histograms->AddHistogram("ESD_Mother_alfa_Pi0","Invariant mass",kGCnXBinsSpectra,kGCfirstXBinAlpha, kGClastXBinAlpha,"#alpha","Counts");
2178
2179       //      histograms->AddHistogram("ESD_Mother_InvMass_vs_Pt" ,"Invariant Mass vs Pt" , kGCnXBinsSpectra, kGCfirstXBinSpectra, kGClastXBinSpectra,kGCnYBinsSpectra, kGCfirstYBinSpectra, kGClastYBinSpectra,"InvMass [GeV]","Pt [GeV]");
2180       histograms->AddHistogram("ESD_Mother_InvMass_vs_Pt" ,"Invariant Mass vs Pt" , kGCnXBinsSpectra, kGCfirstXBinSpectra, kGClastXBinSpectra,kGCnYBinsSpectra, kGCfirstYBinSpectra, kGClastYBinSpectra,"InvMass [GeV]","Pt [GeV]");
2181       histograms->AddHistogram("ESD_Mother_InvMass_vs_Pt_alpha" ,"Invariant Mass vs Pt" , kGCnXBinsSpectra, kGCfirstXBinSpectra, kGClastXBinSpectra,kGCnYBinsSpectra, kGCfirstYBinSpectra, kGClastYBinSpectra,"InvMass [GeV]","Pt [GeV]");
2182       histograms->AddHistogram("ESD_Mother_InvMass_vs_E_alpha" ,"Invariant Mass vs E" , kGCnXBinsSpectra, kGCfirstXBinSpectra, kGClastXBinSpectra,kGCnYBinsSpectra, kGCfirstYBinSpectra, kGClastYBinSpectra,"InvMass [GeV]","E [GeV]");
2183       histograms->AddHistogram("ESD_Mother_InvMass","Invariant mass",kGCnXBinsSpectra,kGCfirstXBinSpectra, kGClastXBinSpectra,"InvMass [GeV]","Counts");
2184       histograms->AddHistogram("ESD_Mother_InvMass_1212","Invariant mass",kGCnXBinsSpectra,kGCfirstXBinSpectra, kGClastXBinSpectra,"InvMass [GeV]","Counts");
2185       histograms->AddHistogram("ESD_Mother_InvMass_0912","Invariant mass",kGCnXBinsSpectra,kGCfirstXBinSpectra, kGClastXBinSpectra,"InvMass [GeV]","Counts");
2186       histograms->AddHistogram("ESD_Mother_InvMass_0909","Invariant mass",kGCnXBinsSpectra,kGCfirstXBinSpectra, kGClastXBinSpectra,"InvMass [GeV]","Counts");
2187       histograms->AddHistogram("ESD_Mother_InvMass_vs_Pt1212" ,"Invariant Mass vs Pt" , kGCnXBinsSpectra, kGCfirstXBinSpectra, kGClastXBinSpectra,kGCnYBinsSpectra, kGCfirstYBinSpectra, kGClastYBinSpectra,"InvMass [GeV]","Pt [GeV]");
2188       histograms->AddHistogram("ESD_Mother_InvMass_vs_Pt0912" ,"Invariant Mass vs Pt" , kGCnXBinsSpectra, kGCfirstXBinSpectra, kGClastXBinSpectra,kGCnYBinsSpectra, kGCfirstYBinSpectra, kGClastYBinSpectra,"InvMass [GeV]","Pt [GeV]");
2189       histograms->AddHistogram("ESD_Mother_InvMass_vs_Pt0909" ,"Invariant Mass vs Pt" , kGCnXBinsSpectra, kGCfirstXBinSpectra, kGClastXBinSpectra,kGCnYBinsSpectra, kGCfirstYBinSpectra, kGClastYBinSpectra,"InvMass [GeV]","Pt [GeV]");
2190
2191       if(kGCLowMemoryConsumption == kFALSE){
2192         histograms->AddHistogram("ESD_Mother_InvMass_GammaConvPHOS","Invariant mass",kGCnXBinsSpectra,kGCfirstXBinSpectra, kGClastXBinSpectra,"InvMass [GeV]","Counts");
2193         histograms->AddHistogram("ESD_Mother_InvMass_vs_Pt_GammaConvPHOS" ,"Invariant Mass vs Pt" , kGCnXBinsSpectra, kGCfirstXBinSpectra, kGClastXBinSpectra,kGCnYBinsSpectra, kGCfirstYBinSpectra, kGClastYBinSpectra,"InvMass [GeV]","Pt [GeV]");
2194         histograms->AddHistogram("ESD_Mother_InvMass_GammaConvPHOS_OpanLow","Invariant mass",kGCnXBinsSpectra,kGCfirstXBinSpectra, kGClastXBinSpectra,"InvMass [GeV]","Counts");
2195         histograms->AddHistogram("ESD_Mother_InvMass_GammaConvPHOS_OpanHigh","Invariant mass",kGCnXBinsSpectra,kGCfirstXBinSpectra, kGClastXBinSpectra,"InvMass [GeV]","Counts");
2196
2197         histograms->AddHistogram("ESD_Mother_InvMass_GammaConvEMCAL","Invariant mass",kGCnXBinsSpectra,kGCfirstXBinSpectra, kGClastXBinSpectra,"InvMass [GeV]","Counts");
2198         histograms->AddHistogram("ESD_Mother_InvMass_GammaConvEMCAL_Bck","Invariant mass",kGCnXBinsSpectra,kGCfirstXBinSpectra, kGClastXBinSpectra,"InvMass [GeV]","Counts");
2199         
2200         histograms->AddHistogram("ESD_Mother_InvMass_vs_Pt_GammaConvEMCAL" ,"Invariant Mass vs Pt" , kGCnXBinsSpectra, kGCfirstXBinSpectra, kGClastXBinSpectra,kGCnYBinsSpectra, kGCfirstYBinSpectra, kGClastYBinSpectra,"InvMass [GeV]","Pt [GeV]");
2201         histograms->AddHistogram("ESD_Mother_InvMass_vs_Pt_GammaConvEMCAL_Bck" ,"Invariant Mass vs Pt" , kGCnXBinsSpectra, kGCfirstXBinSpectra, kGClastXBinSpectra,kGCnYBinsSpectra, kGCfirstYBinSpectra, kGClastYBinSpectra,"InvMass [GeV]","Pt [GeV]");
2202         
2203         histograms->AddHistogram("ESD_Mother_InvMass_GammaConvEMCAL_OpanLow","Invariant mass",kGCnXBinsSpectra,kGCfirstXBinSpectra, kGClastXBinSpectra,"InvMass [GeV]","Counts");
2204         histograms->AddHistogram("ESD_Mother_InvMass_GammaConvEMCAL_OpanHigh","Invariant mass",kGCnXBinsSpectra,kGCfirstXBinSpectra, kGClastXBinSpectra,"InvMass [GeV]","Counts");
2205       }
2206
2207       //      if(kGCdoNeutralMesonV0MCCheck == kTRUE){
2208       histograms->AddHistogram("ESD_TrueBckGG_InvMass","Invariant mass",kGCnXBinsSpectra,kGCfirstXBinSpectra, kGClastXBinSpectra,"InvMass [GeV]","Counts");
2209       histograms->AddHistogram("ESD_TrueBckCont_InvMass","Invariant mass",kGCnXBinsSpectra,kGCfirstXBinSpectra, kGClastXBinSpectra,"InvMass [GeV]","Counts");
2210       histograms->AddHistogram("ESD_TruePi0Sec_InvMass","Invariant mass",kGCnXBinsSpectra,kGCfirstXBinSpectra, kGClastXBinSpectra,"InvMass [GeV]","Counts");
2211
2212         histograms->AddHistogram("ESD_TruePi0_InvMass","Invariant mass",kGCnXBinsSpectra,kGCfirstXBinSpectra, kGClastXBinSpectra,"InvMass [GeV]","Counts");
2213         histograms->AddHistogram("ESD_TruePi0_InvMass_1212","Invariant mass",kGCnXBinsSpectra,kGCfirstXBinSpectra, kGClastXBinSpectra,"InvMass [GeV]","Counts");
2214         histograms->AddHistogram("ESD_TruePi0_InvMass_0912","Invariant mass",kGCnXBinsSpectra,kGCfirstXBinSpectra, kGClastXBinSpectra,"InvMass [GeV]","Counts");
2215         histograms->AddHistogram("ESD_TruePi0_InvMass_0909","Invariant mass",kGCnXBinsSpectra,kGCfirstXBinSpectra, kGClastXBinSpectra,"InvMass [GeV]","Counts");
2216         histograms->AddHistogram("ESD_TruePi0_OpeningAngle_1212" ,"" , kGCnXBinsOpeningAngle, kGCfirstXBinOpeningAngle, kGClastXBinOpeningAngle, "", "");
2217         histograms->AddHistogram("ESD_TruePi0_OpeningAngle_0912" ,"" , kGCnXBinsOpeningAngle, kGCfirstXBinOpeningAngle, kGClastXBinOpeningAngle, "", "");
2218         histograms->AddHistogram("ESD_TruePi0_OpeningAngle_0909" ,"" , kGCnXBinsOpeningAngle, kGCfirstXBinOpeningAngle, kGClastXBinOpeningAngle, "", "");
2219         histograms->AddHistogram("ESD_TruePi0_InvMass_vs_Pt" ,"Invariant Mass vs Pt" , kGCnXBinsSpectra, kGCfirstXBinSpectra, kGClastXBinSpectra,kGCnYBinsSpectra, kGCfirstYBinSpectra, kGClastYBinSpectra,"InvMass [GeV]","Pt [GeV]");
2220 histograms->AddHistogram("ESD_TruePi0_InvMass_vs_Pt_alpha" ,"Invariant Mass vs Pt" , kGCnXBinsSpectra, kGCfirstXBinSpectra, kGClastXBinSpectra,kGCnYBinsSpectra, kGCfirstYBinSpectra, kGClastYBinSpectra,"InvMass [GeV]","Pt [GeV]");
2221
2222  if(kGCLowMemoryConsumption == kFALSE){
2223    histograms->AddHistogram("ESD_TruePi0_InvMass_vs_Pt1212" ,"Invariant Mass vs Pt" , kGCnXBinsSpectra, kGCfirstXBinSpectra, kGClastXBinSpectra,kGCnYBinsSpectra, kGCfirstYBinSpectra, kGClastYBinSpectra,"InvMass [GeV]","Pt [GeV]");
2224    histograms->AddHistogram("ESD_TruePi0_InvMass_vs_Pt0912" ,"Invariant Mass vs Pt" , kGCnXBinsSpectra, kGCfirstXBinSpectra, kGClastXBinSpectra,kGCnYBinsSpectra, kGCfirstYBinSpectra, kGClastYBinSpectra,"InvMass [GeV]","Pt [GeV]");
2225    histograms->AddHistogram("ESD_TruePi0_InvMass_vs_Pt0909" ,"Invariant Mass vs Pt" , kGCnXBinsSpectra, kGCfirstXBinSpectra, kGClastXBinSpectra,kGCnYBinsSpectra, kGCfirstYBinSpectra, kGClastYBinSpectra,"InvMass [GeV]","Pt [GeV]");
2226
2227         //}
2228
2229    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]");
2230  }
2231       histograms->AddHistogram("ESD_Mother_InvMass_Fiducial","Invariant mass |eta|<0.9",kGCnXBinsSpectra,kGCfirstXBinSpectra, kGClastXBinSpectra,"InvMass [GeV]","Counts");
2232
2233
2234     }
2235
2236     if(kGCplotPi0Spectra == kTRUE && kGCcalculateBackground == kTRUE){
2237       for(Int_t m=0;m<6;m++){
2238         histograms->AddHistogram(Form("%dESD_Mother_InvMass_vs_Pt",m) ,"Background Invariant Mass vs Pt" , kGCnXBinsSpectra, kGCfirstXBinSpectra, kGClastXBinSpectra,kGCnYBinsSpectra, kGCfirstYBinSpectra, kGClastYBinSpectra,"InvMass [GeV]","Pt [GeV]");
2239       }
2240       for(Int_t z=0;z<8;z++){
2241         for(Int_t m=0;m<6;m++){
2242           histograms->AddHistogram(Form("%d%dESD_Mother_InvMass_vs_Pt",z,m) ,"ESD Invariant Mass vs Pt" , kGCnXBinsSpectra, kGCfirstXBinSpectra, kGClastXBinSpectra,kGCnYBinsSpectra, kGCfirstYBinSpectra, kGClastYBinSpectra,"InvMass [GeV]","Pt [GeV]");
2243
2244           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]");
2245
2246           
2247           histograms->AddHistogram(Form("%d%dESD_Background_InvMass",z,m),"Invariant mass background",kGCnXBinsSpectra,kGCfirstXBinSpectra, kGClastXBinSpectra,"InvMass BG [GeV]","Counts");
2248           histograms->AddHistogram(Form("%d%dESD_Mother_InvMass",z,m),"Invariant mass in z and m bins",kGCnXBinsSpectra,kGCfirstXBinSpectra, kGClastXBinSpectra,"InvMass BG [GeV]","Counts");
2249
2250
2251           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]");
2252
2253          
2254           histograms->AddHistogram(Form("%d%dESD_Background_InvMass_Fiducial",z,m),"Invariant mass background |eta|<0.9",kGCnXBinsSpectra,kGCfirstXBinSpectra, kGClastXBinSpectra,"InvMass BG [GeV]","Counts");
2255         }
2256       }
2257     
2258       histograms->AddHistogram("ESD_Background_InvMass_vs_Pt" ,"Background Invariant Mass vs Pt" , kGCnXBinsSpectra, kGCfirstXBinSpectra, kGClastXBinSpectra,kGCnYBinsSpectra, kGCfirstYBinSpectra, kGClastYBinSpectra,"InvMass [GeV]","Pt [GeV]");
2259       histograms->AddHistogram("ESD_Background_InvMass_vs_Pt_alpha" ,"Background Invariant Mass vs Pt" , kGCnXBinsSpectra, kGCfirstXBinSpectra, kGClastXBinSpectra,kGCnYBinsSpectra, kGCfirstYBinSpectra, kGClastYBinSpectra,"InvMass [GeV]","Pt [GeV]");
2260
2261      histograms->AddHistogram("ESD_Background_InvMass_vs_E_alpha" ,"Background Invariant Mass vs E" , kGCnXBinsSpectra, kGCfirstXBinSpectra, kGClastXBinSpectra,kGCnYBinsSpectra, kGCfirstYBinSpectra, kGClastYBinSpectra,"InvMass [GeV]","E [GeV]");
2262
2263   histograms->AddHistogram("ESD_Background_InvMass","Invariant mass background",kGCnXBinsSpectra,kGCfirstXBinSpectra, kGClastXBinSpectra,"InvMass BG [GeV]","Counts");
2264
2265       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]");
2266       histograms->AddHistogram("ESD_Background_InvMass_Fiducial","Invariant mass background |eta|<0.9",kGCnXBinsSpectra,kGCfirstXBinSpectra, kGClastXBinSpectra,"InvMass BG [GeV]","Counts");
2267     
2268     }
2269     
2270     if(kGCdoMCTruth){
2271       if(kGCplotMCConversionR == kTRUE){ histograms->AddHistogram("MC_Conversion_R","Radius of gamma conversion points",kGCnXBinsR, kGCfirstXBinR, kGClastXBinR,"counts","cm");}
2272       if(kGCplotMCConversionZR == kTRUE){ histograms->AddHistogram("MC_Conversion_ZR","Radius of gamma conversion points vs Z",kGCnXBinsZR, kGCfirstXBinZR, kGClastXBinZR, kGCnYBinsZR, kGCfirstYBinZR, kGClastYBinZR, "cm", "cm");}
2273       if(kGCplotMCConversionXY == kTRUE){ histograms->AddHistogram("MC_Conversion_XY","Gamma XY converison point.",kGCnXBinsXY, kGCfirstXBinXY, kGClastXBinXY, kGCnYBinsXY, kGCfirstYBinXY, kGClastYBinXY, "cm", "cm");}
2274       if(kGCplotMCConversionOpeningAngle == kTRUE){ histograms->AddHistogram("MC_Conversion_OpeningAngle","Opening angle of e+e- pairs from gamma conversion",kGCnXBinsOpeningAngle, kGCfirstXBinOpeningAngle, kGClastXBinOpeningAngle, "counts", "cm");}
2275       if(kGCplotMCConvGammaEAsymmetryP== kTRUE){ histograms->AddHistogram("MC_ConvGamma_E_AsymmetryP" ,"" ,kGCnXBinsP, kGCfirstXBinP, kGClastXBinP,kGCnYBinsAsymmetry, kGCfirstYBinAsymmetry, kGClastYBinAsymmetry,"", "");}
2276       if(kGCplotMCConvGammaPAsymmetryP== kTRUE){ histograms->AddHistogram("MC_ConvGamma_P_AsymmetryP" ,"" ,kGCnXBinsP, kGCfirstXBinP, kGClastXBinP,kGCnYBinsAsymmetry, kGCfirstYBinAsymmetry, kGClastYBinAsymmetry,"", "");}
2277                 
2278
2279       if(kGCplotMCEEnergy == kTRUE){ histograms->AddHistogram("MC_E_Energy" ,"" , kGCnXBinsEnergy, kGCfirstXBinEnergy, kGClastXBinEnergy, "", "");}
2280       if(kGCplotMCEPt == kTRUE){ histograms->AddHistogram("MC_E_Pt" ,"" , kGCnXBinsPt, kGCfirstXBinPt, kGClastXBinPt, "", "");}
2281       if(kGCplotMCEEta == kTRUE){ histograms->AddHistogram("MC_E_Eta" ,"" , kGCnXBinsEta, kGCfirstXBinEta, kGClastXBinEta, "", "");}
2282       if(kGCplotMCEPhi == kTRUE){ histograms->AddHistogram("MC_E_Phi" ,"" , kGCnXBinsPhi, kGCfirstXBinPhi, kGClastXBinPhi, "", "");}
2283       if(kGCplotMCENTPCClusters == kTRUE){ histograms->AddHistogram("MC_E_nTPCClusters" ,"" , kGCnXBinsNTPCClusters, kGCfirstXBinNTPCClusters, kGClastXBinNTPCClusters, "", "");}
2284       if(kGCplotMCENITSClusters == kTRUE){ histograms->AddHistogram("MC_E_nITSClusters" ,"" , kGCnXBinsNITSClusters, kGCfirstXBinNITSClusters, kGClastXBinNITSClusters, "", "");}
2285                 
2286       if(kGCplotMCPEnergy == kTRUE){ histograms->AddHistogram("MC_P_Energy" ,"" , kGCnXBinsEnergy, kGCfirstXBinEnergy, kGClastXBinEnergy, "", "");}
2287       if(kGCplotMCPPt == kTRUE){ histograms->AddHistogram("MC_P_Pt" ,"" , kGCnXBinsPt, kGCfirstXBinPt, kGClastXBinPt, "", "");}
2288       if(kGCplotMCPEta == kTRUE){ histograms->AddHistogram("MC_P_Eta" ,"" , kGCnXBinsEta, kGCfirstXBinEta, kGClastXBinEta, "", "");}
2289       if(kGCplotMCPPhi == kTRUE){ histograms->AddHistogram("MC_P_Phi" ,"" , kGCnXBinsPhi, kGCfirstXBinPhi, kGClastXBinPhi, "", "");}
2290       if(kGCplotMCPNTPCClusters == kTRUE){ histograms->AddHistogram("MC_P_nTPCClusters" ,"" , kGCnXBinsNTPCClusters, kGCfirstXBinNTPCClusters, kGClastXBinNTPCClusters, "", "");}
2291       if(kGCplotMCPNITSClusters == kTRUE){ histograms->AddHistogram("MC_P_nITSClusters" ,"" , kGCnXBinsNITSClusters, kGCfirstXBinNITSClusters, kGClastXBinNITSClusters, "", "");}
2292                 
2293       if(kGCplotMCallGammaEnergy == kTRUE){ histograms->AddHistogram("MC_allGamma_Energy" ,"" , kGCnXBinsEnergy, kGCfirstXBinEnergy, kGClastXBinEnergy, "", "");}
2294       if(kGCplotMCallGammaPt == kTRUE){ histograms->AddHistogram("MC_allGamma_Pt" ,"" , kGCnXBinsPt, kGCfirstXBinPt, kGClastXBinPt, "", "");}
2295       if(kGCplotMCallGammaEta == kTRUE){ histograms->AddHistogram("MC_allGamma_Eta" ,"" , kGCnXBinsEta, kGCfirstXBinEta, kGClastXBinEta, "", "");}
2296       if(kGCplotMCallGammaPhi == kTRUE){ histograms->AddHistogram("MC_allGamma_Phi" ,"" , kGCnXBinsPhi, kGCfirstXBinPhi, kGClastXBinPhi, "", "");}
2297       if(kGCplotMCallGammaRapid == kTRUE){ histograms->AddHistogram("MC_allGamma_Rapid" ,"" , kGCnXBinsRapid, kGCfirstXBinRapid, kGClastXBinRapid, "", "");}
2298                 
2299       if(kGCplotMCConvGammaEnergy == kTRUE){ histograms->AddHistogram("MC_ConvGamma_Energy" ,"" , kGCnXBinsEnergy, kGCfirstXBinEnergy, kGClastXBinEnergy, "", "");}
2300       if(kGCplotMCConvGammaPt == kTRUE){ histograms->AddHistogram("MC_ConvGamma_Pt" ,"" , kGCnXBinsPt, kGCfirstXBinPt, kGClastXBinPt, "", "");}
2301       if(kGCplotMCConvGammaEta == kTRUE){ histograms->AddHistogram("MC_ConvGamma_Eta" ,"" , kGCnXBinsEta, kGCfirstXBinEta, kGClastXBinEta, "", "");}
2302       if(kGCplotMCConvGammaPhi == kTRUE){ histograms->AddHistogram("MC_ConvGamma_Phi" ,"" , kGCnXBinsPhi, kGCfirstXBinPhi, kGClastXBinPhi, "", "");}
2303       if(kGCplotMCConvGammaRapid == kTRUE){ histograms->AddHistogram("MC_ConvGamma_Rapid" ,"" , kGCnXBinsRapid, kGCfirstXBinRapid, kGClastXBinRapid, "", "");}
2304       if(kGCplotMCConvGammaPtvsEta == kTRUE){ histograms->AddHistogram("MC_ConvGamma_Pt_Eta","", kGCnXBinsPt, kGCfirstXBinPt, kGClastXBinPt,kGCnXBinsEta, kGCfirstXBinEta, kGClastXBinEta,"","");}
2305                 
2306       if(kGCplotMCallDirectGammaEnergy == kTRUE){ histograms->AddHistogram("MC_allDirectGamma_Energy" ,"" , kGCnXBinsEnergy, kGCfirstXBinEnergy, kGClastXBinEnergy, "", "");}
2307       if(kGCplotMCallDirectGammaPt == kTRUE){ histograms->AddHistogram("MC_allDirectGamma_Pt" ,"" , kGCnXBinsPt, kGCfirstXBinPt, kGClastXBinPt, "", "");}
2308       if(kGCplotMCallDirectGammaEta == kTRUE){ histograms->AddHistogram("MC_allDirectGamma_Eta" ,"" , kGCnXBinsEta, kGCfirstXBinEta, kGClastXBinEta, "", "");}
2309       if(kGCplotMCallDirectGammaPhi == kTRUE){ histograms->AddHistogram("MC_allDirectGamma_Phi" ,"" , kGCnXBinsPhi, kGCfirstXBinPhi, kGClastXBinPhi, "", "");}
2310       if(kGCplotMCallDirectGammaRapid == kTRUE){ histograms->AddHistogram("MC_allDirectGamma_Rapid" ,"" , kGCnXBinsRapid, kGCfirstXBinRapid, kGClastXBinRapid, "", "");}
2311                 
2312       if(kGCplotMCConvDirectGammaEnergy == kTRUE){ histograms->AddHistogram("MC_ConvDirectGamma_Energy" ,"" , kGCnXBinsEnergy, kGCfirstXBinEnergy, kGClastXBinEnergy, "", "");}
2313       if(kGCplotMCConvDirectGammaPt == kTRUE){ histograms->AddHistogram("MC_ConvDirectGamma_Pt" ,"" , kGCnXBinsPt, kGCfirstXBinPt, kGClastXBinPt, "", "");}
2314       if(kGCplotMCConvDirectGammaEta == kTRUE){ histograms->AddHistogram("MC_ConvDirectGamma_Eta" ,"" , kGCnXBinsEta, kGCfirstXBinEta, kGClastXBinEta, "", "");}
2315       if(kGCplotMCConvDirectGammaPhi == kTRUE){ histograms->AddHistogram("MC_ConvDirectGamma_Phi" ,"" , kGCnXBinsPhi, kGCfirstXBinPhi, kGClastXBinPhi, "", "");}
2316       if(kGCplotMCConvDirectGammaRapid == kTRUE){ histograms->AddHistogram("MC_ConvDirectGamma_Rapid" ,"" , kGCnXBinsRapid, kGCfirstXBinRapid, kGClastXBinRapid, "", "");}
2317                 
2318       if(kGCplotMCMotherEta == kTRUE){ histograms->AddHistogram("MC_Mother_Eta" ,"" , kGCnXBinsEta, kGCfirstXBinEta, kGClastXBinEta, "", "");}
2319       if(kGCplotMCMotherPhi == kTRUE){ histograms->AddHistogram("MC_Mother_Phi" ,"" , kGCnXBinsPhi, kGCfirstXBinPhi, kGClastXBinPhi, "", "");}
2320       if(kGCplotMCMotherRapid == kTRUE){ histograms->AddHistogram("MC_Mother_Rapid" ,"" , kGCnXBinsRapid, kGCfirstXBinRapid, kGClastXBinRapid, "", "");}
2321       if(kGCplotMCMotherPt == kTRUE){ histograms->AddHistogram("MC_Mother_Pt" ,"" , kGCnXBinsPt, kGCfirstXBinPt, kGClastXBinPt, "", "");}
2322       if(kGCplotMCMotherEnergy == kTRUE){ histograms->AddHistogram("MC_Mother_Energy" ,"" , kGCnXBinsEnergy, kGCfirstXBinEnergy, kGClastXBinEnergy, "", "");}
2323       if(kGCplotMCMotherMass == kTRUE){ histograms->AddHistogram("MC_Mother_Mass" ,"" , kGCnXBinsGammaMass, kGCfirstXBinGammaMass, kGClastXBinGammaMass, "", "");}
2324       if(kGCplotMCMotherOpeningAngle == kTRUE){ histograms->AddHistogram("MC_Mother_GammaDaughter_OpeningAngle" ,"" , kGCnXBinsOpeningAngle, kGCfirstXBinOpeningAngle, kGClastXBinOpeningAngle, "", "");}
2325       if(kGCplotMCMotherR == kTRUE){ histograms->AddHistogram("MC_Mother_R" ,"" , kGCnXBinsR, kGCfirstXBinR, kGClastXBinR, "", "");}
2326       if(kGCplotMCMotherZR == kTRUE){ histograms->AddHistogram("MC_Mother_ZR" ,"" , kGCnXBinsZR, kGCfirstXBinZR, kGClastXBinZR, kGCnYBinsZR, kGCfirstYBinZR, kGClastYBinZR, "", "");}
2327       if(kGCplotMCMotherXY == kTRUE){ histograms->AddHistogram("MC_Mother_XY" ,"" , kGCnXBinsXY, kGCfirstXBinXY, kGClastXBinXY, kGCnYBinsXY, kGCfirstYBinXY, kGClastYBinXY, "", "");}
2328       if(kGCplotMCMotherPtvsEtaWithinAcceptance == kTRUE){ histograms->AddHistogram("MC_Mother_Pt_Eta_withinAcceptance" ,"" , kGCnXBinsPt, kGCfirstXBinPt, kGClastXBinPt, kGCnXBinsEta, kGCfirstXBinEta, kGClastXBinEta, "", "");}
2329       if(kGCplotMCMotherPtvsRapidWithinAcceptance == kTRUE){ histograms->AddHistogram("MC_Mother_Pt_Rapid_withinAcceptance" ,"" , kGCnXBinsPt, kGCfirstXBinPt, kGClastXBinPt, kGCnXBinsRapid, kGCfirstXBinRapid, kGClastXBinRapid, "", "");}
2330       if(kGCplotMCMotherPtvsEtaConvGammaWithinAcceptance == kTRUE){ histograms->AddHistogram("MC_Mother_Pt_Eta_ConvGamma_withinAcceptance" ,"" , kGCnXBinsPt, kGCfirstXBinPt, kGClastXBinPt, kGCnXBinsEta, kGCfirstXBinEta, kGClastXBinEta, "", "");}
2331       if(kGCplotMCMotherPtvsRapidConvGammaWithinAcceptance == kTRUE){ histograms->AddHistogram("MC_Mother_Pt_Rapid_ConvGamma_withinAcceptance" ,"" , kGCnXBinsPt, kGCfirstXBinPt, kGClastXBinPt, kGCnXBinsRapid, kGCfirstXBinRapid, kGClastXBinRapid, "", "");}
2332                 
2333       if(kGCplotMCMotherSpectra == kTRUE){ 
2334         histograms->AddHistogram("MC_Mother_InvMass_vs_Pt" ,"" ,kGCnXBinsSpectra, kGCfirstXBinSpectra, kGClastXBinSpectra, kGCnYBinsSpectra, kGCfirstYBinSpectra, kGClastYBinSpectra, "", "");
2335         histograms->AddHistogram("MC_Mother_InvMass_vs_Pt_withinAcceptance" ,"" ,kGCnXBinsSpectra, kGCfirstXBinSpectra, kGClastXBinSpectra, kGCnYBinsSpectra, kGCfirstYBinSpectra, kGClastYBinSpectra, "", "");
2336         histograms->AddHistogram("MC_Mother_InvMass_vs_Pt_ConvGamma_withinAcceptance" ,"" ,kGCnXBinsSpectra, kGCfirstXBinSpectra, kGClastXBinSpectra, kGCnYBinsSpectra, kGCfirstYBinSpectra, kGClastYBinSpectra, "", "");
2337       }
2338                 
2339       if(kGCplotMCPhysicalPrimaryChargedPt == kTRUE){ histograms->AddHistogram("MC_PhysicalPrimaryCharged_Pt" ,"" , kGCnXBinsPt, kGCfirstXBinPt, kGClastXBinPt, "", "");}
2340       if(kGCplotMCPi0Eta == kTRUE){ histograms->AddHistogram("MC_Pi0_Eta" ,"" , kGCnXBinsEta, kGCfirstXBinEta, kGClastXBinEta, "", "");}        
2341       if(kGCplotMCPi0Rapid == kTRUE){ histograms->AddHistogram("MC_Pi0_Rapid" ,"" , kGCnXBinsRapid, kGCfirstXBinRapid, kGClastXBinRapid, "", "");}      
2342       if(kGCplotMCPi0PtvsRapid == kTRUE){ histograms->AddHistogram("MC_Pi0_Pt_vs_Rapid" ,"" , kGCnXBinsPt, kGCfirstXBinPt, kGClastXBinPt, kGCnXBinsRapid, kGCfirstXBinRapid, kGClastXBinRapid, "", "");}
2343       if(kGCplotMCPi0Phi == kTRUE){ histograms->AddHistogram("MC_Pi0_Phi" ,"" , kGCnXBinsPhi, kGCfirstXBinPhi, kGClastXBinPhi, "", "");}
2344       if(kGCplotMCPi0Pt == kTRUE){ histograms->AddHistogram("MC_Pi0_Pt" ,"" , kGCnXBinsPt, kGCfirstXBinPt, kGClastXBinPt, "", "");}
2345
2346       if(kGCplotMCPi0Pt == kTRUE){ histograms->AddHistogram("MC_SD_EvtQ1_Pi0_Pt" ,"" , kGCnXBinsPt, kGCfirstXBinPt, kGClastXBinPt, "", "");}
2347       if(kGCplotMCPi0Pt == kTRUE){ histograms->AddHistogram("MC_SD_EvtQ2_Pi0_Pt" ,"" , kGCnXBinsPt, kGCfirstXBinPt, kGClastXBinPt, "", "");}
2348       if(kGCplotMCPi0Pt == kTRUE){ histograms->AddHistogram("MC_SD_EvtQ3_Pi0_Pt" ,"" , kGCnXBinsPt, kGCfirstXBinPt, kGClastXBinPt, "", "");}
2349
2350       if(kGCplotMCPi0Pt == kTRUE){ histograms->AddHistogram("MC_DD_EvtQ1_Pi0_Pt" ,"" , kGCnXBinsPt, kGCfirstXBinPt, kGClastXBinPt, "", "");}
2351       if(kGCplotMCPi0Pt == kTRUE){ histograms->AddHistogram("MC_DD_EvtQ2_Pi0_Pt" ,"" , kGCnXBinsPt, kGCfirstXBinPt, kGClastXBinPt, "", "");}
2352       if(kGCplotMCPi0Pt == kTRUE){ histograms->AddHistogram("MC_DD_EvtQ3_Pi0_Pt" ,"" , kGCnXBinsPt, kGCfirstXBinPt, kGClastXBinPt, "", "");}
2353
2354       if(kGCplotMCPi0Pt == kTRUE){ histograms->AddHistogram("MC_ND_EvtQ1_Pi0_Pt" ,"" , kGCnXBinsPt, kGCfirstXBinPt, kGClastXBinPt, "", "");}
2355       if(kGCplotMCPi0Pt == kTRUE){ histograms->AddHistogram("MC_ND_EvtQ2_Pi0_Pt" ,"" , kGCnXBinsPt, kGCfirstXBinPt, kGClastXBinPt, "", "");}
2356       if(kGCplotMCPi0Pt == kTRUE){ histograms->AddHistogram("MC_ND_EvtQ3_Pi0_Pt" ,"" , kGCnXBinsPt, kGCfirstXBinPt, kGClastXBinPt, "", "");}
2357
2358
2359       if(kGCplotMCPi0PtFiducial == kTRUE){ histograms->AddHistogram("MC_Pi0_Pt_Fiducial" ,"" , kGCnXBinsPt, kGCfirstXBinPt, kGClastXBinPt, "", "");}
2360       if(kGCplotMCPi0PtWithinAcceptanceFiducial == kTRUE){ histograms->AddHistogram("MC_Pi0_Pt_withinAcceptance_Fiducial" ,"" , kGCnXBinsPt,kGCfirstXBinPt, kGClastXBinPt, "", "");}
2361       if(kGCplotMCPi0PtConvGammaWithinAcceptanceFiducial == kTRUE){ histograms->AddHistogram("MC_Pi0_Pt_ConvGamma_withinAcceptance_Fiducial","" , kGCnXBinsPt, kGCfirstXBinPt, kGClastXBinPt, "", "");}
2362       if(kGCplotMCPi0OpeningPtConvGammaWithinAcceptance == kTRUE){ histograms->AddHistogram("MC_Pi0_ConvGamma_OpeningAngle_Pt","", kGCnXBinsPt, kGCfirstXBinPt, kGClastXBinPt, kGCnXBinsOpeningAngle, kGCfirstXBinOpeningAngle, kGClastXBinOpeningAngle, "", "");}
2363       if(kGCplotMCPi0PtGammaPtConvGammaWithinAcceptance == kTRUE){ histograms->AddHistogram("MC_Pi0_ConvGamma_PtGamma_Pt","", kGCnXBinsPt, kGCfirstXBinPt, kGClastXBinPt, kGCnXBinsPt, kGCfirstXBinPt, kGClastXBinPt, "", "");}
2364       if(kGCplotMCPi0Energy == kTRUE){ histograms->AddHistogram("MC_Pi0_Energy" ,"" , kGCnXBinsEnergy, kGCfirstXBinEnergy, kGClastXBinEnergy, "", "");}
2365       if(kGCplotMCPi0Mass == kTRUE){ histograms->AddHistogram("MC_Pi0_Mass" ,"" , kGCnXBinsPi0Mass, kGCfirstXBinPi0Mass, kGClastXBinPi0Mass, "", "");}
2366       if(kGCplotMCPi0Alpha == kTRUE){ histograms->AddHistogram("MC_Pi0_alpha" ,"" , kGCnXBinsPi0Mass, kGCfirstXBinPi0Alpha, kGClastXBinPi0Alpha, "", "");}
2367
2368        if(kGCplotMCPi0OpeningAngle == kTRUE){ histograms->AddHistogram("MC_Pi0_GammaDaughter_OpeningAngle" ,"" , kGCnXBinsOpeningAngle, kGCfirstXBinOpeningAngle, kGClastXBinOpeningAngle, "", "");}
2369       if(kGCplotMCPi0R == kTRUE){ histograms->AddHistogram("MC_Pi0_R" ,"" , kGCnXBinsR, kGCfirstXBinR, kGClastXBinR, "", "");}
2370       if(kGCplotMCPi0ZR == kTRUE){ histograms->AddHistogram("MC_Pi0_ZR" ,"" , kGCnXBinsZR, kGCfirstXBinZR, kGClastXBinZR, kGCnYBinsZR, kGCfirstYBinZR, kGClastYBinZR, "", "");}
2371       if(kGCplotMCPi0XY == kTRUE){ histograms->AddHistogram("MC_Pi0_XY" ,"" , kGCnXBinsXY, kGCfirstXBinXY, kGClastXBinXY, kGCnYBinsXY, kGCfirstYBinXY, kGClastYBinXY, "", "");}
2372       if(kGCplotMCPi0PtvsEtaWithinAcceptance == kTRUE){ histograms->AddHistogram("MC_Pi0_Pt_Eta_withinAcceptance" ,"" , kGCnXBinsPt, kGCfirstXBinPt, kGClastXBinPt, kGCnXBinsEta, kGCfirstXBinEta, kGClastXBinEta, "", "");}
2373       if(kGCplotMCPi0PtvsRapidWithinAcceptance == kTRUE){ histograms->AddHistogram("MC_Pi0_Pt_Rapid_withinAcceptance" ,"" , kGCnXBinsPt, kGCfirstXBinPt, kGClastXBinPt, kGCnXBinsRapid, kGCfirstXBinRapid, kGClastXBinRapid, "", "");}
2374       if(kGCplotMCPi0PtvsEtaConvGammaWithinAcceptance == kTRUE){ histograms->AddHistogram("MC_Pi0_Pt_Eta_ConvGamma_withinAcceptance" ,"" , kGCnXBinsPt, kGCfirstXBinPt, kGClastXBinPt, kGCnXBinsEta, kGCfirstXBinEta, kGClastXBinEta, "", "");}
2375       if(kGCplotMCPi0PtvsRapidConvGammaWithinAcceptance == kTRUE){ histograms->AddHistogram("MC_Pi0_Pt_Rapid_ConvGamma_withinAcceptance" ,"" , kGCnXBinsPt, kGCfirstXBinPt, kGClastXBinPt, kGCnXBinsRapid, kGCfirstXBinRapid, kGClastXBinRapid, "", "");}
2376       if(kGCplotMCPi0ZRConvGammaWithinAcceptance == kTRUE){ histograms->AddHistogram("MC_Pi0_ZR_ConvGamma_withinAcceptance" ,"" , kGCnXBinsZR, kGCfirstXBinZR, kGClastXBinZR, kGCnYBinsZR, kGCfirstYBinZR, kGClastYBinZR, "", "");}
2377                 
2378                 
2379       if(kGCplotMCPi0SecondaryEta == kTRUE){ histograms->AddHistogram("MC_Pi0_Secondaries_Eta" ,"" , kGCnXBinsEta, kGCfirstXBinEta, kGClastXBinEta, "", "");}
2380       if(kGCplotMCPi0SecondaryRapid == kTRUE){ histograms->AddHistogram("MC_Pi0_Secondaries_Rapid" ,"" , kGCnXBinsRapid, kGCfirstXBinRapid, kGClastXBinRapid, "", "");}
2381       if(kGCplotMCPi0SecondaryPhi == kTRUE){ histograms->AddHistogram("MC_Pi0_Secondaries_Phi" ,"" , kGCnXBinsPhi, kGCfirstXBinPhi, kGClastXBinPhi, "", "");}
2382       if(kGCplotMCPi0SecondaryPt == kTRUE){ histograms->AddHistogram("MC_Pi0_Secondaries_Pt" ,"" , kGCnXBinsPt, kGCfirstXBinPt, kGClastXBinPt, "", "");}
2383       if(kGCplotMCPi0SecondaryEnergy == kTRUE){ histograms->AddHistogram("MC_Pi0_Secondaries_Energy" ,"" , kGCnXBinsEnergy, kGCfirstXBinEnergy, kGClastXBinEnergy, "", "");}
2384       if(kGCplotMCPi0SecondaryMass == kTRUE){ histograms->AddHistogram("MC_Pi0_Secondaries_Mass" ,"" , kGCnXBinsPi0Mass, kGCfirstXBinPi0Mass, kGClastXBinPi0Mass, "", "");}
2385       if(kGCplotMCPi0SecondaryOpeningAngle == kTRUE){ histograms->AddHistogram("MC_Pi0_Secondaries_GammaDaughter_OpeningAngle" ,"" , kGCnXBinsOpeningAngle, kGCfirstXBinOpeningAngle, kGClastXBinOpeningAngle, "", "");}
2386       if(kGCplotMCPi0SecondaryR == kTRUE){ histograms->AddHistogram("MC_Pi0_Secondaries_R" ,"" , kGCnXBinsR, kGCfirstXBinR, kGClastXBinR, "", "");}
2387       if(kGCplotMCPi0SecondaryZR == kTRUE){ histograms->AddHistogram("MC_Pi0_Secondaries_ZR" ,"" , kGCnXBinsZR, kGCfirstXBinZR, kGClastXBinZR, kGCnYBinsZR, kGCfirstYBinZR, kGClastYBinZR, "", "");}
2388       if(kGCplotMCPi0SecondaryXY == kTRUE){ histograms->AddHistogram("MC_Pi0_Secondaries_XY" ,"" , kGCnXBinsXY, kGCfirstXBinXY, kGClastXBinXY, kGCnYBinsXY, kGCfirstYBinXY, kGClastYBinXY, "", "");}
2389       if(kGCplotMCPi0SecondaryPtvsEtaWithinAcceptance == kTRUE){ histograms->AddHistogram("MC_Pi0_Secondaries_Pt_Eta_withinAcceptance" ,"" , kGCnXBinsPt, kGCfirstXBinPt, kGClastXBinPt, kGCnXBinsEta, kGCfirstXBinEta, kGClastXBinEta, "", "");}
2390       if(kGCplotMCPi0SecondaryPtvsRapidWithinAcceptance == kTRUE){ histograms->AddHistogram("MC_Pi0_Secondaries_Pt_Rapid_withinAcceptance" ,"" , kGCnXBinsPt, kGCfirstXBinPt, kGClastXBinPt, kGCnXBinsRapid, kGCfirstXBinRapid, kGClastXBinRapid, "", "");}
2391       if(kGCplotMCPi0SecondaryPtvsEtaConvGammaWithinAcceptance == kTRUE){ histograms->AddHistogram("MC_Pi0_Secondaries_Pt_Eta_ConvGamma_withinAcceptance" ,"" , kGCnXBinsPt, kGCfirstXBinPt, kGClastXBinPt, kGCnXBinsEta, kGCfirstXBinEta, kGClastXBinEta, "", "");}
2392       if(kGCplotMCPi0SecondaryPtvsRapidConvGammaWithinAcceptance == kTRUE){ histograms->AddHistogram("MC_Pi0_Secondaries_Pt_Rapid_ConvGamma_withinAcceptance" ,"" , kGCnXBinsPt, kGCfirstXBinPt, kGClastXBinPt, kGCnXBinsRapid, kGCfirstXBinRapid, kGClastXBinRapid, "", "");}
2393                 
2394                 
2395                 
2396       if(kGCplotMCEtaEta == kTRUE){ histograms->AddHistogram("MC_Eta_Eta" ,"" , kGCnXBinsEta, kGCfirstXBinEta, kGClastXBinEta, "", "");}
2397       if(kGCplotMCEtaRapid == kTRUE){ histograms->AddHistogram("MC_Eta_Rapid" ,"" , kGCnXBinsRapid, kGCfirstXBinRapid, kGClastXBinRapid, "", "");}
2398       if(kGCplotMCEtaPtvsRapid == kTRUE){ histograms->AddHistogram("MC_Eta_Pt_vs_Rapid" ,"" , kGCnXBinsPt, kGCfirstXBinPt, kGClastXBinPt, kGCnXBinsRapid, kGCfirstXBinRapid, kGClastXBinRapid, "", "");}
2399       if(kGCplotMCEtaPhi == kTRUE){ histograms->AddHistogram("MC_Eta_Phi" ,"" , kGCnXBinsPhi, kGCfirstXBinPhi, kGClastXBinPhi, "", "");}
2400       if(kGCplotMCEtaPt == kTRUE){ histograms->AddHistogram("MC_Eta_Pt" ,"" , kGCnXBinsPt, kGCfirstXBinPt, kGClastXBinPt, "", "");}
2401       if(kGCplotMCEtaEnergy == kTRUE){ histograms->AddHistogram("MC_Eta_Energy" ,"" , kGCnXBinsEnergy, kGCfirstXBinEnergy, kGClastXBinEnergy, "", "");}
2402       if(kGCplotMCEtaMass == kTRUE){ histograms->AddHistogram("MC_Eta_Mass" ,"" , kGCnXBinsEtaMass, kGCfirstXBinEtaMass, kGClastXBinEtaMass, "", "");}
2403       if(kGCplotMCEtaOpeningAngleGamma == kTRUE){ histograms->AddHistogram("MC_Eta_GammaDaughter_OpeningAngle" ,"" , kGCnXBinsOpeningAngle, kGCfirstXBinOpeningAngle, kGClastXBinOpeningAngle, "", "");}
2404       if(kGCplotMCEtaR == kTRUE){ histograms->AddHistogram("MC_Eta_R" ,"" , kGCnXBinsR, kGCfirstXBinR, kGClastXBinR, "", "");}
2405       if(kGCplotMCEtaZR == kTRUE){ histograms->AddHistogram("MC_Eta_ZR" ,"" , kGCnXBinsZR, kGCfirstXBinZR, kGClastXBinZR, kGCnYBinsZR, kGCfirstYBinZR, kGClastYBinZR, "", "");}
2406       if(kGCplotMCEtaXY == kTRUE){ histograms->AddHistogram("MC_Eta_XY" ,"" , kGCnXBinsXY, kGCfirstXBinXY, kGClastXBinXY, kGCnYBinsXY, kGCfirstYBinXY, kGClastYBinXY, "", "");}
2407       if(kGCplotMCEtaPtvsEtaWithinAcceptance == kTRUE){ histograms->AddHistogram("MC_Eta_Pt_Eta_withinAcceptance" ,"" , kGCnXBinsPt, kGCfirstXBinPt, kGClastXBinPt, kGCnXBinsEta, kGCfirstXBinEta, kGClastXBinEta, "", "");}
2408       if(kGCplotMCEtaPtvsRapidWithinAcceptance == kTRUE){ histograms->AddHistogram("MC_Eta_Pt_Rapid_withinAcceptance" ,"" , kGCnXBinsPt, kGCfirstXBinPt, kGClastXBinPt, kGCnXBinsRapid, kGCfirstXBinRapid, kGClastXBinRapid, "", "");}
2409       if(kGCplotMCEtaPtvsEtaConvGammaWithinAcceptance == kTRUE){ histograms->AddHistogram("MC_Eta_Pt_Eta_ConvGamma_withinAcceptance" ,"" , kGCnXBinsPt, kGCfirstXBinPt, kGClastXBinPt, kGCnXBinsEta, kGCfirstXBinEta, kGClastXBinEta, "", "");}
2410       if(kGCplotMCEtaPtvsRapidConvGammaWithinAcceptance == kTRUE){ histograms->AddHistogram("MC_Eta_Pt_Rapid_ConvGamma_withinAcceptance" ,"" , kGCnXBinsPt, kGCfirstXBinPt, kGClastXBinPt, kGCnXBinsRapid, kGCfirstXBinRapid, kGClastXBinRapid, "", "");}
2411       if(kGCplotMCEtaZRConvGammaWithinAcceptance == kTRUE){ histograms->AddHistogram("MC_Eta_ZR_ConvGamma_withinAcceptance" ,"" , kGCnXBinsZR, kGCfirstXBinZR, kGClastXBinZR, kGCnYBinsZR, kGCfirstYBinZR, kGClastYBinZR, "", "");} 
2412     }
2413     if(kGCplotMCEtaOpeningPtConvGammaWithinAcceptance == kTRUE){ histograms->AddHistogram("MC_Eta_ConvGamma_OpeningAngle_Pt","", kGCnXBinsPt, kGCfirstXBinPt, kGClastXBinPt, kGCnXBinsOpeningAngle, kGCfirstXBinOpeningAngle, kGClastXBinOpeningAngle, "", "");}
2414     if(kGCplotMCEtaPtGammaPtConvGammaWithinAcceptance == kTRUE){ histograms->AddHistogram("MC_Eta_ConvGamma_PtGamma_Pt","", kGCnXBinsPt, kGCfirstXBinPt, kGClastXBinPt, kGCnXBinsPt, kGCfirstXBinPt, kGClastXBinPt, "", "");}
2415   }// end kGCrunNeutralMeson
2416
2417   
2418   //---------------------------------------------------  2 gamma Background -------------------------------------------------------
2419
2420   if(kGCcalculateBackground==kTRUE){
2421     histograms->AddHistogram("ESD_Z_distribution" ,"Z primary vertex" , 2000, -30, 30,"Z[cm]","counts");
2422     histograms->AddHistogram("ESD_multiplicity_distribution" ,"multiplicity distribution" , 200, 0, 200,"counts","Multiplicity");
2423     histograms->AddHistogram("ESD_ZvsMultiplicity" ,"Z vs Multiplicity" , 1000, -10, 10,200,0,200,"Z[cm]","Multiplicity");
2424   }
2425   
2426   if(kGCRecalculateV0ForGamma==kTRUE){
2427     histograms->AddHistogram("ESD_RecalculateV0_InvMass","", kGCnXBinsGammaMass, kGCfirstXBinGammaMass, kGClastXBinGammaMass,"","");
2428     histograms->AddHistogram("ESD_RecalculateV0_Pt","",kGCnXBinsPt, kGCfirstXBinPt, kGClastXBinPt, "", "");
2429     histograms->AddHistogram("ESD_RecalculateV0_E_dEdxP","",kGCnXBinsP, kGCfirstXBinP, kGClastXBinP,kGCnYBinsdEdx, kGCfirstYBindEdx, kGClastYBindEdx,"", "",0);
2430     histograms->AddHistogram("ESD_RecalculateV0_P_dEdxP","",kGCnXBinsP, kGCfirstXBinP, kGClastXBinP,kGCnYBinsdEdx, kGCfirstYBindEdx, kGClastYBindEdx,"", "",0);
2431     histograms->AddHistogram("ESD_RecalculateV0_cpa","",1000,-1.,1.,"","");
2432     histograms->AddHistogram("ESD_RecalculateV0_dca","",100,0.,10.,"","");
2433     histograms->AddHistogram("ESD_RecalculateV0_Rr","",250,0.,250.,"","");
2434     histograms->AddHistogram("ESD_RecalculateV0_normdistP","",250,0.,250.,"","");
2435     histograms->AddHistogram("ESD_RecalculateV0_normdistN","",250,0.,250.,"","");
2436
2437     histograms->AddHistogram("ESD_RecalculateGG_InvMass","",kGCnXBinsSpectra,kGCfirstXBinSpectra, kGClastXBinSpectra,"InvMass [GeV]","Counts");
2438     histograms->AddHistogram("ESD_RecalculateGG_InvMass_vs_Pt","", kGCnXBinsSpectra, kGCfirstXBinSpectra, kGClastXBinSpectra,kGCnYBinsSpectra, kGCfirstYBinSpectra, kGClastYBinSpectra,"InvMass [GeV]","Pt [GeV]");             
2439
2440   }
2441   
2442
2443 }
2444
2445
2446
2447 Int_t SetAnalysisCutSelection(TString analysisCutSelection){
2448   Int_t iResult=0;
2449   
2450   // set the cuts depending on the Cut Selection Id
2451   // first number is dummy always set to 9 
2452   //  const char* cutSelection = analysisCutSelection.Data(); 
2453   if(analysisCutSelection.Length()!=c_array_size){
2454     cout<<"Cut selection has the wrong length!"<<endl;
2455     return 0;
2456   }
2457
2458   char cutSelection[] = analysisCutSelection.Data();
2459   int array[c_array_size];
2460   const int N = sizeof(array) / sizeof(int);
2461   string2array( cutSelection, array );
2462
2463
2464
2465   Int_t goodId=array[0];
2466   Int_t v0FinderType=array[1];
2467   Int_t eProbCut=array[2];
2468   Int_t ededxSigmaCut=array[3];
2469   Int_t pidedxSigmaCut=array[4];
2470   Int_t piMomdedxSigmaCut=array[5];
2471   Int_t chi2GammaCut=array[6];
2472   Int_t singlePtCut=array[7];
2473   Int_t clsTPCCut=array[8];
2474   Int_t etaCut=array[9];
2475   Int_t chi2MesonCut=array[10];
2476   Int_t LowPRejectionSigmaCut=array[11];
2477   Int_t QtMaxCut=array[12];
2478   Int_t piMaxMomdedxSigmaCut=array[13];
2479   Int_t alphaMesonCut=array[14];
2480   Int_t minRCut=array[15];
2481   Int_t RapidityMesonCut=array[16];
2482   Int_t BackgroundScheme=array[17];
2483   Int_t DegreesForRotationMethod=array[18];
2484   Int_t NumberOfRotations=array[19];
2485   Int_t removePileUp=array[20];
2486   Int_t selectV0AND=array[21];
2487   Int_t multiplicityBin=array[22];
2488   Int_t isHeavyIon=array[23];
2489   Int_t useCentrality=array[24];
2490   Int_t centralityBin=array[25];
2491
2492   cout<<"CentralityBin::"<< centralityBin <<endl;
2493   cout<<"Use Centrality::"<< useCentrality <<endl;
2494   cout<<"Heavy Ion::"<< isHeavyIon<<endl;
2495   cout<<"Multiplicity Bin::"<< multiplicityBin<<endl;
2496   cout<<"Select V0AND::"<< selectV0AND<<endl;
2497   cout<<"Remove PileUp::"<< removePileUp<<endl;
2498   cout<<"NumberOfRotations::"<<NumberOfRotations<<endl;
2499   cout<<"DegreesForRotationMethod::"<<DegreesForRotationMethod<<endl;
2500   cout<<"BackgroundScheme::"<<BackgroundScheme<<endl;
2501   cout<<"RapidityMesonCut::"<<RapidityMesonCut<<endl;   
2502   cout<<"minRCut::"<<minRCut<<endl;
2503   cout<<"alphaMesonCut::"<<alphaMesonCut<<endl; 
2504   cout<<"piMaxMomdedxSigmaCut::"<<piMaxMomdedxSigmaCut<<endl;
2505   cout<<"QtMaxCut:"<<QtMaxCut<<endl;
2506   cout<<"LowPRejectionSigmaCut:"<<LowPRejectionSigmaCut<<endl;
2507   cout<<"chi2MesonCut: "<< chi2MesonCut<<endl;
2508   cout<<"etaCut: "<<etaCut<<endl;
2509   cout<<"clsTPCCut: "<<clsTPCCut<<endl;
2510   cout<<"singlePtCut: "<<singlePtCut<<endl;
2511   cout<<"chi2GammaCut: "<<chi2GammaCut<<endl;
2512   cout<<"piMomdedxSigmaCut: "<<piMomdedxSigmaCut<<endl;
2513   cout<<"pidedxSigmaCut: "<<pidedxSigmaCut <<endl;
2514   cout<<"ededxSigmaCut: "<<ededxSigmaCut <<endl;
2515   cout<<"eProbCut: "<< eProbCut<<endl;
2516   cout<<"v0FinderType: "<<v0FinderType <<endl;
2517   cout<<"goodId: "<<goodId <<endl;
2518
2519   if(goodId !=9){
2520     cout<<"Analysis Cut Selection too short or does not start with 9"<<endl;
2521     return iResult;
2522   }
2523
2524   switch (v0FinderType){
2525   case 0:  // on fly V0 finder
2526     kGCUseOnFlyV0Finder=kTRUE;
2527     break;
2528   case 1:  // offline V0 finder
2529     kGCUseOnFlyV0Finder=kFALSE;
2530     break;
2531   default:
2532     return iResult;
2533   }
2534
2535   switch(eProbCut){
2536   case 0:
2537     kGCprobElectron=0;
2538     break;
2539   case 1:
2540     kGCprobElectron=0.1;
2541     break;
2542   case 2:
2543     kGCprobElectron=0.5;
2544     break;
2545   case 3:
2546     kGCprobElectron=0.7;
2547     break;
2548   default:
2549     return iResult;
2550   }
2551
2552   switch(ededxSigmaCut){
2553   case 0: // -10,10
2554     kGCPIDnSigmaBelowElectronLine=-10;
2555     kGCPIDnSigmaAboveElectronLine=10;
2556     break;
2557   case 1: // -5,5 
2558     kGCPIDnSigmaBelowElectronLine=-5;
2559     kGCPIDnSigmaAboveElectronLine=5;
2560     break;
2561   case 2: // -3,5
2562     kGCPIDnSigmaBelowElectronLine=-3;
2563     kGCPIDnSigmaAboveElectronLine=5;
2564     break;
2565   case 3: // -4,5
2566     kGCPIDnSigmaBelowElectronLine=-4;
2567     kGCPIDnSigmaAboveElectronLine=5;
2568     break;
2569   default:
2570     return iResult;
2571   }
2572   
2573   switch(pidedxSigmaCut){
2574   case 0:  // -10
2575     kGCPIDnSigmaAbovePionLine=-10;
2576     break;
2577   case 1:   // 0
2578     kGCPIDnSigmaAbovePionLine=0;
2579     break;
2580   case 2:  // 1
2581     kGCPIDnSigmaAbovePionLine=1;
2582     break;
2583   case 3:  // 1
2584     kGCPIDnSigmaAbovePionLine=-1;
2585     break;
2586   case 4:  // 1
2587     kGCPIDnSigmaAbovePionLine=-1.5;
2588     break;
2589   case 5:  // 1
2590     kGCPIDnSigmaAbovePionLine=2.;
2591     break;
2592
2593   default:
2594     return iResult;
2595   }
2596   
2597   switch(piMomdedxSigmaCut){
2598   case 0:  // 0.5 GeV
2599     kGCPIDMinPnSigmaAbovePionLine=0.5;
2600     break;
2601   case 1:  // 1. GeV
2602     kGCPIDMinPnSigmaAbovePionLine=1.;
2603     break;
2604   case 2:  // 1.5 GeV
2605     kGCPIDMinPnSigmaAbovePionLine=1.5;
2606     break;
2607   case 3:  // 20.0 GeV
2608     kGCPIDMinPnSigmaAbovePionLine=20.;
2609     break;
2610   case 4:  // 50.0 GeV
2611     kGCPIDMinPnSigmaAbovePionLine=50.;
2612     break;
2613   case 5:  // 0.3 GeV
2614     kGCPIDMinPnSigmaAbovePionLine=0.3;
2615     break;
2616   case 6:  // 0.3 GeV
2617     kGCPIDMinPnSigmaAbovePionLine=0.25;
2618     break;
2619   case 7:  // 0.4 GeV
2620     kGCPIDMinPnSigmaAbovePionLine=0.4;
2621     break;
2622   default:
2623     return iResult;
2624   }
2625   
2626   switch(chi2GammaCut){
2627   case 0: // 100
2628     kGCchi2CutConversion = 100.;
2629     break;
2630   case 1:  // 50
2631     kGCchi2CutConversion = 50.;
2632     break;
2633   case 2:  // 30
2634     kGCchi2CutConversion = 30.;
2635     break;
2636   case 3:
2637     kGCchi2CutConversion = 200.;
2638     break;
2639   case 4:
2640     kGCchi2CutConversion = 500.;
2641     break;
2642   case 5:
2643     kGCchi2CutConversion = 1000.;
2644     break;
2645   case 6:
2646     kGCchi2CutConversion = 5.;
2647     break;
2648   case 7:
2649     kGCchi2CutConversion = 10.;
2650     break;
2651   case 8:
2652     kGCchi2CutConversion = 20.;
2653     break;
2654   case 9:
2655     kGCchi2CutConversion = 15.;
2656     break;
2657   default:
2658     return iResult;
2659   }
2660
2661   switch(singlePtCut){
2662   case 0: // 0.050 GeV
2663     kGCsingleptCut = 0.050;
2664     break;
2665   case 1:  // 0.100 GeV
2666     kGCsingleptCut = 0.100;
2667     break;
2668   case 2:  // 0.150 GeV
2669     kGCsingleptCut = 0.150;
2670     break;
2671   case 3:  // 0.200 GeV
2672     kGCsingleptCut = 0.200;
2673     break;
2674   case 4:  // 0.075 GeV
2675     kGCsingleptCut = 0.075;
2676     break;
2677   case 5:  // 0.125 GeV
2678     kGCsingleptCut = 0.125;
2679     break;
2680   default:
2681     return iResult;
2682  }
2683
2684   switch(clsTPCCut){
2685   case 0: // 0 
2686     kGCminClsTPCCut= 0.;
2687     break;
2688   case 1:  // 70 
2689     kGCminClsTPCCut= 70.;
2690     break;
2691   case 2:  // 80 
2692     kGCminClsTPCCut= 80.;
2693     break;
2694   case 3:  // 100 
2695     kGCminClsTPCCut= 100.;
2696     break;
2697   case 4:  // 60% of findable clusters
2698     kGCminClsTPCCutToF= 0.6;
2699     break;
2700   case 5:  // 0% of findable clusters
2701     kGCminClsTPCCutToF= 0.0;
2702     break;
2703   case 6:  // 0% of findable clusters
2704     kGCminClsTPCCutToF= 0.7;
2705     break;
2706   case 7:  // 0% of findable clusters
2707     kGCminClsTPCCutToF= 0.35;
2708     break;
2709
2710   default:
2711     return iResult;
2712   }
2713
2714   switch(etaCut){
2715   case 0: // 0.9 
2716     kGCetaCut    = 0.9;
2717     kGCLineCutZRSlope = tan(2*atan(exp(-kGCetaCut)));
2718     break;
2719   case 1:  // 1.2
2720     kGCetaCut    = 1.2;
2721     kGCLineCutZRSlope = tan(2*atan(exp(-kGCetaCut)));
2722     break;
2723   case 2:  // 1.4
2724     kGCetaCut    = 1.4;
2725     kGCLineCutZRSlope = tan(2*atan(exp(-kGCetaCut)));
2726     break;
2727   default:
2728     return iResult;
2729   }
2730
2731   switch(chi2MesonCut){
2732   case 0:  // 100.
2733     kGCchi2CutMeson = 100.;
2734     break;
2735   case 1:  // 50.
2736     kGCchi2CutMeson = 50.;
2737     break;
2738   case 2:  // 30.
2739     kGCchi2CutMeson = 30.;
2740     break;
2741   case 3:
2742     kGCchi2CutMeson = 200.;
2743     break;
2744   case 4:
2745     kGCchi2CutMeson = 500.;
2746     break;
2747   case 5:
2748     kGCchi2CutMeson = 1000.;
2749     break;
2750   default:
2751     return iResult;
2752   }
2753
2754
2755   switch(LowPRejectionSigmaCut){
2756   case 0:  // 
2757     kGCPIDnSigmaAtLowPAroundKaonLine=0;
2758     kGCPIDnSigmaAtLowPAroundProtonLine=0;
2759     kGCPIDnSigmaAtLowPAroundPionLine=0;
2760     break;
2761   case 1:  // 
2762     kGCPIDnSigmaAtLowPAroundKaonLine=0.5;
2763     kGCPIDnSigmaAtLowPAroundProtonLine=0.5;
2764     kGCPIDnSigmaAtLowPAroundPionLine=0.5;
2765     break;
2766   case 2:  // 
2767     kGCPIDnSigmaAtLowPAroundKaonLine=1;
2768     kGCPIDnSigmaAtLowPAroundProtonLine=1;
2769     kGCPIDnSigmaAtLowPAroundPionLine=1;
2770     break;
2771   case 3:  // 
2772     kGCPIDnSigmaAtLowPAroundKaonLine=2.;
2773     kGCPIDnSigmaAtLowPAroundProtonLine=2.;
2774     kGCPIDnSigmaAtLowPAroundPionLine=2.;
2775     break;
2776   case 4:  // 
2777     kGCPIDnSigmaAtLowPAroundKaonLine=0.;
2778     kGCPIDnSigmaAtLowPAroundProtonLine=0.;
2779     kGCPIDnSigmaAtLowPAroundPionLine=1;
2780     break;
2781   case 5:  // 
2782     kGCPIDnSigmaAtLowPAroundKaonLine=0.;
2783     kGCPIDnSigmaAtLowPAroundProtonLine=0.;
2784     kGCPIDnSigmaAtLowPAroundPionLine=1.5;
2785     break;
2786   case 6:  // 
2787     kGCPIDnSigmaAtLowPAroundKaonLine=0.;
2788     kGCPIDnSigmaAtLowPAroundProtonLine=0.;
2789     kGCPIDnSigmaAtLowPAroundPionLine=2.;
2790     break;
2791
2792   default:
2793     return iResult;
2794   }
2795   switch(QtMaxCut){
2796   case 0: //
2797     kGCQtMax=1.;
2798     break;
2799   case 1:
2800     kGCQtMax=0.1;
2801     break;
2802   case 2:
2803     kGCQtMax=0.07;
2804     break;
2805   case 3:
2806     kGCQtMax=0.05;
2807     break;
2808   case 4:
2809     kGCQtMax=0.03;
2810     break;
2811   default:
2812     return iResult;
2813   }
2814
2815   switch(piMaxMomdedxSigmaCut){
2816   case 0:  // 100. GeV
2817     kGCPIDMaxPnSigmaAbovePionLine=100.;
2818     break;
2819   case 1:  // 5. GeV
2820     kGCPIDMaxPnSigmaAbovePionLine=5.;
2821     break;
2822   case 2:  // 4. GeV
2823     kGCPIDMaxPnSigmaAbovePionLine=4.;
2824     break;
2825   case 3:  // 3.5 GeV
2826     kGCPIDMaxPnSigmaAbovePionLine=3.5;
2827     break;
2828   case 4:  // 3. GeV
2829     kGCPIDMaxPnSigmaAbovePionLine=3.;
2830     break;
2831   default:
2832     return iResult;
2833   }
2834
2835         
2836   switch(alphaMesonCut){
2837   case 0:  // 0- 0.7
2838     kGCalphaMinCutMeson   = 0.0;
2839     kGCalphaCutMeson   = 0.7;
2840     break;
2841   case 1:  // 0-0.5
2842     kGCalphaMinCutMeson   = 0.0;
2843     kGCalphaCutMeson   = 0.5;
2844     break;
2845   case 2:  // 0.5-1 
2846     kGCalphaMinCutMeson   = 0.5;
2847     kGCalphaCutMeson   = 1.;
2848     break;
2849   case 3:  // 0.0-1 
2850     kGCalphaMinCutMeson   = 0.0;
2851     kGCalphaCutMeson   = 1.;
2852     break;
2853   default:
2854     return iResult;
2855   }
2856   
2857   switch(minRCut){
2858   case 0:
2859     kGCminRCut=0;
2860     kGCmaxRCut = 180.;
2861     break;
2862   case 1:
2863     kGCminRCut=2.8;
2864     kGCmaxRCut = 180.;
2865     break;
2866   case 2:
2867     kGCminRCut=5.;
2868     kGCmaxRCut = 180.;
2869     break;
2870   case 3:
2871     kGCmaxRCut = 70.;
2872     kGCminRCut = 10.;
2873     break;
2874   case 4:
2875     kGCmaxRCut = 70.;
2876     kGCminRCut = 5.;
2877     break;
2878   case 5:
2879     kGCmaxRCut = 180.;
2880     kGCminRCut = 10.;
2881     break;
2882     
2883   default:
2884     return iResult;
2885   }
2886
2887   switch(RapidityMesonCut){
2888   case 0:  //
2889     kGCrapidityCutMeson   = 0.9;
2890     break;
2891   case 1:  // 
2892     kGCrapidityCutMeson   = 0.8;
2893     break;
2894   case 2:  // 
2895     kGCrapidityCutMeson   = 0.7;
2896     break;
2897     
2898   default:
2899     return iResult;
2900   }
2901
2902   switch(BackgroundScheme){
2903   case 0: //Rotation
2904     kGCUseRotationMethodInBG=kTRUE;
2905     break;
2906   case 1: // mixed event
2907     kGCUseRotationMethodInBG=kFALSE;
2908     break;
2909
2910   default:
2911     return iResult;
2912   }
2913   
2914   switch(DegreesForRotationMethod){
2915   case 0:
2916     kGCnDegreeRotationPMForBG = 5;
2917     break;
2918   case 1:
2919     kGCnDegreeRotationPMForBG = 10;
2920     break;
2921   case 2:
2922     kGCnDegreeRotationPMForBG = 15;
2923     break;
2924   case 3:
2925     kGCnDegreeRotationPMForBG = 20;
2926     break;
2927
2928   default:
2929     return iResult;
2930   }
2931
2932   switch(NumberOfRotations){
2933   case 0:
2934     kGCnumberOfRotationEventsForBG = 5;
2935     break;
2936   case 1:
2937     kGCnumberOfRotationEventsForBG = 10;
2938     break;
2939   case 2:
2940     kGCnumberOfRotationEventsForBG = 15;
2941     break;
2942   case 3:
2943     kGCnumberOfRotationEventsForBG = 20;
2944     break;
2945   case 4:
2946     kGCnumberOfRotationEventsForBG = 2;
2947     break;
2948
2949   default:
2950     return iResult;
2951   }
2952
2953   switch(removePileUp){
2954   case 0:
2955     kGCRemovePileUp=kFALSE;
2956     break;
2957   case 1:
2958     kGCRemovePileUp=kTRUE;
2959     break;
2960   default:
2961     return iResult;
2962   }
2963
2964   switch(selectV0AND){
2965   case 0:
2966     kGCSelectV0AND=kFALSE;
2967     break;
2968   case 1:
2969     kGCSelectV0AND=kTRUE;
2970     break;
2971   default:
2972     return iResult;
2973   }
2974
2975   switch(multiplicityBin){
2976   case 0:
2977     kGCUseMultiplicity=kFALSE;
2978     kGCUseMultiplicityBin=0;
2979     break;
2980   case 1:
2981     kGCUseMultiplicity=kTRUE;
2982     kGCUseMultiplicityBin=1;
2983      break;
2984   case 2:
2985     kGCUseMultiplicity=kTRUE;
2986     kGCUseMultiplicityBin=2;
2987      break;
2988   case 3:
2989     kGCUseMultiplicity=kTRUE;
2990     kGCUseMultiplicityBin=3;
2991      break;
2992   case 4:
2993     kGCUseMultiplicity=kTRUE;
2994     kGCUseMultiplicityBin=4;
2995      break;
2996   case 5:
2997     kGCUseMultiplicity=kTRUE;
2998     kGCUseMultiplicityBin=5;
2999      break;
3000   default:
3001     return iResult;
3002   }
3003
3004   switch(isHeavyIon){
3005   case 0:
3006     kGCIsHeavyIon=0;
3007     break;
3008   case 1:
3009     kGCIsHeavyIon=1;
3010     break;
3011    default:
3012     return iResult;
3013   }
3014
3015   switch(useCentrality){
3016   case 0:
3017     kGCUseCentrality=0;
3018     break;
3019   case 1:
3020     kGCUseCentrality=1;//    GetCentralityClass10("V0M")
3021     break;
3022   case 2:
3023     kGCUseCentrality=2; //    GetCentralityClass10("CL1")
3024     break;
3025    default:
3026     return iResult;
3027   }
3028
3029   switch(centralityBin){
3030   case 0:
3031     kGCUseCentralityBin=0;
3032     break;
3033   case 1:
3034     kGCUseCentralityBin=1;
3035     break;
3036   case 2:
3037     kGCUseCentralityBin=2;
3038     break;
3039   case 3:
3040     kGCUseCentralityBin=3;
3041     break;
3042   case 4:
3043     kGCUseCentralityBin=4;
3044     break;
3045   case 5:
3046     kGCUseCentralityBin=5;
3047     break;
3048   case 6:
3049     kGCUseCentralityBin=6;
3050     break;
3051   case 7:
3052     kGCUseCentralityBin=7;
3053     break;
3054   case 8:
3055     kGCUseCentralityBin=8;
3056     break;
3057   case 9:
3058     kGCUseCentralityBin=9;
3059     break;
3060    default:
3061     return iResult;
3062   }
3063   iResult=1;
3064   return iResult;
3065
3066
3067 }
3068
3069
3070 void string2array(const std::string& number, int a[c_array_size]) 
3071 {
3072     if (number.size() == c_array_size) {
3073 #define ASSIGNARRAY(i)  a[i] = number[i] - '0'
3074         ASSIGNARRAY(0);
3075         ASSIGNARRAY(1);
3076         ASSIGNARRAY(2);
3077         ASSIGNARRAY(3);
3078         ASSIGNARRAY(4);
3079         ASSIGNARRAY(5);
3080         ASSIGNARRAY(6);
3081         ASSIGNARRAY(7);
3082         ASSIGNARRAY(8);
3083         ASSIGNARRAY(9);
3084         ASSIGNARRAY(10);
3085         ASSIGNARRAY(11);
3086         ASSIGNARRAY(12);
3087         ASSIGNARRAY(13);
3088         ASSIGNARRAY(14);
3089         ASSIGNARRAY(15);
3090         ASSIGNARRAY(16);
3091         ASSIGNARRAY(17);
3092         ASSIGNARRAY(18);
3093         ASSIGNARRAY(19);
3094         ASSIGNARRAY(20);
3095         ASSIGNARRAY(21);
3096         ASSIGNARRAY(22);
3097         ASSIGNARRAY(23);
3098         ASSIGNARRAY(24);
3099         ASSIGNARRAY(25);
3100   }
3101 }
3102
3103
3104
3105