2 /** ------------------------------ Monte Carlo flag -----------------------------------------*/
3 Bool_t doMCTruth = kTRUE;
4 /** ---------------------------- end Monte Carlo flag ---------------------------------------*/
6 /** ------------------------- Choose KFParticle OR ESDTrack --------------------------------*/
7 Bool_t useKFParticle = kTRUE;
8 Bool_t useESDTrack = kFALSE;
9 /** ----------------------- end Choose KFParticle OR ESDTrack -----------------------------*/
12 Bool_t calculateBackground = kTRUE;
14 /** ---------------------------------- define cuts here ------------------------------------*/
16 Int_t pidOfNegativeTrack=11;
17 Int_t pidOfPositiveTrack=-11;
19 Double_t maxRCut = 200.;
20 Double_t etaCut = 1.2;
22 Double_t chi2Cut = 20.;
24 Double_t xVertexCut = 0.;
25 Double_t yVertexCut = 0.;
26 Double_t zVertexCut = 0.;
28 Double_t sigmaCutGammaMass=0.0001;
30 Bool_t useImprovedVertex = kTRUE;
32 // define masses of different particles, this will be used by the KF particle
33 // together with the width to set mass constraints. Units in GeV.
34 Double_t electronMass = 0.00051099892;
35 Double_t gammaMass = 0.;
36 Double_t pi0Mass = 0.1349766;
37 Double_t etaMass = 0.54751;
39 // define the width constraint used by KF particle.
40 Double_t gammaWidth = 0.01;
41 Double_t pi0Width = 0.01;
42 Double_t etaWidth = 0.01;
44 // define the probability of track being an electron
45 Double_t probElectron = 0.5;
47 /** ----------------------------------end define cuts here----------------------------------*/
49 /** -------------------------------- Phi/R Mapping ---------------------------------------*/
53 Double_t minRadius = 0.;
54 Double_t maxRadius = 200.;
55 Double_t minPhi = -TMath::Pi();
56 Double_t maxPhi = TMath::Pi();
57 /** ------------------------------- end Phi/R Mapping ------------------------------------*/
59 /** ------------------- define which histograms to plot here --------------------------------*/
60 /** NB: to change the bin numbers, see below the histogram flags */
61 Bool_t plotMC_EP_R = kTRUE;
62 Bool_t plotMC_EP_Z_R = kTRUE;
63 Bool_t plotMC_EP_X_Y = kTRUE;
64 Bool_t plotMC_EP_OpeningAngle = kTRUE;
66 Bool_t plotMC_E_Energy = kTRUE;
67 Bool_t plotMC_E_Pt = kTRUE;
68 Bool_t plotMC_E_Eta = kTRUE;
69 Bool_t plotMC_E_Phi = kTRUE;
71 Bool_t plotMC_P_Energy = kTRUE;
72 Bool_t plotMC_P_Pt = kTRUE;
73 Bool_t plotMC_P_Eta = kTRUE;
74 Bool_t plotMC_P_Phi = kTRUE;
76 Bool_t plotMC_Gamma_Energy = kTRUE;
77 Bool_t plotMC_Gamma_Pt = kTRUE;
78 Bool_t plotMC_Gamma_Eta = kTRUE;
79 Bool_t plotMC_Gamma_Phi = kTRUE;
81 Bool_t plotMC_DirectGamma_Energy = kTRUE;
82 Bool_t plotMC_DirectGamma_Pt = kTRUE;
83 Bool_t plotMC_DirectGamma_Eta = kTRUE;
84 Bool_t plotMC_DirectGamma_Phi = kTRUE;
86 Bool_t plotMC_Match_Gamma_Eta = kTRUE;
87 Bool_t plotMC_Match_Gamma_Phi = kTRUE;
88 Bool_t plotMC_Match_Gamma_Pt = kTRUE;
89 Bool_t plotMC_Match_Gamma_Energy = kTRUE;
90 Bool_t plotMC_Match_Gamma_Mass = kTRUE;
91 Bool_t plotMC_Match_Gamma_OpeningAngle = kTRUE;
92 Bool_t plotMC_Match_Gamma_R = kTRUE;
93 Bool_t plotMC_Match_Gamma_Z_R = kTRUE;
94 Bool_t plotMC_Match_Gamma_X_Y = kTRUE;
96 Bool_t plotMC_Pi0_Eta = kTRUE;
97 Bool_t plotMC_Pi0_Phi = kTRUE;
98 Bool_t plotMC_Pi0_Pt = kTRUE;
99 Bool_t plotMC_Pi0_Energy = kTRUE;
100 Bool_t plotMC_Pi0_Mass = kTRUE;
101 Bool_t plotMC_Pi0_OpeningAngle = kTRUE;
102 Bool_t plotMC_Pi0_R = kTRUE;
103 Bool_t plotMC_Pi0_Z_R = kTRUE;
104 Bool_t plotMC_Pi0_X_Y = kTRUE;
106 Bool_t plotMC_Eta_Eta = kTRUE;
107 Bool_t plotMC_Eta_Phi = kTRUE;
108 Bool_t plotMC_Eta_Pt = kTRUE;
109 Bool_t plotMC_Eta_Energy = kTRUE;
110 Bool_t plotMC_Eta_Mass = kTRUE;
111 Bool_t plotMC_Eta_OpeningAngleGamma = kTRUE;
112 Bool_t plotMC_Eta_R = kTRUE;
113 Bool_t plotMC_Eta_Z_R = kTRUE;
114 Bool_t plotMC_Eta_X_Y = kTRUE;
116 // Histograms from esd tracks
117 Bool_t plotESD_EP_R = kTRUE;
118 Bool_t plotESD_EP_Z_R = kTRUE;
119 Bool_t plotESD_EP_X_Y = kTRUE;
120 Bool_t plotESD_EP_OpeningAngle = kTRUE;
122 Bool_t plotESD_E_Energy = kTRUE;
123 Bool_t plotESD_E_Pt = kTRUE;
124 Bool_t plotESD_E_Eta = kTRUE;
125 Bool_t plotESD_E_Phi = kTRUE;
127 Bool_t plotESD_P_Energy = kTRUE;
128 Bool_t plotESD_P_Pt = kTRUE;
129 Bool_t plotESD_P_Eta = kTRUE;
130 Bool_t plotESD_P_Phi = kTRUE;
133 Bool_t plotESD_Gamma_Energy = kTRUE;
134 Bool_t plotESD_Gamma_Pt = kTRUE;
135 Bool_t plotESD_Gamma_Eta = kTRUE;
136 Bool_t plotESD_Gamma_Phi = kTRUE;
138 Bool_t plotESD_Match_Gamma_OpeningAngle = kTRUE;
139 Bool_t plotESD_Match_Gamma_Energy = kTRUE;
140 Bool_t plotESD_Match_Gamma_Pt = kTRUE;
141 Bool_t plotESD_Match_Gamma_Eta = kTRUE;
142 Bool_t plotESD_Match_Gamma_Phi = kTRUE;
143 Bool_t plotESD_Match_Gamma_Mass = kTRUE;
144 Bool_t plotESD_Match_Gamma_Width = kTRUE;
145 Bool_t plotESD_Match_Gamma_Chi2 = kTRUE;
146 Bool_t plotESD_Match_Gamma_NDF = kTRUE;
147 Bool_t plotESD_Match_Gamma_R = kTRUE;
148 Bool_t plotESD_Match_Gamma_Z_R = kTRUE;
149 Bool_t plotESD_Match_Gamma_X_Y = kTRUE;
151 Bool_t plotESD_Pi0_OpeningAngleGamma = kTRUE;
152 Bool_t plotESD_Pi0_Energy = kTRUE;
153 Bool_t plotESD_Pi0_Pt = kTRUE;
154 Bool_t plotESD_Pi0_Eta = kTRUE;
155 Bool_t plotESD_Pi0_Phi = kTRUE;
156 Bool_t plotESD_Pi0_Mass = kTRUE;
157 Bool_t plotESD_Pi0_R = kTRUE;
158 Bool_t plotESD_Pi0_Z_R = kTRUE;
159 Bool_t plotESD_Pi0_X_Y = kTRUE;
161 Bool_t plotESD_Eta_OpeningAngleGamma = kTRUE;
162 Bool_t plotESD_Eta_Energy = kTRUE;
163 Bool_t plotESD_Eta_Pt = kTRUE;
164 Bool_t plotESD_Eta_Eta = kTRUE;
165 Bool_t plotESD_Eta_Phi = kTRUE;
166 Bool_t plotESD_Eta_Mass = kTRUE;
167 Bool_t plotESD_Eta_R = kTRUE;
168 Bool_t plotESD_Eta_Z_R = kTRUE;
169 Bool_t plotESD_Eta_X_Y = kTRUE;
171 Bool_t plotESD_Background_OpeningAngleGamma = kTRUE;
172 Bool_t plotESD_Background_Energy = kTRUE;
173 Bool_t plotESD_Background_Pt = kTRUE;
174 Bool_t plotESD_Background_Eta = kTRUE;
175 Bool_t plotESD_Background_Phi = kTRUE;
176 Bool_t plotESD_Background_Mass = kTRUE;
177 Bool_t plotESD_Background_R = kTRUE;
178 Bool_t plotESD_Background_Z_R = kTRUE;
179 Bool_t plotESD_Background_X_Y = kTRUE;
181 Bool_t plotMapping = kTRUE;
183 Bool_t plotResolution_dPt = kTRUE;
184 Bool_t plotResolution_dR = kTRUE;
185 Bool_t plotResolution_dZ = kTRUE;
187 Bool_t plotResolution_dR_dPt = kTRUE;
189 Bool_t plotResolution_MC_Pt = kTRUE;
190 Bool_t plotResolution_MC_R = kTRUE;
191 Bool_t plotResolution_MC_Z = kTRUE;
193 Bool_t plotResolution_ESD_Pt = kTRUE;
194 Bool_t plotResolution_ESD_R = kTRUE;
195 Bool_t plotResolution_ESD_Z = kTRUE;
197 Bool_t plotNumberOfV0s = kTRUE;
198 Bool_t plotNumberOfSurvivingV0s = kTRUE;
201 Bool_t plotV0MassDebugCut1 = kTRUE;
202 Bool_t plotV0MassDebugCut2 = kTRUE;
203 Bool_t plotV0MassDebugCut3 = kTRUE;
204 Bool_t plotV0MassDebugCut4 = kTRUE;
205 Bool_t plotV0MassDebugCut5 = kTRUE;
206 Bool_t plotV0MassDebugCut6 = kTRUE;
207 Bool_t plotV0MassDebugCut7 = kTRUE;
208 Bool_t plotV0MassDebugCut8 = kTRUE;
211 /** ----------------- end define which histograms to plot here -------------------------------*/
215 /** ----------- Define the binning for the different plot types here -------------------------*/
217 Int_t nXBinsR = 1000;
218 Double_t firstXBinR = 0.;
219 Double_t lastXBinR = 250.;
222 Int_t nXBinsZ_R = 2000;
223 Double_t firstXBinZ_R = -10.;
224 Double_t lastXBinZ_R = 10.;
225 Int_t nYBinsZ_R = 1000;
226 Double_t firstYBinZ_R = 0.;
227 Double_t lastYBinZ_R = 250.;
230 Int_t nXBinsX_Y = 2000;
231 Double_t firstXBinX_Y = -250.;
232 Double_t lastXBinX_Y = 250.;
233 Int_t nYBinsX_Y = 2000;
234 Double_t firstYBinX_Y = -250.;
235 Double_t lastYBinX_Y = 250.;
238 Int_t nXBinsOpeningAngle = 200;
239 Double_t firstXBinOpeningAngle = 0.;
240 Double_t lastXBinOpeningAngle = TMath::Pi()/2;
243 Int_t nXBinsEnergy = 500;
244 Double_t firstXBinEnergy = 0.;
245 Double_t lastXBinEnergy = 5.;
248 Int_t nXBinsPt = 500;
249 Double_t firstXBinPt = 0.;
250 Double_t lastXBinPt = 5.;
253 Int_t nXBinsEta = 400;
254 Double_t firstXBinEta = -2.;
255 Double_t lastXBinEta = 2.;
258 Int_t nXBinsPhi = 720;
259 Double_t firstXBinPhi = -TMath::Pi();
260 Double_t lastXBinPhi = TMath::Pi();
263 Int_t nXBinsMapping = 40;
264 Double_t firstXBinMapping = -20.;
265 Double_t lastXBinMapping = 20.;
266 Int_t nYBinsMapping = 30;
267 Double_t firstYBinMapping = -1.5;
268 Double_t lastYBinMapping = 1.5;
272 Int_t nXBinsResdPt=500;
273 Int_t firstXBinResdPt= 0;
274 Int_t lastXBinResdPt=5;
275 Int_t nYBinsResdPt=1000;
276 Int_t firstYBinResdPt= -5;
277 Int_t lastYBinResdPt=5;
280 Int_t nXBinsResdR=1000;
281 Int_t firstXBinResdR= 0;
282 Int_t lastXBinResdR=250;
283 Int_t nYBinsResdR=1000;
284 Int_t firstYBinResdR= -25;
285 Int_t lastYBinResdR=25;
288 Int_t nXBinsResdZ=2000;
289 Int_t firstXBinResdZ= -20;
290 Int_t lastXBinResdZ=20;
291 Int_t nYBinsResdZ=1000;
292 Int_t firstYBinResdZ= -20;
293 Int_t lastYBinResdZ=20;
296 Int_t nXBinsResdR_dPt=1000;
297 Int_t firstXBinResdR_dPt= -22;
298 Int_t lastXBinResdR_dPt=22;
299 Int_t nYBinsResdR_dPt=1000;
300 Int_t firstYBinResdR_dPt= -5;
301 Int_t lastYBinResdR_dPt=5;
305 Int_t nXBinsResPt=500;
306 Int_t firstXBinResPt= 0;
307 Int_t lastXBinResPt=5;
310 Int_t nXBinsResR=1000;
311 Int_t firstXBinResR= 0;
312 Int_t lastXBinResR=250;
315 Int_t nXBinsResZ=1000;
316 Int_t firstXBinResZ= 0;
317 Int_t lastXBinResZ=250;
320 Int_t nXBinsGamma_Mass = 100;
321 Double_t firstXBinGamma_Mass = 0.;
322 Double_t lastXBinGamma_Mass = 1.;
325 Int_t nXBinsPi0_Mass = 100;
326 Double_t firstXBinPi0_Mass = 0.;
327 Double_t lastXBinPi0_Mass = 1.;
330 Int_t nXBinsEta_Mass = 100;
331 Double_t firstXBinEta_Mass = 0.;
332 Double_t lastXBinEta_Mass = 1.;
335 Int_t nXBinsGamma_Width = 100;
336 Double_t firstXBinGamma_Width = 0.;
337 Double_t lastXBinGamma_Width = 1.;
340 Int_t nXBinsGamma_Chi2 = 100;
341 Double_t firstXBinGamma_Chi2 = 0;
342 Double_t lastXBinGamma_Chi2 = 100.;
345 Int_t nXBinsGamma_NDF = 10;
346 Double_t firstXBinGamma_NDF = 0.;
347 Double_t lastXBinGamma_NDF = 10.;
348 /** ---------- end Define the binning for the different plot types here ----------------------*/
352 /************************************************************************************************
355 * EVERYTHING BELOW IS FOR DEVELOPERS ONLY *
358 ************************************************************************************************/
360 void ConfigGammaConversion(const char *chainName, const char *sample, int limit = 0){
362 build();//build (if necessary) and load the libraries needed
364 gROOT->LoadMacro("$ALICE_ROOT/PWG0/CreateESDChain.C"); // load the CreateChain macro
366 AliLog::SetGlobalLogLevel(AliLog::kError);
368 //-------------------------------- Creating the histograms -------------------------------
369 AliGammaConversionHistograms * histograms = new AliGammaConversionHistograms();
372 // All the plots need to be given good names for the x-axis and y-axis so that people don't have to ask, or get confused.
373 // I put in cm and cm in the first one as an example where to put in the axis titles.
375 if(plotMC_EP_R != NULL){ histograms->Initialize_MC_EP_R(nXBinsR, firstXBinR, lastXBinR,"cm","cm");}
376 if(plotMC_EP_Z_R != NULL){ histograms->Initialize_MC_EP_Z_R(nXBinsZ_R, firstXBinZ_R, lastXBinZ_R, nYBinsZ_R, firstYBinZ_R, lastYBinZ_R, "", "");}
377 if(plotMC_EP_X_Y != NULL){ histograms->Initialize_MC_EP_X_Y(nXBinsX_Y, firstXBinX_Y, lastXBinX_Y, nYBinsX_Y, firstYBinX_Y, lastYBinX_Y, "", "");}
378 if(plotMC_EP_OpeningAngle != NULL){ histograms->Initialize_MC_EP_OpeningAngle(nXBinsOpeningAngle, firstXBinOpeningAngle, lastXBinOpeningAngle, "", "");}
380 if(plotMC_E_Energy != NULL){ histograms->Initialize_MC_E_Energy(nXBinsEnergy, firstXBinEnergy, lastXBinEnergy, "", "");}
381 if(plotMC_E_Pt != NULL){ histograms->Initialize_MC_E_Pt(nXBinsPt, firstXBinPt, lastXBinPt, "", "");}
382 if(plotMC_E_Eta != NULL){ histograms->Initialize_MC_E_Eta(nXBinsEta, firstXBinEta, lastXBinEta, "", "");}
383 if(plotMC_E_Phi != NULL){ histograms->Initialize_MC_E_Phi(nXBinsPhi, firstXBinPhi, lastXBinPhi, "", "");}
385 if(plotMC_P_Energy != NULL){ histograms->Initialize_MC_P_Energy(nXBinsEnergy, firstXBinEnergy, lastXBinEnergy, "", "");}
386 if(plotMC_P_Pt != NULL){ histograms->Initialize_MC_P_Pt(nXBinsPt, firstXBinPt, lastXBinPt, "", "");}
387 if(plotMC_P_Eta != NULL){ histograms->Initialize_MC_P_Eta(nXBinsEta, firstXBinEta, lastXBinEta, "", "");}
388 if(plotMC_P_Phi != NULL){ histograms->Initialize_MC_P_Phi(nXBinsPhi, firstXBinPhi, lastXBinPhi, "", "");}
390 if(plotMC_Gamma_Energy != NULL){ histograms->Initialize_MC_Gamma_Energy(nXBinsEnergy, firstXBinEnergy, lastXBinEnergy, "", "");}
391 if(plotMC_Gamma_Pt != NULL){ histograms->Initialize_MC_Gamma_Pt(nXBinsPt, firstXBinPt, lastXBinPt, "", "");}
392 if(plotMC_Gamma_Eta != NULL){ histograms->Initialize_MC_Gamma_Eta(nXBinsEta, firstXBinEta, lastXBinEta, "", "");}
393 if(plotMC_Gamma_Phi != NULL){ histograms->Initialize_MC_Gamma_Phi(nXBinsPhi, firstXBinPhi, lastXBinPhi, "", "");}
395 if(plotMC_DirectGamma_Energy != NULL){ histograms->Initialize_MC_DirectGamma_Energy(nXBinsEnergy, firstXBinEnergy, lastXBinEnergy, "", "");}
396 if(plotMC_DirectGamma_Pt != NULL){ histograms->Initialize_MC_DirectGamma_Pt(nXBinsPt, firstXBinPt, lastXBinPt, "", "");}
397 if(plotMC_DirectGamma_Eta != NULL){ histograms->Initialize_MC_DirectGamma_Eta(nXBinsEta, firstXBinEta, lastXBinEta, "", "");}
398 if(plotMC_DirectGamma_Phi != NULL){ histograms->Initialize_MC_DirectGamma_Phi(nXBinsPhi, firstXBinPhi, lastXBinPhi, "", "");}
400 if(plotMC_Match_Gamma_Eta != NULL){ histograms->Initialize_MC_Match_Gamma_Eta(nXBinsEta, firstXBinEta, lastXBinEta, "", "");}
401 if(plotMC_Match_Gamma_Phi != NULL){ histograms->Initialize_MC_Match_Gamma_Phi(nXBinsPhi, firstXBinPhi, lastXBinPhi, "", "");}
402 if(plotMC_Match_Gamma_Pt != NULL){ histograms->Initialize_MC_Match_Gamma_Pt(nXBinsPt, firstXBinPt, lastXBinPt, "", "");}
403 if(plotMC_Match_Gamma_Energy != NULL){ histograms->Initialize_MC_Match_Gamma_Energy(nXBinsEnergy, firstXBinEnergy, lastXBinEnergy, "", "");}
404 if(plotMC_Match_Gamma_Mass != NULL){ histograms->Initialize_MC_Match_Gamma_Mass(nXBinsGamma_Mass, firstXBinGamma_Mass, lastXBinGamma_Mass, "", "");}
405 if(plotMC_Match_Gamma_OpeningAngle != NULL){ histograms->Initialize_MC_Match_Gamma_OpeningAngle(nXBinsOpeningAngle, firstXBinOpeningAngle, lastXBinOpeningAngle, "", "");}
406 if(plotMC_Match_Gamma_R != NULL){ histograms->Initialize_MC_Match_Gamma_R(nXBinsR, firstXBinR, lastXBinR, "", "");}
407 if(plotMC_Match_Gamma_Z_R != NULL){ histograms->Initialize_MC_Match_Gamma_Z_R(nXBinsZ_R, firstXBinZ_R, lastXBinZ_R, nYBinsZ_R, firstYBinZ_R, lastYBinZ_R, "", "");}
408 if(plotMC_Match_Gamma_X_Y != NULL){ histograms->Initialize_MC_Match_Gamma_X_Y(nXBinsX_Y, firstXBinX_Y, lastXBinX_Y, nYBinsX_Y, firstYBinX_Y, lastYBinX_Y, "", "");}
410 if(plotMC_Pi0_Eta != NULL){ histograms->Initialize_MC_Pi0_Eta(nXBinsEta, firstXBinEta, lastXBinEta, "", "");}
411 if(plotMC_Pi0_Phi != NULL){ histograms->Initialize_MC_Pi0_Phi(nXBinsPhi, firstXBinPhi, lastXBinPhi, "", "");}
412 if(plotMC_Pi0_Pt != NULL){ histograms->Initialize_MC_Pi0_Pt(nXBinsPt, firstXBinPt, lastXBinPt, "", "");}
413 if(plotMC_Pi0_Energy != NULL){ histograms->Initialize_MC_Pi0_Energy(nXBinsEnergy, firstXBinEnergy, lastXBinEnergy, "", "");}
414 if(plotMC_Pi0_Mass != NULL){ histograms->Initialize_MC_Pi0_Mass(nXBinsPi0_Mass, firstXBinPi0_Mass, lastXBinPi0_Mass, "", "");}
415 if(plotMC_Pi0_OpeningAngle != NULL){ histograms->Initialize_MC_Pi0_OpeningAngleGamma(nXBinsOpeningAngle, firstXBinOpeningAngle, lastXBinOpeningAngle, "", "");}
416 if(plotMC_Pi0_R != NULL){ histograms->Initialize_MC_Pi0_R(nXBinsR, firstXBinR, lastXBinR, "", "");}
417 if(plotMC_Pi0_Z_R != NULL){ histograms->Initialize_MC_Pi0_Z_R(nXBinsZ_R, firstXBinZ_R, lastXBinZ_R, nYBinsZ_R, firstYBinZ_R, lastYBinZ_R, "", "");}
418 if(plotMC_Pi0_X_Y != NULL){ histograms->Initialize_MC_Pi0_X_Y(nXBinsX_Y, firstXBinX_Y, lastXBinX_Y, nYBinsX_Y, firstYBinX_Y, lastYBinX_Y, "", "");}
420 if(plotMC_Eta_Eta != NULL){ histograms->Initialize_MC_Eta_Eta(nXBinsEta, firstXBinEta, lastXBinEta, "", "");}
421 if(plotMC_Eta_Phi != NULL){ histograms->Initialize_MC_Eta_Phi(nXBinsPhi, firstXBinPhi, lastXBinPhi, "", "");}
422 if(plotMC_Eta_Pt != NULL){ histograms->Initialize_MC_Eta_Pt(nXBinsPt, firstXBinPt, lastXBinPt, "", "");}
423 if(plotMC_Eta_Energy != NULL){ histograms->Initialize_MC_Eta_Energy(nXBinsEnergy, firstXBinEnergy, lastXBinEnergy, "", "");}
424 if(plotMC_Eta_Mass != NULL){ histograms->Initialize_MC_Eta_Mass(nXBinsEta_Mass, firstXBinEta_Mass, lastXBinEta_Mass, "", "");}
425 if(plotMC_Eta_OpeningAngleGamma != NULL){ histograms->Initialize_MC_Eta_OpeningAngleGamma(nXBinsOpeningAngle, firstXBinOpeningAngle, lastXBinOpeningAngle, "", "");}
426 if(plotMC_Eta_R != NULL){ histograms->Initialize_MC_Eta_R(nXBinsR, firstXBinR, lastXBinR, "", "");}
427 if(plotMC_Eta_Z_R != NULL){ histograms->Initialize_MC_Eta_Z_R(nXBinsZ_R, firstXBinZ_R, lastXBinZ_R, nYBinsZ_R, firstYBinZ_R, lastYBinZ_R, "", "");}
428 if(plotMC_Eta_X_Y != NULL){ histograms->Initialize_MC_Eta_X_Y(nXBinsX_Y, firstXBinX_Y, lastXBinX_Y, nYBinsX_Y, firstYBinX_Y, lastYBinX_Y, "", "");}
430 // Histograms from esd tracks
431 if(plotESD_EP_R != NULL){ histograms->Initialize_ESD_EP_R(nXBinsR, firstXBinR, lastXBinR, "", "");}
432 if(plotESD_EP_Z_R != NULL){ histograms->Initialize_ESD_EP_Z_R(nXBinsZ_R, firstXBinZ_R, lastXBinZ_R, nYBinsZ_R, firstYBinZ_R, lastYBinZ_R, "", "");}
433 if(plotESD_EP_X_Y != NULL){ histograms->Initialize_ESD_EP_X_Y(nXBinsX_Y, firstXBinX_Y, lastXBinX_Y, nYBinsX_Y, firstYBinX_Y, lastYBinX_Y, "", "");}
434 if(plotESD_EP_OpeningAngle != NULL){ histograms->Initialize_ESD_EP_OpeningAngle(nXBinsOpeningAngle, firstXBinOpeningAngle, lastXBinOpeningAngle, "", "");}
436 if(plotESD_E_Energy != NULL){ histograms->Initialize_ESD_E_Energy(nXBinsEnergy, firstXBinEnergy, lastXBinEnergy, "", "");}
437 if(plotESD_E_Pt != NULL){ histograms->Initialize_ESD_E_Pt(nXBinsPt, firstXBinPt, lastXBinPt, "", "");}
438 if(plotESD_E_Eta != NULL){ histograms->Initialize_ESD_E_Eta(nXBinsEta, firstXBinEta, lastXBinEta, "", "");}
439 if(plotESD_E_Phi != NULL){ histograms->Initialize_ESD_E_Phi(nXBinsPhi, firstXBinPhi, lastXBinPhi, "", "");}
441 if(plotESD_P_Energy != NULL){ histograms->Initialize_ESD_P_Energy(nXBinsEnergy, firstXBinEnergy, lastXBinEnergy, "", "");}
442 if(plotESD_P_Pt != NULL){ histograms->Initialize_ESD_P_Pt(nXBinsPt, firstXBinPt, lastXBinPt, "", "");}
443 if(plotESD_P_Eta != NULL){ histograms->Initialize_ESD_P_Eta(nXBinsEta, firstXBinEta, lastXBinEta, "", "");}
444 if(plotESD_P_Phi != NULL){ histograms->Initialize_ESD_P_Phi(nXBinsPhi, firstXBinPhi, lastXBinPhi, "", "");}
446 if(plotESD_Gamma_Energy != NULL){ histograms->Initialize_ESD_Gamma_Energy(nXBinsEnergy, firstXBinEnergy, lastXBinEnergy, "", "");}
447 if(plotESD_Gamma_Pt != NULL){ histograms->Initialize_ESD_Gamma_Pt(nXBinsPt, firstXBinPt, lastXBinPt, "", "");}
448 if(plotESD_Gamma_Eta != NULL){ histograms->Initialize_ESD_Gamma_Eta(nXBinsEta, firstXBinEta, lastXBinEta, "", "");}
449 if(plotESD_Gamma_Phi != NULL){ histograms->Initialize_ESD_Gamma_Phi(nXBinsPhi, firstXBinPhi, lastXBinPhi, "", "");}
451 if(plotESD_Match_Gamma_OpeningAngle != NULL){ histograms->Initialize_ESD_Match_Gamma_OpeningAngle(nXBinsOpeningAngle, firstXBinOpeningAngle, lastXBinOpeningAngle, "", "");}
452 if(plotESD_Match_Gamma_Energy != NULL){ histograms->Initialize_ESD_Match_Gamma_Energy(nXBinsEnergy, firstXBinEnergy, lastXBinEnergy, "", "");}
453 if(plotESD_Match_Gamma_Pt != NULL){ histograms->Initialize_ESD_Match_Gamma_Pt(nXBinsPt, firstXBinPt, lastXBinPt, "", "");}
454 if(plotESD_Match_Gamma_Eta != NULL){ histograms->Initialize_ESD_Match_Gamma_Eta(nXBinsEta, firstXBinEta, lastXBinEta, "", "");}
455 if(plotESD_Match_Gamma_Phi != NULL){ histograms->Initialize_ESD_Match_Gamma_Phi(nXBinsPhi, firstXBinPhi, lastXBinPhi, "", "");}
456 if(plotESD_Match_Gamma_Mass != NULL){ histograms->Initialize_ESD_Match_Gamma_Mass(nXBinsGamma_Mass, firstXBinGamma_Mass, lastXBinGamma_Mass, "", "");}
457 if(plotESD_Match_Gamma_Width != NULL){ histograms->Initialize_ESD_Match_Gamma_Width(nXBinsGamma_Width, firstXBinGamma_Width, lastXBinGamma_Width, "", "");}
458 if(plotESD_Match_Gamma_Chi2 != NULL){ histograms->Initialize_ESD_Match_Gamma_Chi2(nXBinsGamma_Chi2, firstXBinGamma_Chi2, lastXBinGamma_Chi2, "", "");}
459 if(plotESD_Match_Gamma_NDF != NULL){ histograms->Initialize_ESD_Match_Gamma_NDF(nXBinsGamma_NDF, firstXBinGamma_NDF, lastXBinGamma_NDF, "", "");}
460 if(plotESD_Match_Gamma_R != NULL){ histograms->Initialize_ESD_Match_Gamma_R(nXBinsR, firstXBinR, lastXBinR, "", "");}
461 if(plotESD_Match_Gamma_Z_R != NULL){ histograms->Initialize_ESD_Match_Gamma_Z_R(nXBinsZ_R, firstXBinZ_R, lastXBinZ_R, nYBinsZ_R, firstYBinZ_R, lastYBinZ_R, "", "");}
462 if(plotESD_Match_Gamma_X_Y != NULL){ histograms->Initialize_ESD_Match_Gamma_X_Y(nXBinsX_Y, firstXBinX_Y, lastXBinX_Y, nYBinsX_Y, firstYBinX_Y, lastYBinX_Y, "", "");}
464 if(plotESD_Pi0_OpeningAngleGamma != NULL){ histograms->Initialize_ESD_Pi0_OpeningAngleGamma(nXBinsOpeningAngle, firstXBinOpeningAngle, lastXBinOpeningAngle, "", "");}
465 if(plotESD_Pi0_Energy != NULL){ histograms->Initialize_ESD_Pi0_Energy(nXBinsEnergy, firstXBinEnergy, lastXBinEnergy, "", "");}
466 if(plotESD_Pi0_Pt != NULL){ histograms->Initialize_ESD_Pi0_Pt(nXBinsPt, firstXBinPt, lastXBinPt, "", "");}
467 if(plotESD_Pi0_Eta != NULL){ histograms->Initialize_ESD_Pi0_Eta(nXBinsEta, firstXBinEta, lastXBinEta, "", "");}
468 if(plotESD_Pi0_Phi != NULL){ histograms->Initialize_ESD_Pi0_Phi(nXBinsPhi, firstXBinPhi, lastXBinPhi, "", "");}
469 if(plotESD_Pi0_Mass != NULL){ histograms->Initialize_ESD_Pi0_Mass(nXBinsPi0_Mass, firstXBinPi0_Mass, lastXBinPi0_Mass, "", "");}
470 if(plotESD_Pi0_R != NULL){ histograms->Initialize_ESD_Pi0_R(nXBinsR, firstXBinR, lastXBinR, "", "");}
471 if(plotESD_Pi0_Z_R != NULL){ histograms->Initialize_ESD_Pi0_Z_R(nXBinsZ_R, firstXBinZ_R, lastXBinZ_R, nYBinsZ_R, firstYBinZ_R, lastYBinZ_R, "", "");}
472 if(plotESD_Pi0_X_Y != NULL){ histograms->Initialize_ESD_Pi0_X_Y(nXBinsX_Y, firstXBinX_Y, lastXBinX_Y, nYBinsX_Y, firstYBinX_Y, lastYBinX_Y, "", "");}
474 if(plotESD_Eta_OpeningAngleGamma != NULL){ histograms->Initialize_ESD_Eta_OpeningAngleGamma(nXBinsOpeningAngle, firstXBinOpeningAngle, lastXBinOpeningAngle, "", "");}
475 if(plotESD_Eta_Energy != NULL){ histograms->Initialize_ESD_Eta_Energy(nXBinsEnergy, firstXBinEnergy, lastXBinEnergy, "", "");}
476 if(plotESD_Eta_Pt != NULL){ histograms->Initialize_ESD_Eta_Pt(nXBinsPt, firstXBinPt, lastXBinPt, "", "");}
477 if(plotESD_Eta_Eta != NULL){ histograms->Initialize_ESD_Eta_Eta(nXBinsEta, firstXBinEta, lastXBinEta, "", "");}
478 if(plotESD_Eta_Phi != NULL){ histograms->Initialize_ESD_Eta_Phi(nXBinsPhi, firstXBinPhi, lastXBinPhi, "", "");}
479 if(plotESD_Eta_Mass != NULL){ histograms->Initialize_ESD_Eta_Mass(nXBinsEta_Mass, firstXBinEta_Mass, lastXBinEta_Mass, "", "");}
480 if(plotESD_Eta_R != NULL){ histograms->Initialize_ESD_Eta_R(nXBinsR, firstXBinR, lastXBinR, "", "");}
481 if(plotESD_Eta_Z_R != NULL){ histograms->Initialize_ESD_Eta_Z_R(nXBinsZ_R, firstXBinZ_R, lastXBinZ_R, nYBinsZ_R, firstYBinZ_R, lastYBinZ_R, "", "");}
482 if(plotESD_Eta_X_Y != NULL){ histograms->Initialize_ESD_Eta_X_Y(nXBinsX_Y, firstXBinX_Y, lastXBinX_Y, nYBinsX_Y, firstYBinX_Y, lastYBinX_Y, "", "");}
484 if(plotESD_Background_OpeningAngleGamma != NULL){ histograms->Initialize_ESD_Background_OpeningAngleGamma(nXBinsOpeningAngle, firstXBinOpeningAngle, lastXBinOpeningAngle, "", "");}
485 if(plotESD_Background_Energy != NULL){ histograms->Initialize_ESD_Background_Energy(nXBinsEnergy, firstXBinEnergy, lastXBinEnergy, "", "");}
486 if(plotESD_Background_Pt != NULL){ histograms->Initialize_ESD_Background_Pt(nXBinsPt, firstXBinPt, lastXBinPt, "", "");}
487 if(plotESD_Background_Eta != NULL){ histograms->Initialize_ESD_Background_Eta(nXBinsEta, firstXBinEta, lastXBinEta, "", "");}
488 if(plotESD_Background_Phi != NULL){ histograms->Initialize_ESD_Background_Phi(nXBinsPhi, firstXBinPhi, lastXBinPhi, "", "");}
489 if(plotESD_Background_Mass != NULL){ histograms->Initialize_ESD_Background_Mass(nXBinsEta_Mass, firstXBinEta_Mass, lastXBinEta_Mass, "", "");}
490 if(plotESD_Background_R != NULL){ histograms->Initialize_ESD_Background_R(nXBinsR, firstXBinR, lastXBinR, "", "");}
491 if(plotESD_Background_Z_R != NULL){ histograms->Initialize_ESD_Background_Z_R(nXBinsZ_R, firstXBinZ_R, lastXBinZ_R, nYBinsZ_R, firstYBinZ_R, lastYBinZ_R, "", "");}
492 if(plotESD_Background_X_Y != NULL){ histograms->Initialize_ESD_Background_X_Y(nXBinsX_Y, firstXBinX_Y, lastXBinX_Y, nYBinsX_Y, firstYBinX_Y, lastYBinX_Y, "", "");}
494 if(plotMapping != NULL){histograms->Initialize_MappingValues(nPhiIndex,nRIndex,nXBinsMapping,minRadius,maxRadius,nYBinsMapping,minPhi,maxPhi);}
495 //create the mapping histograms
496 if(plotMapping != NULL){histograms->Initialize_MappingHistograms(nPhiIndex,nRIndex,nXBinsMapping,firstXBinMapping,lastXBinMapping,nYBinsMapping,firstYBinMapping,lastYBinMapping,"", "");}
502 if(plotResolution_dPt !=NULL){histograms->Initialize_Resolution_dPt(nXBinsResdPt, firstXBinResdPt, lastXBinResdPt, nYBinsResdPt, firstYBinResdPt, lastYBinResdPt, "", "");}
503 if(plotResolution_dR !=NULL){histograms->Initialize_Resolution_dR(nXBinsResdR, firstXBinResdR, lastXBinResdR, nYBinsResdR, firstYBinResdR, lastYBinResdR, "", "");}
504 if(plotResolution_dZ !=NULL){histograms->Initialize_Resolution_dZ(nXBinsResdZ, firstXBinResdZ, lastXBinResdZ, nYBinsResdZ, firstYBinResdZ, lastYBinResdZ, "", "");}
506 if(plotResolution_dR_dPt !=NULL){histograms->Initialize_Resolution_dR_dPt(nXBinsResdR_dPt, firstXBinResdR_dPt, lastXBinResdR_dPt, nYBinsResdR_dPt, firstYBinResdR_dPt, lastYBinResdR_dPt, "", "");}
508 if(plotResolution_MC_Pt !=NULL){histograms->Initialize_Resolution_MC_Pt(nXBinsResPt, firstXBinResPt, lastXBinResPt,"","");}
509 if(plotResolution_MC_R !=NULL){histograms->Initialize_Resolution_MC_R(nXBinsResR, firstXBinResR, lastXBinResR,"","");}
510 if(plotResolution_MC_Z !=NULL){histograms->Initialize_Resolution_MC_Z(nXBinsResZ, firstXBinResZ, lastXBinResZ,"","");}
512 if(plotResolution_ESD_Pt !=NULL){histograms->Initialize_Resolution_ESD_Pt(nXBinsResPt, firstXBinResPt, lastXBinResPt,"","");}
513 if(plotResolution_ESD_R !=NULL){histograms->Initialize_Resolution_ESD_R(nXBinsResR, firstXBinResR, lastXBinResR,"","");}
514 if(plotResolution_ESD_Z !=NULL){histograms->Initialize_Resolution_ESD_Z(nXBinsResZ, firstXBinResZ, lastXBinResZ,"","");}
516 if(plotNumberOfV0s != NULL){histograms->Initialize_NumberOfV0s(100, 0, 100,"","");}
517 if(plotNumberOfSurvivingV0s != NULL){histograms->Initialize_NumberOfSurvivingV0s(100, 0, 100,"","");}
520 if(plotV0MassDebugCut1 != NULL){histograms->Initialize_V0MassDebugCut1(nXBinsGamma_Mass, firstXBinGamma_Mass, lastXBinGamma_Mass,"","");}
521 if(plotV0MassDebugCut2 != NULL){histograms->Initialize_V0MassDebugCut2(nXBinsGamma_Mass, firstXBinGamma_Mass, lastXBinGamma_Mass,"","");}
522 if(plotV0MassDebugCut3 != NULL){histograms->Initialize_V0MassDebugCut3(nXBinsGamma_Mass, firstXBinGamma_Mass, lastXBinGamma_Mass,"","");}
523 if(plotV0MassDebugCut4 != NULL){histograms->Initialize_V0MassDebugCut4(nXBinsGamma_Mass, firstXBinGamma_Mass, lastXBinGamma_Mass,"","");}
524 if(plotV0MassDebugCut5 != NULL){histograms->Initialize_V0MassDebugCut5(nXBinsGamma_Mass, firstXBinGamma_Mass, lastXBinGamma_Mass,"","");}
525 if(plotV0MassDebugCut6 != NULL){histograms->Initialize_V0MassDebugCut6(nXBinsGamma_Mass, firstXBinGamma_Mass, lastXBinGamma_Mass,"","");}
526 if(plotV0MassDebugCut7 != NULL){histograms->Initialize_V0MassDebugCut7(nXBinsGamma_Mass, firstXBinGamma_Mass, lastXBinGamma_Mass,"","");}
527 if(plotV0MassDebugCut8 != NULL){histograms->Initialize_V0MassDebugCut8(nXBinsGamma_Mass, firstXBinGamma_Mass, lastXBinGamma_Mass,"","");}
531 //------------------------------ end Creating the histograms -----------------------------
533 // Create the Analysis manager
534 AliAnalysisManager *mgr = new AliAnalysisManager("My Manager", "My Analysis");
536 // Define Input Event Handler
537 AliESDInputHandler* inpHandler = new AliESDInputHandler();
539 // Define Output Event Handler
540 AliAODHandler* aodHandler = new AliAODHandler();
541 aodHandler->SetOutputFileName("aodAliGammaConversion.root");
543 // Define MC Truth Event Handler
544 AliMCEventHandler* mcHandler = new AliMCEventHandler();
546 // Add Handlers to the Task Manager
547 mgr->SetInputEventHandler (inpHandler);
548 mgr->SetOutputEventHandler (aodHandler);
549 mgr->SetMCtruthEventHandler(mcHandler);
551 // Be sure you are told what you are doing
552 mgr->SetDebugLevel(10);
554 // Declare Common Input Tchain
555 AliAnalysisDataContainer *cinput1 = mgr->CreateContainer("Chain",TChain::Class(),AliAnalysisManager::kInputContainer);
557 // Common Output Tree in common ‘default’ output file
558 AliAnalysisDataContainer *coutput1 = mgr->CreateContainer("tree", TTree::Class(),AliAnalysisManager::kOutputContainer, "default");
560 // Private output objects
561 AliAnalysisDataContainer *coutput2 = mgr->CreateContainer("histogramsAliGammaConversion", TList::Class(),AliAnalysisManager::kOutputContainer, "histogramsAliGammaConversion.root");
564 //------------------------ END: Define input/output handlers ---------------------------------------------------
567 //check for errors in the specified data
568 if(useKFParticle == kTRUE && useESDTrack == kTRUE){
569 //Print warning, cannot use both
571 if(useKFParticle == kFALSE && useESDTrack == kFALSE){
572 //Print warning, one have to be specified
576 //Create the V0Reader
577 AliV0Reader * v0Reader = new AliV0Reader();
579 v0Reader->UseKFParticle();
581 else if(useESDTrack){
582 v0Reader->UseESDTrack();
584 v0Reader->SetNegativeTrackPID(pidOfNegativeTrack);
585 v0Reader->SetPositiveTrackPID(pidOfPositiveTrack);
586 v0Reader->SetMaxRCut(maxRCut);
587 v0Reader->SetEtaCut(etaCut);
588 v0Reader->SetPtCut(ptCut);
589 v0Reader->SetChi2Cut(chi2Cut);
590 v0Reader->SetPIDProbability(probElectron);
591 v0Reader->SetXVertexCut(xVertexCut);
592 v0Reader->SetYVertexCut(yVertexCut);
593 v0Reader->SetZVertexCut(zVertexCut);
594 v0Reader->SetSigmaMass(sigmaCutGammaMass);
595 v0Reader->SetUseImprovedVertex(useImprovedVertex);
597 // Create the GammaConversionTask
598 AliAnalysisTaskGammaConversion *gammaconversion = new AliAnalysisTaskGammaConversion("GammaConversionTask");
599 gammaconversion->SetDebugLevel(10);
601 gammaconversion->SetV0Reader(v0Reader);
602 gammaconversion->SetCalculateBackground(calculateBackground);
603 gammaconversion->Init();
605 gammaconversion->SetElectronMass(electronMass);
606 gammaconversion->SetGammaMass(gammaMass);
607 gammaconversion->SetPi0Mass(pi0Mass);
608 gammaconversion->SetEtaMass(etaMass);
610 gammaconversion->SetGammaWidth(gammaWidth);
611 gammaconversion->SetPi0Width(pi0Width);
612 gammaconversion->SetEtaWidth(etaWidth);
614 // define the width constraint used by KF particle.
615 Double_t gammaWidth = 0.01;
616 Double_t pi0Width = 0.01;
617 Double_t etaWidth = 0.01;
619 gammaconversion->SetHistograms(histograms);
620 v0Reader->SetHistograms(histograms);// also give the pointer to the v0reader, for debugging cuts
622 gammaconversion->SetDoMCTruth(doMCTruth);
625 // Add task to the manager
626 mgr->AddTask(gammaconversion);
628 // Connect I/O to the task
629 mgr->ConnectInput (gammaconversion, 0, cinput1);
630 mgr->ConnectOutput(gammaconversion, 0, coutput1);
631 mgr->ConnectOutput(gammaconversion, 1, coutput2);
633 TChain* chain= CreateESDChain(sample);
639 mgr->StartAnalysis("local",chain);
649 gSystem->Load("libTree.so");
650 gSystem->Load("libGeom");
651 // gSystem->Load("libANALYSISalice");
653 //____________________________________________________//
654 //____________________________________________________//
655 //_____________Setting up STEERBase.par_______________//
656 //____________________________________________________//
657 setupPar("STEERBase");
658 gSystem->Load("libSTEERBase.so");
660 //____________________________________________________//
661 //_____________Setting up ESD.par_____________________//
662 //____________________________________________________//
664 gSystem->Load("libVMC.so");
665 gSystem->Load("libESD.so");
667 //____________________________________________________//
668 //_____________Setting up AOD.par_____________________//
669 //____________________________________________________//
671 gSystem->Load("libAOD.so");
673 //_____________________________________________________________//
674 //_____________Setting up ANALYSIS.par_________________________//
675 //_____________________________________________________________//
676 setupPar("ANALYSIS");
677 gSystem->Load("libANALYSIS.so");
679 //_____________________________________________________________//
680 //_____________Setting up ANALYSISalice.par_________________________//
681 //_____________________________________________________________//
682 setupPar("ANALYSISalice");
683 gSystem->Load("libANALYSISalice.so");
685 //_____________________________________________________________//
686 //_____________Setting up PWG4Gamma.par_____________________//
687 //_____________________________________________________________//
688 // setupPar("PWG4Gamma");
689 // gSystem->Load("libPWG4Gamma.so");
690 setupPar("PWG4PartCorr");
691 gSystem->Load("libPWG4PartCorr.so");
692 //if head:: use PWG4PartCorr
694 //gROOT->LoadMacro("AliAnalysisTaskPi0.cxx+");
695 // gROOT->LoadMacro("AliAnalysisTaskPtMC.cxx+");
696 // gROOT->LoadMacro("AliAnalysisTaskPi0MC.cxx+");
697 // gROOT->LoadMacro("AliAnaScale.cxx+");
700 //gROOT->LoadMacro("$ALICE_ROOT/PWG0/CreateESDChain.C");
701 //TChain* chain = CreateESDChain("files1.txt");
705 //____________________________________________//
710 Int_t setupPar(const char* pararchivename) {
714 if (pararchivename) {
715 char processline[1024];
716 sprintf(processline,".! tar xvzf %s.par",pararchivename);
717 gROOT->ProcessLine(processline);
718 const char* ocwd = gSystem->WorkingDirectory();
719 gSystem->ChangeDirectory(pararchivename);
721 // check for BUILD.sh and execute
722 if (!gSystem->AccessPathName("PROOF-INF/BUILD.sh")) {
723 printf("*******************************\n");
724 printf("*** Building PAR archive ***\n");
725 printf("*******************************\n");
727 if (gSystem->Exec("PROOF-INF/BUILD.sh")) {
728 Error("runAnalysis","Cannot Build the PAR Archive! - Abort!");
732 // check for SETUP.C and execute
733 if (!gSystem->AccessPathName("PROOF-INF/SETUP.C")) {
734 printf("*******************************\n");
735 printf("*** Setup PAR archive ***\n");
736 printf("*******************************\n");
737 gROOT->Macro("PROOF-INF/SETUP.C");
740 gSystem->ChangeDirectory("../");