coding violations corrected
[u/mrichter/AliRoot.git] / PWG4 / macros / ConfigGammaConversion.C
1 \r
2 /** ------------------------------ Monte Carlo flag -----------------------------------------*/\r
3 Bool_t doMCTruth = kTRUE;\r
4 /** ---------------------------- end Monte Carlo flag ---------------------------------------*/\r
5 \r
6 /** ------------------------- Choose KFParticle OR ESDTrack  --------------------------------*/\r
7 Bool_t useKFParticle = kTRUE;\r
8 Bool_t useESDTrack   = kFALSE;\r
9 /** ----------------------- end Choose KFParticle OR ESDTrack  -----------------------------*/\r
10 \r
11 \r
12 Bool_t calculateBackground = kTRUE;\r
13 \r
14 /** ---------------------------------- define cuts here ------------------------------------*/\r
15 \r
16 Int_t pidOfNegativeTrack=11;\r
17 Int_t pidOfPositiveTrack=-11;\r
18 \r
19 Double_t maxRCut   = 200.;\r
20 Double_t etaCut    = 1.2;\r
21 Double_t ptCut     = 0.1;\r
22 Double_t chi2Cut   = 20.;\r
23 \r
24 Double_t xVertexCut = 0.;\r
25 Double_t yVertexCut = 0.;\r
26 Double_t zVertexCut = 0.;\r
27 \r
28 Double_t sigmaCutGammaMass=0.0001;\r
29 \r
30 Bool_t useImprovedVertex = kTRUE;\r
31 \r
32 // define masses of different particles, this will be used by the KF particle\r
33 // together with the width to set mass constraints. Units in GeV.\r
34 Double_t electronMass = 0.00051099892;\r
35 Double_t gammaMass    = 0.;\r
36 Double_t pi0Mass      = 0.1349766;\r
37 Double_t etaMass      = 0.54751;\r
38 \r
39 // define the width constraint used by KF particle.\r
40 Double_t gammaWidth = 0.01;\r
41 Double_t pi0Width   = 0.01;\r
42 Double_t etaWidth   = 0.01;\r
43 \r
44 // define the probability of track being an electron\r
45 Double_t probElectron = 0.5;\r
46 \r
47 /** ----------------------------------end define cuts here----------------------------------*/\r
48 \r
49 /** -------------------------------- Phi/R Mapping ---------------------------------------*/\r
50 Int_t nPhiIndex = 18;\r
51 Int_t nRIndex   = 40;\r
52 \r
53 Double_t minRadius   = 0.;\r
54 Double_t maxRadius   = 200.;\r
55 Double_t minPhi      = -TMath::Pi();\r
56 Double_t maxPhi      = TMath::Pi();\r
57 /** ------------------------------- end Phi/R Mapping ------------------------------------*/\r
58 \r
59 /** ------------------- define which histograms to plot here --------------------------------*/\r
60 /**   NB: to change the bin numbers, see below the histogram flags                           */\r
61 Bool_t plotMCEPR                             = kTRUE;\r
62 Bool_t plotMCEPZR                           = kTRUE;\r
63 Bool_t plotMCEPXY                           = kTRUE;\r
64 Bool_t plotMCEPOpeningAngle                  = kTRUE;\r
65 \r
66 Bool_t plotMCEEnergy                         = kTRUE;\r
67 Bool_t plotMCEPt                             = kTRUE;\r
68 Bool_t plotMCEEta                            = kTRUE;\r
69 Bool_t plotMCEPhi                            = kTRUE;\r
70 \r
71 Bool_t plotMCPEnergy                         = kTRUE;\r
72 Bool_t plotMCPPt                             = kTRUE;\r
73 Bool_t plotMCPEta                            = kTRUE;\r
74 Bool_t plotMCPPhi                            = kTRUE;\r
75 \r
76 Bool_t plotMCGammaEnergy                     = kTRUE;\r
77 Bool_t plotMCGammaPt                         = kTRUE;\r
78 Bool_t plotMCGammaEta                        = kTRUE;\r
79 Bool_t plotMCGammaPhi                        = kTRUE;\r
80 \r
81 Bool_t plotMCDirectGammaEnergy               = kTRUE;\r
82 Bool_t plotMCDirectGammaPt                   = kTRUE;\r
83 Bool_t plotMCDirectGammaEta                  = kTRUE;\r
84 Bool_t plotMCDirectGammaPhi                  = kTRUE;\r
85 \r
86 Bool_t plotMCMatchGammaEta                  = kTRUE;\r
87 Bool_t plotMCMatchGammaPhi                  = kTRUE;\r
88 Bool_t plotMCMatchGammaPt                   = kTRUE;\r
89 Bool_t plotMCMatchGammaEnergy               = kTRUE;\r
90 Bool_t plotMCMatchGammaMass                 = kTRUE;\r
91 Bool_t plotMCMatchGammaOpeningAngle         = kTRUE;\r
92 Bool_t plotMCMatchGammaR                    = kTRUE;\r
93 Bool_t plotMCMatchGammaZR                  = kTRUE;\r
94 Bool_t plotMCMatchGammaXY                  = kTRUE;\r
95 \r
96 Bool_t plotMCPi0Eta                          = kTRUE;\r
97 Bool_t plotMCPi0Phi                          = kTRUE;\r
98 Bool_t plotMCPi0Pt                           = kTRUE;\r
99 Bool_t plotMCPi0Energy                       = kTRUE;\r
100 Bool_t plotMCPi0Mass                         = kTRUE;\r
101 Bool_t plotMCPi0OpeningAngle                 = kTRUE;\r
102 Bool_t plotMCPi0R                            = kTRUE;\r
103 Bool_t plotMCPi0ZR                          = kTRUE;\r
104 Bool_t plotMCPi0XY                          = kTRUE;\r
105 \r
106 Bool_t plotMCEtaEta                          = kTRUE;\r
107 Bool_t plotMCEtaPhi                          = kTRUE;\r
108 Bool_t plotMCEtaPt                           = kTRUE;\r
109 Bool_t plotMCEtaEnergy                       = kTRUE;\r
110 Bool_t plotMCEtaMass                         = kTRUE;\r
111 Bool_t plotMCEtaOpeningAngleGamma            = kTRUE;\r
112 Bool_t plotMCEtaR                            = kTRUE;\r
113 Bool_t plotMCEtaZR                          = kTRUE;\r
114 Bool_t plotMCEtaXY                          = kTRUE;\r
115     \r
116 // Histograms from esd tracks\r
117 Bool_t plotESDEPR                            = kTRUE;\r
118 Bool_t plotESDEPZR                          = kTRUE;\r
119 Bool_t plotESDEPXY                          = kTRUE;\r
120 Bool_t plotESDEPOpeningAngle                 = kTRUE;\r
121 \r
122 Bool_t plotESDEEnergy                        = kTRUE;\r
123 Bool_t plotESDEPt                            = kTRUE;\r
124 Bool_t plotESDEEta                           = kTRUE;\r
125 Bool_t plotESDEPhi                           = kTRUE;\r
126 \r
127 Bool_t plotESDPEnergy                        = kTRUE;\r
128 Bool_t plotESDPPt                            = kTRUE;\r
129 Bool_t plotESDPEta                           = kTRUE;\r
130 Bool_t plotESDPPhi                           = kTRUE;\r
131 \r
132 \r
133 Bool_t plotESDGammaEnergy                    = kTRUE;\r
134 Bool_t plotESDGammaPt                        = kTRUE;\r
135 Bool_t plotESDGammaEta                       = kTRUE;\r
136 Bool_t plotESDGammaPhi                       = kTRUE;\r
137 \r
138 Bool_t plotESDMatchGammaOpeningAngle        = kTRUE;\r
139 Bool_t plotESDMatchGammaEnergy              = kTRUE;\r
140 Bool_t plotESDMatchGammaPt                  = kTRUE;\r
141 Bool_t plotESDMatchGammaEta                 = kTRUE;\r
142 Bool_t plotESDMatchGammaPhi                 = kTRUE;\r
143 Bool_t plotESDMatchGammaMass                = kTRUE;\r
144 Bool_t plotESDMatchGammaWidth               = kTRUE;\r
145 Bool_t plotESDMatchGammaChi2                = kTRUE;\r
146 Bool_t plotESDMatchGammaNDF                 = kTRUE;\r
147 Bool_t plotESDMatchGammaR                   = kTRUE;\r
148 Bool_t plotESDMatchGammaZR                 = kTRUE;\r
149 Bool_t plotESDMatchGammaXY                 = kTRUE;\r
150 \r
151 Bool_t plotESDTwoGammaCombinationOpeningAngleGamma         = kTRUE;\r
152 Bool_t plotESDTwoGammaCombinationEnergy    = kTRUE;\r
153 Bool_t plotESDTwoGammaCombinationPt        = kTRUE;\r
154 Bool_t plotESDTwoGammaCombinationEta       = kTRUE;\r
155 Bool_t plotESDTwoGammaCombinationPhi       = kTRUE;\r
156 Bool_t plotESDTwoGammaCombinationMass      = kTRUE;\r
157 Bool_t plotESDTwoGammaCombinationR         = kTRUE;\r
158 Bool_t plotESDTwoGammaCombinationZR        = kTRUE;\r
159 Bool_t plotESDTwoGammaCombinationXY        = kTRUE;\r
160 \r
161 Bool_t plotESDBackgroundOpeningAngleGamma    = kTRUE;\r
162 Bool_t plotESDBackgroundEnergy               = kTRUE;\r
163 Bool_t plotESDBackgroundPt                   = kTRUE;\r
164 Bool_t plotESDBackgroundEta                  = kTRUE;\r
165 Bool_t plotESDBackgroundPhi                  = kTRUE;\r
166 Bool_t plotESDBackgroundMass                 = kTRUE;\r
167 Bool_t plotESDBackgroundR                    = kTRUE;\r
168 Bool_t plotESDBackgroundZR                  = kTRUE;\r
169 Bool_t plotESDBackgroundXY                  = kTRUE;\r
170 \r
171 Bool_t plotMapping                             = kTRUE;       \r
172 \r
173 Bool_t plotResolutiondPt                      = kTRUE;\r
174 Bool_t plotResolutiondR                       = kTRUE;\r
175 Bool_t plotResolutiondZ                       = kTRUE;\r
176   \r
177 Bool_t plotResolutiondRdPt                   = kTRUE;\r
178 \r
179 Bool_t plotResolutionMCPt                    = kTRUE;\r
180 Bool_t plotResolutionMCR                     = kTRUE;\r
181 Bool_t plotResolutionMCZ                     = kTRUE;\r
182 \r
183 Bool_t plotResolutionESDPt                   = kTRUE;\r
184 Bool_t plotResolutionESDR                    = kTRUE;\r
185 Bool_t plotResolutionESDZ                    = kTRUE;\r
186 \r
187 Bool_t plotNumberOfV0s                         = kTRUE;\r
188 Bool_t plotNumberOfSurvivingV0s                = kTRUE;\r
189 \r
190   //  debug histograms\r
191 Bool_t plotV0MassDebugCut1                     = kTRUE;\r
192 Bool_t plotV0MassDebugCut2                     = kTRUE;\r
193 Bool_t plotV0MassDebugCut3                     = kTRUE;\r
194 Bool_t plotV0MassDebugCut4                     = kTRUE;\r
195 Bool_t plotV0MassDebugCut5                     = kTRUE;\r
196 Bool_t plotV0MassDebugCut6                     = kTRUE;\r
197 Bool_t plotV0MassDebugCut7                     = kTRUE;\r
198 Bool_t plotV0MassDebugCut8                     = kTRUE;\r
199 \r
200 Bool_t plotPi0Spectra                          = kTRUE;\r
201 Bool_t plotEtaSpectra                          = kTRUE;\r
202 \r
203 \r
204 /** ----------------- end define which histograms to plot here -------------------------------*/\r
205 \r
206 \r
207 \r
208 /** ----------- Define the binning for the different plot types here -------------------------*/\r
209 //R-plots\r
210 Int_t nXBinsR = 1000;\r
211 Double_t firstXBinR = 0.;\r
212 Double_t lastXBinR = 250.;\r
213 \r
214 //ZR-plots\r
215 Int_t nXBinsZR = 2000;\r
216 Double_t firstXBinZR = -10.;\r
217 Double_t lastXBinZR = 10.;\r
218 Int_t nYBinsZR = 1000;\r
219 Double_t firstYBinZR = 0.;\r
220 Double_t lastYBinZR = 250.;\r
221 \r
222 //XY-plots\r
223 Int_t nXBinsXY = 2000;\r
224 Double_t firstXBinXY = -250.;\r
225 Double_t lastXBinXY = 250.;\r
226 Int_t nYBinsXY = 2000;\r
227 Double_t firstYBinXY = -250.;\r
228 Double_t lastYBinXY = 250.;\r
229 \r
230 //OpenAngle-plots\r
231 Int_t nXBinsOpeningAngle = 200;\r
232 Double_t firstXBinOpeningAngle = 0.;\r
233 Double_t lastXBinOpeningAngle = TMath::Pi()/2;\r
234 \r
235 //Energy-plots\r
236 Int_t nXBinsEnergy = 500;\r
237 Double_t firstXBinEnergy = 0.;\r
238 Double_t lastXBinEnergy = 5.;\r
239 \r
240 //Pt-plots\r
241 Int_t nXBinsPt = 500;\r
242 Double_t firstXBinPt = 0.;\r
243 Double_t lastXBinPt = 5.;\r
244 \r
245 //Eta-plots\r
246 Int_t nXBinsEta = 400;\r
247 Double_t firstXBinEta = -2.;\r
248 Double_t lastXBinEta = 2.;\r
249 \r
250 //Phi-plots\r
251 Int_t nXBinsPhi = 720;\r
252 Double_t firstXBinPhi = -TMath::Pi();\r
253 Double_t lastXBinPhi = TMath::Pi();\r
254 \r
255 //Mapping-plots\r
256 Int_t nXBinsMapping = 40;\r
257 Double_t firstXBinMapping = -20.;\r
258 Double_t lastXBinMapping = 20.;\r
259 Int_t nYBinsMapping = 30;\r
260 Double_t firstYBinMapping = -1.5;\r
261 Double_t lastYBinMapping = 1.5;\r
262 \r
263 //ResolutionPlots\r
264 //RESdPt\r
265 Int_t nXBinsResdPt=500;\r
266 Int_t firstXBinResdPt= 0;\r
267 Int_t lastXBinResdPt=5;\r
268 Int_t nYBinsResdPt=1000;\r
269 Int_t firstYBinResdPt= -5;\r
270 Int_t lastYBinResdPt=5;\r
271 \r
272 //RESdR\r
273 Int_t nXBinsResdR=1000;\r
274 Int_t firstXBinResdR= 0;\r
275 Int_t lastXBinResdR=250;\r
276 Int_t nYBinsResdR=1000;\r
277 Int_t firstYBinResdR= -25;\r
278 Int_t lastYBinResdR=25;\r
279 \r
280 //RESdZ\r
281 Int_t nXBinsResdZ=2000;\r
282 Int_t firstXBinResdZ= -20;\r
283 Int_t lastXBinResdZ=20;\r
284 Int_t nYBinsResdZ=1000;\r
285 Int_t firstYBinResdZ= -20;\r
286 Int_t lastYBinResdZ=20;\r
287 \r
288 //RESdRdPt\r
289 Int_t nXBinsResdRdPt=1000;\r
290 Int_t firstXBinResdRdPt= -22;\r
291 Int_t lastXBinResdRdPt=22;\r
292 Int_t nYBinsResdRdPt=1000;\r
293 Int_t firstYBinResdRdPt= -5;\r
294 Int_t lastYBinResdRdPt=5;\r
295 \r
296 \r
297 //RESMCPt\r
298 Int_t nXBinsResPt=500;\r
299 Int_t firstXBinResPt= 0;\r
300 Int_t lastXBinResPt=5;\r
301 \r
302 //RESMCR\r
303 Int_t nXBinsResR=1000;\r
304 Int_t firstXBinResR= 0;\r
305 Int_t lastXBinResR=250;\r
306 \r
307 //RESMCZ\r
308 Int_t nXBinsResZ=1000;\r
309 Int_t firstXBinResZ= 0;\r
310 Int_t lastXBinResZ=250;\r
311 \r
312 //GammaMass-plots\r
313 Int_t nXBinsGammaMass = 100;\r
314 Double_t firstXBinGammaMass = 0.;\r
315 Double_t lastXBinGammaMass = 1.;\r
316 \r
317 //Pi0Mass-plots\r
318 Int_t nXBinsPi0Mass = 100;\r
319 Double_t firstXBinPi0Mass = 0.;\r
320 Double_t lastXBinPi0Mass = 1.;\r
321 \r
322 //EtaMass-plots\r
323 Int_t nXBinsEtaMass = 100;\r
324 Double_t firstXBinEtaMass = 0.;\r
325 Double_t lastXBinEtaMass = 1.;\r
326 \r
327 //GammaWidth-plots\r
328 Int_t nXBinsGammaWidth = 100;\r
329 Double_t firstXBinGammaWidth = 0.;\r
330 Double_t lastXBinGammaWidth = 1.;\r
331 \r
332 //GammaChi2-plots\r
333 Int_t nXBinsGammaChi2 = 100;\r
334 Double_t firstXBinGammaChi2 = 0;\r
335 Double_t lastXBinGammaChi2 = 100.;\r
336 \r
337 //GammaNDF-plots\r
338 Int_t nXBinsGammaNDF = 10;\r
339 Double_t firstXBinGammaNDF = 0.;\r
340 Double_t lastXBinGammaNDF = 10.;\r
341 \r
342 //Spectra-plots\r
343 Int_t nXBinsSpectra = 100;\r
344 Double_t firstXBinSpectra = 0.;\r
345 Double_t lastXBinSpectra = 1.;\r
346 Int_t nYBinsSpectra = 500;\r
347 Double_t firstYBinSpectra = 0.;\r
348 Double_t lastYBinSpectra = 100.;\r
349 \r
350 /** ---------- end Define the binning for the different plot types here ----------------------*/\r
351 \r
352 \r
353 \r
354 /************************************************************************************************\r
355  *                                                                                              *\r
356  *                                                                                              *\r
357  *                     EVERYTHING BELOW IS FOR DEVELOPERS ONLY                                  *\r
358  *                                                                                              *\r
359  *                                                                                              *\r
360  ************************************************************************************************/\r
361 \r
362 void ConfigGammaConversion(const char *chainName, const char *sample, int limit = 0){\r
363   \r
364   build();//build (if necessary) and load the libraries needed\r
365 \r
366   gROOT->LoadMacro("$ALICE_ROOT/PWG0/CreateESDChain.C"); // load the CreateChain macro\r
367 \r
368   AliLog::SetGlobalLogLevel(AliLog::kError);\r
369 \r
370   //-------------------------------- Creating the histograms -------------------------------\r
371   AliGammaConversionHistograms * histograms = new AliGammaConversionHistograms();\r
372 \r
373   if(plotMCEPR == kTRUE){ histograms->AddHistogram("MC_EP_R","Radius of gamma conversion points",nXBinsR, firstXBinR, lastXBinR,"counts","cm");}\r
374   if(plotMCEPZR == kTRUE){ histograms->AddHistogram("MC_EP_ZR","Radius of gamma conversion points vs Z",nXBinsZR, firstXBinZR, lastXBinZR, nYBinsZR, firstYBinZR, lastYBinZR, "cm", "cm");}\r
375   if(plotMCEPXY == kTRUE){ histograms->AddHistogram("MC_EP_XY","Gamma XY converison point.",nXBinsXY, firstXBinXY, lastXBinXY, nYBinsXY, firstYBinXY, lastYBinXY, "cm", "cm");}\r
376   if(plotMCEPOpeningAngle == kTRUE){ histograms->AddHistogram("MC_EP_OpeningAngle","Opening angle of e+e- pairs from gamma conversion",nXBinsOpeningAngle, firstXBinOpeningAngle, lastXBinOpeningAngle, "counts", "cm");}\r
377 \r
378   if(plotMCEEnergy == kTRUE){ histograms->AddHistogram("MC_E_Energy" ,"" , nXBinsEnergy, firstXBinEnergy, lastXBinEnergy, "", "");}\r
379   if(plotMCEPt == kTRUE){ histograms->AddHistogram("MC_E_Pt" ,"" , nXBinsPt, firstXBinPt, lastXBinPt, "", "");}\r
380   if(plotMCEEta == kTRUE){ histograms->AddHistogram("MC_E_Eta" ,"" , nXBinsEta, firstXBinEta, lastXBinEta, "", "");}\r
381   if(plotMCEPhi == kTRUE){ histograms->AddHistogram("MC_E_Phi" ,"" , nXBinsPhi, firstXBinPhi, lastXBinPhi, "", "");}\r
382 \r
383   if(plotMCPEnergy == kTRUE){ histograms->AddHistogram("MC_P_Energy" ,"" , nXBinsEnergy, firstXBinEnergy, lastXBinEnergy, "", "");}\r
384   if(plotMCPPt == kTRUE){ histograms->AddHistogram("MC_P_Pt" ,"" , nXBinsPt, firstXBinPt, lastXBinPt, "", "");}\r
385   if(plotMCPEta == kTRUE){ histograms->AddHistogram("MC_P_Eta" ,"" , nXBinsEta, firstXBinEta, lastXBinEta, "", "");}\r
386   if(plotMCPPhi == kTRUE){ histograms->AddHistogram("MC_P_Phi" ,"" , nXBinsPhi, firstXBinPhi, lastXBinPhi, "", "");}\r
387 \r
388   if(plotMCGammaEnergy == kTRUE){ histograms->AddHistogram("MC_Gamma_Energy" ,"" , nXBinsEnergy, firstXBinEnergy, lastXBinEnergy, "", "");}\r
389   if(plotMCGammaPt == kTRUE){ histograms->AddHistogram("MC_Gamma_Pt" ,"" , nXBinsPt, firstXBinPt, lastXBinPt, "", "");}\r
390   if(plotMCGammaEta == kTRUE){ histograms->AddHistogram("MC_Gamma_Eta" ,"" , nXBinsEta, firstXBinEta, lastXBinEta, "", "");}\r
391   if(plotMCGammaPhi == kTRUE){ histograms->AddHistogram("MC_Gamma_Phi" ,"" , nXBinsPhi, firstXBinPhi, lastXBinPhi, "", "");}\r
392 \r
393   if(plotMCDirectGammaEnergy == kTRUE){ histograms->AddHistogram("MC_DirectGamma_Energy" ,"" , nXBinsEnergy, firstXBinEnergy, lastXBinEnergy, "", "");}\r
394   if(plotMCDirectGammaPt == kTRUE){ histograms->AddHistogram("MC_DirectGamma_Pt" ,"" , nXBinsPt, firstXBinPt, lastXBinPt, "", "");}\r
395   if(plotMCDirectGammaEta == kTRUE){ histograms->AddHistogram("MC_DirectGamma_Eta" ,"" , nXBinsEta, firstXBinEta, lastXBinEta, "", "");}\r
396   if(plotMCDirectGammaPhi == kTRUE){ histograms->AddHistogram("MC_DirectGamma_Phi" ,"" , nXBinsPhi, firstXBinPhi, lastXBinPhi, "", "");}\r
397 \r
398   if(plotMCMatchGammaEta == kTRUE){ histograms->AddHistogram("MC_Match_Gamma_Eta" ,"" , nXBinsEta, firstXBinEta, lastXBinEta, "", "");}\r
399   if(plotMCMatchGammaPhi == kTRUE){ histograms->AddHistogram("MC_Match_Gamma_Phi" ,"" , nXBinsPhi, firstXBinPhi, lastXBinPhi, "", "");}\r
400   if(plotMCMatchGammaPt == kTRUE){ histograms->AddHistogram("MC_Match_Gamma_Pt" ,"" , nXBinsPt, firstXBinPt, lastXBinPt, "", "");}\r
401   if(plotMCMatchGammaEnergy == kTRUE){ histograms->AddHistogram("MC_Match_Gamma_Energy" ,"" , nXBinsEnergy, firstXBinEnergy, lastXBinEnergy, "", "");}\r
402   if(plotMCMatchGammaMass == kTRUE){ histograms->AddHistogram("MC_Match_Gamma_Mass" ,"" , nXBinsGammaMass, firstXBinGammaMass, lastXBinGammaMass, "", "");}\r
403   if(plotMCMatchGammaOpeningAngle == kTRUE){ histograms->AddHistogram("MC_Match_Gamma_OpeningAngle" ,"" , nXBinsOpeningAngle, firstXBinOpeningAngle, lastXBinOpeningAngle, "", "");}\r
404   if(plotMCMatchGammaR == kTRUE){ histograms->AddHistogram("MC_Match_GammaR" ,"" , nXBinsR, firstXBinR, lastXBinR, "", "");}\r
405   if(plotMCMatchGammaZR == kTRUE){ histograms->AddHistogram("MC_Match_GammaZR" ,"" , nXBinsZR, firstXBinZR, lastXBinZR, nYBinsZR, firstYBinZR, lastYBinZR, "", "");}\r
406   if(plotMCMatchGammaXY == kTRUE){ histograms->AddHistogram("MC_Match_GammaXY" ,"" , nXBinsXY, firstXBinXY, lastXBinXY, nYBinsXY, firstYBinXY, lastYBinXY, "", "");}\r
407 \r
408   if(plotMCPi0Eta == kTRUE){ histograms->AddHistogram("MC_Pi0_Eta" ,"" , nXBinsEta, firstXBinEta, lastXBinEta, "", "");}\r
409   if(plotMCPi0Phi == kTRUE){ histograms->AddHistogram("MC_Pi0_Phi" ,"" , nXBinsPhi, firstXBinPhi, lastXBinPhi, "", "");}\r
410   if(plotMCPi0Pt == kTRUE){ histograms->AddHistogram("MC_Pi0_Pt" ,"" , nXBinsPt, firstXBinPt, lastXBinPt, "", "");}\r
411   if(plotMCPi0Energy == kTRUE){ histograms->AddHistogram("MC_Pi0_Energy" ,"" , nXBinsEnergy, firstXBinEnergy, lastXBinEnergy, "", "");}\r
412   if(plotMCPi0Mass == kTRUE){ histograms->AddHistogram("MC_Pi0_Mass" ,"" , nXBinsPi0Mass, firstXBinPi0Mass, lastXBinPi0Mass, "", "");}\r
413   if(plotMCPi0OpeningAngle == kTRUE){ histograms->AddHistogram("MC_Pi0_GammaDaughter_OpeningAngle" ,"" , nXBinsOpeningAngle, firstXBinOpeningAngle, lastXBinOpeningAngle, "", "");}\r
414   if(plotMCPi0R == kTRUE){ histograms->AddHistogram("MC_Pi0_R" ,"" , nXBinsR, firstXBinR, lastXBinR, "", "");}\r
415   if(plotMCPi0ZR == kTRUE){ histograms->AddHistogram("MC_Pi0_ZR" ,"" , nXBinsZR, firstXBinZR, lastXBinZR, nYBinsZR, firstYBinZR, lastYBinZR, "", "");}\r
416   if(plotMCPi0XY == kTRUE){ histograms->AddHistogram("MC_Pi0_XY" ,"" , nXBinsXY, firstXBinXY, lastXBinXY, nYBinsXY, firstYBinXY, lastYBinXY, "", "");}\r
417 \r
418   if(plotMCEtaEta == kTRUE){ histograms->AddHistogram("MC_Eta_Eta" ,"" , nXBinsEta, firstXBinEta, lastXBinEta, "", "");}\r
419   if(plotMCEtaPhi == kTRUE){ histograms->AddHistogram("MC_Eta_Phi" ,"" , nXBinsPhi, firstXBinPhi, lastXBinPhi, "", "");}\r
420   if(plotMCEtaPt == kTRUE){ histograms->AddHistogram("MC_Eta_Pt" ,"" , nXBinsPt, firstXBinPt, lastXBinPt, "", "");}\r
421   if(plotMCEtaEnergy == kTRUE){ histograms->AddHistogram("MC_Eta_Energy" ,"" , nXBinsEnergy, firstXBinEnergy, lastXBinEnergy, "", "");}\r
422   if(plotMCEtaMass == kTRUE){ histograms->AddHistogram("MC_Eta_Mass" ,"" , nXBinsEtaMass, firstXBinEtaMass, lastXBinEtaMass, "", "");}\r
423   if(plotMCEtaOpeningAngleGamma == kTRUE){ histograms->AddHistogram("MC_Eta_GammaDaughter_OpeningAngle" ,"" , nXBinsOpeningAngle, firstXBinOpeningAngle, lastXBinOpeningAngle, "", "");}\r
424   if(plotMCEtaR == kTRUE){ histograms->AddHistogram("MC_Eta_R" ,"" , nXBinsR, firstXBinR, lastXBinR, "", "");}\r
425   if(plotMCEtaZR == kTRUE){ histograms->AddHistogram("MC_Eta_ZR" ,"" , nXBinsZR, firstXBinZR, lastXBinZR, nYBinsZR, firstYBinZR, lastYBinZR, "", "");}\r
426   if(plotMCEtaXY == kTRUE){ histograms->AddHistogram("MC_Eta_XY" ,"" , nXBinsXY, firstXBinXY, lastXBinXY, nYBinsXY, firstYBinXY, lastYBinXY, "", "");}\r
427     \r
428   // Histograms from esd tracks\r
429   if(plotESDEPR == kTRUE){ histograms->AddHistogram("ESD_EP_R" ,"" , nXBinsR, firstXBinR, lastXBinR, "", "");}\r
430   if(plotESDEPZR == kTRUE){ histograms->AddHistogram("ESD_EP_ZR" ,"" , nXBinsZR, firstXBinZR, lastXBinZR, nYBinsZR, firstYBinZR, lastYBinZR, "", "");}\r
431   if(plotESDEPXY == kTRUE){ histograms->AddHistogram("ESD_EP_XY" ,"" , nXBinsXY, firstXBinXY, lastXBinXY, nYBinsXY, firstYBinXY, lastYBinXY, "", "");}\r
432   if(plotESDEPOpeningAngle == kTRUE){ histograms->AddHistogram("ESD_EP_OpeningAngle" ,"" , nXBinsOpeningAngle, firstXBinOpeningAngle, lastXBinOpeningAngle, "", "");}\r
433 \r
434   if(plotESDEEnergy == kTRUE){ histograms->AddHistogram("ESD_E_Energy" ,"" , nXBinsEnergy, firstXBinEnergy, lastXBinEnergy, "", "");}\r
435   if(plotESDEPt == kTRUE){ histograms->AddHistogram("ESD_E_Pt" ,"" , nXBinsPt, firstXBinPt, lastXBinPt, "", "");}\r
436   if(plotESDEEta == kTRUE){ histograms->AddHistogram("ESD_E_Eta" ,"" , nXBinsEta, firstXBinEta, lastXBinEta, "", "");}\r
437   if(plotESDEPhi == kTRUE){ histograms->AddHistogram("ESD_E_Phi" ,"" , nXBinsPhi, firstXBinPhi, lastXBinPhi, "", "");}\r
438 \r
439   if(plotESDPEnergy == kTRUE){ histograms->AddHistogram("ESD_P_Energy" ,"" , nXBinsEnergy, firstXBinEnergy, lastXBinEnergy, "", "");}\r
440   if(plotESDPPt == kTRUE){ histograms->AddHistogram("ESD_P_Pt" ,"" , nXBinsPt, firstXBinPt, lastXBinPt, "", "");}\r
441   if(plotESDPEta == kTRUE){ histograms->AddHistogram("ESD_P_Eta" ,"" , nXBinsEta, firstXBinEta, lastXBinEta, "", "");}\r
442   if(plotESDPPhi == kTRUE){ histograms->AddHistogram("ESD_P_Phi" ,"" , nXBinsPhi, firstXBinPhi, lastXBinPhi, "", "");}\r
443 \r
444   if(plotESDGammaEnergy == kTRUE){ histograms->AddHistogram("ESD_Gamma_Energy" ,"" , nXBinsEnergy, firstXBinEnergy, lastXBinEnergy, "", "");}\r
445   if(plotESDGammaPt == kTRUE){ histograms->AddHistogram("ESD_Gamma_Pt" ,"" , nXBinsPt, firstXBinPt, lastXBinPt, "", "");}\r
446   if(plotESDGammaEta == kTRUE){ histograms->AddHistogram("ESD_Gamma_Eta" ,"" , nXBinsEta, firstXBinEta, lastXBinEta, "", "");}\r
447   if(plotESDGammaPhi == kTRUE){ histograms->AddHistogram("ESD_Gamma_Phi" ,"" , nXBinsPhi, firstXBinPhi, lastXBinPhi, "", "");}\r
448 \r
449   if(plotESDMatchGammaOpeningAngle == kTRUE){ histograms->AddHistogram("ESD_Match_Gamma_OpeningAngle" ,"" , nXBinsOpeningAngle, firstXBinOpeningAngle, lastXBinOpeningAngle, "", "");}\r
450   if(plotESDMatchGammaEnergy == kTRUE){ histograms->AddHistogram("ESD_Match_Gamma_Energy" ,"" , nXBinsEnergy, firstXBinEnergy, lastXBinEnergy, "", "");}\r
451   if(plotESDMatchGammaPt == kTRUE){ histograms->AddHistogram("ESD_Match_Gamma_Pt" ,"" , nXBinsPt, firstXBinPt, lastXBinPt, "", "");}\r
452   if(plotESDMatchGammaEta == kTRUE){ histograms->AddHistogram("ESD_Match_Gamma_Eta" ,"" , nXBinsEta, firstXBinEta, lastXBinEta, "", "");}\r
453   if(plotESDMatchGammaPhi == kTRUE){ histograms->AddHistogram("ESD_Match_Gamma_Phi" ,"" , nXBinsPhi, firstXBinPhi, lastXBinPhi, "", "");}\r
454   if(plotESDMatchGammaMass == kTRUE){ histograms->AddHistogram("ESD_Match_Gamma_Mass" ,"" , nXBinsGammaMass, firstXBinGammaMass, lastXBinGammaMass, "", "");}\r
455   if(plotESDMatchGammaWidth == kTRUE){ histograms->AddHistogram("ESD_Match_Gamma_Width" ,"" , nXBinsGammaWidth, firstXBinGammaWidth, lastXBinGammaWidth, "", "");}\r
456   if(plotESDMatchGammaChi2 == kTRUE){ histograms->AddHistogram("ESD_Match_Gamma_Chi2" ,"" , nXBinsGammaChi2, firstXBinGammaChi2, lastXBinGammaChi2, "", "");}\r
457   if(plotESDMatchGammaNDF == kTRUE){ histograms->AddHistogram("ESD_Match_Gamma_NDF" ,"" , nXBinsGammaNDF, firstXBinGammaNDF, lastXBinGammaNDF, "", "");}\r
458   if(plotESDMatchGammaR == kTRUE){ histograms->AddHistogram("ESD_Match_Gamma_R" ,"" , nXBinsR, firstXBinR, lastXBinR, "", "");}\r
459   if(plotESDMatchGammaZR == kTRUE){ histograms->AddHistogram("ESD_Match_Gamma_ZR" ,"" , nXBinsZR, firstXBinZR, lastXBinZR, nYBinsZR, firstYBinZR, lastYBinZR, "", "");}\r
460   if(plotESDMatchGammaXY == kTRUE){ histograms->AddHistogram("ESD_Match_Gamma_XY" ,"" , nXBinsXY, firstXBinXY, lastXBinXY, nYBinsXY, firstYBinXY, lastYBinXY, "", "");}\r
461 \r
462   if(plotESDTwoGammaCombinationOpeningAngleGamma == kTRUE){ histograms->AddHistogram("ESD_TwoGammaCombination_GammaDaughter_OpeningAngle" ,"" , nXBinsOpeningAngle, firstXBinOpeningAngle, lastXBinOpeningAngle, "", "");}\r
463   if(plotESDTwoGammaCombinationEnergy == kTRUE){ histograms->AddHistogram("ESD_TwoGammaCombination_Energy" ,"" , nXBinsEnergy, firstXBinEnergy, lastXBinEnergy, "", "");}\r
464   if(plotESDTwoGammaCombinationPt == kTRUE){ histograms->AddHistogram("ESD_TwoGammaCombination_Pt" ,"" , nXBinsPt, firstXBinPt, lastXBinPt, "", "");}\r
465   if(plotESDTwoGammaCombinationEta == kTRUE){ histograms->AddHistogram("ESD_TwoGammaCombination_Eta" ,"" , nXBinsEta, firstXBinEta, lastXBinEta, "", "");}\r
466   if(plotESDTwoGammaCombinationPhi == kTRUE){ histograms->AddHistogram("ESD_TwoGammaCombination_Phi" ,"" , nXBinsPhi, firstXBinPhi, lastXBinPhi, "", "");}\r
467   if(plotESDTwoGammaCombinationMass == kTRUE){ histograms->AddHistogram("ESD_TwoGammaCombination_Mass" ,"" , nXBinsPi0Mass, firstXBinPi0Mass, lastXBinPi0Mass, "", "");}\r
468   if(plotESDTwoGammaCombinationR == kTRUE){ histograms->AddHistogram("ESD_TwoGammaCombination_R" ,"" , nXBinsR, firstXBinR, lastXBinR, "", "");}\r
469   if(plotESDTwoGammaCombinationZR == kTRUE){ histograms->AddHistogram("ESD_TwoGammaCombination_ZR" ,"" , nXBinsZR, firstXBinZR, lastXBinZR, nYBinsZR, firstYBinZR, lastYBinZR, "", "");}\r
470   if(plotESDTwoGammaCombinationXY == kTRUE){ histograms->AddHistogram("ESD_TwoGammaCombination_XY" ,"" , nXBinsXY, firstXBinXY, lastXBinXY, nYBinsXY, firstYBinXY, lastYBinXY, "", "");}\r
471 \r
472   /*\r
473   if(plotESDEtaOpeningAngleGamma == kTRUE){ histograms->AddHistogram("ESD_Eta_GammaDaughter_OpeningAngle" ,"" , nXBinsOpeningAngle, firstXBinOpeningAngle, lastXBinOpeningAngle, "", "");}\r
474   if(plotESDEtaEnergy == kTRUE){ histograms->AddHistogram("ESD_Eta_Energy" ,"" , nXBinsEnergy, firstXBinEnergy, lastXBinEnergy, "", "");}\r
475   if(plotESDEtaPt == kTRUE){ histograms->AddHistogram("ESD_Eta_Pt" ,"" , nXBinsPt, firstXBinPt, lastXBinPt, "", "");}\r
476   if(plotESDEtaEta == kTRUE){ histograms->AddHistogram("ESD_Eta_Eta" ,"" , nXBinsEta, firstXBinEta, lastXBinEta, "", "");}\r
477   if(plotESDEtaPhi == kTRUE){ histograms->AddHistogram("ESD_Eta_Phi" ,"" , nXBinsPhi, firstXBinPhi, lastXBinPhi, "", "");}\r
478   if(plotESDEtaMass == kTRUE){ histograms->AddHistogram("ESD_Eta_Mass" ,"" , nXBinsEtaMass, firstXBinEtaMass, lastXBinEtaMass, "", "");}\r
479   if(plotESDEtaR == kTRUE){ histograms->AddHistogram("ESD_Eta_R" ,"" , nXBinsR, firstXBinR, lastXBinR, "", "");}\r
480   if(plotESDEtaZR == kTRUE){ histograms->AddHistogram("ESD_Eta_ZR" ,"" , nXBinsZR, firstXBinZR, lastXBinZR, nYBinsZR, firstYBinZR, lastYBinZR, "", "");}\r
481   if(plotESDEtaXY == kTRUE){ histograms->AddHistogram("ESD_Eta_XY" ,"" , nXBinsXY, firstXBinXY, lastXBinXY, nYBinsXY, firstYBinXY, lastYBinXY, "", "");}\r
482   */\r
483   if(plotESDBackgroundOpeningAngleGamma == kTRUE){ histograms->AddHistogram("ESD_Background_GammaDaughter_OpeningAngle" ,"" , nXBinsOpeningAngle, firstXBinOpeningAngle, lastXBinOpeningAngle, "", "");}\r
484   if(plotESDBackgroundEnergy == kTRUE){ histograms->AddHistogram("ESD_Background_Energy" ,"" , nXBinsEnergy, firstXBinEnergy, lastXBinEnergy, "", "");}\r
485   if(plotESDBackgroundPt == kTRUE){ histograms->AddHistogram("ESD_Background_Pt" ,"" , nXBinsPt, firstXBinPt, lastXBinPt, "", "");}\r
486   if(plotESDBackgroundEta == kTRUE){ histograms->AddHistogram("ESD_Background_Eta" ,"" , nXBinsEta, firstXBinEta, lastXBinEta, "", "");}\r
487   if(plotESDBackgroundPhi == kTRUE){ histograms->AddHistogram("ESD_Background_Phi" ,"" , nXBinsPhi, firstXBinPhi, lastXBinPhi, "", "");}\r
488   if(plotESDBackgroundMass == kTRUE){ histograms->AddHistogram("ESD_Background_Mass" ,"" , nXBinsEtaMass, firstXBinEtaMass, lastXBinEtaMass, "", "");}\r
489   if(plotESDBackgroundR == kTRUE){ histograms->AddHistogram("ESD_Background_R" ,"" , nXBinsR, firstXBinR, lastXBinR, "", "");}\r
490   if(plotESDBackgroundZR == kTRUE){ histograms->AddHistogram("ESD_Background_ZR" ,"" , nXBinsZR, firstXBinZR, lastXBinZR, nYBinsZR, firstYBinZR, lastYBinZR, "", "");}\r
491   if(plotESDBackgroundXY == kTRUE){ histograms->AddHistogram("ESD_Background_XY" ,"" , nXBinsXY, firstXBinXY, lastXBinXY, nYBinsXY, firstYBinXY, lastYBinXY, "", "");}\r
492 \r
493   if(plotMapping == kTRUE){\r
494     histograms->InitializeMappingValues(nPhiIndex,nRIndex,nXBinsMapping,minRadius,maxRadius,nYBinsMapping,minPhi,maxPhi);\r
495     histograms->AddMappingHistograms(nPhiIndex,nRIndex,nXBinsMapping,minRadius,maxRadius,nYBinsMapping,minPhi,maxPhi);\r
496   }\r
497 \r
498   if(plotResolutiondPt == kTRUE){histograms->AddHistogram("Resolution_dPt" ,"" , nXBinsResdPt, firstXBinResdPt, lastXBinResdPt, nYBinsResdPt, firstYBinResdPt, lastYBinResdPt, "", "");}\r
499   if(plotResolutiondR == kTRUE){histograms->AddHistogram("Resolution_dR" ,"" , nXBinsResdR, firstXBinResdR, lastXBinResdR, nYBinsResdR, firstYBinResdR, lastYBinResdR, "", "");}\r
500   if(plotResolutiondZ == kTRUE){histograms->AddHistogram("Resolution_dZ" ,"" , nXBinsResdZ, firstXBinResdZ, lastXBinResdZ, nYBinsResdZ, firstYBinResdZ, lastYBinResdZ, "", "");}\r
501   \r
502   if(plotResolutiondRdPt == kTRUE){histograms->AddHistogram("Resolution_dR_dPt" ,"" , nXBinsResdRdPt, firstXBinResdRdPt, lastXBinResdRdPt, nYBinsResdRdPt, firstYBinResdRdPt, lastYBinResdRdPt, "", "");}\r
503   \r
504   if(plotResolutionMCPt == kTRUE){histograms->AddHistogram("Resolution_MC_Pt" ,"" , nXBinsResPt, firstXBinResPt, lastXBinResPt,"","");}\r
505   if(plotResolutionMCR == kTRUE){histograms->AddHistogram("Resolution_MC_R" ,"" , nXBinsResR, firstXBinResR, lastXBinResR,"","");}\r
506   if(plotResolutionMCZ == kTRUE){histograms->AddHistogram("Resolution_MC_Z" ,"" , nXBinsResZ, firstXBinResZ, lastXBinResZ,"","");}\r
507   \r
508   if(plotResolutionESDPt == kTRUE){histograms->AddHistogram("Resolution_ESD_Pt" ,"" , nXBinsResPt, firstXBinResPt, lastXBinResPt,"","");}\r
509   if(plotResolutionESDR == kTRUE){histograms->AddHistogram("Resolution_ESD_R" ,"" , nXBinsResR, firstXBinResR, lastXBinResR,"","");}\r
510   if(plotResolutionESDZ == kTRUE){histograms->AddHistogram("Resolution_ESD_Z" ,"" , nXBinsResZ, firstXBinResZ, lastXBinResZ,"","");}\r
511   \r
512   if(plotNumberOfV0s == kTRUE){histograms->AddHistogram("NumberOfV0s","Number of v0s",100, 0, 100,"","");}\r
513   if(plotNumberOfSurvivingV0s == kTRUE){histograms->AddHistogram("NumberOfSurvivingV0s","Number of surviving v0s",100, 0, 100,"","");}\r
514 \r
515   //  debug histograms\r
516   if(plotV0MassDebugCut1 == kTRUE){histograms->AddHistogram("V0MassDebugCut1" ,"debug1" , nXBinsGammaMass, firstXBinGammaMass, lastXBinGammaMass,"","");}\r
517   if(plotV0MassDebugCut2 == kTRUE){histograms->AddHistogram("V0MassDebugCut2" ,"debug2" , nXBinsGammaMass, firstXBinGammaMass, lastXBinGammaMass,"","");}\r
518   if(plotV0MassDebugCut3 == kTRUE){histograms->AddHistogram("V0MassDebugCut3" ,"debug3" , nXBinsGammaMass, firstXBinGammaMass, lastXBinGammaMass,"","");}\r
519   if(plotV0MassDebugCut4 == kTRUE){histograms->AddHistogram("V0MassDebugCut4" ,"debug4" , nXBinsGammaMass, firstXBinGammaMass, lastXBinGammaMass,"","");}\r
520   if(plotV0MassDebugCut5 == kTRUE){histograms->AddHistogram("V0MassDebugCut5" ,"debug5" , nXBinsGammaMass, firstXBinGammaMass, lastXBinGammaMass,"","");}\r
521   if(plotV0MassDebugCut6 == kTRUE){histograms->AddHistogram("V0MassDebugCut6" ,"debug6" , nXBinsGammaMass, firstXBinGammaMass, lastXBinGammaMass,"","");}\r
522   if(plotV0MassDebugCut7 == kTRUE){histograms->AddHistogram("V0MassDebugCut7" ,"debug7" , nXBinsGammaMass, firstXBinGammaMass, lastXBinGammaMass,"","");}\r
523   if(plotV0MassDebugCut8 == kTRUE){histograms->AddHistogram("V0MassDebugCut8" ,"debug8" , nXBinsGammaMass, firstXBinGammaMass, lastXBinGammaMass,"","");}\r
524 \r
525 \r
526   if(plotPi0Spectra == kTRUE){histograms->AddHistogram("InvMass_vs_Pt__Spectra" ,"Inv mass vs Pt" , nXBinsSpectra, firstXBinSpectra, lastXBinSpectra,nYBinsSpectra, firstYBinSpectra, lastYBinSpectra,"InvMass [GeV]","Pt [GeV]");}\r
527 \r
528   \r
529 \r
530   //------------------------------ end Creating the histograms -----------------------------\r
531 \r
532   // Create the Analysis manager\r
533   AliAnalysisManager *mgr  = new AliAnalysisManager("My Manager", "My Analysis");\r
534 \r
535   // Define Input Event Handler \r
536   AliESDInputHandler* inpHandler = new AliESDInputHandler();\r
537 \r
538   // Define Output Event Handler\r
539   AliAODHandler* aodHandler = new AliAODHandler();\r
540   aodHandler->SetOutputFileName("aodAliGammaConversion.root");\r
541   \r
542   // Define MC Truth Event Handler\r
543   AliMCEventHandler* mcHandler = new AliMCEventHandler();\r
544   \r
545   // Add Handlers to the Task Manager\r
546   mgr->SetInputEventHandler  (inpHandler);\r
547   mgr->SetOutputEventHandler (aodHandler);\r
548   mgr->SetMCtruthEventHandler(mcHandler);\r
549 \r
550   // Be sure you are told what you are doing\r
551   mgr->SetDebugLevel(10);\r
552 \r
553   // Declare Common Input Tchain\r
554   AliAnalysisDataContainer *cinput1 = mgr->CreateContainer("Chain",TChain::Class(),AliAnalysisManager::kInputContainer);\r
555 \r
556   // Common Output Tree in common â€˜default’ output file\r
557   AliAnalysisDataContainer *coutput1 = mgr->CreateContainer("tree", TTree::Class(),AliAnalysisManager::kOutputContainer, "default");\r
558 \r
559   // Private output objects\r
560   AliAnalysisDataContainer *coutput2 = mgr->CreateContainer("histogramsAliGammaConversion", TList::Class(),AliAnalysisManager::kOutputContainer, "histogramsAliGammaConversion.root");\r
561 \r
562 \r
563   //------------------------ END: Define input/output handlers ---------------------------------------------------\r
564 \r
565 \r
566   //check for errors in the specified data\r
567   if(useKFParticle == kTRUE && useESDTrack == kTRUE){\r
568     //Print warning, cannot use both\r
569   }\r
570   if(useKFParticle == kFALSE && useESDTrack == kFALSE){\r
571     //Print warning, one have to be specified\r
572   }\r
573 \r
574 \r
575   //Create the V0Reader\r
576   AliV0Reader * v0Reader = new AliV0Reader();\r
577   if(useKFParticle){\r
578     v0Reader->UseKFParticle();\r
579   }\r
580   else if(useESDTrack){\r
581     v0Reader->UseESDTrack();\r
582   }\r
583   v0Reader->SetNegativeTrackPID(pidOfNegativeTrack);\r
584   v0Reader->SetPositiveTrackPID(pidOfPositiveTrack);\r
585   v0Reader->SetMaxRCut(maxRCut);\r
586   v0Reader->SetEtaCut(etaCut);\r
587   v0Reader->SetPtCut(ptCut);\r
588   v0Reader->SetChi2Cut(chi2Cut);\r
589   v0Reader->SetPIDProbability(probElectron);\r
590   v0Reader->SetXVertexCut(xVertexCut);\r
591   v0Reader->SetYVertexCut(yVertexCut);\r
592   v0Reader->SetZVertexCut(zVertexCut);\r
593   v0Reader->SetSigmaMass(sigmaCutGammaMass);\r
594   v0Reader->SetUseImprovedVertex(useImprovedVertex);\r
595 \r
596   // Create the GammaConversionTask\r
597   AliAnalysisTaskGammaConversion *gammaconversion = new AliAnalysisTaskGammaConversion("GammaConversionTask");\r
598   gammaconversion->SetDebugLevel(10);\r
599   \r
600   gammaconversion->SetV0Reader(v0Reader);\r
601   gammaconversion->SetCalculateBackground(calculateBackground);\r
602   gammaconversion->Init();\r
603   \r
604   gammaconversion->SetElectronMass(electronMass);\r
605   gammaconversion->SetGammaMass(gammaMass);\r
606   gammaconversion->SetPi0Mass(pi0Mass);\r
607   gammaconversion->SetEtaMass(etaMass);\r
608 \r
609   gammaconversion->SetGammaWidth(gammaWidth);\r
610   gammaconversion->SetPi0Width(pi0Width);\r
611   gammaconversion->SetEtaWidth(etaWidth);\r
612 \r
613   // define the width constraint used by KF particle.\r
614   Double_t gammaWidth = 0.01;\r
615   Double_t pi0Width   = 0.01;\r
616   Double_t etaWidth   = 0.01;\r
617 \r
618   gammaconversion->SetHistograms(histograms);\r
619   v0Reader->SetHistograms(histograms);// also give the pointer to the v0reader, for debugging cuts\r
620   \r
621   gammaconversion->SetDoMCTruth(doMCTruth);\r
622 \r
623 \r
624   // Add task to the manager \r
625   mgr->AddTask(gammaconversion);\r
626 \r
627   // Connect I/O to the task\r
628   mgr->ConnectInput (gammaconversion, 0, cinput1);\r
629   mgr->ConnectOutput(gammaconversion, 0, coutput1);\r
630   mgr->ConnectOutput(gammaconversion, 1, coutput2);\r
631 \r
632   TChain* chain= CreateESDChain(sample);\r
633   \r
634   mgr->InitAnalysis();\r
635   \r
636   mgr->PrintStatus();\r
637   \r
638   mgr->StartAnalysis("local",chain);\r
639 }\r
640 \r
641 \r
642 \r
643 \r
644 void build() {\r
645   TStopwatch timer;\r
646   timer.Start();\r
647   gSystem->Load("libTree.so");\r
648   gSystem->Load("libGeom");\r
649   //  gSystem->Load("libANALYSISalice");\r
650 \r
651   ////\r
652   ////\r
653   //Setting up STEERBase.par//\r
654   ////\r
655   setupPar("STEERBase");\r
656   gSystem->Load("libSTEERBase.so");\r
657 \r
658   ////\r
659   //Setting up ESD.par//\r
660   ////\r
661   setupPar("ESD");\r
662   gSystem->Load("libVMC.so");\r
663   gSystem->Load("libESD.so");\r
664 \r
665   ////\r
666   //Setting up AOD.par//\r
667   ////\r
668   setupPar("AOD");\r
669   gSystem->Load("libAOD.so");\r
670                                                                 \r
671   ////\r
672   //Setting up ANALYSIS.par//\r
673   ////\r
674   setupPar("ANALYSIS");\r
675   gSystem->Load("libANALYSIS.so");\r
676 \r
677   ////\r
678   //Setting up ANALYSISalice.par//\r
679   ////\r
680   setupPar("ANALYSISalice");\r
681   gSystem->Load("libANALYSISalice.so");\r
682                                                                                                                                   \r
683   ////\r
684   //Setting up PWG4Gamma.par//\r
685   ////\r
686   //  setupPar("PWG4Gamma");\r
687   //  gSystem->Load("libPWG4Gamma.so");\r
688   setupPar("PWG4PartCorr");\r
689   gSystem->Load("libPWG4PartCorr.so");\r
690   //if head:: use PWG4PartCorr\r
691              \r
692   //gROOT->LoadMacro("AliAnalysisTaskPi0.cxx+");\r
693   // gROOT->LoadMacro("AliAnalysisTaskPtMC.cxx+");\r
694   //  gROOT->LoadMacro("AliAnalysisTaskPi0MC.cxx+");\r
695   //  gROOT->LoadMacro("AliAnaScale.cxx+");\r
696 \r
697 \r
698   //gROOT->LoadMacro("$ALICEROOT/PWG0/CreateESDChain.C");\r
699   //TChain* chain = CreateESDChain("files1.txt");\r
700 \r
701 \r
702 \r
703   ////\r
704 \r
705 \r
706 }\r
707 \r
708 Int_t setupPar(const char* pararchivename) {\r
709   ///////////////////\r
710   // Setup PAR File//\r
711   ///////////////////\r
712   if (pararchivename) {\r
713     char processline[1024];\r
714     sprintf(processline,".! tar xvzf %s.par",pararchivename);\r
715     gROOT->ProcessLine(processline);\r
716     const char* ocwd = gSystem->WorkingDirectory();\r
717     gSystem->ChangeDirectory(pararchivename);\r
718                                                                                                                                                \r
719     // check for BUILD.sh and execute\r
720     if (!gSystem->AccessPathName("PROOF-INF/BUILD.sh")) {\r
721       printf("*******************************\n");\r
722       printf("*** Building PAR archive    ***\n");\r
723       printf("*******************************\n");\r
724                                                                                                                                                \r
725       if (gSystem->Exec("PROOF-INF/BUILD.sh")) {\r
726         Error("runAnalysis","Cannot Build the PAR Archive! - Abort!");\r
727         return -1;\r
728       }\r
729     }\r
730     // check for SETUP.C and execute\r
731     if (!gSystem->AccessPathName("PROOF-INF/SETUP.C")) {\r
732       printf("*******************************\n");\r
733       printf("*** Setup PAR archive       ***\n");\r
734       printf("*******************************\n");\r
735       gROOT->Macro("PROOF-INF/SETUP.C");\r
736     }\r
737                                                                                                                                                \r
738     gSystem->ChangeDirectory("../");\r
739   }                                                                                                                                               \r
740   return 1;\r
741 }\r