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