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