]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWG2/drawProtonQAResults.C
Adding the possibility to run the analysis in eta-pT or y-pT (better for the corrections)
[u/mrichter/AliRoot.git] / PWG2 / drawProtonQAResults.C
CommitLineData
9e2392b0 1void drawProtonQAResults(const char *analysisType = "TPC") {
0008a5a6 2 //Macro to visualize the results of the proton QA task
3e23254a 3 //TCanvas objects: 16
cc0fbd97 4 gStyle->SetPalette(1,0);
720944fa 5 gStyle->SetCanvasColor(41);
6 gStyle->SetFrameFillColor(10);
7
9e2392b0 8 TString filename1 = "Protons.QA.";
9 filename1 += analysisType; filename1 += ".root";
10 TString filename2 = "Protons.MC.QA.";
11 filename2 += analysisType; filename2 += ".root";
12 TString filename3 = "Protons.Efficiency.";
13 filename3 += analysisType; filename3 += ".root",
1c21299a 14
9e2392b0 15 TFile *fQA = TFile::Open(filename1.Data());
1c21299a 16 TList *listGlobalQA = (TList *)fQA->Get("globalQAList");
9e2392b0 17 drawCutStatistics(listGlobalQA,analysisType);
1c21299a 18
9e2392b0 19 TFile *fMC = TFile::Open(filename2.Data());
1c21299a 20 TList *listPDG = (TList *)fMC->Get("pdgCodeList");
21 TList *listMCProcesses = (TList *)fMC->Get("mcProcessList");
22 drawMCQA(listPDG,listMCProcesses);
23
9e2392b0 24 TFile *fEfficiency = TFile::Open(filename3.Data());
863f782b 25 TList *listEfficiency = (TList *)fEfficiency->Get("efficiencyList");
9e2392b0 26 drawEfficiency(listEfficiency,analysisType);
863f782b 27
1c21299a 28 fQA->Close();
29 fMC->Close();
863f782b 30 fEfficiency->Close();
0008a5a6 31}
cc0fbd97 32
0008a5a6 33//________________________________________//
9e2392b0 34void drawCutStatistics(TList *list,
35 const char* analysisType) {
0008a5a6 36 //Function to display the statistics from the cuts
37 //The histogram shows the influence of each cut on the primary
38 //and secondary (anti)protons
39 const Int_t NQAHISTOSPERLIST = 26;
cc0fbd97 40
863f782b 41 Double_t gEntriesQA2DList[12] = {0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.};
cc0fbd97 42 Double_t gEntriesQAPrimaryProtonsAcceptedList[NQAHISTOSPERLIST], gEntriesQAPrimaryProtonsRejectedList[NQAHISTOSPERLIST];
43 Double_t gEntriesQASecondaryProtonsAcceptedList[NQAHISTOSPERLIST], gEntriesQASecondaryProtonsRejectedList[NQAHISTOSPERLIST];
44 Double_t gEntriesQAPrimaryAntiProtonsAcceptedList[NQAHISTOSPERLIST], gEntriesQAPrimaryAntiProtonsRejectedList[NQAHISTOSPERLIST];
45 Double_t gEntriesQASecondaryAntiProtonsAcceptedList[NQAHISTOSPERLIST], gEntriesQASecondaryAntiProtonsRejectedList[NQAHISTOSPERLIST];
46
47 for(Int_t i = 0; i < NQAHISTOSPERLIST; i++) {
48 gEntriesQAPrimaryProtonsAcceptedList[i] = 0.0;
49 gEntriesQAPrimaryProtonsRejectedList[i] = 0.0;
50 gEntriesQASecondaryProtonsAcceptedList[i] = 0.0;
51 gEntriesQASecondaryProtonsRejectedList[i] = 0.0;
52 gEntriesQAPrimaryAntiProtonsAcceptedList[i] = 0.0;
53 gEntriesQAPrimaryAntiProtonsRejectedList[i] = 0.0;
54 gEntriesQASecondaryAntiProtonsAcceptedList[i] = 0.0;
55 gEntriesQASecondaryAntiProtonsRejectedList[i] = 0.0;
56 }
57
cc0fbd97 58 TList *fQA2DList = (TList *)list->At(0);
59 GetQAEntries(fQA2DList,gEntriesQA2DList);
863f782b 60 TH3F *gHistYPtPDGProtonsPass = (TH3F *)fQA2DList->At(10);
61 TH3F *gHistYPtPDGAntiProtonsPass = (TH3F *)fQA2DList->At(11);
cc0fbd97 62
63 TList *fQAPrimaryProtonsAcceptedList = (TList *)list->At(1);
64 GetQAEntries(fQAPrimaryProtonsAcceptedList,gEntriesQAPrimaryProtonsAcceptedList);
65
66 TList *fQAPrimaryProtonsRejectedList = (TList *)list->At(2);
67 GetQAEntries(fQAPrimaryProtonsRejectedList,gEntriesQAPrimaryProtonsRejectedList);
68
69 TList *fQASecondaryProtonsAcceptedList = (TList *)list->At(3);
70 GetQAEntries(fQASecondaryProtonsAcceptedList,gEntriesQASecondaryProtonsAcceptedList);
71
72 TList *fQASecondaryProtonsRejectedList = (TList *)list->At(4);
73 GetQAEntries(fQASecondaryProtonsRejectedList,gEntriesQASecondaryProtonsRejectedList);
74
75 TList *fQAPrimaryAntiProtonsAcceptedList = (TList *)list->At(5);
76 GetQAEntries(fQAPrimaryAntiProtonsAcceptedList,gEntriesQAPrimaryAntiProtonsAcceptedList);
77
78 TList *fQAPrimaryAntiProtonsRejectedList = (TList *)list->At(6);
79 GetQAEntries(fQAPrimaryAntiProtonsRejectedList,gEntriesQAPrimaryAntiProtonsRejectedList);
80
81 TList *fQASecondaryAntiProtonsAcceptedList = (TList *)list->At(7);
82 GetQAEntries(fQASecondaryAntiProtonsAcceptedList,gEntriesQASecondaryAntiProtonsAcceptedList);
83
84 TList *fQASecondaryAntiProtonsRejectedList = (TList *)list->At(8);
85 GetQAEntries(fQASecondaryAntiProtonsRejectedList,gEntriesQASecondaryAntiProtonsRejectedList);
86
87 //_______________________________________________________//
88 //Create the histograms
0008a5a6 89 const Int_t nx = 26;
cc0fbd97 90 char *fCutName[nx] = {"Tracks","",
91 "ITS Clusters",
92 "#chi^{2}/N_{ITS-Clusters}",
93 "TPC Clusters",
94 "#chi^{2}/N_{TPC-Clusters}",
95 "ExtCov11",
96 "ExtCov22",
97 "ExtCov33",
98 "ExtCov44",
99 "ExtCov55",
100 "#sigma_{Vertex}",
101 "#sigma_{Vertex-TPC}",
0008a5a6 102 "DCA_{xy}",
103 "DCA_{xy}(TPC)",
104 "DCA_{z}",
105 "DCA_{z}(TPC)",
106 "#chi^{2}(vertex)",
cc0fbd97 107 "ITS refit",
108 "TPC refit",
109 "ESD pid",
110 "TPC pid","",
111 "N_{Secondaries}/N_{total}","",""};
0008a5a6 112 char *fCutITSName[6] = {"SPD_{1}","SPD_{2}",
113 "SDD_{1}","SDD_{2}",
114 "SSD_{1}","SSD_{2}"};
cc0fbd97 115
0008a5a6 116 //cut influence
cc0fbd97 117 TH2F *hEmpty = new TH2F("hEmpty","",nx,0,nx,100,0,100);
118 hEmpty->SetStats(kFALSE);
119 hEmpty->SetMarkerStyle(kFullCircle);
120 hEmpty->SetLineColor(2); hEmpty->SetMarkerColor(2);
121 hEmpty->GetYaxis()->SetTitle("Influence of the cuts [%]");
122 for(Int_t i = 1; i <= nx; i++)
123 hEmpty->GetXaxis()->SetBinLabel(i,fCutName[i-1]);
124 hEmpty->GetXaxis()->SetLabelOffset(0.01);
125 hEmpty->GetXaxis()->SetLabelSize(0.045);
126
127 //primary protons
128 TH1F *hPrimaryProtons = new TH1F("hPrimaryProtons","",nx,0,nx);
129 hPrimaryProtons->SetStats(kFALSE);
130 hPrimaryProtons->SetMarkerStyle(kFullCircle);
131 hPrimaryProtons->SetLineColor(4); hPrimaryProtons->SetLineWidth(2);
132 hPrimaryProtons->SetMarkerColor(4);
133 hPrimaryProtons->GetYaxis()->SetTitle("Influence of the cuts [%]");
134 for(Int_t i = 1; i <= nx; i++) {
135 hPrimaryProtons->SetBinContent(i,-10.);
136 hPrimaryProtons->GetXaxis()->SetBinLabel(i,fCutName[i-1]);
137 }
138 hPrimaryProtons->GetXaxis()->SetLabelOffset(0.01);
139 hPrimaryProtons->GetXaxis()->SetLabelSize(0.045);
140
141 //secondary protons
142 TH1F *hSecondaryProtons = new TH1F("hSecondaryProtons","",nx,0,nx);
143 hSecondaryProtons->SetStats(kFALSE);
144 hSecondaryProtons->SetMarkerStyle(22);
145 hSecondaryProtons->SetMarkerSize(1.4);
146 hSecondaryProtons->SetLineColor(2); hSecondaryProtons->SetLineWidth(2);
147 hSecondaryProtons->SetMarkerColor(2);
148 hSecondaryProtons->GetYaxis()->SetTitle("Influence of the cuts [%]");
149 for(Int_t i = 1; i <= nx; i++) {
150 hSecondaryProtons->SetBinContent(i,-10.);
151 hSecondaryProtons->GetXaxis()->SetBinLabel(i,fCutName[i-1]);
152 }
153 hSecondaryProtons->GetXaxis()->SetLabelOffset(0.01);
154 hSecondaryProtons->GetXaxis()->SetLabelSize(0.045);
155
156 //primary antiprotons
157 TH1F *hPrimaryAntiProtons = new TH1F("hPrimaryAntiProtons","",nx,0,nx);
158 hPrimaryAntiProtons->SetStats(kFALSE);
159 hPrimaryAntiProtons->SetMarkerStyle(kFullCircle);
160 hPrimaryAntiProtons->SetLineColor(4); hPrimaryAntiProtons->SetLineWidth(2);
161 hPrimaryAntiProtons->SetMarkerColor(4);
162 hPrimaryAntiProtons->GetYaxis()->SetTitle("Influence of the cuts [%]");
163 for(Int_t i = 1; i <= nx; i++) {
164 hPrimaryAntiProtons->SetBinContent(i,-10.);
165 hPrimaryAntiProtons->GetXaxis()->SetBinLabel(i,fCutName[i-1]);
166 }
167 hPrimaryAntiProtons->GetXaxis()->SetLabelOffset(0.01);
168 hPrimaryAntiProtons->GetXaxis()->SetLabelSize(0.045);
169
170 //secondary antiprotons
171 TH1F *hSecondaryAntiProtons = new TH1F("hSecondaryAntiProtons","",nx,0,nx);
172 hSecondaryAntiProtons->SetStats(kFALSE);
173 hSecondaryAntiProtons->SetMarkerStyle(22);
174 hSecondaryAntiProtons->SetMarkerSize(1.4);
175 hSecondaryAntiProtons->SetLineColor(2); hSecondaryAntiProtons->SetLineWidth(2);
176 hSecondaryAntiProtons->SetMarkerColor(2);
177 hSecondaryAntiProtons->GetYaxis()->SetTitle("Influence of the cuts [%]");
178 for(Int_t i = 1; i <= nx; i++) {
179 hSecondaryAntiProtons->SetBinContent(i,-10.);
180 hSecondaryAntiProtons->GetXaxis()->SetBinLabel(i,fCutName[i-1]);
181 }
182 hSecondaryAntiProtons->GetXaxis()->SetLabelOffset(0.01);
183 hSecondaryAntiProtons->GetXaxis()->SetLabelSize(0.045);
184 //_______________________________________________________//
185
186 //1D for primary protons
0008a5a6 187 //cout<<"_____________________________________________________"<<endl;
188 //cout<<"_______________PRIMARY PROTONS_______________________"<<endl;
cc0fbd97 189 hPrimaryProtons->SetBinContent(1,GetPercentage(gEntriesQA2DList[0],gEntriesQA2DList[1]));
190
0008a5a6 191 for(Int_t i = 2; i < NQAHISTOSPERLIST-4; i++)
cc0fbd97 192 hPrimaryProtons->SetBinContent(i+1,GetPercentage(gEntriesQAPrimaryProtonsAcceptedList[i-2],
0008a5a6 193 gEntriesQAPrimaryProtonsRejectedList[i-2]));
cc0fbd97 194
195 //1D for secondary protons
0008a5a6 196 //cout<<"_____________________________________________________"<<endl;
197 //cout<<"_______________SECONDARY PROTONS_____________________"<<endl;
cc0fbd97 198 hSecondaryProtons->SetBinContent(1,GetPercentage(gEntriesQA2DList[2],gEntriesQA2DList[3]));
0008a5a6 199
200 for(Int_t i = 2; i < NQAHISTOSPERLIST-4; i++)
cc0fbd97 201 hSecondaryProtons->SetBinContent(i+1,GetPercentage(gEntriesQASecondaryProtonsAcceptedList[i-2],
0008a5a6 202 gEntriesQASecondaryProtonsRejectedList[i-2]));
203 hSecondaryProtons->SetBinContent(24,GetPercentage(gEntriesQA2DList[0],gEntriesQA2DList[2]));
cc0fbd97 204
205 //1D for primary antiprotons
0008a5a6 206 //cout<<"_________________________________________________________"<<endl;
207 //cout<<"_______________PRIMARY ANTIPROTONS_______________________"<<endl;
cc0fbd97 208 hPrimaryAntiProtons->SetBinContent(1,GetPercentage(gEntriesQA2DList[4],gEntriesQA2DList[5]));
0008a5a6 209
210 for(Int_t i = 2; i < NQAHISTOSPERLIST-4; i++)
cc0fbd97 211 hPrimaryAntiProtons->SetBinContent(i+1,GetPercentage(gEntriesQAPrimaryAntiProtonsAcceptedList[i-2],
0008a5a6 212 gEntriesQAPrimaryAntiProtonsRejectedList[i-2]));
213
cc0fbd97 214 //1D for secondary antiprotons
0008a5a6 215 //cout<<"_________________________________________________________"<<endl;
216 //cout<<"_______________SECONDARY ANTIPROTONS_____________________"<<endl;
cc0fbd97 217 hSecondaryAntiProtons->SetBinContent(1,GetPercentage(gEntriesQA2DList[6],gEntriesQA2DList[7]));
cc0fbd97 218
0008a5a6 219 for(Int_t i = 2; i < NQAHISTOSPERLIST-4; i++)
cc0fbd97 220 hSecondaryAntiProtons->SetBinContent(i+1,GetPercentage(gEntriesQASecondaryAntiProtonsAcceptedList[i-2],
0008a5a6 221 gEntriesQASecondaryAntiProtonsRejectedList[i-2]));
222 hSecondaryAntiProtons->SetBinContent(24,GetPercentage(gEntriesQA2DList[4],gEntriesQA2DList[6]));
cc0fbd97 223
224 TLatex *t1 = new TLatex();
225 t1->SetTextSize(0.04);
226 //_________________________________________________________//
863f782b 227 TCanvas *c1 = new TCanvas("c1","Cut Influence - Protons",0,0,700,400);
cc0fbd97 228 c1->SetHighLightColor(10); c1->SetBottomMargin(0.15);
229 c1->SetGridx(); c1->SetGridy();
230
231 for(Int_t i = 1; i <= nx; i++) {
232 hPrimaryProtons->SetBinError(i,1.0);
233 hSecondaryProtons->SetBinError(i,1.0);
234 }
1c21299a 235 hEmpty->DrawCopy();
236 hPrimaryProtons->DrawCopy("EHISTSAME");
237 hSecondaryProtons->DrawCopy("EHISTSAME");
0008a5a6 238 DrawMarker(20.5, 90, 20, 1.2, 4);
239 t1->DrawLatex(21,88,"Primary p");
240 DrawMarker(20.5, 80, 22, 1.2, 2);
241 t1->DrawLatex(21,78,"Secondary p");
cc0fbd97 242
0008a5a6 243 c1->SaveAs("CutInfluence-Protons.gif");
cc0fbd97 244
245 //_________________________________________________________//
863f782b 246 TCanvas *c2 = new TCanvas("c2","Cut Influence - AntiProtons",50,50,700,400);
cc0fbd97 247 c2->SetHighLightColor(10); c2->SetBottomMargin(0.15);
248 c2->SetGridx(); c2->SetGridy();
249
250 for(Int_t i = 1; i <= nx; i++) {
251 hPrimaryAntiProtons->SetBinError(i,1.0);
252 hSecondaryAntiProtons->SetBinError(i,1.0);
253 }
1c21299a 254 hEmpty->DrawCopy();
255 hPrimaryAntiProtons->DrawCopy("EHISTSAME");
256 hSecondaryAntiProtons->DrawCopy("EHISTSAME");
0008a5a6 257 DrawMarker(20.5, 90, 20, 1.2, 4);
258 t1->DrawLatex(21,88,"Primary #bar{p}");
259 DrawMarker(20.5, 80, 22, 1.2, 2);
260 t1->DrawLatex(21,78,"Secondary #bar{p}");
261
262 c2->SaveAs("CutInfluence-AntiProtons.gif");
263
264 //_________________________________________________________//
265 //ITS layers influence
266 TH2F *hEmptyITS = new TH2F("hEmptyITS","",10,0,10,100,0,100);
267 hEmptyITS->SetStats(kFALSE);
268 hEmptyITS->SetMarkerStyle(kFullCircle);
269 hEmptyITS->SetLineColor(2); hEmptyITS->SetMarkerColor(2);
270 hEmptyITS->GetYaxis()->SetTitle("Influence of the ITS layers [%]");
271 hEmptyITS->GetYaxis()->SetTitleOffset(1.3);
272 for(Int_t i = 1; i <= 6; i++)
273 hEmptyITS->GetXaxis()->SetBinLabel(i,fCutITSName[i-1]);
274 hEmptyITS->GetXaxis()->SetLabelOffset(0.01);
275 hEmptyITS->GetXaxis()->SetLabelSize(0.045);
276
277 //_________________________________________________________//
278 //primary protons
279 TH1F *hPrimaryProtonsITS = new TH1F("hPrimaryProtonsITS","",7,0,7);
280 hPrimaryProtonsITS->SetStats(kFALSE);
281 hPrimaryProtonsITS->SetMarkerStyle(kFullCircle);
282 hPrimaryProtonsITS->SetLineColor(4); hPrimaryProtonsITS->SetLineWidth(2);
283 hPrimaryProtonsITS->SetMarkerColor(4);
284 hPrimaryProtonsITS->GetYaxis()->SetTitle("Influence of the cuts [%]");
285 for(Int_t i = 1; i <= 6; i++) {
286 hPrimaryProtonsITS->SetBinContent(i,-10.);
287 hPrimaryProtonsITS->GetXaxis()->SetBinLabel(i,fCutITSName[i-1]);
288 }
289 hPrimaryProtonsITS->GetXaxis()->SetLabelOffset(0.01);
290 hPrimaryProtonsITS->GetXaxis()->SetLabelSize(0.045);
291
292 //secondary protons
293 TH1F *hSecondaryProtonsITS = new TH1F("hSecondaryProtonsITS","",7,0,7);
294 hSecondaryProtonsITS->SetStats(kFALSE);
295 hSecondaryProtonsITS->SetMarkerStyle(22);
296 hSecondaryProtonsITS->SetMarkerSize(1.4);
297 hSecondaryProtonsITS->SetLineColor(2); hSecondaryProtonsITS->SetLineWidth(2);
298 hSecondaryProtonsITS->SetMarkerColor(2);
299 hSecondaryProtonsITS->GetYaxis()->SetTitle("Influence of the cuts [%]");
300 for(Int_t i = 1; i <= 6; i++) {
301 hSecondaryProtonsITS->SetBinContent(i,-10.);
302 hSecondaryProtonsITS->GetXaxis()->SetBinLabel(i,fCutITSName[i-1]);
303 }
304 hSecondaryProtonsITS->GetXaxis()->SetLabelOffset(0.01);
305 hSecondaryProtonsITS->GetXaxis()->SetLabelSize(0.045);
306
307 //primary antiprotons
308 TH1F *hPrimaryAntiProtonsITS = new TH1F("hPrimaryAntiProtonsITS","",7,0,7);
309 hPrimaryAntiProtonsITS->SetStats(kFALSE);
310 hPrimaryAntiProtonsITS->SetMarkerStyle(kFullCircle);
311 hPrimaryAntiProtonsITS->SetLineColor(4); hPrimaryAntiProtonsITS->SetLineWidth(2);
312 hPrimaryAntiProtonsITS->SetMarkerColor(4);
313 hPrimaryAntiProtonsITS->GetYaxis()->SetTitle("Influence of the cuts [%]");
314 for(Int_t i = 1; i <= 6; i++) {
315 hPrimaryAntiProtonsITS->SetBinContent(i,-10.);
316 hPrimaryAntiProtonsITS->GetXaxis()->SetBinLabel(i,fCutITSName[i-1]);
317 }
318 hPrimaryAntiProtonsITS->GetXaxis()->SetLabelOffset(0.01);
319 hPrimaryAntiProtonsITS->GetXaxis()->SetLabelSize(0.045);
cc0fbd97 320
0008a5a6 321 //secondary antiprotons
322 TH1F *hSecondaryAntiProtonsITS = new TH1F("hSecondaryAntiProtonsITS","",7,0,7);
323 hSecondaryAntiProtonsITS->SetStats(kFALSE);
324 hSecondaryAntiProtonsITS->SetMarkerStyle(22);
325 hSecondaryAntiProtonsITS->SetMarkerSize(1.4);
326 hSecondaryAntiProtonsITS->SetLineColor(2); hSecondaryAntiProtonsITS->SetLineWidth(2);
327 hSecondaryAntiProtonsITS->SetMarkerColor(2);
328 hSecondaryAntiProtonsITS->GetYaxis()->SetTitle("Influence of the cuts [%]");
329 for(Int_t i = 1; i <= 6; i++) {
330 hSecondaryAntiProtonsITS->SetBinContent(i,-10.);
331 hSecondaryAntiProtonsITS->GetXaxis()->SetBinLabel(i,fCutITSName[i-1]);
332 }
333 hSecondaryAntiProtonsITS->GetXaxis()->SetLabelOffset(0.01);
334 hSecondaryAntiProtonsITS->GetXaxis()->SetLabelSize(0.045);
335
336 //_______________________________________________________//
1c21299a 337 TCanvas *c9 = new TCanvas("c9","ITS cluster map - (anti)protons",
863f782b 338 100,100,700,400);
0008a5a6 339 c9->SetHighLightColor(10); c9->Divide(2,1);
340 for(Int_t i = 1; i <= 6; i++) {
341 hPrimaryProtonsITS->SetBinError(i,1.0);
342 hSecondaryProtonsITS->SetBinError(i,1.0);
343 hPrimaryAntiProtonsITS->SetBinError(i,1.0);
344 hSecondaryAntiProtonsITS->SetBinError(i,1.0);
345 }
346 c9->cd(1)->SetBottomMargin(0.15);
347 c9->cd(1)->SetLeftMargin(0.15);
348 c9->cd(1)->SetGridx(); c9->cd(1)->SetGridy();
349 hEmptyITS->SetTitle("Protons");
350 hEmptyITS->DrawCopy();
351
352 for(Int_t i = 1; i < 7; i++) {
353 hPrimaryProtonsITS->SetBinContent(i,GetPercentage(gEntriesQAPrimaryProtonsAcceptedList[19+i],
354 gEntriesQAPrimaryProtonsRejectedList[19+i]));
355 hSecondaryProtonsITS->SetBinContent(i,GetPercentage(gEntriesQASecondaryProtonsAcceptedList[19+i],
356 gEntriesQASecondaryProtonsRejectedList[19+i]));
357 }
1c21299a 358 hPrimaryProtonsITS->DrawCopy("EHISTSAME");
359 hSecondaryProtonsITS->DrawCopy("EHISTSAME");
0008a5a6 360 DrawMarker(6.5, 90, 20, 1.2, 4);
361 t1->DrawLatex(7,88,"Primary p");
362 DrawMarker(6.5, 80, 22, 1.2, 2);
363 t1->DrawLatex(7,78,"Secondary p");
364
365 c9->cd(2)->SetBottomMargin(0.15);
366 c9->cd(2)->SetLeftMargin(0.15);
367 c9->cd(2)->SetGridx(); c9->cd(2)->SetGridy();
368 hEmptyITS->SetTitle("Antiprotons");
369 hEmptyITS->DrawCopy();
370 for(Int_t i = 1; i < 7; i++) {
371 hPrimaryAntiProtonsITS->SetBinContent(i,GetPercentage(gEntriesQAPrimaryAntiProtonsAcceptedList[19+i],
372 gEntriesQAPrimaryAntiProtonsRejectedList[19+i]));
373 hSecondaryAntiProtonsITS->SetBinContent(i,GetPercentage(gEntriesQASecondaryAntiProtonsAcceptedList[19+i],
374 gEntriesQASecondaryAntiProtonsRejectedList[19+i]));
375 }
1c21299a 376 hPrimaryAntiProtonsITS->DrawCopy("EHISTSAME");
377 hSecondaryAntiProtonsITS->DrawCopy("EHISTSAME");
0008a5a6 378 DrawMarker(6.5, 90, 20, 1.2, 4);
379 t1->DrawLatex(7,88,"Primary #bar{p}");
380 DrawMarker(6.5, 80, 22, 1.2, 2);
381 t1->DrawLatex(7,78,"Secondary #bar{p}");
382
383 c9->SaveAs("CutInfluence-ITS.gif");
1c21299a 384
863f782b 385 //Efficiency - Contamination plots
9e2392b0 386 DrawContamination(fQA2DList,analysisType);
387 DrawCutEfficiency(fQA2DList,analysisType);
863f782b 388 DrawComposition(gHistYPtPDGProtonsPass,gHistYPtPDGAntiProtonsPass);
389}
390
391//________________________________________//
392void DrawComposition(TH3F *gHistYPtPDGProtons,
393 TH3F *gHistYPtPDGAntiProtons) {
394 //Function to display the composition of secondary (anti)protons
395 //that survive the quality criteria
396 Double_t nParticleCompositionProtonY[100], nParticleCompositionProtonPt[100];
720944fa 397 Double_t nParticleCompositionProtonYError[100], nParticleCompositionProtonPtError[100];
863f782b 398 Double_t nParticleCompositionAntiProtonY[100], nParticleCompositionAntiProtonPt[100];
720944fa 399 Double_t nParticleCompositionAntiProtonYError[100], nParticleCompositionAntiProtonPtError[100];
863f782b 400 Double_t gY[100], gPt[100];
720944fa 401 Double_t gYError[100], gPtError[100];
863f782b 402 for(Int_t iBins = 0; iBins < 100; iBins++) {
403 nParticleCompositionProtonY[iBins] = 0;
404 nParticleCompositionProtonPt[iBins] = 0;
720944fa 405 nParticleCompositionProtonYError[iBins] = 0;
406 nParticleCompositionProtonPtError[iBins] = 0;
863f782b 407 nParticleCompositionAntiProtonY[iBins] = 0;
408 nParticleCompositionAntiProtonPt[iBins] = 0;
720944fa 409 nParticleCompositionAntiProtonYError[iBins] = 0;
410 nParticleCompositionAntiProtonPtError[iBins] = 0;
863f782b 411 gY[iBins] = 0;
412 gPt[iBins] = 0;
720944fa 413 gYError[iBins] = 0;
414 gPtError[iBins] = 0;
863f782b 415 }
416
720944fa 417 TGraphErrors *gParticleProtonY[14];
418 TGraphErrors *gParticleProtonPt[14];
419 TGraphErrors *gParticleAntiProtonY[14];
420 TGraphErrors *gParticleAntiProtonPt[14];
863f782b 421 for(Int_t iParticle = 0; iParticle < 14; iParticle++) {
422 GetComposition(iParticle,
423 gHistYPtPDGProtons,
720944fa 424 nParticleCompositionProtonY,nParticleCompositionProtonYError,gY, gYError,
425 nParticleCompositionProtonPt, nParticleCompositionProtonPtError, gPt, gPtError);
426 gParticleProtonY[iParticle] = new TGraphErrors(gHistYPtPDGProtons->GetNbinsX(),
427 gY,nParticleCompositionProtonY,gYError,nParticleCompositionProtonYError);
863f782b 428 gParticleProtonY[iParticle]->SetMarkerStyle(iParticle+20);
429 gParticleProtonY[iParticle]->SetMarkerSize(1.2);
430
720944fa 431 gParticleProtonPt[iParticle] = new TGraphErrors(gHistYPtPDGProtons->GetNbinsY(),
432 gPt,nParticleCompositionProtonPt,gPtError,nParticleCompositionProtonPtError);
863f782b 433 gParticleProtonPt[iParticle]->SetMarkerStyle(iParticle+20);
434 gParticleProtonPt[iParticle]->SetMarkerSize(1.2);
435
436 GetComposition(iParticle,
437 gHistYPtPDGAntiProtons,
720944fa 438 nParticleCompositionAntiProtonY,nParticleCompositionAntiProtonYError,gY, gYError,
439 nParticleCompositionAntiProtonPt, nParticleCompositionAntiProtonPtError, gPt, gPtError);
440 gParticleAntiProtonY[iParticle] = new TGraphErrors(gHistYPtPDGAntiProtons->GetNbinsX(),
441 gY,nParticleCompositionAntiProtonY,gYError,nParticleCompositionAntiProtonYError);
863f782b 442 gParticleAntiProtonY[iParticle]->SetMarkerStyle(iParticle+20);
443 gParticleAntiProtonY[iParticle]->SetMarkerSize(1.2);
444
720944fa 445 gParticleAntiProtonPt[iParticle] = new TGraphErrors(gHistYPtPDGAntiProtons->GetNbinsY(),
446 gPt,nParticleCompositionAntiProtonPt,gPtError,nParticleCompositionAntiProtonPtError);
863f782b 447 gParticleAntiProtonPt[iParticle]->SetMarkerStyle(iParticle+20);
448 gParticleAntiProtonPt[iParticle]->SetMarkerSize(1.2);
449 }
450
451 //_________________________________________________________//
452 char *fParticleName[14] = {"Primary","K_{L}","#pi","K_{S}","K",
453 "n","p","#Sigma^{-}","#Lambda","#Sigma^{+}",
454 "#Xi^{-}","#Xi^{0}","#Omega^{-}"};
455 TLatex *t1 = new TLatex();
456 t1->SetTextSize(0.04);
457
458 TH2F *hEmptyY = new TH2F("hEmptyY","",100,-1.2,1.2,100,0,120);
459 hEmptyY->SetStats(kFALSE);
460 hEmptyY->GetYaxis()->SetTitle("Particle composition [%]");
dd3fa486 461 hEmptyY->GetXaxis()->SetTitle(gHistYPtPDGProtons->GetXaxis()->GetTitle());
863f782b 462
463 TCanvas *c12 = new TCanvas("c12",
464 "Composition of accepted secondaries vs y",
3e23254a 465 350,350,700,400);
720944fa 466 c12->Divide(2,1);
863f782b 467 c12->SetHighLightColor(10); c12->cd(1)->SetBottomMargin(0.15);
468 c12->cd(1)->SetGridx(); c12->cd(1)->SetGridy();
5ae0977e 469 hEmptyY->SetTitle("Protons");
863f782b 470 hEmptyY->DrawCopy();
471 for(Int_t iParticle = 0; iParticle < 10; iParticle++) {
472 //if((iParticle == 0)||(iParticle == 2)||(iParticle == 5)||(iParticle == 6)||(iParticle == 8))
720944fa 473 if((iParticle == 2)||(iParticle == 6)||(iParticle == 8)) {
863f782b 474 gParticleProtonY[iParticle]->Draw("P");
720944fa 475 //if(iParticle < 5) {
476 //DrawMarker(-1.1, 115-5*iParticle, 20+iParticle, 1.2, 1);
477 //t1->DrawLatex(-1.0,113-5*iParticle,fParticleName[iParticle]);
863f782b 478 }
720944fa 479 /*else {
863f782b 480 DrawMarker(0.2, 115-5*(iParticle-5), 20+iParticle, 1.2, 1);
481 t1->DrawLatex(0.3,113-5*(iParticle-5),fParticleName[iParticle]);
720944fa 482 }*/
863f782b 483 }
720944fa 484 DrawMarker(0.0, 115, 22, 1.2, 1);
485 t1->DrawLatex(0.1,113,fParticleName[2]);
486 DrawMarker(0.0, 105, 26, 1.2, 1);
487 t1->DrawLatex(0.1,103,fParticleName[6]);
488 DrawMarker(0.0, 95, 28, 1.2, 1);
489 t1->DrawLatex(0.1,93,fParticleName[8]);
863f782b 490
491 c12->SetHighLightColor(10); c12->cd(2)->SetBottomMargin(0.15);
492 c12->cd(2)->SetGridx(); c12->cd(2)->SetGridy();
5ae0977e 493 hEmptyY->SetTitle("Antiprotons");
863f782b 494 hEmptyY->DrawCopy();
495 for(Int_t iParticle = 0; iParticle < 10; iParticle++) {
720944fa 496 if((iParticle == 6)||(iParticle == 8))
863f782b 497 gParticleAntiProtonY[iParticle]->Draw("P");
720944fa 498 /*if(iParticle < 5) {
863f782b 499 DrawMarker(-1.1, 115-5*iParticle, 20+iParticle, 1.2, 1);
500 t1->DrawLatex(-1.0,113-5*iParticle,fParticleName[iParticle]);
501 }
502 else {
503 DrawMarker(0.2, 115-5*(iParticle-5), 20+iParticle, 1.2, 1);
504 t1->DrawLatex(0.3,113-5*(iParticle-5),fParticleName[iParticle]);
720944fa 505 }*/
863f782b 506 }
720944fa 507 DrawMarker(0.0, 115, 26, 1.2, 1);
508 t1->DrawLatex(0.1,113,fParticleName[6]);
509 DrawMarker(0.0, 105, 28, 1.2, 1);
510 t1->DrawLatex(0.1,103,fParticleName[8]);
2b00fd2c 511 c12->SaveAs("SurvivedSecondaries-Composition-Rapidity.gif");
863f782b 512
513 TH2F *hEmptyPt = new TH2F("hEmptyPt","",100,0.0,4.0,100,0,120);
514 hEmptyPt->SetStats(kFALSE);
515 hEmptyPt->GetYaxis()->SetTitle("Particle composition [%]");
516 hEmptyPt->GetXaxis()->SetTitle("P_{T} [GeV/c]");
517
518 TCanvas *c13 = new TCanvas("c13",
5ae0977e 519 "Composition of accepted secondaries vs pT",
3e23254a 520 400,400,700,400);
720944fa 521 c13->Divide(2,1);
863f782b 522 c13->SetHighLightColor(10); c13->cd(1)->SetBottomMargin(0.15);
523 c13->cd(1)->SetGridx(); c13->cd(1)->SetGridy();
5ae0977e 524 hEmptyPt->GetXaxis()->SetRangeUser(gParticleProtonPt[0]->GetXaxis()->GetXmin()-0.2,gParticleProtonPt[0]->GetXaxis()->GetXmax()+0.2);
525 hEmptyPt->SetTitle("Protons");
863f782b 526 hEmptyPt->DrawCopy();
527 for(Int_t iParticle = 0; iParticle < 10; iParticle++) {
720944fa 528 /*if(iParticle < 5) {
5ae0977e 529 DrawMarker(gParticleProtonPt[0]->GetXaxis()->GetXmin()+0.1,
530 115-5*iParticle, 20+iParticle, 1.2, 1);
531 t1->DrawLatex(gParticleProtonPt[0]->GetXaxis()->GetXmin()+0.2,
532 113-5*iParticle,fParticleName[iParticle]);
863f782b 533 }
534 else {
5ae0977e 535 DrawMarker(gParticleProtonPt[0]->GetXaxis()->GetXmax()*0.5,
536 115-5*(iParticle-5), 20+iParticle, 1.2, 1);
537 t1->DrawLatex(gParticleProtonPt[0]->GetXaxis()->GetXmax()*0.5+0.1,
538 113-5*(iParticle-5),fParticleName[iParticle]);
720944fa 539 }*/
540 if((iParticle == 2)||(iParticle == 6)||(iParticle == 8))
863f782b 541 gParticleProtonPt[iParticle]->Draw("P");
542 }
720944fa 543 DrawMarker(0.5, 115, 22, 1.2, 1);
544 t1->DrawLatex(0.6,113,fParticleName[2]);
545 DrawMarker(0.5, 105, 26, 1.2, 1);
546 t1->DrawLatex(0.6,103,fParticleName[6]);
547 DrawMarker(0.5, 95, 28, 1.2, 1);
548 t1->DrawLatex(0.6,93,fParticleName[8]);
863f782b 549
550 c13->SetHighLightColor(10); c13->cd(2)->SetBottomMargin(0.15);
551 c13->cd(2)->SetGridx(); c13->cd(2)->SetGridy();
5ae0977e 552 hEmptyPt->SetTitle("Antiprotons");
863f782b 553 hEmptyPt->DrawCopy();
554 for(Int_t iParticle = 0; iParticle < 10; iParticle++) {
720944fa 555 /*if(iParticle < 5) {
5ae0977e 556 DrawMarker(gParticleProtonPt[0]->GetXaxis()->GetXmin()+0.1,
557 115-5*iParticle, 20+iParticle, 1.2, 1);
558 t1->DrawLatex(gParticleProtonPt[0]->GetXaxis()->GetXmin()+0.2,
559 113-5*iParticle,fParticleName[iParticle]);
863f782b 560 }
561 else {
5ae0977e 562 DrawMarker(gParticleProtonPt[0]->GetXaxis()->GetXmax()*0.5,
563 115-5*(iParticle-5), 20+iParticle, 1.2, 1);
564 t1->DrawLatex(gParticleProtonPt[0]->GetXaxis()->GetXmax()*0.5+0.1,
565 113-5*(iParticle-5),fParticleName[iParticle]);
720944fa 566 }*/
567 if((iParticle == 6)||(iParticle == 8))
863f782b 568 gParticleAntiProtonPt[iParticle]->Draw("P");
569 }
720944fa 570 DrawMarker(0.5, 115, 26, 1.2, 1);
571 t1->DrawLatex(0.6,113,fParticleName[6]);
572 DrawMarker(0.5, 105, 28, 1.2, 1);
573 t1->DrawLatex(0.6,103,fParticleName[8]);
2b00fd2c 574 c13->SaveAs("SurvivedSecondaries-Composition-Pt.gif");
0008a5a6 575}
576
577//________________________________________________//
9e2392b0 578void DrawContamination(TList *inputList,
579 const char* analysisType) {
0008a5a6 580 //loops over the list entries and
581 //draws the rapidity and pT dependence
582 //of the percentage of primary and secondary
583 //protons and antiprotons after the track cuts
584 cout<<"Extracting the entries for the histograms in the list: "<<
585 inputList->GetName()<<"..."<<endl;
586
587 TLatex *t1 = new TLatex();
588 t1->SetTextSize(0.04);
589
590 TH2F *hPrimaryProtons = (TH2F *)inputList->At(0);
591 TH2F *hSecondaryProtons = (TH2F *)inputList->At(2);
592 TH2F *hPrimaryAntiProtons = (TH2F *)inputList->At(4);
593 TH2F *hSecondaryAntiProtons = (TH2F *)inputList->At(6);
594
595 //rapidity dependence
596 //Protons
597 TH1D *gYPrimaryProtons = (TH1D *)hPrimaryProtons->ProjectionX("gYPrimaryProtons",0,hPrimaryProtons->GetXaxis()->GetNbins(),"e");
598 TH1D *gYSecondaryProtons = (TH1D *)hSecondaryProtons->ProjectionX("gYSecondaryProtons",0,hSecondaryProtons->GetXaxis()->GetNbins(),"e");
599 TH1D *gYTotalProtons = (TH1D *)hPrimaryProtons->ProjectionX("gYTotalProtons",0,hPrimaryProtons->GetXaxis()->GetNbins(),"e");
600 gYTotalProtons->Add(gYSecondaryProtons);
601
602 TH1D *gYPrimaryProtonsPercentage = new TH1D("gYPrimaryProtonsPercentage",
603 "",
604 hPrimaryProtons->GetXaxis()->GetNbins(),
605 hPrimaryProtons->GetXaxis()->GetXmin(),
606 hPrimaryProtons->GetXaxis()->GetXmax());
607 gYPrimaryProtonsPercentage->Divide(gYPrimaryProtons,
863f782b 608 gYTotalProtons,1.,1.0);
1c21299a 609 SetError(gYPrimaryProtonsPercentage,gYTotalProtons);
863f782b 610 gYPrimaryProtonsPercentage->Scale(100.);
0008a5a6 611 gYPrimaryProtonsPercentage->SetMarkerStyle(kFullCircle);
612
613 TH1D *gYSecondaryProtonsPercentage = new TH1D("gYSecondaryProtonsPercentage",
614 "",
615 hSecondaryProtons->GetXaxis()->GetNbins(),
616 hSecondaryProtons->GetXaxis()->GetXmin(),
617 hSecondaryProtons->GetXaxis()->GetXmax());
618 gYSecondaryProtonsPercentage->Divide(gYSecondaryProtons,
863f782b 619 gYTotalProtons,1.,1.0);
1c21299a 620 SetError(gYSecondaryProtonsPercentage,gYTotalProtons);
863f782b 621 gYSecondaryProtonsPercentage->Scale(100.);
0008a5a6 622 gYSecondaryProtonsPercentage->SetMarkerStyle(kOpenCircle);
623
0008a5a6 624 //Antiprotons
625 TH1D *gYPrimaryAntiProtons = (TH1D *)hPrimaryAntiProtons->ProjectionX("gYPrimaryAntiProtons",0,hPrimaryAntiProtons->GetXaxis()->GetNbins(),"e");
626 TH1D *gYSecondaryAntiProtons = (TH1D *)hSecondaryAntiProtons->ProjectionX("gYSecondaryAntiProtons",0,hSecondaryAntiProtons->GetXaxis()->GetNbins(),"e");
627 TH1D *gYTotalAntiProtons = (TH1D *)hPrimaryAntiProtons->ProjectionX("gYTotalAntiProtons",0,hPrimaryAntiProtons->GetXaxis()->GetNbins(),"e");
628 gYTotalAntiProtons->Add(gYSecondaryAntiProtons);
629
630 TH1D *gYPrimaryAntiProtonsPercentage = new TH1D("gYPrimaryAntiProtonsPercentage",
631 "",
632 hPrimaryAntiProtons->GetXaxis()->GetNbins(),
633 hPrimaryAntiProtons->GetXaxis()->GetXmin(),
634 hPrimaryAntiProtons->GetXaxis()->GetXmax());
635 gYPrimaryAntiProtonsPercentage->Divide(gYPrimaryAntiProtons,
863f782b 636 gYTotalAntiProtons,1.,1.0);
1c21299a 637 SetError(gYPrimaryAntiProtonsPercentage,gYTotalAntiProtons);
863f782b 638 gYPrimaryAntiProtonsPercentage->Scale(100.);
0008a5a6 639 gYPrimaryAntiProtonsPercentage->SetMarkerStyle(kFullCircle);
640
641 TH1D *gYSecondaryAntiProtonsPercentage = new TH1D("gYSecondaryAntiProtonsPercentage",
642 "",
643 hSecondaryAntiProtons->GetXaxis()->GetNbins(),
644 hSecondaryAntiProtons->GetXaxis()->GetXmin(),
645 hSecondaryAntiProtons->GetXaxis()->GetXmax());
646 gYSecondaryAntiProtonsPercentage->Divide(gYSecondaryAntiProtons,
863f782b 647 gYTotalAntiProtons,1.,1.0);
1c21299a 648 SetError(gYSecondaryAntiProtonsPercentage,gYTotalAntiProtons);
863f782b 649 gYSecondaryAntiProtonsPercentage->Scale(100.);
0008a5a6 650 gYSecondaryAntiProtonsPercentage->SetMarkerStyle(kOpenCircle);
651
652
653 TH2F *hEmptyY = new TH2F("hEmptyCompositionY","",
654 100,-1.2,1.2,100,-10.0,130);
655 hEmptyY->SetStats(kFALSE);
656 hEmptyY->GetYaxis()->SetTitle("Particle composition [%]");
657 hEmptyY->GetYaxis()->SetTitleOffset(1.3);
dd3fa486 658 hEmptyY->GetXaxis()->SetTitle(hPrimaryProtons->GetXaxis()->GetTitle());
0008a5a6 659
1c21299a 660 TCanvas *c7 = new TCanvas("c7","(Anti)Proton contamination vs y",
863f782b 661 150,150,700,400);
0008a5a6 662 c7->SetHighLightColor(10); c7->Divide(2,1);
663
664 c7->cd(1)->SetBottomMargin(0.15);
665 c7->cd(1)->SetLeftMargin(0.15);
666 c7->cd(1)->SetGridx(); c7->cd(1)->SetGridy();
667 hEmptyY->SetTitle("Protons");
668 hEmptyY->DrawCopy();
1c21299a 669 gYPrimaryProtonsPercentage->DrawCopy("ESAME");
670 gYSecondaryProtonsPercentage->DrawCopy("ESAME");
0008a5a6 671
672 DrawMarker(0, 55, kFullCircle, 1.2, 1);
673 t1->DrawLatex(0.1,53,"Primaries");
674 DrawMarker(0, 45, kOpenCircle, 1.2, 1);
675 t1->DrawLatex(0.1,43,"Secondaries");
676
677 c7->cd(2)->SetBottomMargin(0.15);
678 c7->cd(2)->SetLeftMargin(0.15);
679 c7->cd(2)->SetGridx(); c7->cd(2)->SetGridy();
680 hEmptyY->SetTitle("Antiprotons");
681 hEmptyY->DrawCopy();
1c21299a 682 gYPrimaryAntiProtonsPercentage->DrawCopy("ESAME");
683 gYSecondaryAntiProtonsPercentage->DrawCopy("ESAME");
0008a5a6 684
685 DrawMarker(0, 55, kFullCircle, 1.2, 1);
686 t1->DrawLatex(0.1,53,"Primaries");
687 DrawMarker(0, 45, kOpenCircle, 1.2, 1);
5ae0977e 688 t1->DrawLatex(0.1,41,"Secondaries");
0008a5a6 689
690 c7->SaveAs("Contamination-Protons-Rapidity.gif");
691
692 //pT dependence
693 //Protons
694 TH1D *gPtPrimaryProtons = (TH1D *)hPrimaryProtons->ProjectionY("gPtPrimaryProtons",0,hPrimaryProtons->GetYaxis()->GetNbins(),"e");
695 TH1D *gPtSecondaryProtons = (TH1D *)hSecondaryProtons->ProjectionY("gPtSecondaryProtons",0,hSecondaryProtons->GetYaxis()->GetNbins(),"e");
696 TH1D *gPtTotalProtons = (TH1D *)hPrimaryProtons->ProjectionY("gPtTotalProtons",0,hPrimaryProtons->GetYaxis()->GetNbins(),"e");
697 gPtTotalProtons->Add(gPtSecondaryProtons);
698
699 TH1D *gPtPrimaryProtonsPercentage = new TH1D("gPtPrimaryProtonsPercentage",
700 "",
701 hPrimaryProtons->GetYaxis()->GetNbins(),
702 hPrimaryProtons->GetYaxis()->GetXmin(),
703 hPrimaryProtons->GetYaxis()->GetXmax());
704 gPtPrimaryProtonsPercentage->Divide(gPtPrimaryProtons,
863f782b 705 gPtTotalProtons,1.,1.0);
1c21299a 706 SetError(gPtPrimaryProtonsPercentage,gPtTotalProtons);
863f782b 707 gPtPrimaryProtonsPercentage->Scale(100.);
0008a5a6 708 gPtPrimaryProtonsPercentage->SetMarkerStyle(kFullCircle);
709
710 TH1D *gPtSecondaryProtonsPercentage = new TH1D("gPtSecondaryProtonsPercentage",
711 "",
712 hSecondaryProtons->GetYaxis()->GetNbins(),
713 hSecondaryProtons->GetYaxis()->GetXmin(),
714 hSecondaryProtons->GetYaxis()->GetXmax());
715 gPtSecondaryProtonsPercentage->Divide(gPtSecondaryProtons,
863f782b 716 gPtTotalProtons,1.,1.0);
1c21299a 717 SetError(gPtSecondaryProtonsPercentage,gPtTotalProtons);
863f782b 718 gPtSecondaryProtonsPercentage->Scale(100.);
0008a5a6 719 gPtSecondaryProtonsPercentage->SetMarkerStyle(kOpenCircle);
720
721
722 //Antiprotons
723 TH1D *gPtPrimaryAntiProtons = (TH1D *)hPrimaryAntiProtons->ProjectionY("gPtPrimaryAntiProtons",0,hPrimaryAntiProtons->GetYaxis()->GetNbins(),"e");
724 TH1D *gPtSecondaryAntiProtons = (TH1D *)hSecondaryAntiProtons->ProjectionY("gPtSecondaryAntiProtons",0,hSecondaryAntiProtons->GetYaxis()->GetNbins(),"e");
725 TH1D *gPtTotalAntiProtons = (TH1D *)hPrimaryAntiProtons->ProjectionY("gPtTotalAntiProtons",0,hPrimaryAntiProtons->GetYaxis()->GetNbins(),"e");
726 gPtTotalAntiProtons->Add(gPtSecondaryAntiProtons);
727
728 TH1D *gPtPrimaryAntiProtonsPercentage = new TH1D("gPtPrimaryAntiProtonsPercentage",
729 "",
730 hPrimaryAntiProtons->GetYaxis()->GetNbins(),
731 hPrimaryAntiProtons->GetYaxis()->GetXmin(),
732 hPrimaryAntiProtons->GetYaxis()->GetXmax());
733 gPtPrimaryAntiProtonsPercentage->Divide(gPtPrimaryAntiProtons,
863f782b 734 gPtTotalAntiProtons,1.,1.0);
1c21299a 735 SetError(gPtPrimaryAntiProtonsPercentage,gPtTotalAntiProtons);
863f782b 736 gPtPrimaryAntiProtonsPercentage->Scale(100.);
0008a5a6 737 gPtPrimaryAntiProtonsPercentage->SetMarkerStyle(kFullCircle);
738
739 TH1D *gPtSecondaryAntiProtonsPercentage = new TH1D("gPtSecondaryAntiProtonsPercentage",
740 "",
741 hSecondaryAntiProtons->GetYaxis()->GetNbins(),
742 hSecondaryAntiProtons->GetYaxis()->GetXmin(),
743 hSecondaryAntiProtons->GetYaxis()->GetXmax());
744 gPtSecondaryAntiProtonsPercentage->Divide(gPtSecondaryAntiProtons,
863f782b 745 gPtTotalAntiProtons,1.,1.0);
1c21299a 746 SetError(gPtSecondaryAntiProtonsPercentage,gPtTotalAntiProtons);
863f782b 747 gPtSecondaryAntiProtonsPercentage->Scale(100.);
0008a5a6 748 gPtSecondaryAntiProtonsPercentage->SetMarkerStyle(kOpenCircle);
749
750 TH2F *hEmptyPt = new TH2F("hEmptyCompositionPt","",
751 100,0.0,4.0,100,-10.0,130);
752 hEmptyPt->SetStats(kFALSE);
753 hEmptyPt->GetYaxis()->SetTitle("Particle composition [%]");
754 hEmptyPt->GetYaxis()->SetTitleOffset(1.3);
755 hEmptyPt->GetXaxis()->SetTitle("P_{T} [GeV/c]");
756
1c21299a 757 TCanvas *c8 = new TCanvas("c8","(Anti)Proton comtamination vs pT",
863f782b 758 200,200,700,400);
0008a5a6 759 c8->SetHighLightColor(10); c8->Divide(2,1);
760
761 c8->cd(1)->SetBottomMargin(0.15);
762 c8->cd(1)->SetLeftMargin(0.15);
763 c8->cd(1)->SetGridx(); c8->cd(1)->SetGridy();
764 hEmptyPt->SetTitle("Protons");
5ae0977e 765 hEmptyPt->GetXaxis()->SetRangeUser(gPtPrimaryProtonsPercentage->GetXaxis()->GetXmin()-0.2,gPtPrimaryProtonsPercentage->GetXaxis()->GetXmax()+0.2);
0008a5a6 766 hEmptyPt->DrawCopy();
1c21299a 767 gPtPrimaryProtonsPercentage->DrawCopy("ESAME");
768 gPtSecondaryProtonsPercentage->DrawCopy("ESAME");
0008a5a6 769
5ae0977e 770 DrawMarker(0.5, 55, kFullCircle, 1.2, 1);
771 t1->DrawLatex(0.6,53,"Primaries");
772 DrawMarker(0.5, 45, kOpenCircle, 1.2, 1);
773 t1->DrawLatex(0.6,41,"Secondaries");
0008a5a6 774
775 c8->cd(2)->SetBottomMargin(0.15);
776 c8->cd(2)->SetLeftMargin(0.15);
777 c8->cd(2)->SetGridx(); c8->cd(2)->SetGridy();
778 hEmptyPt->SetTitle("Antirotons");
779 hEmptyPt->DrawCopy();
1c21299a 780 gPtPrimaryAntiProtonsPercentage->DrawCopy("ESAME");
781 gPtSecondaryAntiProtonsPercentage->DrawCopy("ESAME");
0008a5a6 782
783 DrawMarker(2.0, 55, kFullCircle, 1.2, 1);
784 t1->DrawLatex(2.1,53,"Primaries");
785 DrawMarker(2.0, 45, kOpenCircle, 1.2, 1);
786 t1->DrawLatex(2.1,43,"Secondaries");
787
788 c8->SaveAs("Contamination-Protons-Pt.gif");
5b8133c7 789
9e2392b0 790 TString outputFileName = "Contamination.";
791 outputFileName += analysisType; outputFileName += ".root";
792 TFile *fout = TFile::Open(outputFileName.Data(),"recreate");
5b8133c7 793 gYPrimaryProtonsPercentage->Write();
794 gYSecondaryProtonsPercentage->Write();
795 gPtPrimaryProtonsPercentage->Write();
796 gPtSecondaryProtonsPercentage->Write();
797 gYPrimaryAntiProtonsPercentage->Write();
798 gYSecondaryAntiProtonsPercentage->Write();
799 gPtPrimaryAntiProtonsPercentage->Write();
800 gPtSecondaryAntiProtonsPercentage->Write();
801 fout->Close();
cc0fbd97 802}
803
1c21299a 804//________________________________________________//
9e2392b0 805void DrawCutEfficiency(TList *inputList,
806 const char* analysisType) {
1c21299a 807 //loops over the list entries and
808 //draws the rapidity and pT dependence
809 //of the percentage of primary and secondary
810 //protons and antiprotons after the track cuts
811 cout<<"Extracting the entries for the histograms in the list: "<<
812 inputList->GetName()<<"..."<<endl;
813
814 TLatex *t1 = new TLatex();
815 t1->SetTextSize(0.04);
816
817 TH2F *hPrimaryESDProtons = (TH2F *)inputList->At(0);
818 TH2F *hPrimaryESDAntiProtons = (TH2F *)inputList->At(4);
819 TH2F *hPrimaryMCProtons = (TH2F *)inputList->At(8);
820 TH2F *hPrimaryMCAntiProtons = (TH2F *)inputList->At(9);
821
822 //rapidity dependence
823 //Protons
824 TH1D *gYPrimaryESDProtons = (TH1D *)hPrimaryESDProtons->ProjectionX("gYPrimaryESDProtons",0,hPrimaryESDProtons->GetXaxis()->GetNbins(),"e");
825 TH1D *gYPrimaryMCProtons = (TH1D *)hPrimaryMCProtons->ProjectionX("gYPrimaryMCProtons",0,hPrimaryMCProtons->GetXaxis()->GetNbins(),"e");
826 gYPrimaryESDProtons->Divide(gYPrimaryMCProtons);
1c21299a 827 SetError(gYPrimaryESDProtons,gYPrimaryMCProtons);
863f782b 828 gYPrimaryESDProtons->Scale(100.);
1c21299a 829 gYPrimaryESDProtons->SetMarkerStyle(kFullCircle);
830
831 //Antiprotons
832 TH1D *gYPrimaryESDAntiProtons = (TH1D *)hPrimaryESDAntiProtons->ProjectionX("gYPrimaryESDAntiProtons",0,hPrimaryESDAntiProtons->GetXaxis()->GetNbins(),"e");
833 TH1D *gYPrimaryMCAntiProtons = (TH1D *)hPrimaryMCAntiProtons->ProjectionX("gYPrimaryMCAntiProtons",0,hPrimaryMCAntiProtons->GetXaxis()->GetNbins(),"e");
834 gYPrimaryESDAntiProtons->Divide(gYPrimaryMCAntiProtons);
1c21299a 835 SetError(gYPrimaryESDAntiProtons,gYPrimaryMCAntiProtons);
863f782b 836 gYPrimaryESDAntiProtons->Scale(100.);
1c21299a 837 gYPrimaryESDAntiProtons->SetMarkerStyle(kFullCircle);
838
839 TH2F *hEmptyY = new TH2F("hEmptyEfficiencyY","",
840 100,-1.2,1.2,100,-10.0,130);
841 hEmptyY->SetStats(kFALSE);
842 hEmptyY->GetYaxis()->SetTitle("#epsilon [%]");
843 hEmptyY->GetYaxis()->SetTitleOffset(1.3);
dd3fa486 844 hEmptyY->GetXaxis()->SetTitle(hPrimaryESDProtons->GetXaxis()->GetTitle());
1c21299a 845
2b00fd2c 846 TCanvas *c10 = new TCanvas("c10","(Anti)Proton cut efficiency vs y",
863f782b 847 250,250,700,400);
1c21299a 848 c10->SetHighLightColor(10); c10->Divide(2,1);
849
850 c10->cd(1)->SetBottomMargin(0.15);
851 c10->cd(1)->SetLeftMargin(0.15);
852 c10->cd(1)->SetGridx(); c10->cd(1)->SetGridy();
853 hEmptyY->SetTitle("Protons");
e13bbda6 854 hEmptyY->GetXaxis()->SetRangeUser(gYPrimaryESDAntiProtons->GetXaxis()->GetXmin()-0.2,gYPrimaryESDAntiProtons->GetXaxis()->GetXmax()+0.2);
1c21299a 855 hEmptyY->DrawCopy();
856 gYPrimaryESDProtons->DrawCopy("ESAME");
857
858 c10->cd(2)->SetBottomMargin(0.15);
859 c10->cd(2)->SetLeftMargin(0.15);
860 c10->cd(2)->SetGridx(); c10->cd(2)->SetGridy();
861 hEmptyY->SetTitle("Antiprotons");
862 hEmptyY->DrawCopy();
863 gYPrimaryESDAntiProtons->DrawCopy("ESAME");
864
2b00fd2c 865 c10->SaveAs("CutEfficiency-Protons-Rapidity.gif");
1c21299a 866
867 //pT dependence
868 //Protons
869 TH1D *gPtPrimaryESDProtons = (TH1D *)hPrimaryESDProtons->ProjectionY("gPtPrimaryESDProtons",0,hPrimaryESDProtons->GetYaxis()->GetNbins(),"e");
870 TH1D *gPtPrimaryMCProtons = (TH1D *)hPrimaryMCProtons->ProjectionY("gPtPrimaryMCProtons",0,hPrimaryMCProtons->GetYaxis()->GetNbins(),"e");
871 gPtPrimaryESDProtons->Divide(gPtPrimaryMCProtons);
1c21299a 872 SetError(gPtPrimaryESDProtons,gPtPrimaryMCProtons);
863f782b 873 gPtPrimaryESDProtons->Scale(100.);
1c21299a 874 gPtPrimaryESDProtons->SetMarkerStyle(kFullCircle);
875
876 //Antiprotons
877 TH1D *gPtPrimaryESDAntiProtons = (TH1D *)hPrimaryESDAntiProtons->ProjectionY("gPtPrimaryESDAntiProtons",0,hPrimaryESDAntiProtons->GetYaxis()->GetNbins(),"e");
878 TH1D *gPtPrimaryMCAntiProtons = (TH1D *)hPrimaryMCAntiProtons->ProjectionY("gPtPrimaryMCAntiProtons",0,hPrimaryMCAntiProtons->GetYaxis()->GetNbins(),"e");
879 gPtPrimaryESDAntiProtons->Divide(gPtPrimaryMCAntiProtons);
1c21299a 880 SetError(gPtPrimaryESDAntiProtons,gPtPrimaryMCAntiProtons);
863f782b 881 gPtPrimaryESDAntiProtons->Scale(100.);
1c21299a 882 gPtPrimaryESDAntiProtons->SetMarkerStyle(kFullCircle);
883
884 TH2F *hEmptyPt = new TH2F("hEmptyEfficiencyPt","",
885 100,0.0,4.0,100,-10.0,130);
886 hEmptyPt->SetStats(kFALSE);
887 hEmptyPt->GetYaxis()->SetTitle("#epsilon [%]");
888 hEmptyPt->GetYaxis()->SetTitleOffset(1.3);
889 hEmptyPt->GetXaxis()->SetTitle("P_{T} [GeV/c]");
890
2b00fd2c 891 TCanvas *c11 = new TCanvas("c11","(Anti)Proton cut efficiency vs pT",
863f782b 892 300,300,700,400);
1c21299a 893 c11->SetHighLightColor(10); c11->Divide(2,1);
894
895 c11->cd(1)->SetBottomMargin(0.15);
896 c11->cd(1)->SetLeftMargin(0.15);
897 c11->cd(1)->SetGridx(); c11->cd(1)->SetGridy();
898 hEmptyPt->SetTitle("Protons");
e13bbda6 899 hEmptyPt->GetXaxis()->SetRangeUser(gPtPrimaryESDAntiProtons->GetXaxis()->GetXmin()-0.2,gPtPrimaryESDAntiProtons->GetXaxis()->GetXmax()+0.2);
1c21299a 900 hEmptyPt->DrawCopy();
901 gPtPrimaryESDProtons->DrawCopy("ESAME");
902
903 c11->cd(2)->SetBottomMargin(0.15);
904 c11->cd(2)->SetLeftMargin(0.15);
905 c11->cd(2)->SetGridx(); c11->cd(2)->SetGridy();
906 hEmptyPt->SetTitle("Antirotons");
907 hEmptyPt->DrawCopy();
908 gPtPrimaryESDAntiProtons->DrawCopy("ESAME");
909
2b00fd2c 910 c11->SaveAs("CutEfficiency-Protons-Pt.gif");
1c21299a 911
9e2392b0 912 TString outputFileName = "CutEfficiency.";
913 outputFileName += analysisType; outputFileName += ".root";
914 TFile *fout = TFile::Open(outputFileName.Data(),"recreate");
1c21299a 915 gYPrimaryESDProtons->Write();
916 gYPrimaryESDAntiProtons->Write();
917 gPtPrimaryESDProtons->Write();
918 gPtPrimaryESDAntiProtons->Write();
919 fout->Close();
920}
921
cc0fbd97 922//________________________________________________//
923void GetQAEntries(TList *inputList, Double_t *entries) {
924 //loops over the list entries
925 //extracts the entries for each histogram
0008a5a6 926 //cout<<"Extracting the entries for the histograms in the list: "<<
927 //inputList->GetName()<<"..."<<endl;
cc0fbd97 928
929 for(Int_t i = 0; i < inputList->GetEntries(); i++) {
930 TH1F *gHist = (TH1F *)inputList->At(i);
931 entries[i] = gHist->GetEntries();
932 cout<<"Histogram: "<<gHist->GetName()<<
933 " - Entries: "<<entries[i]<<endl;
934 gHist = 0;
935 }
936}
937
938//________________________________________________//
939Double_t GetPercentage(Double_t nPassEntries,
940 Double_t nRejectEntries) {
941 //returns the percentage of tracks that were rejected by a cut
942 Int_t nTotalEntries = nPassEntries + nRejectEntries;
943
944 if(nTotalEntries == 0)
945 return -1;
946
947 return 100.*nRejectEntries/nTotalEntries;
948}
949
0008a5a6 950//________________________________________//
1c21299a 951void drawMCQA(TList *listPDG, TList *listMCProcesses) {
0008a5a6 952 //Function to display the composition of secondary (anti)protons
953 //The histogram shows the percentage of secondary (anti)protons
954 //originating from each particle species.
955 //The box summarizes the MC process that gave these secondary (anti)protons
956 TDatabasePDG *db = TDatabasePDG::Instance();
957 TParticlePDG *p = 0x0;
958
1c21299a 959 TH3F *gHistYPtPDGProtons = (TH3F *)listPDG->At(0);
960 TH3F *gHistYPtPDGAntiProtons = (TH3F *)listPDG->At(1);
961 readProcesses(listMCProcesses);
0008a5a6 962 Double_t nParticleCompositionProtonY[100], nParticleCompositionProtonPt[100];
720944fa 963 Double_t nParticleCompositionProtonYError[100], nParticleCompositionProtonPtError[100];
0008a5a6 964 Double_t nParticleCompositionAntiProtonY[100], nParticleCompositionAntiProtonPt[100];
720944fa 965 Double_t nParticleCompositionAntiProtonYError[100], nParticleCompositionAntiProtonPtError[100];
0008a5a6 966 Double_t gY[100], gPt[100];
720944fa 967 Double_t gYError[100], gPtError[100];
0008a5a6 968 for(Int_t iBins = 0; iBins < 100; iBins++) {
969 nParticleCompositionProtonY[iBins] = 0;
970 nParticleCompositionProtonPt[iBins] = 0;
720944fa 971 nParticleCompositionProtonYError[iBins] = 0;
972 nParticleCompositionProtonPtError[iBins] = 0;
0008a5a6 973 nParticleCompositionAntiProtonY[iBins] = 0;
974 nParticleCompositionAntiProtonPt[iBins] = 0;
720944fa 975 nParticleCompositionAntiProtonYError[iBins] = 0;
976 nParticleCompositionAntiProtonPtError[iBins] = 0;
0008a5a6 977 gY[iBins] = 0;
978 gPt[iBins] = 0;
720944fa 979 gYError[iBins] = 0;
980 gPtError[iBins] = 0;
0008a5a6 981 }
982
720944fa 983 TGraphErrors *gParticleProtonY[14];
984 TGraphErrors *gParticleProtonPt[14];
985 TGraphErrors *gParticleAntiProtonY[14];
986 TGraphErrors *gParticleAntiProtonPt[14];
0008a5a6 987 for(Int_t iParticle = 0; iParticle < 14; iParticle++) {
988 GetComposition(iParticle,
989 gHistYPtPDGProtons,
990 nParticleCompositionProtonY,
720944fa 991 nParticleCompositionProtonYError, gY, gYError,
992 nParticleCompositionProtonPt,
993 nParticleCompositionProtonPtError, gPt, gPtError);
994 gParticleProtonY[iParticle] = new TGraphErrors(gHistYPtPDGProtons->GetNbinsX(),
995 gY,nParticleCompositionProtonY,
996 gYError,nParticleCompositionProtonYError);
0008a5a6 997 gParticleProtonY[iParticle]->SetMarkerStyle(iParticle+20);
998 gParticleProtonY[iParticle]->SetMarkerSize(1.2);
999
720944fa 1000 gParticleProtonPt[iParticle] = new TGraphErrors(gHistYPtPDGProtons->GetNbinsY(),
1001 gPt,nParticleCompositionProtonPt,
1002 gPtError,nParticleCompositionProtonPtError);
0008a5a6 1003 gParticleProtonPt[iParticle]->SetMarkerStyle(iParticle+20);
1004 gParticleProtonPt[iParticle]->SetMarkerSize(1.2);
1005
1006 GetComposition(iParticle,
1007 gHistYPtPDGAntiProtons,
1008 nParticleCompositionAntiProtonY,
720944fa 1009 nParticleCompositionAntiProtonYError, gY, gYError,
1010 nParticleCompositionAntiProtonPt,
1011 nParticleCompositionAntiProtonPtError, gPt, gPtError);
1012 gParticleAntiProtonY[iParticle] = new TGraphErrors(gHistYPtPDGAntiProtons->GetNbinsX(),
1013 gY,nParticleCompositionAntiProtonY,
1014 gYError,nParticleCompositionAntiProtonYError);
0008a5a6 1015 gParticleAntiProtonY[iParticle]->SetMarkerStyle(iParticle+20);
1016 gParticleAntiProtonY[iParticle]->SetMarkerSize(1.2);
1017
720944fa 1018 gParticleAntiProtonPt[iParticle] = new TGraphErrors(gHistYPtPDGAntiProtons->GetNbinsY(),
1019 gPt,nParticleCompositionAntiProtonPt,
1020 gPtError,nParticleCompositionAntiProtonPtError);
0008a5a6 1021 gParticleAntiProtonPt[iParticle]->SetMarkerStyle(iParticle+20);
1022 gParticleAntiProtonPt[iParticle]->SetMarkerSize(1.2);
1023 }
1024
1025 //_________________________________________________________//
1026 char *fParticleName[14] = {"Primary","K_{L}","#pi","K_{S}","K",
1027 "n","p","#Sigma^{-}","#Lambda","#Sigma^{+}",
5b8133c7 1028 "#Xi^{-}","#Xi^{0}","#Omega^{-}"};
0008a5a6 1029 TLatex *t1 = new TLatex();
1030 t1->SetTextSize(0.04);
1031
5b8133c7 1032 TH2F *hEmptyY = new TH2F("hEmptyY","",100,-1.2,1.2,100,0,120);
0008a5a6 1033 hEmptyY->SetStats(kFALSE);
1034 hEmptyY->GetYaxis()->SetTitle("Particle composition [%]");
dd3fa486 1035 hEmptyY->GetXaxis()->SetTitle(gHistYPtPDGProtons->GetXaxis()->GetTitle());
0008a5a6 1036
5b8133c7 1037 TCanvas *c3 = new TCanvas("c3","MC secondary composition vs y - Protons",
3e23254a 1038 450,450,700,400);
0008a5a6 1039 c3->SetHighLightColor(10); c3->SetBottomMargin(0.15);
1040 c3->SetGridx(); c3->SetGridy();
720944fa 1041 hEmptyY->GetXaxis()->SetRangeUser(gParticleProtonY[0]->GetXaxis()->GetXmin()-0.2,gParticleProtonY[0]->GetXaxis()->GetXmax()+0.2);
1c21299a 1042 hEmptyY->DrawCopy();
0008a5a6 1043 for(Int_t iParticle = 0; iParticle < 10; iParticle++) {
5b8133c7 1044 //if((iParticle == 0)||(iParticle == 2)||(iParticle == 5)||(iParticle == 6)||(iParticle == 8))
1045 if((iParticle == 0)||(iParticle == 2)||(iParticle == 6)||(iParticle == 8))
1046 gParticleProtonY[iParticle]->Draw("P");
720944fa 1047 /*if(iParticle < 5) {
5b8133c7 1048 DrawMarker(-1.1, 115-5*iParticle, 20+iParticle, 1.2, 1);
1049 t1->DrawLatex(-1.0,113-5*iParticle,fParticleName[iParticle]);
0008a5a6 1050 }
1051 else {
5b8133c7 1052 DrawMarker(0.2, 115-5*(iParticle-5), 20+iParticle, 1.2, 1);
1053 t1->DrawLatex(0.3,113-5*(iParticle-5),fParticleName[iParticle]);
720944fa 1054 }*/
0008a5a6 1055 }
720944fa 1056 DrawMarker(0.0, 115, 20, 1.2, 1);
1057 t1->DrawLatex(0.1,113,fParticleName[0]);
1058 DrawMarker(0.0, 108, 22, 1.2, 1);
1059 t1->DrawLatex(0.1,106,fParticleName[2]);
1060 DrawMarker(0.0, 101, 26, 1.2, 1);
1061 t1->DrawLatex(0.1,99,fParticleName[6]);
1062 DrawMarker(0.0, 94, 28, 1.2, 1);
1063 t1->DrawLatex(0.1,92,fParticleName[8]);
0008a5a6 1064
5b8133c7 1065 TCanvas *c5 = new TCanvas("c5","MC secondary composition vs y - antiProtons",
3e23254a 1066 500,500,700,400);
0008a5a6 1067 c5->SetHighLightColor(10); c5->SetBottomMargin(0.15);
1068 c5->SetGridx(); c5->SetGridy();
1c21299a 1069 hEmptyY->DrawCopy();
0008a5a6 1070 for(Int_t iParticle = 0; iParticle < 10; iParticle++) {
5b8133c7 1071 if((iParticle == 0)||(iParticle == 6)||(iParticle == 8))
1072 gParticleAntiProtonY[iParticle]->Draw("P");
720944fa 1073 /*if(iParticle < 5) {
5b8133c7 1074 DrawMarker(-1.1, 115-5*iParticle, 20+iParticle, 1.2, 1);
1075 t1->DrawLatex(-1.0,113-5*iParticle,fParticleName[iParticle]);
0008a5a6 1076 }
1077 else {
5b8133c7 1078 DrawMarker(0.2, 115-5*(iParticle-5), 20+iParticle, 1.2, 1);
1079 t1->DrawLatex(0.3,113-5*(iParticle-5),fParticleName[iParticle]);
720944fa 1080 }*/
0008a5a6 1081 }
720944fa 1082 DrawMarker(0.0, 115, 20, 1.2, 1);
1083 t1->DrawLatex(0.1,113,fParticleName[0]);
1084 DrawMarker(0.0, 108, 26, 1.2, 1);
1085 t1->DrawLatex(0.1,106,fParticleName[6]);
1086 DrawMarker(0.0, 101, 28, 1.2, 1);
1087 t1->DrawLatex(0.1,99,fParticleName[8]);
0008a5a6 1088
5b8133c7 1089 TH2F *hEmptyPt = new TH2F("hEmptyPt","",100,0.0,4.0,100,0,120);
0008a5a6 1090 hEmptyPt->SetStats(kFALSE);
1091 hEmptyPt->GetYaxis()->SetTitle("Particle composition [%]");
1092 hEmptyPt->GetXaxis()->SetTitle("P_{T} [GeV/c]");
1093
5b8133c7 1094 TCanvas *c4 = new TCanvas("c4","MC secondary composition vs pT - Protons",
3e23254a 1095 550,550,700,400);
0008a5a6 1096 c4->SetHighLightColor(10); c4->SetBottomMargin(0.15);
1097 c4->SetGridx(); c4->SetGridy();
720944fa 1098 hEmptyPt->GetXaxis()->SetRangeUser(gParticleProtonPt[0]->GetXaxis()->GetXmin()-0.2,gParticleProtonPt[0]->GetXaxis()->GetXmax()+0.2);
1c21299a 1099 hEmptyPt->DrawCopy();
0008a5a6 1100 for(Int_t iParticle = 0; iParticle < 10; iParticle++) {
720944fa 1101 /*if(iParticle < 5) {
5b8133c7 1102 DrawMarker(0.2, 115-5*iParticle, 20+iParticle, 1.2, 1);
1103 t1->DrawLatex(0.3,113-5*iParticle,fParticleName[iParticle]);
0008a5a6 1104 }
1105 else {
5b8133c7 1106 DrawMarker(2.2, 115-5*(iParticle-5), 20+iParticle, 1.2, 1);
1107 t1->DrawLatex(2.3,113-5*(iParticle-5),fParticleName[iParticle]);
720944fa 1108 }*/
5b8133c7 1109 if((iParticle == 0)||(iParticle == 2)||(iParticle == 6)||(iParticle == 8))
1110 gParticleProtonPt[iParticle]->Draw("P");
0008a5a6 1111 }
720944fa 1112 DrawMarker(0.5, 115, 20, 1.2, 1);
1113 t1->DrawLatex(0.6,113,fParticleName[0]);
1114 DrawMarker(0.5, 108, 22, 1.2, 1);
1115 t1->DrawLatex(0.6,106,fParticleName[2]);
1116 DrawMarker(0.5, 101, 26, 1.2, 1);
1117 t1->DrawLatex(0.6,99,fParticleName[6]);
1118 DrawMarker(0.5, 94, 28, 1.2, 1);
1119 t1->DrawLatex(0.6,92,fParticleName[8]);
0008a5a6 1120
1c21299a 1121 TCanvas *c6 = new TCanvas("c6",
1122 "MC secondary composition vs pT - AntiProtons",
3e23254a 1123 600,600,700,400);
0008a5a6 1124 c6->SetHighLightColor(10); c6->SetBottomMargin(0.15);
1125 c6->SetGridx(); c6->SetGridy();
1c21299a 1126 hEmptyPt->DrawCopy();
0008a5a6 1127 for(Int_t iParticle = 0; iParticle < 10; iParticle++) {
720944fa 1128 /*if(iParticle < 5) {
5b8133c7 1129 DrawMarker(0.2, 115-5*iParticle, 20+iParticle, 1.2, 1);
1130 t1->DrawLatex(0.3,113-5*iParticle,fParticleName[iParticle]);
0008a5a6 1131 }
1132 else {
5b8133c7 1133 DrawMarker(2.2, 115-5*(iParticle-5), 20+iParticle, 1.2, 1);
1134 t1->DrawLatex(2.3,113-5*(iParticle-5),fParticleName[iParticle]);
720944fa 1135 }*/
5b8133c7 1136 if((iParticle == 0)||(iParticle == 6)||(iParticle == 8))
1137 gParticleAntiProtonPt[iParticle]->Draw("P");
0008a5a6 1138 }
720944fa 1139 DrawMarker(0.5, 115, 20, 1.2, 1);
1140 t1->DrawLatex(0.6,113,fParticleName[0]);
1141 DrawMarker(0.5, 108, 26, 1.2, 1);
1142 t1->DrawLatex(0.6,106,fParticleName[6]);
1143 DrawMarker(0.5, 101, 28, 1.2, 1);
1144 t1->DrawLatex(0.6,99,fParticleName[8]);
0008a5a6 1145}
1146
1147//________________________________________//
1148void GetComposition(Int_t iSpecies,
1149 TH3F *gHist,
1150 Double_t *nParticleCompositionY,
720944fa 1151 Double_t *nParticleCompositionYError,
1152 Double_t *gY, Double_t *gYError,
0008a5a6 1153 Double_t *nParticleCompositionPt,
720944fa 1154 Double_t *nParticleCompositionPtError,
1155 Double_t *gPt, Double_t *gPtError) {
0008a5a6 1156 //Returns the pT and y dependence of the MC composition
1157 Double_t ymin = gHist->GetXaxis()->GetXmin();
1158 Double_t ymax = gHist->GetXaxis()->GetXmax();
1159 Double_t nybins = gHist->GetNbinsX();
1160 Double_t ptmin = gHist->GetYaxis()->GetXmin();
1161 Double_t ptmax = gHist->GetYaxis()->GetXmax();
1162 Double_t nptbins = gHist->GetNbinsY();
1163 Double_t nTotalY[100], nTotalPt[100];
1164 for(Int_t iBins = 0; iBins < 100; iBins++) {
1165 nParticleCompositionY[iBins] = 0;
1166 nParticleCompositionPt[iBins] = 0;
720944fa 1167 nParticleCompositionYError[iBins] = 0;
1168 nParticleCompositionPtError[iBins] = 0;
0008a5a6 1169 nTotalY[iBins] = 0.0;
1170 nTotalPt[iBins] = 0.0;
1171 }
1172
1173 //rapidity dependence
1174 //cout<<"Ymin: "<<ymin<<" - Ymax: "<<ymax<<" - Ybins: "<<nybins<<endl;
1175 for(Int_t iXbins = 1; iXbins <= gHist->GetNbinsX(); iXbins++) {
1176 for(Int_t iZbins = 1; iZbins <= gHist->GetNbinsZ(); iZbins++) {
1177 for(Int_t iYbins = 1; iYbins <= gHist->GetNbinsY(); iYbins++) {
1178 nTotalY[iXbins-1] += gHist->GetBinContent(iXbins,iYbins,iZbins);
1179 }
1180 }
1181 }
1182
1183 for(Int_t iXbins = 1; iXbins <= gHist->GetNbinsX(); iXbins++) {
1184 for(Int_t iYbins = 1; iYbins <= gHist->GetNbinsY(); iYbins++) {
863f782b 1185 if(nTotalY[iXbins-1] > 0)
1186 nParticleCompositionY[iXbins-1] += 100.*gHist->GetBinContent(iXbins,iYbins,iSpecies+1)/nTotalY[iXbins-1];
720944fa 1187 //nCompositionY[iXbins-1] += gHist->GetBinContent(iXbins,iYbins,iSpecies+1);
5b8133c7 1188 //if(nParticleCompositionY[iXbins-1] == 0)
1189 //nParticleCompositionY[iXbins-1] = -10.0;
0008a5a6 1190 }//pt loop
720944fa 1191 if((nParticleCompositionY[iXbins-1] <= 100.)&&(nTotalY[iXbins-1] != 0))
1192 nParticleCompositionYError[iXbins-1] = TMath::Sqrt(nParticleCompositionY[iXbins-1]*(100. - nParticleCompositionY[iXbins-1])/nTotalY[iXbins-1]);
0008a5a6 1193 gY[iXbins-1] = ymin + (iXbins-1)*(ymax - ymin)/nybins + 0.5*(ymax - ymin)/nybins;
720944fa 1194 gYError[iXbins-1] = 0.5*(ymax - ymin)/nybins;
0008a5a6 1195 //cout<<"y: "<<gY[iXbins-1]<<
1196 //" - test: "<<ymin + (iXbins-1)*(ymax - ymin)/nybins + 0.5*(ymax - ymin)/nybins<<
1197 //" - Number of protons: "<<nY[iXbins-1]<<
1198 //" - Total: "<<nTotalY[iXbins-1]<<
1199 //" - Percentage: "<<nParticleCompositionY[iXbins-1]<<endl;
1200 }//y loop
1201
1202 //pt dependence
1203 //cout<<"Ptmin: "<<ptmin<<" - Ptmax: "<<ptmax<<" - Ptbins: "<<nptbins<<endl;
1204 for(Int_t iYbins = 1; iYbins <= gHist->GetNbinsY(); iYbins++) {
1205 for(Int_t iZbins = 1; iZbins <= gHist->GetNbinsZ(); iZbins++) {
1206 for(Int_t iXbins = 1; iXbins <= gHist->GetNbinsX(); iXbins++) {
1207 nTotalPt[iYbins-1] += gHist->GetBinContent(iXbins,iYbins,iZbins);
1208 }
1209 }
1210 }
1211
1212 for(Int_t iYbins = 1; iYbins <= gHist->GetNbinsY(); iYbins++) {
1213 for(Int_t iXbins = 1; iXbins <= gHist->GetNbinsX(); iXbins++) {
863f782b 1214 if(nTotalPt[iYbins-1] > 0)
1215 nParticleCompositionPt[iYbins-1] += 100.*gHist->GetBinContent(iXbins,iYbins,iSpecies+1)/nTotalPt[iYbins-1];
5b8133c7 1216 //if(nParticleCompositionPt[iYbins-1] == 0)
1217 //nParticleCompositionPt[iYbins-1] = -10.0;
0008a5a6 1218 }//pt loop
720944fa 1219 if((nParticleCompositionPt[iYbins-1] <= 100.)&&(nTotalPt[iYbins-1] != 0))
1220 nParticleCompositionPtError[iYbins-1] = TMath::Sqrt(nParticleCompositionPt[iYbins-1]*(100. - nParticleCompositionPt[iYbins-1])/nTotalPt[iYbins-1]);
0008a5a6 1221 gPt[iYbins-1] = ptmin + (iYbins-1)*(ptmax - ptmin)/nptbins + 0.5*(ptmax - ptmin)/nptbins;
720944fa 1222 gPtError[iYbins-1] = 0.5*(ptmax - ptmin)/nptbins;
0008a5a6 1223 //cout<<"Pt: "<<gPt[iYbins-1]<<
1224 //" - test: "<<ptmin + (iYbins-1)*(ptmax - ptmin)/nptbins + 0.5*(ptmax - ptmin)/nptbins<<
1225 //" - Number of protons: "<<nY[iXbins-1]<<
1226 //" - Total: "<<nTotalPt[iYbins-1]<<
1227 //" - Percentage: "<<nParticleCompositionPt[iYbins-1]<<endl;
1228 }//pt loop
1229}
1230
5b8133c7 1231//________________________________________//
1232void readProcesses(TList *list) {
1233 char *fParticleProtonName[12] = {"K_{L}","#pi","K_{S}","K",
1234 "n","p","#Sigma^{-}","#Lambda","#Sigma^{+}",
1235 "#Xi^{-}","#Xi^{0}","#Omega^{-}"};
1236 char *fParticleAntiProtonName[8] = {"K_{L}","#pi","K_{S}","K",
1c21299a 1237 "n","p","#Lambda","#Sigma^{+}"};
5b8133c7 1238 Int_t iProtonCounter = 0, iAntiProtonCounter = 0;
1239 TH1F *gMCProcesses;
1240 for(Int_t iEntry = 0; iEntry < list->GetEntries(); iEntry++) {
1241 gMCProcesses = (TH1F *)list->At(iEntry);
1242 TString histName = gMCProcesses->GetName();
1243 if(histName.Contains("gHistProtons")) {
1244 cout<<"Protons coming from "<<fParticleProtonName[iProtonCounter]<<endl;
1245
1246 iProtonCounter += 1;
1247 }
1248 if(histName.Contains("gHistAntiProtons")) {
1249 cout<<"Antiprotons coming from "<<fParticleAntiProtonName[iAntiProtonCounter]<<endl;
1250
1251 iAntiProtonCounter += 1;
1252 }
1253 for(Int_t iBin = 1; iBin < gMCProcesses->GetNbinsX(); iBin++) {
1254 Double_t binContent = gMCProcesses->GetBinContent(iBin);
1255 if(binContent > 0) {
1256 Int_t processId = gMCProcesses->GetBinCenter(iBin);
1257 cout<<"\t Process ID: "<<processId<<" - "<<
1c21299a 1258 gMCProcessName[processId]<<" - "<<
5b8133c7 1259 100.*binContent/gMCProcesses->GetEntries()<<"%"<<endl;
1260 }
1261 }
1c21299a 1262 }
1263}
5b8133c7 1264
1c21299a 1265//________________________________________________//
1266void SetError(TH1D *hEff, TH1D *hGen) {
1267 for(Int_t iBin = 1; iBin <= hEff->GetNbinsX(); iBin++) {
1268 Double_t error = 0.0;
e13bbda6 1269 if((hEff->GetBinContent(iBin) <= 1 .)&&(hGen->GetBinContent(iBin) != 0))
863f782b 1270 error = TMath::Sqrt(hEff->GetBinContent(iBin)*(1 . - hEff->GetBinContent(iBin))/hGen->GetBinContent(iBin));
1c21299a 1271 hEff->SetBinError(iBin,error);
5b8133c7 1272 }
1273}
1274
863f782b 1275//________________________________________//
9e2392b0 1276void drawEfficiency(TList *list,
1277 const char* analysisType) {
863f782b 1278 //Function to display the reconstruction and PID efficiencies
1279 //for protons and antiprotons vs y and pT
1280
1281 TH2F *hEmpty = new TH2F("hEmptyReconstructionEfficiency","",
1282 100,-1.2,3.5,100,-10.0,130);
1283 hEmpty->SetStats(kFALSE);
1284 hEmpty->GetYaxis()->SetTitle("#epsilon [%]");
1285 hEmpty->GetYaxis()->SetTitleOffset(1.3);
1286
1287 //Reconstruction efficiency
e13bbda6 1288 TH2D *gHistPrimariesMCYPtProtons = (TH2D *)list->At(0);
1289 TH2D *gHistPrimariesMCYPtAntiProtons = (TH2D *)list->At(1);
1290 TH2D *gHistMCYPtProtonsFromWeak = (TH2D *)list->At(2);
1291 TH2D *gHistMCYPtAntiProtonsFromWeak = (TH2D *)list->At(3);
1292 TH2D *gHistMCYPtProtonsFromHadronic = (TH2D *)list->At(4);
1293 TH2D *gHistMCYPtAntiProtonsFromHadronic = (TH2D *)list->At(5);
1294 TH2D *gHistPrimariesESDYPtProtons = (TH2D *)list->At(6);
1295 TH2D *gHistPrimariesESDYPtAntiProtons = (TH2D *)list->At(7);
1296 TH2D *gHistESDYPtProtonsFromWeak = (TH2D *)list->At(8);
1297 TH2D *gHistESDYPtAntiProtonsFromWeak = (TH2D *)list->At(9);
1298 TH2D *gHistESDYPtProtonsFromHadronic = (TH2D *)list->At(10);
1299 TH2D *gHistESDYPtAntiProtonsFromHadronic = (TH2D *)list->At(11);
863f782b 1300
1301 //rapidity dependence
1302 TCanvas *c14 = new TCanvas("c14",
1303 "(Anti)Proton reconstruction efficiency vs y",
3e23254a 1304 650,650,700,400);
863f782b 1305 c14->SetHighLightColor(10); c14->Divide(2,1);
1306
e13bbda6 1307 //Primary Protons
1308 TH1D *gYPrimariesESDProtons = (TH1D *)gHistPrimariesESDYPtProtons->ProjectionX("gYPrimariesESDProtons",0,gHistPrimariesESDYPtProtons->GetXaxis()->GetNbins(),"e");
1309 TH1D *gYPrimariesMCProtons = (TH1D *)gHistPrimariesMCYPtProtons->ProjectionX("gYPrimariesMCProtons",0,gHistPrimariesMCYPtProtons->GetXaxis()->GetNbins(),"e");
1310 gYPrimariesESDProtons->Divide(gYPrimariesMCProtons);
1311 SetError(gYPrimariesESDProtons,gYPrimariesMCProtons);
1312 gYPrimariesESDProtons->Scale(100.);
1313 gYPrimariesESDProtons->SetMarkerStyle(kFullCircle);
1314
1315 //Primary AntiProtons
1316 TH1D *gYPrimariesESDAntiProtons = (TH1D *)gHistPrimariesESDYPtAntiProtons->ProjectionX("gYPrimariesESDAntiProtons",0,gHistPrimariesESDYPtAntiProtons->GetXaxis()->GetNbins(),"e");
1317 TH1D *gYPrimariesMCAntiProtons = (TH1D *)gHistPrimariesMCYPtAntiProtons->ProjectionX("gYPrimariesMCAntiProtons",0,gHistPrimariesMCYPtProtons->GetXaxis()->GetNbins(),"e");
1318 gYPrimariesESDAntiProtons->Divide(gYPrimariesMCAntiProtons);
1319 SetError(gYPrimariesESDAntiProtons,gYPrimariesMCAntiProtons);
1320 gYPrimariesESDAntiProtons->Scale(100.);
1321 gYPrimariesESDAntiProtons->SetMarkerStyle(kFullCircle);
1322
1323 //Protons from weak decays
1324 TH1D *gYESDProtonsFromWeak = (TH1D *)gHistESDYPtProtonsFromWeak->ProjectionX("gYESDProtonsFromWeak",0,gHistESDYPtProtonsFromWeak->GetXaxis()->GetNbins(),"e");
1325 TH1D *gYMCProtonsFromWeak = (TH1D *)gHistMCYPtProtonsFromWeak->ProjectionX("gYMCProtonsFromWeak",0,gHistMCYPtProtonsFromWeak->GetXaxis()->GetNbins(),"e");
1326 gYESDProtonsFromWeak->Divide(gYMCProtonsFromWeak);
1327 SetError(gYESDProtonsFromWeak,gYMCProtonsFromWeak);
1328 gYESDProtonsFromWeak->Scale(100.);
1329 gYESDProtonsFromWeak->SetMarkerStyle(21);
1330 gYESDProtonsFromWeak->SetMarkerColor(2);
1331
1332 //AntiProtons from weak decays
1333 TH1D *gYESDAntiProtonsFromWeak = (TH1D *)gHistESDYPtAntiProtonsFromWeak->ProjectionX("gYESDAntiProtonsFromWeak",0,gHistESDYPtAntiProtonsFromWeak->GetXaxis()->GetNbins(),"e");
1334 TH1D *gYMCAntiProtonsFromWeak = (TH1D *)gHistMCYPtAntiProtonsFromWeak->ProjectionX("gYMCAntiProtonsFromWeak",0,gHistMCYPtProtonsFromWeak->GetXaxis()->GetNbins(),"e");
1335 gYESDAntiProtonsFromWeak->Divide(gYMCAntiProtonsFromWeak);
1336 SetError(gYESDAntiProtonsFromWeak,gYMCAntiProtonsFromWeak);
1337 gYESDAntiProtonsFromWeak->Scale(100.);
1338 gYESDAntiProtonsFromWeak->SetMarkerStyle(21);
1339 gYESDAntiProtonsFromWeak->SetMarkerColor(2);
1340
1341 //Protons from hadronic interactions
1342 TH1D *gYESDProtonsFromHadronic = (TH1D *)gHistESDYPtProtonsFromHadronic->ProjectionX("gYESDProtonsFromHadronic",0,gHistESDYPtProtonsFromHadronic->GetXaxis()->GetNbins(),"e");
1343 TH1D *gYMCProtonsFromHadronic = (TH1D *)gHistMCYPtProtonsFromHadronic->ProjectionX("gYMCProtonsFromHadronic",0,gHistMCYPtProtonsFromHadronic->GetXaxis()->GetNbins(),"e");
1344 gYESDProtonsFromHadronic->Divide(gYMCProtonsFromHadronic);
1345 SetError(gYESDProtonsFromHadronic,gYMCProtonsFromHadronic);
1346 gYESDProtonsFromHadronic->Scale(100.);
1347 gYESDProtonsFromHadronic->SetMarkerStyle(22);
1348 gYESDProtonsFromHadronic->SetMarkerColor(3);
1349
3e23254a 1350 //AntiProtons from hadronic interactions
e13bbda6 1351 TH1D *gYESDAntiProtonsFromHadronic = (TH1D *)gHistESDYPtAntiProtonsFromHadronic->ProjectionX("gYESDAntiProtonsFromHadronic",0,gHistESDYPtAntiProtonsFromHadronic->GetXaxis()->GetNbins(),"e");
1352 TH1D *gYMCAntiProtonsFromHadronic = (TH1D *)gHistMCYPtAntiProtonsFromHadronic->ProjectionX("gYMCAntiProtonsFromHadronic",0,gHistMCYPtProtonsFromHadronic->GetXaxis()->GetNbins(),"e");
1353 gYESDAntiProtonsFromHadronic->Divide(gYMCAntiProtonsFromHadronic);
1354 SetError(gYESDAntiProtonsFromHadronic,gYMCAntiProtonsFromHadronic);
1355 gYESDAntiProtonsFromHadronic->Scale(100.);
1356 gYESDAntiProtonsFromHadronic->SetMarkerStyle(22);
1357 gYESDAntiProtonsFromHadronic->SetMarkerColor(3);
863f782b 1358
1359 c14->cd(1)->SetBottomMargin(0.15);
1360 c14->cd(1)->SetLeftMargin(0.15);
1361 c14->cd(1)->SetGridx(); c14->cd(1)->SetGridy();
e13bbda6 1362 hEmpty->GetXaxis()->SetRangeUser(gYPrimariesESDAntiProtons->GetXaxis()->GetXmin()-0.2,
1363 gYPrimariesESDAntiProtons->GetXaxis()->GetXmax()+0.2);
1364 hEmpty->GetXaxis()->SetTitle(gYPrimariesESDAntiProtons->GetXaxis()->GetTitle());
863f782b 1365 hEmpty->SetTitle("Protons");
1366 hEmpty->DrawCopy();
e13bbda6 1367 gYPrimariesESDProtons->DrawCopy("ESAME");
1368 gYESDProtonsFromWeak->DrawCopy("ESAME");
1369 gYESDProtonsFromHadronic->DrawCopy("ESAME");
863f782b 1370
1371 c14->cd(2)->SetBottomMargin(0.15);
1372 c14->cd(2)->SetLeftMargin(0.15);
1373 c14->cd(2)->SetGridx(); c14->cd(2)->SetGridy();
1374 hEmpty->SetTitle("Antiprotons");
1375 hEmpty->DrawCopy();
e13bbda6 1376 gYPrimariesESDAntiProtons->DrawCopy("ESAME");
1377 gYESDAntiProtonsFromWeak->DrawCopy("ESAME");
1378 gYESDAntiProtonsFromHadronic->DrawCopy("ESAME");
863f782b 1379 c14->SaveAs("ReconstructionEfficiency-Protons-Rapidity.gif");
1380
1381 //pT dependence
1382 TCanvas *c15 = new TCanvas("c15",
1383 "(Anti)Proton reconstruction efficiency vs pT",
3e23254a 1384 700,700,700,400);
863f782b 1385 c15->SetHighLightColor(10); c15->Divide(2,1);
1386
e13bbda6 1387 //Primary Protons
1388 TH1D *gPtPrimariesESDProtons = (TH1D *)gHistPrimariesESDYPtProtons->ProjectionY("gPtPrimariesESDProtons",0,gHistPrimariesESDYPtProtons->GetYaxis()->GetNbins(),"e");
1389 TH1D *gPtPrimariesMCProtons = (TH1D *)gHistPrimariesMCYPtProtons->ProjectionY("gPtPrimariesMCProtons",0,gHistPrimariesMCYPtProtons->GetYaxis()->GetNbins(),"e");
1390 gPtPrimariesESDProtons->Divide(gPtPrimariesMCProtons);
1391 SetError(gPtPrimariesESDProtons,gPtPrimariesMCProtons);
1392 gPtPrimariesESDProtons->Scale(100.);
1393 gPtPrimariesESDProtons->SetMarkerStyle(kFullCircle);
1394
1395 //Primary AntiProtons
1396 TH1D *gPtPrimariesESDAntiProtons = (TH1D *)gHistPrimariesESDYPtAntiProtons->ProjectionY("gPtPrimariesESDAntiProtons",0,gHistPrimariesESDYPtAntiProtons->GetYaxis()->GetNbins(),"e");
1397 TH1D *gPtPrimariesMCAntiProtons = (TH1D *)gHistPrimariesMCYPtAntiProtons->ProjectionY("gPtPrimariesMCAntiProtons",0,gHistPrimariesMCYPtProtons->GetYaxis()->GetNbins(),"e");
1398 gPtPrimariesESDAntiProtons->Divide(gPtPrimariesMCAntiProtons);
1399 SetError(gPtPrimariesESDAntiProtons,gPtPrimariesMCAntiProtons);
1400 gPtPrimariesESDAntiProtons->Scale(100.);
1401 gPtPrimariesESDAntiProtons->SetMarkerStyle(kFullCircle);
1402
1403 //Protons from weak decays
1404 TH1D *gPtESDProtonsFromWeak = (TH1D *)gHistESDYPtProtonsFromWeak->ProjectionY("gPtESDProtonsFromWeak",0,gHistESDYPtProtonsFromWeak->GetYaxis()->GetNbins(),"e");
1405 TH1D *gPtMCProtonsFromWeak = (TH1D *)gHistMCYPtProtonsFromWeak->ProjectionY("gPtMCProtonsFromWeak",0,gHistMCYPtProtonsFromWeak->GetYaxis()->GetNbins(),"e");
1406 gPtESDProtonsFromWeak->Divide(gPtMCProtonsFromWeak);
1407 SetError(gPtESDProtonsFromWeak,gPtMCProtonsFromWeak);
1408 gPtESDProtonsFromWeak->Scale(100.);
1409 gPtESDProtonsFromWeak->SetMarkerStyle(21);
1410 gPtESDProtonsFromWeak->SetMarkerColor(2);
1411
1412 //AntiProtons from weak decays
1413 TH1D *gPtESDAntiProtonsFromWeak = (TH1D *)gHistESDYPtAntiProtonsFromWeak->ProjectionY("gPtESDAntiProtonsFromWeak",0,gHistESDYPtAntiProtonsFromWeak->GetYaxis()->GetNbins(),"e");
1414 TH1D *gPtMCAntiProtonsFromWeak = (TH1D *)gHistMCYPtAntiProtonsFromWeak->ProjectionY("gPtMCAntiProtonsFromWeak",0,gHistMCYPtProtonsFromWeak->GetYaxis()->GetNbins(),"e");
1415 gPtESDAntiProtonsFromWeak->Divide(gPtMCAntiProtonsFromWeak);
1416 SetError(gPtESDAntiProtonsFromWeak,gPtMCAntiProtonsFromWeak);
1417 gPtESDAntiProtonsFromWeak->Scale(100.);
1418 gPtESDAntiProtonsFromWeak->SetMarkerStyle(21);
1419 gPtESDAntiProtonsFromWeak->SetMarkerColor(2);
1420
1421 //Protons from hadronic interactions
1422 TH1D *gPtESDProtonsFromHadronic = (TH1D *)gHistESDYPtProtonsFromHadronic->ProjectionY("gPtESDProtonsFromHadronic",0,gHistESDYPtProtonsFromHadronic->GetYaxis()->GetNbins(),"e");
1423 TH1D *gPtMCProtonsFromHadronic = (TH1D *)gHistMCYPtProtonsFromHadronic->ProjectionY("gPtMCProtonsFromHadronic",0,gHistMCYPtProtonsFromHadronic->GetYaxis()->GetNbins(),"e");
1424 gPtESDProtonsFromHadronic->Divide(gPtMCProtonsFromHadronic);
1425 SetError(gPtESDProtonsFromHadronic,gPtMCProtonsFromHadronic);
1426 gPtESDProtonsFromHadronic->Scale(100.);
1427 gPtESDProtonsFromHadronic->SetMarkerStyle(22);
1428 gPtESDProtonsFromHadronic->SetMarkerColor(3);
1429
1430 //AntiProtons from hadronic interactions
1431 TH1D *gPtESDAntiProtonsFromHadronic = (TH1D *)gHistESDYPtAntiProtonsFromHadronic->ProjectionY("gPtESDAntiProtonsFromHadronic",0,gHistESDYPtAntiProtonsFromHadronic->GetYaxis()->GetNbins(),"e");
1432 TH1D *gPtMCAntiProtonsFromHadronic = (TH1D *)gHistMCYPtAntiProtonsFromHadronic->ProjectionY("gPtMCAntiProtonsFromHadronic",0,gHistMCYPtProtonsFromHadronic->GetYaxis()->GetNbins(),"e");
1433 gPtESDAntiProtonsFromHadronic->Divide(gPtMCAntiProtonsFromHadronic);
1434 SetError(gPtESDAntiProtonsFromHadronic,gPtMCAntiProtonsFromHadronic);
1435 gPtESDAntiProtonsFromHadronic->Scale(100.);
1436 gPtESDAntiProtonsFromHadronic->SetMarkerStyle(22);
1437 gPtESDAntiProtonsFromHadronic->SetMarkerColor(3);
863f782b 1438
1439
1440 c15->cd(1)->SetBottomMargin(0.15);
1441 c15->cd(1)->SetLeftMargin(0.15);
1442 c15->cd(1)->SetGridx(); c15->cd(1)->SetGridy();
e13bbda6 1443 hEmpty->GetXaxis()->SetRangeUser(gPtPrimariesESDAntiProtons->GetXaxis()->GetXmin()-0.2,
1444 gPtPrimariesESDAntiProtons->GetXaxis()->GetXmax()+0.2);
863f782b 1445 hEmpty->GetXaxis()->SetTitle("P_{T} [GeV/c]");
1446 hEmpty->SetTitle("Protons");
1447 hEmpty->DrawCopy();
e13bbda6 1448 gPtPrimariesESDProtons->DrawCopy("ESAME");
1449 gPtESDProtonsFromWeak->DrawCopy("ESAME");
1450 gPtESDProtonsFromHadronic->DrawCopy("ESAME");
863f782b 1451
1452 c15->cd(2)->SetBottomMargin(0.15);
1453 c15->cd(2)->SetLeftMargin(0.15);
1454 c15->cd(2)->SetGridx(); c15->cd(2)->SetGridy();
1455 hEmpty->SetTitle("Antiprotons");
1456 hEmpty->DrawCopy();
e13bbda6 1457 gPtPrimariesESDAntiProtons->DrawCopy("ESAME");
1458 gPtESDAntiProtonsFromWeak->DrawCopy("ESAME");
1459 gPtESDAntiProtonsFromHadronic->DrawCopy("ESAME");
863f782b 1460 c15->SaveAs("ReconstructionEfficiency-Protons-Pt.gif");
1461
e13bbda6 1462 //______________//
1463 //PID efficiency//
1464 //______________//
1465 TH2D *gHistESDInitYPtProtons = (TH2D *)list->At(12);
1466 TH2D *gHistESDIdYPtProtons = (TH2D *)list->At(13);
1467 TH2D *gHistESDRecIdYPtProtons = (TH2D *)list->At(14);
1468 TH2D *gHistESDContamYPtProtons = (TH2D *)list->At(15);
863f782b 1469
1470 TCanvas *c16 = new TCanvas("c16",
1471 "(Anti)Proton PID efficiency vs y and pT",
3e23254a 1472 750,750,700,400);
863f782b 1473 c16->SetHighLightColor(10); c16->Divide(2,1);
1474
1475 //rapidity dependence
1476 //protons pid efficiency
1477 TH1D *gYESDIdProtons = (TH1D *)gHistESDIdYPtProtons->ProjectionX("gYESDIdProtons",0,gHistESDIdYPtProtons->GetXaxis()->GetNbins(),"e");
1478 TH1D *gYESDInitProtons = (TH1D *)gHistESDInitYPtProtons->ProjectionX("gYESDInitProtons",0,gHistESDInitYPtProtons->GetXaxis()->GetNbins(),"e");
1479 gYESDIdProtons->Divide(gYESDInitProtons);
1480 SetError(gYESDIdProtons,gYESDInitProtons);
1481 gYESDIdProtons->Scale(100.);
1482 gYESDIdProtons->SetMarkerStyle(kFullCircle);
1483
1484 //protons pid contamination
1485 TH1D *gYESDContamProtons = (TH1D *)gHistESDContamYPtProtons->ProjectionX("gYESDContamProtons",0,gHistESDContamYPtProtons->GetXaxis()->GetNbins(),"e");
1486 TH1D *gYESDRecIdProtons = (TH1D *)gHistESDRecIdYPtProtons->ProjectionX("gYESDRecIdProtons",0,gHistESDRecIdYPtProtons->GetXaxis()->GetNbins(),"e");
1487 gYESDContamProtons->Divide(gYESDRecIdProtons);
1488 SetError(gYESDContamProtons,gYESDRecIdProtons);
1489 gYESDContamProtons->Scale(100.);
1490 gYESDContamProtons->SetMarkerStyle(kOpenCircle);
1491
1492 c16->cd(1)->SetBottomMargin(0.15);
1493 c16->cd(1)->SetLeftMargin(0.15);
1494 c16->cd(1)->SetGridx(); c16->cd(1)->SetGridy();
1495 hEmpty->GetXaxis()->SetRangeUser(-1.0.,1.0);
e13bbda6 1496 hEmpty->GetXaxis()->SetTitle(gYESDContamProtons->GetXaxis()->GetTitle());
863f782b 1497 hEmpty->DrawCopy();
1498 gYESDIdProtons->DrawCopy("ESAME");
1499 gYESDContamProtons->DrawCopy("ESAME");
1500
1501 //pT dependence
1502 //protons pid efficiency
1503 TH1D *gPtESDIdProtons = (TH1D *)gHistESDIdYPtProtons->ProjectionY("gPtESDIdProtons",0,gHistESDIdYPtProtons->GetYaxis()->GetNbins(),"e");
1504 TH1D *gPtESDInitProtons = (TH1D *)gHistESDInitYPtProtons->ProjectionY("gPtESDInitProtons",0,gHistESDInitYPtProtons->GetYaxis()->GetNbins(),"e");
1505 gPtESDIdProtons->Divide(gPtESDInitProtons);
1506 SetError(gPtESDIdProtons,gPtESDInitProtons);
1507 gPtESDIdProtons->Scale(100.);
1508 gPtESDIdProtons->SetMarkerStyle(kFullCircle);
1509
1510 //protons pid contamination
1511 TH1D *gPtESDContamProtons = (TH1D *)gHistESDContamYPtProtons->ProjectionY("gPtESDContamProtons",0,gHistESDContamYPtProtons->GetYaxis()->GetNbins(),"e");
1512 TH1D *gPtESDRecIdProtons = (TH1D *)gHistESDRecIdYPtProtons->ProjectionY("gPtESDRecIdProtons",0,gHistESDRecIdYPtProtons->GetYaxis()->GetNbins(),"e");
1513 gPtESDContamProtons->Divide(gPtESDRecIdProtons);
1514 SetError(gPtESDContamProtons,gPtESDRecIdProtons);
1515 gPtESDContamProtons->Scale(100.);
1516 gPtESDContamProtons->SetMarkerStyle(kOpenCircle);
1517
1518 c16->cd(2)->SetBottomMargin(0.15);
1519 c16->cd(2)->SetLeftMargin(0.15);
1520 c16->cd(2)->SetGridx(); c16->cd(2)->SetGridy();
1521 hEmpty->GetXaxis()->SetRangeUser(0.0,1.2);
2b00fd2c 1522 hEmpty->GetXaxis()->SetTitle("P_{T} [GeV/c]");
863f782b 1523 hEmpty->DrawCopy();
1524 gPtESDIdProtons->DrawCopy("ESAME");
1525 gPtESDContamProtons->DrawCopy("ESAME");
2b00fd2c 1526
1527 c16->SaveAs("PIDEfficiency-Protons.gif");
5b44449f 1528
9e2392b0 1529 TString outputFileName = "Reconstruction-PID-Efficiency.";
1530 outputFileName += analysisType; outputFileName += ".root";
1531 TFile *fout = TFile::Open(outputFileName.Data(),"recreate");
5b44449f 1532 gYPrimariesESDProtons->Write();
1533 gYESDProtonsFromWeak->Write();
1534 gYESDProtonsFromHadronic->Write();
1535 gPtPrimariesESDProtons->Write();
1536 gPtESDProtonsFromWeak->Write();
1537 gPtESDProtonsFromHadronic->Write();
1538 gYPrimariesESDAntiProtons->Write();
1539 gYESDAntiProtonsFromWeak->Write();
1540 gYESDAntiProtonsFromHadronic->Write();
1541 gPtPrimariesESDAntiProtons->Write();
1542 gPtESDAntiProtonsFromWeak->Write();
1543 gPtESDAntiProtonsFromHadronic->Write();
1544 gYESDIdProtons->Write();
1545 gYESDContamProtons->Write();
1546 gPtESDIdProtons->Write();
1547 gPtESDContamProtons->Write();
1548 fout->Close();
863f782b 1549}
1550
cc0fbd97 1551//________________________________________________//
0008a5a6 1552void DrawMarker(Double_t x, Double_t y, Int_t style,
1553 Double_t size, Int_t color) {
cc0fbd97 1554 TMarker *m = new TMarker(x,y,style);
1555 m->SetMarkerSize(size);
1556 m->SetMarkerColor(color);
1557 m->Draw();
1558}
0008a5a6 1559
5b8133c7 1560//________________________________________________//
1c21299a 1561const char * const gMCProcessName[45] = {
5b8133c7 1562 "Primary particle emission",
1563 "Multiple scattering",
1564 "Energy loss",
1565 "Bending in magnetic field",
1566 "Decay",
1567 "Lepton pair production",
1568 "Compton scattering",
1569 "Photoelectric effect",
1570 "Bremstrahlung",
1571 "Delta ray",
1572 "Positron annihilation",
1573 "Positron annihilation at rest",
1574 "Positron annihilation in flight",
1575 "Hadronic interaction",
1576 "Nuclear evaporation",
1577 "Nuclear fission",
1578 "Nuclear absorbtion",
1579 "Antiproton annihilation",
1580 "Antineutron annihilation",
1581 "Neutron capture",
1582 "Hadronic elastic",
1583 "Hadronic incoherent elastic",
1584 "Hadronic coherent elastic",
1585 "Hadronic inelastic",
1586 "Photon inelastic",
1587 "Muon nuclear interaction",
1588 "Electron nuclear interaction",
1589 "Positron nuclear interaction",
1590 "Time of flight limit",
1591 "Nuclear photofission",
1592 "Rayleigh effect",
1593 "No active process",
1594 "Energy threshold",
1595 "Light absorption",
1596 "Light detection",
1597 "Light scattering",
1598 "Maximum allowed step",
1599 "Cerenkov production",
1600 "Cerenkov feed back photon",
1601 "Cerenkov photon reflection",
1602 "Cerenkov photon refraction",
1603 "Synchrotron radiation",
1604 "Scintillation",
1605 "Transportation",
1606 "Unknown process"
1c21299a 1607};