1 void drawProtonQAResults(const char* filename1 = "Protons.QA.root",
2 const char* filename2 = "Protons.MC.QA.root",
3 const char* filename3 = "Protons.Efficiency.root") {
4 //Macro to visualize the results of the proton QA task
6 gStyle->SetPalette(1,0);
8 TFile *fQA = TFile::Open(filename1);
9 TList *listGlobalQA = (TList *)fQA->Get("globalQAList");
10 drawCutStatistics(listGlobalQA);
12 TFile *fMC = TFile::Open(filename2);
13 TList *listPDG = (TList *)fMC->Get("pdgCodeList");
14 TList *listMCProcesses = (TList *)fMC->Get("mcProcessList");
15 drawMCQA(listPDG,listMCProcesses);
17 TFile *fEfficiency = TFile::Open(filename3);
18 TList *listEfficiency = (TList *)fEfficiency->Get("efficiencyList");
19 drawEfficiency(listEfficiency);
26 //________________________________________//
27 void drawCutStatistics(TList *list) {
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;
33 Double_t gEntriesQA2DList[12] = {0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.};
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];
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;
50 TList *fQA2DList = (TList *)list->At(0);
51 GetQAEntries(fQA2DList,gEntriesQA2DList);
52 TH3F *gHistYPtPDGProtonsPass = (TH3F *)fQA2DList->At(10);
53 TH3F *gHistYPtPDGAntiProtonsPass = (TH3F *)fQA2DList->At(11);
55 TList *fQAPrimaryProtonsAcceptedList = (TList *)list->At(1);
56 GetQAEntries(fQAPrimaryProtonsAcceptedList,gEntriesQAPrimaryProtonsAcceptedList);
58 TList *fQAPrimaryProtonsRejectedList = (TList *)list->At(2);
59 GetQAEntries(fQAPrimaryProtonsRejectedList,gEntriesQAPrimaryProtonsRejectedList);
61 TList *fQASecondaryProtonsAcceptedList = (TList *)list->At(3);
62 GetQAEntries(fQASecondaryProtonsAcceptedList,gEntriesQASecondaryProtonsAcceptedList);
64 TList *fQASecondaryProtonsRejectedList = (TList *)list->At(4);
65 GetQAEntries(fQASecondaryProtonsRejectedList,gEntriesQASecondaryProtonsRejectedList);
67 TList *fQAPrimaryAntiProtonsAcceptedList = (TList *)list->At(5);
68 GetQAEntries(fQAPrimaryAntiProtonsAcceptedList,gEntriesQAPrimaryAntiProtonsAcceptedList);
70 TList *fQAPrimaryAntiProtonsRejectedList = (TList *)list->At(6);
71 GetQAEntries(fQAPrimaryAntiProtonsRejectedList,gEntriesQAPrimaryAntiProtonsRejectedList);
73 TList *fQASecondaryAntiProtonsAcceptedList = (TList *)list->At(7);
74 GetQAEntries(fQASecondaryAntiProtonsAcceptedList,gEntriesQASecondaryAntiProtonsAcceptedList);
76 TList *fQASecondaryAntiProtonsRejectedList = (TList *)list->At(8);
77 GetQAEntries(fQASecondaryAntiProtonsRejectedList,gEntriesQASecondaryAntiProtonsRejectedList);
79 //_______________________________________________________//
80 //Create the histograms
82 char *fCutName[nx] = {"Tracks","",
84 "#chi^{2}/N_{ITS-Clusters}",
86 "#chi^{2}/N_{TPC-Clusters}",
93 "#sigma_{Vertex-TPC}",
103 "N_{Secondaries}/N_{total}","",""};
104 char *fCutITSName[6] = {"SPD_{1}","SPD_{2}",
106 "SSD_{1}","SSD_{2}"};
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);
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]);
130 hPrimaryProtons->GetXaxis()->SetLabelOffset(0.01);
131 hPrimaryProtons->GetXaxis()->SetLabelSize(0.045);
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]);
145 hSecondaryProtons->GetXaxis()->SetLabelOffset(0.01);
146 hSecondaryProtons->GetXaxis()->SetLabelSize(0.045);
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]);
159 hPrimaryAntiProtons->GetXaxis()->SetLabelOffset(0.01);
160 hPrimaryAntiProtons->GetXaxis()->SetLabelSize(0.045);
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]);
174 hSecondaryAntiProtons->GetXaxis()->SetLabelOffset(0.01);
175 hSecondaryAntiProtons->GetXaxis()->SetLabelSize(0.045);
176 //_______________________________________________________//
178 //1D for primary protons
179 //cout<<"_____________________________________________________"<<endl;
180 //cout<<"_______________PRIMARY PROTONS_______________________"<<endl;
181 hPrimaryProtons->SetBinContent(1,GetPercentage(gEntriesQA2DList[0],gEntriesQA2DList[1]));
183 for(Int_t i = 2; i < NQAHISTOSPERLIST-4; i++)
184 hPrimaryProtons->SetBinContent(i+1,GetPercentage(gEntriesQAPrimaryProtonsAcceptedList[i-2],
185 gEntriesQAPrimaryProtonsRejectedList[i-2]));
187 //1D for secondary protons
188 //cout<<"_____________________________________________________"<<endl;
189 //cout<<"_______________SECONDARY PROTONS_____________________"<<endl;
190 hSecondaryProtons->SetBinContent(1,GetPercentage(gEntriesQA2DList[2],gEntriesQA2DList[3]));
192 for(Int_t i = 2; i < NQAHISTOSPERLIST-4; i++)
193 hSecondaryProtons->SetBinContent(i+1,GetPercentage(gEntriesQASecondaryProtonsAcceptedList[i-2],
194 gEntriesQASecondaryProtonsRejectedList[i-2]));
195 hSecondaryProtons->SetBinContent(24,GetPercentage(gEntriesQA2DList[0],gEntriesQA2DList[2]));
197 //1D for primary antiprotons
198 //cout<<"_________________________________________________________"<<endl;
199 //cout<<"_______________PRIMARY ANTIPROTONS_______________________"<<endl;
200 hPrimaryAntiProtons->SetBinContent(1,GetPercentage(gEntriesQA2DList[4],gEntriesQA2DList[5]));
202 for(Int_t i = 2; i < NQAHISTOSPERLIST-4; i++)
203 hPrimaryAntiProtons->SetBinContent(i+1,GetPercentage(gEntriesQAPrimaryAntiProtonsAcceptedList[i-2],
204 gEntriesQAPrimaryAntiProtonsRejectedList[i-2]));
206 //1D for secondary antiprotons
207 //cout<<"_________________________________________________________"<<endl;
208 //cout<<"_______________SECONDARY ANTIPROTONS_____________________"<<endl;
209 hSecondaryAntiProtons->SetBinContent(1,GetPercentage(gEntriesQA2DList[6],gEntriesQA2DList[7]));
211 for(Int_t i = 2; i < NQAHISTOSPERLIST-4; i++)
212 hSecondaryAntiProtons->SetBinContent(i+1,GetPercentage(gEntriesQASecondaryAntiProtonsAcceptedList[i-2],
213 gEntriesQASecondaryAntiProtonsRejectedList[i-2]));
214 hSecondaryAntiProtons->SetBinContent(24,GetPercentage(gEntriesQA2DList[4],gEntriesQA2DList[6]));
216 TLatex *t1 = new TLatex();
217 t1->SetTextSize(0.04);
218 //_________________________________________________________//
219 TCanvas *c1 = new TCanvas("c1","Cut Influence - Protons",0,0,700,400);
220 c1->SetFillColor(10); c1->GetFrame()->SetFillColor(10);
221 c1->SetHighLightColor(10); c1->SetBottomMargin(0.15);
222 c1->SetGridx(); c1->SetGridy();
224 for(Int_t i = 1; i <= nx; i++) {
225 hPrimaryProtons->SetBinError(i,1.0);
226 hSecondaryProtons->SetBinError(i,1.0);
229 hPrimaryProtons->DrawCopy("EHISTSAME");
230 hSecondaryProtons->DrawCopy("EHISTSAME");
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");
236 c1->SaveAs("CutInfluence-Protons.gif");
238 //_________________________________________________________//
239 TCanvas *c2 = new TCanvas("c2","Cut Influence - AntiProtons",50,50,700,400);
240 c2->SetFillColor(10); c2->GetFrame()->SetFillColor(10);
241 c2->SetHighLightColor(10); c2->SetBottomMargin(0.15);
242 c2->SetGridx(); c2->SetGridy();
244 for(Int_t i = 1; i <= nx; i++) {
245 hPrimaryAntiProtons->SetBinError(i,1.0);
246 hSecondaryAntiProtons->SetBinError(i,1.0);
249 hPrimaryAntiProtons->DrawCopy("EHISTSAME");
250 hSecondaryAntiProtons->DrawCopy("EHISTSAME");
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}");
256 c2->SaveAs("CutInfluence-AntiProtons.gif");
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);
271 //_________________________________________________________//
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]);
283 hPrimaryProtonsITS->GetXaxis()->SetLabelOffset(0.01);
284 hPrimaryProtonsITS->GetXaxis()->SetLabelSize(0.045);
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]);
298 hSecondaryProtonsITS->GetXaxis()->SetLabelOffset(0.01);
299 hSecondaryProtonsITS->GetXaxis()->SetLabelSize(0.045);
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]);
312 hPrimaryAntiProtonsITS->GetXaxis()->SetLabelOffset(0.01);
313 hPrimaryAntiProtonsITS->GetXaxis()->SetLabelSize(0.045);
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]);
327 hSecondaryAntiProtonsITS->GetXaxis()->SetLabelOffset(0.01);
328 hSecondaryAntiProtonsITS->GetXaxis()->SetLabelSize(0.045);
330 //_______________________________________________________//
331 TCanvas *c9 = new TCanvas("c9","ITS cluster map - (anti)protons",
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);
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();
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]));
353 hPrimaryProtonsITS->DrawCopy("EHISTSAME");
354 hSecondaryProtonsITS->DrawCopy("EHISTSAME");
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");
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]));
371 hPrimaryAntiProtonsITS->DrawCopy("EHISTSAME");
372 hSecondaryAntiProtonsITS->DrawCopy("EHISTSAME");
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}");
378 c9->SaveAs("CutInfluence-ITS.gif");
380 //Efficiency - Contamination plots
381 DrawContamination(fQA2DList);
382 DrawCutEfficiency(fQA2DList);
383 DrawComposition(gHistYPtPDGProtonsPass,gHistYPtPDGAntiProtonsPass);
386 //________________________________________//
387 void 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;
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,
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);
417 gParticleProtonPt[iParticle] = new TGraph(gHistYPtPDGProtons->GetNbinsY(),
418 gPt,nParticleCompositionProtonPt);
419 gParticleProtonPt[iParticle]->SetMarkerStyle(iParticle+20);
420 gParticleProtonPt[iParticle]->SetMarkerSize(1.2);
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);
431 gParticleAntiProtonPt[iParticle] = new TGraph(gHistYPtPDGAntiProtons->GetNbinsY(),
432 gPt,nParticleCompositionAntiProtonPt);
433 gParticleAntiProtonPt[iParticle]->SetMarkerStyle(iParticle+20);
434 gParticleAntiProtonPt[iParticle]->SetMarkerSize(1.2);
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);
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");
449 TCanvas *c12 = new TCanvas("c12",
450 "Composition of accepted secondaries vs y",
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();
456 for(Int_t iParticle = 0; iParticle < 10; iParticle++) {
457 //if((iParticle == 0)||(iParticle == 2)||(iParticle == 5)||(iParticle == 6)||(iParticle == 8))
458 if((iParticle == 0)||(iParticle == 2)||(iParticle == 6)||(iParticle == 8))
459 gParticleProtonY[iParticle]->Draw("P");
461 DrawMarker(-1.1, 115-5*iParticle, 20+iParticle, 1.2, 1);
462 t1->DrawLatex(-1.0,113-5*iParticle,fParticleName[iParticle]);
465 DrawMarker(0.2, 115-5*(iParticle-5), 20+iParticle, 1.2, 1);
466 t1->DrawLatex(0.3,113-5*(iParticle-5),fParticleName[iParticle]);
470 c12->SetHighLightColor(10); c12->cd(2)->SetBottomMargin(0.15);
471 c12->cd(2)->SetGridx(); c12->cd(2)->SetGridy();
473 for(Int_t iParticle = 0; iParticle < 10; iParticle++) {
474 if((iParticle == 0)||(iParticle == 6)||(iParticle == 8))
475 gParticleAntiProtonY[iParticle]->Draw("P");
477 DrawMarker(-1.1, 115-5*iParticle, 20+iParticle, 1.2, 1);
478 t1->DrawLatex(-1.0,113-5*iParticle,fParticleName[iParticle]);
481 DrawMarker(0.2, 115-5*(iParticle-5), 20+iParticle, 1.2, 1);
482 t1->DrawLatex(0.3,113-5*(iParticle-5),fParticleName[iParticle]);
485 c12->SaveAs("SurvivedSecondaries-Composition-Rapidity.gif");
487 TH2F *hEmptyPt = new TH2F("hEmptyPt","",100,0.0,4.0,100,0,120);
488 hEmptyPt->SetStats(kFALSE);
489 hEmptyPt->GetYaxis()->SetTitle("Particle composition [%]");
490 hEmptyPt->GetXaxis()->SetTitle("P_{T} [GeV/c]");
492 TCanvas *c13 = new TCanvas("c13",
493 "Composition of accepted secondaries vs pT",
495 c13->SetFillColor(10); c13->GetFrame()->SetFillColor(10); c13->Divide(2,1);
496 c13->SetHighLightColor(10); c13->cd(1)->SetBottomMargin(0.15);
497 c13->cd(1)->SetGridx(); c13->cd(1)->SetGridy();
498 hEmptyPt->DrawCopy();
499 for(Int_t iParticle = 0; iParticle < 10; iParticle++) {
501 DrawMarker(0.2, 115-5*iParticle, 20+iParticle, 1.2, 1);
502 t1->DrawLatex(0.3,113-5*iParticle,fParticleName[iParticle]);
505 DrawMarker(2.2, 115-5*(iParticle-5), 20+iParticle, 1.2, 1);
506 t1->DrawLatex(2.3,113-5*(iParticle-5),fParticleName[iParticle]);
508 if((iParticle == 0)||(iParticle == 2)||(iParticle == 6)||(iParticle == 8))
509 gParticleProtonPt[iParticle]->Draw("P");
512 c13->SetHighLightColor(10); c13->cd(2)->SetBottomMargin(0.15);
513 c13->cd(2)->SetGridx(); c13->cd(2)->SetGridy();
514 hEmptyPt->DrawCopy();
515 for(Int_t iParticle = 0; iParticle < 10; iParticle++) {
517 DrawMarker(0.2, 115-5*iParticle, 20+iParticle, 1.2, 1);
518 t1->DrawLatex(0.3,113-5*iParticle,fParticleName[iParticle]);
521 DrawMarker(2.2, 115-5*(iParticle-5), 20+iParticle, 1.2, 1);
522 t1->DrawLatex(2.3,113-5*(iParticle-5),fParticleName[iParticle]);
524 if((iParticle == 0)||(iParticle == 6)||(iParticle == 8))
525 gParticleAntiProtonPt[iParticle]->Draw("P");
527 c13->SaveAs("SurvivedSecondaries-Composition-Pt.gif");
530 //________________________________________________//
531 void DrawContamination(TList *inputList) {
532 //loops over the list entries and
533 //draws the rapidity and pT dependence
534 //of the percentage of primary and secondary
535 //protons and antiprotons after the track cuts
536 cout<<"Extracting the entries for the histograms in the list: "<<
537 inputList->GetName()<<"..."<<endl;
539 TLatex *t1 = new TLatex();
540 t1->SetTextSize(0.04);
542 TH2F *hPrimaryProtons = (TH2F *)inputList->At(0);
543 TH2F *hSecondaryProtons = (TH2F *)inputList->At(2);
544 TH2F *hPrimaryAntiProtons = (TH2F *)inputList->At(4);
545 TH2F *hSecondaryAntiProtons = (TH2F *)inputList->At(6);
547 //rapidity dependence
549 TH1D *gYPrimaryProtons = (TH1D *)hPrimaryProtons->ProjectionX("gYPrimaryProtons",0,hPrimaryProtons->GetXaxis()->GetNbins(),"e");
550 TH1D *gYSecondaryProtons = (TH1D *)hSecondaryProtons->ProjectionX("gYSecondaryProtons",0,hSecondaryProtons->GetXaxis()->GetNbins(),"e");
551 TH1D *gYTotalProtons = (TH1D *)hPrimaryProtons->ProjectionX("gYTotalProtons",0,hPrimaryProtons->GetXaxis()->GetNbins(),"e");
552 gYTotalProtons->Add(gYSecondaryProtons);
554 TH1D *gYPrimaryProtonsPercentage = new TH1D("gYPrimaryProtonsPercentage",
556 hPrimaryProtons->GetXaxis()->GetNbins(),
557 hPrimaryProtons->GetXaxis()->GetXmin(),
558 hPrimaryProtons->GetXaxis()->GetXmax());
559 gYPrimaryProtonsPercentage->Divide(gYPrimaryProtons,
560 gYTotalProtons,1.,1.0);
561 SetError(gYPrimaryProtonsPercentage,gYTotalProtons);
562 gYPrimaryProtonsPercentage->Scale(100.);
563 gYPrimaryProtonsPercentage->SetMarkerStyle(kFullCircle);
565 TH1D *gYSecondaryProtonsPercentage = new TH1D("gYSecondaryProtonsPercentage",
567 hSecondaryProtons->GetXaxis()->GetNbins(),
568 hSecondaryProtons->GetXaxis()->GetXmin(),
569 hSecondaryProtons->GetXaxis()->GetXmax());
570 gYSecondaryProtonsPercentage->Divide(gYSecondaryProtons,
571 gYTotalProtons,1.,1.0);
572 SetError(gYSecondaryProtonsPercentage,gYTotalProtons);
573 gYSecondaryProtonsPercentage->Scale(100.);
574 gYSecondaryProtonsPercentage->SetMarkerStyle(kOpenCircle);
577 TH1D *gYPrimaryAntiProtons = (TH1D *)hPrimaryAntiProtons->ProjectionX("gYPrimaryAntiProtons",0,hPrimaryAntiProtons->GetXaxis()->GetNbins(),"e");
578 TH1D *gYSecondaryAntiProtons = (TH1D *)hSecondaryAntiProtons->ProjectionX("gYSecondaryAntiProtons",0,hSecondaryAntiProtons->GetXaxis()->GetNbins(),"e");
579 TH1D *gYTotalAntiProtons = (TH1D *)hPrimaryAntiProtons->ProjectionX("gYTotalAntiProtons",0,hPrimaryAntiProtons->GetXaxis()->GetNbins(),"e");
580 gYTotalAntiProtons->Add(gYSecondaryAntiProtons);
582 TH1D *gYPrimaryAntiProtonsPercentage = new TH1D("gYPrimaryAntiProtonsPercentage",
584 hPrimaryAntiProtons->GetXaxis()->GetNbins(),
585 hPrimaryAntiProtons->GetXaxis()->GetXmin(),
586 hPrimaryAntiProtons->GetXaxis()->GetXmax());
587 gYPrimaryAntiProtonsPercentage->Divide(gYPrimaryAntiProtons,
588 gYTotalAntiProtons,1.,1.0);
589 SetError(gYPrimaryAntiProtonsPercentage,gYTotalAntiProtons);
590 gYPrimaryAntiProtonsPercentage->Scale(100.);
591 gYPrimaryAntiProtonsPercentage->SetMarkerStyle(kFullCircle);
593 TH1D *gYSecondaryAntiProtonsPercentage = new TH1D("gYSecondaryAntiProtonsPercentage",
595 hSecondaryAntiProtons->GetXaxis()->GetNbins(),
596 hSecondaryAntiProtons->GetXaxis()->GetXmin(),
597 hSecondaryAntiProtons->GetXaxis()->GetXmax());
598 gYSecondaryAntiProtonsPercentage->Divide(gYSecondaryAntiProtons,
599 gYTotalAntiProtons,1.,1.0);
600 SetError(gYSecondaryAntiProtonsPercentage,gYTotalAntiProtons);
601 gYSecondaryAntiProtonsPercentage->Scale(100.);
602 gYSecondaryAntiProtonsPercentage->SetMarkerStyle(kOpenCircle);
605 TH2F *hEmptyY = new TH2F("hEmptyCompositionY","",
606 100,-1.2,1.2,100,-10.0,130);
607 hEmptyY->SetStats(kFALSE);
608 hEmptyY->GetYaxis()->SetTitle("Particle composition [%]");
609 hEmptyY->GetYaxis()->SetTitleOffset(1.3);
610 hEmptyY->GetXaxis()->SetTitle("y");
612 TCanvas *c7 = new TCanvas("c7","(Anti)Proton contamination vs y",
614 c7->SetFillColor(10); c7->GetFrame()->SetFillColor(10);
615 c7->SetHighLightColor(10); c7->Divide(2,1);
617 c7->cd(1)->SetBottomMargin(0.15);
618 c7->cd(1)->SetLeftMargin(0.15);
619 c7->cd(1)->SetGridx(); c7->cd(1)->SetGridy();
620 hEmptyY->SetTitle("Protons");
622 gYPrimaryProtonsPercentage->DrawCopy("ESAME");
623 gYSecondaryProtonsPercentage->DrawCopy("ESAME");
625 DrawMarker(0, 55, kFullCircle, 1.2, 1);
626 t1->DrawLatex(0.1,53,"Primaries");
627 DrawMarker(0, 45, kOpenCircle, 1.2, 1);
628 t1->DrawLatex(0.1,43,"Secondaries");
630 c7->cd(2)->SetBottomMargin(0.15);
631 c7->cd(2)->SetLeftMargin(0.15);
632 c7->cd(2)->SetGridx(); c7->cd(2)->SetGridy();
633 hEmptyY->SetTitle("Antiprotons");
635 gYPrimaryAntiProtonsPercentage->DrawCopy("ESAME");
636 gYSecondaryAntiProtonsPercentage->DrawCopy("ESAME");
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");
643 c7->SaveAs("Contamination-Protons-Rapidity.gif");
647 TH1D *gPtPrimaryProtons = (TH1D *)hPrimaryProtons->ProjectionY("gPtPrimaryProtons",0,hPrimaryProtons->GetYaxis()->GetNbins(),"e");
648 TH1D *gPtSecondaryProtons = (TH1D *)hSecondaryProtons->ProjectionY("gPtSecondaryProtons",0,hSecondaryProtons->GetYaxis()->GetNbins(),"e");
649 TH1D *gPtTotalProtons = (TH1D *)hPrimaryProtons->ProjectionY("gPtTotalProtons",0,hPrimaryProtons->GetYaxis()->GetNbins(),"e");
650 gPtTotalProtons->Add(gPtSecondaryProtons);
652 TH1D *gPtPrimaryProtonsPercentage = new TH1D("gPtPrimaryProtonsPercentage",
654 hPrimaryProtons->GetYaxis()->GetNbins(),
655 hPrimaryProtons->GetYaxis()->GetXmin(),
656 hPrimaryProtons->GetYaxis()->GetXmax());
657 gPtPrimaryProtonsPercentage->Divide(gPtPrimaryProtons,
658 gPtTotalProtons,1.,1.0);
659 SetError(gPtPrimaryProtonsPercentage,gPtTotalProtons);
660 gPtPrimaryProtonsPercentage->Scale(100.);
661 gPtPrimaryProtonsPercentage->SetMarkerStyle(kFullCircle);
663 TH1D *gPtSecondaryProtonsPercentage = new TH1D("gPtSecondaryProtonsPercentage",
665 hSecondaryProtons->GetYaxis()->GetNbins(),
666 hSecondaryProtons->GetYaxis()->GetXmin(),
667 hSecondaryProtons->GetYaxis()->GetXmax());
668 gPtSecondaryProtonsPercentage->Divide(gPtSecondaryProtons,
669 gPtTotalProtons,1.,1.0);
670 SetError(gPtSecondaryProtonsPercentage,gPtTotalProtons);
671 gPtSecondaryProtonsPercentage->Scale(100.);
672 gPtSecondaryProtonsPercentage->SetMarkerStyle(kOpenCircle);
676 TH1D *gPtPrimaryAntiProtons = (TH1D *)hPrimaryAntiProtons->ProjectionY("gPtPrimaryAntiProtons",0,hPrimaryAntiProtons->GetYaxis()->GetNbins(),"e");
677 TH1D *gPtSecondaryAntiProtons = (TH1D *)hSecondaryAntiProtons->ProjectionY("gPtSecondaryAntiProtons",0,hSecondaryAntiProtons->GetYaxis()->GetNbins(),"e");
678 TH1D *gPtTotalAntiProtons = (TH1D *)hPrimaryAntiProtons->ProjectionY("gPtTotalAntiProtons",0,hPrimaryAntiProtons->GetYaxis()->GetNbins(),"e");
679 gPtTotalAntiProtons->Add(gPtSecondaryAntiProtons);
681 TH1D *gPtPrimaryAntiProtonsPercentage = new TH1D("gPtPrimaryAntiProtonsPercentage",
683 hPrimaryAntiProtons->GetYaxis()->GetNbins(),
684 hPrimaryAntiProtons->GetYaxis()->GetXmin(),
685 hPrimaryAntiProtons->GetYaxis()->GetXmax());
686 gPtPrimaryAntiProtonsPercentage->Divide(gPtPrimaryAntiProtons,
687 gPtTotalAntiProtons,1.,1.0);
688 SetError(gPtPrimaryAntiProtonsPercentage,gPtTotalAntiProtons);
689 gPtPrimaryAntiProtonsPercentage->Scale(100.);
690 gPtPrimaryAntiProtonsPercentage->SetMarkerStyle(kFullCircle);
692 TH1D *gPtSecondaryAntiProtonsPercentage = new TH1D("gPtSecondaryAntiProtonsPercentage",
694 hSecondaryAntiProtons->GetYaxis()->GetNbins(),
695 hSecondaryAntiProtons->GetYaxis()->GetXmin(),
696 hSecondaryAntiProtons->GetYaxis()->GetXmax());
697 gPtSecondaryAntiProtonsPercentage->Divide(gPtSecondaryAntiProtons,
698 gPtTotalAntiProtons,1.,1.0);
699 SetError(gPtSecondaryAntiProtonsPercentage,gPtTotalAntiProtons);
700 gPtSecondaryAntiProtonsPercentage->Scale(100.);
701 gPtSecondaryAntiProtonsPercentage->SetMarkerStyle(kOpenCircle);
703 TH2F *hEmptyPt = new TH2F("hEmptyCompositionPt","",
704 100,0.0,4.0,100,-10.0,130);
705 hEmptyPt->SetStats(kFALSE);
706 hEmptyPt->GetYaxis()->SetTitle("Particle composition [%]");
707 hEmptyPt->GetYaxis()->SetTitleOffset(1.3);
708 hEmptyPt->GetXaxis()->SetTitle("P_{T} [GeV/c]");
710 TCanvas *c8 = new TCanvas("c8","(Anti)Proton comtamination vs pT",
712 c8->SetFillColor(10); c8->GetFrame()->SetFillColor(10);
713 c8->SetHighLightColor(10); c8->Divide(2,1);
715 c8->cd(1)->SetBottomMargin(0.15);
716 c8->cd(1)->SetLeftMargin(0.15);
717 c8->cd(1)->SetGridx(); c8->cd(1)->SetGridy();
718 hEmptyPt->SetTitle("Protons");
719 hEmptyPt->DrawCopy();
720 gPtPrimaryProtonsPercentage->DrawCopy("ESAME");
721 gPtSecondaryProtonsPercentage->DrawCopy("ESAME");
723 DrawMarker(2.0, 55, kFullCircle, 1.2, 1);
724 t1->DrawLatex(2.1,53,"Primaries");
725 DrawMarker(2.0, 45, kOpenCircle, 1.2, 1);
726 t1->DrawLatex(2.1,43,"Secondaries");
728 c8->cd(2)->SetBottomMargin(0.15);
729 c8->cd(2)->SetLeftMargin(0.15);
730 c8->cd(2)->SetGridx(); c8->cd(2)->SetGridy();
731 hEmptyPt->SetTitle("Antirotons");
732 hEmptyPt->DrawCopy();
733 gPtPrimaryAntiProtonsPercentage->DrawCopy("ESAME");
734 gPtSecondaryAntiProtonsPercentage->DrawCopy("ESAME");
736 DrawMarker(2.0, 55, kFullCircle, 1.2, 1);
737 t1->DrawLatex(2.1,53,"Primaries");
738 DrawMarker(2.0, 45, kOpenCircle, 1.2, 1);
739 t1->DrawLatex(2.1,43,"Secondaries");
741 c8->SaveAs("Contamination-Protons-Pt.gif");
743 TFile *fout = TFile::Open("Contamination.root","recreate");
744 gYPrimaryProtonsPercentage->Write();
745 gYSecondaryProtonsPercentage->Write();
746 gPtPrimaryProtonsPercentage->Write();
747 gPtSecondaryProtonsPercentage->Write();
748 gYPrimaryAntiProtonsPercentage->Write();
749 gYSecondaryAntiProtonsPercentage->Write();
750 gPtPrimaryAntiProtonsPercentage->Write();
751 gPtSecondaryAntiProtonsPercentage->Write();
755 //________________________________________________//
756 void DrawCutEfficiency(TList *inputList) {
757 //loops over the list entries and
758 //draws the rapidity and pT dependence
759 //of the percentage of primary and secondary
760 //protons and antiprotons after the track cuts
761 cout<<"Extracting the entries for the histograms in the list: "<<
762 inputList->GetName()<<"..."<<endl;
764 TLatex *t1 = new TLatex();
765 t1->SetTextSize(0.04);
767 TH2F *hPrimaryESDProtons = (TH2F *)inputList->At(0);
768 TH2F *hPrimaryESDAntiProtons = (TH2F *)inputList->At(4);
769 TH2F *hPrimaryMCProtons = (TH2F *)inputList->At(8);
770 TH2F *hPrimaryMCAntiProtons = (TH2F *)inputList->At(9);
772 //rapidity dependence
774 TH1D *gYPrimaryESDProtons = (TH1D *)hPrimaryESDProtons->ProjectionX("gYPrimaryESDProtons",0,hPrimaryESDProtons->GetXaxis()->GetNbins(),"e");
775 TH1D *gYPrimaryMCProtons = (TH1D *)hPrimaryMCProtons->ProjectionX("gYPrimaryMCProtons",0,hPrimaryMCProtons->GetXaxis()->GetNbins(),"e");
776 gYPrimaryESDProtons->Divide(gYPrimaryMCProtons);
777 SetError(gYPrimaryESDProtons,gYPrimaryMCProtons);
778 gYPrimaryESDProtons->Scale(100.);
779 gYPrimaryESDProtons->SetMarkerStyle(kFullCircle);
782 TH1D *gYPrimaryESDAntiProtons = (TH1D *)hPrimaryESDAntiProtons->ProjectionX("gYPrimaryESDAntiProtons",0,hPrimaryESDAntiProtons->GetXaxis()->GetNbins(),"e");
783 TH1D *gYPrimaryMCAntiProtons = (TH1D *)hPrimaryMCAntiProtons->ProjectionX("gYPrimaryMCAntiProtons",0,hPrimaryMCAntiProtons->GetXaxis()->GetNbins(),"e");
784 gYPrimaryESDAntiProtons->Divide(gYPrimaryMCAntiProtons);
785 SetError(gYPrimaryESDAntiProtons,gYPrimaryMCAntiProtons);
786 gYPrimaryESDAntiProtons->Scale(100.);
787 gYPrimaryESDAntiProtons->SetMarkerStyle(kFullCircle);
789 TH2F *hEmptyY = new TH2F("hEmptyEfficiencyY","",
790 100,-1.2,1.2,100,-10.0,130);
791 hEmptyY->SetStats(kFALSE);
792 hEmptyY->GetYaxis()->SetTitle("#epsilon [%]");
793 hEmptyY->GetYaxis()->SetTitleOffset(1.3);
794 hEmptyY->GetXaxis()->SetTitle("y");
796 TCanvas *c10 = new TCanvas("c10","(Anti)Proton cut efficiency vs y",
798 c10->SetFillColor(10); c10->GetFrame()->SetFillColor(10);
799 c10->SetHighLightColor(10); c10->Divide(2,1);
801 c10->cd(1)->SetBottomMargin(0.15);
802 c10->cd(1)->SetLeftMargin(0.15);
803 c10->cd(1)->SetGridx(); c10->cd(1)->SetGridy();
804 hEmptyY->SetTitle("Protons");
805 hEmptyY->GetXaxis()->SetRangeUser(gYPrimaryESDAntiProtons->GetXaxis()->GetXmin()-0.2,gYPrimaryESDAntiProtons->GetXaxis()->GetXmax()+0.2);
807 gYPrimaryESDProtons->DrawCopy("ESAME");
809 c10->cd(2)->SetBottomMargin(0.15);
810 c10->cd(2)->SetLeftMargin(0.15);
811 c10->cd(2)->SetGridx(); c10->cd(2)->SetGridy();
812 hEmptyY->SetTitle("Antiprotons");
814 gYPrimaryESDAntiProtons->DrawCopy("ESAME");
816 c10->SaveAs("CutEfficiency-Protons-Rapidity.gif");
820 TH1D *gPtPrimaryESDProtons = (TH1D *)hPrimaryESDProtons->ProjectionY("gPtPrimaryESDProtons",0,hPrimaryESDProtons->GetYaxis()->GetNbins(),"e");
821 TH1D *gPtPrimaryMCProtons = (TH1D *)hPrimaryMCProtons->ProjectionY("gPtPrimaryMCProtons",0,hPrimaryMCProtons->GetYaxis()->GetNbins(),"e");
822 gPtPrimaryESDProtons->Divide(gPtPrimaryMCProtons);
823 SetError(gPtPrimaryESDProtons,gPtPrimaryMCProtons);
824 gPtPrimaryESDProtons->Scale(100.);
825 gPtPrimaryESDProtons->SetMarkerStyle(kFullCircle);
828 TH1D *gPtPrimaryESDAntiProtons = (TH1D *)hPrimaryESDAntiProtons->ProjectionY("gPtPrimaryESDAntiProtons",0,hPrimaryESDAntiProtons->GetYaxis()->GetNbins(),"e");
829 TH1D *gPtPrimaryMCAntiProtons = (TH1D *)hPrimaryMCAntiProtons->ProjectionY("gPtPrimaryMCAntiProtons",0,hPrimaryMCAntiProtons->GetYaxis()->GetNbins(),"e");
830 gPtPrimaryESDAntiProtons->Divide(gPtPrimaryMCAntiProtons);
831 SetError(gPtPrimaryESDAntiProtons,gPtPrimaryMCAntiProtons);
832 gPtPrimaryESDAntiProtons->Scale(100.);
833 gPtPrimaryESDAntiProtons->SetMarkerStyle(kFullCircle);
835 TH2F *hEmptyPt = new TH2F("hEmptyEfficiencyPt","",
836 100,0.0,4.0,100,-10.0,130);
837 hEmptyPt->SetStats(kFALSE);
838 hEmptyPt->GetYaxis()->SetTitle("#epsilon [%]");
839 hEmptyPt->GetYaxis()->SetTitleOffset(1.3);
840 hEmptyPt->GetXaxis()->SetTitle("P_{T} [GeV/c]");
842 TCanvas *c11 = new TCanvas("c11","(Anti)Proton cut efficiency vs pT",
844 c11->SetFillColor(10); c11->GetFrame()->SetFillColor(10);
845 c11->SetHighLightColor(10); c11->Divide(2,1);
847 c11->cd(1)->SetBottomMargin(0.15);
848 c11->cd(1)->SetLeftMargin(0.15);
849 c11->cd(1)->SetGridx(); c11->cd(1)->SetGridy();
850 hEmptyPt->SetTitle("Protons");
851 hEmptyPt->GetXaxis()->SetRangeUser(gPtPrimaryESDAntiProtons->GetXaxis()->GetXmin()-0.2,gPtPrimaryESDAntiProtons->GetXaxis()->GetXmax()+0.2);
852 hEmptyPt->DrawCopy();
853 gPtPrimaryESDProtons->DrawCopy("ESAME");
855 c11->cd(2)->SetBottomMargin(0.15);
856 c11->cd(2)->SetLeftMargin(0.15);
857 c11->cd(2)->SetGridx(); c11->cd(2)->SetGridy();
858 hEmptyPt->SetTitle("Antirotons");
859 hEmptyPt->DrawCopy();
860 gPtPrimaryESDAntiProtons->DrawCopy("ESAME");
862 c11->SaveAs("CutEfficiency-Protons-Pt.gif");
864 TFile *fout = TFile::Open("CutEfficiency.root","recreate");
865 gYPrimaryESDProtons->Write();
866 gYPrimaryESDAntiProtons->Write();
867 gPtPrimaryESDProtons->Write();
868 gPtPrimaryESDAntiProtons->Write();
872 //________________________________________________//
873 void GetQAEntries(TList *inputList, Double_t *entries) {
874 //loops over the list entries
875 //extracts the entries for each histogram
876 //cout<<"Extracting the entries for the histograms in the list: "<<
877 //inputList->GetName()<<"..."<<endl;
879 for(Int_t i = 0; i < inputList->GetEntries(); i++) {
880 TH1F *gHist = (TH1F *)inputList->At(i);
881 entries[i] = gHist->GetEntries();
882 cout<<"Histogram: "<<gHist->GetName()<<
883 " - Entries: "<<entries[i]<<endl;
888 //________________________________________________//
889 Double_t GetPercentage(Double_t nPassEntries,
890 Double_t nRejectEntries) {
891 //returns the percentage of tracks that were rejected by a cut
892 Int_t nTotalEntries = nPassEntries + nRejectEntries;
894 if(nTotalEntries == 0)
897 return 100.*nRejectEntries/nTotalEntries;
900 //________________________________________//
901 void drawMCQA(TList *listPDG, TList *listMCProcesses) {
902 //Function to display the composition of secondary (anti)protons
903 //The histogram shows the percentage of secondary (anti)protons
904 //originating from each particle species.
905 //The box summarizes the MC process that gave these secondary (anti)protons
906 TDatabasePDG *db = TDatabasePDG::Instance();
907 TParticlePDG *p = 0x0;
909 TH3F *gHistYPtPDGProtons = (TH3F *)listPDG->At(0);
910 TH3F *gHistYPtPDGAntiProtons = (TH3F *)listPDG->At(1);
911 readProcesses(listMCProcesses);
912 Double_t nParticleCompositionProtonY[100], nParticleCompositionProtonPt[100];
913 Double_t nParticleCompositionAntiProtonY[100], nParticleCompositionAntiProtonPt[100];
914 Double_t gY[100], gPt[100];
915 for(Int_t iBins = 0; iBins < 100; iBins++) {
916 nParticleCompositionProtonY[iBins] = 0;
917 nParticleCompositionProtonPt[iBins] = 0;
918 nParticleCompositionAntiProtonY[iBins] = 0;
919 nParticleCompositionAntiProtonPt[iBins] = 0;
924 TGraph *gParticleProtonY[14];
925 TGraph *gParticleProtonPt[14];
926 TGraph *gParticleAntiProtonY[14];
927 TGraph *gParticleAntiProtonPt[14];
928 for(Int_t iParticle = 0; iParticle < 14; iParticle++) {
929 GetComposition(iParticle,
931 nParticleCompositionProtonY,
932 gY, nParticleCompositionProtonPt, gPt);
933 gParticleProtonY[iParticle] = new TGraph(gHistYPtPDGProtons->GetNbinsX(),
934 gY,nParticleCompositionProtonY);
935 gParticleProtonY[iParticle]->SetMarkerStyle(iParticle+20);
936 gParticleProtonY[iParticle]->SetMarkerSize(1.2);
938 gParticleProtonPt[iParticle] = new TGraph(gHistYPtPDGProtons->GetNbinsY(),
939 gPt,nParticleCompositionProtonPt);
940 gParticleProtonPt[iParticle]->SetMarkerStyle(iParticle+20);
941 gParticleProtonPt[iParticle]->SetMarkerSize(1.2);
943 GetComposition(iParticle,
944 gHistYPtPDGAntiProtons,
945 nParticleCompositionAntiProtonY,
946 gY, nParticleCompositionAntiProtonPt, gPt);
947 gParticleAntiProtonY[iParticle] = new TGraph(gHistYPtPDGAntiProtons->GetNbinsX(),
948 gY,nParticleCompositionAntiProtonY);
949 gParticleAntiProtonY[iParticle]->SetMarkerStyle(iParticle+20);
950 gParticleAntiProtonY[iParticle]->SetMarkerSize(1.2);
952 gParticleAntiProtonPt[iParticle] = new TGraph(gHistYPtPDGAntiProtons->GetNbinsY(),
953 gPt,nParticleCompositionAntiProtonPt);
954 gParticleAntiProtonPt[iParticle]->SetMarkerStyle(iParticle+20);
955 gParticleAntiProtonPt[iParticle]->SetMarkerSize(1.2);
958 //_________________________________________________________//
959 char *fParticleName[14] = {"Primary","K_{L}","#pi","K_{S}","K",
960 "n","p","#Sigma^{-}","#Lambda","#Sigma^{+}",
961 "#Xi^{-}","#Xi^{0}","#Omega^{-}"};
962 TLatex *t1 = new TLatex();
963 t1->SetTextSize(0.04);
965 TH2F *hEmptyY = new TH2F("hEmptyY","",100,-1.2,1.2,100,0,120);
966 hEmptyY->SetStats(kFALSE);
967 hEmptyY->GetYaxis()->SetTitle("Particle composition [%]");
968 hEmptyY->GetXaxis()->SetTitle("y");
970 TCanvas *c3 = new TCanvas("c3","MC secondary composition vs y - Protons",
972 c3->SetFillColor(10); c3->GetFrame()->SetFillColor(10);
973 c3->SetHighLightColor(10); c3->SetBottomMargin(0.15);
974 c3->SetGridx(); c3->SetGridy();
976 for(Int_t iParticle = 0; iParticle < 10; iParticle++) {
977 //if((iParticle == 0)||(iParticle == 2)||(iParticle == 5)||(iParticle == 6)||(iParticle == 8))
978 if((iParticle == 0)||(iParticle == 2)||(iParticle == 6)||(iParticle == 8))
979 gParticleProtonY[iParticle]->Draw("P");
981 DrawMarker(-1.1, 115-5*iParticle, 20+iParticle, 1.2, 1);
982 t1->DrawLatex(-1.0,113-5*iParticle,fParticleName[iParticle]);
985 DrawMarker(0.2, 115-5*(iParticle-5), 20+iParticle, 1.2, 1);
986 t1->DrawLatex(0.3,113-5*(iParticle-5),fParticleName[iParticle]);
990 TCanvas *c5 = new TCanvas("c5","MC secondary composition vs y - antiProtons",
992 c5->SetFillColor(10); c5->GetFrame()->SetFillColor(10);
993 c5->SetHighLightColor(10); c5->SetBottomMargin(0.15);
994 c5->SetGridx(); c5->SetGridy();
996 for(Int_t iParticle = 0; iParticle < 10; iParticle++) {
997 if((iParticle == 0)||(iParticle == 6)||(iParticle == 8))
998 gParticleAntiProtonY[iParticle]->Draw("P");
1000 DrawMarker(-1.1, 115-5*iParticle, 20+iParticle, 1.2, 1);
1001 t1->DrawLatex(-1.0,113-5*iParticle,fParticleName[iParticle]);
1004 DrawMarker(0.2, 115-5*(iParticle-5), 20+iParticle, 1.2, 1);
1005 t1->DrawLatex(0.3,113-5*(iParticle-5),fParticleName[iParticle]);
1009 TH2F *hEmptyPt = new TH2F("hEmptyPt","",100,0.0,4.0,100,0,120);
1010 hEmptyPt->SetStats(kFALSE);
1011 hEmptyPt->GetYaxis()->SetTitle("Particle composition [%]");
1012 hEmptyPt->GetXaxis()->SetTitle("P_{T} [GeV/c]");
1014 TCanvas *c4 = new TCanvas("c4","MC secondary composition vs pT - Protons",
1016 c4->SetFillColor(10); c4->GetFrame()->SetFillColor(10);
1017 c4->SetHighLightColor(10); c4->SetBottomMargin(0.15);
1018 c4->SetGridx(); c4->SetGridy();
1019 hEmptyPt->DrawCopy();
1020 for(Int_t iParticle = 0; iParticle < 10; iParticle++) {
1022 DrawMarker(0.2, 115-5*iParticle, 20+iParticle, 1.2, 1);
1023 t1->DrawLatex(0.3,113-5*iParticle,fParticleName[iParticle]);
1026 DrawMarker(2.2, 115-5*(iParticle-5), 20+iParticle, 1.2, 1);
1027 t1->DrawLatex(2.3,113-5*(iParticle-5),fParticleName[iParticle]);
1029 if((iParticle == 0)||(iParticle == 2)||(iParticle == 6)||(iParticle == 8))
1030 gParticleProtonPt[iParticle]->Draw("P");
1033 TCanvas *c6 = new TCanvas("c6",
1034 "MC secondary composition vs pT - AntiProtons",
1036 c6->SetFillColor(10); c6->GetFrame()->SetFillColor(10);
1037 c6->SetHighLightColor(10); c6->SetBottomMargin(0.15);
1038 c6->SetGridx(); c6->SetGridy();
1039 hEmptyPt->DrawCopy();
1040 for(Int_t iParticle = 0; iParticle < 10; iParticle++) {
1042 DrawMarker(0.2, 115-5*iParticle, 20+iParticle, 1.2, 1);
1043 t1->DrawLatex(0.3,113-5*iParticle,fParticleName[iParticle]);
1046 DrawMarker(2.2, 115-5*(iParticle-5), 20+iParticle, 1.2, 1);
1047 t1->DrawLatex(2.3,113-5*(iParticle-5),fParticleName[iParticle]);
1049 if((iParticle == 0)||(iParticle == 6)||(iParticle == 8))
1050 gParticleAntiProtonPt[iParticle]->Draw("P");
1054 //________________________________________//
1055 void GetComposition(Int_t iSpecies,
1057 Double_t *nParticleCompositionY,
1059 Double_t *nParticleCompositionPt,
1061 //Returns the pT and y dependence of the MC composition
1062 Double_t ymin = gHist->GetXaxis()->GetXmin();
1063 Double_t ymax = gHist->GetXaxis()->GetXmax();
1064 Double_t nybins = gHist->GetNbinsX();
1065 Double_t ptmin = gHist->GetYaxis()->GetXmin();
1066 Double_t ptmax = gHist->GetYaxis()->GetXmax();
1067 Double_t nptbins = gHist->GetNbinsY();
1068 Double_t nTotalY[100], nTotalPt[100];
1069 for(Int_t iBins = 0; iBins < 100; iBins++) {
1070 nParticleCompositionY[iBins] = 0;
1071 nParticleCompositionPt[iBins] = 0;
1072 nTotalY[iBins] = 0.0;
1073 nTotalPt[iBins] = 0.0;
1076 //rapidity dependence
1077 //cout<<"Ymin: "<<ymin<<" - Ymax: "<<ymax<<" - Ybins: "<<nybins<<endl;
1078 for(Int_t iXbins = 1; iXbins <= gHist->GetNbinsX(); iXbins++) {
1079 for(Int_t iZbins = 1; iZbins <= gHist->GetNbinsZ(); iZbins++) {
1080 for(Int_t iYbins = 1; iYbins <= gHist->GetNbinsY(); iYbins++) {
1081 nTotalY[iXbins-1] += gHist->GetBinContent(iXbins,iYbins,iZbins);
1086 for(Int_t iXbins = 1; iXbins <= gHist->GetNbinsX(); iXbins++) {
1087 for(Int_t iYbins = 1; iYbins <= gHist->GetNbinsY(); iYbins++) {
1088 if(nTotalY[iXbins-1] > 0)
1089 nParticleCompositionY[iXbins-1] += 100.*gHist->GetBinContent(iXbins,iYbins,iSpecies+1)/nTotalY[iXbins-1];
1090 //if(nParticleCompositionY[iXbins-1] == 0)
1091 //nParticleCompositionY[iXbins-1] = -10.0;
1093 gY[iXbins-1] = ymin + (iXbins-1)*(ymax - ymin)/nybins + 0.5*(ymax - ymin)/nybins;
1094 //cout<<"y: "<<gY[iXbins-1]<<
1095 //" - test: "<<ymin + (iXbins-1)*(ymax - ymin)/nybins + 0.5*(ymax - ymin)/nybins<<
1096 //" - Number of protons: "<<nY[iXbins-1]<<
1097 //" - Total: "<<nTotalY[iXbins-1]<<
1098 //" - Percentage: "<<nParticleCompositionY[iXbins-1]<<endl;
1102 //cout<<"Ptmin: "<<ptmin<<" - Ptmax: "<<ptmax<<" - Ptbins: "<<nptbins<<endl;
1103 for(Int_t iYbins = 1; iYbins <= gHist->GetNbinsY(); iYbins++) {
1104 for(Int_t iZbins = 1; iZbins <= gHist->GetNbinsZ(); iZbins++) {
1105 for(Int_t iXbins = 1; iXbins <= gHist->GetNbinsX(); iXbins++) {
1106 nTotalPt[iYbins-1] += gHist->GetBinContent(iXbins,iYbins,iZbins);
1111 for(Int_t iYbins = 1; iYbins <= gHist->GetNbinsY(); iYbins++) {
1112 for(Int_t iXbins = 1; iXbins <= gHist->GetNbinsX(); iXbins++) {
1113 if(nTotalPt[iYbins-1] > 0)
1114 nParticleCompositionPt[iYbins-1] += 100.*gHist->GetBinContent(iXbins,iYbins,iSpecies+1)/nTotalPt[iYbins-1];
1115 //if(nParticleCompositionPt[iYbins-1] == 0)
1116 //nParticleCompositionPt[iYbins-1] = -10.0;
1118 gPt[iYbins-1] = ptmin + (iYbins-1)*(ptmax - ptmin)/nptbins + 0.5*(ptmax - ptmin)/nptbins;
1119 //cout<<"Pt: "<<gPt[iYbins-1]<<
1120 //" - test: "<<ptmin + (iYbins-1)*(ptmax - ptmin)/nptbins + 0.5*(ptmax - ptmin)/nptbins<<
1121 //" - Number of protons: "<<nY[iXbins-1]<<
1122 //" - Total: "<<nTotalPt[iYbins-1]<<
1123 //" - Percentage: "<<nParticleCompositionPt[iYbins-1]<<endl;
1127 //________________________________________//
1128 void readProcesses(TList *list) {
1129 char *fParticleProtonName[12] = {"K_{L}","#pi","K_{S}","K",
1130 "n","p","#Sigma^{-}","#Lambda","#Sigma^{+}",
1131 "#Xi^{-}","#Xi^{0}","#Omega^{-}"};
1132 char *fParticleAntiProtonName[8] = {"K_{L}","#pi","K_{S}","K",
1133 "n","p","#Lambda","#Sigma^{+}"};
1134 Int_t iProtonCounter = 0, iAntiProtonCounter = 0;
1136 for(Int_t iEntry = 0; iEntry < list->GetEntries(); iEntry++) {
1137 gMCProcesses = (TH1F *)list->At(iEntry);
1138 TString histName = gMCProcesses->GetName();
1139 if(histName.Contains("gHistProtons")) {
1140 cout<<"Protons coming from "<<fParticleProtonName[iProtonCounter]<<endl;
1142 iProtonCounter += 1;
1144 if(histName.Contains("gHistAntiProtons")) {
1145 cout<<"Antiprotons coming from "<<fParticleAntiProtonName[iAntiProtonCounter]<<endl;
1147 iAntiProtonCounter += 1;
1149 for(Int_t iBin = 1; iBin < gMCProcesses->GetNbinsX(); iBin++) {
1150 Double_t binContent = gMCProcesses->GetBinContent(iBin);
1151 if(binContent > 0) {
1152 Int_t processId = gMCProcesses->GetBinCenter(iBin);
1153 cout<<"\t Process ID: "<<processId<<" - "<<
1154 gMCProcessName[processId]<<" - "<<
1155 100.*binContent/gMCProcesses->GetEntries()<<"%"<<endl;
1161 //________________________________________________//
1162 void SetError(TH1D *hEff, TH1D *hGen) {
1163 for(Int_t iBin = 1; iBin <= hEff->GetNbinsX(); iBin++) {
1164 Double_t error = 0.0;
1165 if((hEff->GetBinContent(iBin) <= 1 .)&&(hGen->GetBinContent(iBin) != 0))
1166 error = TMath::Sqrt(hEff->GetBinContent(iBin)*(1 . - hEff->GetBinContent(iBin))/hGen->GetBinContent(iBin));
1167 hEff->SetBinError(iBin,error);
1171 //________________________________________//
1172 void drawEfficiency(TList *list) {
1173 //Function to display the reconstruction and PID efficiencies
1174 //for protons and antiprotons vs y and pT
1176 TH2F *hEmpty = new TH2F("hEmptyReconstructionEfficiency","",
1177 100,-1.2,3.5,100,-10.0,130);
1178 hEmpty->SetStats(kFALSE);
1179 hEmpty->GetYaxis()->SetTitle("#epsilon [%]");
1180 hEmpty->GetYaxis()->SetTitleOffset(1.3);
1182 //Reconstruction efficiency
1183 TH2D *gHistPrimariesMCYPtProtons = (TH2D *)list->At(0);
1184 TH2D *gHistPrimariesMCYPtAntiProtons = (TH2D *)list->At(1);
1185 TH2D *gHistMCYPtProtonsFromWeak = (TH2D *)list->At(2);
1186 TH2D *gHistMCYPtAntiProtonsFromWeak = (TH2D *)list->At(3);
1187 TH2D *gHistMCYPtProtonsFromHadronic = (TH2D *)list->At(4);
1188 TH2D *gHistMCYPtAntiProtonsFromHadronic = (TH2D *)list->At(5);
1189 TH2D *gHistPrimariesESDYPtProtons = (TH2D *)list->At(6);
1190 TH2D *gHistPrimariesESDYPtAntiProtons = (TH2D *)list->At(7);
1191 TH2D *gHistESDYPtProtonsFromWeak = (TH2D *)list->At(8);
1192 TH2D *gHistESDYPtAntiProtonsFromWeak = (TH2D *)list->At(9);
1193 TH2D *gHistESDYPtProtonsFromHadronic = (TH2D *)list->At(10);
1194 TH2D *gHistESDYPtAntiProtonsFromHadronic = (TH2D *)list->At(11);
1196 //rapidity dependence
1197 TCanvas *c14 = new TCanvas("c14",
1198 "(Anti)Proton reconstruction efficiency vs y",
1200 c14->SetFillColor(10); c14->GetFrame()->SetFillColor(10);
1201 c14->SetHighLightColor(10); c14->Divide(2,1);
1204 TH1D *gYPrimariesESDProtons = (TH1D *)gHistPrimariesESDYPtProtons->ProjectionX("gYPrimariesESDProtons",0,gHistPrimariesESDYPtProtons->GetXaxis()->GetNbins(),"e");
1205 TH1D *gYPrimariesMCProtons = (TH1D *)gHistPrimariesMCYPtProtons->ProjectionX("gYPrimariesMCProtons",0,gHistPrimariesMCYPtProtons->GetXaxis()->GetNbins(),"e");
1206 gYPrimariesESDProtons->Divide(gYPrimariesMCProtons);
1207 SetError(gYPrimariesESDProtons,gYPrimariesMCProtons);
1208 gYPrimariesESDProtons->Scale(100.);
1209 gYPrimariesESDProtons->SetMarkerStyle(kFullCircle);
1211 //Primary AntiProtons
1212 TH1D *gYPrimariesESDAntiProtons = (TH1D *)gHistPrimariesESDYPtAntiProtons->ProjectionX("gYPrimariesESDAntiProtons",0,gHistPrimariesESDYPtAntiProtons->GetXaxis()->GetNbins(),"e");
1213 TH1D *gYPrimariesMCAntiProtons = (TH1D *)gHistPrimariesMCYPtAntiProtons->ProjectionX("gYPrimariesMCAntiProtons",0,gHistPrimariesMCYPtProtons->GetXaxis()->GetNbins(),"e");
1214 gYPrimariesESDAntiProtons->Divide(gYPrimariesMCAntiProtons);
1215 SetError(gYPrimariesESDAntiProtons,gYPrimariesMCAntiProtons);
1216 gYPrimariesESDAntiProtons->Scale(100.);
1217 gYPrimariesESDAntiProtons->SetMarkerStyle(kFullCircle);
1219 //Protons from weak decays
1220 TH1D *gYESDProtonsFromWeak = (TH1D *)gHistESDYPtProtonsFromWeak->ProjectionX("gYESDProtonsFromWeak",0,gHistESDYPtProtonsFromWeak->GetXaxis()->GetNbins(),"e");
1221 TH1D *gYMCProtonsFromWeak = (TH1D *)gHistMCYPtProtonsFromWeak->ProjectionX("gYMCProtonsFromWeak",0,gHistMCYPtProtonsFromWeak->GetXaxis()->GetNbins(),"e");
1222 gYESDProtonsFromWeak->Divide(gYMCProtonsFromWeak);
1223 SetError(gYESDProtonsFromWeak,gYMCProtonsFromWeak);
1224 gYESDProtonsFromWeak->Scale(100.);
1225 gYESDProtonsFromWeak->SetMarkerStyle(21);
1226 gYESDProtonsFromWeak->SetMarkerColor(2);
1228 //AntiProtons from weak decays
1229 TH1D *gYESDAntiProtonsFromWeak = (TH1D *)gHistESDYPtAntiProtonsFromWeak->ProjectionX("gYESDAntiProtonsFromWeak",0,gHistESDYPtAntiProtonsFromWeak->GetXaxis()->GetNbins(),"e");
1230 TH1D *gYMCAntiProtonsFromWeak = (TH1D *)gHistMCYPtAntiProtonsFromWeak->ProjectionX("gYMCAntiProtonsFromWeak",0,gHistMCYPtProtonsFromWeak->GetXaxis()->GetNbins(),"e");
1231 gYESDAntiProtonsFromWeak->Divide(gYMCAntiProtonsFromWeak);
1232 SetError(gYESDAntiProtonsFromWeak,gYMCAntiProtonsFromWeak);
1233 gYESDAntiProtonsFromWeak->Scale(100.);
1234 gYESDAntiProtonsFromWeak->SetMarkerStyle(21);
1235 gYESDAntiProtonsFromWeak->SetMarkerColor(2);
1237 //Protons from hadronic interactions
1238 TH1D *gYESDProtonsFromHadronic = (TH1D *)gHistESDYPtProtonsFromHadronic->ProjectionX("gYESDProtonsFromHadronic",0,gHistESDYPtProtonsFromHadronic->GetXaxis()->GetNbins(),"e");
1239 TH1D *gYMCProtonsFromHadronic = (TH1D *)gHistMCYPtProtonsFromHadronic->ProjectionX("gYMCProtonsFromHadronic",0,gHistMCYPtProtonsFromHadronic->GetXaxis()->GetNbins(),"e");
1240 gYESDProtonsFromHadronic->Divide(gYMCProtonsFromHadronic);
1241 SetError(gYESDProtonsFromHadronic,gYMCProtonsFromHadronic);
1242 gYESDProtonsFromHadronic->Scale(100.);
1243 gYESDProtonsFromHadronic->SetMarkerStyle(22);
1244 gYESDProtonsFromHadronic->SetMarkerColor(3);
1246 //AntiProtons from weak decays
1247 TH1D *gYESDAntiProtonsFromHadronic = (TH1D *)gHistESDYPtAntiProtonsFromHadronic->ProjectionX("gYESDAntiProtonsFromHadronic",0,gHistESDYPtAntiProtonsFromHadronic->GetXaxis()->GetNbins(),"e");
1248 TH1D *gYMCAntiProtonsFromHadronic = (TH1D *)gHistMCYPtAntiProtonsFromHadronic->ProjectionX("gYMCAntiProtonsFromHadronic",0,gHistMCYPtProtonsFromHadronic->GetXaxis()->GetNbins(),"e");
1249 gYESDAntiProtonsFromHadronic->Divide(gYMCAntiProtonsFromHadronic);
1250 SetError(gYESDAntiProtonsFromHadronic,gYMCAntiProtonsFromHadronic);
1251 gYESDAntiProtonsFromHadronic->Scale(100.);
1252 gYESDAntiProtonsFromHadronic->SetMarkerStyle(22);
1253 gYESDAntiProtonsFromHadronic->SetMarkerColor(3);
1255 c14->cd(1)->SetBottomMargin(0.15);
1256 c14->cd(1)->SetLeftMargin(0.15);
1257 c14->cd(1)->SetGridx(); c14->cd(1)->SetGridy();
1258 hEmpty->GetXaxis()->SetRangeUser(gYPrimariesESDAntiProtons->GetXaxis()->GetXmin()-0.2,
1259 gYPrimariesESDAntiProtons->GetXaxis()->GetXmax()+0.2);
1260 hEmpty->GetXaxis()->SetTitle(gYPrimariesESDAntiProtons->GetXaxis()->GetTitle());
1261 hEmpty->SetTitle("Protons");
1263 gYPrimariesESDProtons->DrawCopy("ESAME");
1264 gYESDProtonsFromWeak->DrawCopy("ESAME");
1265 gYESDProtonsFromHadronic->DrawCopy("ESAME");
1267 c14->cd(2)->SetBottomMargin(0.15);
1268 c14->cd(2)->SetLeftMargin(0.15);
1269 c14->cd(2)->SetGridx(); c14->cd(2)->SetGridy();
1270 hEmpty->SetTitle("Antiprotons");
1272 gYPrimariesESDAntiProtons->DrawCopy("ESAME");
1273 gYESDAntiProtonsFromWeak->DrawCopy("ESAME");
1274 gYESDAntiProtonsFromHadronic->DrawCopy("ESAME");
1275 c14->SaveAs("ReconstructionEfficiency-Protons-Rapidity.gif");
1278 TCanvas *c15 = new TCanvas("c15",
1279 "(Anti)Proton reconstruction efficiency vs pT",
1281 c15->SetFillColor(10); c15->GetFrame()->SetFillColor(10);
1282 c15->SetHighLightColor(10); c15->Divide(2,1);
1285 TH1D *gPtPrimariesESDProtons = (TH1D *)gHistPrimariesESDYPtProtons->ProjectionY("gPtPrimariesESDProtons",0,gHistPrimariesESDYPtProtons->GetYaxis()->GetNbins(),"e");
1286 TH1D *gPtPrimariesMCProtons = (TH1D *)gHistPrimariesMCYPtProtons->ProjectionY("gPtPrimariesMCProtons",0,gHistPrimariesMCYPtProtons->GetYaxis()->GetNbins(),"e");
1287 gPtPrimariesESDProtons->Divide(gPtPrimariesMCProtons);
1288 SetError(gPtPrimariesESDProtons,gPtPrimariesMCProtons);
1289 gPtPrimariesESDProtons->Scale(100.);
1290 gPtPrimariesESDProtons->SetMarkerStyle(kFullCircle);
1292 //Primary AntiProtons
1293 TH1D *gPtPrimariesESDAntiProtons = (TH1D *)gHistPrimariesESDYPtAntiProtons->ProjectionY("gPtPrimariesESDAntiProtons",0,gHistPrimariesESDYPtAntiProtons->GetYaxis()->GetNbins(),"e");
1294 TH1D *gPtPrimariesMCAntiProtons = (TH1D *)gHistPrimariesMCYPtAntiProtons->ProjectionY("gPtPrimariesMCAntiProtons",0,gHistPrimariesMCYPtProtons->GetYaxis()->GetNbins(),"e");
1295 gPtPrimariesESDAntiProtons->Divide(gPtPrimariesMCAntiProtons);
1296 SetError(gPtPrimariesESDAntiProtons,gPtPrimariesMCAntiProtons);
1297 gPtPrimariesESDAntiProtons->Scale(100.);
1298 gPtPrimariesESDAntiProtons->SetMarkerStyle(kFullCircle);
1300 //Protons from weak decays
1301 TH1D *gPtESDProtonsFromWeak = (TH1D *)gHistESDYPtProtonsFromWeak->ProjectionY("gPtESDProtonsFromWeak",0,gHistESDYPtProtonsFromWeak->GetYaxis()->GetNbins(),"e");
1302 TH1D *gPtMCProtonsFromWeak = (TH1D *)gHistMCYPtProtonsFromWeak->ProjectionY("gPtMCProtonsFromWeak",0,gHistMCYPtProtonsFromWeak->GetYaxis()->GetNbins(),"e");
1303 gPtESDProtonsFromWeak->Divide(gPtMCProtonsFromWeak);
1304 SetError(gPtESDProtonsFromWeak,gPtMCProtonsFromWeak);
1305 gPtESDProtonsFromWeak->Scale(100.);
1306 gPtESDProtonsFromWeak->SetMarkerStyle(21);
1307 gPtESDProtonsFromWeak->SetMarkerColor(2);
1309 //AntiProtons from weak decays
1310 TH1D *gPtESDAntiProtonsFromWeak = (TH1D *)gHistESDYPtAntiProtonsFromWeak->ProjectionY("gPtESDAntiProtonsFromWeak",0,gHistESDYPtAntiProtonsFromWeak->GetYaxis()->GetNbins(),"e");
1311 TH1D *gPtMCAntiProtonsFromWeak = (TH1D *)gHistMCYPtAntiProtonsFromWeak->ProjectionY("gPtMCAntiProtonsFromWeak",0,gHistMCYPtProtonsFromWeak->GetYaxis()->GetNbins(),"e");
1312 gPtESDAntiProtonsFromWeak->Divide(gPtMCAntiProtonsFromWeak);
1313 SetError(gPtESDAntiProtonsFromWeak,gPtMCAntiProtonsFromWeak);
1314 gPtESDAntiProtonsFromWeak->Scale(100.);
1315 gPtESDAntiProtonsFromWeak->SetMarkerStyle(21);
1316 gPtESDAntiProtonsFromWeak->SetMarkerColor(2);
1318 //Protons from hadronic interactions
1319 TH1D *gPtESDProtonsFromHadronic = (TH1D *)gHistESDYPtProtonsFromHadronic->ProjectionY("gPtESDProtonsFromHadronic",0,gHistESDYPtProtonsFromHadronic->GetYaxis()->GetNbins(),"e");
1320 TH1D *gPtMCProtonsFromHadronic = (TH1D *)gHistMCYPtProtonsFromHadronic->ProjectionY("gPtMCProtonsFromHadronic",0,gHistMCYPtProtonsFromHadronic->GetYaxis()->GetNbins(),"e");
1321 gPtESDProtonsFromHadronic->Divide(gPtMCProtonsFromHadronic);
1322 SetError(gPtESDProtonsFromHadronic,gPtMCProtonsFromHadronic);
1323 gPtESDProtonsFromHadronic->Scale(100.);
1324 gPtESDProtonsFromHadronic->SetMarkerStyle(22);
1325 gPtESDProtonsFromHadronic->SetMarkerColor(3);
1327 //AntiProtons from hadronic interactions
1328 TH1D *gPtESDAntiProtonsFromHadronic = (TH1D *)gHistESDYPtAntiProtonsFromHadronic->ProjectionY("gPtESDAntiProtonsFromHadronic",0,gHistESDYPtAntiProtonsFromHadronic->GetYaxis()->GetNbins(),"e");
1329 TH1D *gPtMCAntiProtonsFromHadronic = (TH1D *)gHistMCYPtAntiProtonsFromHadronic->ProjectionY("gPtMCAntiProtonsFromHadronic",0,gHistMCYPtProtonsFromHadronic->GetYaxis()->GetNbins(),"e");
1330 gPtESDAntiProtonsFromHadronic->Divide(gPtMCAntiProtonsFromHadronic);
1331 SetError(gPtESDAntiProtonsFromHadronic,gPtMCAntiProtonsFromHadronic);
1332 gPtESDAntiProtonsFromHadronic->Scale(100.);
1333 gPtESDAntiProtonsFromHadronic->SetMarkerStyle(22);
1334 gPtESDAntiProtonsFromHadronic->SetMarkerColor(3);
1337 c15->cd(1)->SetBottomMargin(0.15);
1338 c15->cd(1)->SetLeftMargin(0.15);
1339 c15->cd(1)->SetGridx(); c15->cd(1)->SetGridy();
1340 hEmpty->GetXaxis()->SetRangeUser(gPtPrimariesESDAntiProtons->GetXaxis()->GetXmin()-0.2,
1341 gPtPrimariesESDAntiProtons->GetXaxis()->GetXmax()+0.2);
1342 hEmpty->GetXaxis()->SetTitle("P_{T} [GeV/c]");
1343 hEmpty->SetTitle("Protons");
1345 gPtPrimariesESDProtons->DrawCopy("ESAME");
1346 gPtESDProtonsFromWeak->DrawCopy("ESAME");
1347 gPtESDProtonsFromHadronic->DrawCopy("ESAME");
1349 c15->cd(2)->SetBottomMargin(0.15);
1350 c15->cd(2)->SetLeftMargin(0.15);
1351 c15->cd(2)->SetGridx(); c15->cd(2)->SetGridy();
1352 hEmpty->SetTitle("Antiprotons");
1354 gPtPrimariesESDAntiProtons->DrawCopy("ESAME");
1355 gPtESDAntiProtonsFromWeak->DrawCopy("ESAME");
1356 gPtESDAntiProtonsFromHadronic->DrawCopy("ESAME");
1357 c15->SaveAs("ReconstructionEfficiency-Protons-Pt.gif");
1362 TH2D *gHistESDInitYPtProtons = (TH2D *)list->At(12);
1363 TH2D *gHistESDIdYPtProtons = (TH2D *)list->At(13);
1364 TH2D *gHistESDRecIdYPtProtons = (TH2D *)list->At(14);
1365 TH2D *gHistESDContamYPtProtons = (TH2D *)list->At(15);
1367 TCanvas *c16 = new TCanvas("c16",
1368 "(Anti)Proton PID efficiency vs y and pT",
1370 c16->SetFillColor(10); c16->GetFrame()->SetFillColor(10);
1371 c16->SetHighLightColor(10); c16->Divide(2,1);
1373 //rapidity dependence
1374 //protons pid efficiency
1375 TH1D *gYESDIdProtons = (TH1D *)gHistESDIdYPtProtons->ProjectionX("gYESDIdProtons",0,gHistESDIdYPtProtons->GetXaxis()->GetNbins(),"e");
1376 TH1D *gYESDInitProtons = (TH1D *)gHistESDInitYPtProtons->ProjectionX("gYESDInitProtons",0,gHistESDInitYPtProtons->GetXaxis()->GetNbins(),"e");
1377 gYESDIdProtons->Divide(gYESDInitProtons);
1378 SetError(gYESDIdProtons,gYESDInitProtons);
1379 gYESDIdProtons->Scale(100.);
1380 gYESDIdProtons->SetMarkerStyle(kFullCircle);
1382 //protons pid contamination
1383 TH1D *gYESDContamProtons = (TH1D *)gHistESDContamYPtProtons->ProjectionX("gYESDContamProtons",0,gHistESDContamYPtProtons->GetXaxis()->GetNbins(),"e");
1384 TH1D *gYESDRecIdProtons = (TH1D *)gHistESDRecIdYPtProtons->ProjectionX("gYESDRecIdProtons",0,gHistESDRecIdYPtProtons->GetXaxis()->GetNbins(),"e");
1385 gYESDContamProtons->Divide(gYESDRecIdProtons);
1386 SetError(gYESDContamProtons,gYESDRecIdProtons);
1387 gYESDContamProtons->Scale(100.);
1388 gYESDContamProtons->SetMarkerStyle(kOpenCircle);
1390 c16->cd(1)->SetBottomMargin(0.15);
1391 c16->cd(1)->SetLeftMargin(0.15);
1392 c16->cd(1)->SetGridx(); c16->cd(1)->SetGridy();
1393 hEmpty->GetXaxis()->SetRangeUser(-1.0.,1.0);
1394 hEmpty->GetXaxis()->SetTitle(gYESDContamProtons->GetXaxis()->GetTitle());
1396 gYESDIdProtons->DrawCopy("ESAME");
1397 gYESDContamProtons->DrawCopy("ESAME");
1400 //protons pid efficiency
1401 TH1D *gPtESDIdProtons = (TH1D *)gHistESDIdYPtProtons->ProjectionY("gPtESDIdProtons",0,gHistESDIdYPtProtons->GetYaxis()->GetNbins(),"e");
1402 TH1D *gPtESDInitProtons = (TH1D *)gHistESDInitYPtProtons->ProjectionY("gPtESDInitProtons",0,gHistESDInitYPtProtons->GetYaxis()->GetNbins(),"e");
1403 gPtESDIdProtons->Divide(gPtESDInitProtons);
1404 SetError(gPtESDIdProtons,gPtESDInitProtons);
1405 gPtESDIdProtons->Scale(100.);
1406 gPtESDIdProtons->SetMarkerStyle(kFullCircle);
1408 //protons pid contamination
1409 TH1D *gPtESDContamProtons = (TH1D *)gHistESDContamYPtProtons->ProjectionY("gPtESDContamProtons",0,gHistESDContamYPtProtons->GetYaxis()->GetNbins(),"e");
1410 TH1D *gPtESDRecIdProtons = (TH1D *)gHistESDRecIdYPtProtons->ProjectionY("gPtESDRecIdProtons",0,gHistESDRecIdYPtProtons->GetYaxis()->GetNbins(),"e");
1411 gPtESDContamProtons->Divide(gPtESDRecIdProtons);
1412 SetError(gPtESDContamProtons,gPtESDRecIdProtons);
1413 gPtESDContamProtons->Scale(100.);
1414 gPtESDContamProtons->SetMarkerStyle(kOpenCircle);
1416 c16->cd(2)->SetBottomMargin(0.15);
1417 c16->cd(2)->SetLeftMargin(0.15);
1418 c16->cd(2)->SetGridx(); c16->cd(2)->SetGridy();
1419 hEmpty->GetXaxis()->SetRangeUser(0.0,1.2);
1420 hEmpty->GetXaxis()->SetTitle("P_{T} [GeV/c]");
1422 gPtESDIdProtons->DrawCopy("ESAME");
1423 gPtESDContamProtons->DrawCopy("ESAME");
1425 c16->SaveAs("PIDEfficiency-Protons.gif");
1427 TFile *fout = TFile::Open("Reconstruction-PID-Efficiency.root","recreate");
1428 gYPrimariesESDProtons->Write();
1429 gYESDProtonsFromWeak->Write();
1430 gYESDProtonsFromHadronic->Write();
1431 gPtPrimariesESDProtons->Write();
1432 gPtESDProtonsFromWeak->Write();
1433 gPtESDProtonsFromHadronic->Write();
1434 gYPrimariesESDAntiProtons->Write();
1435 gYESDAntiProtonsFromWeak->Write();
1436 gYESDAntiProtonsFromHadronic->Write();
1437 gPtPrimariesESDAntiProtons->Write();
1438 gPtESDAntiProtonsFromWeak->Write();
1439 gPtESDAntiProtonsFromHadronic->Write();
1440 gYESDIdProtons->Write();
1441 gYESDContamProtons->Write();
1442 gPtESDIdProtons->Write();
1443 gPtESDContamProtons->Write();
1447 //________________________________________________//
1448 void DrawMarker(Double_t x, Double_t y, Int_t style,
1449 Double_t size, Int_t color) {
1450 TMarker *m = new TMarker(x,y,style);
1451 m->SetMarkerSize(size);
1452 m->SetMarkerColor(color);
1456 //________________________________________________//
1457 const char * const gMCProcessName[45] = {
1458 "Primary particle emission",
1459 "Multiple scattering",
1461 "Bending in magnetic field",
1463 "Lepton pair production",
1464 "Compton scattering",
1465 "Photoelectric effect",
1468 "Positron annihilation",
1469 "Positron annihilation at rest",
1470 "Positron annihilation in flight",
1471 "Hadronic interaction",
1472 "Nuclear evaporation",
1474 "Nuclear absorbtion",
1475 "Antiproton annihilation",
1476 "Antineutron annihilation",
1479 "Hadronic incoherent elastic",
1480 "Hadronic coherent elastic",
1481 "Hadronic inelastic",
1483 "Muon nuclear interaction",
1484 "Electron nuclear interaction",
1485 "Positron nuclear interaction",
1486 "Time of flight limit",
1487 "Nuclear photofission",
1489 "No active process",
1494 "Maximum allowed step",
1495 "Cerenkov production",
1496 "Cerenkov feed back photon",
1497 "Cerenkov photon reflection",
1498 "Cerenkov photon refraction",
1499 "Synchrotron radiation",