]>
Commit | Line | Data |
---|---|---|
f5ec6c30 | 1 | // macro to applying slice method to calculate |
2 | // efficiencies, on a CF container created with | |
3 | // AliCFHeavyFlavourTaskMultiVarMultiStep (commenting cut on | |
4 | // cosPoitingAngle at REC PPR step) | |
5 | // slicing on cosPointingAngle | |
6 | // The efficiency are calculated by default using RecPPR / GenAcc steps | |
7 | ||
8 | ||
9 | #include <Riostream.h> | |
10 | ||
11 | extern TRandom *gRandom; | |
12 | extern TBenchmark *gBenchmark; | |
13 | extern TSystem *gSystem; | |
14 | ||
15 | void ReadCFHeavyFlavourOutputSlice(Int_t stepDen=1, | |
16 | Int_t stepNum=5, | |
17 | const char* plotsDir="./SlicePlots/GenAcc_RecPPR") | |
18 | { | |
19 | ||
20 | gROOT->SetStyle("Plain"); | |
21 | gStyle->SetPalette(1); | |
22 | gStyle->SetOptStat(0); | |
23 | gStyle->SetPalette(1); | |
24 | gStyle->SetCanvasColor(0); | |
25 | gStyle->SetFrameFillColor(0); | |
26 | gStyle->SetOptTitle(0); | |
27 | ||
28 | gSystem->SetIncludePath("-I. -I$ALICE_ROOT/include -I$ROOTSYS/include"); | |
29 | gSystem->Load("libANALYSIS.so"); | |
30 | gSystem->Load("libANALYSISalice.so"); | |
31 | gSystem->Load("$ALICE_ROOT/CORRFW/libCORRFW.so") ; | |
32 | ||
33 | // Expected container: | |
34 | // number of selection steps | |
35 | // 0 --> MC | |
36 | // 1 --> MC Acceptance | |
37 | // 2 --> Reco | |
38 | // 3 --> Reco in Acceptance | |
39 | // 4 --> Reco with n. of ITS clusters | |
40 | // 5 --> Reco PPR cuts | |
41 | // variables on the grid: pt, y, cosThetaStar, ptPi, ptK, cTau, dca, d0pi, d0K, d0xd0, cosPointingAngle | |
42 | ||
43 | // Flag the sel steps | |
44 | Int_t stepGen=0; | |
45 | Int_t stepGenAcc=1; | |
46 | Int_t stepRec=2; | |
47 | Int_t stepRecAcc=3; | |
48 | Int_t stepRecITSClus=4; | |
49 | Int_t stepRecPPR=5; | |
50 | ||
51 | //the sensitive variables, their indeces | |
52 | Int_t ipt =0; | |
53 | Int_t iy=1; | |
54 | UInt_t icTS = 2; //cTS stands for cosThetaStar | |
55 | UInt_t iptPi = 3; | |
56 | UInt_t iptK = 4; | |
57 | UInt_t icT = 5; | |
58 | UInt_t idca = 6; | |
59 | UInt_t id0pi = 7; | |
60 | UInt_t id0K = 8; | |
61 | UInt_t id0xd0 = 9; | |
62 | UInt_t ipointing = 10; | |
63 | ||
64 | // Read the container from file | |
65 | TFile *file = new TFile("./output.root"); | |
66 | AliCFContainer *data = (AliCFContainer*) (file->Get("container")); | |
67 | ||
68 | TH1D *hMCpt1D = data->ShowProjection(ipt, stepGen); | |
69 | TH1D *hMCAccpt1D = data->ShowProjection(ipt, stepGenAcc); | |
70 | TH1D *hRECpt1D = data->ShowProjection(ipt, stepRec); | |
71 | TH1D *hRECAccpt1D = data->ShowProjection(ipt, stepRecAcc); | |
72 | TH1D *hRECITSClpt1D = data->ShowProjection(ipt, stepRecITSClus); | |
73 | TH1D *hRECPPRpt1D = data->ShowProjection(ipt, stepRecPPR); | |
74 | ||
75 | TH1D *hMCy1D = data->ShowProjection(iy, stepGen); | |
76 | TH1D *hMCAccy1D = data->ShowProjection(iy, stepGenAcc); | |
77 | TH1D *hRECy1D = data->ShowProjection(iy, stepRec); | |
78 | TH1D *hRECAccy1D = data->ShowProjection(iy, stepRecAcc); | |
79 | TH1D *hRECITSCly1D = data->ShowProjection(iy, stepRecITSClus); | |
80 | TH1D *hRECPPRy1D = data->ShowProjection(iy, stepRecPPR); | |
81 | ||
82 | TH1D *hMCcTS1D = data->ShowProjection(icTS, stepGen); | |
83 | TH1D *hMCAcccTS1D = data->ShowProjection(icTS, stepGenAcc); | |
84 | TH1D *hRECcTS1D = data->ShowProjection(icTS, stepRec); | |
85 | TH1D *hRECAcccTS1D = data->ShowProjection(icTS, stepRecAcc); | |
86 | TH1D *hRECITSClcTS1D = data->ShowProjection(icTS, stepRecITSClus); | |
87 | TH1D *hRECPPRcTS1D = data->ShowProjection(icTS, stepRecPPR); | |
88 | ||
89 | TH1D *hMCptPi1D = data->ShowProjection(iptPi, stepGen); | |
90 | TH1D *hMCAccptPi1D = data->ShowProjection(iptPi, stepGen); | |
91 | TH1D *hRECptPi1D = data->ShowProjection(iptPi, stepRec); | |
92 | TH1D *hRECAccptPi1D = data->ShowProjection(iptPi, stepRecAcc); | |
93 | TH1D *hRECITSClptPi1D = data->ShowProjection(iptPi, stepRecITSClus); | |
94 | TH1D *hRECPPRptPi1D = data->ShowProjection(iptPi, stepRecPPR); | |
95 | ||
96 | TH1D *hMCptK1D = data->ShowProjection(iptK, stepGen); | |
97 | TH1D *hMCAccptK1D = data->ShowProjection(iptK, stepGenAcc); | |
98 | TH1D *hRECptK1D = data->ShowProjection(iptK, stepRec); | |
99 | TH1D *hRECAccptK1D = data->ShowProjection(iptK, stepRecAcc); | |
100 | TH1D *hRECITSClptK1D = data->ShowProjection(iptK, stepRecITSClus); | |
101 | TH1D *hRECPPRptK1D = data->ShowProjection(iptK, stepRecPPR); | |
102 | ||
103 | TH1D *hMCcT1D = data->ShowProjection(icT, stepGen); | |
104 | TH1D *hMCAcccT1D = data->ShowProjection(icT, stepGenAcc); | |
105 | TH1D *hRECcT1D = data->ShowProjection(icT, stepRec); | |
106 | TH1D *hRECAcccT1D = data->ShowProjection(icT, stepRecAcc); | |
107 | TH1D *hRECITSClcT1D = data->ShowProjection(icT, stepRecITSClus); | |
108 | TH1D *hRECPPRcT1D = data->ShowProjection(icT, stepRecPPR); | |
109 | ||
110 | TH1D *hMCdca1D = data->ShowProjection(idca, stepGen); | |
111 | TH1D *hMCAccdca1D = data->ShowProjection(idca, stepGenAcc); | |
112 | TH1D *hRECdca1D = data->ShowProjection(idca, stepRec); | |
113 | TH1D *hRECAccdca1D = data->ShowProjection(idca, stepRecAcc); | |
114 | TH1D *hRECITSCldca1D = data->ShowProjection(idca, stepRecITSClus); | |
115 | TH1D *hRECPPRdca1D = data->ShowProjection(idca, stepRecPPR); | |
116 | ||
117 | TH1D *hMCd0pi1D = data->ShowProjection(id0pi, stepGen); | |
118 | TH1D *hMCAccd0pi1D = data->ShowProjection(id0pi, stepGenAcc); | |
119 | TH1D *hRECd0pi1D = data->ShowProjection(id0pi, stepRec); | |
120 | TH1D *hRECAccd0pi1D = data->ShowProjection(id0pi, stepRecAcc); | |
121 | TH1D *hRECITSCld0pi1D = data->ShowProjection(id0pi, stepRecITSClus); | |
122 | TH1D *hRECPPRd0pi1D = data->ShowProjection(id0pi, stepRecPPR); | |
123 | ||
124 | TH1D *hMCd0K1D = data->ShowProjection(id0K, stepGen); | |
125 | TH1D *hMCAccd0K1D = data->ShowProjection(id0K, stepGenAcc); | |
126 | TH1D *hRECd0K1D = data->ShowProjection(id0K, stepRec); | |
127 | TH1D *hRECAccd0K1D = data->ShowProjection(id0K, stepRecAcc); | |
128 | TH1D *hRECITSCld0K1D = data->ShowProjection(id0K, stepRecITSClus); | |
129 | TH1D *hRECPPRd0K1D = data->ShowProjection(id0K, stepRecPPR); | |
130 | ||
131 | TH1D *hMCd0xd01D = data->ShowProjection(id0xd0, stepGen); | |
132 | TH1D *hMCAccd0xd01D = data->ShowProjection(id0xd0, stepGenAcc); | |
133 | TH1D *hRECd0xd01D = data->ShowProjection(id0xd0, stepRec); | |
134 | TH1D *hRECAccd0xd01D = data->ShowProjection(id0xd0, stepRecAcc); | |
135 | TH1D *hRECITSCld0xd01D = data->ShowProjection(id0xd0, stepRecITSClus); | |
136 | TH1D *hRECPPRd0xd01D = data->ShowProjection(id0xd0, stepRecPPR); | |
137 | ||
138 | TH1D *hMCpointing1D = data->ShowProjection(ipointing, stepGen); | |
139 | TH1D *hMCAccpointing1D = data->ShowProjection(ipointing, stepGenAcc); | |
140 | TH1D *hRECpointing1D = data->ShowProjection(ipointing, stepRec); | |
141 | TH1D *hRECAccpointing1D = data->ShowProjection(ipointing, stepRecAcc); | |
142 | TH1D *hRECITSClpointing1D = data->ShowProjection(ipointing, stepRecITSClus); | |
143 | TH1D *hRECPPRpointing1D = data->ShowProjection(ipointing, stepRecPPR); | |
144 | ||
145 | //construct the efficiency grid from the data container | |
146 | AliCFEffGrid *eff = new AliCFEffGrid("eff"," The efficiency",*data); | |
147 | eff->CalculateEfficiency(stepNum,stepDen); //eff= step1/step0 | |
148 | ||
149 | //The efficiency along the variables | |
150 | TCanvas *ceff =new TCanvas("ceff"," Efficiency",0,0,1600,1200); | |
151 | ceff->Divide(4,3); | |
152 | TCanvas *ceffpt = new TCanvas("ceffpt","Efficiency vs pt",50,50,550,550); | |
153 | TCanvas *ceffy = new TCanvas("ceffy","Efficiency vs y",50,50,550,550); | |
154 | TCanvas *ceffcTS = new TCanvas("ceffcTS","Efficiency vs cosThetaStar",50,50,550,550); | |
155 | TCanvas *ceffptPi = new TCanvas("ceffptPi","Efficiency vs ptPi",50,50,550,550); | |
156 | TCanvas *ceffptK = new TCanvas("ceffptK","Efficiency vs ptK",50,50,550,550); | |
157 | TCanvas *ceffcT = new TCanvas("ceffcT","Efficiency vs cT",50,50,550,550); | |
158 | TCanvas *ceffdca = new TCanvas("ceffdca","Efficiency vs dca",50,50,550,550); | |
159 | TCanvas *ceffd0pi = new TCanvas("ceffd0pi","Efficiency vs d0pi",50,50,550,550); | |
160 | TCanvas *ceffd0K = new TCanvas("ceffd0K","Efficiency vs d0K",50,50,550,550); | |
161 | TCanvas *ceffd0xd0 = new TCanvas("ceffd0xd0","Efficiency vs d0xd0",50,50,550,550); | |
162 | TCanvas *ceffpointing = new TCanvas("ceffpointing","Efficiency vs pointing",50,50,550,550); | |
163 | ||
164 | ceff->cd(1); | |
165 | TH1D *hpteffCF = eff->Project(ipt); //the efficiency vs pt | |
166 | //hpteffCF->Setw2(); | |
167 | //hpteffCF->SetMinimum(0.01); | |
168 | hpteffCF->SetLineColor(8); | |
169 | hpteffCF->SetLineWidth(3); | |
170 | hpteffCF->SetMarkerColor(8); | |
171 | hpteffCF->SetMarkerStyle(20); | |
172 | hpteffCF->GetXaxis()->SetTitleOffset(1.2); | |
173 | hpteffCF->GetYaxis()->SetTitleOffset(1.5); | |
174 | hpteffCF->Draw("hist"); | |
175 | ceffpt->cd(); | |
176 | ceffpt->SetLeftMargin(0.15); | |
177 | ceffpt->SetRightMargin(0.05); | |
178 | hpteffCF->GetXaxis()->SetTitle("p_{T} (GeV/c)"); | |
179 | hpteffCF->GetYaxis()->SetTitle("Efficiency"); | |
180 | hpteffCF->Draw("hist"); | |
181 | hpteffCF->Draw("err same"); | |
182 | ||
183 | ceff->cd(2); | |
184 | TH1D *hyeffCF = eff->Project(iy); //the efficiency vs y | |
185 | //hyeffCF->Setw2(); | |
186 | //hyeffCF->SetMinimum(0.01); | |
187 | hyeffCF->SetLineColor(8); | |
188 | hyeffCF->SetLineWidth(3); | |
189 | hyeffCF->SetMarkerColor(8); | |
190 | hyeffCF->SetMarkerStyle(20); | |
191 | hyeffCF->GetXaxis()->SetTitleOffset(1.2); | |
192 | hyeffCF->GetYaxis()->SetTitleOffset(1.5); | |
193 | hyeffCF->Draw("hist"); | |
194 | ceffy->cd(); | |
195 | ceffy->SetLeftMargin(0.15); | |
196 | ceffy->SetRightMargin(0.05); | |
197 | hyeffCF->GetXaxis()->SetTitle("y"); | |
198 | hyeffCF->GetYaxis()->SetTitle("Efficiency"); | |
199 | hyeffCF->Draw("hist"); | |
200 | hyeffCF->Draw("err same"); | |
201 | ||
202 | ceff->cd(3); | |
203 | TH1D *hcTSeffCF = eff->Project(icTS); //the efficiency vs cosThetaStar | |
204 | //hcTSeffCF->Setw2(); | |
205 | //hcTSeffCF->SetMinimum(0.01); | |
206 | hcTSeffCF->SetLineColor(8); | |
207 | hcTSeffCF->SetLineWidth(3); | |
208 | hcTSeffCF->SetMarkerColor(8); | |
209 | hcTSeffCF->SetMarkerStyle(20); | |
210 | hcTSeffCF->GetXaxis()->SetTitleOffset(1.2); | |
211 | hcTSeffCF->GetYaxis()->SetTitleOffset(1.5); | |
212 | hcTSeffCF->Draw("hist"); | |
213 | ceffcTS->cd(); | |
214 | ceffcTS->SetLeftMargin(0.15); | |
215 | ceffcTS->SetRightMargin(0.05); | |
216 | hcTSeffCF->GetXaxis()->SetTitle("cosThetaStar"); | |
217 | hcTSeffCF->GetYaxis()->SetTitle("Efficiency"); | |
218 | hcTSeffCF->Draw("hist"); | |
219 | hcTSeffCF->Draw("err same"); | |
220 | ||
221 | ceff->cd(4); | |
222 | TH1D *hptPieffCF = eff->Project(iptPi); //the efficiency vs ptPi | |
223 | //hptPieffCF->Setw2(); | |
224 | //hptPieffCF->SetMinimum(0.01); | |
225 | hptPieffCF->SetLineColor(8); | |
226 | hptPieffCF->SetLineWidth(3); | |
227 | hptPieffCF->SetMarkerColor(8); | |
228 | hptPieffCF->SetMarkerStyle(20); | |
229 | hptPieffCF->GetXaxis()->SetTitleOffset(1.2); | |
230 | hptPieffCF->GetYaxis()->SetTitleOffset(1.5); | |
231 | hptPieffCF->Draw("hist"); | |
232 | ceffptPi->cd(); | |
233 | ceffptPi->SetLeftMargin(0.15); | |
234 | ceffptPi->SetRightMargin(0.05); | |
235 | hptPieffCF->GetXaxis()->SetTitle("p_{T, #pi} (GeV/c)"); | |
236 | hptPieffCF->GetYaxis()->SetTitle("Efficiency"); | |
237 | hptPieffCF->Draw("hist"); | |
238 | hptPieffCF->Draw("err same"); | |
239 | ||
240 | ceff->cd(5); | |
241 | TH1D *hptKeffCF = eff->Project(iptK); //the efficiency vs ptK | |
242 | //hptKeffCF->Setw2(); | |
243 | //hptKeffCF->SetMinimum(0.01); | |
244 | hptKeffCF->SetLineColor(8); | |
245 | hptKeffCF->SetLineWidth(3); | |
246 | hptKeffCF->SetMarkerColor(8); | |
247 | hptKeffCF->SetMarkerStyle(20); | |
248 | hptKeffCF->GetXaxis()->SetTitleOffset(1.2); | |
249 | hptKeffCF->GetYaxis()->SetTitleOffset(1.5); | |
250 | hptKeffCF->Draw("hist"); | |
251 | ceffptK->cd(); | |
252 | ceffptK->SetLeftMargin(0.15); | |
253 | ceffptK->SetRightMargin(0.05); | |
254 | hptKeffCF->GetXaxis()->SetTitle("p_{T, K} (GeV/c)"); | |
255 | hptKeffCF->GetYaxis()->SetTitle("Efficiency"); | |
256 | hptKeffCF->Draw("hist"); | |
257 | hptKeffCF->Draw("err same"); | |
258 | ||
259 | ceff->cd(6); | |
260 | TH1D *hcTeffCF = eff->Project(icT); //the efficiency vs cT | |
261 | //hcTeffCF->Setw2(); | |
262 | //hcTeffCF->SetMinimum(0.01); | |
263 | hcTeffCF->SetLineColor(8); | |
264 | hcTeffCF->SetLineWidth(3); | |
265 | hcTeffCF->SetMarkerColor(8); | |
266 | hcTeffCF->SetMarkerStyle(20); | |
267 | hcTeffCF->GetXaxis()->SetTitleOffset(1.2); | |
268 | hcTeffCF->GetYaxis()->SetTitleOffset(1.5); | |
269 | hcTeffCF->Draw("hist"); | |
270 | ceffcT->cd(); | |
271 | ceffcT->SetLeftMargin(0.15); | |
272 | ceffcT->SetRightMargin(0.05); | |
273 | hcTeffCF->GetXaxis()->SetTitle("ct (#mum)"); | |
274 | hcTeffCF->GetYaxis()->SetTitle("Efficiency"); | |
275 | hcTeffCF->Draw("hist"); | |
276 | hcTeffCF->Draw("err same"); | |
277 | ||
278 | ceff->cd(7); | |
279 | TH1D *hdcaeffCF = eff->Project(idca); //the efficiency vs dca | |
280 | //hdcaeffCF->Setw2(); | |
281 | //hdcaeffCF->SetMinimum(0.01); | |
282 | hdcaeffCF->SetLineColor(8); | |
283 | hdcaeffCF->SetLineWidth(3); | |
284 | hdcaeffCF->SetMarkerColor(8); | |
285 | hdcaeffCF->SetMarkerStyle(20); | |
286 | hdcaeffCF->GetXaxis()->SetTitleOffset(1.2); | |
287 | hdcaeffCF->GetYaxis()->SetTitleOffset(1.5); | |
288 | hdcaeffCF->Draw("hist"); | |
289 | ceffdca->cd(); | |
290 | ceffdca->SetLeftMargin(0.15); | |
291 | ceffdca->SetRightMargin(0.05); | |
292 | hdcaeffCF->GetXaxis()->SetTitle("dca (#mum)"); | |
293 | hdcaeffCF->GetYaxis()->SetTitle("Efficiency"); | |
294 | hdcaeffCF->Draw("hist"); | |
295 | hdcaeffCF->Draw("err same"); | |
296 | ||
297 | ceff->cd(8); | |
298 | TH1D *hd0pieffCF = eff->Project(id0pi); //the efficiency vs d0pi | |
299 | //hd0pieffCF->Setw2(); | |
300 | //hd0pieffCF->SetMinimum(0.01); | |
301 | hd0pieffCF->SetLineColor(8); | |
302 | hd0pieffCF->SetLineWidth(3); | |
303 | hd0pieffCF->SetMarkerColor(8); | |
304 | hd0pieffCF->SetMarkerStyle(20); | |
305 | hd0pieffCF->GetXaxis()->SetTitleOffset(1.2); | |
306 | hd0pieffCF->GetYaxis()->SetTitleOffset(1.5); | |
307 | hd0pieffCF->Draw("hist"); | |
308 | ceffd0pi->cd(); | |
309 | ceffd0pi->SetLeftMargin(0.15); | |
310 | ceffd0pi->SetRightMargin(0.05); | |
311 | hd0pieffCF->GetXaxis()->SetTitle("d0_{#pi} (#mum)"); | |
312 | hd0pieffCF->GetYaxis()->SetTitle("Efficiency"); | |
313 | hd0pieffCF->Draw("hist"); | |
314 | hd0pieffCF->Draw("err same"); | |
315 | ||
316 | ceff->cd(9); | |
317 | TH1D *hd0KeffCF = eff->Project(id0K); //the efficiency vs d0K | |
318 | //hd0KeffCF->Setw2(); | |
319 | //hd0KeffCF->SetMinimum(0.01); | |
320 | hd0KeffCF->SetLineColor(8); | |
321 | hd0KeffCF->SetLineWidth(3); | |
322 | hd0KeffCF->SetMarkerColor(8); | |
323 | hd0KeffCF->SetMarkerStyle(20); | |
324 | hd0KeffCF->GetXaxis()->SetTitleOffset(1.2); | |
325 | hd0KeffCF->GetYaxis()->SetTitleOffset(1.5); | |
326 | hd0KeffCF->Draw("hist"); | |
327 | ceffd0K->cd(); | |
328 | ceffd0K->SetLeftMargin(0.15); | |
329 | ceffd0K->SetRightMargin(0.05); | |
330 | hd0KeffCF->GetXaxis()->SetTitle("d0_{K} (#mum)"); | |
331 | hd0KeffCF->GetYaxis()->SetTitle("Efficiency"); | |
332 | hd0KeffCF->Draw("hist"); | |
333 | hd0KeffCF->Draw("err same"); | |
334 | ||
335 | ceff->cd(10); | |
336 | TH1D *hd0xd0effCF = eff->Project(id0xd0); //the efficiency vs d0xd0 | |
337 | //hd0xd0effCF->Setw2(); | |
338 | //hd0xd0effCF->SetMinimum(0.01); | |
339 | hd0xd0effCF->SetLineColor(8); | |
340 | hd0xd0effCF->SetLineWidth(3); | |
341 | hd0xd0effCF->SetMarkerColor(8); | |
342 | hd0xd0effCF->SetMarkerStyle(20); | |
343 | hd0xd0effCF->GetXaxis()->SetTitleOffset(1.2); | |
344 | hd0xd0effCF->GetYaxis()->SetTitleOffset(1.5); | |
345 | hd0xd0effCF->Draw("hist"); | |
346 | ceffd0xd0->cd(); | |
347 | ceffd0xd0->SetLeftMargin(0.15); | |
348 | ceffd0xd0->SetRightMargin(0.05); | |
349 | hd0xd0effCF->GetXaxis()->SetTitle("d0_{#pi}xd0_{K} (#mum^2)"); | |
350 | hd0xd0effCF->GetYaxis()->SetTitle("Efficiency"); | |
351 | hd0xd0effCF->Draw("hist"); | |
352 | hd0xd0effCF->Draw("err same"); | |
353 | ||
354 | ceff->cd(11); | |
355 | TH1D *hpointingeffCF = eff->Project(ipointing); //the efficiency vs pointing | |
356 | //hpointingeffCF->Setw2(); | |
357 | // hpointingeffCF->SetMinimum(0.01); | |
358 | hpointingeffCF->SetLineColor(8); | |
359 | hpointingeffCF->SetLineWidth(3); | |
360 | hpointingeffCF->SetMarkerColor(8); | |
361 | hpointingeffCF->SetMarkerStyle(20); | |
362 | hpointingeffCF->GetXaxis()->SetTitleOffset(1.2); | |
363 | hpointingeffCF->GetYaxis()->SetTitleOffset(1.5); | |
364 | hpointingeffCF->Draw("hist"); | |
365 | ceffpointing->cd(); | |
366 | ceffpointing->SetLeftMargin(0.15); | |
367 | ceffpointing->SetRightMargin(0.05); | |
368 | hpointingeffCF->GetXaxis()->SetTitle("cosPointingAngle"); | |
369 | hpointingeffCF->GetYaxis()->SetTitle("Efficiency"); | |
370 | hpointingeffCF->Draw("hist"); | |
371 | hpointingeffCF->Draw("err same"); | |
372 | ||
373 | // making slice | |
374 | ||
375 | // define vars on which to make the slice | |
376 | Int_t nvarSlice = 11; | |
377 | Int_t* ivarSlice = new Int_t[nvarSlice]; | |
378 | ivarSlice[0] = ipt; | |
379 | ivarSlice[1] = iy; | |
380 | ivarSlice[2] = icTS; | |
381 | ivarSlice[3] = iptPi; | |
382 | ivarSlice[4] = iptK; | |
383 | ivarSlice[5] = icT; | |
384 | ivarSlice[6] = idca; | |
385 | ivarSlice[7] = id0pi; | |
386 | ivarSlice[8] = id0K; | |
387 | ivarSlice[9] = id0xd0; | |
388 | ivarSlice[10] = ipointing; | |
389 | ||
390 | // define limits for all vars | |
391 | Double_t mins[11]; | |
392 | Double_t maxs[11]; | |
393 | // pt | |
394 | mins[0] = 2; | |
395 | maxs[0] = 10; | |
396 | // y | |
397 | mins[1] = -2.1; | |
398 | maxs[1] = 2.1; | |
399 | // cTS | |
400 | mins[2] = -1.05; | |
401 | maxs[2] = 1.05; | |
402 | // ptPi | |
403 | mins[3] = 0; | |
404 | maxs[3] = 10; | |
405 | // ptK | |
406 | mins[4] = 0; | |
407 | maxs[4] = 10; | |
408 | // cT | |
409 | mins[5] = 0; | |
410 | maxs[5] = 500; | |
411 | // dca | |
412 | mins[6] = 0; | |
413 | maxs[6] = 500; | |
414 | // d0pi | |
415 | mins[7] = -1000; | |
416 | maxs[7] = 1000; | |
417 | // d0K | |
418 | mins[8] = -1000; | |
419 | maxs[8] = 1000; | |
420 | //d0xd0 | |
421 | mins[9] = -100000; | |
422 | maxs[9] = 100000; | |
423 | // pointing | |
424 | mins[10] = 0.5; | |
425 | maxs[10] = 1.05; | |
426 | ||
427 | AliCFContainer* slicedCont = data->MakeSlice(nvarSlice, ivarSlice, mins, maxs); | |
428 | ||
429 | cout << "the new container has " << slicedCont->GetNStep() << " steps " << endl; | |
430 | ||
431 | TFile* fSlice = new TFile("fileSliceCont_pt_gt_2_pointing_gt_05.root","RECREATE"); | |
432 | slicedCont->Write("container"); | |
433 | fSlice->Close(); | |
434 | ||
435 | //construct the efficiency grid from the sliced data container | |
436 | AliCFEffGrid *effSlice = new AliCFEffGrid("effSlice"," The Sliced efficiency",*slicedCont); | |
437 | effSlice->CalculateEfficiency(stepNum,stepDen); //eff= step1/step0 | |
438 | ||
439 | //The efficiency along the variables, and some 2-D projections | |
440 | TCanvas *ceffSlice =new TCanvas("ceffSlice"," Sliced Efficiency",0,0,1600,1200); | |
441 | ceffSlice->Divide(4,3); | |
442 | TCanvas *ceffSlicept = new TCanvas("ceffSlicept","Sliced Efficiency vs pt",50,50,550,550); | |
443 | TCanvas *ceffSlicey = new TCanvas("ceffSlicey","Sliced Efficiency vs y",50,50,550,550); | |
444 | TCanvas *ceffSlicecTS = new TCanvas("ceffSlicecTS","Sliced Efficiency vs cosThetaStar",50,50,550,550); | |
445 | TCanvas *ceffSliceptPi = new TCanvas("ceffSliceptPi","Sliced Efficiency vs ptPi",50,50,550,550); | |
446 | TCanvas *ceffSliceptK = new TCanvas("ceffSliceptK","Sliced Efficiency vs ptK",50,50,550,550); | |
447 | TCanvas *ceffSlicecT = new TCanvas("ceffSlicecT","Sliced Efficiency vs cT",50,50,550,550); | |
448 | TCanvas *ceffSlicedca = new TCanvas("ceffSlicedca","Sliced Efficiency vs dca",50,50,550,550); | |
449 | TCanvas *ceffSliced0pi = new TCanvas("ceffSliced0pi","Sliced Efficiency vs d0pi",50,50,550,550); | |
450 | TCanvas *ceffSliced0K = new TCanvas("ceffSliced0K","Sliced Efficiency vs d0K",50,50,550,550); | |
451 | TCanvas *ceffSliced0xd0 = new TCanvas("ceffSliced0xd0","Sliced Efficiency vs d0xd0",50,50,550,550); | |
452 | TCanvas *ceffSlicepointing = new TCanvas("ceffSlicepointing","Sliced Efficiency vs pointing",50,50,550,550); | |
453 | ||
454 | ceffSlice->cd(1); | |
455 | TH1D *hpteffSliceCF = effSlice->Project(ipt); //the efficiency vs pt | |
456 | //hpteffCF->Setw2(); | |
457 | //hpteffSliceCF->SetMinimum(0.01); | |
458 | hpteffSliceCF->SetLineColor(8); | |
459 | hpteffSliceCF->SetLineWidth(3); | |
460 | hpteffSliceCF->SetMarkerColor(8); | |
461 | hpteffSliceCF->SetMarkerStyle(20); | |
462 | hpteffSliceCF->GetXaxis()->SetTitleOffset(1.2); | |
463 | hpteffSliceCF->GetYaxis()->SetTitleOffset(1.5); | |
464 | hpteffSliceCF->Draw("hist"); | |
465 | ceffSlicept->cd(); | |
466 | ceffSlicept->SetLeftMargin(0.15); | |
467 | ceffSlicept->SetRightMargin(0.05); | |
468 | hpteffSliceCF->GetXaxis()->SetTitle("p_{T} (GeV/c)"); | |
469 | hpteffSliceCF->GetYaxis()->SetTitle("Sliced Efficiency"); | |
470 | hpteffSliceCF->Draw("hist"); | |
471 | hpteffSliceCF->Draw("err same"); | |
472 | ||
473 | ceffSlice->cd(2); | |
474 | TH1D *hyeffSliceCF = effSlice->Project(iy); //the Sliced efficiency vs y | |
475 | //hyeffSliceCF->Setw2(); | |
476 | //hyeffSliceCF->SetMinimum(0.01); | |
477 | hyeffSliceCF->SetLineColor(8); | |
478 | hyeffSliceCF->SetLineWidth(3); | |
479 | hyeffSliceCF->SetMarkerColor(8); | |
480 | hyeffSliceCF->SetMarkerStyle(20); | |
481 | hyeffSliceCF->GetXaxis()->SetTitleOffset(1.2); | |
482 | hyeffSliceCF->GetYaxis()->SetTitleOffset(1.5); | |
483 | hyeffSliceCF->Draw("hist"); | |
484 | ceffSlicey->cd(); | |
485 | ceffSlicey->SetLeftMargin(0.15); | |
486 | ceffSlicey->SetRightMargin(0.05); | |
487 | hyeffSliceCF->GetXaxis()->SetTitle("y"); | |
488 | hyeffSliceCF->GetYaxis()->SetTitle("Sliced Efficiency"); | |
489 | hyeffSliceCF->Draw("hist"); | |
490 | hyeffSliceCF->Draw("err same"); | |
491 | ||
492 | ceffSlice->cd(3); | |
493 | TH1D *hcTSeffSliceCF = effSlice->Project(icTS); //the Sliced efficiency vs cosThetaStar | |
494 | //hcTSeffSliceCF->Setw2(); | |
495 | //hcTSeffSliceCF->SetMinimum(0.01); | |
496 | hcTSeffSliceCF->SetLineColor(8); | |
497 | hcTSeffSliceCF->SetLineWidth(3); | |
498 | hcTSeffSliceCF->SetMarkerColor(8); | |
499 | hcTSeffSliceCF->SetMarkerStyle(20); | |
500 | hcTSeffSliceCF->GetXaxis()->SetTitleOffset(1.2); | |
501 | hcTSeffSliceCF->GetYaxis()->SetTitleOffset(1.5); | |
502 | hcTSeffSliceCF->Draw("hist"); | |
503 | ceffSlicecTS->cd(); | |
504 | ceffSlicecTS->SetLeftMargin(0.15); | |
505 | ceffSlicecTS->SetRightMargin(0.05); | |
506 | hcTSeffSliceCF->GetXaxis()->SetTitle("cosThetaStar"); | |
507 | hcTSeffSliceCF->GetYaxis()->SetTitle("EffSliceiciency"); | |
508 | hcTSeffSliceCF->Draw("hist"); | |
509 | hcTSeffSliceCF->Draw("err same"); | |
510 | ||
511 | ceffSlice->cd(4); | |
512 | TH1D *hptPieffSliceCF = effSlice->Project(iptPi); //the Sliced efficiency vs ptPi | |
513 | //hptPieffSliceCF->Setw2(); | |
514 | //hptPieffSliceCF->SetMinimum(0.01); | |
515 | hptPieffSliceCF->SetLineColor(8); | |
516 | hptPieffSliceCF->SetLineWidth(3); | |
517 | hptPieffSliceCF->SetMarkerColor(8); | |
518 | hptPieffSliceCF->SetMarkerStyle(20); | |
519 | hptPieffSliceCF->GetXaxis()->SetTitleOffset(1.2); | |
520 | hptPieffSliceCF->GetYaxis()->SetTitleOffset(1.5); | |
521 | hptPieffSliceCF->Draw("hist"); | |
522 | ceffSliceptPi->cd(); | |
523 | ceffSliceptPi->SetLeftMargin(0.15); | |
524 | ceffSliceptPi->SetRightMargin(0.05); | |
525 | hptPieffSliceCF->GetXaxis()->SetTitle("p_{T, #pi} (GeV/c)"); | |
526 | hptPieffSliceCF->GetYaxis()->SetTitle("Sliced Efficiency"); | |
527 | hptPieffSliceCF->Draw("hist"); | |
528 | hptPieffSliceCF->Draw("err same"); | |
529 | ||
530 | ceffSlice->cd(5); | |
531 | TH1D *hptKeffSliceCF = effSlice->Project(iptK); //the Sliced efficiency vs ptK | |
532 | //hptKeffSliceCF->Setw2(); | |
533 | //hptKeffSliceCF->SetMinimum(0.01); | |
534 | hptKeffSliceCF->SetLineColor(8); | |
535 | hptKeffSliceCF->SetLineWidth(3); | |
536 | hptKeffSliceCF->SetMarkerColor(8); | |
537 | hptKeffSliceCF->SetMarkerStyle(20); | |
538 | hptKeffSliceCF->GetXaxis()->SetTitleOffset(1.2); | |
539 | hptKeffSliceCF->GetYaxis()->SetTitleOffset(1.5); | |
540 | hptKeffSliceCF->Draw("hist"); | |
541 | ceffSliceptK->cd(); | |
542 | ceffSliceptK->SetLeftMargin(0.15); | |
543 | ceffSliceptK->SetRightMargin(0.05); | |
544 | hptKeffSliceCF->GetXaxis()->SetTitle("p_{T, K} (GeV/c)"); | |
545 | hptKeffSliceCF->GetYaxis()->SetTitle("Sliced Efficiency"); | |
546 | hptKeffSliceCF->Draw("hist"); | |
547 | hptKeffSliceCF->Draw("err same"); | |
548 | ||
549 | ceffSlice->cd(6); | |
550 | TH1D *hcTeffSliceCF = effSlice->Project(icT); //the Sliced efficiency vs cT | |
551 | //hcTeffSliceCF->Setw2(); | |
552 | //hcTeffSliceCF->SetMinimum(0.01); | |
553 | hcTeffSliceCF->SetLineColor(8); | |
554 | hcTeffSliceCF->SetLineWidth(3); | |
555 | hcTeffSliceCF->SetMarkerColor(8); | |
556 | hcTeffSliceCF->SetMarkerStyle(20); | |
557 | hcTeffSliceCF->GetXaxis()->SetTitleOffset(1.2); | |
558 | hcTeffSliceCF->GetYaxis()->SetTitleOffset(1.5); | |
559 | hcTeffSliceCF->Draw("hist"); | |
560 | ceffSlicecT->cd(); | |
561 | ceffSlicecT->SetLeftMargin(0.15); | |
562 | ceffSlicecT->SetRightMargin(0.05); | |
563 | hcTeffSliceCF->GetXaxis()->SetTitle("ct (#mum)"); | |
564 | hcTeffSliceCF->GetYaxis()->SetTitle("Sliced Efficiency"); | |
565 | hcTeffSliceCF->Draw("hist"); | |
566 | hcTeffSliceCF->Draw("err same"); | |
567 | ||
568 | ceffSlice->cd(7); | |
569 | TH1D *hdcaeffSliceCF = effSlice->Project(idca); //the Sliced efficiency vs dca | |
570 | //hdcaeffSliceCF->Setw2(); | |
571 | //hdcaeffSliceCF->SetMinimum(0.01); | |
572 | hdcaeffSliceCF->SetLineColor(8); | |
573 | hdcaeffSliceCF->SetLineWidth(3); | |
574 | hdcaeffSliceCF->SetMarkerColor(8); | |
575 | hdcaeffSliceCF->SetMarkerStyle(20); | |
576 | hdcaeffSliceCF->GetXaxis()->SetTitleOffset(1.2); | |
577 | hdcaeffSliceCF->GetYaxis()->SetTitleOffset(1.5); | |
578 | hdcaeffSliceCF->Draw("hist"); | |
579 | ceffSlicedca->cd(); | |
580 | ceffSlicedca->SetLeftMargin(0.15); | |
581 | ceffSlicedca->SetRightMargin(0.05); | |
582 | hdcaeffSliceCF->GetXaxis()->SetTitle("dca (#mum)"); | |
583 | hdcaeffSliceCF->GetYaxis()->SetTitle("Sliced Efficiency"); | |
584 | hdcaeffSliceCF->Draw("hist"); | |
585 | hdcaeffSliceCF->Draw("err same"); | |
586 | ||
587 | ceffSlice->cd(8); | |
588 | TH1D *hd0pieffSliceCF = effSlice->Project(id0pi); //the Sliced efficiency vs d0pi | |
589 | //hd0pieffSliceCF->Setw2(); | |
590 | //hd0pieffSliceCF->SetMinimum(0.01); | |
591 | hd0pieffSliceCF->SetLineColor(8); | |
592 | hd0pieffSliceCF->SetLineWidth(3); | |
593 | hd0pieffSliceCF->SetMarkerColor(8); | |
594 | hd0pieffSliceCF->SetMarkerStyle(20); | |
595 | hd0pieffSliceCF->GetXaxis()->SetTitleOffset(1.2); | |
596 | hd0pieffSliceCF->GetYaxis()->SetTitleOffset(1.5); | |
597 | hd0pieffSliceCF->Draw("hist"); | |
598 | ceffSliced0pi->cd(); | |
599 | ceffSliced0pi->SetLeftMargin(0.15); | |
600 | ceffSliced0pi->SetRightMargin(0.05); | |
601 | hd0pieffSliceCF->GetXaxis()->SetTitle("d0_{#pi} (#mum)"); | |
602 | hd0pieffSliceCF->GetYaxis()->SetTitle("Efficiency"); | |
603 | hd0pieffSliceCF->Draw("hist"); | |
604 | hd0pieffSliceCF->Draw("err same"); | |
605 | ||
606 | ceffSlice->cd(9); | |
607 | TH1D *hd0KeffSliceCF = effSlice->Project(id0K); //the Sliced efficiency vs d0K | |
608 | //hd0KeffSliceCF->Setw2(); | |
609 | //hd0KeffSliceCF->SetMinimum(0.01); | |
610 | hd0KeffSliceCF->SetLineColor(8); | |
611 | hd0KeffSliceCF->SetLineWidth(3); | |
612 | hd0KeffSliceCF->SetMarkerColor(8); | |
613 | hd0KeffSliceCF->SetMarkerStyle(20); | |
614 | hd0KeffSliceCF->GetXaxis()->SetTitleOffset(1.2); | |
615 | hd0KeffSliceCF->GetYaxis()->SetTitleOffset(1.5); | |
616 | hd0KeffSliceCF->Draw("hist"); | |
617 | ceffSliced0K->cd(); | |
618 | ceffSliced0K->SetLeftMargin(0.15); | |
619 | ceffSliced0K->SetRightMargin(0.05); | |
620 | hd0KeffSliceCF->GetXaxis()->SetTitle("d0_{K} (#mum)"); | |
621 | hd0KeffSliceCF->GetYaxis()->SetTitle("Sliced Efficiency"); | |
622 | hd0KeffSliceCF->Draw("hist"); | |
623 | hd0KeffSliceCF->Draw("err same"); | |
624 | ||
625 | ceffSlice->cd(10); | |
626 | TH1D *hd0xd0effSliceCF = effSlice->Project(id0xd0); //the Sliced efficiency vs d0xd0 | |
627 | //hd0xd0effSliceCF->Setw2(); | |
628 | //hd0xd0effSliceCF->SetMinimum(0.01); | |
629 | hd0xd0effSliceCF->SetLineColor(8); | |
630 | hd0xd0effSliceCF->SetLineWidth(3); | |
631 | hd0xd0effSliceCF->SetMarkerColor(8); | |
632 | hd0xd0effSliceCF->SetMarkerStyle(20); | |
633 | hd0xd0effSliceCF->GetXaxis()->SetTitleOffset(1.2); | |
634 | hd0xd0effSliceCF->GetYaxis()->SetTitleOffset(1.5); | |
635 | hd0xd0effSliceCF->Draw("hist"); | |
636 | ceffSliced0xd0->cd(); | |
637 | ceffSliced0xd0->SetLeftMargin(0.15); | |
638 | ceffSliced0xd0->SetRightMargin(0.05); | |
639 | hd0xd0effSliceCF->GetXaxis()->SetTitle("d0_{#pi}xd0_{K} (#mum^2)"); | |
640 | hd0xd0effSliceCF->GetYaxis()->SetTitle("Sliced Efficiency"); | |
641 | hd0xd0effSliceCF->Draw("hist"); | |
642 | hd0xd0effSliceCF->Draw("err same"); | |
643 | ||
644 | ceffSlice->cd(11); | |
645 | TH1D *hpointingeffSliceCF = effSlice->Project(ipointing); //the efficiency vs pointing | |
646 | //hpointingeffSliceCF->Setw2(); | |
647 | // hpointingeffSliceCF->SetMinimum(0.01); | |
648 | hpointingeffSliceCF->SetLineColor(8); | |
649 | hpointingeffSliceCF->SetLineWidth(3); | |
650 | hpointingeffSliceCF->SetMarkerColor(8); | |
651 | hpointingeffSliceCF->SetMarkerStyle(20); | |
652 | hpointingeffSliceCF->GetXaxis()->SetTitleOffset(1.2); | |
653 | hpointingeffSliceCF->GetYaxis()->SetTitleOffset(1.5); | |
654 | hpointingeffSliceCF->Draw("hist"); | |
655 | ceffSlicepointing->cd(); | |
656 | ceffSlicepointing->SetLeftMargin(0.15); | |
657 | ceffSlicepointing->SetRightMargin(0.05); | |
658 | hpointingeffSliceCF->GetXaxis()->SetTitle("cosPointingAngle"); | |
659 | hpointingeffSliceCF->GetYaxis()->SetTitle("Sliced Efficiency"); | |
660 | hpointingeffSliceCF->Draw("hist"); | |
661 | hpointingeffSliceCF->Draw("err same"); | |
662 | ||
663 | ||
664 | TFile* fileEff = new TFile("fileEff_GenAcc_RecPPR_pt_gt_2_pointing_gt_05.root", "RECREATE"); | |
665 | hpteffSliceCF->Write("hpteffCFGenAccRecPPR"); | |
666 | hyeffSliceCF->Write("hyeffCFGenAccRecPPR"); | |
667 | hcTSeffSliceCF->Write("hcTSeffCFGenAccRecPPR"); | |
668 | hptPieffSliceCF->Write("hptPieffCFGenAccRecPPR"); | |
669 | hptKeffSliceCF->Write("hptKeffCFGenAccRecPPR"); | |
670 | hcTeffSliceCF->Write("hcTeffCFGenAccRecPPR"); | |
671 | hdcaeffSliceCF->Write("hdcaeffCFGenAccRecPPR"); | |
672 | hd0pieffSliceCF->Write("hd0pieffCFGenAccRecPPR"); | |
673 | hd0KeffSliceCF->Write("hd0KeffCFGenAccRecPPR"); | |
674 | hd0xd0effSliceCF->Write("hd0xd0effCFGenAccRecPPR"); | |
675 | hpointingeffSliceCF->Write("hpointingeffCFGenAccRecPPR"); | |
676 | fileEff->Close(); | |
677 | ||
678 | ||
679 | TString dir(plotsDir); | |
680 | if (gSystem->Exec(Form("ls %s",dir.Data()))!=0){ | |
681 | cout << " Creating directory for plots" << endl; | |
682 | ||
683 | gSystem->mkdir(Form("%s_pt_gt_2_pointing_gt_05",dir.Data())); | |
684 | gSystem->cd(Form("%s_pt_gt_2_pointing_gt_05",dir.Data())); | |
685 | } | |
686 | ||
687 | // printing eps files | |
688 | ceffSlice->Print(Form("efficiencies.eps", dir.Data())); | |
689 | ceffSlicept->Print(Form("effpt.eps", dir.Data())); | |
690 | ceffSlicey->Print(Form("effy.eps", dir.Data())); | |
691 | ceffSlicecTS->Print(Form("effcTS.eps", dir.Data())); | |
692 | ceffSliceptPi->Print(Form("effptPi.eps", dir.Data())); | |
693 | ceffSliceptK->Print(Form("effptK.eps", dir.Data())); | |
694 | ceffSlicecT->Print(Form("effcT.eps", dir.Data())); | |
695 | ceffSlicedca->Print(Form("effdca.eps", dir.Data())); | |
696 | ceffSliced0pi->Print(Form("effd0pi.eps", dir.Data())); | |
697 | ceffSliced0K->Print(Form("effd0K.eps", dir.Data())); | |
698 | ceffSliced0xd0->Print(Form("effd0xd0.eps", dir.Data())); | |
699 | ceffSlicepointing->Print(Form("effpointing.eps", dir.Data())); | |
700 | ||
701 | // printing gif files | |
702 | ceffSlice->Print(Form("efficiencies.gif", dir.Data())); | |
703 | ceffSlicept->Print(Form("effpt.gif", dir.Data())); | |
704 | ceffSlicey->Print(Form("effy.gif", dir.Data())); | |
705 | ceffSlicecTS->Print(Form("effcTS.gif", dir.Data())); | |
706 | ceffSliceptPi->Print(Form("effptPi.gif", dir.Data())); | |
707 | ceffSliceptK->Print(Form("effptK.gif", dir.Data())); | |
708 | ceffSlicecT->Print(Form("effcT.gif", dir.Data())); | |
709 | ceffSlicedca->Print(Form("effdca.gif", dir.Data())); | |
710 | ceffSliced0pi->Print(Form("effd0pi.gif", dir.Data())); | |
711 | ceffSliced0K->Print(Form("effd0K.gif", dir.Data())); | |
712 | ceffSliced0xd0->Print(Form("effd0xd0.gif", dir.Data())); | |
713 | ceffSlicepointing->Print(Form("effpointing.gif", dir.Data())); | |
714 | ||
715 | ||
716 | } |