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