]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWG2/drawProtonQAResults.C
Macro to plot and compare integrated and differentail flow obtained from
[u/mrichter/AliRoot.git] / PWG2 / drawProtonQAResults.C
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
5   //TCanvas objects: 15
6   gStyle->SetPalette(1,0);
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   
17   TFile *fEfficiency = TFile::Open(filename3);
18   TList *listEfficiency = (TList *)fEfficiency->Get("efficiencyList");
19   drawEfficiency(listEfficiency);
20
21   fQA->Close();
22   fMC->Close();
23   fEfficiency->Close();
24 }
25
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;
32   
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];
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
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);
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
81   const Int_t nx = 26;
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}",
94                         "DCA_{xy}",
95                         "DCA_{xy}(TPC)",
96                         "DCA_{z}",
97                         "DCA_{z}(TPC)",
98                         "#chi^{2}(vertex)",
99                         "ITS refit",
100                         "TPC refit",
101                         "ESD pid",
102                         "TPC pid","",
103                         "N_{Secondaries}/N_{total}","",""};
104   char *fCutITSName[6] = {"SPD_{1}","SPD_{2}",
105                           "SDD_{1}","SDD_{2}",
106                           "SSD_{1}","SSD_{2}"};
107
108   //cut influence
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
179   //cout<<"_____________________________________________________"<<endl;
180   //cout<<"_______________PRIMARY PROTONS_______________________"<<endl;
181   hPrimaryProtons->SetBinContent(1,GetPercentage(gEntriesQA2DList[0],gEntriesQA2DList[1]));
182
183   for(Int_t i = 2; i < NQAHISTOSPERLIST-4; i++) 
184     hPrimaryProtons->SetBinContent(i+1,GetPercentage(gEntriesQAPrimaryProtonsAcceptedList[i-2],
185                                                      gEntriesQAPrimaryProtonsRejectedList[i-2]));
186   
187   //1D for secondary protons
188   //cout<<"_____________________________________________________"<<endl;
189   //cout<<"_______________SECONDARY PROTONS_____________________"<<endl;
190   hSecondaryProtons->SetBinContent(1,GetPercentage(gEntriesQA2DList[2],gEntriesQA2DList[3]));
191   
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]));
196
197   //1D for primary antiprotons
198   //cout<<"_________________________________________________________"<<endl;
199   //cout<<"_______________PRIMARY ANTIPROTONS_______________________"<<endl;
200   hPrimaryAntiProtons->SetBinContent(1,GetPercentage(gEntriesQA2DList[4],gEntriesQA2DList[5]));
201   
202   for(Int_t i = 2; i < NQAHISTOSPERLIST-4; i++) 
203     hPrimaryAntiProtons->SetBinContent(i+1,GetPercentage(gEntriesQAPrimaryAntiProtonsAcceptedList[i-2],
204                                                          gEntriesQAPrimaryAntiProtonsRejectedList[i-2]));
205   
206   //1D for secondary antiprotons
207   //cout<<"_________________________________________________________"<<endl;
208   //cout<<"_______________SECONDARY ANTIPROTONS_____________________"<<endl;
209   hSecondaryAntiProtons->SetBinContent(1,GetPercentage(gEntriesQA2DList[6],gEntriesQA2DList[7]));
210
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]));
215
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();
223
224   for(Int_t i = 1; i <= nx; i++) {
225     hPrimaryProtons->SetBinError(i,1.0);
226     hSecondaryProtons->SetBinError(i,1.0);
227   }
228   hEmpty->DrawCopy();
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");
235
236   c1->SaveAs("CutInfluence-Protons.gif");
237
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();
243
244   for(Int_t i = 1; i <= nx; i++) {
245     hPrimaryAntiProtons->SetBinError(i,1.0);
246     hSecondaryAntiProtons->SetBinError(i,1.0);
247   }
248   hEmpty->DrawCopy();
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}");
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);
314
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   //_______________________________________________________//
331   TCanvas *c9 = new TCanvas("c9","ITS cluster map - (anti)protons",
332                             100,100,700,400);
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   }
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");
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   }
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}");
377
378   c9->SaveAs("CutInfluence-ITS.gif");
379   
380   //Efficiency - Contamination plots
381   DrawContamination(fQA2DList);
382   DrawCutEfficiency(fQA2DList);
383   DrawComposition(gHistYPtPDGProtonsPass,gHistYPtPDGAntiProtonsPass);
384 }
385
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;
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();
455   hEmptyY->DrawCopy();
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");
460     if(iParticle < 5) {
461       DrawMarker(-1.1, 115-5*iParticle, 20+iParticle, 1.2, 1);
462       t1->DrawLatex(-1.0,113-5*iParticle,fParticleName[iParticle]);
463     }
464     else {
465       DrawMarker(0.2, 115-5*(iParticle-5), 20+iParticle, 1.2, 1);
466       t1->DrawLatex(0.3,113-5*(iParticle-5),fParticleName[iParticle]);
467     }
468   }
469
470   c12->SetHighLightColor(10); c12->cd(2)->SetBottomMargin(0.15);
471   c12->cd(2)->SetGridx(); c12->cd(2)->SetGridy();
472   hEmptyY->DrawCopy();
473   for(Int_t iParticle = 0; iParticle < 10; iParticle++) {
474     if((iParticle == 0)||(iParticle == 6)||(iParticle == 8))
475       gParticleAntiProtonY[iParticle]->Draw("P");
476     if(iParticle < 5) {
477       DrawMarker(-1.1, 115-5*iParticle, 20+iParticle, 1.2, 1);
478       t1->DrawLatex(-1.0,113-5*iParticle,fParticleName[iParticle]);
479     }
480     else {
481       DrawMarker(0.2, 115-5*(iParticle-5), 20+iParticle, 1.2, 1);
482       t1->DrawLatex(0.3,113-5*(iParticle-5),fParticleName[iParticle]);
483     }
484   }
485   c12->SaveAs("SurvivedSecondaries-Composition-Rapidity.gif");
486
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]");
491
492   TCanvas *c13 = new TCanvas("c13",
493                             "Composition of accepted secondaries vs pT",
494                             600,600,700,400);
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++) {
500     if(iParticle < 5) {
501       DrawMarker(0.2, 115-5*iParticle, 20+iParticle, 1.2, 1);
502       t1->DrawLatex(0.3,113-5*iParticle,fParticleName[iParticle]);
503     }
504     else {
505       DrawMarker(2.2, 115-5*(iParticle-5), 20+iParticle, 1.2, 1);
506       t1->DrawLatex(2.3,113-5*(iParticle-5),fParticleName[iParticle]);
507     }
508     if((iParticle == 0)||(iParticle == 2)||(iParticle == 6)||(iParticle == 8))
509       gParticleProtonPt[iParticle]->Draw("P");
510   }
511
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++) {
516     if(iParticle < 5) {
517       DrawMarker(0.2, 115-5*iParticle, 20+iParticle, 1.2, 1);
518       t1->DrawLatex(0.3,113-5*iParticle,fParticleName[iParticle]);
519     }
520     else {
521       DrawMarker(2.2, 115-5*(iParticle-5), 20+iParticle, 1.2, 1);
522       t1->DrawLatex(2.3,113-5*(iParticle-5),fParticleName[iParticle]);
523     }
524     if((iParticle == 0)||(iParticle == 6)||(iParticle == 8))
525       gParticleAntiProtonPt[iParticle]->Draw("P");
526   }
527   c13->SaveAs("SurvivedSecondaries-Composition-Pt.gif");
528 }
529
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;
538
539   TLatex *t1 = new TLatex();
540   t1->SetTextSize(0.04);
541
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);
546
547   //rapidity dependence
548   //Protons
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);
553
554   TH1D *gYPrimaryProtonsPercentage = new TH1D("gYPrimaryProtonsPercentage",
555                                               "",
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);
564
565   TH1D *gYSecondaryProtonsPercentage = new TH1D("gYSecondaryProtonsPercentage",
566                                                 "",
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);
575
576   //Antiprotons
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);
581   
582   TH1D *gYPrimaryAntiProtonsPercentage = new TH1D("gYPrimaryAntiProtonsPercentage",
583                                                   "",
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);
592   
593   TH1D *gYSecondaryAntiProtonsPercentage = new TH1D("gYSecondaryAntiProtonsPercentage",
594                                                     "",
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);
603   
604   
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");
611
612   TCanvas *c7 = new TCanvas("c7","(Anti)Proton contamination vs y",
613                             150,150,700,400);
614   c7->SetFillColor(10); c7->GetFrame()->SetFillColor(10); 
615   c7->SetHighLightColor(10); c7->Divide(2,1);
616
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");
621   hEmptyY->DrawCopy();
622   gYPrimaryProtonsPercentage->DrawCopy("ESAME");
623   gYSecondaryProtonsPercentage->DrawCopy("ESAME");
624
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");
629
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");
634   hEmptyY->DrawCopy();
635   gYPrimaryAntiProtonsPercentage->DrawCopy("ESAME");
636   gYSecondaryAntiProtonsPercentage->DrawCopy("ESAME");
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->SaveAs("Contamination-Protons-Rapidity.gif");
644
645   //pT dependence
646   //Protons
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);
651
652   TH1D *gPtPrimaryProtonsPercentage = new TH1D("gPtPrimaryProtonsPercentage",
653                                                "",
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);
662   
663   TH1D *gPtSecondaryProtonsPercentage = new TH1D("gPtSecondaryProtonsPercentage",
664                                                  "",
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);
673
674
675   //Antiprotons
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);
680   
681   TH1D *gPtPrimaryAntiProtonsPercentage = new TH1D("gPtPrimaryAntiProtonsPercentage",
682                                                    "",
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);
691   
692   TH1D *gPtSecondaryAntiProtonsPercentage = new TH1D("gPtSecondaryAntiProtonsPercentage",
693                                                      "",
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);
702   
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]");
709
710   TCanvas *c8 = new TCanvas("c8","(Anti)Proton comtamination vs pT",
711                             200,200,700,400);
712   c8->SetFillColor(10); c8->GetFrame()->SetFillColor(10); 
713   c8->SetHighLightColor(10); c8->Divide(2,1);
714
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");
722
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");
727
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");
735
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");
740
741   c8->SaveAs("Contamination-Protons-Pt.gif");
742
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();
752   fout->Close();
753 }
754
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;
763
764   TLatex *t1 = new TLatex();
765   t1->SetTextSize(0.04);
766
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);
771
772   //rapidity dependence
773   //Protons
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);
780
781   //Antiprotons
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);
788   
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");
795
796   TCanvas *c10 = new TCanvas("c10","(Anti)Proton cut efficiency vs y",
797                             250,250,700,400);
798   c10->SetFillColor(10); c10->GetFrame()->SetFillColor(10); 
799   c10->SetHighLightColor(10); c10->Divide(2,1);
800
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);
806   hEmptyY->DrawCopy();
807   gYPrimaryESDProtons->DrawCopy("ESAME");
808
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");
813   hEmptyY->DrawCopy();
814   gYPrimaryESDAntiProtons->DrawCopy("ESAME");
815
816   c10->SaveAs("CutEfficiency-Protons-Rapidity.gif");
817
818   //pT dependence
819   //Protons
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);
826
827   //Antiprotons
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);
834
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]");
841
842   TCanvas *c11 = new TCanvas("c11","(Anti)Proton cut efficiency vs pT",
843                             300,300,700,400);
844   c11->SetFillColor(10); c11->GetFrame()->SetFillColor(10); 
845   c11->SetHighLightColor(10); c11->Divide(2,1);
846
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");
854
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");
861
862   c11->SaveAs("CutEfficiency-Protons-Pt.gif");
863
864   TFile *fout = TFile::Open("CutEfficiency.root","recreate");
865   gYPrimaryESDProtons->Write();
866   gYPrimaryESDAntiProtons->Write();
867   gPtPrimaryESDProtons->Write();
868   gPtPrimaryESDAntiProtons->Write();
869   fout->Close();
870 }
871
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;
878
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;
884     gHist = 0;
885   }
886 }
887
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;
893
894   if(nTotalEntries == 0)
895     return -1;
896
897   return 100.*nRejectEntries/nTotalEntries;
898 }
899
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;
908   
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;
920     gY[iBins] = 0;
921     gPt[iBins] = 0;
922   }
923   
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,
930                    gHistYPtPDGProtons,
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);
937
938     gParticleProtonPt[iParticle] = new TGraph(gHistYPtPDGProtons->GetNbinsY(),
939                                         gPt,nParticleCompositionProtonPt);
940     gParticleProtonPt[iParticle]->SetMarkerStyle(iParticle+20);
941     gParticleProtonPt[iParticle]->SetMarkerSize(1.2);
942
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);
951
952     gParticleAntiProtonPt[iParticle] = new TGraph(gHistYPtPDGAntiProtons->GetNbinsY(),
953                                         gPt,nParticleCompositionAntiProtonPt);
954     gParticleAntiProtonPt[iParticle]->SetMarkerStyle(iParticle+20);
955     gParticleAntiProtonPt[iParticle]->SetMarkerSize(1.2);
956   }
957
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);
964
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");
969
970   TCanvas *c3 = new TCanvas("c3","MC secondary composition vs y - Protons",
971                             350,350,700,400);
972   c3->SetFillColor(10); c3->GetFrame()->SetFillColor(10);
973   c3->SetHighLightColor(10); c3->SetBottomMargin(0.15);
974   c3->SetGridx(); c3->SetGridy();
975   hEmptyY->DrawCopy();
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");
980     if(iParticle < 5) {
981       DrawMarker(-1.1, 115-5*iParticle, 20+iParticle, 1.2, 1);
982       t1->DrawLatex(-1.0,113-5*iParticle,fParticleName[iParticle]);
983     }
984     else {
985       DrawMarker(0.2, 115-5*(iParticle-5), 20+iParticle, 1.2, 1);
986       t1->DrawLatex(0.3,113-5*(iParticle-5),fParticleName[iParticle]);
987     }
988   }
989
990   TCanvas *c5 = new TCanvas("c5","MC secondary composition vs y - antiProtons",
991                             400,400,700,400);
992   c5->SetFillColor(10); c5->GetFrame()->SetFillColor(10);
993   c5->SetHighLightColor(10); c5->SetBottomMargin(0.15);
994   c5->SetGridx(); c5->SetGridy();
995   hEmptyY->DrawCopy();
996   for(Int_t iParticle = 0; iParticle < 10; iParticle++) {
997     if((iParticle == 0)||(iParticle == 6)||(iParticle == 8))
998       gParticleAntiProtonY[iParticle]->Draw("P");
999     if(iParticle < 5) {
1000       DrawMarker(-1.1, 115-5*iParticle, 20+iParticle, 1.2, 1);
1001       t1->DrawLatex(-1.0,113-5*iParticle,fParticleName[iParticle]);
1002     }
1003     else {
1004       DrawMarker(0.2, 115-5*(iParticle-5), 20+iParticle, 1.2, 1);
1005       t1->DrawLatex(0.3,113-5*(iParticle-5),fParticleName[iParticle]);
1006     }
1007   }
1008
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]");
1013
1014   TCanvas *c4 = new TCanvas("c4","MC secondary composition vs pT - Protons",
1015                             450,450,700,400);
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++) {
1021     if(iParticle < 5) {
1022       DrawMarker(0.2, 115-5*iParticle, 20+iParticle, 1.2, 1);
1023       t1->DrawLatex(0.3,113-5*iParticle,fParticleName[iParticle]);
1024     }
1025     else {
1026       DrawMarker(2.2, 115-5*(iParticle-5), 20+iParticle, 1.2, 1);
1027       t1->DrawLatex(2.3,113-5*(iParticle-5),fParticleName[iParticle]);
1028     }
1029     if((iParticle == 0)||(iParticle == 2)||(iParticle == 6)||(iParticle == 8))
1030       gParticleProtonPt[iParticle]->Draw("P");
1031   }
1032
1033   TCanvas *c6 = new TCanvas("c6",
1034                             "MC secondary composition vs pT - AntiProtons",
1035                             500,500,700,400);
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++) {
1041     if(iParticle < 5) {
1042       DrawMarker(0.2, 115-5*iParticle, 20+iParticle, 1.2, 1);
1043       t1->DrawLatex(0.3,113-5*iParticle,fParticleName[iParticle]);
1044     }
1045     else {
1046       DrawMarker(2.2, 115-5*(iParticle-5), 20+iParticle, 1.2, 1);
1047       t1->DrawLatex(2.3,113-5*(iParticle-5),fParticleName[iParticle]);
1048     }
1049     if((iParticle == 0)||(iParticle == 6)||(iParticle == 8))
1050       gParticleAntiProtonPt[iParticle]->Draw("P");
1051   }
1052 }
1053
1054 //________________________________________//
1055 void GetComposition(Int_t iSpecies,
1056                     TH3F *gHist, 
1057                     Double_t *nParticleCompositionY,
1058                     Double_t *gY,
1059                     Double_t *nParticleCompositionPt,
1060                     Double_t *gPt) {
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;
1074   }
1075
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);
1082       }
1083     }
1084   }
1085
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;
1092     }//pt loop
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;
1099   }//y loop
1100
1101   //pt dependence
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);
1107       }
1108     }
1109   }
1110
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;
1117     }//pt loop
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;
1124   }//pt loop
1125 }
1126
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;
1135   TH1F *gMCProcesses;
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;
1141
1142       iProtonCounter += 1;
1143     }
1144     if(histName.Contains("gHistAntiProtons")) {
1145       cout<<"Antiprotons coming from "<<fParticleAntiProtonName[iAntiProtonCounter]<<endl;
1146
1147       iAntiProtonCounter += 1;
1148     }
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;
1156       }
1157     }
1158   }
1159 }
1160
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);
1168   }
1169 }
1170
1171 //________________________________________//
1172 void drawEfficiency(TList *list) {
1173   //Function to display the reconstruction and PID efficiencies
1174   //for protons and antiprotons vs y and pT
1175
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);
1181
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);
1195
1196   //rapidity dependence
1197   TCanvas *c14 = new TCanvas("c14",
1198                              "(Anti)Proton reconstruction efficiency vs y",
1199                              600,600,700,400);
1200   c14->SetFillColor(10); c14->GetFrame()->SetFillColor(10); 
1201   c14->SetHighLightColor(10); c14->Divide(2,1);
1202
1203   //Primary Protons
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);
1210
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);
1218
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);
1227
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);
1236
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);
1245
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);
1254
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");
1262   hEmpty->DrawCopy();
1263   gYPrimariesESDProtons->DrawCopy("ESAME");
1264   gYESDProtonsFromWeak->DrawCopy("ESAME");
1265   gYESDProtonsFromHadronic->DrawCopy("ESAME");
1266
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");
1271   hEmpty->DrawCopy();
1272   gYPrimariesESDAntiProtons->DrawCopy("ESAME");
1273   gYESDAntiProtonsFromWeak->DrawCopy("ESAME");
1274   gYESDAntiProtonsFromHadronic->DrawCopy("ESAME");
1275   c14->SaveAs("ReconstructionEfficiency-Protons-Rapidity.gif");
1276
1277   //pT dependence
1278   TCanvas *c15 = new TCanvas("c15",
1279                              "(Anti)Proton reconstruction efficiency vs pT",
1280                              650,650,700,400);
1281   c15->SetFillColor(10); c15->GetFrame()->SetFillColor(10); 
1282   c15->SetHighLightColor(10); c15->Divide(2,1);
1283
1284   //Primary Protons
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);
1291
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);
1299
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);
1308
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);
1317
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);
1326
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);
1335
1336
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");
1344   hEmpty->DrawCopy();
1345   gPtPrimariesESDProtons->DrawCopy("ESAME");
1346   gPtESDProtonsFromWeak->DrawCopy("ESAME");
1347   gPtESDProtonsFromHadronic->DrawCopy("ESAME");
1348
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");
1353   hEmpty->DrawCopy();
1354   gPtPrimariesESDAntiProtons->DrawCopy("ESAME");
1355   gPtESDAntiProtonsFromWeak->DrawCopy("ESAME");
1356   gPtESDAntiProtonsFromHadronic->DrawCopy("ESAME");
1357   c15->SaveAs("ReconstructionEfficiency-Protons-Pt.gif");
1358
1359   //______________//
1360   //PID efficiency//
1361   //______________//
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);
1366
1367   TCanvas *c16 = new TCanvas("c16",
1368                              "(Anti)Proton PID efficiency vs y and pT",
1369                              700,700,700,400);
1370   c16->SetFillColor(10); c16->GetFrame()->SetFillColor(10); 
1371   c16->SetHighLightColor(10); c16->Divide(2,1);
1372
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);
1381
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);
1389
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());
1395   hEmpty->DrawCopy();
1396   gYESDIdProtons->DrawCopy("ESAME");
1397   gYESDContamProtons->DrawCopy("ESAME");
1398
1399   //pT dependence
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);
1407
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);
1415
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]");
1421   hEmpty->DrawCopy();
1422   gPtESDIdProtons->DrawCopy("ESAME");
1423   gPtESDContamProtons->DrawCopy("ESAME");
1424
1425   c16->SaveAs("PIDEfficiency-Protons.gif");
1426
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();
1444   fout->Close();
1445 }
1446
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);
1453   m->Draw();
1454 }
1455
1456 //________________________________________________//
1457 const char * const gMCProcessName[45] = {
1458   "Primary particle emission",
1459   "Multiple scattering",
1460   "Energy loss",
1461   "Bending in magnetic field",
1462   "Decay",
1463   "Lepton pair production",
1464   "Compton scattering",
1465   "Photoelectric effect",
1466   "Bremstrahlung",
1467   "Delta ray",
1468   "Positron annihilation",
1469   "Positron annihilation at rest",
1470   "Positron annihilation in flight",
1471   "Hadronic interaction",
1472   "Nuclear evaporation",
1473   "Nuclear fission",
1474   "Nuclear absorbtion",
1475   "Antiproton annihilation",
1476   "Antineutron annihilation",
1477   "Neutron capture",
1478   "Hadronic elastic",
1479   "Hadronic incoherent elastic",
1480   "Hadronic coherent elastic",
1481   "Hadronic inelastic",
1482   "Photon inelastic",
1483   "Muon nuclear interaction",
1484   "Electron nuclear interaction",
1485   "Positron nuclear interaction",
1486   "Time of flight limit",
1487   "Nuclear photofission",
1488   "Rayleigh effect",
1489   "No active process",
1490   "Energy threshold",
1491   "Light absorption",
1492   "Light detection",
1493   "Light scattering",
1494   "Maximum allowed step",
1495   "Cerenkov production",
1496   "Cerenkov feed back photon",
1497   "Cerenkov photon reflection",
1498   "Cerenkov photon refraction",
1499   "Synchrotron radiation",
1500   "Scintillation",
1501   "Transportation",
1502   "Unknown process"
1503 };