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