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