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