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