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