]>
Commit | Line | Data |
---|---|---|
0008a5a6 | 1 | void drawProtonQAResults(const char* filename1 = "Protons.QA.root", |
2 | const char* filename2 = "Protons.MC.QA.root") { | |
3 | //Macro to visualize the results of the proton QA task | |
cc0fbd97 | 4 | gStyle->SetPalette(1,0); |
0008a5a6 | 5 | drawCutStatistics(filename1); |
6 | //drawMCQA(filename2); | |
7 | } | |
cc0fbd97 | 8 | |
0008a5a6 | 9 | //________________________________________// |
10 | void drawCutStatistics(const char *filename) { | |
11 | //Function to display the statistics from the cuts | |
12 | //The histogram shows the influence of each cut on the primary | |
13 | //and secondary (anti)protons | |
14 | const Int_t NQAHISTOSPERLIST = 26; | |
cc0fbd97 | 15 | |
16 | Double_t gEntriesQA2DList[8] = {0.,0.,0.,0.,0.,0.,0.,0.}; | |
17 | Double_t gEntriesQAPrimaryProtonsAcceptedList[NQAHISTOSPERLIST], gEntriesQAPrimaryProtonsRejectedList[NQAHISTOSPERLIST]; | |
18 | Double_t gEntriesQASecondaryProtonsAcceptedList[NQAHISTOSPERLIST], gEntriesQASecondaryProtonsRejectedList[NQAHISTOSPERLIST]; | |
19 | Double_t gEntriesQAPrimaryAntiProtonsAcceptedList[NQAHISTOSPERLIST], gEntriesQAPrimaryAntiProtonsRejectedList[NQAHISTOSPERLIST]; | |
20 | Double_t gEntriesQASecondaryAntiProtonsAcceptedList[NQAHISTOSPERLIST], gEntriesQASecondaryAntiProtonsRejectedList[NQAHISTOSPERLIST]; | |
21 | ||
22 | for(Int_t i = 0; i < NQAHISTOSPERLIST; i++) { | |
23 | gEntriesQAPrimaryProtonsAcceptedList[i] = 0.0; | |
24 | gEntriesQAPrimaryProtonsRejectedList[i] = 0.0; | |
25 | gEntriesQASecondaryProtonsAcceptedList[i] = 0.0; | |
26 | gEntriesQASecondaryProtonsRejectedList[i] = 0.0; | |
27 | gEntriesQAPrimaryAntiProtonsAcceptedList[i] = 0.0; | |
28 | gEntriesQAPrimaryAntiProtonsRejectedList[i] = 0.0; | |
29 | gEntriesQASecondaryAntiProtonsAcceptedList[i] = 0.0; | |
30 | gEntriesQASecondaryAntiProtonsRejectedList[i] = 0.0; | |
31 | } | |
32 | ||
33 | TFile *f = TFile::Open(filename); | |
34 | TList *list = (TList *)f->Get("outputList1"); | |
35 | ||
36 | TList *fQA2DList = (TList *)list->At(0); | |
37 | GetQAEntries(fQA2DList,gEntriesQA2DList); | |
0008a5a6 | 38 | DrawContamination(fQA2DList); |
cc0fbd97 | 39 | |
40 | TList *fQAPrimaryProtonsAcceptedList = (TList *)list->At(1); | |
41 | GetQAEntries(fQAPrimaryProtonsAcceptedList,gEntriesQAPrimaryProtonsAcceptedList); | |
42 | ||
43 | TList *fQAPrimaryProtonsRejectedList = (TList *)list->At(2); | |
44 | GetQAEntries(fQAPrimaryProtonsRejectedList,gEntriesQAPrimaryProtonsRejectedList); | |
45 | ||
46 | TList *fQASecondaryProtonsAcceptedList = (TList *)list->At(3); | |
47 | GetQAEntries(fQASecondaryProtonsAcceptedList,gEntriesQASecondaryProtonsAcceptedList); | |
48 | ||
49 | TList *fQASecondaryProtonsRejectedList = (TList *)list->At(4); | |
50 | GetQAEntries(fQASecondaryProtonsRejectedList,gEntriesQASecondaryProtonsRejectedList); | |
51 | ||
52 | TList *fQAPrimaryAntiProtonsAcceptedList = (TList *)list->At(5); | |
53 | GetQAEntries(fQAPrimaryAntiProtonsAcceptedList,gEntriesQAPrimaryAntiProtonsAcceptedList); | |
54 | ||
55 | TList *fQAPrimaryAntiProtonsRejectedList = (TList *)list->At(6); | |
56 | GetQAEntries(fQAPrimaryAntiProtonsRejectedList,gEntriesQAPrimaryAntiProtonsRejectedList); | |
57 | ||
58 | TList *fQASecondaryAntiProtonsAcceptedList = (TList *)list->At(7); | |
59 | GetQAEntries(fQASecondaryAntiProtonsAcceptedList,gEntriesQASecondaryAntiProtonsAcceptedList); | |
60 | ||
61 | TList *fQASecondaryAntiProtonsRejectedList = (TList *)list->At(8); | |
62 | GetQAEntries(fQASecondaryAntiProtonsRejectedList,gEntriesQASecondaryAntiProtonsRejectedList); | |
63 | ||
64 | //_______________________________________________________// | |
65 | //Create the histograms | |
0008a5a6 | 66 | const Int_t nx = 26; |
cc0fbd97 | 67 | char *fCutName[nx] = {"Tracks","", |
68 | "ITS Clusters", | |
69 | "#chi^{2}/N_{ITS-Clusters}", | |
70 | "TPC Clusters", | |
71 | "#chi^{2}/N_{TPC-Clusters}", | |
72 | "ExtCov11", | |
73 | "ExtCov22", | |
74 | "ExtCov33", | |
75 | "ExtCov44", | |
76 | "ExtCov55", | |
77 | "#sigma_{Vertex}", | |
78 | "#sigma_{Vertex-TPC}", | |
0008a5a6 | 79 | "DCA_{xy}", |
80 | "DCA_{xy}(TPC)", | |
81 | "DCA_{z}", | |
82 | "DCA_{z}(TPC)", | |
83 | "#chi^{2}(vertex)", | |
cc0fbd97 | 84 | "ITS refit", |
85 | "TPC refit", | |
86 | "ESD pid", | |
87 | "TPC pid","", | |
88 | "N_{Secondaries}/N_{total}","",""}; | |
0008a5a6 | 89 | char *fCutITSName[6] = {"SPD_{1}","SPD_{2}", |
90 | "SDD_{1}","SDD_{2}", | |
91 | "SSD_{1}","SSD_{2}"}; | |
cc0fbd97 | 92 | |
0008a5a6 | 93 | //cut influence |
cc0fbd97 | 94 | TH2F *hEmpty = new TH2F("hEmpty","",nx,0,nx,100,0,100); |
95 | hEmpty->SetStats(kFALSE); | |
96 | hEmpty->SetMarkerStyle(kFullCircle); | |
97 | hEmpty->SetLineColor(2); hEmpty->SetMarkerColor(2); | |
98 | hEmpty->GetYaxis()->SetTitle("Influence of the cuts [%]"); | |
99 | for(Int_t i = 1; i <= nx; i++) | |
100 | hEmpty->GetXaxis()->SetBinLabel(i,fCutName[i-1]); | |
101 | hEmpty->GetXaxis()->SetLabelOffset(0.01); | |
102 | hEmpty->GetXaxis()->SetLabelSize(0.045); | |
103 | ||
104 | //primary protons | |
105 | TH1F *hPrimaryProtons = new TH1F("hPrimaryProtons","",nx,0,nx); | |
106 | hPrimaryProtons->SetStats(kFALSE); | |
107 | hPrimaryProtons->SetMarkerStyle(kFullCircle); | |
108 | hPrimaryProtons->SetLineColor(4); hPrimaryProtons->SetLineWidth(2); | |
109 | hPrimaryProtons->SetMarkerColor(4); | |
110 | hPrimaryProtons->GetYaxis()->SetTitle("Influence of the cuts [%]"); | |
111 | for(Int_t i = 1; i <= nx; i++) { | |
112 | hPrimaryProtons->SetBinContent(i,-10.); | |
113 | hPrimaryProtons->GetXaxis()->SetBinLabel(i,fCutName[i-1]); | |
114 | } | |
115 | hPrimaryProtons->GetXaxis()->SetLabelOffset(0.01); | |
116 | hPrimaryProtons->GetXaxis()->SetLabelSize(0.045); | |
117 | ||
118 | //secondary protons | |
119 | TH1F *hSecondaryProtons = new TH1F("hSecondaryProtons","",nx,0,nx); | |
120 | hSecondaryProtons->SetStats(kFALSE); | |
121 | hSecondaryProtons->SetMarkerStyle(22); | |
122 | hSecondaryProtons->SetMarkerSize(1.4); | |
123 | hSecondaryProtons->SetLineColor(2); hSecondaryProtons->SetLineWidth(2); | |
124 | hSecondaryProtons->SetMarkerColor(2); | |
125 | hSecondaryProtons->GetYaxis()->SetTitle("Influence of the cuts [%]"); | |
126 | for(Int_t i = 1; i <= nx; i++) { | |
127 | hSecondaryProtons->SetBinContent(i,-10.); | |
128 | hSecondaryProtons->GetXaxis()->SetBinLabel(i,fCutName[i-1]); | |
129 | } | |
130 | hSecondaryProtons->GetXaxis()->SetLabelOffset(0.01); | |
131 | hSecondaryProtons->GetXaxis()->SetLabelSize(0.045); | |
132 | ||
133 | //primary antiprotons | |
134 | TH1F *hPrimaryAntiProtons = new TH1F("hPrimaryAntiProtons","",nx,0,nx); | |
135 | hPrimaryAntiProtons->SetStats(kFALSE); | |
136 | hPrimaryAntiProtons->SetMarkerStyle(kFullCircle); | |
137 | hPrimaryAntiProtons->SetLineColor(4); hPrimaryAntiProtons->SetLineWidth(2); | |
138 | hPrimaryAntiProtons->SetMarkerColor(4); | |
139 | hPrimaryAntiProtons->GetYaxis()->SetTitle("Influence of the cuts [%]"); | |
140 | for(Int_t i = 1; i <= nx; i++) { | |
141 | hPrimaryAntiProtons->SetBinContent(i,-10.); | |
142 | hPrimaryAntiProtons->GetXaxis()->SetBinLabel(i,fCutName[i-1]); | |
143 | } | |
144 | hPrimaryAntiProtons->GetXaxis()->SetLabelOffset(0.01); | |
145 | hPrimaryAntiProtons->GetXaxis()->SetLabelSize(0.045); | |
146 | ||
147 | //secondary antiprotons | |
148 | TH1F *hSecondaryAntiProtons = new TH1F("hSecondaryAntiProtons","",nx,0,nx); | |
149 | hSecondaryAntiProtons->SetStats(kFALSE); | |
150 | hSecondaryAntiProtons->SetMarkerStyle(22); | |
151 | hSecondaryAntiProtons->SetMarkerSize(1.4); | |
152 | hSecondaryAntiProtons->SetLineColor(2); hSecondaryAntiProtons->SetLineWidth(2); | |
153 | hSecondaryAntiProtons->SetMarkerColor(2); | |
154 | hSecondaryAntiProtons->GetYaxis()->SetTitle("Influence of the cuts [%]"); | |
155 | for(Int_t i = 1; i <= nx; i++) { | |
156 | hSecondaryAntiProtons->SetBinContent(i,-10.); | |
157 | hSecondaryAntiProtons->GetXaxis()->SetBinLabel(i,fCutName[i-1]); | |
158 | } | |
159 | hSecondaryAntiProtons->GetXaxis()->SetLabelOffset(0.01); | |
160 | hSecondaryAntiProtons->GetXaxis()->SetLabelSize(0.045); | |
161 | //_______________________________________________________// | |
162 | ||
163 | //1D for primary protons | |
0008a5a6 | 164 | //cout<<"_____________________________________________________"<<endl; |
165 | //cout<<"_______________PRIMARY PROTONS_______________________"<<endl; | |
cc0fbd97 | 166 | hPrimaryProtons->SetBinContent(1,GetPercentage(gEntriesQA2DList[0],gEntriesQA2DList[1])); |
167 | ||
0008a5a6 | 168 | for(Int_t i = 2; i < NQAHISTOSPERLIST-4; i++) |
cc0fbd97 | 169 | hPrimaryProtons->SetBinContent(i+1,GetPercentage(gEntriesQAPrimaryProtonsAcceptedList[i-2], |
0008a5a6 | 170 | gEntriesQAPrimaryProtonsRejectedList[i-2])); |
cc0fbd97 | 171 | |
172 | //1D for secondary protons | |
0008a5a6 | 173 | //cout<<"_____________________________________________________"<<endl; |
174 | //cout<<"_______________SECONDARY PROTONS_____________________"<<endl; | |
cc0fbd97 | 175 | hSecondaryProtons->SetBinContent(1,GetPercentage(gEntriesQA2DList[2],gEntriesQA2DList[3])); |
0008a5a6 | 176 | |
177 | for(Int_t i = 2; i < NQAHISTOSPERLIST-4; i++) | |
cc0fbd97 | 178 | hSecondaryProtons->SetBinContent(i+1,GetPercentage(gEntriesQASecondaryProtonsAcceptedList[i-2], |
0008a5a6 | 179 | gEntriesQASecondaryProtonsRejectedList[i-2])); |
180 | hSecondaryProtons->SetBinContent(24,GetPercentage(gEntriesQA2DList[0],gEntriesQA2DList[2])); | |
cc0fbd97 | 181 | |
182 | //1D for primary antiprotons | |
0008a5a6 | 183 | //cout<<"_________________________________________________________"<<endl; |
184 | //cout<<"_______________PRIMARY ANTIPROTONS_______________________"<<endl; | |
cc0fbd97 | 185 | hPrimaryAntiProtons->SetBinContent(1,GetPercentage(gEntriesQA2DList[4],gEntriesQA2DList[5])); |
0008a5a6 | 186 | |
187 | for(Int_t i = 2; i < NQAHISTOSPERLIST-4; i++) | |
cc0fbd97 | 188 | hPrimaryAntiProtons->SetBinContent(i+1,GetPercentage(gEntriesQAPrimaryAntiProtonsAcceptedList[i-2], |
0008a5a6 | 189 | gEntriesQAPrimaryAntiProtonsRejectedList[i-2])); |
190 | ||
cc0fbd97 | 191 | //1D for secondary antiprotons |
0008a5a6 | 192 | //cout<<"_________________________________________________________"<<endl; |
193 | //cout<<"_______________SECONDARY ANTIPROTONS_____________________"<<endl; | |
cc0fbd97 | 194 | hSecondaryAntiProtons->SetBinContent(1,GetPercentage(gEntriesQA2DList[6],gEntriesQA2DList[7])); |
cc0fbd97 | 195 | |
0008a5a6 | 196 | for(Int_t i = 2; i < NQAHISTOSPERLIST-4; i++) |
cc0fbd97 | 197 | hSecondaryAntiProtons->SetBinContent(i+1,GetPercentage(gEntriesQASecondaryAntiProtonsAcceptedList[i-2], |
0008a5a6 | 198 | gEntriesQASecondaryAntiProtonsRejectedList[i-2])); |
199 | hSecondaryAntiProtons->SetBinContent(24,GetPercentage(gEntriesQA2DList[4],gEntriesQA2DList[6])); | |
cc0fbd97 | 200 | |
201 | TLatex *t1 = new TLatex(); | |
202 | t1->SetTextSize(0.04); | |
203 | //_________________________________________________________// | |
0008a5a6 | 204 | TCanvas *c1 = new TCanvas("c1","Cut Influence - Protons",0,0,950,550); |
cc0fbd97 | 205 | c1->SetFillColor(10); c1->GetFrame()->SetFillColor(10); |
206 | c1->SetHighLightColor(10); c1->SetBottomMargin(0.15); | |
207 | c1->SetGridx(); c1->SetGridy(); | |
208 | ||
209 | for(Int_t i = 1; i <= nx; i++) { | |
210 | hPrimaryProtons->SetBinError(i,1.0); | |
211 | hSecondaryProtons->SetBinError(i,1.0); | |
212 | } | |
213 | hEmpty->Draw(); | |
214 | hPrimaryProtons->Draw("EHISTSAME"); | |
215 | hSecondaryProtons->Draw("EHISTSAME"); | |
0008a5a6 | 216 | DrawMarker(20.5, 90, 20, 1.2, 4); |
217 | t1->DrawLatex(21,88,"Primary p"); | |
218 | DrawMarker(20.5, 80, 22, 1.2, 2); | |
219 | t1->DrawLatex(21,78,"Secondary p"); | |
cc0fbd97 | 220 | |
0008a5a6 | 221 | c1->SaveAs("CutInfluence-Protons.gif"); |
cc0fbd97 | 222 | |
223 | //_________________________________________________________// | |
0008a5a6 | 224 | TCanvas *c2 = new TCanvas("c2","Cut Influence - AntiProtons",0,300,950,550); |
cc0fbd97 | 225 | c2->SetFillColor(10); c2->GetFrame()->SetFillColor(10); |
226 | c2->SetHighLightColor(10); c2->SetBottomMargin(0.15); | |
227 | c2->SetGridx(); c2->SetGridy(); | |
228 | ||
229 | for(Int_t i = 1; i <= nx; i++) { | |
230 | hPrimaryAntiProtons->SetBinError(i,1.0); | |
231 | hSecondaryAntiProtons->SetBinError(i,1.0); | |
232 | } | |
233 | hEmpty->Draw(); | |
234 | hPrimaryAntiProtons->Draw("EHISTSAME"); | |
235 | hSecondaryAntiProtons->Draw("EHISTSAME"); | |
0008a5a6 | 236 | DrawMarker(20.5, 90, 20, 1.2, 4); |
237 | t1->DrawLatex(21,88,"Primary #bar{p}"); | |
238 | DrawMarker(20.5, 80, 22, 1.2, 2); | |
239 | t1->DrawLatex(21,78,"Secondary #bar{p}"); | |
240 | ||
241 | c2->SaveAs("CutInfluence-AntiProtons.gif"); | |
242 | ||
243 | //_________________________________________________________// | |
244 | //ITS layers influence | |
245 | TH2F *hEmptyITS = new TH2F("hEmptyITS","",10,0,10,100,0,100); | |
246 | hEmptyITS->SetStats(kFALSE); | |
247 | hEmptyITS->SetMarkerStyle(kFullCircle); | |
248 | hEmptyITS->SetLineColor(2); hEmptyITS->SetMarkerColor(2); | |
249 | hEmptyITS->GetYaxis()->SetTitle("Influence of the ITS layers [%]"); | |
250 | hEmptyITS->GetYaxis()->SetTitleOffset(1.3); | |
251 | for(Int_t i = 1; i <= 6; i++) | |
252 | hEmptyITS->GetXaxis()->SetBinLabel(i,fCutITSName[i-1]); | |
253 | hEmptyITS->GetXaxis()->SetLabelOffset(0.01); | |
254 | hEmptyITS->GetXaxis()->SetLabelSize(0.045); | |
255 | ||
256 | //_________________________________________________________// | |
257 | //primary protons | |
258 | TH1F *hPrimaryProtonsITS = new TH1F("hPrimaryProtonsITS","",7,0,7); | |
259 | hPrimaryProtonsITS->SetStats(kFALSE); | |
260 | hPrimaryProtonsITS->SetMarkerStyle(kFullCircle); | |
261 | hPrimaryProtonsITS->SetLineColor(4); hPrimaryProtonsITS->SetLineWidth(2); | |
262 | hPrimaryProtonsITS->SetMarkerColor(4); | |
263 | hPrimaryProtonsITS->GetYaxis()->SetTitle("Influence of the cuts [%]"); | |
264 | for(Int_t i = 1; i <= 6; i++) { | |
265 | hPrimaryProtonsITS->SetBinContent(i,-10.); | |
266 | hPrimaryProtonsITS->GetXaxis()->SetBinLabel(i,fCutITSName[i-1]); | |
267 | } | |
268 | hPrimaryProtonsITS->GetXaxis()->SetLabelOffset(0.01); | |
269 | hPrimaryProtonsITS->GetXaxis()->SetLabelSize(0.045); | |
270 | ||
271 | //secondary protons | |
272 | TH1F *hSecondaryProtonsITS = new TH1F("hSecondaryProtonsITS","",7,0,7); | |
273 | hSecondaryProtonsITS->SetStats(kFALSE); | |
274 | hSecondaryProtonsITS->SetMarkerStyle(22); | |
275 | hSecondaryProtonsITS->SetMarkerSize(1.4); | |
276 | hSecondaryProtonsITS->SetLineColor(2); hSecondaryProtonsITS->SetLineWidth(2); | |
277 | hSecondaryProtonsITS->SetMarkerColor(2); | |
278 | hSecondaryProtonsITS->GetYaxis()->SetTitle("Influence of the cuts [%]"); | |
279 | for(Int_t i = 1; i <= 6; i++) { | |
280 | hSecondaryProtonsITS->SetBinContent(i,-10.); | |
281 | hSecondaryProtonsITS->GetXaxis()->SetBinLabel(i,fCutITSName[i-1]); | |
282 | } | |
283 | hSecondaryProtonsITS->GetXaxis()->SetLabelOffset(0.01); | |
284 | hSecondaryProtonsITS->GetXaxis()->SetLabelSize(0.045); | |
285 | ||
286 | //primary antiprotons | |
287 | TH1F *hPrimaryAntiProtonsITS = new TH1F("hPrimaryAntiProtonsITS","",7,0,7); | |
288 | hPrimaryAntiProtonsITS->SetStats(kFALSE); | |
289 | hPrimaryAntiProtonsITS->SetMarkerStyle(kFullCircle); | |
290 | hPrimaryAntiProtonsITS->SetLineColor(4); hPrimaryAntiProtonsITS->SetLineWidth(2); | |
291 | hPrimaryAntiProtonsITS->SetMarkerColor(4); | |
292 | hPrimaryAntiProtonsITS->GetYaxis()->SetTitle("Influence of the cuts [%]"); | |
293 | for(Int_t i = 1; i <= 6; i++) { | |
294 | hPrimaryAntiProtonsITS->SetBinContent(i,-10.); | |
295 | hPrimaryAntiProtonsITS->GetXaxis()->SetBinLabel(i,fCutITSName[i-1]); | |
296 | } | |
297 | hPrimaryAntiProtonsITS->GetXaxis()->SetLabelOffset(0.01); | |
298 | hPrimaryAntiProtonsITS->GetXaxis()->SetLabelSize(0.045); | |
cc0fbd97 | 299 | |
0008a5a6 | 300 | //secondary antiprotons |
301 | TH1F *hSecondaryAntiProtonsITS = new TH1F("hSecondaryAntiProtonsITS","",7,0,7); | |
302 | hSecondaryAntiProtonsITS->SetStats(kFALSE); | |
303 | hSecondaryAntiProtonsITS->SetMarkerStyle(22); | |
304 | hSecondaryAntiProtonsITS->SetMarkerSize(1.4); | |
305 | hSecondaryAntiProtonsITS->SetLineColor(2); hSecondaryAntiProtonsITS->SetLineWidth(2); | |
306 | hSecondaryAntiProtonsITS->SetMarkerColor(2); | |
307 | hSecondaryAntiProtonsITS->GetYaxis()->SetTitle("Influence of the cuts [%]"); | |
308 | for(Int_t i = 1; i <= 6; i++) { | |
309 | hSecondaryAntiProtonsITS->SetBinContent(i,-10.); | |
310 | hSecondaryAntiProtonsITS->GetXaxis()->SetBinLabel(i,fCutITSName[i-1]); | |
311 | } | |
312 | hSecondaryAntiProtonsITS->GetXaxis()->SetLabelOffset(0.01); | |
313 | hSecondaryAntiProtonsITS->GetXaxis()->SetLabelSize(0.045); | |
314 | ||
315 | //_______________________________________________________// | |
316 | TCanvas *c9 = new TCanvas("c9","Cut Influence - Protons",0,0,950,550); | |
317 | c9->SetFillColor(10); c9->GetFrame()->SetFillColor(10); | |
318 | c9->SetHighLightColor(10); c9->Divide(2,1); | |
319 | for(Int_t i = 1; i <= 6; i++) { | |
320 | hPrimaryProtonsITS->SetBinError(i,1.0); | |
321 | hSecondaryProtonsITS->SetBinError(i,1.0); | |
322 | hPrimaryAntiProtonsITS->SetBinError(i,1.0); | |
323 | hSecondaryAntiProtonsITS->SetBinError(i,1.0); | |
324 | } | |
325 | c9->cd(1)->SetBottomMargin(0.15); | |
326 | c9->cd(1)->SetLeftMargin(0.15); | |
327 | c9->cd(1)->SetGridx(); c9->cd(1)->SetGridy(); | |
328 | hEmptyITS->SetTitle("Protons"); | |
329 | hEmptyITS->DrawCopy(); | |
330 | ||
331 | for(Int_t i = 1; i < 7; i++) { | |
332 | hPrimaryProtonsITS->SetBinContent(i,GetPercentage(gEntriesQAPrimaryProtonsAcceptedList[19+i], | |
333 | gEntriesQAPrimaryProtonsRejectedList[19+i])); | |
334 | hSecondaryProtonsITS->SetBinContent(i,GetPercentage(gEntriesQASecondaryProtonsAcceptedList[19+i], | |
335 | gEntriesQASecondaryProtonsRejectedList[19+i])); | |
336 | } | |
337 | hPrimaryProtonsITS->Draw("EHISTSAME"); | |
338 | hSecondaryProtonsITS->Draw("EHISTSAME"); | |
339 | DrawMarker(6.5, 90, 20, 1.2, 4); | |
340 | t1->DrawLatex(7,88,"Primary p"); | |
341 | DrawMarker(6.5, 80, 22, 1.2, 2); | |
342 | t1->DrawLatex(7,78,"Secondary p"); | |
343 | ||
344 | c9->cd(2)->SetBottomMargin(0.15); | |
345 | c9->cd(2)->SetLeftMargin(0.15); | |
346 | c9->cd(2)->SetGridx(); c9->cd(2)->SetGridy(); | |
347 | hEmptyITS->SetTitle("Antiprotons"); | |
348 | hEmptyITS->DrawCopy(); | |
349 | for(Int_t i = 1; i < 7; i++) { | |
350 | hPrimaryAntiProtonsITS->SetBinContent(i,GetPercentage(gEntriesQAPrimaryAntiProtonsAcceptedList[19+i], | |
351 | gEntriesQAPrimaryAntiProtonsRejectedList[19+i])); | |
352 | hSecondaryAntiProtonsITS->SetBinContent(i,GetPercentage(gEntriesQASecondaryAntiProtonsAcceptedList[19+i], | |
353 | gEntriesQASecondaryAntiProtonsRejectedList[19+i])); | |
354 | } | |
355 | hPrimaryAntiProtonsITS->Draw("EHISTSAME"); | |
356 | hSecondaryAntiProtonsITS->Draw("EHISTSAME"); | |
357 | DrawMarker(6.5, 90, 20, 1.2, 4); | |
358 | t1->DrawLatex(7,88,"Primary #bar{p}"); | |
359 | DrawMarker(6.5, 80, 22, 1.2, 2); | |
360 | t1->DrawLatex(7,78,"Secondary #bar{p}"); | |
361 | ||
362 | c9->SaveAs("CutInfluence-ITS.gif"); | |
363 | } | |
364 | ||
365 | //________________________________________________// | |
366 | void DrawContamination(TList *inputList) { | |
367 | //loops over the list entries and | |
368 | //draws the rapidity and pT dependence | |
369 | //of the percentage of primary and secondary | |
370 | //protons and antiprotons after the track cuts | |
371 | cout<<"Extracting the entries for the histograms in the list: "<< | |
372 | inputList->GetName()<<"..."<<endl; | |
373 | ||
374 | TLatex *t1 = new TLatex(); | |
375 | t1->SetTextSize(0.04); | |
376 | ||
377 | TH2F *hPrimaryProtons = (TH2F *)inputList->At(0); | |
378 | TH2F *hSecondaryProtons = (TH2F *)inputList->At(2); | |
379 | TH2F *hPrimaryAntiProtons = (TH2F *)inputList->At(4); | |
380 | TH2F *hSecondaryAntiProtons = (TH2F *)inputList->At(6); | |
381 | ||
382 | //rapidity dependence | |
383 | //Protons | |
384 | TH1D *gYPrimaryProtons = (TH1D *)hPrimaryProtons->ProjectionX("gYPrimaryProtons",0,hPrimaryProtons->GetXaxis()->GetNbins(),"e"); | |
385 | TH1D *gYSecondaryProtons = (TH1D *)hSecondaryProtons->ProjectionX("gYSecondaryProtons",0,hSecondaryProtons->GetXaxis()->GetNbins(),"e"); | |
386 | TH1D *gYTotalProtons = (TH1D *)hPrimaryProtons->ProjectionX("gYTotalProtons",0,hPrimaryProtons->GetXaxis()->GetNbins(),"e"); | |
387 | gYTotalProtons->Add(gYSecondaryProtons); | |
388 | ||
389 | TH1D *gYPrimaryProtonsPercentage = new TH1D("gYPrimaryProtonsPercentage", | |
390 | "", | |
391 | hPrimaryProtons->GetXaxis()->GetNbins(), | |
392 | hPrimaryProtons->GetXaxis()->GetXmin(), | |
393 | hPrimaryProtons->GetXaxis()->GetXmax()); | |
394 | gYPrimaryProtonsPercentage->Divide(gYPrimaryProtons, | |
395 | gYTotalProtons,100.,1.0); | |
396 | gYPrimaryProtonsPercentage->SetMarkerStyle(kFullCircle); | |
397 | ||
398 | TH1D *gYSecondaryProtonsPercentage = new TH1D("gYSecondaryProtonsPercentage", | |
399 | "", | |
400 | hSecondaryProtons->GetXaxis()->GetNbins(), | |
401 | hSecondaryProtons->GetXaxis()->GetXmin(), | |
402 | hSecondaryProtons->GetXaxis()->GetXmax()); | |
403 | gYSecondaryProtonsPercentage->Divide(gYSecondaryProtons, | |
404 | gYTotalProtons,100.,1.0); | |
405 | gYSecondaryProtonsPercentage->SetMarkerStyle(kOpenCircle); | |
406 | ||
407 | ||
408 | //Antiprotons | |
409 | TH1D *gYPrimaryAntiProtons = (TH1D *)hPrimaryAntiProtons->ProjectionX("gYPrimaryAntiProtons",0,hPrimaryAntiProtons->GetXaxis()->GetNbins(),"e"); | |
410 | TH1D *gYSecondaryAntiProtons = (TH1D *)hSecondaryAntiProtons->ProjectionX("gYSecondaryAntiProtons",0,hSecondaryAntiProtons->GetXaxis()->GetNbins(),"e"); | |
411 | TH1D *gYTotalAntiProtons = (TH1D *)hPrimaryAntiProtons->ProjectionX("gYTotalAntiProtons",0,hPrimaryAntiProtons->GetXaxis()->GetNbins(),"e"); | |
412 | gYTotalAntiProtons->Add(gYSecondaryAntiProtons); | |
413 | ||
414 | TH1D *gYPrimaryAntiProtonsPercentage = new TH1D("gYPrimaryAntiProtonsPercentage", | |
415 | "", | |
416 | hPrimaryAntiProtons->GetXaxis()->GetNbins(), | |
417 | hPrimaryAntiProtons->GetXaxis()->GetXmin(), | |
418 | hPrimaryAntiProtons->GetXaxis()->GetXmax()); | |
419 | gYPrimaryAntiProtonsPercentage->Divide(gYPrimaryAntiProtons, | |
420 | gYTotalAntiProtons,100.,1.0); | |
421 | gYPrimaryAntiProtonsPercentage->SetMarkerStyle(kFullCircle); | |
422 | ||
423 | TH1D *gYSecondaryAntiProtonsPercentage = new TH1D("gYSecondaryAntiProtonsPercentage", | |
424 | "", | |
425 | hSecondaryAntiProtons->GetXaxis()->GetNbins(), | |
426 | hSecondaryAntiProtons->GetXaxis()->GetXmin(), | |
427 | hSecondaryAntiProtons->GetXaxis()->GetXmax()); | |
428 | gYSecondaryAntiProtonsPercentage->Divide(gYSecondaryAntiProtons, | |
429 | gYTotalAntiProtons,100.,1.0); | |
430 | gYSecondaryAntiProtonsPercentage->SetMarkerStyle(kOpenCircle); | |
431 | ||
432 | ||
433 | TH2F *hEmptyY = new TH2F("hEmptyCompositionY","", | |
434 | 100,-1.2,1.2,100,-10.0,130); | |
435 | hEmptyY->SetStats(kFALSE); | |
436 | hEmptyY->GetYaxis()->SetTitle("Particle composition [%]"); | |
437 | hEmptyY->GetYaxis()->SetTitleOffset(1.3); | |
438 | hEmptyY->GetXaxis()->SetTitle("y"); | |
439 | ||
440 | TCanvas *c7 = new TCanvas("c7","(Anti)Proton composition", | |
441 | 200,0,950,550); | |
442 | c7->SetFillColor(10); c7->GetFrame()->SetFillColor(10); | |
443 | c7->SetHighLightColor(10); c7->Divide(2,1); | |
444 | ||
445 | c7->cd(1)->SetBottomMargin(0.15); | |
446 | c7->cd(1)->SetLeftMargin(0.15); | |
447 | c7->cd(1)->SetGridx(); c7->cd(1)->SetGridy(); | |
448 | hEmptyY->SetTitle("Protons"); | |
449 | hEmptyY->DrawCopy(); | |
450 | gYPrimaryProtonsPercentage->Draw("ESAME"); | |
451 | gYSecondaryProtonsPercentage->Draw("ESAME"); | |
452 | ||
453 | DrawMarker(0, 55, kFullCircle, 1.2, 1); | |
454 | t1->DrawLatex(0.1,53,"Primaries"); | |
455 | DrawMarker(0, 45, kOpenCircle, 1.2, 1); | |
456 | t1->DrawLatex(0.1,43,"Secondaries"); | |
457 | ||
458 | c7->cd(2)->SetBottomMargin(0.15); | |
459 | c7->cd(2)->SetLeftMargin(0.15); | |
460 | c7->cd(2)->SetGridx(); c7->cd(2)->SetGridy(); | |
461 | hEmptyY->SetTitle("Antiprotons"); | |
462 | hEmptyY->DrawCopy(); | |
463 | gYPrimaryAntiProtonsPercentage->Draw("ESAME"); | |
464 | gYSecondaryAntiProtonsPercentage->Draw("ESAME"); | |
465 | ||
466 | DrawMarker(0, 55, kFullCircle, 1.2, 1); | |
467 | t1->DrawLatex(0.1,53,"Primaries"); | |
468 | DrawMarker(0, 45, kOpenCircle, 1.2, 1); | |
469 | t1->DrawLatex(0.1,43,"Secondaries"); | |
470 | ||
471 | c7->SaveAs("Contamination-Protons-Rapidity.gif"); | |
472 | ||
473 | //pT dependence | |
474 | //Protons | |
475 | TH1D *gPtPrimaryProtons = (TH1D *)hPrimaryProtons->ProjectionY("gPtPrimaryProtons",0,hPrimaryProtons->GetYaxis()->GetNbins(),"e"); | |
476 | TH1D *gPtSecondaryProtons = (TH1D *)hSecondaryProtons->ProjectionY("gPtSecondaryProtons",0,hSecondaryProtons->GetYaxis()->GetNbins(),"e"); | |
477 | TH1D *gPtTotalProtons = (TH1D *)hPrimaryProtons->ProjectionY("gPtTotalProtons",0,hPrimaryProtons->GetYaxis()->GetNbins(),"e"); | |
478 | gPtTotalProtons->Add(gPtSecondaryProtons); | |
479 | ||
480 | TH1D *gPtPrimaryProtonsPercentage = new TH1D("gPtPrimaryProtonsPercentage", | |
481 | "", | |
482 | hPrimaryProtons->GetYaxis()->GetNbins(), | |
483 | hPrimaryProtons->GetYaxis()->GetXmin(), | |
484 | hPrimaryProtons->GetYaxis()->GetXmax()); | |
485 | gPtPrimaryProtonsPercentage->Divide(gPtPrimaryProtons, | |
486 | gPtTotalProtons,100.,1.0); | |
487 | gPtPrimaryProtonsPercentage->SetMarkerStyle(kFullCircle); | |
488 | ||
489 | TH1D *gPtSecondaryProtonsPercentage = new TH1D("gPtSecondaryProtonsPercentage", | |
490 | "", | |
491 | hSecondaryProtons->GetYaxis()->GetNbins(), | |
492 | hSecondaryProtons->GetYaxis()->GetXmin(), | |
493 | hSecondaryProtons->GetYaxis()->GetXmax()); | |
494 | gPtSecondaryProtonsPercentage->Divide(gPtSecondaryProtons, | |
495 | gPtTotalProtons,100.,1.0); | |
496 | gPtSecondaryProtonsPercentage->SetMarkerStyle(kOpenCircle); | |
497 | ||
498 | ||
499 | //Antiprotons | |
500 | TH1D *gPtPrimaryAntiProtons = (TH1D *)hPrimaryAntiProtons->ProjectionY("gPtPrimaryAntiProtons",0,hPrimaryAntiProtons->GetYaxis()->GetNbins(),"e"); | |
501 | TH1D *gPtSecondaryAntiProtons = (TH1D *)hSecondaryAntiProtons->ProjectionY("gPtSecondaryAntiProtons",0,hSecondaryAntiProtons->GetYaxis()->GetNbins(),"e"); | |
502 | TH1D *gPtTotalAntiProtons = (TH1D *)hPrimaryAntiProtons->ProjectionY("gPtTotalAntiProtons",0,hPrimaryAntiProtons->GetYaxis()->GetNbins(),"e"); | |
503 | gPtTotalAntiProtons->Add(gPtSecondaryAntiProtons); | |
504 | ||
505 | TH1D *gPtPrimaryAntiProtonsPercentage = new TH1D("gPtPrimaryAntiProtonsPercentage", | |
506 | "", | |
507 | hPrimaryAntiProtons->GetYaxis()->GetNbins(), | |
508 | hPrimaryAntiProtons->GetYaxis()->GetXmin(), | |
509 | hPrimaryAntiProtons->GetYaxis()->GetXmax()); | |
510 | gPtPrimaryAntiProtonsPercentage->Divide(gPtPrimaryAntiProtons, | |
511 | gPtTotalAntiProtons,100.,1.0); | |
512 | gPtPrimaryAntiProtonsPercentage->SetMarkerStyle(kFullCircle); | |
513 | ||
514 | TH1D *gPtSecondaryAntiProtonsPercentage = new TH1D("gPtSecondaryAntiProtonsPercentage", | |
515 | "", | |
516 | hSecondaryAntiProtons->GetYaxis()->GetNbins(), | |
517 | hSecondaryAntiProtons->GetYaxis()->GetXmin(), | |
518 | hSecondaryAntiProtons->GetYaxis()->GetXmax()); | |
519 | gPtSecondaryAntiProtonsPercentage->Divide(gPtSecondaryAntiProtons, | |
520 | gPtTotalAntiProtons,100.,1.0); | |
521 | gPtSecondaryAntiProtonsPercentage->SetMarkerStyle(kOpenCircle); | |
522 | ||
523 | TH2F *hEmptyPt = new TH2F("hEmptyCompositionPt","", | |
524 | 100,0.0,4.0,100,-10.0,130); | |
525 | hEmptyPt->SetStats(kFALSE); | |
526 | hEmptyPt->GetYaxis()->SetTitle("Particle composition [%]"); | |
527 | hEmptyPt->GetYaxis()->SetTitleOffset(1.3); | |
528 | hEmptyPt->GetXaxis()->SetTitle("P_{T} [GeV/c]"); | |
529 | ||
530 | TCanvas *c8 = new TCanvas("c8","(Anti)Proton composition", | |
531 | 200,100,950,550); | |
532 | c8->SetFillColor(10); c8->GetFrame()->SetFillColor(10); | |
533 | c8->SetHighLightColor(10); c8->Divide(2,1); | |
534 | ||
535 | c8->cd(1)->SetBottomMargin(0.15); | |
536 | c8->cd(1)->SetLeftMargin(0.15); | |
537 | c8->cd(1)->SetGridx(); c8->cd(1)->SetGridy(); | |
538 | hEmptyPt->SetTitle("Protons"); | |
539 | hEmptyPt->DrawCopy(); | |
540 | gPtPrimaryProtonsPercentage->Draw("ESAME"); | |
541 | gPtSecondaryProtonsPercentage->Draw("ESAME"); | |
542 | ||
543 | DrawMarker(2.0, 55, kFullCircle, 1.2, 1); | |
544 | t1->DrawLatex(2.1,53,"Primaries"); | |
545 | DrawMarker(2.0, 45, kOpenCircle, 1.2, 1); | |
546 | t1->DrawLatex(2.1,43,"Secondaries"); | |
547 | ||
548 | c8->cd(2)->SetBottomMargin(0.15); | |
549 | c8->cd(2)->SetLeftMargin(0.15); | |
550 | c8->cd(2)->SetGridx(); c8->cd(2)->SetGridy(); | |
551 | hEmptyPt->SetTitle("Antirotons"); | |
552 | hEmptyPt->DrawCopy(); | |
553 | gPtPrimaryAntiProtonsPercentage->Draw("ESAME"); | |
554 | gPtSecondaryAntiProtonsPercentage->Draw("ESAME"); | |
555 | ||
556 | DrawMarker(2.0, 55, kFullCircle, 1.2, 1); | |
557 | t1->DrawLatex(2.1,53,"Primaries"); | |
558 | DrawMarker(2.0, 45, kOpenCircle, 1.2, 1); | |
559 | t1->DrawLatex(2.1,43,"Secondaries"); | |
560 | ||
561 | c8->SaveAs("Contamination-Protons-Pt.gif"); | |
cc0fbd97 | 562 | } |
563 | ||
564 | //________________________________________________// | |
565 | void GetQAEntries(TList *inputList, Double_t *entries) { | |
566 | //loops over the list entries | |
567 | //extracts the entries for each histogram | |
0008a5a6 | 568 | //cout<<"Extracting the entries for the histograms in the list: "<< |
569 | //inputList->GetName()<<"..."<<endl; | |
cc0fbd97 | 570 | |
571 | for(Int_t i = 0; i < inputList->GetEntries(); i++) { | |
572 | TH1F *gHist = (TH1F *)inputList->At(i); | |
573 | entries[i] = gHist->GetEntries(); | |
574 | cout<<"Histogram: "<<gHist->GetName()<< | |
575 | " - Entries: "<<entries[i]<<endl; | |
576 | gHist = 0; | |
577 | } | |
578 | } | |
579 | ||
580 | //________________________________________________// | |
581 | Double_t GetPercentage(Double_t nPassEntries, | |
582 | Double_t nRejectEntries) { | |
583 | //returns the percentage of tracks that were rejected by a cut | |
584 | Int_t nTotalEntries = nPassEntries + nRejectEntries; | |
585 | ||
586 | if(nTotalEntries == 0) | |
587 | return -1; | |
588 | ||
589 | return 100.*nRejectEntries/nTotalEntries; | |
590 | } | |
591 | ||
0008a5a6 | 592 | //________________________________________// |
593 | void drawMCQA(const char *filename) { | |
594 | //Function to display the composition of secondary (anti)protons | |
595 | //The histogram shows the percentage of secondary (anti)protons | |
596 | //originating from each particle species. | |
597 | //The box summarizes the MC process that gave these secondary (anti)protons | |
598 | TDatabasePDG *db = TDatabasePDG::Instance(); | |
599 | TParticlePDG *p = 0x0; | |
600 | ||
601 | TFile *f = TFile::Open(filename); | |
602 | TList *list2 = (TList *)f->Get("outputList2"); | |
603 | TH3F *gHistYPtPDGProtons = (TH3F *)list2->At(0); | |
604 | TH3F *gHistYPtPDGAntiProtons = (TH3F *)list2->At(1); | |
605 | TList *list3 = (TList *)f->Get("outputList3"); | |
606 | ||
607 | Double_t nParticleCompositionProtonY[100], nParticleCompositionProtonPt[100]; | |
608 | Double_t nParticleCompositionAntiProtonY[100], nParticleCompositionAntiProtonPt[100]; | |
609 | Double_t gY[100], gPt[100]; | |
610 | for(Int_t iBins = 0; iBins < 100; iBins++) { | |
611 | nParticleCompositionProtonY[iBins] = 0; | |
612 | nParticleCompositionProtonPt[iBins] = 0; | |
613 | nParticleCompositionAntiProtonY[iBins] = 0; | |
614 | nParticleCompositionAntiProtonPt[iBins] = 0; | |
615 | gY[iBins] = 0; | |
616 | gPt[iBins] = 0; | |
617 | } | |
618 | ||
619 | TGraph *gParticleProtonY[14]; | |
620 | TGraph *gParticleProtonPt[14]; | |
621 | TGraph *gParticleAntiProtonY[14]; | |
622 | TGraph *gParticleAntiProtonPt[14]; | |
623 | for(Int_t iParticle = 0; iParticle < 14; iParticle++) { | |
624 | GetComposition(iParticle, | |
625 | gHistYPtPDGProtons, | |
626 | nParticleCompositionProtonY, | |
627 | gY, nParticleCompositionProtonPt, gPt); | |
628 | gParticleProtonY[iParticle] = new TGraph(gHistYPtPDGProtons->GetNbinsX(), | |
629 | gY,nParticleCompositionProtonY); | |
630 | gParticleProtonY[iParticle]->SetMarkerStyle(iParticle+20); | |
631 | gParticleProtonY[iParticle]->SetMarkerSize(1.2); | |
632 | ||
633 | gParticleProtonPt[iParticle] = new TGraph(gHistYPtPDGProtons->GetNbinsY(), | |
634 | gPt,nParticleCompositionProtonPt); | |
635 | gParticleProtonPt[iParticle]->SetMarkerStyle(iParticle+20); | |
636 | gParticleProtonPt[iParticle]->SetMarkerSize(1.2); | |
637 | ||
638 | GetComposition(iParticle, | |
639 | gHistYPtPDGAntiProtons, | |
640 | nParticleCompositionAntiProtonY, | |
641 | gY, nParticleCompositionAntiProtonPt, gPt); | |
642 | gParticleAntiProtonY[iParticle] = new TGraph(gHistYPtPDGAntiProtons->GetNbinsX(), | |
643 | gY,nParticleCompositionAntiProtonY); | |
644 | gParticleAntiProtonY[iParticle]->SetMarkerStyle(iParticle+20); | |
645 | gParticleAntiProtonY[iParticle]->SetMarkerSize(1.2); | |
646 | ||
647 | gParticleAntiProtonPt[iParticle] = new TGraph(gHistYPtPDGAntiProtons->GetNbinsY(), | |
648 | gPt,nParticleCompositionAntiProtonPt); | |
649 | gParticleAntiProtonPt[iParticle]->SetMarkerStyle(iParticle+20); | |
650 | gParticleAntiProtonPt[iParticle]->SetMarkerSize(1.2); | |
651 | } | |
652 | ||
653 | //_________________________________________________________// | |
654 | char *fParticleName[14] = {"Primary","K_{L}","#pi","K_{S}","K", | |
655 | "n","p","#Sigma^{-}","#Lambda","#Sigma^{+}", | |
656 | "#Xi^{-}","#Xi^{-}","#Omega^{-}"}; | |
657 | TLatex *t1 = new TLatex(); | |
658 | t1->SetTextSize(0.04); | |
659 | ||
660 | TH2F *hEmptyY = new TH2F("hEmptyY","",100,-1.2,1.2,100,0,100); | |
661 | hEmptyY->SetStats(kFALSE); | |
662 | hEmptyY->GetYaxis()->SetTitle("Particle composition [%]"); | |
663 | hEmptyY->GetXaxis()->SetTitle("y"); | |
664 | ||
665 | TCanvas *c3 = new TCanvas("c3","MC secondary composition - Protons", | |
666 | 0,0,650,550); | |
667 | c3->SetFillColor(10); c3->GetFrame()->SetFillColor(10); | |
668 | c3->SetHighLightColor(10); c3->SetBottomMargin(0.15); | |
669 | c3->SetGridx(); c3->SetGridy(); | |
670 | hEmptyY->Draw(); | |
671 | for(Int_t iParticle = 0; iParticle < 10; iParticle++) { | |
672 | gParticleProtonY[iParticle]->Draw("P"); | |
673 | if(iParticle < 5) { | |
674 | DrawMarker(-1.1, 95-5*iParticle, 20+iParticle, 1.2, 1); | |
675 | t1->DrawLatex(-1.0,93-5*iParticle,fParticleName[iParticle]); | |
676 | } | |
677 | else { | |
678 | DrawMarker(0.2, 95-5*(iParticle-5), 20+iParticle, 1.2, 1); | |
679 | t1->DrawLatex(0.3,93-5*(iParticle-5),fParticleName[iParticle]); | |
680 | } | |
681 | } | |
682 | ||
683 | TCanvas *c5 = new TCanvas("c5","MC secondary composition - antiProtons", | |
684 | 0,0,650,550); | |
685 | c5->SetFillColor(10); c5->GetFrame()->SetFillColor(10); | |
686 | c5->SetHighLightColor(10); c5->SetBottomMargin(0.15); | |
687 | c5->SetGridx(); c5->SetGridy(); | |
688 | hEmptyY->Draw(); | |
689 | for(Int_t iParticle = 0; iParticle < 10; iParticle++) { | |
690 | gParticleAntiProtonY[iParticle]->Draw("P"); | |
691 | if(iParticle < 5) { | |
692 | DrawMarker(-1.1, 95-5*iParticle, 20+iParticle, 1.2, 1); | |
693 | t1->DrawLatex(-1.0,93-5*iParticle,fParticleName[iParticle]); | |
694 | } | |
695 | else { | |
696 | DrawMarker(0.2, 95-5*(iParticle-5), 20+iParticle, 1.2, 1); | |
697 | t1->DrawLatex(0.3,93-5*(iParticle-5),fParticleName[iParticle]); | |
698 | } | |
699 | } | |
700 | ||
701 | TH2F *hEmptyPt = new TH2F("hEmptyPt","",100,0.0,4.0,100,0,100); | |
702 | hEmptyPt->SetStats(kFALSE); | |
703 | hEmptyPt->GetYaxis()->SetTitle("Particle composition [%]"); | |
704 | hEmptyPt->GetXaxis()->SetTitle("P_{T} [GeV/c]"); | |
705 | ||
706 | TCanvas *c4 = new TCanvas("c4","MC secondary composition - Protons", | |
707 | 0,0,650,550); | |
708 | c4->SetFillColor(10); c4->GetFrame()->SetFillColor(10); | |
709 | c4->SetHighLightColor(10); c4->SetBottomMargin(0.15); | |
710 | c4->SetGridx(); c4->SetGridy(); | |
711 | hEmptyPt->Draw(); | |
712 | for(Int_t iParticle = 0; iParticle < 10; iParticle++) { | |
713 | if(iParticle < 5) { | |
714 | DrawMarker(0.2, 95-5*iParticle, 20+iParticle, 1.2, 1); | |
715 | t1->DrawLatex(0.3,93-5*iParticle,fParticleName[iParticle]); | |
716 | } | |
717 | else { | |
718 | DrawMarker(2.2, 95-5*(iParticle-5), 20+iParticle, 1.2, 1); | |
719 | t1->DrawLatex(2.3,93-5*(iParticle-5),fParticleName[iParticle]); | |
720 | } | |
721 | gParticleProtonPt[iParticle]->Draw("P"); | |
722 | } | |
723 | ||
724 | TCanvas *c6 = new TCanvas("c6","MC secondary composition - AntiProtons", | |
725 | 0,0,650,550); | |
726 | c6->SetFillColor(10); c6->GetFrame()->SetFillColor(10); | |
727 | c6->SetHighLightColor(10); c6->SetBottomMargin(0.15); | |
728 | c6->SetGridx(); c6->SetGridy(); | |
729 | hEmptyPt->Draw(); | |
730 | for(Int_t iParticle = 0; iParticle < 10; iParticle++) { | |
731 | if(iParticle < 5) { | |
732 | DrawMarker(0.2, 95-5*iParticle, 20+iParticle, 1.2, 1); | |
733 | t1->DrawLatex(0.3,93-5*iParticle,fParticleName[iParticle]); | |
734 | } | |
735 | else { | |
736 | DrawMarker(2.2, 95-5*(iParticle-5), 20+iParticle, 1.2, 1); | |
737 | t1->DrawLatex(2.3,93-5*(iParticle-5),fParticleName[iParticle]); | |
738 | } | |
739 | gParticleAntiProtonPt[iParticle]->Draw("P"); | |
740 | } | |
741 | } | |
742 | ||
743 | //________________________________________// | |
744 | void GetComposition(Int_t iSpecies, | |
745 | TH3F *gHist, | |
746 | Double_t *nParticleCompositionY, | |
747 | Double_t *gY, | |
748 | Double_t *nParticleCompositionPt, | |
749 | Double_t *gPt) { | |
750 | //Returns the pT and y dependence of the MC composition | |
751 | Double_t ymin = gHist->GetXaxis()->GetXmin(); | |
752 | Double_t ymax = gHist->GetXaxis()->GetXmax(); | |
753 | Double_t nybins = gHist->GetNbinsX(); | |
754 | Double_t ptmin = gHist->GetYaxis()->GetXmin(); | |
755 | Double_t ptmax = gHist->GetYaxis()->GetXmax(); | |
756 | Double_t nptbins = gHist->GetNbinsY(); | |
757 | Double_t nTotalY[100], nTotalPt[100]; | |
758 | for(Int_t iBins = 0; iBins < 100; iBins++) { | |
759 | nParticleCompositionY[iBins] = 0; | |
760 | nParticleCompositionPt[iBins] = 0; | |
761 | nTotalY[iBins] = 0.0; | |
762 | nTotalPt[iBins] = 0.0; | |
763 | } | |
764 | ||
765 | //rapidity dependence | |
766 | //cout<<"Ymin: "<<ymin<<" - Ymax: "<<ymax<<" - Ybins: "<<nybins<<endl; | |
767 | for(Int_t iXbins = 1; iXbins <= gHist->GetNbinsX(); iXbins++) { | |
768 | for(Int_t iZbins = 1; iZbins <= gHist->GetNbinsZ(); iZbins++) { | |
769 | for(Int_t iYbins = 1; iYbins <= gHist->GetNbinsY(); iYbins++) { | |
770 | nTotalY[iXbins-1] += gHist->GetBinContent(iXbins,iYbins,iZbins); | |
771 | } | |
772 | } | |
773 | } | |
774 | ||
775 | for(Int_t iXbins = 1; iXbins <= gHist->GetNbinsX(); iXbins++) { | |
776 | for(Int_t iYbins = 1; iYbins <= gHist->GetNbinsY(); iYbins++) { | |
777 | nParticleCompositionY[iXbins-1] += 100.*gHist->GetBinContent(iXbins,iYbins,iSpecies+1)/nTotalY[iXbins-1]; | |
778 | if(nParticleCompositionY[iXbins-1] == 0) | |
779 | nParticleCompositionY[iXbins-1] = -10.0; | |
780 | }//pt loop | |
781 | gY[iXbins-1] = ymin + (iXbins-1)*(ymax - ymin)/nybins + 0.5*(ymax - ymin)/nybins; | |
782 | //cout<<"y: "<<gY[iXbins-1]<< | |
783 | //" - test: "<<ymin + (iXbins-1)*(ymax - ymin)/nybins + 0.5*(ymax - ymin)/nybins<< | |
784 | //" - Number of protons: "<<nY[iXbins-1]<< | |
785 | //" - Total: "<<nTotalY[iXbins-1]<< | |
786 | //" - Percentage: "<<nParticleCompositionY[iXbins-1]<<endl; | |
787 | }//y loop | |
788 | ||
789 | //pt dependence | |
790 | //cout<<"Ptmin: "<<ptmin<<" - Ptmax: "<<ptmax<<" - Ptbins: "<<nptbins<<endl; | |
791 | for(Int_t iYbins = 1; iYbins <= gHist->GetNbinsY(); iYbins++) { | |
792 | for(Int_t iZbins = 1; iZbins <= gHist->GetNbinsZ(); iZbins++) { | |
793 | for(Int_t iXbins = 1; iXbins <= gHist->GetNbinsX(); iXbins++) { | |
794 | nTotalPt[iYbins-1] += gHist->GetBinContent(iXbins,iYbins,iZbins); | |
795 | } | |
796 | } | |
797 | } | |
798 | ||
799 | for(Int_t iYbins = 1; iYbins <= gHist->GetNbinsY(); iYbins++) { | |
800 | for(Int_t iXbins = 1; iXbins <= gHist->GetNbinsX(); iXbins++) { | |
801 | nParticleCompositionPt[iYbins-1] += 100.*gHist->GetBinContent(iXbins,iYbins,iSpecies+1)/nTotalPt[iYbins-1]; | |
802 | if(nParticleCompositionPt[iYbins-1] == 0) | |
803 | nParticleCompositionPt[iYbins-1] = -10.0; | |
804 | }//pt loop | |
805 | gPt[iYbins-1] = ptmin + (iYbins-1)*(ptmax - ptmin)/nptbins + 0.5*(ptmax - ptmin)/nptbins; | |
806 | //cout<<"Pt: "<<gPt[iYbins-1]<< | |
807 | //" - test: "<<ptmin + (iYbins-1)*(ptmax - ptmin)/nptbins + 0.5*(ptmax - ptmin)/nptbins<< | |
808 | //" - Number of protons: "<<nY[iXbins-1]<< | |
809 | //" - Total: "<<nTotalPt[iYbins-1]<< | |
810 | //" - Percentage: "<<nParticleCompositionPt[iYbins-1]<<endl; | |
811 | }//pt loop | |
812 | } | |
813 | ||
cc0fbd97 | 814 | //________________________________________________// |
0008a5a6 | 815 | void DrawMarker(Double_t x, Double_t y, Int_t style, |
816 | Double_t size, Int_t color) { | |
cc0fbd97 | 817 | TMarker *m = new TMarker(x,y,style); |
818 | m->SetMarkerSize(size); | |
819 | m->SetMarkerColor(color); | |
820 | m->Draw(); | |
821 | } | |
0008a5a6 | 822 |