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