1 void drawProtonQAResults(const char *analysisType = "TPC",
2 const char *pidMode = "Bayesian") {
3 //Macro to visualize the results of the proton QA task
4 gStyle->SetPalette(1,0);
5 gStyle->SetCanvasColor(41);
6 gStyle->SetFrameFillColor(10);
10 TString filename1 = "Protons.QA.";
11 filename1 += analysisType;
12 filename1 += "."; filename1 += pidMode;
14 TString filename2 = "Protons.MC.QA.";
15 filename2 += analysisType;
16 filename2 += "."; filename2 += pidMode;
18 TString filename3 = "Protons.Efficiency.";
19 filename3 += analysisType;
20 filename3 += "."; filename3 += pidMode;
23 TFile *fQA = TFile::Open(filename1.Data());
24 TList *listGlobalQA = (TList *)fQA->Get("globalQAList");
25 drawCutStatistics(listGlobalQA,analysisType);
28 TFile *fMC = TFile::Open(filename2.Data());
29 TList *listPDG = (TList *)fMC->Get("pdgCodeList");
30 TList *listMCProcesses = (TList *)fMC->Get("mcProcessList");
31 drawMCQA(listPDG,listMCProcesses);
34 TFile *fEfficiency = TFile::Open(filename3.Data());
35 TList *listEfficiency = (TList *)fEfficiency->Get("efficiencyList");
36 drawEfficiency(listEfficiency,analysisType);
37 TList *listCutEfficiency = (TList *)fEfficiency->Get("cutEfficiencyList");
38 DrawCutEfficiency(listCutEfficiency,analysisType);
41 TFile *fVertex = TFile::Open("Vertex.QA.root");
42 TList *listVertex = (TList *)fVertex->Get("vertexList");
43 drawVertexQA(listVertex);
47 //________________________________________//
48 void PrintHelpMenu() {
49 //Function that prints the different possibilities the user has
50 //with this macro (what to display, what is the input etc)
51 Printf("==============================HELP MENU===========================");
52 Printf("Function drawCutStatistics: Takes as an argument the list obtained from the Protons.QA.root file and the corresponding analysis type. Displays the following plots:");
53 Printf("\t 1. Influence of the track cuts to the primary and secondary protons. For each bin we show the percentage of particles rejected by the corresponding cut. The first column shows the percentage of tracks excluded from the analysis.");
54 Printf("\t 2. Influence of the track cuts to the primary and secondary antiprotons. For each bin we show the percentage of particles rejected by the corresponding cut. The first column shows the percentage of tracks excluded from the analysis.");
55 Printf("\t 3. The ITS cluster map for primary and secondary (anti)protons.");
56 Printf("\t 4. The (anti)proton purity and contamination as a function of eta or y.");
57 Printf("\t 5. The (anti)proton purity and contamination as a function of Pt.");
58 Printf("\t 6. The (anti)proton cut efficiency as a function of eta or y.");
59 Printf("\t 7. The (anti)proton cut efficiency as a function of Pt.");
60 Printf("\t 8. The composition of accepted secondary (anti)protons as a function of eta or y.");
61 Printf("\t 9. The composition of accepted secondary (anti)protons as a function of Pt.");
62 Printf("\t ***This function calls the DrawContamination function that creates an output root file with the name Contamination.root holding all the purity and contamination plots (eta or y and Pt dependence) and the DrawCutEfficiency function that creates an output root file with the name CutEfficiency.root with the y or eta and Pt dependence of the cut efficiency for protons and antiprotons.***");
64 Printf("\nFunction drawMCQA: Takes as an argument the two lists obtained from the Protons.MC.QA.root file holding pure MC information. Displays the following plots:");
65 Printf("\t 1. MC composition of secondary protons as a function of either eta or y.");
66 Printf("\t 2. MC composition of secondary antiprotons as a function of either eta or y.");
67 Printf("\t 3. MC composition of secondary protons as a function of Pt.");
68 Printf("\t 4. MC composition of secondary antiprotons as a function of Pt");
70 Printf("\nFunction drawEfficiency: Takes as an argument the list obtained from the Protons.Efficiency.root file along with the analysis type. Displays the following plots:");
71 Printf("\t 1. Reconstruction efficiencies for primary and secondary (anti)protons as a function of either eta or y. The secondaries are categorized by the MC process as originating from a weak decay or from a hadronic interaction.");
72 Printf("\t 2. Reconstruction efficiencies for primary and secondary (anti)protons as a function of Pt. The secondaries are categorized by the MC process as originating from a weak decay or from a hadronic interaction.");
73 Printf("\t 3. Particle identifiction efficiencies for (anti)protons as a function of either eta or y and of Pt.");
74 Printf("\t ***This function produces an output root file with the name Reconstruction-PID-Efficiency.root with all the efficiency and contamination plots.***");
76 Printf("\nFunction drawVertexQA: Takes as an argument the list obtained from the Vertex.QA.root file holding pure vertex information. Displays the following plots:");
77 Printf("\t 1. The vertex efficiencies for the TPC, SPD and track ones.");
78 Printf("\t 2. The QA plots for the TPC vertex.");
79 Printf("\t 3. The QA plots for the SPD vertex.");
80 Printf("\t 4. The QA plots for the tracks vertex.");
82 Printf("\nFunction drawKineQA: Takes as an argument the file Protons.QA.Histograms.root with all the histograms about kinematic or not variables");
83 Printf("\t 1. The phi vs eta correlation plots for primary and secondary (anti)protons.");
84 Printf("\t 2. The Nclusters TPC vs eta correlation plots for primary and secondary (anti)protons.");
85 Printf("\t 3. The Nclusters TPC vs phi correlation plots for primary and secondary (anti)protons.");
86 Printf("\t 4. The chi^2 per TPC cluster vs eta correlation plots for primary and secondary (anti)protons.");
87 Printf("\t 5. The chi^2 per TPC cluster vs phi correlation plots for primary and secondary (anti)protons.");
88 Printf("\t 6. The Npoints TPC (dE/dx) vs eta correlation plots for primary and secondary (anti)protons.");
89 Printf("\t 7. The Npoints TPC (dE/dx) vs phi correlation plots for primary and secondary (anti)protons.");
91 Printf("\nFunction drawEfficiencies: Takes as arguments the filename produced by the drawEfficiency (see before - usually the name is Reconstruction-PID-Efficiency.root) and three booleans indicating whether the points for primaries, secondaries from weak decays and secondaries from hadronic interactions will be shown.It displays:");
92 Printf("\t 1. Reconstruction efficiencies for primary and secondary (anti)protons as a function of either eta or y. The secondaries are categorized by the MC process as originating from a weak decay or from a hadronic interaction.");
93 Printf("\t 2. Reconstruction efficiencies for primary and secondary (anti)protons as a function of Pt. The secondaries are categorized by the MC process as originating from a weak decay or from a hadronic interaction.");
94 Printf("\t 3. Particle identifiction efficiencies for (anti)protons as a function of either eta or y and of Pt.");
96 Printf("\nFunction compareEfficiencies: Takes as arguments the filenames produced by the drawEfficiency (see before - usually the name is Reconstruction-PID-Efficiency.root) and three booleans indicating whether the points for primaries, secondaries from weak decays and secondaries from hadronic interactions will be shown. The two files correspond to two different tracking methods (e.g. TPC, Hybrid, Global). It displays:");
97 Printf("\t 1. Reconstruction efficiencies for primary and secondary (anti)protons as a function of either eta or y. The secondaries are categorized by the MC process as originating from a weak decay or from a hadronic interaction.");
98 Printf("\t 2. Reconstruction efficiencies for primary and secondary (anti)protons as a function of Pt. The secondaries are categorized by the MC process as originating from a weak decay or from a hadronic interaction.");
100 Printf("\nFunction draw2DEfficiency: Takes as an argument the analysis and the PID mode along with the desired projection of the 3D plots. It draws the PID efficiency as a function of the different parameters.");
101 Printf("\t yx: Efficiency vs pT vs eta");
102 Printf("\t zx: Efficiency vs Npoints TPC for the dE/dx vs eta");
103 Printf("\t zy: Efficiency vs Npoints TPC for the dE/dx vs pT");
105 Printf("\nFunction drawCutParametersDistributions: Takes as an argument the third file created by the QA code (usually the name is Protons.QA.Histograms.<AnalysisMode>.root) and displays the distributions of accepted primaries (in blue) and secondaries (in orange) for the different cut parameters.");
106 Printf("==================================================================\n\n\n");
109 //________________________________________//
110 void drawCutStatistics(TList *list,
111 const char* analysisType) {
112 //Function to display the statistics from the cuts
113 //The histogram shows the influence of each cut on the primary
114 //and secondary (anti)protons
115 const Int_t NQAHISTOSPERLIST = 27;
117 Double_t gEntriesQA2DList[12] = {0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.};
118 Double_t gEntriesQAPrimaryProtonsAcceptedList[NQAHISTOSPERLIST], gEntriesQAPrimaryProtonsRejectedList[NQAHISTOSPERLIST];
119 Double_t gEntriesQASecondaryProtonsAcceptedList[NQAHISTOSPERLIST], gEntriesQASecondaryProtonsRejectedList[NQAHISTOSPERLIST];
120 Double_t gEntriesQAPrimaryAntiProtonsAcceptedList[NQAHISTOSPERLIST], gEntriesQAPrimaryAntiProtonsRejectedList[NQAHISTOSPERLIST];
121 Double_t gEntriesQASecondaryAntiProtonsAcceptedList[NQAHISTOSPERLIST], gEntriesQASecondaryAntiProtonsRejectedList[NQAHISTOSPERLIST];
123 for(Int_t i = 0; i < NQAHISTOSPERLIST; i++) {
124 gEntriesQAPrimaryProtonsAcceptedList[i] = 0.0;
125 gEntriesQAPrimaryProtonsRejectedList[i] = 0.0;
126 gEntriesQASecondaryProtonsAcceptedList[i] = 0.0;
127 gEntriesQASecondaryProtonsRejectedList[i] = 0.0;
128 gEntriesQAPrimaryAntiProtonsAcceptedList[i] = 0.0;
129 gEntriesQAPrimaryAntiProtonsRejectedList[i] = 0.0;
130 gEntriesQASecondaryAntiProtonsAcceptedList[i] = 0.0;
131 gEntriesQASecondaryAntiProtonsRejectedList[i] = 0.0;
134 TList *fQA2DList = (TList *)list->At(0);
135 GetQAEntries(fQA2DList,gEntriesQA2DList);
136 TH3F *gHistYPtPDGProtonsPass = (TH3F *)fQA2DList->At(10);
137 TH3F *gHistYPtPDGAntiProtonsPass = (TH3F *)fQA2DList->At(11);
139 TList *fQAPrimaryProtonsAcceptedList = (TList *)list->At(1);
140 GetQAEntries(fQAPrimaryProtonsAcceptedList,gEntriesQAPrimaryProtonsAcceptedList);
142 TList *fQAPrimaryProtonsRejectedList = (TList *)list->At(2);
143 GetQAEntries(fQAPrimaryProtonsRejectedList,gEntriesQAPrimaryProtonsRejectedList);
145 TList *fQASecondaryProtonsAcceptedList = (TList *)list->At(3);
146 GetQAEntries(fQASecondaryProtonsAcceptedList,gEntriesQASecondaryProtonsAcceptedList);
148 TList *fQASecondaryProtonsRejectedList = (TList *)list->At(4);
149 GetQAEntries(fQASecondaryProtonsRejectedList,gEntriesQASecondaryProtonsRejectedList);
151 TList *fQAPrimaryAntiProtonsAcceptedList = (TList *)list->At(5);
152 GetQAEntries(fQAPrimaryAntiProtonsAcceptedList,gEntriesQAPrimaryAntiProtonsAcceptedList);
154 TList *fQAPrimaryAntiProtonsRejectedList = (TList *)list->At(6);
155 GetQAEntries(fQAPrimaryAntiProtonsRejectedList,gEntriesQAPrimaryAntiProtonsRejectedList);
157 TList *fQASecondaryAntiProtonsAcceptedList = (TList *)list->At(7);
158 GetQAEntries(fQASecondaryAntiProtonsAcceptedList,gEntriesQASecondaryAntiProtonsAcceptedList);
160 TList *fQASecondaryAntiProtonsRejectedList = (TList *)list->At(8);
161 GetQAEntries(fQASecondaryAntiProtonsRejectedList,gEntriesQASecondaryAntiProtonsRejectedList);
163 //_______________________________________________________//
164 //Create the histograms
166 char *fCutName[nx] = {"Tracks","",
168 "#chi^{2}/N_{ITS-Clusters}",
170 "#chi^{2}/N_{TPC-Clusters}",
177 "#sigma_{Vertex-TPC}",
187 "N_{points} (dE/dx)","",
188 "N_{Secondaries}/N_{total}","",""};
189 char *fCutITSName[6] = {"SPD_{1}","SPD_{2}",
191 "SSD_{1}","SSD_{2}"};
194 TH2F *hEmpty = new TH2F("hEmpty","",nx,0,nx,100,0,100);
195 hEmpty->SetStats(kFALSE);
196 hEmpty->SetMarkerStyle(kFullCircle);
197 hEmpty->SetLineColor(2); hEmpty->SetMarkerColor(2);
198 hEmpty->GetYaxis()->SetTitle("Influence of the cuts [%]");
199 for(Int_t i = 1; i <= nx; i++)
200 hEmpty->GetXaxis()->SetBinLabel(i,fCutName[i-1]);
201 hEmpty->GetXaxis()->SetLabelOffset(0.01);
202 hEmpty->GetXaxis()->SetLabelSize(0.045);
205 TH1F *hPrimaryProtons = new TH1F("hPrimaryProtons","",nx,0,nx);
206 hPrimaryProtons->SetStats(kFALSE);
207 hPrimaryProtons->SetMarkerStyle(kFullCircle);
208 hPrimaryProtons->SetLineColor(4); hPrimaryProtons->SetLineWidth(2);
209 hPrimaryProtons->SetMarkerColor(4);
210 hPrimaryProtons->GetYaxis()->SetTitle("Influence of the cuts [%]");
211 for(Int_t i = 1; i <= nx; i++) {
212 hPrimaryProtons->SetBinContent(i,-10.);
213 hPrimaryProtons->GetXaxis()->SetBinLabel(i,fCutName[i-1]);
215 hPrimaryProtons->GetXaxis()->SetLabelOffset(0.01);
216 hPrimaryProtons->GetXaxis()->SetLabelSize(0.045);
219 TH1F *hSecondaryProtons = new TH1F("hSecondaryProtons","",nx,0,nx);
220 hSecondaryProtons->SetStats(kFALSE);
221 hSecondaryProtons->SetMarkerStyle(22);
222 hSecondaryProtons->SetMarkerSize(1.4);
223 hSecondaryProtons->SetLineColor(2); hSecondaryProtons->SetLineWidth(2);
224 hSecondaryProtons->SetMarkerColor(2);
225 hSecondaryProtons->GetYaxis()->SetTitle("Influence of the cuts [%]");
226 for(Int_t i = 1; i <= nx; i++) {
227 hSecondaryProtons->SetBinContent(i,-10.);
228 hSecondaryProtons->GetXaxis()->SetBinLabel(i,fCutName[i-1]);
230 hSecondaryProtons->GetXaxis()->SetLabelOffset(0.01);
231 hSecondaryProtons->GetXaxis()->SetLabelSize(0.045);
233 //primary antiprotons
234 TH1F *hPrimaryAntiProtons = new TH1F("hPrimaryAntiProtons","",nx,0,nx);
235 hPrimaryAntiProtons->SetStats(kFALSE);
236 hPrimaryAntiProtons->SetMarkerStyle(kFullCircle);
237 hPrimaryAntiProtons->SetLineColor(4); hPrimaryAntiProtons->SetLineWidth(2);
238 hPrimaryAntiProtons->SetMarkerColor(4);
239 hPrimaryAntiProtons->GetYaxis()->SetTitle("Influence of the cuts [%]");
240 for(Int_t i = 1; i <= nx; i++) {
241 hPrimaryAntiProtons->SetBinContent(i,-10.);
242 hPrimaryAntiProtons->GetXaxis()->SetBinLabel(i,fCutName[i-1]);
244 hPrimaryAntiProtons->GetXaxis()->SetLabelOffset(0.01);
245 hPrimaryAntiProtons->GetXaxis()->SetLabelSize(0.045);
247 //secondary antiprotons
248 TH1F *hSecondaryAntiProtons = new TH1F("hSecondaryAntiProtons","",nx,0,nx);
249 hSecondaryAntiProtons->SetStats(kFALSE);
250 hSecondaryAntiProtons->SetMarkerStyle(22);
251 hSecondaryAntiProtons->SetMarkerSize(1.4);
252 hSecondaryAntiProtons->SetLineColor(2); hSecondaryAntiProtons->SetLineWidth(2);
253 hSecondaryAntiProtons->SetMarkerColor(2);
254 hSecondaryAntiProtons->GetYaxis()->SetTitle("Influence of the cuts [%]");
255 for(Int_t i = 1; i <= nx; i++) {
256 hSecondaryAntiProtons->SetBinContent(i,-10.);
257 hSecondaryAntiProtons->GetXaxis()->SetBinLabel(i,fCutName[i-1]);
259 hSecondaryAntiProtons->GetXaxis()->SetLabelOffset(0.01);
260 hSecondaryAntiProtons->GetXaxis()->SetLabelSize(0.045);
261 //_______________________________________________________//
263 //1D for primary protons
264 //cout<<"_____________________________________________________"<<endl;
265 //cout<<"_______________PRIMARY PROTONS_______________________"<<endl;
266 hPrimaryProtons->SetBinContent(1,GetPercentage(gEntriesQA2DList[0],gEntriesQA2DList[1]));
268 for(Int_t i = 2; i < NQAHISTOSPERLIST-4; i++)
269 hPrimaryProtons->SetBinContent(i+1,GetPercentage(gEntriesQAPrimaryProtonsAcceptedList[i-2],
270 gEntriesQAPrimaryProtonsRejectedList[i-2]));
272 //1D for secondary protons
273 //cout<<"_____________________________________________________"<<endl;
274 //cout<<"_______________SECONDARY PROTONS_____________________"<<endl;
275 hSecondaryProtons->SetBinContent(1,GetPercentage(gEntriesQA2DList[2],gEntriesQA2DList[3]));
277 for(Int_t i = 2; i < NQAHISTOSPERLIST-4; i++)
278 hSecondaryProtons->SetBinContent(i+1,GetPercentage(gEntriesQASecondaryProtonsAcceptedList[i-2],
279 gEntriesQASecondaryProtonsRejectedList[i-2]));
280 hSecondaryProtons->SetBinContent(25,GetPercentage(gEntriesQA2DList[0],gEntriesQA2DList[2]));
282 //1D for primary antiprotons
283 //cout<<"_________________________________________________________"<<endl;
284 //cout<<"_______________PRIMARY ANTIPROTONS_______________________"<<endl;
285 hPrimaryAntiProtons->SetBinContent(1,GetPercentage(gEntriesQA2DList[4],gEntriesQA2DList[5]));
287 for(Int_t i = 2; i < NQAHISTOSPERLIST-4; i++)
288 hPrimaryAntiProtons->SetBinContent(i+1,GetPercentage(gEntriesQAPrimaryAntiProtonsAcceptedList[i-2],
289 gEntriesQAPrimaryAntiProtonsRejectedList[i-2]));
291 //1D for secondary antiprotons
292 //cout<<"_________________________________________________________"<<endl;
293 //cout<<"_______________SECONDARY ANTIPROTONS_____________________"<<endl;
294 hSecondaryAntiProtons->SetBinContent(1,GetPercentage(gEntriesQA2DList[6],gEntriesQA2DList[7]));
296 for(Int_t i = 2; i < NQAHISTOSPERLIST-4; i++)
297 hSecondaryAntiProtons->SetBinContent(i+1,GetPercentage(gEntriesQASecondaryAntiProtonsAcceptedList[i-2],
298 gEntriesQASecondaryAntiProtonsRejectedList[i-2]));
299 hSecondaryAntiProtons->SetBinContent(25,GetPercentage(gEntriesQA2DList[4],gEntriesQA2DList[6]));
301 TLatex *t1 = new TLatex();
302 t1->SetTextSize(0.04);
303 //_________________________________________________________//
304 TCanvas *c1 = new TCanvas("c1","Cut Influence - Protons",0,0,700,400);
305 c1->SetHighLightColor(10); c1->SetBottomMargin(0.15);
306 c1->SetGridx(); c1->SetGridy();
308 for(Int_t i = 1; i <= nx; i++) {
309 hPrimaryProtons->SetBinError(i,1.0);
310 hSecondaryProtons->SetBinError(i,1.0);
313 hPrimaryProtons->DrawCopy("EHISTSAME");
314 hSecondaryProtons->DrawCopy("EHISTSAME");
315 DrawMarker(20.5, 90, 20, 1.2, 4);
316 t1->DrawLatex(21,88,"Primary p");
317 DrawMarker(20.5, 80, 22, 1.2, 2);
318 t1->DrawLatex(21,78,"Secondary p");
320 c1->SaveAs("CutInfluence-Protons.gif");
322 //_________________________________________________________//
323 TCanvas *c2 = new TCanvas("c2","Cut Influence - AntiProtons",50,50,700,400);
324 c2->SetHighLightColor(10); c2->SetBottomMargin(0.15);
325 c2->SetGridx(); c2->SetGridy();
327 for(Int_t i = 1; i <= nx; i++) {
328 hPrimaryAntiProtons->SetBinError(i,1.0);
329 hSecondaryAntiProtons->SetBinError(i,1.0);
332 hPrimaryAntiProtons->DrawCopy("EHISTSAME");
333 hSecondaryAntiProtons->DrawCopy("EHISTSAME");
334 DrawMarker(20.5, 90, 20, 1.2, 4);
335 t1->DrawLatex(21,88,"Primary #bar{p}");
336 DrawMarker(20.5, 80, 22, 1.2, 2);
337 t1->DrawLatex(21,78,"Secondary #bar{p}");
339 c2->SaveAs("CutInfluence-AntiProtons.gif");
341 //_________________________________________________________//
342 //ITS layers influence
343 TH2F *hEmptyITS = new TH2F("hEmptyITS","",10,0,10,100,0,100);
344 hEmptyITS->SetStats(kFALSE);
345 hEmptyITS->SetMarkerStyle(kFullCircle);
346 hEmptyITS->SetLineColor(2); hEmptyITS->SetMarkerColor(2);
347 hEmptyITS->GetYaxis()->SetTitle("Influence of the ITS layers [%]");
348 hEmptyITS->GetYaxis()->SetTitleOffset(1.3);
349 for(Int_t i = 1; i <= 6; i++)
350 hEmptyITS->GetXaxis()->SetBinLabel(i,fCutITSName[i-1]);
351 hEmptyITS->GetXaxis()->SetLabelOffset(0.01);
352 hEmptyITS->GetXaxis()->SetLabelSize(0.045);
354 //_________________________________________________________//
356 TH1F *hPrimaryProtonsITS = new TH1F("hPrimaryProtonsITS","",7,0,7);
357 hPrimaryProtonsITS->SetStats(kFALSE);
358 hPrimaryProtonsITS->SetMarkerStyle(kFullCircle);
359 hPrimaryProtonsITS->SetLineColor(4); hPrimaryProtonsITS->SetLineWidth(2);
360 hPrimaryProtonsITS->SetMarkerColor(4);
361 hPrimaryProtonsITS->GetYaxis()->SetTitle("Influence of the cuts [%]");
362 for(Int_t i = 1; i <= 6; i++) {
363 hPrimaryProtonsITS->SetBinContent(i,-10.);
364 hPrimaryProtonsITS->GetXaxis()->SetBinLabel(i,fCutITSName[i-1]);
366 hPrimaryProtonsITS->GetXaxis()->SetLabelOffset(0.01);
367 hPrimaryProtonsITS->GetXaxis()->SetLabelSize(0.045);
370 TH1F *hSecondaryProtonsITS = new TH1F("hSecondaryProtonsITS","",7,0,7);
371 hSecondaryProtonsITS->SetStats(kFALSE);
372 hSecondaryProtonsITS->SetMarkerStyle(22);
373 hSecondaryProtonsITS->SetMarkerSize(1.4);
374 hSecondaryProtonsITS->SetLineColor(2); hSecondaryProtonsITS->SetLineWidth(2);
375 hSecondaryProtonsITS->SetMarkerColor(2);
376 hSecondaryProtonsITS->GetYaxis()->SetTitle("Influence of the cuts [%]");
377 for(Int_t i = 1; i <= 6; i++) {
378 hSecondaryProtonsITS->SetBinContent(i,-10.);
379 hSecondaryProtonsITS->GetXaxis()->SetBinLabel(i,fCutITSName[i-1]);
381 hSecondaryProtonsITS->GetXaxis()->SetLabelOffset(0.01);
382 hSecondaryProtonsITS->GetXaxis()->SetLabelSize(0.045);
384 //primary antiprotons
385 TH1F *hPrimaryAntiProtonsITS = new TH1F("hPrimaryAntiProtonsITS","",7,0,7);
386 hPrimaryAntiProtonsITS->SetStats(kFALSE);
387 hPrimaryAntiProtonsITS->SetMarkerStyle(kFullCircle);
388 hPrimaryAntiProtonsITS->SetLineColor(4); hPrimaryAntiProtonsITS->SetLineWidth(2);
389 hPrimaryAntiProtonsITS->SetMarkerColor(4);
390 hPrimaryAntiProtonsITS->GetYaxis()->SetTitle("Influence of the cuts [%]");
391 for(Int_t i = 1; i <= 6; i++) {
392 hPrimaryAntiProtonsITS->SetBinContent(i,-10.);
393 hPrimaryAntiProtonsITS->GetXaxis()->SetBinLabel(i,fCutITSName[i-1]);
395 hPrimaryAntiProtonsITS->GetXaxis()->SetLabelOffset(0.01);
396 hPrimaryAntiProtonsITS->GetXaxis()->SetLabelSize(0.045);
398 //secondary antiprotons
399 TH1F *hSecondaryAntiProtonsITS = new TH1F("hSecondaryAntiProtonsITS","",7,0,7);
400 hSecondaryAntiProtonsITS->SetStats(kFALSE);
401 hSecondaryAntiProtonsITS->SetMarkerStyle(22);
402 hSecondaryAntiProtonsITS->SetMarkerSize(1.4);
403 hSecondaryAntiProtonsITS->SetLineColor(2); hSecondaryAntiProtonsITS->SetLineWidth(2);
404 hSecondaryAntiProtonsITS->SetMarkerColor(2);
405 hSecondaryAntiProtonsITS->GetYaxis()->SetTitle("Influence of the cuts [%]");
406 for(Int_t i = 1; i <= 6; i++) {
407 hSecondaryAntiProtonsITS->SetBinContent(i,-10.);
408 hSecondaryAntiProtonsITS->GetXaxis()->SetBinLabel(i,fCutITSName[i-1]);
410 hSecondaryAntiProtonsITS->GetXaxis()->SetLabelOffset(0.01);
411 hSecondaryAntiProtonsITS->GetXaxis()->SetLabelSize(0.045);
413 //_______________________________________________________//
414 TCanvas *c9 = new TCanvas("c9","ITS cluster map - (anti)protons",
416 c9->SetHighLightColor(10); c9->Divide(2,1);
417 for(Int_t i = 1; i <= 6; i++) {
418 hPrimaryProtonsITS->SetBinError(i,1.0);
419 hSecondaryProtonsITS->SetBinError(i,1.0);
420 hPrimaryAntiProtonsITS->SetBinError(i,1.0);
421 hSecondaryAntiProtonsITS->SetBinError(i,1.0);
423 c9->cd(1)->SetBottomMargin(0.15);
424 c9->cd(1)->SetLeftMargin(0.15);
425 c9->cd(1)->SetGridx(); c9->cd(1)->SetGridy();
426 hEmptyITS->SetTitle("Protons");
427 hEmptyITS->DrawCopy();
429 for(Int_t i = 1; i < 7; i++) {
430 hPrimaryProtonsITS->SetBinContent(i,GetPercentage(gEntriesQAPrimaryProtonsAcceptedList[20+i],
431 gEntriesQAPrimaryProtonsRejectedList[20+i]));
432 hSecondaryProtonsITS->SetBinContent(i,GetPercentage(gEntriesQASecondaryProtonsAcceptedList[20+i],
433 gEntriesQASecondaryProtonsRejectedList[20+i]));
435 hPrimaryProtonsITS->DrawCopy("EHISTSAME");
436 hSecondaryProtonsITS->DrawCopy("EHISTSAME");
437 DrawMarker(6.5, 90, 20, 1.2, 4);
438 t1->DrawLatex(7,88,"Primary p");
439 DrawMarker(6.5, 80, 22, 1.2, 2);
440 t1->DrawLatex(7,78,"Secondary p");
442 c9->cd(2)->SetBottomMargin(0.15);
443 c9->cd(2)->SetLeftMargin(0.15);
444 c9->cd(2)->SetGridx(); c9->cd(2)->SetGridy();
445 hEmptyITS->SetTitle("Antiprotons");
446 hEmptyITS->DrawCopy();
447 for(Int_t i = 1; i < 7; i++) {
448 hPrimaryAntiProtonsITS->SetBinContent(i,GetPercentage(gEntriesQAPrimaryAntiProtonsAcceptedList[20+i],
449 gEntriesQAPrimaryAntiProtonsRejectedList[20+i]));
450 hSecondaryAntiProtonsITS->SetBinContent(i,GetPercentage(gEntriesQASecondaryAntiProtonsAcceptedList[20+i],
451 gEntriesQASecondaryAntiProtonsRejectedList[20+i]));
453 hPrimaryAntiProtonsITS->DrawCopy("EHISTSAME");
454 hSecondaryAntiProtonsITS->DrawCopy("EHISTSAME");
455 DrawMarker(6.5, 90, 20, 1.2, 4);
456 t1->DrawLatex(7,88,"Primary #bar{p}");
457 DrawMarker(6.5, 80, 22, 1.2, 2);
458 t1->DrawLatex(7,78,"Secondary #bar{p}");
460 c9->SaveAs("CutInfluence-ITS.gif");
462 //Efficiency - Contamination plots
463 DrawContamination(fQA2DList,analysisType);
464 DrawComposition(gHistYPtPDGProtonsPass,gHistYPtPDGAntiProtonsPass);
467 //________________________________________//
468 void DrawComposition(TH3F *gHistYPtPDGProtons,
469 TH3F *gHistYPtPDGAntiProtons) {
470 //Function to display the composition of secondary (anti)protons
471 //that survive the quality criteria
472 Double_t nParticleCompositionProtonY[200], nParticleCompositionProtonPt[200];
473 Double_t nParticleCompositionProtonYError[200], nParticleCompositionProtonPtError[200];
474 Double_t nParticleCompositionAntiProtonY[200], nParticleCompositionAntiProtonPt[200];
475 Double_t nParticleCompositionAntiProtonYError[200], nParticleCompositionAntiProtonPtError[200];
476 Double_t gY[200], gPt[200];
477 Double_t gYError[200], gPtError[200];
478 for(Int_t iBins = 0; iBins < 200; iBins++) {
479 nParticleCompositionProtonY[iBins] = 0;
480 nParticleCompositionProtonPt[iBins] = 0;
481 nParticleCompositionProtonYError[iBins] = 0;
482 nParticleCompositionProtonPtError[iBins] = 0;
483 nParticleCompositionAntiProtonY[iBins] = 0;
484 nParticleCompositionAntiProtonPt[iBins] = 0;
485 nParticleCompositionAntiProtonYError[iBins] = 0;
486 nParticleCompositionAntiProtonPtError[iBins] = 0;
493 TGraphErrors *gParticleProtonY[14];
494 TGraphErrors *gParticleProtonPt[14];
495 TGraphErrors *gParticleAntiProtonY[14];
496 TGraphErrors *gParticleAntiProtonPt[14];
497 for(Int_t iParticle = 0; iParticle < 14; iParticle++) {
498 GetComposition(iParticle,
500 nParticleCompositionProtonY,nParticleCompositionProtonYError,gY, gYError,
501 nParticleCompositionProtonPt, nParticleCompositionProtonPtError, gPt, gPtError);
502 gParticleProtonY[iParticle] = new TGraphErrors(gHistYPtPDGProtons->GetNbinsX(),
503 gY,nParticleCompositionProtonY,gYError,nParticleCompositionProtonYError);
504 gParticleProtonY[iParticle]->SetMarkerStyle(iParticle+20);
505 gParticleProtonY[iParticle]->SetMarkerSize(1.2);
507 gParticleProtonPt[iParticle] = new TGraphErrors(gHistYPtPDGProtons->GetNbinsY(),
508 gPt,nParticleCompositionProtonPt,gPtError,nParticleCompositionProtonPtError);
509 gParticleProtonPt[iParticle]->SetMarkerStyle(iParticle+20);
510 gParticleProtonPt[iParticle]->SetMarkerSize(1.2);
512 GetComposition(iParticle,
513 gHistYPtPDGAntiProtons,
514 nParticleCompositionAntiProtonY,nParticleCompositionAntiProtonYError,gY, gYError,
515 nParticleCompositionAntiProtonPt, nParticleCompositionAntiProtonPtError, gPt, gPtError);
516 gParticleAntiProtonY[iParticle] = new TGraphErrors(gHistYPtPDGAntiProtons->GetNbinsX(),
517 gY,nParticleCompositionAntiProtonY,gYError,nParticleCompositionAntiProtonYError);
518 gParticleAntiProtonY[iParticle]->SetMarkerStyle(iParticle+20);
519 gParticleAntiProtonY[iParticle]->SetMarkerSize(1.2);
521 gParticleAntiProtonPt[iParticle] = new TGraphErrors(gHistYPtPDGAntiProtons->GetNbinsY(),
522 gPt,nParticleCompositionAntiProtonPt,gPtError,nParticleCompositionAntiProtonPtError);
523 gParticleAntiProtonPt[iParticle]->SetMarkerStyle(iParticle+20);
524 gParticleAntiProtonPt[iParticle]->SetMarkerSize(1.2);
527 //_________________________________________________________//
528 char *fParticleName[14] = {"Primary","K_{L}","#pi","K_{S}","K",
529 "n","p","#Sigma^{-}","#Lambda","#Sigma^{+}",
530 "#Xi^{-}","#Xi^{0}","#Omega^{-}"};
531 TLatex *t1 = new TLatex();
532 t1->SetTextSize(0.04);
534 TH2F *hEmptyY = new TH2F("hEmptyY","",100,-1.2,1.2,100,0,120);
535 hEmptyY->SetStats(kFALSE);
536 hEmptyY->GetYaxis()->SetTitle("Particle composition [%]");
537 hEmptyY->GetXaxis()->SetTitle(gHistYPtPDGProtons->GetXaxis()->GetTitle());
539 TCanvas *c12 = new TCanvas("c12",
540 "Composition of accepted secondaries vs y",
543 c12->SetHighLightColor(10); c12->cd(1)->SetBottomMargin(0.15);
544 c12->cd(1)->SetGridx(); c12->cd(1)->SetGridy();
545 hEmptyY->SetTitle("Protons");
547 for(Int_t iParticle = 0; iParticle < 10; iParticle++) {
548 //if((iParticle == 0)||(iParticle == 2)||(iParticle == 5)||(iParticle == 6)||(iParticle == 8))
549 if((iParticle == 2)||(iParticle == 6)||(iParticle == 8)) {
550 gParticleProtonY[iParticle]->Draw("P");
551 //if(iParticle < 5) {
552 //DrawMarker(-1.1, 115-5*iParticle, 20+iParticle, 1.2, 1);
553 //t1->DrawLatex(-1.0,113-5*iParticle,fParticleName[iParticle]);
556 DrawMarker(0.2, 115-5*(iParticle-5), 20+iParticle, 1.2, 1);
557 t1->DrawLatex(0.3,113-5*(iParticle-5),fParticleName[iParticle]);
560 DrawMarker(0.0, 115, 22, 1.2, 1);
561 t1->DrawLatex(0.1,113,fParticleName[2]);
562 DrawMarker(0.0, 105, 26, 1.2, 1);
563 t1->DrawLatex(0.1,103,fParticleName[6]);
564 DrawMarker(0.0, 95, 28, 1.2, 1);
565 t1->DrawLatex(0.1,93,fParticleName[8]);
567 c12->SetHighLightColor(10); c12->cd(2)->SetBottomMargin(0.15);
568 c12->cd(2)->SetGridx(); c12->cd(2)->SetGridy();
569 hEmptyY->SetTitle("Antiprotons");
571 for(Int_t iParticle = 0; iParticle < 10; iParticle++) {
572 if((iParticle == 6)||(iParticle == 8))
573 gParticleAntiProtonY[iParticle]->Draw("P");
574 /*if(iParticle < 5) {
575 DrawMarker(-1.1, 115-5*iParticle, 20+iParticle, 1.2, 1);
576 t1->DrawLatex(-1.0,113-5*iParticle,fParticleName[iParticle]);
579 DrawMarker(0.2, 115-5*(iParticle-5), 20+iParticle, 1.2, 1);
580 t1->DrawLatex(0.3,113-5*(iParticle-5),fParticleName[iParticle]);
583 DrawMarker(0.0, 115, 26, 1.2, 1);
584 t1->DrawLatex(0.1,113,fParticleName[6]);
585 DrawMarker(0.0, 105, 28, 1.2, 1);
586 t1->DrawLatex(0.1,103,fParticleName[8]);
587 c12->SaveAs("SurvivedSecondaries-Composition-Rapidity.gif");
589 TH2F *hEmptyPt = new TH2F("hEmptyPt","",100,0.0,4.0,100,0,120);
590 hEmptyPt->SetStats(kFALSE);
591 hEmptyPt->GetYaxis()->SetTitle("Particle composition [%]");
592 hEmptyPt->GetXaxis()->SetTitle("P_{T} [GeV/c]");
594 TCanvas *c13 = new TCanvas("c13",
595 "Composition of accepted secondaries vs pT",
598 c13->SetHighLightColor(10); c13->cd(1)->SetBottomMargin(0.15);
599 c13->cd(1)->SetGridx(); c13->cd(1)->SetGridy();
600 hEmptyPt->GetXaxis()->SetRangeUser(gParticleProtonPt[0]->GetXaxis()->GetXmin()-0.2,gParticleProtonPt[0]->GetXaxis()->GetXmax()+0.2);
601 hEmptyPt->SetTitle("Protons");
602 hEmptyPt->DrawCopy();
603 for(Int_t iParticle = 0; iParticle < 10; iParticle++) {
604 /*if(iParticle < 5) {
605 DrawMarker(gParticleProtonPt[0]->GetXaxis()->GetXmin()+0.1,
606 115-5*iParticle, 20+iParticle, 1.2, 1);
607 t1->DrawLatex(gParticleProtonPt[0]->GetXaxis()->GetXmin()+0.2,
608 113-5*iParticle,fParticleName[iParticle]);
611 DrawMarker(gParticleProtonPt[0]->GetXaxis()->GetXmax()*0.5,
612 115-5*(iParticle-5), 20+iParticle, 1.2, 1);
613 t1->DrawLatex(gParticleProtonPt[0]->GetXaxis()->GetXmax()*0.5+0.1,
614 113-5*(iParticle-5),fParticleName[iParticle]);
616 if((iParticle == 2)||(iParticle == 6)||(iParticle == 8))
617 gParticleProtonPt[iParticle]->Draw("P");
619 DrawMarker(0.5, 115, 22, 1.2, 1);
620 t1->DrawLatex(0.6,113,fParticleName[2]);
621 DrawMarker(0.5, 105, 26, 1.2, 1);
622 t1->DrawLatex(0.6,103,fParticleName[6]);
623 DrawMarker(0.5, 95, 28, 1.2, 1);
624 t1->DrawLatex(0.6,93,fParticleName[8]);
626 c13->SetHighLightColor(10); c13->cd(2)->SetBottomMargin(0.15);
627 c13->cd(2)->SetGridx(); c13->cd(2)->SetGridy();
628 hEmptyPt->SetTitle("Antiprotons");
629 hEmptyPt->DrawCopy();
630 for(Int_t iParticle = 0; iParticle < 10; iParticle++) {
631 /*if(iParticle < 5) {
632 DrawMarker(gParticleProtonPt[0]->GetXaxis()->GetXmin()+0.1,
633 115-5*iParticle, 20+iParticle, 1.2, 1);
634 t1->DrawLatex(gParticleProtonPt[0]->GetXaxis()->GetXmin()+0.2,
635 113-5*iParticle,fParticleName[iParticle]);
638 DrawMarker(gParticleProtonPt[0]->GetXaxis()->GetXmax()*0.5,
639 115-5*(iParticle-5), 20+iParticle, 1.2, 1);
640 t1->DrawLatex(gParticleProtonPt[0]->GetXaxis()->GetXmax()*0.5+0.1,
641 113-5*(iParticle-5),fParticleName[iParticle]);
643 if((iParticle == 6)||(iParticle == 8))
644 gParticleAntiProtonPt[iParticle]->Draw("P");
646 DrawMarker(0.5, 115, 26, 1.2, 1);
647 t1->DrawLatex(0.6,113,fParticleName[6]);
648 DrawMarker(0.5, 105, 28, 1.2, 1);
649 t1->DrawLatex(0.6,103,fParticleName[8]);
650 c13->SaveAs("SurvivedSecondaries-Composition-Pt.gif");
653 //________________________________________________//
654 void DrawContamination(TList *inputList,
655 const char* analysisType) {
656 //loops over the list entries and
657 //draws the rapidity and pT dependence
658 //of the percentage of primary and secondary
659 //protons and antiprotons after the track cuts
660 cout<<"Extracting the entries for the histograms in the list: "<<
661 inputList->GetName()<<"..."<<endl;
663 TLatex *t1 = new TLatex();
664 t1->SetTextSize(0.04);
666 TH2F *hPrimaryProtons = (TH2F *)inputList->At(0);
667 TH2F *hSecondaryProtons = (TH2F *)inputList->At(2);
668 TH2F *hPrimaryAntiProtons = (TH2F *)inputList->At(4);
669 TH2F *hSecondaryAntiProtons = (TH2F *)inputList->At(6);
671 //rapidity dependence
673 TH1D *gYPrimaryProtons = (TH1D *)hPrimaryProtons->ProjectionX("gYPrimaryProtons",0,hPrimaryProtons->GetXaxis()->GetNbins(),"e");
674 TH1D *gYSecondaryProtons = (TH1D *)hSecondaryProtons->ProjectionX("gYSecondaryProtons",0,hSecondaryProtons->GetXaxis()->GetNbins(),"e");
675 TH1D *gYTotalProtons = (TH1D *)hPrimaryProtons->ProjectionX("gYTotalProtons",0,hPrimaryProtons->GetXaxis()->GetNbins(),"e");
676 gYTotalProtons->Add(gYSecondaryProtons);
678 TH1D *gYPrimaryProtonsPercentage = new TH1D("gYPrimaryProtonsPercentage",
680 hPrimaryProtons->GetXaxis()->GetNbins(),
681 hPrimaryProtons->GetXaxis()->GetXmin(),
682 hPrimaryProtons->GetXaxis()->GetXmax());
683 gYPrimaryProtonsPercentage->Divide(gYPrimaryProtons,
684 gYTotalProtons,1.,1.0);
685 SetError(gYPrimaryProtonsPercentage,gYTotalProtons);
686 gYPrimaryProtonsPercentage->Scale(100.);
687 gYPrimaryProtonsPercentage->SetMarkerStyle(kFullCircle);
689 TH1D *gYSecondaryProtonsPercentage = new TH1D("gYSecondaryProtonsPercentage",
691 hSecondaryProtons->GetXaxis()->GetNbins(),
692 hSecondaryProtons->GetXaxis()->GetXmin(),
693 hSecondaryProtons->GetXaxis()->GetXmax());
694 gYSecondaryProtonsPercentage->Divide(gYSecondaryProtons,
695 gYTotalProtons,1.,1.0);
696 SetError(gYSecondaryProtonsPercentage,gYTotalProtons);
697 gYSecondaryProtonsPercentage->Scale(100.);
698 gYSecondaryProtonsPercentage->SetMarkerStyle(kOpenCircle);
701 TH1D *gYPrimaryAntiProtons = (TH1D *)hPrimaryAntiProtons->ProjectionX("gYPrimaryAntiProtons",0,hPrimaryAntiProtons->GetXaxis()->GetNbins(),"e");
702 TH1D *gYSecondaryAntiProtons = (TH1D *)hSecondaryAntiProtons->ProjectionX("gYSecondaryAntiProtons",0,hSecondaryAntiProtons->GetXaxis()->GetNbins(),"e");
703 TH1D *gYTotalAntiProtons = (TH1D *)hPrimaryAntiProtons->ProjectionX("gYTotalAntiProtons",0,hPrimaryAntiProtons->GetXaxis()->GetNbins(),"e");
704 gYTotalAntiProtons->Add(gYSecondaryAntiProtons);
706 TH1D *gYPrimaryAntiProtonsPercentage = new TH1D("gYPrimaryAntiProtonsPercentage",
708 hPrimaryAntiProtons->GetXaxis()->GetNbins(),
709 hPrimaryAntiProtons->GetXaxis()->GetXmin(),
710 hPrimaryAntiProtons->GetXaxis()->GetXmax());
711 gYPrimaryAntiProtonsPercentage->Divide(gYPrimaryAntiProtons,
712 gYTotalAntiProtons,1.,1.0);
713 SetError(gYPrimaryAntiProtonsPercentage,gYTotalAntiProtons);
714 gYPrimaryAntiProtonsPercentage->Scale(100.);
715 gYPrimaryAntiProtonsPercentage->SetMarkerStyle(kFullCircle);
717 TH1D *gYSecondaryAntiProtonsPercentage = new TH1D("gYSecondaryAntiProtonsPercentage",
719 hSecondaryAntiProtons->GetXaxis()->GetNbins(),
720 hSecondaryAntiProtons->GetXaxis()->GetXmin(),
721 hSecondaryAntiProtons->GetXaxis()->GetXmax());
722 gYSecondaryAntiProtonsPercentage->Divide(gYSecondaryAntiProtons,
723 gYTotalAntiProtons,1.,1.0);
724 SetError(gYSecondaryAntiProtonsPercentage,gYTotalAntiProtons);
725 gYSecondaryAntiProtonsPercentage->Scale(100.);
726 gYSecondaryAntiProtonsPercentage->SetMarkerStyle(kOpenCircle);
729 TH2F *hEmptyY = new TH2F("hEmptyCompositionY","",
730 100,-1.2,1.2,100,-10.0,130);
731 hEmptyY->SetStats(kFALSE);
732 hEmptyY->GetYaxis()->SetTitle("Particle composition [%]");
733 hEmptyY->GetYaxis()->SetTitleOffset(1.3);
734 hEmptyY->GetXaxis()->SetTitle(hPrimaryProtons->GetXaxis()->GetTitle());
736 TCanvas *c7 = new TCanvas("c7","(Anti)Proton contamination vs y",
738 c7->SetHighLightColor(10); c7->Divide(2,1);
740 c7->cd(1)->SetBottomMargin(0.15);
741 c7->cd(1)->SetLeftMargin(0.15);
742 c7->cd(1)->SetGridx(); c7->cd(1)->SetGridy();
743 hEmptyY->SetTitle("Protons");
745 gYPrimaryProtonsPercentage->DrawCopy("ESAME");
746 gYSecondaryProtonsPercentage->DrawCopy("ESAME");
748 DrawMarker(0, 55, kFullCircle, 1.2, 1);
749 t1->DrawLatex(0.1,53,"Primaries");
750 DrawMarker(0, 45, kOpenCircle, 1.2, 1);
751 t1->DrawLatex(0.1,43,"Secondaries");
753 c7->cd(2)->SetBottomMargin(0.15);
754 c7->cd(2)->SetLeftMargin(0.15);
755 c7->cd(2)->SetGridx(); c7->cd(2)->SetGridy();
756 hEmptyY->SetTitle("Antiprotons");
758 gYPrimaryAntiProtonsPercentage->DrawCopy("ESAME");
759 gYSecondaryAntiProtonsPercentage->DrawCopy("ESAME");
761 DrawMarker(0, 55, kFullCircle, 1.2, 1);
762 t1->DrawLatex(0.1,53,"Primaries");
763 DrawMarker(0, 45, kOpenCircle, 1.2, 1);
764 t1->DrawLatex(0.1,41,"Secondaries");
766 c7->SaveAs("Contamination-Protons-Rapidity.gif");
770 TH1D *gPtPrimaryProtons = (TH1D *)hPrimaryProtons->ProjectionY("gPtPrimaryProtons",0,hPrimaryProtons->GetYaxis()->GetNbins(),"e");
771 TH1D *gPtSecondaryProtons = (TH1D *)hSecondaryProtons->ProjectionY("gPtSecondaryProtons",0,hSecondaryProtons->GetYaxis()->GetNbins(),"e");
772 TH1D *gPtTotalProtons = (TH1D *)hPrimaryProtons->ProjectionY("gPtTotalProtons",0,hPrimaryProtons->GetYaxis()->GetNbins(),"e");
773 gPtTotalProtons->Add(gPtSecondaryProtons);
775 TH1D *gPtPrimaryProtonsPercentage = new TH1D("gPtPrimaryProtonsPercentage",
777 hPrimaryProtons->GetYaxis()->GetNbins(),
778 hPrimaryProtons->GetYaxis()->GetXmin(),
779 hPrimaryProtons->GetYaxis()->GetXmax());
780 gPtPrimaryProtonsPercentage->Divide(gPtPrimaryProtons,
781 gPtTotalProtons,1.,1.0);
782 SetError(gPtPrimaryProtonsPercentage,gPtTotalProtons);
783 gPtPrimaryProtonsPercentage->Scale(100.);
784 gPtPrimaryProtonsPercentage->SetMarkerStyle(kFullCircle);
786 TH1D *gPtSecondaryProtonsPercentage = new TH1D("gPtSecondaryProtonsPercentage",
788 hSecondaryProtons->GetYaxis()->GetNbins(),
789 hSecondaryProtons->GetYaxis()->GetXmin(),
790 hSecondaryProtons->GetYaxis()->GetXmax());
791 gPtSecondaryProtonsPercentage->Divide(gPtSecondaryProtons,
792 gPtTotalProtons,1.,1.0);
793 SetError(gPtSecondaryProtonsPercentage,gPtTotalProtons);
794 gPtSecondaryProtonsPercentage->Scale(100.);
795 gPtSecondaryProtonsPercentage->SetMarkerStyle(kOpenCircle);
799 TH1D *gPtPrimaryAntiProtons = (TH1D *)hPrimaryAntiProtons->ProjectionY("gPtPrimaryAntiProtons",0,hPrimaryAntiProtons->GetYaxis()->GetNbins(),"e");
800 TH1D *gPtSecondaryAntiProtons = (TH1D *)hSecondaryAntiProtons->ProjectionY("gPtSecondaryAntiProtons",0,hSecondaryAntiProtons->GetYaxis()->GetNbins(),"e");
801 TH1D *gPtTotalAntiProtons = (TH1D *)hPrimaryAntiProtons->ProjectionY("gPtTotalAntiProtons",0,hPrimaryAntiProtons->GetYaxis()->GetNbins(),"e");
802 gPtTotalAntiProtons->Add(gPtSecondaryAntiProtons);
804 TH1D *gPtPrimaryAntiProtonsPercentage = new TH1D("gPtPrimaryAntiProtonsPercentage",
806 hPrimaryAntiProtons->GetYaxis()->GetNbins(),
807 hPrimaryAntiProtons->GetYaxis()->GetXmin(),
808 hPrimaryAntiProtons->GetYaxis()->GetXmax());
809 gPtPrimaryAntiProtonsPercentage->Divide(gPtPrimaryAntiProtons,
810 gPtTotalAntiProtons,1.,1.0);
811 SetError(gPtPrimaryAntiProtonsPercentage,gPtTotalAntiProtons);
812 gPtPrimaryAntiProtonsPercentage->Scale(100.);
813 gPtPrimaryAntiProtonsPercentage->SetMarkerStyle(kFullCircle);
815 TH1D *gPtSecondaryAntiProtonsPercentage = new TH1D("gPtSecondaryAntiProtonsPercentage",
817 hSecondaryAntiProtons->GetYaxis()->GetNbins(),
818 hSecondaryAntiProtons->GetYaxis()->GetXmin(),
819 hSecondaryAntiProtons->GetYaxis()->GetXmax());
820 gPtSecondaryAntiProtonsPercentage->Divide(gPtSecondaryAntiProtons,
821 gPtTotalAntiProtons,1.,1.0);
822 SetError(gPtSecondaryAntiProtonsPercentage,gPtTotalAntiProtons);
823 gPtSecondaryAntiProtonsPercentage->Scale(100.);
824 gPtSecondaryAntiProtonsPercentage->SetMarkerStyle(kOpenCircle);
826 TH2F *hEmptyPt = new TH2F("hEmptyCompositionPt","",
827 100,0.0,4.0,100,-10.0,130);
828 hEmptyPt->SetStats(kFALSE);
829 hEmptyPt->GetYaxis()->SetTitle("Particle composition [%]");
830 hEmptyPt->GetYaxis()->SetTitleOffset(1.3);
831 hEmptyPt->GetXaxis()->SetTitle("P_{T} [GeV/c]");
833 TCanvas *c8 = new TCanvas("c8","(Anti)Proton comtamination vs pT",
835 c8->SetHighLightColor(10); c8->Divide(2,1);
837 c8->cd(1)->SetBottomMargin(0.15);
838 c8->cd(1)->SetLeftMargin(0.15);
839 c8->cd(1)->SetGridx(); c8->cd(1)->SetGridy();
840 hEmptyPt->SetTitle("Protons");
841 hEmptyPt->GetXaxis()->SetRangeUser(gPtPrimaryProtonsPercentage->GetXaxis()->GetXmin()-0.2,gPtPrimaryProtonsPercentage->GetXaxis()->GetXmax()+0.2);
842 hEmptyPt->DrawCopy();
843 gPtPrimaryProtonsPercentage->DrawCopy("ESAME");
844 gPtSecondaryProtonsPercentage->DrawCopy("ESAME");
846 DrawMarker(0.5, 55, kFullCircle, 1.2, 1);
847 t1->DrawLatex(0.6,53,"Primaries");
848 DrawMarker(0.5, 45, kOpenCircle, 1.2, 1);
849 t1->DrawLatex(0.6,41,"Secondaries");
851 c8->cd(2)->SetBottomMargin(0.15);
852 c8->cd(2)->SetLeftMargin(0.15);
853 c8->cd(2)->SetGridx(); c8->cd(2)->SetGridy();
854 hEmptyPt->SetTitle("Antirotons");
855 hEmptyPt->DrawCopy();
856 gPtPrimaryAntiProtonsPercentage->DrawCopy("ESAME");
857 gPtSecondaryAntiProtonsPercentage->DrawCopy("ESAME");
859 DrawMarker(2.0, 55, kFullCircle, 1.2, 1);
860 t1->DrawLatex(2.1,53,"Primaries");
861 DrawMarker(2.0, 45, kOpenCircle, 1.2, 1);
862 t1->DrawLatex(2.1,43,"Secondaries");
864 c8->SaveAs("Contamination-Protons-Pt.gif");
866 TString outputFileName = "Contamination.";
867 outputFileName += analysisType; outputFileName += ".root";
868 TFile *fout = TFile::Open(outputFileName.Data(),"recreate");
869 gYPrimaryProtonsPercentage->Write();
870 gYSecondaryProtonsPercentage->Write();
871 gPtPrimaryProtonsPercentage->Write();
872 gPtSecondaryProtonsPercentage->Write();
873 gYPrimaryAntiProtonsPercentage->Write();
874 gYSecondaryAntiProtonsPercentage->Write();
875 gPtPrimaryAntiProtonsPercentage->Write();
876 gPtSecondaryAntiProtonsPercentage->Write();
880 //________________________________________________//
881 void DrawCutEfficiency(TList *inputList,
882 const char* analysisType) {
883 //loops over the list entries and
884 //draws the rapidity and pT dependence
885 //of the percentage of primary and secondary
886 //protons and antiprotons after the track cuts
887 cout<<"Extracting the entries for the histograms in the list: "<<
888 inputList->GetName()<<"..."<<endl;
890 TLatex *t1 = new TLatex();
891 t1->SetTextSize(0.04);
893 TH2F *hPrimaryESDProtons = (TH2F *)inputList->At(0);
894 TH2F *hPrimaryESDAntiProtons = (TH2F *)inputList->At(1);
895 TH2F *hPrimaryESDProtonsSurvived = (TH2F *)inputList->At(2);
896 TH2F *hPrimaryESDAntiProtonsSurvived = (TH2F *)inputList->At(3);
898 //rapidity dependence
900 TH1D *gYPrimaryESDProtons = (TH1D *)hPrimaryESDProtons->ProjectionX("gYPrimaryESDProtons",0,hPrimaryESDProtons->GetXaxis()->GetNbins(),"e");
901 TH1D *gYPrimaryESDProtonsSurvived = (TH1D *)hPrimaryESDProtonsSurvived->ProjectionX("gYPrimaryESDProtonsSurvived",0,hPrimaryESDProtonsSurvived->GetXaxis()->GetNbins(),"e");
902 gYPrimaryESDProtonsSurvived->Divide(gYPrimaryESDProtons);
903 SetError(gYPrimaryESDProtonsSurvived,gYPrimaryESDProtons);
904 gYPrimaryESDProtonsSurvived->Scale(100.);
905 gYPrimaryESDProtonsSurvived->SetMarkerStyle(kFullCircle);
908 TH1D *gYPrimaryESDAntiProtons = (TH1D *)hPrimaryESDAntiProtons->ProjectionX("gYPrimaryESDAntiProtons",0,hPrimaryESDAntiProtons->GetXaxis()->GetNbins(),"e");
909 TH1D *gYPrimaryESDAntiProtonsSurvived = (TH1D *)hPrimaryESDAntiProtonsSurvived->ProjectionX("gYPrimaryESDAntiProtonsSurvived",0,hPrimaryESDAntiProtonsSurvived->GetXaxis()->GetNbins(),"e");
910 gYPrimaryESDAntiProtonsSurvived->Divide(gYPrimaryESDAntiProtons);
911 SetError(gYPrimaryESDAntiProtonsSurvived,gYPrimaryESDAntiProtons);
912 gYPrimaryESDAntiProtonsSurvived->Scale(100.);
913 gYPrimaryESDAntiProtonsSurvived->SetMarkerStyle(kFullCircle);
915 TH2F *hEmptyY = new TH2F("hEmptyEfficiencyY","",
916 100,-1.2,1.2,100,-10.0,130);
917 hEmptyY->SetStats(kFALSE);
918 hEmptyY->GetYaxis()->SetTitle("#epsilon [%]");
919 hEmptyY->GetYaxis()->SetTitleOffset(1.3);
920 hEmptyY->GetXaxis()->SetTitle(hPrimaryESDProtonsSurvived->GetXaxis()->GetTitle());
922 TCanvas *c10 = new TCanvas("c10","(Anti)Proton cut efficiency vs y",
924 c10->SetHighLightColor(10); c10->Divide(2,1);
926 c10->cd(1)->SetBottomMargin(0.15);
927 c10->cd(1)->SetLeftMargin(0.15);
928 c10->cd(1)->SetGridx(); c10->cd(1)->SetGridy();
929 hEmptyY->SetTitle("Protons");
930 hEmptyY->GetXaxis()->SetRangeUser(gYPrimaryESDAntiProtonsSurvived->GetXaxis()->GetXmin()-0.2,gYPrimaryESDAntiProtonsSurvived->GetXaxis()->GetXmax()+0.2);
932 gYPrimaryESDProtonsSurvived->DrawCopy("ESAME");
934 c10->cd(2)->SetBottomMargin(0.15);
935 c10->cd(2)->SetLeftMargin(0.15);
936 c10->cd(2)->SetGridx(); c10->cd(2)->SetGridy();
937 hEmptyY->SetTitle("Antiprotons");
939 gYPrimaryESDAntiProtonsSurvived->DrawCopy("ESAME");
941 c10->SaveAs("CutEfficiency-Protons-Rapidity.gif");
945 TH1D *gPtPrimaryESDProtons = (TH1D *)hPrimaryESDProtons->ProjectionY("gPtPrimaryESDProtons",0,hPrimaryESDProtons->GetYaxis()->GetNbins(),"e");
946 TH1D *gPtPrimaryESDProtonsSurvived = (TH1D *)hPrimaryESDProtonsSurvived->ProjectionY("gPtPrimaryESDProtonsSurvived",0,hPrimaryESDProtonsSurvived->GetYaxis()->GetNbins(),"e");
947 gPtPrimaryESDProtonsSurvived->Divide(gPtPrimaryESDProtons);
948 SetError(gPtPrimaryESDProtonsSurvived,gPtPrimaryESDProtons);
949 gPtPrimaryESDProtonsSurvived->Scale(100.);
950 gPtPrimaryESDProtonsSurvived->SetMarkerStyle(kFullCircle);
953 TH1D *gPtPrimaryESDAntiProtons = (TH1D *)hPrimaryESDAntiProtons->ProjectionY("gPtPrimaryESDAntiProtons",0,hPrimaryESDAntiProtons->GetYaxis()->GetNbins(),"e");
954 TH1D *gPtPrimaryESDAntiProtonsSurvived = (TH1D *)hPrimaryESDAntiProtonsSurvived->ProjectionY("gPtPrimaryESDAntiProtonsSurvived",0,hPrimaryESDAntiProtonsSurvived->GetYaxis()->GetNbins(),"e");
955 gPtPrimaryESDAntiProtonsSurvived->Divide(gPtPrimaryESDAntiProtons);
956 SetError(gPtPrimaryESDAntiProtonsSurvived,gPtPrimaryESDAntiProtons);
957 gPtPrimaryESDAntiProtonsSurvived->Scale(100.);
958 gPtPrimaryESDAntiProtonsSurvived->SetMarkerStyle(kFullCircle);
960 TH2F *hEmptyPt = new TH2F("hEmptyEfficiencyPt","",
961 100,0.0,4.0,100,-10.0,130);
962 hEmptyPt->SetStats(kFALSE);
963 hEmptyPt->GetYaxis()->SetTitle("#epsilon [%]");
964 hEmptyPt->GetYaxis()->SetTitleOffset(1.3);
965 hEmptyPt->GetXaxis()->SetTitle("P_{T} [GeV/c]");
967 TCanvas *c11 = new TCanvas("c11","(Anti)Proton cut efficiency vs pT",
969 c11->SetHighLightColor(10); c11->Divide(2,1);
971 c11->cd(1)->SetBottomMargin(0.15);
972 c11->cd(1)->SetLeftMargin(0.15);
973 c11->cd(1)->SetGridx(); c11->cd(1)->SetGridy();
974 hEmptyPt->SetTitle("Protons");
975 hEmptyPt->GetXaxis()->SetRangeUser(gPtPrimaryESDAntiProtonsSurvived->GetXaxis()->GetXmin()-0.2,gPtPrimaryESDAntiProtonsSurvived->GetXaxis()->GetXmax()+0.2);
976 hEmptyPt->DrawCopy();
977 gPtPrimaryESDProtonsSurvived->DrawCopy("ESAME");
979 c11->cd(2)->SetBottomMargin(0.15);
980 c11->cd(2)->SetLeftMargin(0.15);
981 c11->cd(2)->SetGridx(); c11->cd(2)->SetGridy();
982 hEmptyPt->SetTitle("Antirotons");
983 hEmptyPt->DrawCopy();
984 gPtPrimaryESDAntiProtonsSurvived->DrawCopy("ESAME");
986 c11->SaveAs("CutEfficiency-Protons-Pt.gif");
988 TString outputFileName = "CutEfficiency.";
989 outputFileName += analysisType; outputFileName += ".root";
990 TFile *fout = TFile::Open(outputFileName.Data(),"recreate");
991 gYPrimaryESDProtonsSurvived->Write();
992 gYPrimaryESDAntiProtonsSurvived->Write();
993 gPtPrimaryESDProtonsSurvived->Write();
994 gPtPrimaryESDAntiProtonsSurvived->Write();
998 //________________________________________________//
999 void GetQAEntries(TList *inputList, Double_t *entries) {
1000 //loops over the list entries
1001 //extracts the entries for each histogram
1002 //cout<<"Extracting the entries for the histograms in the list: "<<
1003 //inputList->GetName()<<"..."<<endl;
1005 for(Int_t i = 0; i < inputList->GetEntries(); i++) {
1006 TH1F *gHist = (TH1F *)inputList->At(i);
1007 entries[i] = gHist->GetEntries();
1008 cout<<"Position: "<<i+1<<" - Histogram: "<<gHist->GetName()<<
1009 " - Entries: "<<entries[i]<<endl;
1014 //________________________________________________//
1015 Double_t GetPercentage(Double_t nPassEntries,
1016 Double_t nRejectEntries) {
1017 //returns the percentage of tracks that were rejected by a cut
1018 Int_t nTotalEntries = nPassEntries + nRejectEntries;
1020 if(nTotalEntries == 0)
1023 return 100.*nRejectEntries/nTotalEntries;
1026 //________________________________________//
1027 void drawMCQA(TList *listPDG, TList *listMCProcesses) {
1028 //Function to display the composition of secondary (anti)protons
1029 //The histogram shows the percentage of secondary (anti)protons
1030 //originating from each particle species.
1031 //The box summarizes the MC process that gave these secondary (anti)protons
1032 TDatabasePDG *db = TDatabasePDG::Instance();
1033 TParticlePDG *p = 0x0;
1035 TH3F *gHistYPtPDGProtons = (TH3F *)listPDG->At(0);
1036 TH3F *gHistYPtPDGAntiProtons = (TH3F *)listPDG->At(1);
1037 readProcesses(listMCProcesses);
1038 Double_t nParticleCompositionProtonY[200], nParticleCompositionProtonPt[200];
1039 Double_t nParticleCompositionProtonYError[200], nParticleCompositionProtonPtError[200];
1040 Double_t nParticleCompositionAntiProtonY[200], nParticleCompositionAntiProtonPt[200];
1041 Double_t nParticleCompositionAntiProtonYError[200], nParticleCompositionAntiProtonPtError[200];
1042 Double_t gY[200], gPt[200];
1043 Double_t gYError[200], gPtError[200];
1044 for(Int_t iBins = 0; iBins < 200; iBins++) {
1045 nParticleCompositionProtonY[iBins] = 0;
1046 nParticleCompositionProtonPt[iBins] = 0;
1047 nParticleCompositionProtonYError[iBins] = 0;
1048 nParticleCompositionProtonPtError[iBins] = 0;
1049 nParticleCompositionAntiProtonY[iBins] = 0;
1050 nParticleCompositionAntiProtonPt[iBins] = 0;
1051 nParticleCompositionAntiProtonYError[iBins] = 0;
1052 nParticleCompositionAntiProtonPtError[iBins] = 0;
1056 gPtError[iBins] = 0;
1059 TGraphErrors *gParticleProtonY[14];
1060 TGraphErrors *gParticleProtonPt[14];
1061 TGraphErrors *gParticleAntiProtonY[14];
1062 TGraphErrors *gParticleAntiProtonPt[14];
1063 for(Int_t iParticle = 0; iParticle < 14; iParticle++) {
1064 GetComposition(iParticle,
1066 nParticleCompositionProtonY,
1067 nParticleCompositionProtonYError, gY, gYError,
1068 nParticleCompositionProtonPt,
1069 nParticleCompositionProtonPtError, gPt, gPtError);
1070 gParticleProtonY[iParticle] = new TGraphErrors(gHistYPtPDGProtons->GetNbinsX(),
1071 gY,nParticleCompositionProtonY,
1072 gYError,nParticleCompositionProtonYError);
1073 gParticleProtonY[iParticle]->SetMarkerStyle(iParticle+20);
1074 gParticleProtonY[iParticle]->SetMarkerSize(1.2);
1076 gParticleProtonPt[iParticle] = new TGraphErrors(gHistYPtPDGProtons->GetNbinsY(),
1077 gPt,nParticleCompositionProtonPt,
1078 gPtError,nParticleCompositionProtonPtError);
1079 gParticleProtonPt[iParticle]->SetMarkerStyle(iParticle+20);
1080 gParticleProtonPt[iParticle]->SetMarkerSize(1.2);
1082 GetComposition(iParticle,
1083 gHistYPtPDGAntiProtons,
1084 nParticleCompositionAntiProtonY,
1085 nParticleCompositionAntiProtonYError, gY, gYError,
1086 nParticleCompositionAntiProtonPt,
1087 nParticleCompositionAntiProtonPtError, gPt, gPtError);
1088 gParticleAntiProtonY[iParticle] = new TGraphErrors(gHistYPtPDGAntiProtons->GetNbinsX(),
1089 gY,nParticleCompositionAntiProtonY,
1090 gYError,nParticleCompositionAntiProtonYError);
1091 gParticleAntiProtonY[iParticle]->SetMarkerStyle(iParticle+20);
1092 gParticleAntiProtonY[iParticle]->SetMarkerSize(1.2);
1094 gParticleAntiProtonPt[iParticle] = new TGraphErrors(gHistYPtPDGAntiProtons->GetNbinsY(),
1095 gPt,nParticleCompositionAntiProtonPt,
1096 gPtError,nParticleCompositionAntiProtonPtError);
1097 gParticleAntiProtonPt[iParticle]->SetMarkerStyle(iParticle+20);
1098 gParticleAntiProtonPt[iParticle]->SetMarkerSize(1.2);
1101 //_________________________________________________________//
1102 char *fParticleName[14] = {"Primary","K_{L}","#pi","K_{S}","K",
1103 "n","p","#Sigma^{-}","#Lambda","#Sigma^{+}",
1104 "#Xi^{-}","#Xi^{0}","#Omega^{-}"};
1105 TLatex *t1 = new TLatex();
1106 t1->SetTextSize(0.04);
1108 TH2F *hEmptyY = new TH2F("hEmptyY","",100,-1.2,1.2,100,0,120);
1109 hEmptyY->SetStats(kFALSE);
1110 hEmptyY->GetYaxis()->SetTitle("Particle composition [%]");
1111 hEmptyY->GetXaxis()->SetTitle(gHistYPtPDGProtons->GetXaxis()->GetTitle());
1113 TCanvas *c3 = new TCanvas("c3","MC secondary composition vs y - Protons",
1115 c3->SetHighLightColor(10); c3->SetBottomMargin(0.15);
1116 c3->SetGridx(); c3->SetGridy();
1117 hEmptyY->GetXaxis()->SetRangeUser(gParticleProtonY[0]->GetXaxis()->GetXmin()-0.2,gParticleProtonY[0]->GetXaxis()->GetXmax()+0.2);
1118 hEmptyY->DrawCopy();
1119 for(Int_t iParticle = 0; iParticle < 10; iParticle++) {
1120 //if((iParticle == 0)||(iParticle == 2)||(iParticle == 5)||(iParticle == 6)||(iParticle == 8))
1121 if((iParticle == 0)||(iParticle == 2)||(iParticle == 6)||(iParticle == 8))
1122 gParticleProtonY[iParticle]->Draw("P");
1123 /*if(iParticle < 5) {
1124 DrawMarker(-1.1, 115-5*iParticle, 20+iParticle, 1.2, 1);
1125 t1->DrawLatex(-1.0,113-5*iParticle,fParticleName[iParticle]);
1128 DrawMarker(0.2, 115-5*(iParticle-5), 20+iParticle, 1.2, 1);
1129 t1->DrawLatex(0.3,113-5*(iParticle-5),fParticleName[iParticle]);
1132 DrawMarker(0.0, 115, 20, 1.2, 1);
1133 t1->DrawLatex(0.1,113,fParticleName[0]);
1134 DrawMarker(0.0, 108, 22, 1.2, 1);
1135 t1->DrawLatex(0.1,106,fParticleName[2]);
1136 DrawMarker(0.0, 101, 26, 1.2, 1);
1137 t1->DrawLatex(0.1,99,fParticleName[6]);
1138 DrawMarker(0.0, 94, 28, 1.2, 1);
1139 t1->DrawLatex(0.1,92,fParticleName[8]);
1141 TCanvas *c5 = new TCanvas("c5","MC secondary composition vs y - antiProtons",
1143 c5->SetHighLightColor(10); c5->SetBottomMargin(0.15);
1144 c5->SetGridx(); c5->SetGridy();
1145 hEmptyY->DrawCopy();
1146 for(Int_t iParticle = 0; iParticle < 10; iParticle++) {
1147 if((iParticle == 0)||(iParticle == 6)||(iParticle == 8))
1148 gParticleAntiProtonY[iParticle]->Draw("P");
1149 /*if(iParticle < 5) {
1150 DrawMarker(-1.1, 115-5*iParticle, 20+iParticle, 1.2, 1);
1151 t1->DrawLatex(-1.0,113-5*iParticle,fParticleName[iParticle]);
1154 DrawMarker(0.2, 115-5*(iParticle-5), 20+iParticle, 1.2, 1);
1155 t1->DrawLatex(0.3,113-5*(iParticle-5),fParticleName[iParticle]);
1158 DrawMarker(0.0, 115, 20, 1.2, 1);
1159 t1->DrawLatex(0.1,113,fParticleName[0]);
1160 DrawMarker(0.0, 108, 26, 1.2, 1);
1161 t1->DrawLatex(0.1,106,fParticleName[6]);
1162 DrawMarker(0.0, 101, 28, 1.2, 1);
1163 t1->DrawLatex(0.1,99,fParticleName[8]);
1165 TH2F *hEmptyPt = new TH2F("hEmptyPt","",100,0.0,4.0,100,0,120);
1166 hEmptyPt->SetStats(kFALSE);
1167 hEmptyPt->GetYaxis()->SetTitle("Particle composition [%]");
1168 hEmptyPt->GetXaxis()->SetTitle("P_{T} [GeV/c]");
1170 TCanvas *c4 = new TCanvas("c4","MC secondary composition vs pT - Protons",
1172 c4->SetHighLightColor(10); c4->SetBottomMargin(0.15);
1173 c4->SetGridx(); c4->SetGridy();
1174 hEmptyPt->GetXaxis()->SetRangeUser(gParticleProtonPt[0]->GetXaxis()->GetXmin()-0.2,gParticleProtonPt[0]->GetXaxis()->GetXmax()+0.2);
1175 hEmptyPt->DrawCopy();
1176 for(Int_t iParticle = 0; iParticle < 10; iParticle++) {
1177 /*if(iParticle < 5) {
1178 DrawMarker(0.2, 115-5*iParticle, 20+iParticle, 1.2, 1);
1179 t1->DrawLatex(0.3,113-5*iParticle,fParticleName[iParticle]);
1182 DrawMarker(2.2, 115-5*(iParticle-5), 20+iParticle, 1.2, 1);
1183 t1->DrawLatex(2.3,113-5*(iParticle-5),fParticleName[iParticle]);
1185 if((iParticle == 0)||(iParticle == 2)||(iParticle == 6)||(iParticle == 8))
1186 gParticleProtonPt[iParticle]->Draw("P");
1188 DrawMarker(0.5, 115, 20, 1.2, 1);
1189 t1->DrawLatex(0.6,113,fParticleName[0]);
1190 DrawMarker(0.5, 108, 22, 1.2, 1);
1191 t1->DrawLatex(0.6,106,fParticleName[2]);
1192 DrawMarker(0.5, 101, 26, 1.2, 1);
1193 t1->DrawLatex(0.6,99,fParticleName[6]);
1194 DrawMarker(0.5, 94, 28, 1.2, 1);
1195 t1->DrawLatex(0.6,92,fParticleName[8]);
1197 TCanvas *c6 = new TCanvas("c6",
1198 "MC secondary composition vs pT - AntiProtons",
1200 c6->SetHighLightColor(10); c6->SetBottomMargin(0.15);
1201 c6->SetGridx(); c6->SetGridy();
1202 hEmptyPt->DrawCopy();
1203 for(Int_t iParticle = 0; iParticle < 10; iParticle++) {
1204 /*if(iParticle < 5) {
1205 DrawMarker(0.2, 115-5*iParticle, 20+iParticle, 1.2, 1);
1206 t1->DrawLatex(0.3,113-5*iParticle,fParticleName[iParticle]);
1209 DrawMarker(2.2, 115-5*(iParticle-5), 20+iParticle, 1.2, 1);
1210 t1->DrawLatex(2.3,113-5*(iParticle-5),fParticleName[iParticle]);
1212 if((iParticle == 0)||(iParticle == 6)||(iParticle == 8))
1213 gParticleAntiProtonPt[iParticle]->Draw("P");
1215 DrawMarker(0.5, 115, 20, 1.2, 1);
1216 t1->DrawLatex(0.6,113,fParticleName[0]);
1217 DrawMarker(0.5, 108, 26, 1.2, 1);
1218 t1->DrawLatex(0.6,106,fParticleName[6]);
1219 DrawMarker(0.5, 101, 28, 1.2, 1);
1220 t1->DrawLatex(0.6,99,fParticleName[8]);
1223 //________________________________________//
1224 void GetComposition(Int_t iSpecies,
1226 Double_t *nParticleCompositionY,
1227 Double_t *nParticleCompositionYError,
1228 Double_t *gY, Double_t *gYError,
1229 Double_t *nParticleCompositionPt,
1230 Double_t *nParticleCompositionPtError,
1231 Double_t *gPt, Double_t *gPtError) {
1232 //Returns the pT and y dependence of the MC composition
1233 Double_t ymin = gHist->GetXaxis()->GetXmin();
1234 Double_t ymax = gHist->GetXaxis()->GetXmax();
1235 Double_t nybins = gHist->GetNbinsX();
1236 Double_t ptmin = gHist->GetYaxis()->GetXmin();
1237 Double_t ptmax = gHist->GetYaxis()->GetXmax();
1238 Double_t nptbins = gHist->GetNbinsY();
1239 Double_t nTotalY[200], nTotalPt[200];
1240 for(Int_t iBins = 0; iBins < 200; iBins++) {
1241 nParticleCompositionY[iBins] = 0;
1242 nParticleCompositionPt[iBins] = 0;
1243 nParticleCompositionYError[iBins] = 0;
1244 nParticleCompositionPtError[iBins] = 0;
1245 nTotalY[iBins] = 0.0;
1246 nTotalPt[iBins] = 0.0;
1249 //rapidity dependence
1250 //cout<<"Ymin: "<<ymin<<" - Ymax: "<<ymax<<" - Ybins: "<<nybins<<endl;
1251 for(Int_t iXbins = 1; iXbins <= gHist->GetNbinsX(); iXbins++) {
1252 for(Int_t iZbins = 1; iZbins <= gHist->GetNbinsZ(); iZbins++) {
1253 for(Int_t iYbins = 1; iYbins <= gHist->GetNbinsY(); iYbins++) {
1254 nTotalY[iXbins-1] += gHist->GetBinContent(iXbins,iYbins,iZbins);
1259 for(Int_t iXbins = 1; iXbins <= gHist->GetNbinsX(); iXbins++) {
1260 for(Int_t iYbins = 1; iYbins <= gHist->GetNbinsY(); iYbins++) {
1261 if(nTotalY[iXbins-1] > 0)
1262 nParticleCompositionY[iXbins-1] += 100.*gHist->GetBinContent(iXbins,iYbins,iSpecies+1)/nTotalY[iXbins-1];
1263 //nCompositionY[iXbins-1] += gHist->GetBinContent(iXbins,iYbins,iSpecies+1);
1264 //if(nParticleCompositionY[iXbins-1] == 0)
1265 //nParticleCompositionY[iXbins-1] = -10.0;
1267 if((nParticleCompositionY[iXbins-1] <= 100.)&&(nTotalY[iXbins-1] != 0))
1268 nParticleCompositionYError[iXbins-1] = TMath::Sqrt(nParticleCompositionY[iXbins-1]*(100. - nParticleCompositionY[iXbins-1])/nTotalY[iXbins-1]);
1269 gY[iXbins-1] = ymin + (iXbins-1)*(ymax - ymin)/nybins + 0.5*(ymax - ymin)/nybins;
1270 gYError[iXbins-1] = 0.5*(ymax - ymin)/nybins;
1271 //cout<<"y: "<<gY[iXbins-1]<<
1272 //" - test: "<<ymin + (iXbins-1)*(ymax - ymin)/nybins + 0.5*(ymax - ymin)/nybins<<
1273 //" - Number of protons: "<<nY[iXbins-1]<<
1274 //" - Total: "<<nTotalY[iXbins-1]<<
1275 //" - Percentage: "<<nParticleCompositionY[iXbins-1]<<endl;
1279 //cout<<"Ptmin: "<<ptmin<<" - Ptmax: "<<ptmax<<" - Ptbins: "<<nptbins<<endl;
1280 for(Int_t iYbins = 1; iYbins <= gHist->GetNbinsY(); iYbins++) {
1281 for(Int_t iZbins = 1; iZbins <= gHist->GetNbinsZ(); iZbins++) {
1282 for(Int_t iXbins = 1; iXbins <= gHist->GetNbinsX(); iXbins++) {
1283 nTotalPt[iYbins-1] += gHist->GetBinContent(iXbins,iYbins,iZbins);
1288 for(Int_t iYbins = 1; iYbins <= gHist->GetNbinsY(); iYbins++) {
1289 for(Int_t iXbins = 1; iXbins <= gHist->GetNbinsX(); iXbins++) {
1290 if(nTotalPt[iYbins-1] > 0)
1291 nParticleCompositionPt[iYbins-1] += 100.*gHist->GetBinContent(iXbins,iYbins,iSpecies+1)/nTotalPt[iYbins-1];
1292 //if(nParticleCompositionPt[iYbins-1] == 0)
1293 //nParticleCompositionPt[iYbins-1] = -10.0;
1295 if((nParticleCompositionPt[iYbins-1] <= 100.)&&(nTotalPt[iYbins-1] != 0))
1296 nParticleCompositionPtError[iYbins-1] = TMath::Sqrt(nParticleCompositionPt[iYbins-1]*(100. - nParticleCompositionPt[iYbins-1])/nTotalPt[iYbins-1]);
1297 gPt[iYbins-1] = ptmin + (iYbins-1)*(ptmax - ptmin)/nptbins + 0.5*(ptmax - ptmin)/nptbins;
1298 gPtError[iYbins-1] = 0.5*(ptmax - ptmin)/nptbins;
1299 //cout<<"Pt: "<<gPt[iYbins-1]<<
1300 //" - test: "<<ptmin + (iYbins-1)*(ptmax - ptmin)/nptbins + 0.5*(ptmax - ptmin)/nptbins<<
1301 //" - Number of protons: "<<nY[iXbins-1]<<
1302 //" - Total: "<<nTotalPt[iYbins-1]<<
1303 //" - Percentage: "<<nParticleCompositionPt[iYbins-1]<<endl;
1307 //________________________________________//
1308 void readProcesses(TList *list) {
1309 char *fParticleProtonName[12] = {"K_{L}","#pi","K_{S}","K",
1310 "n","p","#Sigma^{-}","#Lambda","#Sigma^{+}",
1311 "#Xi^{-}","#Xi^{0}","#Omega^{-}"};
1312 char *fParticleAntiProtonName[8] = {"K_{L}","#pi","K_{S}","K",
1313 "n","p","#Lambda","#Sigma^{+}"};
1314 Int_t iProtonCounter = 0, iAntiProtonCounter = 0;
1316 for(Int_t iEntry = 0; iEntry < list->GetEntries(); iEntry++) {
1317 gMCProcesses = (TH1F *)list->At(iEntry);
1318 TString histName = gMCProcesses->GetName();
1319 if(histName.Contains("gHistProtons")) {
1320 cout<<"Protons coming from "<<fParticleProtonName[iProtonCounter]<<endl;
1322 iProtonCounter += 1;
1324 if(histName.Contains("gHistAntiProtons")) {
1325 cout<<"Antiprotons coming from "<<fParticleAntiProtonName[iAntiProtonCounter]<<endl;
1327 iAntiProtonCounter += 1;
1329 for(Int_t iBin = 1; iBin < gMCProcesses->GetNbinsX(); iBin++) {
1330 Double_t binContent = gMCProcesses->GetBinContent(iBin);
1331 if(binContent > 0) {
1332 Int_t processId = gMCProcesses->GetBinCenter(iBin);
1333 cout<<"\t Process ID: "<<processId<<" - "<<
1334 gMCProcessName[processId]<<" - "<<
1335 100.*binContent/gMCProcesses->GetEntries()<<"%"<<endl;
1341 //________________________________________________//
1342 void SetError(TH1 *hEff, TH1 *hGen) {
1343 for(Int_t iBin = 1; iBin <= hEff->GetNbinsX(); iBin++) {
1344 Double_t error = 0.0;
1345 if((hEff->GetBinContent(iBin) <= 1 .)&&(hGen->GetBinContent(iBin) != 0))
1346 error = TMath::Sqrt(hEff->GetBinContent(iBin)*(1 . - hEff->GetBinContent(iBin))/hGen->GetBinContent(iBin));
1347 hEff->SetBinError(iBin,error);
1351 //________________________________________//
1352 void drawVertexQA(TList *list) {
1353 //Function to display the vertex QA plots
1354 TH1I *gHistMCPrimaryMultiplicity = (TH1I *)list->At(0);
1356 TH1I *gHistMCPrimaryMultiplicityTPC = (TH1I *)list->At(1);
1357 TH2F *gHistTPCESDVx = (TH2F *)list->At(2);
1358 TH2F *gHistTPCESDVy = (TH2F *)list->At(3);
1359 TH2F *gHistTPCESDVz = (TH2F *)list->At(4);
1360 TH1F *gHistTPCDiffVx = (TH1F *)list->At(5);
1361 TH1F *gHistTPCDiffVy = (TH1F *)list->At(6);
1362 TH1F *gHistTPCDiffVz = (TH1F *)list->At(7);
1363 TH1F *gHistTPCResolutionVx = (TH1F *)list->At(8);
1364 TH1F *gHistTPCResolutionVy = (TH1F *)list->At(9);
1365 TH1F *gHistTPCResolutionVz = (TH1F *)list->At(10);
1367 TH1I *gHistMCPrimaryMultiplicitySPD = (TH1I *)list->At(11);
1368 TH2F *gHistSPDESDVx = (TH2F *)list->At(12);
1369 TH2F *gHistSPDESDVy = (TH2F *)list->At(13);
1370 TH2F *gHistSPDESDVz = (TH2F *)list->At(14);
1371 TH1F *gHistSPDDiffVx = (TH1F *)list->At(15);
1372 TH1F *gHistSPDDiffVy = (TH1F *)list->At(16);
1373 TH1F *gHistSPDDiffVz = (TH1F *)list->At(17);
1374 TH1F *gHistSPDResolutionVx = (TH1F *)list->At(18);
1375 TH1F *gHistSPDResolutionVy = (TH1F *)list->At(19);
1376 TH1F *gHistSPDResolutionVz = (TH1F *)list->At(20);
1378 TH1I *gHistMCPrimaryMultiplicityTracks = (TH1I *)list->At(21);
1379 TH2F *gHistTracksESDVx = (TH2F *)list->At(22);
1380 TH2F *gHistTracksESDVy = (TH2F *)list->At(23);
1381 TH2F *gHistTracksESDVz = (TH2F *)list->At(24);
1382 TH1F *gHistTracksDiffVx = (TH1F *)list->At(25);
1383 TH1F *gHistTracksDiffVy = (TH1F *)list->At(26);
1384 TH1F *gHistTracksDiffVz = (TH1F *)list->At(27);
1385 TH1F *gHistTracksResolutionVx = (TH1F *)list->At(28);
1386 TH1F *gHistTracksResolutionVy = (TH1F *)list->At(29);
1387 TH1F *gHistTracksResolutionVz = (TH1F *)list->At(30);
1389 TCanvas *c17 = new TCanvas("c17",
1390 "Vertex efficiency",
1392 c17->SetHighLightColor(10); c17->Divide(3,1);
1393 c17->cd(1)->SetLeftMargin(0.15); c17->cd(1)->SetBottomMargin(0.15);
1394 c17->cd(1)->SetRightMargin(0.2);
1395 c17->cd(1)->SetGridx(); c17->cd(1)->SetGridy();
1396 gHistMCPrimaryMultiplicityTPC->SetTitle("TPC vertex");
1397 gHistMCPrimaryMultiplicityTPC->Divide(gHistMCPrimaryMultiplicity);
1398 SetError(gHistMCPrimaryMultiplicityTPC,gHistMCPrimaryMultiplicity);
1399 gHistMCPrimaryMultiplicityTPC->SetMaximum(110.);
1400 gHistMCPrimaryMultiplicityTPC->Scale(100.);
1401 gHistMCPrimaryMultiplicityTPC->SetMarkerStyle(20);
1402 gHistMCPrimaryMultiplicityTPC->SetMarkerColor(1);
1403 gHistMCPrimaryMultiplicityTPC->GetYaxis()->SetTitle("#epsilon [%]");
1404 gHistMCPrimaryMultiplicityTPC->SetStats(kFALSE);
1405 gHistMCPrimaryMultiplicityTPC->Draw("E");
1406 c17->cd(2)->SetLeftMargin(0.15); c17->cd(2)->SetBottomMargin(0.15);
1407 c17->cd(2)->SetRightMargin(0.2);
1408 c17->cd(2)->SetGridx(); c17->cd(2)->SetGridy();
1409 gHistMCPrimaryMultiplicitySPD->SetTitle("SPD vertex");
1410 gHistMCPrimaryMultiplicitySPD->Divide(gHistMCPrimaryMultiplicity);
1411 SetError(gHistMCPrimaryMultiplicitySPD,gHistMCPrimaryMultiplicity);
1412 gHistMCPrimaryMultiplicitySPD->SetMaximum(110.);
1413 gHistMCPrimaryMultiplicitySPD->Scale(100.);
1414 gHistMCPrimaryMultiplicitySPD->SetMarkerStyle(20);
1415 gHistMCPrimaryMultiplicitySPD->SetMarkerColor(1);
1416 gHistMCPrimaryMultiplicitySPD->GetYaxis()->SetTitle("#epsilon [%]");
1417 gHistMCPrimaryMultiplicitySPD->SetStats(kFALSE);
1418 gHistMCPrimaryMultiplicitySPD->Draw("E");
1419 c17->cd(3)->SetLeftMargin(0.15); c17->cd(3)->SetBottomMargin(0.15);
1420 c17->cd(3)->SetRightMargin(0.2);
1421 c17->cd(3)->SetGridx(); c17->cd(3)->SetGridy();
1422 gHistMCPrimaryMultiplicityTracks->SetTitle("Vertex from tracks");
1423 gHistMCPrimaryMultiplicityTracks->Divide(gHistMCPrimaryMultiplicity);
1424 SetError(gHistMCPrimaryMultiplicityTracks,gHistMCPrimaryMultiplicity);
1425 gHistMCPrimaryMultiplicityTracks->SetMaximum(110.);
1426 gHistMCPrimaryMultiplicityTracks->Scale(100.);
1427 gHistMCPrimaryMultiplicityTracks->SetMarkerStyle(20);
1428 gHistMCPrimaryMultiplicityTracks->SetMarkerColor(1);
1429 gHistMCPrimaryMultiplicityTracks->GetYaxis()->SetTitle("#epsilon [%]");
1430 gHistMCPrimaryMultiplicityTracks->SetStats(kFALSE);
1431 gHistMCPrimaryMultiplicityTracks->Draw("E");
1432 c17->SaveAs("VertexEfficiency.gif");
1435 TCanvas *c18 = new TCanvas("c18",
1438 c18->SetHighLightColor(10); c18->Divide(3,3);
1439 c18->cd(1)->SetLeftMargin(0.15); c18->cd(1)->SetBottomMargin(0.15);
1440 c18->cd(1)->SetRightMargin(0.2); c18->cd(1)->SetLogy();
1441 gHistTPCESDVx->Draw("col");
1442 c18->cd(2)->SetLeftMargin(0.15); c18->cd(2)->SetBottomMargin(0.15);
1443 c18->cd(2)->SetRightMargin(0.2); c18->cd(2)->SetLogy();
1444 gHistTPCESDVy->Draw("col");
1445 c18->cd(3)->SetLeftMargin(0.15); c18->cd(3)->SetBottomMargin(0.15);
1446 c18->cd(3)->SetRightMargin(0.2); c18->cd(3)->SetLogy();
1447 gHistTPCESDVz->Draw("col");
1448 c18->cd(4)->SetLeftMargin(0.15); c18->cd(4)->SetBottomMargin(0.15);
1449 c18->cd(4)->SetRightMargin(0.2); c18->cd(4)->SetLogy();
1450 gHistTPCDiffVx->Draw();
1451 c18->cd(5)->SetLeftMargin(0.15); c18->cd(5)->SetBottomMargin(0.15);
1452 c18->cd(5)->SetRightMargin(0.2); c18->cd(5)->SetLogy();
1453 gHistTPCDiffVy->Draw();
1454 c18->cd(6)->SetLeftMargin(0.15); c18->cd(6)->SetBottomMargin(0.15);
1455 c18->cd(6)->SetRightMargin(0.2); c18->cd(6)->SetLogy();
1456 gHistTPCDiffVz->Draw();
1457 c18->cd(7)->SetLeftMargin(0.15); c18->cd(7)->SetBottomMargin(0.15);
1458 c18->cd(7)->SetRightMargin(0.2); c18->cd(7)->SetLogy();
1459 gHistTPCResolutionVx->Draw();
1460 c18->cd(8)->SetLeftMargin(0.15); c18->cd(8)->SetBottomMargin(0.15);
1461 c18->cd(8)->SetRightMargin(0.2); c18->cd(8)->SetLogy();
1462 gHistTPCResolutionVy->Draw();
1463 c18->cd(9)->SetLeftMargin(0.15); c18->cd(9)->SetBottomMargin(0.15);
1464 c18->cd(9)->SetRightMargin(0.2); c18->cd(9)->SetLogy();
1465 gHistTPCResolutionVz->Draw();
1466 c18->SaveAs("VertexTPC.gif");
1469 TCanvas *c19 = new TCanvas("c19",
1472 c19->SetHighLightColor(10); c19->Divide(3,3);
1473 c19->cd(1)->SetLeftMargin(0.15); c19->cd(1)->SetBottomMargin(0.15);
1474 c19->cd(1)->SetRightMargin(0.2); c19->cd(1)->SetLogy();
1475 gHistSPDESDVx->Draw("col");
1476 c19->cd(2)->SetLeftMargin(0.15); c19->cd(2)->SetBottomMargin(0.15);
1477 c19->cd(2)->SetRightMargin(0.2); c19->cd(2)->SetLogy();
1478 gHistSPDESDVy->Draw("col");
1479 c19->cd(3)->SetLeftMargin(0.15); c19->cd(3)->SetBottomMargin(0.15);
1480 c19->cd(3)->SetRightMargin(0.2); c19->cd(3)->SetLogy();
1481 gHistSPDESDVz->Draw("col");
1482 c19->cd(4)->SetLeftMargin(0.15); c19->cd(4)->SetBottomMargin(0.15);
1483 c19->cd(4)->SetRightMargin(0.2); c19->cd(4)->SetLogy();
1484 gHistSPDDiffVx->Draw();
1485 c19->cd(5)->SetLeftMargin(0.15); c19->cd(5)->SetBottomMargin(0.15);
1486 c19->cd(5)->SetRightMargin(0.2); c19->cd(5)->SetLogy();
1487 gHistSPDDiffVy->Draw();
1488 c19->cd(6)->SetLeftMargin(0.15); c19->cd(6)->SetBottomMargin(0.15);
1489 c19->cd(6)->SetRightMargin(0.2); c19->cd(6)->SetLogy();
1490 gHistSPDDiffVz->Draw();
1491 c19->cd(7)->SetLeftMargin(0.15); c19->cd(7)->SetBottomMargin(0.15);
1492 c19->cd(7)->SetRightMargin(0.2); c19->cd(7)->SetLogy();
1493 gHistSPDResolutionVx->Draw();
1494 c19->cd(8)->SetLeftMargin(0.15); c19->cd(8)->SetBottomMargin(0.15);
1495 c19->cd(8)->SetRightMargin(0.2); c19->cd(8)->SetLogy();
1496 gHistSPDResolutionVy->Draw();
1497 c19->cd(9)->SetLeftMargin(0.15); c19->cd(9)->SetBottomMargin(0.15);
1498 c19->cd(9)->SetRightMargin(0.2); c19->cd(9)->SetLogy();
1499 gHistSPDResolutionVz->Draw();
1500 c19->SaveAs("VertexSPD.gif");
1503 TCanvas *c20 = new TCanvas("c20",
1506 c20->SetHighLightColor(10); c20->Divide(3,3);
1507 c20->cd(1)->SetLeftMargin(0.15); c20->cd(1)->SetBottomMargin(0.15);
1508 c20->cd(1)->SetRightMargin(0.2); c20->cd(1)->SetLogy();
1509 gHistTracksESDVx->Draw("col");
1510 c20->cd(2)->SetLeftMargin(0.15); c20->cd(2)->SetBottomMargin(0.15);
1511 c20->cd(2)->SetRightMargin(0.2); c20->cd(2)->SetLogy();
1512 gHistTracksESDVy->Draw("col");
1513 c20->cd(3)->SetLeftMargin(0.15); c20->cd(3)->SetBottomMargin(0.15);
1514 c20->cd(3)->SetRightMargin(0.2); c20->cd(3)->SetLogy();
1515 gHistTracksESDVz->Draw("col");
1516 c20->cd(4)->SetLeftMargin(0.15); c20->cd(4)->SetBottomMargin(0.15);
1517 c20->cd(4)->SetRightMargin(0.2); c20->cd(4)->SetLogy();
1518 gHistTracksDiffVx->Draw();
1519 c20->cd(5)->SetLeftMargin(0.15); c20->cd(5)->SetBottomMargin(0.15);
1520 c20->cd(5)->SetRightMargin(0.2); c20->cd(5)->SetLogy();
1521 gHistTracksDiffVy->Draw();
1522 c20->cd(6)->SetLeftMargin(0.15); c20->cd(6)->SetBottomMargin(0.15);
1523 c20->cd(6)->SetRightMargin(0.2); c20->cd(6)->SetLogy();
1524 gHistTracksDiffVz->Draw();
1525 c20->cd(7)->SetLeftMargin(0.15); c20->cd(7)->SetBottomMargin(0.15);
1526 c20->cd(7)->SetRightMargin(0.2); c20->cd(7)->SetLogy();
1527 gHistTracksResolutionVx->Draw();
1528 c20->cd(8)->SetLeftMargin(0.15); c20->cd(8)->SetBottomMargin(0.15);
1529 c20->cd(8)->SetRightMargin(0.2); c20->cd(8)->SetLogy();
1530 gHistTracksResolutionVy->Draw();
1531 c20->cd(9)->SetLeftMargin(0.15); c20->cd(9)->SetBottomMargin(0.15);
1532 c20->cd(9)->SetRightMargin(0.2); c20->cd(9)->SetLogy();
1533 gHistTracksResolutionVz->Draw();
1534 c20->SaveAs("VertexTracks.gif");
1537 //________________________________________//
1538 void drawEfficiency(TList *list,
1539 const char* analysisType) {
1540 //Function to display the reconstruction and PID efficiencies
1541 //for protons and antiprotons vs y and pT
1543 TH2F *hEmpty = new TH2F("hEmptyReconstructionEfficiency","",
1544 1000,-1.2,210.,100,-10.0,130);
1545 hEmpty->SetStats(kFALSE);
1546 hEmpty->GetYaxis()->SetTitle("#epsilon [%]");
1547 hEmpty->GetYaxis()->SetTitleOffset(1.3);
1549 //Reconstruction efficiency
1550 TH2D *gHistPrimariesMCYPtProtons = (TH2D *)list->At(0);
1551 TH2D *gHistPrimariesMCYPtAntiProtons = (TH2D *)list->At(1);
1552 TH2D *gHistMCYPtProtonsFromWeak = (TH2D *)list->At(2);
1553 TH2D *gHistMCYPtAntiProtonsFromWeak = (TH2D *)list->At(3);
1554 TH2D *gHistMCYPtProtonsFromHadronic = (TH2D *)list->At(4);
1555 TH2D *gHistMCYPtAntiProtonsFromHadronic = (TH2D *)list->At(5);
1556 TH2D *gHistPrimariesESDYPtProtons = (TH2D *)list->At(6);
1557 TH2D *gHistPrimariesESDYPtAntiProtons = (TH2D *)list->At(7);
1558 TH2D *gHistESDYPtProtonsFromWeak = (TH2D *)list->At(8);
1559 TH2D *gHistESDYPtAntiProtonsFromWeak = (TH2D *)list->At(9);
1560 TH2D *gHistESDYPtProtonsFromHadronic = (TH2D *)list->At(10);
1561 TH2D *gHistESDYPtAntiProtonsFromHadronic = (TH2D *)list->At(11);
1563 //rapidity dependence
1564 TCanvas *c14 = new TCanvas("c14",
1565 "(Anti)Proton reconstruction efficiency vs y",
1567 c14->SetHighLightColor(10); c14->Divide(2,1);
1570 TH1D *gYPrimariesESDProtons = (TH1D *)gHistPrimariesESDYPtProtons->ProjectionX("gYPrimariesESDProtons",0,gHistPrimariesESDYPtProtons->GetXaxis()->GetNbins(),"e");
1571 TH1D *gYPrimariesMCProtons = (TH1D *)gHistPrimariesMCYPtProtons->ProjectionX("gYPrimariesMCProtons",0,gHistPrimariesMCYPtProtons->GetXaxis()->GetNbins(),"e");
1572 gYPrimariesESDProtons->Divide(gYPrimariesMCProtons);
1573 SetError(gYPrimariesESDProtons,gYPrimariesMCProtons);
1574 gYPrimariesESDProtons->Scale(100.);
1575 gYPrimariesESDProtons->SetMarkerStyle(kFullCircle);
1577 //Primary AntiProtons
1578 TH1D *gYPrimariesESDAntiProtons = (TH1D *)gHistPrimariesESDYPtAntiProtons->ProjectionX("gYPrimariesESDAntiProtons",0,gHistPrimariesESDYPtAntiProtons->GetXaxis()->GetNbins(),"e");
1579 TH1D *gYPrimariesMCAntiProtons = (TH1D *)gHistPrimariesMCYPtAntiProtons->ProjectionX("gYPrimariesMCAntiProtons",0,gHistPrimariesMCYPtProtons->GetXaxis()->GetNbins(),"e");
1580 gYPrimariesESDAntiProtons->Divide(gYPrimariesMCAntiProtons);
1581 SetError(gYPrimariesESDAntiProtons,gYPrimariesMCAntiProtons);
1582 gYPrimariesESDAntiProtons->Scale(100.);
1583 gYPrimariesESDAntiProtons->SetMarkerStyle(kFullCircle);
1585 //Protons from weak decays
1586 TH1D *gYESDProtonsFromWeak = (TH1D *)gHistESDYPtProtonsFromWeak->ProjectionX("gYESDProtonsFromWeak",0,gHistESDYPtProtonsFromWeak->GetXaxis()->GetNbins(),"e");
1587 TH1D *gYMCProtonsFromWeak = (TH1D *)gHistMCYPtProtonsFromWeak->ProjectionX("gYMCProtonsFromWeak",0,gHistMCYPtProtonsFromWeak->GetXaxis()->GetNbins(),"e");
1588 gYESDProtonsFromWeak->Divide(gYMCProtonsFromWeak);
1589 SetError(gYESDProtonsFromWeak,gYMCProtonsFromWeak);
1590 gYESDProtonsFromWeak->Scale(100.);
1591 gYESDProtonsFromWeak->SetMarkerStyle(21);
1592 gYESDProtonsFromWeak->SetMarkerColor(2);
1594 //AntiProtons from weak decays
1595 TH1D *gYESDAntiProtonsFromWeak = (TH1D *)gHistESDYPtAntiProtonsFromWeak->ProjectionX("gYESDAntiProtonsFromWeak",0,gHistESDYPtAntiProtonsFromWeak->GetXaxis()->GetNbins(),"e");
1596 TH1D *gYMCAntiProtonsFromWeak = (TH1D *)gHistMCYPtAntiProtonsFromWeak->ProjectionX("gYMCAntiProtonsFromWeak",0,gHistMCYPtProtonsFromWeak->GetXaxis()->GetNbins(),"e");
1597 gYESDAntiProtonsFromWeak->Divide(gYMCAntiProtonsFromWeak);
1598 SetError(gYESDAntiProtonsFromWeak,gYMCAntiProtonsFromWeak);
1599 gYESDAntiProtonsFromWeak->Scale(100.);
1600 gYESDAntiProtonsFromWeak->SetMarkerStyle(21);
1601 gYESDAntiProtonsFromWeak->SetMarkerColor(2);
1603 //Protons from hadronic interactions
1604 TH1D *gYESDProtonsFromHadronic = (TH1D *)gHistESDYPtProtonsFromHadronic->ProjectionX("gYESDProtonsFromHadronic",0,gHistESDYPtProtonsFromHadronic->GetXaxis()->GetNbins(),"e");
1605 TH1D *gYMCProtonsFromHadronic = (TH1D *)gHistMCYPtProtonsFromHadronic->ProjectionX("gYMCProtonsFromHadronic",0,gHistMCYPtProtonsFromHadronic->GetXaxis()->GetNbins(),"e");
1606 gYESDProtonsFromHadronic->Divide(gYMCProtonsFromHadronic);
1607 SetError(gYESDProtonsFromHadronic,gYMCProtonsFromHadronic);
1608 gYESDProtonsFromHadronic->Scale(100.);
1609 gYESDProtonsFromHadronic->SetMarkerStyle(22);
1610 gYESDProtonsFromHadronic->SetMarkerColor(3);
1612 //AntiProtons from hadronic interactions
1613 TH1D *gYESDAntiProtonsFromHadronic = (TH1D *)gHistESDYPtAntiProtonsFromHadronic->ProjectionX("gYESDAntiProtonsFromHadronic",0,gHistESDYPtAntiProtonsFromHadronic->GetXaxis()->GetNbins(),"e");
1614 TH1D *gYMCAntiProtonsFromHadronic = (TH1D *)gHistMCYPtAntiProtonsFromHadronic->ProjectionX("gYMCAntiProtonsFromHadronic",0,gHistMCYPtProtonsFromHadronic->GetXaxis()->GetNbins(),"e");
1615 gYESDAntiProtonsFromHadronic->Divide(gYMCAntiProtonsFromHadronic);
1616 SetError(gYESDAntiProtonsFromHadronic,gYMCAntiProtonsFromHadronic);
1617 gYESDAntiProtonsFromHadronic->Scale(100.);
1618 gYESDAntiProtonsFromHadronic->SetMarkerStyle(22);
1619 gYESDAntiProtonsFromHadronic->SetMarkerColor(3);
1621 c14->cd(1)->SetBottomMargin(0.15);
1622 c14->cd(1)->SetLeftMargin(0.15);
1623 c14->cd(1)->SetGridx(); c14->cd(1)->SetGridy();
1624 hEmpty->GetXaxis()->SetRangeUser(gYPrimariesESDAntiProtons->GetXaxis()->GetXmin()-0.2,
1625 gYPrimariesESDAntiProtons->GetXaxis()->GetXmax()+0.2);
1626 hEmpty->GetXaxis()->SetTitle(gYPrimariesESDAntiProtons->GetXaxis()->GetTitle());
1627 hEmpty->SetTitle("Protons");
1629 gYPrimariesESDProtons->DrawCopy("ESAME");
1630 gYESDProtonsFromWeak->DrawCopy("ESAME");
1631 gYESDProtonsFromHadronic->DrawCopy("ESAME");
1633 c14->cd(2)->SetBottomMargin(0.15);
1634 c14->cd(2)->SetLeftMargin(0.15);
1635 c14->cd(2)->SetGridx(); c14->cd(2)->SetGridy();
1636 hEmpty->SetTitle("Antiprotons");
1638 gYPrimariesESDAntiProtons->DrawCopy("ESAME");
1639 gYESDAntiProtonsFromWeak->DrawCopy("ESAME");
1640 gYESDAntiProtonsFromHadronic->DrawCopy("ESAME");
1641 c14->SaveAs("ReconstructionEfficiency-Protons-Rapidity.gif");
1644 TCanvas *c15 = new TCanvas("c15",
1645 "(Anti)Proton reconstruction efficiency vs pT",
1647 c15->SetHighLightColor(10); c15->Divide(2,1);
1650 TH1D *gPtPrimariesESDProtons = (TH1D *)gHistPrimariesESDYPtProtons->ProjectionY("gPtPrimariesESDProtons",0,gHistPrimariesESDYPtProtons->GetYaxis()->GetNbins(),"e");
1651 TH1D *gPtPrimariesMCProtons = (TH1D *)gHistPrimariesMCYPtProtons->ProjectionY("gPtPrimariesMCProtons",0,gHistPrimariesMCYPtProtons->GetYaxis()->GetNbins(),"e");
1652 gPtPrimariesESDProtons->Divide(gPtPrimariesMCProtons);
1653 SetError(gPtPrimariesESDProtons,gPtPrimariesMCProtons);
1654 gPtPrimariesESDProtons->Scale(100.);
1655 gPtPrimariesESDProtons->SetMarkerStyle(kFullCircle);
1657 //Primary AntiProtons
1658 TH1D *gPtPrimariesESDAntiProtons = (TH1D *)gHistPrimariesESDYPtAntiProtons->ProjectionY("gPtPrimariesESDAntiProtons",0,gHistPrimariesESDYPtAntiProtons->GetYaxis()->GetNbins(),"e");
1659 TH1D *gPtPrimariesMCAntiProtons = (TH1D *)gHistPrimariesMCYPtAntiProtons->ProjectionY("gPtPrimariesMCAntiProtons",0,gHistPrimariesMCYPtProtons->GetYaxis()->GetNbins(),"e");
1660 gPtPrimariesESDAntiProtons->Divide(gPtPrimariesMCAntiProtons);
1661 SetError(gPtPrimariesESDAntiProtons,gPtPrimariesMCAntiProtons);
1662 gPtPrimariesESDAntiProtons->Scale(100.);
1663 gPtPrimariesESDAntiProtons->SetMarkerStyle(kFullCircle);
1665 //Protons from weak decays
1666 TH1D *gPtESDProtonsFromWeak = (TH1D *)gHistESDYPtProtonsFromWeak->ProjectionY("gPtESDProtonsFromWeak",0,gHistESDYPtProtonsFromWeak->GetYaxis()->GetNbins(),"e");
1667 TH1D *gPtMCProtonsFromWeak = (TH1D *)gHistMCYPtProtonsFromWeak->ProjectionY("gPtMCProtonsFromWeak",0,gHistMCYPtProtonsFromWeak->GetYaxis()->GetNbins(),"e");
1668 gPtESDProtonsFromWeak->Divide(gPtMCProtonsFromWeak);
1669 SetError(gPtESDProtonsFromWeak,gPtMCProtonsFromWeak);
1670 gPtESDProtonsFromWeak->Scale(100.);
1671 gPtESDProtonsFromWeak->SetMarkerStyle(21);
1672 gPtESDProtonsFromWeak->SetMarkerColor(2);
1674 //AntiProtons from weak decays
1675 TH1D *gPtESDAntiProtonsFromWeak = (TH1D *)gHistESDYPtAntiProtonsFromWeak->ProjectionY("gPtESDAntiProtonsFromWeak",0,gHistESDYPtAntiProtonsFromWeak->GetYaxis()->GetNbins(),"e");
1676 TH1D *gPtMCAntiProtonsFromWeak = (TH1D *)gHistMCYPtAntiProtonsFromWeak->ProjectionY("gPtMCAntiProtonsFromWeak",0,gHistMCYPtProtonsFromWeak->GetYaxis()->GetNbins(),"e");
1677 gPtESDAntiProtonsFromWeak->Divide(gPtMCAntiProtonsFromWeak);
1678 SetError(gPtESDAntiProtonsFromWeak,gPtMCAntiProtonsFromWeak);
1679 gPtESDAntiProtonsFromWeak->Scale(100.);
1680 gPtESDAntiProtonsFromWeak->SetMarkerStyle(21);
1681 gPtESDAntiProtonsFromWeak->SetMarkerColor(2);
1683 //Protons from hadronic interactions
1684 TH1D *gPtESDProtonsFromHadronic = (TH1D *)gHistESDYPtProtonsFromHadronic->ProjectionY("gPtESDProtonsFromHadronic",0,gHistESDYPtProtonsFromHadronic->GetYaxis()->GetNbins(),"e");
1685 TH1D *gPtMCProtonsFromHadronic = (TH1D *)gHistMCYPtProtonsFromHadronic->ProjectionY("gPtMCProtonsFromHadronic",0,gHistMCYPtProtonsFromHadronic->GetYaxis()->GetNbins(),"e");
1686 gPtESDProtonsFromHadronic->Divide(gPtMCProtonsFromHadronic);
1687 SetError(gPtESDProtonsFromHadronic,gPtMCProtonsFromHadronic);
1688 gPtESDProtonsFromHadronic->Scale(100.);
1689 gPtESDProtonsFromHadronic->SetMarkerStyle(22);
1690 gPtESDProtonsFromHadronic->SetMarkerColor(3);
1692 //AntiProtons from hadronic interactions
1693 TH1D *gPtESDAntiProtonsFromHadronic = (TH1D *)gHistESDYPtAntiProtonsFromHadronic->ProjectionY("gPtESDAntiProtonsFromHadronic",0,gHistESDYPtAntiProtonsFromHadronic->GetYaxis()->GetNbins(),"e");
1694 TH1D *gPtMCAntiProtonsFromHadronic = (TH1D *)gHistMCYPtAntiProtonsFromHadronic->ProjectionY("gPtMCAntiProtonsFromHadronic",0,gHistMCYPtProtonsFromHadronic->GetYaxis()->GetNbins(),"e");
1695 gPtESDAntiProtonsFromHadronic->Divide(gPtMCAntiProtonsFromHadronic);
1696 SetError(gPtESDAntiProtonsFromHadronic,gPtMCAntiProtonsFromHadronic);
1697 gPtESDAntiProtonsFromHadronic->Scale(100.);
1698 gPtESDAntiProtonsFromHadronic->SetMarkerStyle(22);
1699 gPtESDAntiProtonsFromHadronic->SetMarkerColor(3);
1702 c15->cd(1)->SetBottomMargin(0.15);
1703 c15->cd(1)->SetLeftMargin(0.15);
1704 c15->cd(1)->SetGridx(); c15->cd(1)->SetGridy();
1705 hEmpty->GetXaxis()->SetRangeUser(gPtPrimariesESDAntiProtons->GetXaxis()->GetXmin()-0.2,
1706 gPtPrimariesESDAntiProtons->GetXaxis()->GetXmax()+0.2);
1707 hEmpty->GetXaxis()->SetTitle("P_{T} [GeV/c]");
1708 hEmpty->SetTitle("Protons");
1710 gPtPrimariesESDProtons->DrawCopy("ESAME");
1711 gPtESDProtonsFromWeak->DrawCopy("ESAME");
1712 gPtESDProtonsFromHadronic->DrawCopy("ESAME");
1714 c15->cd(2)->SetBottomMargin(0.15);
1715 c15->cd(2)->SetLeftMargin(0.15);
1716 c15->cd(2)->SetGridx(); c15->cd(2)->SetGridy();
1717 hEmpty->SetTitle("Antiprotons");
1719 gPtPrimariesESDAntiProtons->DrawCopy("ESAME");
1720 gPtESDAntiProtonsFromWeak->DrawCopy("ESAME");
1721 gPtESDAntiProtonsFromHadronic->DrawCopy("ESAME");
1722 c15->SaveAs("ReconstructionEfficiency-Protons-Pt.gif");
1727 TH3D *gHistESDInitYPtProtons = (TH3D *)list->At(12);
1728 TH3D *gHistESDIdYPtProtons = (TH3D *)list->At(13);
1729 TH3D *gHistESDRecIdYPtProtons = (TH3D *)list->At(14);
1730 TH3D *gHistESDContamYPtProtons = (TH3D *)list->At(15);
1732 TCanvas *c16 = new TCanvas("c16",
1733 "(Anti)Proton PID efficiency vs y and pT",
1735 c16->SetHighLightColor(10); c16->Divide(3,1);
1737 //rapidity dependence
1738 //protons pid efficiency
1739 //TH1D *gYESDIdProtons = (TH1D *)gHistESDIdYPtProtons->ProjectionX("gYESDIdProtons",0,gHistESDIdYPtProtons->GetXaxis()->GetNbins(),"e");
1740 //TH1D *gYESDInitProtons = (TH1D *)gHistESDInitYPtProtons->ProjectionX("gYESDInitProtons",0,gHistESDInitYPtProtons->GetXaxis()->GetNbins(),"e");
1741 TH1D *gYESDIdProtons = (TH1D *)gHistESDIdYPtProtons->Project3D("x");
1742 TH1D *gYESDInitProtons = (TH1D *)gHistESDInitYPtProtons->Project3D("x");
1743 gYESDIdProtons->Divide(gYESDInitProtons);
1744 SetError(gYESDIdProtons,gYESDInitProtons);
1745 gYESDIdProtons->Scale(100.);
1746 gYESDIdProtons->SetMarkerStyle(kFullCircle);
1748 //protons pid contamination
1749 //TH1D *gYESDContamProtons = (TH1D *)gHistESDContamYPtProtons->ProjectionX("gYESDContamProtons",0,gHistESDContamYPtProtons->GetXaxis()->GetNbins(),"e");
1750 //TH1D *gYESDRecIdProtons = (TH1D *)gHistESDRecIdYPtProtons->ProjectionX("gYESDRecIdProtons",0,gHistESDRecIdYPtProtons->GetXaxis()->GetNbins(),"e");
1751 TH1D *gYESDContamProtons = (TH1D *)gHistESDContamYPtProtons->Project3D("x");
1752 TH1D *gYESDRecIdProtons = (TH1D *)gHistESDRecIdYPtProtons->Project3D("x");
1753 gYESDContamProtons->Divide(gYESDRecIdProtons);
1754 SetError(gYESDContamProtons,gYESDRecIdProtons);
1755 gYESDContamProtons->Scale(100.);
1756 gYESDContamProtons->SetMarkerStyle(kOpenCircle);
1758 c16->cd(1)->SetBottomMargin(0.15);
1759 c16->cd(1)->SetLeftMargin(0.15);
1760 c16->cd(1)->SetGridx(); c16->cd(1)->SetGridy();
1761 hEmpty->GetXaxis()->SetRangeUser(gYESDIdProtons->GetXaxis()->GetXmin()-0.2,
1762 gYESDIdProtons->GetXaxis()->GetXmax()+0.2);
1763 hEmpty->GetXaxis()->SetTitle(gYESDContamProtons->GetXaxis()->GetTitle());
1765 gYESDIdProtons->DrawCopy("ESAME");
1766 gYESDContamProtons->DrawCopy("ESAME");
1769 //protons pid efficiency
1770 //TH1D *gPtESDIdProtons = (TH1D *)gHistESDIdYPtProtons->ProjectionY("gPtESDIdProtons",0,gHistESDIdYPtProtons->GetYaxis()->GetNbins(),"e");
1771 //TH1D *gPtESDInitProtons = (TH1D *)gHistESDInitYPtProtons->ProjectionY("gPtESDInitProtons",0,gHistESDInitYPtProtons->GetYaxis()->GetNbins(),"e");
1772 TH1D *gPtESDIdProtons = (TH1D *)gHistESDIdYPtProtons->Project3D("y");
1773 TH1D *gPtESDInitProtons = (TH1D *)gHistESDInitYPtProtons->Project3D("y");
1774 gPtESDIdProtons->Divide(gPtESDInitProtons);
1775 SetError(gPtESDIdProtons,gPtESDInitProtons);
1776 gPtESDIdProtons->Scale(100.);
1777 gPtESDIdProtons->SetMarkerStyle(kFullCircle);
1779 //protons pid contamination
1780 //TH1D *gPtESDContamProtons = (TH1D *)gHistESDContamYPtProtons->ProjectionY("gPtESDContamProtons",0,gHistESDContamYPtProtons->GetYaxis()->GetNbins(),"e");
1781 //TH1D *gPtESDRecIdProtons = (TH1D *)gHistESDRecIdYPtProtons->ProjectionY("gPtESDRecIdProtons",0,gHistESDRecIdYPtProtons->GetYaxis()->GetNbins(),"e");
1782 TH1D *gPtESDContamProtons = (TH1D *)gHistESDContamYPtProtons->Project3D("y");
1783 TH1D *gPtESDRecIdProtons = (TH1D *)gHistESDRecIdYPtProtons->Project3D("y");
1784 gPtESDContamProtons->Divide(gPtESDRecIdProtons);
1785 SetError(gPtESDContamProtons,gPtESDRecIdProtons);
1786 gPtESDContamProtons->Scale(100.);
1787 gPtESDContamProtons->SetMarkerStyle(kOpenCircle);
1789 c16->cd(2)->SetBottomMargin(0.15);
1790 c16->cd(2)->SetLeftMargin(0.15);
1791 c16->cd(2)->SetGridx(); c16->cd(2)->SetGridy();
1792 hEmpty->GetXaxis()->SetRangeUser(gPtESDIdProtons->GetXaxis()->GetXmin()-0.2,
1793 gPtESDIdProtons->GetXaxis()->GetXmax()+0.2);
1794 hEmpty->GetXaxis()->SetTitle(gPtESDContamProtons->GetXaxis()->GetTitle());
1796 gPtESDIdProtons->DrawCopy("ESAME");
1797 gPtESDContamProtons->DrawCopy("ESAME");
1799 //N_points dependence
1800 //protons pid efficiency
1801 TH1D *gNPointsESDIdProtons = (TH1D *)gHistESDIdYPtProtons->Project3D("z");
1802 TH1D *gNPointsESDInitProtons = (TH1D *)gHistESDInitYPtProtons->Project3D("z");
1803 gNPointsESDIdProtons->Divide(gNPointsESDInitProtons);
1804 SetError(gNPointsESDIdProtons,gNPointsESDInitProtons);
1805 gNPointsESDIdProtons->Scale(100.);
1806 gNPointsESDIdProtons->SetMarkerStyle(kFullCircle);
1808 //protons pid contamination
1809 TH1D *gNPointsESDContamProtons = (TH1D *)gHistESDContamYPtProtons->Project3D("z");
1810 TH1D *gNPointsESDRecIdProtons = (TH1D *)gHistESDRecIdYPtProtons->Project3D("z");
1811 gNPointsESDContamProtons->Divide(gNPointsESDRecIdProtons);
1812 SetError(gNPointsESDContamProtons,gNPointsESDRecIdProtons);
1813 gNPointsESDContamProtons->Scale(100.);
1814 gNPointsESDContamProtons->SetMarkerStyle(kOpenCircle);
1816 c16->cd(3)->SetBottomMargin(0.15);
1817 c16->cd(3)->SetLeftMargin(0.15);
1818 c16->cd(3)->SetGridx(); c16->cd(3)->SetGridy();
1819 hEmpty->GetXaxis()->SetRangeUser(gNPointsESDIdProtons->GetXaxis()->GetXmin(),
1820 gNPointsESDIdProtons->GetXaxis()->GetXmax()+10);
1821 hEmpty->GetXaxis()->SetTitle(gNPointsESDContamProtons->GetXaxis()->GetTitle());
1823 gNPointsESDIdProtons->DrawCopy("ESAME");
1824 gNPointsESDContamProtons->DrawCopy("ESAME");
1826 c16->SaveAs("PIDEfficiency-Protons.gif");
1828 TString outputFileName = "Reconstruction-PID-Efficiency.";
1829 outputFileName += analysisType; outputFileName += ".root";
1830 TFile *fout = TFile::Open(outputFileName.Data(),"recreate");
1831 gYPrimariesESDProtons->Write();
1832 gYESDProtonsFromWeak->Write();
1833 gYESDProtonsFromHadronic->Write();
1834 gPtPrimariesESDProtons->Write();
1835 gPtESDProtonsFromWeak->Write();
1836 gPtESDProtonsFromHadronic->Write();
1837 gYPrimariesESDAntiProtons->Write();
1838 gYESDAntiProtonsFromWeak->Write();
1839 gYESDAntiProtonsFromHadronic->Write();
1840 gPtPrimariesESDAntiProtons->Write();
1841 gPtESDAntiProtonsFromWeak->Write();
1842 gPtESDAntiProtonsFromHadronic->Write();
1843 gYESDIdProtons->Write();
1844 gYESDContamProtons->Write();
1845 gPtESDIdProtons->Write();
1846 gPtESDContamProtons->Write();
1847 gNPointsESDIdProtons->Write();
1848 gNPointsESDContamProtons->Write();
1852 //________________________________________________//
1853 void DrawMarker(Double_t x, Double_t y, Int_t style,
1854 Double_t size, Int_t color) {
1855 TMarker *m = new TMarker(x,y,style);
1856 m->SetMarkerSize(size);
1857 m->SetMarkerColor(color);
1861 //________________________________________________//
1862 const char * const gMCProcessName[45] = {
1863 "Primary particle emission",
1864 "Multiple scattering",
1866 "Bending in magnetic field",
1868 "Lepton pair production",
1869 "Compton scattering",
1870 "Photoelectric effect",
1873 "Positron annihilation",
1874 "Positron annihilation at rest",
1875 "Positron annihilation in flight",
1876 "Hadronic interaction",
1877 "Nuclear evaporation",
1879 "Nuclear absorbtion",
1880 "Antiproton annihilation",
1881 "Antineutron annihilation",
1884 "Hadronic incoherent elastic",
1885 "Hadronic coherent elastic",
1886 "Hadronic inelastic",
1888 "Muon nuclear interaction",
1889 "Electron nuclear interaction",
1890 "Positron nuclear interaction",
1891 "Time of flight limit",
1892 "Nuclear photofission",
1894 "No active process",
1899 "Maximum allowed step",
1900 "Cerenkov production",
1901 "Cerenkov feed back photon",
1902 "Cerenkov photon reflection",
1903 "Cerenkov photon refraction",
1904 "Synchrotron radiation",
1910 //________________________________________________//
1911 void drawKineQA(const char *filename) {
1912 //Draws the QA plots for the kinematic variables for protons and antiprotons
1913 gStyle->SetPalette(1,0);
1914 gStyle->SetCanvasColor(41);
1915 gStyle->SetFrameFillColor(10);
1917 TFile *f = TFile::Open(filename);
1918 TList *acceptedList = (TList *)f->Get("acceptedCutList");
1919 TH3D *gHistEtaPhiNClustersPrimaryProtonsPass = (TH3D *)acceptedList->At(44);
1920 gHistEtaPhiNClustersPrimaryProtonsPass->SetTitle("Primary protons");
1921 TH3D *gHistEtaPhiNClustersSecondaryProtonsPass = (TH3D *)acceptedList->At(46);
1922 gHistEtaPhiNClustersSecondaryProtonsPass->SetTitle("Secondary protons");
1923 TH3D *gHistEtaPhiNClustersPrimaryAntiProtonsPass = (TH3D *)acceptedList->At(45);
1924 gHistEtaPhiNClustersPrimaryAntiProtonsPass->SetTitle("Primary antiprotons");
1925 TH3D *gHistEtaPhiNClustersSecondaryAntiProtonsPass = (TH3D *)acceptedList->At(47);
1926 gHistEtaPhiNClustersSecondaryAntiProtonsPass->SetTitle("Secondary antiprotons");
1927 TH3D *gHistEtaPhiChi2PerTPCClusterPrimaryProtonsPass = (TH3D *)acceptedList->At(48);
1928 gHistEtaPhiChi2PerTPCClusterPrimaryProtonsPass->SetTitle("Primary protons");
1929 TH3D *gHistEtaPhiChi2PerTPCClusterSecondaryProtonsPass = (TH3D *)acceptedList->At(50);
1930 gHistEtaPhiChi2PerTPCClusterSecondaryProtonsPass->SetTitle("Secondary protons");
1931 TH3D *gHistEtaPhiChi2PerTPCClusterPrimaryAntiProtonsPass = (TH3D *)acceptedList->At(49);
1932 gHistEtaPhiChi2PerTPCClusterPrimaryAntiProtonsPass->SetTitle("Primary antiprotons");
1933 TH3D *gHistEtaPhiChi2PerTPCClusterSecondaryAntiProtonsPass = (TH3D *)acceptedList->At(51);
1934 gHistEtaPhiChi2PerTPCClusterSecondaryAntiProtonsPass->SetTitle("Secondary antiprotons");
1935 TH3D *gHistEtaPhiTPCdEdxNPointsPrimaryProtonsPass = (TH3D *)acceptedList->At(52);
1936 gHistEtaPhiTPCdEdxNPointsPrimaryProtonsPass->SetTitle("Primary protons");
1937 TH3D *gHistEtaPhiTPCdEdxNPointsSecondaryProtonsPass = (TH3D *)acceptedList->At(54);
1938 gHistEtaPhiTPCdEdxNPointsSecondaryProtonsPass->SetTitle("Secondary protons");
1939 TH3D *gHistEtaPhiTPCdEdxNPointsPrimaryAntiProtonsPass = (TH3D *)acceptedList->At(53);
1940 gHistEtaPhiTPCdEdxNPointsPrimaryAntiProtonsPass->SetTitle("Primary antiprotons");
1941 TH3D *gHistEtaPhiTPCdEdxNPointsSecondaryAntiProtonsPass = (TH3D *)acceptedList->At(55);
1942 gHistEtaPhiTPCdEdxNPointsSecondaryAntiProtonsPass->SetTitle("Secondary antiprotons");
1944 TList *rejectedList = (TList *)f->Get("rejectedCutList");
1945 TH3D *gHistEtaPhiNClustersPrimaryProtonsReject = (TH3D *)rejectedList->At(0);
1946 gHistEtaPhiNClustersPrimaryProtonsPass->Add(gHistEtaPhiNClustersPrimaryProtonsReject);
1947 TH3D *gHistEtaPhiNClustersSecondaryProtonsReject = (TH3D *)rejectedList->At(2);
1948 gHistEtaPhiNClustersSecondaryProtonsPass->Add(gHistEtaPhiNClustersSecondaryProtonsReject);
1949 TH3D *gHistEtaPhiNClustersPrimaryAntiProtonsReject = (TH3D *)rejectedList->At(1);
1950 gHistEtaPhiNClustersPrimaryAntiProtonsPass->Add(gHistEtaPhiNClustersPrimaryAntiProtonsReject);
1951 TH3D *gHistEtaPhiNClustersSecondaryAntiProtonsReject = (TH3D *)rejectedList->At(3);
1952 gHistEtaPhiNClustersSecondaryAntiProtonsPass->Add(gHistEtaPhiNClustersSecondaryAntiProtonsReject);
1953 TH3D *gHistEtaPhiChi2PerTPCClusterPrimaryProtonsReject = (TH3D *)rejectedList->At(4);
1954 gHistEtaPhiChi2PerTPCClusterPrimaryProtonsPass->Add(gHistEtaPhiChi2PerTPCClusterPrimaryProtonsReject);
1955 TH3D *gHistEtaPhiChi2PerTPCClusterSecondaryProtonsReject = (TH3D *)rejectedList->At(6);
1956 gHistEtaPhiChi2PerTPCClusterSecondaryProtonsPass->Add(gHistEtaPhiChi2PerTPCClusterSecondaryProtonsReject);
1957 TH3D *gHistEtaPhiChi2PerTPCClusterPrimaryAntiProtonsReject = (TH3D *)rejectedList->At(5);
1958 gHistEtaPhiChi2PerTPCClusterPrimaryAntiProtonsPass->Add(gHistEtaPhiChi2PerTPCClusterPrimaryAntiProtonsReject);
1959 TH3D *gHistEtaPhiChi2PerTPCClusterSecondaryAntiProtonsReject = (TH3D *)rejectedList->At(7);
1960 gHistEtaPhiChi2PerTPCClusterSecondaryAntiProtonsPass->Add(gHistEtaPhiChi2PerTPCClusterSecondaryAntiProtonsReject);
1961 TH3D *gHistEtaPhiTPCdEdxNPointsPrimaryProtonsReject = (TH3D *)rejectedList->At(8);
1962 gHistEtaPhiTPCdEdxNPointsPrimaryProtonsPass->Add(gHistEtaPhiTPCdEdxNPointsPrimaryProtonsReject);
1963 TH3D *gHistEtaPhiTPCdEdxNPointsSecondaryProtonsReject = (TH3D *)rejectedList->At(10);
1964 gHistEtaPhiTPCdEdxNPointsSecondaryProtonsPass->Add(gHistEtaPhiTPCdEdxNPointsSecondaryProtonsReject);
1965 TH3D *gHistEtaPhiTPCdEdxNPointsPrimaryAntiProtonsReject = (TH3D *)rejectedList->At(9);
1966 gHistEtaPhiTPCdEdxNPointsPrimaryAntiProtonsPass->Add(gHistEtaPhiTPCdEdxNPointsPrimaryAntiProtonsReject);
1967 TH3D *gHistEtaPhiTPCdEdxNPointsSecondaryAntiProtonsReject = (TH3D *)rejectedList->At(11);
1968 gHistEtaPhiTPCdEdxNPointsSecondaryAntiProtonsPass->Add(gHistEtaPhiTPCdEdxNPointsSecondaryAntiProtonsReject);
1971 TCanvas *c21 = new TCanvas("c21",
1974 c21->SetHighLightColor(10); c21->Divide(2,2);
1975 c21->cd(1)->SetLeftMargin(0.15); c21->cd(1)->SetBottomMargin(0.15);
1976 c21->cd(1)->SetRightMargin(0.2);
1977 ((TH2D *)(gHistEtaPhiNClustersPrimaryProtonsPass->Project3D("yx")))->SetStats(kFALSE);
1978 ((TH2D *)(gHistEtaPhiNClustersPrimaryProtonsPass->Project3D("yx")))->DrawCopy("colz");
1979 c21->cd(2)->SetLeftMargin(0.15); c21->cd(2)->SetBottomMargin(0.15);
1980 c21->cd(2)->SetRightMargin(0.2);
1981 ((TH2D *)(gHistEtaPhiNClustersSecondaryProtonsPass->Project3D("yx")))->SetStats(kFALSE);
1982 ((TH2D *)(gHistEtaPhiNClustersSecondaryProtonsPass->Project3D("yx")))->DrawCopy("colz");
1983 c21->cd(3)->SetLeftMargin(0.15); c21->cd(3)->SetBottomMargin(0.15);
1984 c21->cd(3)->SetRightMargin(0.2);
1985 ((TH2D *)(gHistEtaPhiNClustersPrimaryAntiProtonsPass->Project3D("yx")))->SetStats(kFALSE);
1986 ((TH2D *)(gHistEtaPhiNClustersPrimaryAntiProtonsPass->Project3D("yx")))->DrawCopy("colz");
1987 c21->cd(4)->SetLeftMargin(0.15); c21->cd(4)->SetBottomMargin(0.15);
1988 c21->cd(4)->SetRightMargin(0.2);
1989 ((TH2D *)(gHistEtaPhiNClustersSecondaryAntiProtonsPass->Project3D("yx")))->SetStats(kFALSE);
1990 ((TH2D *)(gHistEtaPhiNClustersSecondaryAntiProtonsPass->Project3D("yx")))->DrawCopy("colz");
1991 c21->SaveAs("EtaPhi.gif");
1994 TCanvas *c22 = new TCanvas("c22",
1995 "#eta-N_{clusters}",
1997 c22->SetHighLightColor(10); c22->Divide(2,2);
1998 c22->cd(1)->SetLeftMargin(0.15); c22->cd(1)->SetBottomMargin(0.15);
1999 c22->cd(1)->SetRightMargin(0.2);
2000 ((TH2D *)(gHistEtaPhiNClustersPrimaryProtonsPass->Project3D("zx")))->SetStats(kFALSE);
2001 ((TH2D *)(gHistEtaPhiNClustersPrimaryProtonsPass->Project3D("zx")))->DrawCopy("colz");
2002 c22->cd(2)->SetLeftMargin(0.15); c22->cd(2)->SetBottomMargin(0.15);
2003 c22->cd(2)->SetRightMargin(0.2);
2004 ((TH2D *)(gHistEtaPhiNClustersSecondaryProtonsPass->Project3D("zx")))->SetStats(kFALSE);
2005 ((TH2D *)(gHistEtaPhiNClustersSecondaryProtonsPass->Project3D("zx")))->DrawCopy("colz");
2006 c22->cd(3)->SetLeftMargin(0.15); c22->cd(3)->SetBottomMargin(0.15);
2007 c22->cd(3)->SetRightMargin(0.2);
2008 ((TH2D *)(gHistEtaPhiNClustersPrimaryAntiProtonsPass->Project3D("zx")))->SetStats(kFALSE);
2009 ((TH2D *)(gHistEtaPhiNClustersPrimaryAntiProtonsPass->Project3D("zx")))->DrawCopy("colz");
2010 c22->cd(4)->SetLeftMargin(0.15); c22->cd(4)->SetBottomMargin(0.15);
2011 c22->cd(4)->SetRightMargin(0.2);
2012 ((TH2D *)(gHistEtaPhiNClustersSecondaryAntiProtonsPass->Project3D("zx")))->SetStats(kFALSE);
2013 ((TH2D *)(gHistEtaPhiNClustersSecondaryAntiProtonsPass->Project3D("zx")))->DrawCopy("colz");
2014 c22->SaveAs("EtaNClusters.gif");
2017 TCanvas *c23 = new TCanvas("c23",
2018 "#phi-N_{clusters}",
2020 c23->SetHighLightColor(10); c23->Divide(2,2);
2021 c23->cd(1)->SetLeftMargin(0.15); c23->cd(1)->SetBottomMargin(0.15);
2022 c23->cd(1)->SetRightMargin(0.2);
2023 ((TH2D *)(gHistEtaPhiNClustersPrimaryProtonsPass->Project3D("zy")))->SetStats(kFALSE);
2024 ((TH2D *)(gHistEtaPhiNClustersPrimaryProtonsPass->Project3D("zy")))->DrawCopy("colz");
2025 c23->cd(2)->SetLeftMargin(0.15); c23->cd(2)->SetBottomMargin(0.15);
2026 c23->cd(2)->SetRightMargin(0.2);
2027 ((TH2D *)(gHistEtaPhiNClustersSecondaryProtonsPass->Project3D("zy")))->SetStats(kFALSE);
2028 ((TH2D *)(gHistEtaPhiNClustersSecondaryProtonsPass->Project3D("zy")))->DrawCopy("colz");
2029 c23->cd(3)->SetLeftMargin(0.15); c23->cd(3)->SetBottomMargin(0.15);
2030 c23->cd(3)->SetRightMargin(0.2);
2031 ((TH2D *)(gHistEtaPhiNClustersPrimaryAntiProtonsPass->Project3D("zy")))->SetStats(kFALSE);
2032 ((TH2D *)(gHistEtaPhiNClustersPrimaryAntiProtonsPass->Project3D("zy")))->DrawCopy("colz");
2033 c23->cd(4)->SetLeftMargin(0.15); c23->cd(4)->SetBottomMargin(0.15);
2034 c23->cd(4)->SetRightMargin(0.2);
2035 ((TH2D *)(gHistEtaPhiNClustersSecondaryAntiProtonsPass->Project3D("zy")))->SetStats(kFALSE);
2036 ((TH2D *)(gHistEtaPhiNClustersSecondaryAntiProtonsPass->Project3D("zy")))->DrawCopy("colz");
2037 c23->SaveAs("PhiNClusters.gif");
2039 //eta-chi^2 per TPC cluster
2040 TCanvas *c24 = new TCanvas("c24",
2041 "#eta-#chi^{2}/N_{clusters}(TPC)",
2043 c24->SetHighLightColor(10); c24->Divide(2,2);
2044 c24->cd(1)->SetLeftMargin(0.15); c24->cd(1)->SetBottomMargin(0.15);
2045 c24->cd(1)->SetRightMargin(0.2);
2046 ((TH2D *)(gHistEtaPhiChi2PerTPCClusterPrimaryProtonsPass->Project3D("zx")))->SetStats(kFALSE);
2047 ((TH2D *)(gHistEtaPhiChi2PerTPCClusterPrimaryProtonsPass->Project3D("zx")))->DrawCopy("colz");
2048 c24->cd(2)->SetLeftMargin(0.15); c24->cd(2)->SetBottomMargin(0.15);
2049 c24->cd(2)->SetRightMargin(0.2);
2050 ((TH2D *)(gHistEtaPhiChi2PerTPCClusterSecondaryProtonsPass->Project3D("zx")))->SetStats(kFALSE);
2051 ((TH2D *)(gHistEtaPhiChi2PerTPCClusterSecondaryProtonsPass->Project3D("zx")))->DrawCopy("colz");
2052 c24->cd(3)->SetLeftMargin(0.15); c24->cd(3)->SetBottomMargin(0.15);
2053 c24->cd(3)->SetRightMargin(0.2);
2054 ((TH2D *)(gHistEtaPhiChi2PerTPCClusterPrimaryAntiProtonsPass->Project3D("zx")))->SetStats(kFALSE);
2055 ((TH2D *)(gHistEtaPhiChi2PerTPCClusterPrimaryAntiProtonsPass->Project3D("zx")))->DrawCopy("colz");
2056 c24->cd(4)->SetLeftMargin(0.15); c24->cd(4)->SetBottomMargin(0.15);
2057 c24->cd(4)->SetRightMargin(0.2);
2058 ((TH2D *)(gHistEtaPhiChi2PerTPCClusterSecondaryAntiProtonsPass->Project3D("zx")))->SetStats(kFALSE);
2059 ((TH2D *)(gHistEtaPhiChi2PerTPCClusterSecondaryAntiProtonsPass->Project3D("zx")))->DrawCopy("colz");
2060 c24->SaveAs("EtaChi2PerTPCCluster.gif");
2062 //phi-chi^2 per TPC cluster
2063 TCanvas *c25 = new TCanvas("c25",
2064 "#phi-#chi^{2}/N_{clusters}(TPC)",
2066 c25->SetHighLightColor(10); c25->Divide(2,2);
2067 c25->cd(1)->SetLeftMargin(0.15); c25->cd(1)->SetBottomMargin(0.15);
2068 c25->cd(1)->SetRightMargin(0.2);
2069 ((TH2D *)(gHistEtaPhiChi2PerTPCClusterPrimaryProtonsPass->Project3D("zy")))->SetStats(kFALSE);
2070 ((TH2D *)(gHistEtaPhiChi2PerTPCClusterPrimaryProtonsPass->Project3D("zy")))->DrawCopy("colz");
2071 c25->cd(2)->SetLeftMargin(0.15); c25->cd(2)->SetBottomMargin(0.15);
2072 c25->cd(2)->SetRightMargin(0.2);
2073 ((TH2D *)(gHistEtaPhiChi2PerTPCClusterSecondaryProtonsPass->Project3D("zy")))->SetStats(kFALSE);
2074 ((TH2D *)(gHistEtaPhiChi2PerTPCClusterSecondaryProtonsPass->Project3D("zy")))->DrawCopy("colz");
2075 c25->cd(3)->SetLeftMargin(0.15); c25->cd(3)->SetBottomMargin(0.15);
2076 c25->cd(3)->SetRightMargin(0.2);
2077 ((TH2D *)(gHistEtaPhiChi2PerTPCClusterPrimaryAntiProtonsPass->Project3D("zy")))->SetStats(kFALSE);
2078 ((TH2D *)(gHistEtaPhiChi2PerTPCClusterPrimaryAntiProtonsPass->Project3D("zy")))->DrawCopy("colz");
2079 c25->cd(4)->SetLeftMargin(0.15); c25->cd(4)->SetBottomMargin(0.15);
2080 c25->cd(4)->SetRightMargin(0.2);
2081 ((TH2D *)(gHistEtaPhiChi2PerTPCClusterSecondaryAntiProtonsPass->Project3D("zy")))->SetStats(kFALSE);
2082 ((TH2D *)(gHistEtaPhiChi2PerTPCClusterSecondaryAntiProtonsPass->Project3D("zy")))->DrawCopy("colz");
2083 c25->SaveAs("PhiChi2PerTPCCluster.gif");
2085 //eta-dE/dx Npoints (TPC)
2086 TCanvas *c26 = new TCanvas("c26",
2087 "#eta-dEdx N_{points}(TPC)",
2089 c26->SetHighLightColor(10); c26->Divide(2,2);
2090 c26->cd(1)->SetLeftMargin(0.15); c26->cd(1)->SetBottomMargin(0.15);
2091 c26->cd(1)->SetRightMargin(0.2);
2092 ((TH2D *)(gHistEtaPhiTPCdEdxNPointsPrimaryProtonsPass->Project3D("zx")))->SetStats(kFALSE);
2093 ((TH2D *)(gHistEtaPhiTPCdEdxNPointsPrimaryProtonsPass->Project3D("zx")))->DrawCopy("colz");
2094 c26->cd(2)->SetLeftMargin(0.15); c26->cd(2)->SetBottomMargin(0.15);
2095 c26->cd(2)->SetRightMargin(0.2);
2096 ((TH2D *)(gHistEtaPhiTPCdEdxNPointsSecondaryProtonsPass->Project3D("zx")))->SetStats(kFALSE);
2097 ((TH2D *)(gHistEtaPhiTPCdEdxNPointsSecondaryProtonsPass->Project3D("zx")))->DrawCopy("colz");
2098 c26->cd(3)->SetLeftMargin(0.15); c26->cd(3)->SetBottomMargin(0.15);
2099 c26->cd(3)->SetRightMargin(0.2);
2100 ((TH2D *)(gHistEtaPhiTPCdEdxNPointsPrimaryAntiProtonsPass->Project3D("zx")))->SetStats(kFALSE);
2101 ((TH2D *)(gHistEtaPhiTPCdEdxNPointsPrimaryAntiProtonsPass->Project3D("zx")))->DrawCopy("colz");
2102 c26->cd(4)->SetLeftMargin(0.15); c26->cd(4)->SetBottomMargin(0.15);
2103 c26->cd(4)->SetRightMargin(0.2);
2104 ((TH2D *)(gHistEtaPhiTPCdEdxNPointsSecondaryAntiProtonsPass->Project3D("zx")))->SetStats(kFALSE);
2105 ((TH2D *)(gHistEtaPhiTPCdEdxNPointsSecondaryAntiProtonsPass->Project3D("zx")))->DrawCopy("colz");
2106 c26->SaveAs("EtadEdxNPointsTPC.gif");
2108 //phi-dE/dx Npoints (TPC)
2109 TCanvas *c27 = new TCanvas("c27",
2110 "#phi-dEdx N_{points}(TPC)",
2112 c27->SetHighLightColor(10); c27->Divide(2,2);
2113 c27->cd(1)->SetLeftMargin(0.15); c27->cd(1)->SetBottomMargin(0.15);
2114 c27->cd(1)->SetRightMargin(0.2);
2115 ((TH2D *)(gHistEtaPhiTPCdEdxNPointsPrimaryProtonsPass->Project3D("zy")))->SetStats(kFALSE);
2116 ((TH2D *)(gHistEtaPhiTPCdEdxNPointsPrimaryProtonsPass->Project3D("zy")))->DrawCopy("colz");
2117 c27->cd(2)->SetLeftMargin(0.15); c27->cd(2)->SetBottomMargin(0.15);
2118 c27->cd(2)->SetRightMargin(0.2);
2119 ((TH2D *)(gHistEtaPhiTPCdEdxNPointsSecondaryProtonsPass->Project3D("zy")))->SetStats(kFALSE);
2120 ((TH2D *)(gHistEtaPhiTPCdEdxNPointsSecondaryProtonsPass->Project3D("zy")))->DrawCopy("colz");
2121 c27->cd(3)->SetLeftMargin(0.15); c27->cd(3)->SetBottomMargin(0.15);
2122 c27->cd(3)->SetRightMargin(0.2);
2123 ((TH2D *)(gHistEtaPhiTPCdEdxNPointsPrimaryAntiProtonsPass->Project3D("zy")))->SetStats(kFALSE);
2124 ((TH2D *)(gHistEtaPhiTPCdEdxNPointsPrimaryAntiProtonsPass->Project3D("zy")))->DrawCopy("colz");
2125 c27->cd(4)->SetLeftMargin(0.15); c27->cd(4)->SetBottomMargin(0.15);
2126 c27->cd(4)->SetRightMargin(0.2);
2127 ((TH2D *)(gHistEtaPhiTPCdEdxNPointsSecondaryAntiProtonsPass->Project3D("zy")))->SetStats(kFALSE);
2128 ((TH2D *)(gHistEtaPhiTPCdEdxNPointsSecondaryAntiProtonsPass->Project3D("zy")))->DrawCopy("colz");
2129 c27->SaveAs("PhidEdxNPointsTPC.gif");
2134 //________________________________________________//
2135 void drawEfficiencies(const char *filename,
2136 Bool_t gShowPrimaries = kTRUE,
2137 Bool_t gShowWeak = kFALSE,
2138 Bool_t gShowHadronic = kFALSE) {
2139 //Macro to display the reconstruction, cut and pid efficiencies
2140 gStyle->SetPalette(1,0);
2141 gStyle->SetCanvasColor(41);
2142 gStyle->SetFrameFillColor(10);
2144 TH2F *hEmpty = new TH2F("hEmpty","",100,-1.5,5.0,100,0,120);
2145 hEmpty->SetStats(kFALSE);
2146 hEmpty->GetXaxis()->SetTitleColor(1);
2147 hEmpty->GetXaxis()->SetNdivisions(15);
2148 hEmpty->GetYaxis()->SetNdivisions(15);
2149 hEmpty->GetYaxis()->SetTitleOffset(1.4);
2150 hEmpty->GetYaxis()->SetTitle("#epsilon");
2152 TLatex *t1 = new TLatex();
2153 t1->SetTextSize(0.04);
2155 TPaveText *tpave = new TPaveText();
2156 tpave->SetFillColor(10);
2157 Double_t bottomY = 0.0;
2159 TFile *f = TFile::Open(filename);
2160 TH1D *gYPrimariesESDProtons = (TH1D *)f->Get("gYPrimariesESDProtons");
2161 TH1D *gYESDProtonsFromWeak = (TH1D *)f->Get("gYESDProtonsFromWeak");
2162 TH1D *gYESDProtonsFromHadronic = (TH1D *)f->Get("gYESDProtonsFromHadronic");
2163 TH1D *gPtPrimariesESDProtons = (TH1D *)f->Get("gPtPrimariesESDProtons");
2164 TH1D *gPtESDProtonsFromWeak = (TH1D *)f->Get("gPtESDProtonsFromWeak");
2165 TH1D *gPtESDProtonsFromHadronic = (TH1D *)f->Get("gPtESDProtonsFromHadronic");
2166 TH1D *gYPrimariesESDAntiProtons = (TH1D *)f->Get("gYPrimariesESDAntiProtons");
2167 TH1D *gYESDAntiProtonsFromWeak = (TH1D *)f->Get("gYESDAntiProtonsFromWeak");
2168 TH1D *gYESDAntiProtonsFromHadronic = (TH1D *)f->Get("gYESDAntiProtonsFromHadronic");
2169 TH1D *gPtPrimariesESDAntiProtons = (TH1D *)f->Get("gPtPrimariesESDAntiProtons");
2170 TH1D *gPtESDAntiProtonsFromWeak = (TH1D *)f->Get("gPtESDAntiProtonsFromWeak");
2171 TH1D *gPtESDAntiProtonsFromHadronic = (TH1D *)f->Get("gPtESDAntiProtonsFromHadronic");
2172 TH1D *gYESDIdProtons = (TH1D *)f->Get("gHistESDIdYPtProtons_x");
2173 TH1D *gYESDContamProtons = (TH1D *)f->Get("gHistESDContamYPtProtons_x");
2174 TH1D *gPtESDIdProtons = (TH1D *)f->Get("gHistESDIdYPtProtons_y");
2175 TH1D *gPtESDContamProtons = (TH1D *)f->Get("gHistESDContamYPtProtons_y");
2177 //Reconstruction efficiencies - protons
2178 TCanvas *c1 = new TCanvas("c1","Reconstruction efficiencies - Protons",
2180 c1->SetFillColor(41); c1->SetHighLightColor(41);
2182 c1->cd(1)->SetLeftMargin(0.15); c1->cd(1)->SetBottomMargin(0.15);
2183 c1->cd(1)->SetGridx(); c1->cd(1)->SetGridy();
2184 hEmpty->GetXaxis()->SetRangeUser(gYPrimariesESDProtons->GetXaxis()->GetXmin()-0.1,
2185 gYPrimariesESDProtons->GetXaxis()->GetXmax()+0.1);
2186 hEmpty->GetXaxis()->SetTitle(gYPrimariesESDProtons->GetXaxis()->GetTitle());
2194 tpave->DrawPave(gYPrimariesESDProtons->GetXaxis()->GetXmin()+0.1,119,
2195 gYPrimariesESDProtons->GetXaxis()->GetXmax()-0.1,bottomY);
2196 if(gShowPrimaries) {
2197 DrawMarker(gYPrimariesESDProtons->GetXaxis()->GetXmin()+0.2, 115, 20, 1.2, 1);
2198 t1->DrawLatex(gYPrimariesESDProtons->GetXaxis()->GetXmin()+0.3,113,"Primary p");
2199 gYPrimariesESDProtons->DrawCopy("ESAME");
2202 DrawMarker(gYPrimariesESDProtons->GetXaxis()->GetXmin()+0.2, 110, 21, 1.2, 2);
2203 t1->DrawLatex(gYPrimariesESDProtons->GetXaxis()->GetXmin()+0.3,108,"#Lambda -> p + #pi^{-}");
2204 gYESDProtonsFromWeak->DrawCopy("ESAME");
2207 DrawMarker(gYPrimariesESDProtons->GetXaxis()->GetXmin()+0.2, 105, 22, 1.2, 3);
2208 t1->DrawLatex(gYPrimariesESDProtons->GetXaxis()->GetXmin()+0.3,103,"X + A -> p + B");
2209 gYESDProtonsFromHadronic->DrawCopy("ESAME");
2212 c1->cd(2)->SetLeftMargin(0.15); c1->cd(2)->SetBottomMargin(0.15);
2213 c1->cd(2)->SetGridx(); c1->cd(2)->SetGridy();
2214 hEmpty->GetXaxis()->SetRangeUser(gPtPrimariesESDProtons->GetXaxis()->GetXmin()-0.1,
2215 gPtPrimariesESDProtons->GetXaxis()->GetXmax()+0.1);
2216 hEmpty->GetXaxis()->SetTitle(gPtPrimariesESDProtons->GetXaxis()->GetTitle());
2224 tpave->DrawPave(gPtPrimariesESDProtons->GetXaxis()->GetXmin(),119,
2225 gPtPrimariesESDProtons->GetXaxis()->GetXmax(),bottomY);
2226 if(gShowPrimaries) {
2227 DrawMarker(gPtPrimariesESDProtons->GetXaxis()->GetXmin()+0.05, 115, 20, 1.2, 1);
2228 t1->DrawLatex(gPtPrimariesESDProtons->GetXaxis()->GetXmin()+0.15,113,"Primary p");
2229 gPtPrimariesESDProtons->DrawCopy("ESAME");
2232 DrawMarker(gPtPrimariesESDProtons->GetXaxis()->GetXmin()+0.05, 110, 21, 1.2, 2);
2233 t1->DrawLatex(gPtPrimariesESDProtons->GetXaxis()->GetXmin()+0.15,108,"#Lambda -> p + #pi^{-}");
2234 gPtESDProtonsFromWeak->DrawCopy("ESAME");
2237 DrawMarker(gPtPrimariesESDProtons->GetXaxis()->GetXmin()+0.05, 105, 22, 1.2, 3);
2238 t1->DrawLatex(gPtPrimariesESDProtons->GetXaxis()->GetXmin()+0.15,103,"X + A -> p + B");
2239 gPtESDProtonsFromHadronic->DrawCopy("ESAME");
2241 c1->SaveAs("ReconstructionEfficiency-Protons.gif");
2243 //Reconstruction efficiencies - antiprotons
2244 TCanvas *c2 = new TCanvas("c2","Reconstruction efficiencies - Antirotons",
2246 c2->SetFillColor(41); c2->SetHighLightColor(41);
2248 c2->cd(1)->SetLeftMargin(0.15); c2->cd(1)->SetBottomMargin(0.15);
2249 c2->cd(1)->SetGridx(); c2->cd(1)->SetGridy();
2250 hEmpty->GetXaxis()->SetRangeUser(gYPrimariesESDAntiProtons->GetXaxis()->GetXmin()-0.1,
2251 gYPrimariesESDAntiProtons->GetXaxis()->GetXmax()+0.1);
2252 hEmpty->GetXaxis()->SetTitle(gYPrimariesESDAntiProtons->GetXaxis()->GetTitle());
2260 tpave->DrawPave(gYPrimariesESDAntiProtons->GetXaxis()->GetXmin()+0.1,119,
2261 gYPrimariesESDAntiProtons->GetXaxis()->GetXmax()-0.1,bottomY);
2262 if(gShowPrimaries) {
2263 DrawMarker(gYPrimariesESDAntiProtons->GetXaxis()->GetXmin()+0.2, 115, 20, 1.2, 1);
2264 t1->DrawLatex(gYPrimariesESDAntiProtons->GetXaxis()->GetXmin()+0.3,113,"Primary #bar{p}");
2265 gYPrimariesESDAntiProtons->DrawCopy("ESAME");
2268 DrawMarker(gYPrimariesESDAntiProtons->GetXaxis()->GetXmin()+0.2, 108, 21, 1.2, 2);
2269 t1->DrawLatex(gYPrimariesESDAntiProtons->GetXaxis()->GetXmin()+0.3,106,"#bar{#Lambda} -> #bar{p} + #pi^{+}");
2270 gYESDAntiProtonsFromWeak->DrawCopy("ESAME");
2273 DrawMarker(gYPrimariesESDAntiProtons->GetXaxis()->GetXmin()+0.2, 101, 22, 1.2, 3);
2274 t1->DrawLatex(gYPrimariesESDAntiProtons->GetXaxis()->GetXmin()+0.3,98,"X + A -> #bar{p} + B");
2275 gYESDAntiProtonsFromHadronic->DrawCopy("ESAME");
2278 c2->cd(2)->SetLeftMargin(0.15); c2->cd(2)->SetBottomMargin(0.15);
2279 c2->cd(2)->SetGridx(); c2->cd(2)->SetGridy();
2280 hEmpty->GetXaxis()->SetRangeUser(gPtPrimariesESDAntiProtons->GetXaxis()->GetXmin()-0.1,
2281 gPtPrimariesESDAntiProtons->GetXaxis()->GetXmax()+0.1);
2282 hEmpty->GetXaxis()->SetTitle(gPtPrimariesESDAntiProtons->GetXaxis()->GetTitle());
2291 tpave->DrawPave(gPtPrimariesESDAntiProtons->GetXaxis()->GetXmin(),119,
2292 gPtPrimariesESDAntiProtons->GetXaxis()->GetXmax(),bottomY);
2293 if(gShowPrimaries) {
2294 DrawMarker(gPtPrimariesESDAntiProtons->GetXaxis()->GetXmin()+0.05, 115, 20, 1.2, 1);
2295 t1->DrawLatex(gPtPrimariesESDAntiProtons->GetXaxis()->GetXmin()+0.15,113,"Primary #bar{p}");
2296 gPtPrimariesESDAntiProtons->DrawCopy("ESAME");
2299 DrawMarker(gPtPrimariesESDAntiProtons->GetXaxis()->GetXmin()+0.05, 108, 21, 1.2, 2);
2300 t1->DrawLatex(gPtPrimariesESDAntiProtons->GetXaxis()->GetXmin()+0.15,106,"#bar{#Lambda} -> #bar{p} + #pi^{+}");
2301 gPtESDAntiProtonsFromWeak->DrawCopy("ESAME");
2304 DrawMarker(gPtPrimariesESDAntiProtons->GetXaxis()->GetXmin()+0.05, 101, 22, 1.2, 3);
2305 t1->DrawLatex(gPtPrimariesESDAntiProtons->GetXaxis()->GetXmin()+0.15,98,"X + A -> #bar{p} + B");
2306 gPtESDAntiProtonsFromHadronic->DrawCopy("ESAME");
2308 c2->SaveAs("ReconstructionEfficiency-AntiProtons.gif");
2310 //PID efficiencies - (anti)protons
2311 TCanvas *c3 = new TCanvas("c3","PID efficiencies",
2313 c3->SetFillColor(41); c3->SetHighLightColor(41);
2315 c3->cd(1)->SetLeftMargin(0.15); c3->cd(1)->SetBottomMargin(0.15);
2316 c3->cd(1)->SetGridx(); c3->cd(1)->SetGridy();
2317 hEmpty->GetXaxis()->SetRangeUser(gYPrimariesESDProtons->GetXaxis()->GetXmin()-0.1,
2318 gYPrimariesESDProtons->GetXaxis()->GetXmax()+0.1);
2319 hEmpty->GetXaxis()->SetTitle(gYPrimariesESDProtons->GetXaxis()->GetTitle());
2321 tpave->DrawPave(gYPrimariesESDProtons->GetXaxis()->GetXmin()+0.1,119,
2322 gYPrimariesESDProtons->GetXaxis()->GetXmax()-0.1,104);
2323 gYESDIdProtons->DrawCopy("ESAME");
2324 gYESDContamProtons->DrawCopy("ESAME");
2325 DrawMarker(gYPrimariesESDProtons->GetXaxis()->GetXmin()+0.2, 115, 20, 1.2, 1);
2326 t1->DrawLatex(gYPrimariesESDProtons->GetXaxis()->GetXmin()+0.3,113,"Efficiency");
2327 DrawMarker(gYPrimariesESDProtons->GetXaxis()->GetXmin()+0.2, 108, 24, 1.2, 1);
2328 t1->DrawLatex(gYPrimariesESDProtons->GetXaxis()->GetXmin()+0.3,106,"Contamination");
2330 c3->cd(2)->SetLeftMargin(0.15); c3->cd(2)->SetBottomMargin(0.15);
2331 c3->cd(2)->SetGridx(); c3->cd(2)->SetGridy();
2332 hEmpty->GetXaxis()->SetRangeUser(gPtPrimariesESDProtons->GetXaxis()->GetXmin()-0.1,
2333 gPtPrimariesESDProtons->GetXaxis()->GetXmax()+0.1);
2334 hEmpty->GetXaxis()->SetTitle(gPtPrimariesESDProtons->GetXaxis()->GetTitle());
2336 tpave->DrawPave(gPtPrimariesESDProtons->GetXaxis()->GetXmin(),119,
2337 gPtPrimariesESDProtons->GetXaxis()->GetXmax(),104);
2338 gPtESDIdProtons->DrawCopy("ESAME");
2339 gPtESDContamProtons->DrawCopy("ESAME");
2340 DrawMarker(gPtPrimariesESDProtons->GetXaxis()->GetXmin()+0.05, 115, 20, 1.2, 1);
2341 t1->DrawLatex(gPtPrimariesESDProtons->GetXaxis()->GetXmin()+0.15,113,"Efficiency");
2342 DrawMarker(gPtPrimariesESDProtons->GetXaxis()->GetXmin()+0.05, 108, 24, 1.2, 1);
2343 t1->DrawLatex(gPtPrimariesESDProtons->GetXaxis()->GetXmin()+0.15,106,"Contamination");
2344 c3->SaveAs("PIDEfficiency-Protons.gif");
2347 //________________________________________________//
2348 void compareEfficiencies(const char *filenameTPC,
2349 const char *filenameHybrid,
2350 Bool_t gShowPrimaries = kTRUE,
2351 Bool_t gShowWeak = kFALSE,
2352 Bool_t gShowHadronic = kFALSE) {
2353 //Function to compare the reconstruction efficiencies between two methods:
2354 //e.g. TPC standalone and global tracking
2355 gStyle->SetPalette(1,0);
2356 gStyle->SetCanvasColor(41);
2357 gStyle->SetFrameFillColor(10);
2359 TH2F *hEmpty = new TH2F("hEmpty","",100,-1.5,2.0,100,0,120);
2360 hEmpty->SetStats(kFALSE);
2361 hEmpty->GetXaxis()->SetTitleColor(1);
2362 hEmpty->GetXaxis()->SetNdivisions(15);
2363 hEmpty->GetYaxis()->SetNdivisions(15);
2364 hEmpty->GetYaxis()->SetTitleOffset(1.4);
2365 hEmpty->GetYaxis()->SetTitle("#epsilon");
2367 TLatex *t1 = new TLatex();
2368 t1->SetTextSize(0.04);
2370 TPaveText *tpave = new TPaveText();
2371 tpave->SetFillColor(10);
2372 Double_t bottomY = 0.0;
2375 TFile *f1 = TFile::Open(filenameTPC);
2376 TH1D *g1YPrimariesESDProtons = (TH1D *)f1->Get("gYPrimariesESDProtons");
2377 TH1D *g1YESDProtonsFromWeak = (TH1D *)f1->Get("gYESDProtonsFromWeak");
2378 TH1D *g1YESDProtonsFromHadronic = (TH1D *)f1->Get("gYESDProtonsFromHadronic");
2379 TH1D *g1PtPrimariesESDProtons = (TH1D *)f1->Get("gPtPrimariesESDProtons");
2380 TH1D *g1PtESDProtonsFromWeak = (TH1D *)f1->Get("gPtESDProtonsFromWeak");
2381 TH1D *g1PtESDProtonsFromHadronic = (TH1D *)f1->Get("gPtESDProtonsFromHadronic");
2382 TH1D *g1YPrimariesESDAntiProtons = (TH1D *)f1->Get("gYPrimariesESDAntiProtons");
2383 TH1D *g1YESDAntiProtonsFromWeak = (TH1D *)f1->Get("gYESDAntiProtonsFromWeak");
2384 TH1D *g1YESDAntiProtonsFromHadronic = (TH1D *)f1->Get("gYESDAntiProtonsFromHadronic");
2385 TH1D *g1PtPrimariesESDAntiProtons = (TH1D *)f1->Get("gPtPrimariesESDAntiProtons");
2386 TH1D *g1PtESDAntiProtonsFromWeak = (TH1D *)f1->Get("gPtESDAntiProtonsFromWeak");
2387 TH1D *g1PtESDAntiProtonsFromHadronic = (TH1D *)f1->Get("gPtESDAntiProtonsFromHadronic");
2390 TFile *f2 = TFile::Open(filenameHybrid);
2391 TH1D *g2YPrimariesESDProtons = (TH1D *)f2->Get("gYPrimariesESDProtons");
2392 TH1D *g2YESDProtonsFromWeak = (TH1D *)f2->Get("gYESDProtonsFromWeak");
2393 TH1D *g2YESDProtonsFromHadronic = (TH1D *)f2->Get("gYESDProtonsFromHadronic");
2394 TH1D *g2PtPrimariesESDProtons = (TH1D *)f2->Get("gPtPrimariesESDProtons");
2395 TH1D *g2PtESDProtonsFromWeak = (TH1D *)f2->Get("gPtESDProtonsFromWeak");
2396 TH1D *g2PtESDProtonsFromHadronic = (TH1D *)f2->Get("gPtESDProtonsFromHadronic");
2397 TH1D *g2YPrimariesESDAntiProtons = (TH1D *)f2->Get("gYPrimariesESDAntiProtons");
2398 TH1D *g2YESDAntiProtonsFromWeak = (TH1D *)f2->Get("gYESDAntiProtonsFromWeak");
2399 TH1D *g2YESDAntiProtonsFromHadronic = (TH1D *)f2->Get("gYESDAntiProtonsFromHadronic");
2400 TH1D *g2PtPrimariesESDAntiProtons = (TH1D *)f2->Get("gPtPrimariesESDAntiProtons");
2401 TH1D *g2PtESDAntiProtonsFromWeak = (TH1D *)f2->Get("gPtESDAntiProtonsFromWeak");
2402 TH1D *g2PtESDAntiProtonsFromHadronic = (TH1D *)f2->Get("gPtESDAntiProtonsFromHadronic");
2404 //Reconstruction efficiencies - protons
2405 TCanvas *c1 = new TCanvas("c1","Reconstruction efficiencies - Protons",
2407 c1->SetFillColor(41); c1->SetHighLightColor(41);
2409 c1->cd(1)->SetLeftMargin(0.15); c1->cd(1)->SetBottomMargin(0.15);
2410 c1->cd(1)->SetGridx(); c1->cd(1)->SetGridy();
2411 hEmpty->GetXaxis()->SetRangeUser(-1.1,1.1);
2412 hEmpty->GetXaxis()->SetTitle("#eta");
2420 tpave->DrawPave(-0.4,119,1.1,bottomY);
2421 t1->DrawLatex(-0.3,113,"TPC");
2422 t1->DrawLatex(0.0,113,"Global");
2423 if(gShowPrimaries) {
2424 DrawMarker(-0.15, 110, 20, 1.2, 1);
2425 DrawMarker(0.15, 110, 24, 1.2, 1);
2426 t1->DrawLatex(0.35,108,"Primary p");
2427 g1YPrimariesESDProtons->DrawCopy("ESAME");
2428 g2YPrimariesESDProtons->SetMarkerStyle(24);
2429 g2YPrimariesESDProtons->DrawCopy("ESAME");
2432 DrawMarker(-0.15, 103, 21, 1.2, 2);
2433 DrawMarker(0.15, 103, 25, 1.2, 2);
2434 t1->DrawLatex(0.35,101,"#Lambda -> p + #pi^{-}");
2435 g1YESDProtonsFromWeak->DrawCopy("ESAME");
2436 g2YESDProtonsFromWeak->SetMarkerStyle(25);
2437 g2YESDProtonsFromWeak->DrawCopy("ESAME");
2440 DrawMarker(-0.15, 96, 22, 1.2, 3);
2441 DrawMarker(0.15, 96, 26, 1.2, 3);
2442 t1->DrawLatex(0.35,94,"X + A -> p + B");
2443 g1YESDProtonsFromHadronic->DrawCopy("ESAME");
2444 g2YESDProtonsFromHadronic->SetMarkerStyle(26);
2445 g2YESDProtonsFromHadronic->DrawCopy("ESAME");
2448 c1->cd(2)->SetLeftMargin(0.15); c1->cd(2)->SetBottomMargin(0.15);
2449 c1->cd(2)->SetGridx(); c1->cd(2)->SetGridy();
2450 hEmpty->GetXaxis()->SetRangeUser(0.0,1.7);
2451 hEmpty->GetXaxis()->SetTitle("P_{T} [GeV/c]");
2459 tpave->DrawPave(0.05,119,1.2,bottomY);
2460 t1->DrawLatex(0.1,113,"TPC");
2461 t1->DrawLatex(0.3,113,"Global");
2462 if(gShowPrimaries) {
2463 DrawMarker(0.15, 110, 20, 1.2, 1);
2464 DrawMarker(0.4, 110, 24, 1.2, 1);
2465 t1->DrawLatex(0.6,108,"Primary p");
2466 g1PtPrimariesESDProtons->DrawCopy("ESAME");
2467 g2PtPrimariesESDProtons->SetMarkerStyle(24);
2468 g2PtPrimariesESDProtons->DrawCopy("ESAME");
2471 DrawMarker(0.15, 103, 21, 1.2, 2);
2472 DrawMarker(0.4, 103, 25, 1.2, 2);
2473 t1->DrawLatex(0.6,101,"#Lambda -> p + #pi^{-}");
2474 g1PtESDProtonsFromWeak->DrawCopy("ESAME");
2475 g2PtESDProtonsFromWeak->SetMarkerStyle(25);
2476 g2PtESDProtonsFromWeak->DrawCopy("ESAME");
2479 DrawMarker(0.15, 96, 22, 1.2, 3);
2480 DrawMarker(0.4, 96, 26, 1.2, 3);
2481 t1->DrawLatex(0.6,94,"X + A -> p + B");
2482 g1PtESDProtonsFromHadronic->DrawCopy("ESAME");
2483 g2PtESDProtonsFromHadronic->SetMarkerStyle(26);
2484 g2PtESDProtonsFromHadronic->DrawCopy("ESAME");
2486 c1->SaveAs("ReconstructionEfficiency-Protons.gif");
2488 //Reconstruction efficiencies - antiprotons
2489 TCanvas *c2 = new TCanvas("c2","Reconstruction efficiencies - Antirotons",
2491 c2->SetFillColor(41); c2->SetHighLightColor(41);
2493 c2->cd(1)->SetLeftMargin(0.15); c2->cd(1)->SetBottomMargin(0.15);
2494 c2->cd(1)->SetGridx(); c2->cd(1)->SetGridy();
2495 hEmpty->GetXaxis()->SetRangeUser(-1.1,1.1);
2496 hEmpty->GetXaxis()->SetTitle("#eta");
2504 tpave->DrawPave(-0.4,119,1.1,bottomY);
2505 t1->DrawLatex(-0.3,113,"TPC");
2506 t1->DrawLatex(0.0,113,"Global");
2507 if(gShowPrimaries) {
2508 DrawMarker(-0.15, 110, 20, 1.2, 1);
2509 DrawMarker(0.15, 110, 24, 1.2, 1);
2510 t1->DrawLatex(0.35,108,"Primary #bar{p}");
2511 g1YPrimariesESDAntiProtons->DrawCopy("ESAME");
2512 g2YPrimariesESDAntiProtons->SetMarkerStyle(24);
2513 g2YPrimariesESDAntiProtons->DrawCopy("ESAME");
2516 DrawMarker(-0.15, 103, 21, 1.2, 2);
2517 DrawMarker(0.15, 103, 25, 1.2, 2);
2518 t1->DrawLatex(0.35,101,"#bar{#Lambda} -> #bar{p} + #pi^{+}");
2519 g1YESDAntiProtonsFromWeak->DrawCopy("ESAME");
2520 g2YESDAntiProtonsFromWeak->SetMarkerStyle(25);
2521 g2YESDAntiProtonsFromWeak->DrawCopy("ESAME");
2524 DrawMarker(-0.15, 96, 22, 1.2, 3);
2525 DrawMarker(0.15, 96, 26, 1.2, 3);
2526 t1->DrawLatex(0.35,94,"X + A -> #bar{p} + B");
2527 g1YESDAntiProtonsFromHadronic->DrawCopy("ESAME");
2528 g2YESDAntiProtonsFromHadronic->SetMarkerStyle(26);
2529 g2YESDAntiProtonsFromHadronic->DrawCopy("ESAME");
2532 c2->cd(2)->SetLeftMargin(0.15); c2->cd(2)->SetBottomMargin(0.15);
2533 c2->cd(2)->SetGridx(); c2->cd(2)->SetGridy();
2534 hEmpty->GetXaxis()->SetRangeUser(0.0,1.7);
2535 hEmpty->GetXaxis()->SetTitle("P_{T} [GeV/c]");
2543 tpave->DrawPave(0.05,119,1.2,bottomY);
2544 t1->DrawLatex(0.1,113,"TPC");
2545 t1->DrawLatex(0.3,113,"Global");
2546 if(gShowPrimaries) {
2547 DrawMarker(0.15, 110, 20, 1.2, 1);
2548 DrawMarker(0.4, 110, 24, 1.2, 1);
2549 t1->DrawLatex(0.6,108,"Primary #bar{p}");
2550 g1PtPrimariesESDAntiProtons->DrawCopy("ESAME");
2551 g2PtPrimariesESDAntiProtons->SetMarkerStyle(24);
2552 g2PtPrimariesESDAntiProtons->DrawCopy("ESAME");
2555 DrawMarker(0.15, 103, 21, 1.2, 2);
2556 DrawMarker(0.4, 103, 25, 1.2, 2);
2557 t1->DrawLatex(0.6,101,"#bar{#Lambda} -> #bar{p} + #pi^{+}");
2558 g1PtESDAntiProtonsFromWeak->DrawCopy("ESAME");
2559 g2PtESDAntiProtonsFromWeak->SetMarkerStyle(25);
2560 g2PtESDAntiProtonsFromWeak->DrawCopy("ESAME");
2563 DrawMarker(0.15, 96, 22, 1.2, 3);
2564 DrawMarker(0.4, 96, 26, 1.2, 3);
2565 t1->DrawLatex(0.6,94,"X + A -> #bar{p} + B");
2566 g1PtESDAntiProtonsFromHadronic->DrawCopy("ESAME");
2567 g2PtESDAntiProtonsFromHadronic->SetMarkerStyle(26);
2568 g2PtESDAntiProtonsFromHadronic->DrawCopy("ESAME");
2570 c2->SaveAs("ReconstructionEfficiency-AntiProtons.gif");
2574 //________________________________________________//
2575 void drawCutParametersDistributions(const char* filename = "Protons.QA.Histograms.root") {
2576 //macro that takes as an input the third file
2577 //created by the proton QA analysis task
2578 //and draws the DCA distributions of protons
2579 //and antiprotons (both primary & secondaries)
2580 const Int_t nEvents = 1;
2581 gStyle->SetPalette(1,0);
2583 TFile *f = TFile::Open(filename);
2586 TH1F *gCutListHistograms[100];
2587 TList *listCut = (TList *)f->Get("acceptedCutList");
2589 cout<<"Cut list entries: "<<listCut->GetEntries()<<endl;
2590 for(Int_t iEntry = 0; iEntry < listCut->GetEntries(); iEntry++) {
2591 if(iCounter == 4) iCounter = 0;
2593 gCutListHistograms[iEntry] = (TH1F *)listCut->At(iEntry);
2594 gCutListHistograms[iEntry]->Scale(1./nEvents);
2596 gCutListHistograms[iEntry]->SetFillColor(4);
2597 gCutListHistograms[iEntry]->SetMarkerColor(4);
2598 gCutListHistograms[iEntry]->SetMarkerStyle(20);
2601 gCutListHistograms[iEntry]->SetFillColor(kOrange+1);
2602 gCutListHistograms[iEntry]->SetMarkerColor(kOrange+1);
2603 gCutListHistograms[iEntry]->SetMarkerStyle(29);
2605 /*cout<<"Entry: "<<iEntry<<
2606 " - Counter: "<<iCounter<<
2607 " - Name: "<<gCutListHistograms[iEntry]->GetName()<<endl;*/
2611 TH1F *gDCAListHistograms[20];
2612 TList *listDCA = (TList *)f->Get("acceptedDCAList");
2614 Int_t nDCAHistos1D = 12;
2615 cout<<"DCA list entries: "<<listDCA->GetEntries()<<endl;
2616 for(Int_t iEntry = 0; iEntry < nDCAHistos1D; iEntry++) {
2617 if(iCounter == 4) iCounter = 0;
2619 gDCAListHistograms[iEntry] = (TH1F *)listDCA->At(iEntry);
2620 gDCAListHistograms[iEntry]->Scale(1./nEvents);
2622 gDCAListHistograms[iEntry]->SetFillColor(4);
2623 gDCAListHistograms[iEntry]->SetMarkerColor(4);
2624 gDCAListHistograms[iEntry]->SetMarkerStyle(20);
2627 gDCAListHistograms[iEntry]->SetFillColor(kOrange+1);
2628 gDCAListHistograms[iEntry]->SetMarkerColor(kOrange+1);
2629 gDCAListHistograms[iEntry]->SetMarkerStyle(29);
2631 /*cout<<"Entry: "<<iEntry<<
2632 " - Counter: "<<iCounter<<
2633 " - Name: "<<gDCAListHistograms[iEntry]->GetName()<<endl;*/
2636 TH2F *gDCAListHistograms2D[20];
2637 Int_t nDCAHistos2D = 12;
2638 for(Int_t iEntry = nDCAHistos1D; iEntry < 2*nDCAHistos2D; iEntry++)
2639 gDCAListHistograms2D[iEntry-nDCAHistos1D] = (TH2F *)listDCA->At(iEntry);
2640 //_________________________________________________________//
2641 TF1 *gDCA = new TF1("gDCA",
2642 "[0]*TMath::Power(1+TMath::Exp((x-[1])/[2]),-1)",
2644 gDCA->SetParameter(0,1.74221e+07);
2645 gDCA->SetParameter(1,-1.12221e+01);
2646 gDCA->SetParameter(2,1.02726);
2647 //_________________________________________________________//
2648 TH2F *hEmpty = new TH2F("hEmpty","",300,-100,200,100,1e-01,1e+06);
2649 hEmpty->GetYaxis()->SetTitle("Entries/Event");
2650 hEmpty->GetYaxis()->SetNdivisions(10);
2651 hEmpty->GetXaxis()->SetNdivisions(10);
2652 hEmpty->SetStats(kFALSE);
2653 //_________________________________________________________//
2656 TCanvas *c1 = new TCanvas("c1","ITS Cluster map",0,0,650,350);
2657 c1->SetFillColor(10); c1->GetFrame()->SetFillColor(10);
2658 c1->SetHighLightColor(10); c1->Divide(2,1);
2659 c1->cd(1)->SetBottomMargin(0.2); c1->cd(1)->SetLeftMargin(0.2);
2660 c1->cd(1)->SetLogy();
2661 hEmpty->GetXaxis()->SetTitle("ITS layer");
2662 hEmpty->GetXaxis()->SetRangeUser(0.0,7.0);
2663 hEmpty->SetTitle("Protons");
2665 gCutListHistograms[0]->Draw("ESAME");
2666 gCutListHistograms[2]->Draw("ESAME");
2667 c1->cd(2)->SetBottomMargin(0.2); c1->cd(2)->SetLeftMargin(0.2);
2668 c1->cd(2)->SetLogy();
2669 hEmpty->GetXaxis()->SetTitle("ITS layer");
2670 hEmpty->GetXaxis()->SetRangeUser(0.0,7.0);
2671 hEmpty->SetTitle("Antiprotons");
2673 gCutListHistograms[1]->Draw("ESAME");
2674 gCutListHistograms[3]->Draw("ESAME");
2675 c1->SaveAs("ITSClusterMap.gif");
2677 TCanvas *c2 = new TCanvas("c2","Number of ITS Clusters",50,50,650,350);
2678 c2->SetFillColor(10); c2->GetFrame()->SetFillColor(10);
2679 c2->SetHighLightColor(10); c2->Divide(2,1);
2680 c2->cd(1)->SetBottomMargin(0.2); c2->cd(1)->SetLeftMargin(0.2);
2681 c2->cd(1)->SetLogy();
2682 hEmpty->GetXaxis()->SetTitle("N_{clusters}(ITS)");
2683 hEmpty->GetXaxis()->SetRangeUser(0.0,7.0);
2684 hEmpty->SetTitle("Protons");
2686 gCutListHistograms[4]->Draw("ESAME");
2687 gCutListHistograms[6]->Draw("ESAME");
2688 c2->cd(2)->SetBottomMargin(0.2); c2->cd(2)->SetLeftMargin(0.2);
2689 c2->cd(2)->SetLogy();
2690 hEmpty->GetXaxis()->SetTitle("N_{clusters}(ITS)");
2691 hEmpty->GetXaxis()->SetRangeUser(0.0,7.0);
2692 hEmpty->SetTitle("Antiprotons");
2694 gCutListHistograms[5]->Draw("ESAME");
2695 gCutListHistograms[7]->Draw("ESAME");
2696 c2->SaveAs("NITSClusters.gif");
2698 TCanvas *c3 = new TCanvas("c3","Chi2 per ITS cluster",100,100,650,350);
2699 c3->SetFillColor(10); c3->GetFrame()->SetFillColor(10);
2700 c3->SetHighLightColor(10); c3->Divide(2,1);
2701 c3->cd(1)->SetBottomMargin(0.2); c3->cd(1)->SetLeftMargin(0.2);
2702 c3->cd(1)->SetLogy();
2703 hEmpty->GetXaxis()->SetTitle("#chi^{2}/N_{clusters}(ITS)");
2704 hEmpty->GetXaxis()->SetRangeUser(0.0,20.0);
2705 hEmpty->SetTitle("Protons");
2707 gCutListHistograms[8]->Draw("ESAME");
2708 gCutListHistograms[10]->Draw("ESAME");
2709 c3->cd(2)->SetBottomMargin(0.2); c3->cd(2)->SetLeftMargin(0.2);
2710 c3->cd(2)->SetLogy();
2711 hEmpty->GetXaxis()->SetTitle("#chi^{2}/N_{clusters}(ITS)");
2712 hEmpty->GetXaxis()->SetRangeUser(0.0,20.0);
2713 hEmpty->SetTitle("AntiPpotons");
2715 gCutListHistograms[9]->Draw("ESAME");
2716 gCutListHistograms[11]->Draw("ESAME");
2717 c3->SaveAs("Chi2PerITSCluster.gif");
2719 TCanvas *c4 = new TCanvas("c4","Constrain chi2 - vertex",150,150,650,350);
2720 c4->SetFillColor(10); c4->GetFrame()->SetFillColor(10);
2721 c4->SetHighLightColor(10); c4->Divide(2,1);
2722 c4->cd(1)->SetBottomMargin(0.2); c4->cd(1)->SetLeftMargin(0.2);
2723 c4->cd(1)->SetLogy();
2724 hEmpty->GetXaxis()->SetTitle("log_{10}(#chi^{2}) (vertex)");
2725 hEmpty->GetXaxis()->SetRangeUser(-10.0,10.0);
2726 hEmpty->SetTitle("Protons");
2728 gCutListHistograms[12]->Draw("ESAME");
2729 gCutListHistograms[14]->Draw("ESAME");
2730 c4->cd(2)->SetBottomMargin(0.2); c4->cd(2)->SetLeftMargin(0.2);
2731 c4->cd(2)->SetLogy();
2732 hEmpty->GetXaxis()->SetTitle("log_{10}(#chi^{2}) (vertex )");
2733 hEmpty->GetXaxis()->SetRangeUser(-10.0,10.0);
2734 hEmpty->SetTitle("Antiprotons");
2736 gCutListHistograms[13]->Draw("ESAME");
2737 gCutListHistograms[15]->Draw("ESAME");
2738 c4->SaveAs("ConstrainChi2Vertex.gif");
2740 TCanvas *c5 = new TCanvas("c5","Number of TPC Clusters",200,200,650,350);
2741 c5->SetFillColor(10); c5->GetFrame()->SetFillColor(10);
2742 c5->SetHighLightColor(10); c5->Divide(2,1);
2743 c5->cd(1)->SetBottomMargin(0.2); c5->cd(1)->SetLeftMargin(0.2);
2744 c5->cd(1)->SetLogy();
2745 hEmpty->GetXaxis()->SetTitle("N_{clusters}(TPC");
2746 hEmpty->GetXaxis()->SetRangeUser(0.0,200.0);
2747 hEmpty->SetTitle("Protons");
2749 gCutListHistograms[16]->Draw("ESAME");
2750 gCutListHistograms[18]->Draw("ESAME");
2751 c5->cd(2)->SetBottomMargin(0.2); c5->cd(2)->SetLeftMargin(0.2);
2752 c5->cd(2)->SetLogy();
2753 hEmpty->GetXaxis()->SetTitle("N_{clusters}(TPC");
2754 hEmpty->GetXaxis()->SetRangeUser(0.0,200.0);
2755 hEmpty->SetTitle("Antiprotons");
2757 gCutListHistograms[17]->Draw("ESAME");
2758 gCutListHistograms[19]->Draw("ESAME");
2759 c5->SaveAs("NTPCClusters.gif");
2761 TCanvas *c6 = new TCanvas("c6","Chi2 per TPC cluster",250,250,650,350);
2762 c6->SetFillColor(10); c6->GetFrame()->SetFillColor(10);
2763 c6->SetHighLightColor(10); c6->Divide(2,1);
2764 c6->cd(1)->SetBottomMargin(0.2); c6->cd(1)->SetLeftMargin(0.2);
2765 c6->cd(1)->SetLogy();
2766 hEmpty->GetXaxis()->SetTitle("#chi^{2}/N_{clusters}(TPC)");
2767 hEmpty->GetXaxis()->SetRangeUser(0.0,4.0);
2768 hEmpty->SetTitle("Protons");
2770 gCutListHistograms[20]->Draw("ESAME");
2771 gCutListHistograms[22]->Draw("ESAME");
2772 c6->cd(2)->SetBottomMargin(0.2); c6->cd(2)->SetLeftMargin(0.2);
2773 c6->cd(2)->SetLogy();
2774 hEmpty->GetXaxis()->SetTitle("#chi^{2}/N_{clusters}(TPC)");
2775 hEmpty->GetXaxis()->SetRangeUser(0.0,4.0);
2776 hEmpty->SetTitle("Antiprotons");
2778 gCutListHistograms[21]->Draw("ESAME");
2779 gCutListHistograms[23]->Draw("ESAME");
2780 c6->SaveAs("Chi2PerTPCCluster.gif");
2782 TCanvas *c7 = new TCanvas("c7","Covariance matrix 11",300,300,650,350);
2783 c7->SetFillColor(10); c7->GetFrame()->SetFillColor(10);
2784 c7->SetHighLightColor(10); c7->Divide(2,1);
2785 c7->cd(1)->SetBottomMargin(0.2); c7->cd(1)->SetLeftMargin(0.2);
2786 c7->cd(1)->SetLogy();
2787 hEmpty->GetXaxis()->SetTitle("#sigma_{y} [cm]");
2788 hEmpty->GetXaxis()->SetRangeUser(0.0,4.0);
2789 hEmpty->SetTitle("Protons");
2791 gCutListHistograms[24]->Draw("ESAME");
2792 gCutListHistograms[26]->Draw("ESAME");
2793 c7->cd(2)->SetBottomMargin(0.2); c7->cd(2)->SetLeftMargin(0.2);
2794 c7->cd(2)->SetLogy();
2795 hEmpty->GetXaxis()->SetTitle("#sigma_{y} [cm]");
2796 hEmpty->GetXaxis()->SetRangeUser(0.0,4.0);
2797 hEmpty->SetTitle("Antiprotons");
2799 gCutListHistograms[25]->Draw("ESAME");
2800 gCutListHistograms[27]->Draw("ESAME");
2801 c7->SaveAs("Cov11.gif");
2803 TCanvas *c8 = new TCanvas("c8","Covariance matrix 22",350,350,650,350);
2804 c8->SetFillColor(10); c8->GetFrame()->SetFillColor(10);
2805 c8->SetHighLightColor(10); c8->Divide(2,1);
2806 c8->cd(1)->SetBottomMargin(0.2); c8->cd(1)->SetLeftMargin(0.2);
2807 c8->cd(1)->SetLogy();
2808 hEmpty->GetXaxis()->SetTitle("#sigma_{z} [cm]");
2809 hEmpty->GetXaxis()->SetRangeUser(0.0,4.0);
2810 hEmpty->SetTitle("Protons");
2812 gCutListHistograms[28]->Draw("ESAME");
2813 gCutListHistograms[30]->Draw("ESAME");
2814 c8->cd(2)->SetBottomMargin(0.2); c8->cd(2)->SetLeftMargin(0.2);
2815 c8->cd(2)->SetLogy();
2816 hEmpty->GetXaxis()->SetTitle("#sigma_{z} [cm]");
2817 hEmpty->GetXaxis()->SetRangeUser(0.0,4.0);
2818 hEmpty->SetTitle("Antiprotons");
2820 gCutListHistograms[29]->Draw("ESAME");
2821 gCutListHistograms[31]->Draw("ESAME");
2822 c8->SaveAs("Cov22.gif");
2824 TCanvas *c9 = new TCanvas("c9","Covariance matrix 33",400,400,650,350);
2825 c9->SetFillColor(10); c9->GetFrame()->SetFillColor(10);
2826 c9->SetHighLightColor(10); c9->Divide(2,1);
2827 c9->cd(1)->SetBottomMargin(0.2); c9->cd(1)->SetLeftMargin(0.2);
2828 c9->cd(1)->SetLogy();
2829 hEmpty->GetXaxis()->SetTitle("#sigma_{sin(#phi)}");
2830 hEmpty->GetXaxis()->SetRangeUser(0.0,4.0);
2831 hEmpty->SetTitle("Protons");
2833 gCutListHistograms[32]->Draw("ESAME");
2834 gCutListHistograms[34]->Draw("ESAME");
2835 c9->cd(2)->SetBottomMargin(0.2); c9->cd(2)->SetLeftMargin(0.2);
2836 c9->cd(2)->SetLogy();
2837 hEmpty->GetXaxis()->SetTitle("#sigma_{sin(#phi)}");
2838 hEmpty->GetXaxis()->SetRangeUser(0.0,4.0);
2839 hEmpty->SetTitle("Antiprotons");
2841 gCutListHistograms[33]->Draw("ESAME");
2842 gCutListHistograms[35]->Draw("ESAME");
2843 c9->SaveAs("Cov33.gif");
2845 TCanvas *c10 = new TCanvas("c10","Covariance matrix 44",450,450,650,350);
2846 c10->SetFillColor(10); c10->GetFrame()->SetFillColor(10);
2847 c10->SetHighLightColor(10); c10->Divide(2,1);
2848 c10->cd(1)->SetBottomMargin(0.2); c10->cd(1)->SetLeftMargin(0.2);
2849 c10->cd(1)->SetLogy();
2850 hEmpty->GetXaxis()->SetTitle("#sigma_{tan(#lambda)}");
2851 hEmpty->GetXaxis()->SetRangeUser(0.0,4.0);
2852 hEmpty->SetTitle("Protons");
2854 gCutListHistograms[36]->Draw("ESAME");
2855 gCutListHistograms[38]->Draw("ESAME");
2856 c10->cd(2)->SetBottomMargin(0.2); c10->cd(2)->SetLeftMargin(0.2);
2857 c10->cd(2)->SetLogy();
2858 hEmpty->GetXaxis()->SetTitle("#sigma_{tan(#lambda)}");
2859 hEmpty->GetXaxis()->SetRangeUser(0.0,4.0);
2860 hEmpty->SetTitle("Antiprotons");
2862 gCutListHistograms[37]->Draw("ESAME");
2863 gCutListHistograms[39]->Draw("ESAME");
2864 c10->SaveAs("Cov44.gif");
2866 TCanvas *c11 = new TCanvas("c11","Covariance matrix 55",500,500,650,350);
2867 c11->SetFillColor(10); c11->GetFrame()->SetFillColor(10);
2868 c11->SetHighLightColor(10); c11->Divide(2,1);
2869 c11->cd(1)->SetBottomMargin(0.2); c11->cd(1)->SetLeftMargin(0.2);
2870 c11->cd(1)->SetLogy();
2871 hEmpty->GetXaxis()->SetTitle("#sigma_{1/P_{T}} [GeV/c]^{-1}");
2872 hEmpty->GetXaxis()->SetRangeUser(0.0,4.0);
2873 hEmpty->SetTitle("Protons");
2875 gCutListHistograms[40]->Draw("ESAME");
2876 gCutListHistograms[42]->Draw("ESAME");
2877 c11->cd(2)->SetBottomMargin(0.2); c11->cd(2)->SetLeftMargin(0.2);
2878 c11->cd(2)->SetLogy();
2879 hEmpty->GetXaxis()->SetTitle("#sigma_{1/P_{T}} [GeV/c]^{-1}");
2880 hEmpty->GetXaxis()->SetRangeUser(0.0,4.0);
2881 hEmpty->SetTitle("Antiprotons");
2883 gCutListHistograms[41]->Draw("ESAME");
2884 gCutListHistograms[43]->Draw("ESAME");
2885 c11->SaveAs("Cov55.gif");
2887 TCanvas *c12 = new TCanvas("c12","Number of TPC points (dE/dx)",550,550,650,350);
2888 c12->SetFillColor(10); c12->GetFrame()->SetFillColor(10);
2889 c12->SetHighLightColor(10); c12->Divide(2,1);
2890 c12->cd(1)->SetBottomMargin(0.2); c12->cd(1)->SetLeftMargin(0.2);
2891 c12->cd(1)->SetLogy();
2892 hEmpty->GetXaxis()->SetTitle("N_{points} (TPC-dE/dx");
2893 hEmpty->GetXaxis()->SetRangeUser(0.0,200.0);
2894 hEmpty->SetTitle("Protons");
2896 gCutListHistograms[56]->Draw("ESAME");
2897 gCutListHistograms[58]->Draw("ESAME");
2898 c12->cd(2)->SetBottomMargin(0.2); c12->cd(2)->SetLeftMargin(0.2);
2899 c12->cd(2)->SetLogy();
2900 hEmpty->GetXaxis()->SetTitle("N_{points} (TPC-dE/dx");
2901 hEmpty->GetXaxis()->SetRangeUser(0.0,200.0);
2902 hEmpty->SetTitle("Antiprotons");
2904 gCutListHistograms[57]->Draw("ESAME");
2905 gCutListHistograms[59]->Draw("ESAME");
2906 c12->SaveAs("Npoints-TPCdEdx.gif");
2909 //DCA cut parameters
2910 TCanvas *c13 = new TCanvas("c13","DCA xy",600,600,650,350);
2911 c13->SetFillColor(10); c13->GetFrame()->SetFillColor(10);
2912 c13->SetHighLightColor(10); c13->Divide(2,1);
2913 c13->cd(1)->SetBottomMargin(0.2); c13->cd(1)->SetLeftMargin(0.2);
2914 c13->cd(1)->SetLogy();
2915 hEmpty->GetXaxis()->SetTitle("DCA_{xy} [cm]");
2916 hEmpty->GetXaxis()->SetRangeUser(0.0,20.0);
2917 hEmpty->SetTitle("Protons");
2919 gDCAListHistograms[2]->Draw("ESAME");
2920 //gDCAListHistograms[2]->Fit("gDCA","","esame",0.1,12);
2921 gDCAListHistograms[0]->Draw("ESAME");
2922 c13->cd(2)->SetBottomMargin(0.15); c13->cd(2)->SetLeftMargin(0.15);
2923 c13->cd(2)->SetLogy();
2924 hEmpty->GetXaxis()->SetTitle("DCA_{xy} [cm]");
2925 hEmpty->GetXaxis()->SetRangeUser(0.0,20.0);
2926 hEmpty->SetTitle("Antiprotons");
2928 gDCAListHistograms[1]->Draw("ESAME");
2929 gDCAListHistograms[3]->Draw("ESAME");
2930 c13->SaveAs("DCAxy.gif");
2932 TCanvas *c14 = new TCanvas("c14","DCA z",650,650,650,350);
2933 c14->SetFillColor(10); c14->GetFrame()->SetFillColor(10);
2934 c14->SetHighLightColor(10); c14->Divide(2,1);
2935 c14->cd(1)->SetBottomMargin(0.2); c14->cd(1)->SetLeftMargin(0.2);
2936 c14->cd(1)->SetLogy();
2937 hEmpty->GetXaxis()->SetTitle("DCA_{z} [cm]");
2938 hEmpty->GetXaxis()->SetRangeUser(0.0,20.0);
2939 hEmpty->SetTitle("Protons");
2941 gDCAListHistograms[4]->Draw("ESAME");
2942 gDCAListHistograms[6]->Draw("ESAME");
2943 //gDCAListHistograms[6]->Fit("gDCA","","esame",0.1,12);
2944 c14->cd(2)->SetBottomMargin(0.15); c14->cd(2)->SetLeftMargin(0.15);
2945 c14->cd(2)->SetLogy();
2946 hEmpty->GetXaxis()->SetTitle("DCA_{z} [cm]");
2947 hEmpty->GetXaxis()->SetRangeUser(0.0,20.0);
2948 hEmpty->SetTitle("Antiprotons");
2950 gDCAListHistograms[5]->Draw("ESAME");
2951 gDCAListHistograms[7]->Draw("ESAME");
2952 c14->SaveAs("DCAz.gif");
2954 TCanvas *c15 = new TCanvas("c15","Sigma to vertex",700,700,650,350);
2955 c15->SetFillColor(10); c15->GetFrame()->SetFillColor(10);
2956 c15->SetHighLightColor(10); c15->Divide(2,1);
2957 c15->cd(1)->SetBottomMargin(0.2); c15->cd(1)->SetLeftMargin(0.2);
2958 c15->cd(1)->SetLogy();
2959 hEmpty->GetXaxis()->SetTitle("N_{#sigma}(Vertex)");
2960 hEmpty->GetXaxis()->SetRangeUser(0.0,7.0);
2961 hEmpty->SetTitle("Protons");
2963 gDCAListHistograms[8]->DrawCopy("ESAME");
2964 gDCAListHistograms[10]->DrawCopy("ESAME");
2965 c15->cd(2)->SetBottomMargin(0.15); c15->cd(2)->SetLeftMargin(0.15);
2966 c15->cd(2)->SetLogy();
2967 hEmpty->GetXaxis()->SetTitle("N_{#sigma}(Vertex)");
2968 hEmpty->GetXaxis()->SetRangeUser(0.0,7.0);
2969 hEmpty->SetTitle("Antiprotons");
2971 gDCAListHistograms[9]->DrawCopy("ESAME");
2972 gDCAListHistograms[11]->DrawCopy("ESAME");
2973 c15->SaveAs("NSigmaToVertex.gif");
2975 TCanvas *c16 = new TCanvas("c16","dca(xy) vs Pt",0,0,900,650);
2976 c16->SetFillColor(10); c16->GetFrame()->SetFillColor(10);
2977 c16->SetHighLightColor(10); c16->Divide(3,2);
2978 c16->cd(1)->SetBottomMargin(0.2); c16->cd(1)->SetLeftMargin(0.2);
2979 gDCAListHistograms2D[0]->SetTitle("Accepted primary protons");
2980 gDCAListHistograms2D[0]->Draw("colz");
2981 c16->cd(2)->SetBottomMargin(0.2); c16->cd(2)->SetLeftMargin(0.2);
2982 gDCAListHistograms2D[2]->SetTitle("Accepted secondary protons (weak decay)");
2983 gDCAListHistograms2D[2]->Draw("colz");
2984 c16->cd(3)->SetBottomMargin(0.2); c16->cd(3)->SetLeftMargin(0.2);
2985 gDCAListHistograms2D[4]->SetTitle("Accepted secondary protons (material)");
2986 gDCAListHistograms2D[4]->Draw("colz");
2987 c16->cd(4)->SetBottomMargin(0.2); c16->cd(4)->SetLeftMargin(0.2);
2988 gDCAListHistograms2D[1]->SetTitle("Accepted primary antiprotons");
2989 gDCAListHistograms2D[1]->Draw("colz");
2990 c16->cd(5)->SetBottomMargin(0.2); c16->cd(5)->SetLeftMargin(0.2);
2991 gDCAListHistograms2D[3]->SetTitle("Accepted secondary antiprotons (weak decay)");
2992 gDCAListHistograms2D[3]->Draw("colz");
2993 c16->cd(6)->SetBottomMargin(0.2); c16->cd(6)->SetLeftMargin(0.2);
2994 gDCAListHistograms2D[5]->SetTitle("Accepted secondary antiprotons (material)");
2995 gDCAListHistograms2D[5]->Draw("colz");
2997 TCanvas *c17 = new TCanvas("c17","dca(z) vs Pt",100,100,900,650);
2998 c17->SetFillColor(10); c17->GetFrame()->SetFillColor(10);
2999 c17->SetHighLightColor(10); c17->Divide(3,2);
3000 c17->cd(1)->SetBottomMargin(0.2); c17->cd(1)->SetLeftMargin(0.2);
3001 gDCAListHistograms2D[6]->SetTitle("Accepted primary protons");
3002 gDCAListHistograms2D[6]->Draw("colz");
3003 c17->cd(2)->SetBottomMargin(0.2); c17->cd(2)->SetLeftMargin(0.2);
3004 gDCAListHistograms2D[8]->SetTitle("Accepted secondary protons (weak decay)");
3005 gDCAListHistograms2D[8]->Draw("colz");
3006 c17->cd(3)->SetBottomMargin(0.2); c17->cd(3)->SetLeftMargin(0.2);
3007 gDCAListHistograms2D[10]->SetTitle("Accepted secondary protons (material)");
3008 gDCAListHistograms2D[10]->Draw("colz");
3009 c17->cd(4)->SetBottomMargin(0.2); c17->cd(4)->SetLeftMargin(0.2);
3010 gDCAListHistograms2D[7]->SetTitle("Accepted primary antiprotons");
3011 gDCAListHistograms2D[7]->Draw("colz");
3012 c17->cd(5)->SetBottomMargin(0.2); c17->cd(5)->SetLeftMargin(0.2);
3013 gDCAListHistograms2D[9]->SetTitle("Accepted secondary antiprotons (weak decay)");
3014 gDCAListHistograms2D[9]->Draw("colz");
3015 c17->cd(6)->SetBottomMargin(0.2); c17->cd(6)->SetLeftMargin(0.2);
3016 gDCAListHistograms2D[11]->SetTitle("Accepted secondary antiprotons (material)");
3017 gDCAListHistograms2D[11]->Draw("colz");
3022 //________________________________________________//
3023 void draw2DEfficiency(const char *analysisMode = "TPC",
3024 const char *pidMode = "Bayesian",
3025 const char* projection = "yx") {
3026 gStyle->SetPalette(1,0);
3027 gStyle->SetCanvasColor(41);
3028 gStyle->SetFrameFillColor(10);
3030 TString filename = "Protons.Efficiency.";filename += analysisMode;
3031 filename += "."; filename += pidMode; filename += ".root";
3032 TFile *f = TFile::Open(filename.Data());
3033 TList *list = (TList *)f->Get("efficiencyList");
3035 TH3D *gHistESDInitYPtProtons = (TH3D *)list->At(12);
3036 TH2D *gInit = (TH2D *)gHistESDInitYPtProtons->Project3D(projection);
3037 TH3D *gHistESDIdYPtProtons = (TH3D *)list->At(13);
3038 TH2D *gId = (TH2D *)gHistESDIdYPtProtons->Project3D(projection);
3041 gId->GetZaxis()->SetTitle("#epsilon [%]");
3043 TH2F *h = new TH2F("h","",100,-1,1,10000,0,210);
3044 h->SetStats(kFALSE);
3046 switch(projection) {
3048 gId->GetZaxis()->SetRangeUser(90,100);
3049 h->GetXaxis()->SetRangeUser(gHistESDInitYPtProtons->GetXaxis()->GetXmin(),
3050 gHistESDInitYPtProtons->GetXaxis()->GetXmax());
3051 h->GetYaxis()->SetRangeUser(gHistESDInitYPtProtons->GetYaxis()->GetXmin(),
3052 gHistESDInitYPtProtons->GetYaxis()->GetXmax());
3053 h->GetXaxis()->SetTitle(gId->GetXaxis()->GetTitle());
3054 h->GetYaxis()->SetTitle(gId->GetYaxis()->GetTitle());
3057 gId->GetZaxis()->SetRangeUser(0,100);
3058 h->GetXaxis()->SetRangeUser(gHistESDInitYPtProtons->GetXaxis()->GetXmin(),
3059 gHistESDInitYPtProtons->GetXaxis()->GetXmax());
3060 h->GetYaxis()->SetRangeUser(gHistESDInitYPtProtons->GetZaxis()->GetXmin(),
3061 gHistESDInitYPtProtons->GetZaxis()->GetXmax());
3062 h->GetXaxis()->SetTitle(gId->GetXaxis()->GetTitle());
3063 h->GetYaxis()->SetTitle(gId->GetYaxis()->GetTitle());
3066 gId->GetZaxis()->SetRangeUser(0,100);
3067 h->GetXaxis()->SetRangeUser(gHistESDInitYPtProtons->GetYaxis()->GetXmin(),
3068 gHistESDInitYPtProtons->GetYaxis()->GetXmax());
3069 h->GetYaxis()->SetRangeUser(gHistESDInitYPtProtons->GetZaxis()->GetXmin(),
3070 gHistESDInitYPtProtons->GetZaxis()->GetXmax());
3071 h->GetXaxis()->SetTitle(gId->GetXaxis()->GetTitle());
3072 h->GetYaxis()->SetTitle(gId->GetYaxis()->GetTitle());
3078 TCanvas *c = new TCanvas();
3079 c->SetRightMargin(0.15);
3081 gId->DrawCopy("colzsame");