]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWG3/vertexingHF/ReadCFHeavyFlavourOutput.C
New version of task for prompt charm fraction analysis (A. Rossi)
[u/mrichter/AliRoot.git] / PWG3 / vertexingHF / ReadCFHeavyFlavourOutput.C
CommitLineData
becfe989 1#include <Riostream.h>
2
3extern TRandom *gRandom;
4extern TBenchmark *gBenchmark;
5extern TSystem *gSystem;
6
7void ReadCFHeavyFlavourOutput(){
8
9 // example macro for reading a container coming from a CF analysis
10 // the generated and reconstructed distributions are got,
11 // the efficiencies are calculated,
12 // the reco distributions are corrected,
13 // the results plotted
14
15 gROOT->SetStyle("Plain");
16 gStyle->SetPalette(1);
17 gStyle->SetOptStat(1110);
18 gStyle->SetPalette(1);
19 gStyle->SetCanvasColor(0);
20 gStyle->SetFrameFillColor(0);
21 gStyle->SetOptTitle(0);
22
23 gSystem->SetIncludePath("-I. -I$ALICE_ROOT/include -I$ROOTSYS/include");
24 gSystem->Load("libANALYSIS.so");
25 gSystem->Load("libANALYSISalice.so");
a273622f 26 gSystem->Load("libCORRFW.so") ;
becfe989 27
28 //Setting up the container grid...
29
30 const Int_t nstep=2; //number of selection steps (just 2 in this ex)
31
32 const Int_t nvar=6; //number of variables on the grid: pt, y, cosThetaStar, ptPi, ptK, cT
33
34 // Flag the sel steps. In this example, we have two, may be any nstep
35 Int_t stepGen=0;
36 Int_t stepRec=1;
37
38 // the sensitive variables, their indeces
39 UInt_t ipt =0;
40 UInt_t iy =1;
41 UInt_t icTS = 2; // cTS stands for cosThetaStar
42 UInt_t iptPi= 3;
43 UInt_t iptK = 4;
44 UInt_t icT = 5;
45
46 // Read the container from file
47 TFile *file = new TFile("output.root");
48 AliCFContainer *data = (AliCFContainer*) (file->Get("container"));
49
50 // Make some 1 & 2-D projections..
51 // MC level
52 TCanvas *cmc1 = new TCanvas("cmc1","The MC distributions",0,800,900,1200);
53 TCanvas *cmc2 = new TCanvas("cmc2","The MC distributions",0,800,900,1200);
54 TCanvas *cmcpt = new TCanvas("cmcpt","pt distribution from MC",50,50,550,550);
55 TCanvas *cmcy = new TCanvas("cmcy","y distribution from MC",50,50,550,550);
56 TCanvas *cmccTS = new TCanvas("cmcTS","cosThetaStar distribution from MC",50,50,550,550); // cTS stands for cosThetaStar
57 TCanvas *cmcptPi = new TCanvas("cmcptPi","pt_pi distribution from MC",50,50,550,550);
58 TCanvas *cmcptK = new TCanvas("cmcptK","pt_K distribution from MC",50,50,550,550);
59 TCanvas *cmccT = new TCanvas("cmccT","cT distribution from MC",50,50,550,550);
60
61 // Reco-aod level
62 TCanvas *cpt = new TCanvas("cpt","pt distribution from reco aod",50,50,550,550);
63 TCanvas *cy = new TCanvas("cy","y distribution from reco aod",50,50,550,550);
64 TCanvas *ccTS = new TCanvas("cTS","cosThetaStar distribution from reco aod",50,50,550,550);
65 TCanvas *cptPi = new TCanvas("cptPi","pt_pi distribution from reco aod",50,50,550,550);
66 TCanvas *cptK = new TCanvas("cptK","pt_K distribution from reco aod",50,50,550,550);
67 TCanvas *ccT = new TCanvas("ccT","cT distribution from reco aod",50,50,550,550);
68
69 // some 2D distributions in pt and y
70 TCanvas *cGen2d = new TCanvas("cGen2d","2D distribution from MC ",50,50,550,550);
71 TCanvas *cRec2d = new TCanvas("cRec2d","2D distribution from reco aod",50,50,550,550);
72
73 // 2D plots
74 TH2D *hMCpty2d = data->ShowProjection(ipt, iy, stepGen);
75 hMCpty2d->SetLineColor(2);
76 hMCpty2d->SetLineWidth(3);
77 hMCpty2d->SetMarkerColor(2);
78 hMCpty2d->SetMarkerStyle(20);
79 hMCpty2d->GetXaxis()->SetTitleOffset(1.2);
80 hMCpty2d->GetYaxis()->SetTitleOffset(1.5);
81 hMCpty2d->GetXaxis()->SetTitle("p_{T} (GeV/c), MC data");
82 hMCpty2d->GetYaxis()->SetTitle("y, MC data");
83 hMCpty2d->Draw("text");
84 cGen2d->cd();
85 cGen2d->SetLeftMargin(0.15);
86 cGen2d->SetRightMargin(0.05);
87 cGen2d->Update();
88
89 TH2D *hRECpty2d = data->ShowProjection(ipt, iy, stepRec);
90 hRECpty2d->Sumw2();
91 hRECpty2d->SetLineColor(4);
92 hRECpty2d->SetLineWidth(3);
93 hRECpty2d->SetMarkerColor(4);
94 hRECpty2d->SetMarkerStyle(20);
95 hRECpty2d->GetXaxis()->SetTitleOffset(1.2);
96 hRECpty2d->GetYaxis()->SetTitleOffset(1.5);
97 hRECpty2d->GetXaxis()->SetTitle("p_{T} (GeV/c), AOD");
98 hRECpty2d->GetYaxis()->SetTitle("y, AOD");
99 hRECpty2d->Draw("text");
100 cRec2d->cd();
101 cRec2d->SetLeftMargin(0.15);
102 cRec2d->SetRightMargin(0.05);
103 cRec2d->Update();
104
105 // MC + REC 1D plots
106 // pt, y, cosThetaStar
107 cmc1->Divide(2,3);
108
109 cmc1->cd(1);
110 TH1D *hMCpt1D = data->ShowProjection(ipt, stepGen);
111 Double_t maxpt = hMCpt1D->GetMaximum();
112 hMCpt1D->GetYaxis()->SetRangeUser(0,maxpt*1.2);
113 hMCpt1D->Sumw2();
114 hMCpt1D->SetMinimum(0.01);
115 hMCpt1D->SetLineColor(2);
116 hMCpt1D->SetLineWidth(3);
117 hMCpt1D->SetMarkerColor(2);
118 hMCpt1D->SetFillColor(2);
119 hMCpt1D->SetFillStyle(3005);
120 hMCpt1D->SetMarkerStyle(20);
121 hMCpt1D->GetXaxis()->SetTitleOffset(1.2);
122 hMCpt1D->GetXaxis()->SetTitle("p_{T} (GeV/c), MC data");
123 hMCpt1D->Draw("hist");
124 cmcpt->cd();
125 cmcpt->SetLeftMargin(0.15);
126 cmcpt->SetRightMargin(0.05);
127 hMCpt1D->Draw("hist");
128 hMCpt1D->Draw("err same");
129 cmcpt->Update();
130
131 cmc1->cd(2);
132 TH1D *hRECpt1D = data->ShowProjection(ipt, stepRec);
133 hRECpt1D->GetYaxis()->SetRangeUser(0,maxpt*1.2);
134 hRECpt1D->SetLineColor(4);
135 hRECpt1D->SetLineWidth(3);
136 hRECpt1D->SetMarkerColor(4);
137 hRECpt1D->SetFillColor(4);
138 hRECpt1D->SetFillStyle(3004);
139 hRECpt1D->SetMarkerStyle(20);
140 hRECpt1D->GetXaxis()->SetTitleOffset(1.2);
141 hRECpt1D->Sumw2();
142 hRECpt1D->SetMinimum(0.01);
143 hRECpt1D->GetXaxis()->SetTitle("p_{T} (GeV/c), AOD");
144 hRECpt1D->Draw("hist");
145 cpt->cd();
146 cpt->SetLeftMargin(0.15);
147 cpt->SetRightMargin(0.05);
148 hRECpt1D->Draw("hist");
149 hRECpt1D->Draw("err same");
150 cpt->Update();
151
152 cmc1->cd(3);
153 TH1D *hMCy1D = data->ShowProjection(iy, stepGen);
154 Double_t maxy = hMCy1D->GetMaximum();
155 hMCy1D->GetYaxis()->SetRangeUser(0,maxy*1.2);
156 hMCy1D->SetLineColor(2);
157 hMCy1D->SetLineWidth(3);
158 hMCy1D->SetMarkerColor(2);
159 hMCy1D->SetFillColor(2);
160 hMCy1D->SetFillStyle(3005);
161 hMCy1D->SetMarkerStyle(20);
162 hMCy1D->GetXaxis()->SetTitleOffset(1.2);
163 hMCy1D->Sumw2();
164 hMCy1D->SetMinimum(0.01);
165 hMCy1D->GetXaxis()->SetTitle("y, MC data");
166 hMCy1D->Draw("hist");
167 cmcy->cd();
168 cmcy->SetLeftMargin(0.15);
169 cmcy->SetRightMargin(0.05);
170 hMCy1D->Draw("hist");
171 hMCy1D->Draw("err same");
172 cmcy->Update();
173
174 cmc1->cd(4);
175 TH1D *hRECy1D = data->ShowProjection(iy, stepRec);
176 hRECy1D->GetYaxis()->SetRangeUser(0,maxy*1.2);
177 hRECy1D->SetLineColor(4);
178 hRECy1D->SetLineWidth(3);
179 hRECy1D->SetMarkerColor(4);
180 hRECy1D->SetFillColor(4);
181 hRECy1D->SetFillStyle(3004);
182 hRECy1D->SetMarkerStyle(20);
183 hRECy1D->GetXaxis()->SetTitleOffset(1.2);
184 hRECy1D->Sumw2();
185 hRECy1D->SetMinimum(0.01);
186 hRECy1D->Draw("hist");
187 cy->cd();
188 cy->SetLeftMargin(0.15);
189 cy->SetRightMargin(0.05);
190 hRECy1D->GetXaxis()->SetTitle("y, AOD");
191 hRECy1D->Draw("hist");
192 hRECy1D->Draw("err same");
193 cy->Update();
194
195 cmc1->cd(5);
196 TH1D *hMCcTS1D = data->ShowProjection(icTS, stepGen);
197 Double_t maxcTS = hMCcTS1D->GetMaximum();
198 hMCcTS1D->GetYaxis()->SetRangeUser(0,maxcTS*1.2);
199 hMCcTS1D->SetLineColor(2);
200 hMCcTS1D->SetLineWidth(3);
201 hMCcTS1D->SetMarkerColor(2);
202 hMCcTS1D->SetFillColor(2);
203 hMCcTS1D->SetFillStyle(3005);
204 hMCcTS1D->SetMarkerStyle(20);
205 hMCcTS1D->GetXaxis()->SetTitleOffset(1.2);
206 hMCcTS1D->Sumw2();
207 hMCcTS1D->SetMinimum(0.01);
208 hMCcTS1D->GetXaxis()->SetTitle("cosThetaStar, MC data");
209 hMCcTS1D->Draw("hist");
210 cmccTS->cd();
211 cmccTS->SetLeftMargin(0.15);
212 cmccTS->SetRightMargin(0.05);
213 hMCcTS1D->Draw("hist");
214 hMCcTS1D->Draw("err same");
215 cmccTS->Update();
216
217 cmc1->cd(6);
218 TH1D *hRECcTS1D = data->ShowProjection(icTS, stepRec);
219 hRECcTS1D->GetYaxis()->SetRangeUser(0,maxcTS*1.2);
220 hRECcTS1D->SetLineColor(4);
221 hRECcTS1D->SetLineWidth(3);
222 hRECcTS1D->SetMarkerColor(4);
223 hRECcTS1D->SetFillColor(4);
224 hRECcTS1D->SetFillStyle(3004);
225 hRECcTS1D->SetMarkerStyle(20);
226 hRECcTS1D->GetXaxis()->SetTitleOffset(1.2);
227 hRECcTS1D->Sumw2();
228 hRECcTS1D->SetMinimum(0.01);
229 hRECcTS1D->Draw("hist");
230 ccTS->cd();
231 ccTS->SetLeftMargin(0.15);
232 ccTS->SetRightMargin(0.05);
233 hRECcTS1D->GetXaxis()->SetTitle("cosThetaStar, AOD");
234 hRECcTS1D->Draw("hist");
235 hRECcTS1D->Draw("err same");
236 ccTS->Update();
237
238 // ptPi, ptK, cT
239 cmc2->Divide(2,3);
240
241 cmc2->cd(1);
242 TH1D *hMCptPi1D = data->ShowProjection(iptPi, stepGen);
243 Double_t maxptPi = hMCptPi1D->GetMaximum();
244 hMCptPi1D->GetYaxis()->SetRangeUser(0,maxptPi*1.2);
245 hMCptPi1D->Sumw2();
246 hMCptPi1D->SetMinimum(0.01);
247 hMCptPi1D->SetLineColor(2);
248 hMCptPi1D->SetLineWidth(3);
249 hMCptPi1D->SetMarkerColor(2);
250 hMCptPi1D->SetFillColor(2);
251 hMCptPi1D->SetFillStyle(3005);
252 hMCptPi1D->SetMarkerStyle(20);
253 hMCptPi1D->GetXaxis()->SetTitleOffset(1.2);
254 hMCptPi1D->GetXaxis()->SetTitle("p_{T, #pi} (GeV/c), MC data");
255 hMCptPi1D->Draw("hist");
256 cmcptPi->cd();
257 cmcptPi->SetLeftMargin(0.15);
258 cmcptPi->SetRightMargin(0.05);
259 hMCptPi1D->Draw("hist");
260 hMCptPi1D->Draw("err same");
261 cmcptPi->Update();
262
263 cmc2->cd(2);
264 TH1D *hRECptPi1D = data->ShowProjection(iptPi, stepRec);
265 hRECptPi1D->GetYaxis()->SetRangeUser(0,maxptPi*1.2);
266 hRECptPi1D->SetLineColor(4);
267 hRECptPi1D->SetLineWidth(3);
268 hRECptPi1D->SetMarkerColor(4);
269 hRECptPi1D->SetFillColor(4);
270 hRECptPi1D->SetFillStyle(3004);
271 hRECptPi1D->SetMarkerStyle(20);
272 hRECptPi1D->GetXaxis()->SetTitleOffset(1.2);
273 hRECptPi1D->Sumw2();
274 hRECptPi1D->SetMinimum(0.01);
275 hRECptPi1D->GetXaxis()->SetTitle("p_{T, #pi} (GeV/c), AOD");
276 hRECptPi1D->Draw("hist");
277 cptPi->cd();
278 cptPi->SetLeftMargin(0.15);
279 cptPi->SetRightMargin(0.05);
280 hRECptPi1D->Draw("hist");
281 hRECptPi1D->Draw("err same");
282 cptPi->Update();
283
284 cmc2->cd(3);
285 TH1D *hMCptK1D = data->ShowProjection(iptK, stepGen);
286 Double_t maxptK = hMCptK1D->GetMaximum();
287 hMCptK1D->GetYaxis()->SetRangeUser(0,maxptK*1.2);
288 hMCptK1D->SetLineColor(2);
289 hMCptK1D->SetLineWidth(3);
290 hMCptK1D->SetMarkerColor(2);
291 hMCptK1D->SetFillColor(2);
292 hMCptK1D->SetFillStyle(3005);
293 hMCptK1D->SetMarkerStyle(20);
294 hMCptK1D->GetXaxis()->SetTitleOffset(1.2);
295 hMCptK1D->Sumw2();
296 hMCptK1D->SetMinimum(0.01);
297 hMCptK1D->GetXaxis()->SetTitle("p_{T, K} (GeV/c), MC data");
298 hMCptK1D->Draw("hist");
299 cmcptK->cd();
300 cmcptK->SetLeftMargin(0.15);
301 cmcptK->SetRightMargin(0.05);
302 hMCptK1D->Draw("hist");
303 hMCptK1D->Draw("err same");
304 cmcptK->Update();
305
306 cmc2->cd(4);
307 TH1D *hRECptK1D = data->ShowProjection(iptK, stepRec);
308 hRECptK1D->GetYaxis()->SetRangeUser(0,maxptK*1.2);
309 hRECptK1D->SetLineColor(4);
310 hRECptK1D->SetLineWidth(3);
311 hRECptK1D->SetMarkerColor(4);
312 hRECptK1D->SetFillColor(4);
313 hRECptK1D->SetFillStyle(3004);
314 hRECptK1D->SetMarkerStyle(20);
315 hRECptK1D->GetXaxis()->SetTitleOffset(1.2);
316 hRECptK1D->Sumw2();
317 hRECptK1D->SetMinimum(0.01);
318 hRECptK1D->Draw("hist");
319 cptK->cd();
320 cptK->SetLeftMargin(0.15);
321 cptK->SetRightMargin(0.05);
322 hRECptK1D->GetXaxis()->SetTitle("p_{T, K} (GeV/c), AOD");
323 hRECptK1D->Draw("hist");
324 hRECptK1D->Draw("err same");
325 cptK->Update();
326
327 cmc2->cd(5);
328 TH1D *hMCcT1D = data->ShowProjection(icT, stepGen);
329 Double_t maxcT = hMCcT1D->GetMaximum();
330 hMCcT1D->GetYaxis()->SetRangeUser(0,maxcT*1.2);
331 hMCcT1D->SetLineColor(2);
332 hMCcT1D->SetLineWidth(3);
333 hMCcT1D->SetMarkerColor(2);
334 hMCcT1D->SetFillColor(2);
335 hMCcT1D->SetFillStyle(3005);
336 hMCcT1D->SetMarkerStyle(20);
337 hMCcT1D->GetXaxis()->SetTitleOffset(1.2);
338 hMCcT1D->Sumw2();
339 hMCcT1D->SetMinimum(0.01);
340 hMCcT1D->GetXaxis()->SetTitle("ct (#mum), MC data");
341 hMCcT1D->Draw("hist");
342 cmccT->cd();
343 cmccT->SetLeftMargin(0.15);
344 cmccT->SetRightMargin(0.05);
345 hMCcT1D->Draw("hist");
346 hMCcT1D->Draw("err same");
347 cmccT->Update();
348
349 cmc2->cd(6);
350 TH1D *hRECcT1D = data->ShowProjection(icT, stepRec);
351 hRECcT1D->GetYaxis()->SetRangeUser(0,maxcT*1.2);
352 hRECcT1D->SetLineColor(4);
353 hRECcT1D->SetLineWidth(3);
354 hRECcT1D->SetMarkerColor(4);
355 hRECcT1D->SetFillColor(4);
356 hRECcT1D->SetFillStyle(3004);
357 hRECcT1D->SetMarkerStyle(20);
358 hRECcT1D->GetXaxis()->SetTitleOffset(1.2);
359 hRECcT1D->Sumw2();
360 hRECcT1D->SetMinimum(0.01);
361 hRECcT1D->Draw("hist");
362 ccT->cd();
363 ccT->SetLeftMargin(0.15);
364 ccT->SetRightMargin(0.05);
365 hRECcT1D->GetXaxis()->SetTitle("c#t (#mum), AOD");
366 hRECcT1D->Draw("hist");
367 hRECcT1D->Draw("err same");
368 ccT->Update();
369
370 /*
371 // printing on eps files
372 cmc1->Print("Plots/dataMC_pt_y_cTS.gif");
373 cmc2->Print("Plots/dataMC_ptPi_ptK_cT.gif");
374 cmcpt->Print("Plots/pt_Gen.eps");
375 cmcy->Print("Plots/y_Gen.eps");
376 cmccTS->Print("Plots/cTS_Gen.eps");
377 cmcptPi->Print("Plots/ptPi_Gen.eps");
378 cmcptK->Print("Plots/ptK_Gen.eps");
379 cmccT->Print("Plots/cT_Gen.eps");
380 cpt->Print("Plots/pt_Rec.eps");
381 cy->Print("Plots/y_Rec.eps");
382 ccTS->Print("Plots/cTS_Rec.eps");
383 cptPi->Print("Plots/ptPi_Rec.eps");
384 cptK->Print("Plots/ptK_Rec.eps");
385 ccT->Print("Plots/cT_Rec.eps");
386 cGen2d->Print("Plots/pt_y_Gen_2D.eps");
387 cRec2d->Print("Plots/pt_y_Rec_2D.eps");
388
389 // printing on gif files
390 cmc1->Print("Plots/dataMC_pt_y_cTS.gif");
391 cmc2->Print("Plots/dataMC_ptPi_ptK_cT.gif");
392 cmcpt->Print("Plots/pt_Gen.eps");
393 cmcy->Print("Plots/y_Gen.eps");
394 cmccTS->Print("Plots/cTS_Gen.eps");
395 cmcptPi->Print("Plots/ptPi_Gen.eps");
396 cmcptK->Print("Plots/ptK_Gen.eps");
397 cmccT->Print("Plots/cT_Gen.eps");
398 cpt->Print("Plots/pt_Rec.eps");
399 cy->Print("Plots/y_Rec.eps");
400 ccTS->Print("Plots/cTS_Rec.eps");
401 cptPi->Print("Plots/ptPi_Rec.eps");
402 cptK->Print("Plots/ptK_Rec.eps");
403 ccT->Print("Plots/cT_Rec.eps");
404 cGen2d->Print("Plots/pt_y_Gen_2D.eps");
405 cRec2d->Print("Plots/pt_y_Rec_2D.eps");
406 */
407
408 //construct the efficiency grid from the data container
409 AliCFEffGrid *eff = new AliCFEffGrid("eff"," The efficiency",*data);
410 eff->CalculateEfficiency(stepRec,stepGen); //eff= step1/step0
411
412 //The efficiency along the variables, and some 2-D projections
413 TCanvas *ceff =new TCanvas("ceff"," Efficiency",0,0,1600,1200);
414 ceff->Divide(3,2);
415 TCanvas *ceff2D =new TCanvas("ceff2D"," Efficiency for pt and y",50,50,550,550);
416 TCanvas *ceffpt = new TCanvas("ceffpt","Efficiency vs pt",50,50,550,550);
417 TCanvas *ceffy = new TCanvas("ceffy","Efficiency vs y",50,50,550,550);
418 TCanvas *ceffcTS = new TCanvas("ceffcTS","Efficiency vs cosThetaStar",50,50,550,550);
419 TCanvas *ceffptPi = new TCanvas("ceffptPi","Efficiency vs ptPi",50,50,550,550);
420 TCanvas *ceffptK = new TCanvas("ceffptK","Efficiency vs ptK",50,50,550,550);
421 TCanvas *ceffcT = new TCanvas("ceffcT","Efficiency vs cT",50,50,550,550);
422 TCanvas *ceff2Dtext = new TCanvas("ceff2Dtext","Text plot for efficiency in pt and y",50,50,550,550);
423
424 ceff->cd(1);
425 TH1D *hpteffCF = eff->Project(ipt); //the efficiency vs pt
426 hpteffCF->Sumw2();
427 //hpteffCF->SetMinimum(0.01);
428 hpteffCF->SetLineColor(8);
429 hpteffCF->SetLineWidth(3);
430 hpteffCF->SetMarkerColor(8);
431 hpteffCF->SetMarkerStyle(20);
432 hpteffCF->GetXaxis()->SetTitleOffset(1.2);
433 hpteffCF->GetYaxis()->SetTitleOffset(1.5);
434 hpteffCF->Draw("hist");
435 ceffpt->cd();
436 ceffpt->SetLeftMargin(0.15);
437 ceffpt->SetRightMargin(0.05);
438 hpteffCF->GetXaxis()->SetTitle("p_{T} (GeV/c)");
439 hpteffCF->GetYaxis()->SetTitle("Efficiency");
440 hpteffCF->Draw("hist");
441 hpteffCF->Draw("err same");
442
443 ceff->cd(2);
444 TH1D *hyeffCF = eff->Project(iy); //the efficiency vs y
445 hyeffCF->Sumw2();
446 //hyeffCF->SetMinimum(0.01);
447 hyeffCF->SetLineColor(8);
448 hyeffCF->SetLineWidth(3);
449 hyeffCF->SetMarkerColor(8);
450 hyeffCF->SetMarkerStyle(20);
451 hyeffCF->GetXaxis()->SetTitleOffset(1.2);
452 hyeffCF->GetYaxis()->SetTitleOffset(1.5);
453 hyeffCF->Draw("hist");
454 ceffy->cd();
455 ceffy->SetLeftMargin(0.15);
456 ceffy->SetRightMargin(0.05);
457 hyeffCF->GetXaxis()->SetTitle("y");
458 hyeffCF->GetYaxis()->SetTitle("Efficiency");
459 hyeffCF->Draw("hist");
460 hyeffCF->Draw("err same");
461
462 ceff->cd(3);
463 TH1D *hcTSeffCF = eff->Project(icTS); //the efficiency vs cosThetaStar
464 hcTSeffCF->Sumw2();
465 //hcTSeffCF->SetMinimum(0.01);
466 hcTSeffCF->SetLineColor(8);
467 hcTSeffCF->SetLineWidth(3);
468 hcTSeffCF->SetMarkerColor(8);
469 hcTSeffCF->SetMarkerStyle(20);
470 hcTSeffCF->GetXaxis()->SetTitleOffset(1.2);
471 hcTSeffCF->GetYaxis()->SetTitleOffset(1.5);
472 hcTSeffCF->Draw("hist");
473 ceffcTS->cd();
474 ceffcTS->SetLeftMargin(0.15);
475 ceffcTS->SetRightMargin(0.05);
476 hcTSeffCF->GetXaxis()->SetTitle("cosThetaStar");
477 hcTSeffCF->GetYaxis()->SetTitle("Efficiency");
478 hcTSeffCF->Draw("hist");
479 hcTSeffCF->Draw("err same");
480
481 ceff->cd(4);
482 TH1D *hptPieffCF = eff->Project(iptPi); //the efficiency vs ptPi
483 hptPieffCF->Sumw2();
484 //hptPieffCF->SetMinimum(0.01);
485 hptPieffCF->SetLineColor(8);
486 hptPieffCF->SetLineWidth(3);
487 hptPieffCF->SetMarkerColor(8);
488 hptPieffCF->SetMarkerStyle(20);
489 hptPieffCF->GetXaxis()->SetTitleOffset(1.2);
490 hptPieffCF->GetYaxis()->SetTitleOffset(1.5);
491 hptPieffCF->Draw("hist");
492 ceffptPi->cd();
493 ceffptPi->SetLeftMargin(0.15);
494 ceffptPi->SetRightMargin(0.05);
495 hptPieffCF->GetXaxis()->SetTitle("p_{T, #pi} (GeV/c)");
496 hptPieffCF->GetYaxis()->SetTitle("Efficiency");
497 hptPieffCF->Draw("hist");
498 hptPieffCF->Draw("err same");
499
500 ceff->cd(5);
501 TH1D *hptKeffCF = eff->Project(iptK); //the efficiency vs ptK
502 hptKeffCF->Sumw2();
503 //hptKeffCF->SetMinimum(0.01);
504 hptKeffCF->SetLineColor(8);
505 hptKeffCF->SetLineWidth(3);
506 hptKeffCF->SetMarkerColor(8);
507 hptKeffCF->SetMarkerStyle(20);
508 hptKeffCF->GetXaxis()->SetTitleOffset(1.2);
509 hptKeffCF->GetYaxis()->SetTitleOffset(1.5);
510 hptKeffCF->Draw("hist");
511 ceffptK->cd();
512 ceffptK->SetLeftMargin(0.15);
513 ceffptK->SetRightMargin(0.05);
514 hptKeffCF->GetXaxis()->SetTitle("p_{T, K} (GeV/c)");
515 hptKeffCF->GetYaxis()->SetTitle("Efficiency");
516 hptKeffCF->Draw("hist");
517 hptKeffCF->Draw("err same");
518
519 ceff->cd(6);
520 TH1D *hcTeffCF = eff->Project(icT); //the efficiency vs cT
521 hcTeffCF->Sumw2();
522 //hcTeffCF->SetMinimum(0.01);
523 hcTeffCF->SetLineColor(8);
524 hcTeffCF->SetLineWidth(3);
525 hcTeffCF->SetMarkerColor(8);
526 hcTeffCF->SetMarkerStyle(20);
527 hcTeffCF->GetXaxis()->SetTitleOffset(1.2);
528 hcTeffCF->GetYaxis()->SetTitleOffset(1.5);
529 hcTeffCF->Draw("hist");
530 ceffcT->cd();
531 ceffcT->SetLeftMargin(0.15);
532 ceffcT->SetRightMargin(0.05);
533 hcTeffCF->GetXaxis()->SetTitle("c#t (#mum)");
534 hcTeffCF->GetYaxis()->SetTitle("Efficiency");
535 hcTeffCF->Draw("hist");
536 hcTeffCF->Draw("err same");
537
538 ceff2D->cd();
539 TH2D *hptyeffCF = eff->Project(ipt,iy); //look at the numerator
540 //hptyeffCF->SetMinimum(0.01);
541 hptyeffCF->SetMarkerColor(8);
542 hptyeffCF->SetLineColor(8);
543 hptyeffCF->SetMinimum(0.01);
544 hptyeffCF->Draw("lego");
545 ceff2Dtext->cd();
546 hptyeffCF->GetXaxis()->SetTitle("p_{T} (GeV/c)");
547 hptyeffCF->GetXaxis()->SetTitleOffset(1.2);
548 hptyeffCF->GetYaxis()->SetTitle("y");
549 hptyeffCF->GetYaxis()->SetTitleOffset(1.2);
550 hptyeffCF->Draw("text");
551
552 /*
553 // printing eps files
554 ceff->Print("Plots/efficiencies.eps");
555 ceffpt->Print("Plots/effpt.eps");
556 ceffy->Print("Plots/effy.eps");
557 ceffcTS->Print("Plots/effcTS.eps");
558 ceffptPi->Print("Plots/effptPi.eps");
559 ceffptK->Print("Plots/effptK.eps");
560 ceffcT->Print("Plots/effcT.eps");
561 ceff2D->Print("Plots/eff2D_pt_y.eps");
562 ceff2Dtext->Print("Plots/eff2d_text_pt_y.eps");
563
564 // printing gif files
565 ceff->Print("Plots/efficiencies.gif");
566 ceffpt->Print("Plots/effpt.gif");
567 ceffy->Print("Plots/effy.gif");
568 ceffcTS->Print("Plots/effcTS.gif");
569 ceffptPi->Print("Plots/effptPi.gif");
570 ceffptK->Print("Plots/effptK.gif");
571 ceffcT->Print("Plots/effcT.gif");
572 ceff2D->Print("Plots/eff2D_pt_y.gif");
573 ceff2Dtext->Print("Plots/eff2d_text_pt_y.gif");
574 */
575
576 // applying efficiencies - using projections, not the ApplyEffCorrection method
577
578 TCanvas *cmultpiplypt = new TCanvas("cmultiplypt","Reco From Eff in pt distribution",50,50,550,550);
579 TCanvas *cmultpiplyy = new TCanvas("cmultiplyy","Reco From Eff in y distribution",50,50,550,550);
580 TCanvas *cmultpiplycTS = new TCanvas("cmultiplycTS","Reco From Eff in cTS distribution",50,50,550,550);
581 TCanvas *cmultpiplyptPi = new TCanvas("cmultiplyptPi","Reco From Eff in ptPi distribution",50,50,550,550);
582 TCanvas *cmultpiplyptK = new TCanvas("cmultiplyptK","Reco From Eff in ptK distribution",50,50,550,550);
583 TCanvas *cmultpiplycT = new TCanvas("cmultiplycT","Reco From Eff in cT distribution",50,50,550,550);
584
585 TH1D *hmultiplypt = new TH1D("hmultiplypt","hmultiplypt",13,0,10);
586 cout << " bin for histo MC = " << hMCpt1D->GetNbinsX() << " while for RECO histo = " << hRECpt1D->GetNbinsX() << " while for efficiency histo = " << hpteffCF->GetNbinsX() << endl;
587
588 const Double_t ptmin_0_4 = 0.0 ;
589 const Double_t ptmax_0_4 = 4.0 ;
590 const Double_t ptmin_4_8 = 4.0 ;
591 const Double_t ptmax_4_8 = 8.0 ;
592 const Double_t ptmin_8_10 = 8.0 ;
593 const Double_t ptmax_8_10 = 10.0 ;
594 const Int_t nbin0_0_4 = 8 ; //bins in pt
595 const Int_t nbin0_4_8 = 4 ; //bins in pt
596 const Int_t nbin0_8_10 = 1 ; //bins in pt
597 const Int_t nbins = nbin0_0_4 + nbin0_4_8 + nbin0_8_10;
598 Double_t binLim0[nbins+1];
599 for(Int_t i=0; i<=nbin0_0_4; i++) binLim0[i]=(Double_t)ptmin_0_4 + (ptmax_0_4-ptmin_0_4)/nbin0_0_4*(Double_t)i ;
600 if (binLim0[nbin0_0_4] != ptmin_4_8) {
601 printf("Calculated bin lim for pt - 1st range - differs from expected!\n");
602 }
603 for(Int_t i=0; i<=nbin0_4_8; i++) binLim0[i+nbin0_0_4]=(Double_t)ptmin_4_8 + (ptmax_4_8-ptmin_4_8)/nbin0_4_8*(Double_t)i ;
604 if (binLim0[nbin0_0_4+nbin0_4_8] != ptmin_8_10) {
605 printf("Calculated bin lim for pt - 2nd range - differs from expected!\n");
606 }
607 for(Int_t i=0; i<=nbin0_8_10; i++) binLim0[i+nbin0_0_4+nbin0_4_8]=(Double_t)ptmin_8_10 + (ptmax_8_10-ptmin_8_10)/nbin0_8_10*(Double_t)i ;
608
609 hmultiplypt->SetBins(nbins,binLim0);
610 hmultiplypt->Divide(hRECpt1D,hpteffCF,1,1,"b");
611 hmultiplypt->SetMinimum(0);
612 hmultiplypt->SetMaximum(hMCpt1D->GetMaximum());
613 hmultiplypt->SetLineColor(38);
614 hmultiplypt->SetLineWidth(3);
615 hmultiplypt->SetMarkerColor(38);
616 hmultiplypt->SetMarkerStyle(20);
617 hmultiplypt->GetXaxis()->SetTitleOffset(1.2);
618 hmultiplypt->GetYaxis()->SetTitleOffset(1.5);
619 hmultiplypt->GetXaxis()->SetTitle("p_{T} (GeV/c)");
620 cmultiplypt->SetLeftMargin(0.15);
621 cmultiplypt->SetRightMargin(0.05);
622 hmultiplypt->SetFillStyle(3004);
623 hmultiplypt->SetFillColor(38);
624 cmultiplypt->cd();
625 hmultiplypt->Draw("hist err");
626 hMCpt1D->Draw("hist same err");
627
628 TH1D *hmultiplyy = new TH1D("hmultiplyy","hmultiplyy",8,-2,2);
629 hmultiplyy->Divide(hRECy1D,hyeffCF,1,1,"b");
630 hmultiplyy->SetMinimum(0);
631 hmultiplyy->SetMaximum(hMCy1D->GetMaximum());
632 hmultiplyy->SetLineColor(38);
633 hmultiplyy->SetLineWidth(3);
634 hmultiplyy->SetMarkerColor(38);
635 hmultiplyy->SetMarkerStyle(20);
636 hmultiplyy->GetXaxis()->SetTitleOffset(1.2);
637 hmultiplyy->GetXaxis()->SetTitle("y");
638 hmultiplyy->GetYaxis()->SetTitleOffset(1.5);
639 cmultiplyy->SetLeftMargin(0.15);
640 cmultiplyy->SetRightMargin(0.05);
641 cmultiplyy->cd();
642 hmultiplyy->SetFillStyle(3004);
643 hmultiplyy->SetFillColor(38);
644 hmultiplyy->Draw("hist err");
645 hMCy1D->Draw("hist same err");
646
647 TH1D *hmultiplycTS = new TH1D("hmultiplycTS","hmultiplycTS",8,-1,1);
648 hmultiplycTS->Divide(hRECcTS1D,hcTSeffCF,1,1,"b");
649 hmultiplycTS->SetMinimum(0);
650 hmultiplycTS->SetMaximum(hMCcTS1D->GetMaximum());
651 hmultiplycTS->SetLineColor(38);
652 hmultiplycTS->SetLineWidth(3);
653 hmultiplycTS->SetMarkerColor(38);
654 hmultiplycTS->SetMarkerStyle(20);
655 hmultiplycTS->GetXaxis()->SetTitleOffset(1.2);
656 hmultiplycTS->GetXaxis()->SetTitle("cosThetaStar");
657 hmultiplycTS->GetYaxis()->SetTitleOffset(1.5);
658 cmultiplycTS->SetLeftMargin(0.15);
659 cmultiplycTS->SetRightMargin(0.05);
660 cmultiplycTS->cd();
661 hmultiplycTS->SetFillStyle(3004);
662 hmultiplycTS->SetFillColor(38);
663 hmultiplycTS->Draw("hist err");
664 hMCcTS1D->Draw("hist same err");
665
666 TH1D *hmultiplyptPi = new TH1D("hmultiplyptPi","hmultiplyptPi",13,0,10);
667 hmultiplyptPi->SetBins(nbins,binLim0);
668 hmultiplyptPi->Divide(hRECptPi1D,hptPieffCF,1,1,"b");
669 hmultiplyptPi->SetMinimum(0);
670 hmultiplyptPi->SetMaximum(hMCptPi1D->GetMaximum());
671 hmultiplyptPi->SetLineColor(38);
672 hmultiplyptPi->SetLineWidth(3);
673 hmultiplyptPi->SetMarkerColor(38);
674 hmultiplyptPi->SetMarkerStyle(20);
675 hmultiplyptPi->GetXaxis()->SetTitleOffset(1.2);
676 hmultiplyptPi->GetXaxis()->SetTitle("p_{T, #pi} (GeV/c)");
677 hmultiplyptPi->GetYaxis()->SetTitleOffset(1.5);
678 cmultiplyptPi->SetLeftMargin(0.15);
679 cmultiplyptPi->SetRightMargin(0.05);
680 cmultiplyptPi->cd();
681 hmultiplyptPi->SetFillStyle(3004);
682 hmultiplyptPi->SetFillColor(38);
683 hmultiplyptPi->Draw("hist err");
684 hMCptPi1D->Draw("hist same err");
685
686 TH1D *hmultiplyptK = new TH1D("hmultiplyptK","hmultiplyptK",13,0,10);
687 hmultiplyptK->SetBins(nbins,binLim0);
688 hmultiplyptK->Divide(hRECptK1D,hptKeffCF,1,1,"b");
689 hmultiplyptK->SetMinimum(0);
690 hmultiplyptK->SetMaximum(hMCptK1D->GetMaximum());
691 hmultiplyptK->SetLineColor(38);
692 hmultiplyptK->SetLineWidth(3);
693 hmultiplyptK->SetMarkerColor(38);
694 hmultiplyptK->SetMarkerStyle(20);
695 hmultiplyptK->GetXaxis()->SetTitleOffset(1.2);
696 hmultiplyptK->GetXaxis()->SetTitle("p_{T, K} (GeV/c)");
697 hmultiplyptK->GetYaxis()->SetTitleOffset(1.5);
698 cmultiplyptK->SetLeftMargin(0.15);
699 cmultiplyptK->SetRightMargin(0.05);
700 cmultiplyptK->cd();
701 hmultiplyptK->SetFillStyle(3004);
702 hmultiplyptK->SetFillColor(38);
703 hmultiplyptK->Draw("hist err");
704 hMCptK1D->Draw("hist same err");
705
706 TH1D *hmultiplycT = new TH1D("hmultiplycT","hmultiplycT",24,0,500);
707 hmultiplycT->Divide(hRECcT1D,hcTeffCF,1,1,"b");
708 hmultiplycT->SetMinimum(0);
709 hmultiplycT->SetMaximum(hMCcT1D->GetMaximum());
710 hmultiplycT->SetLineColor(38);
711 hmultiplycT->SetLineWidth(3);
712 hmultiplycT->SetMarkerColor(38);
713 hmultiplycT->SetMarkerStyle(20);
714 hmultiplycT->GetXaxis()->SetTitleOffset(1.2);
715 hmultiplycT->GetXaxis()->SetTitle("c#t (#mum)");
716 hmultiplycT->GetYaxis()->SetTitleOffset(1.5);
717 cmultiplycT->SetLeftMargin(0.15);
718 cmultiplycT->SetRightMargin(0.05);
719 cmultiplycT->cd();
720 hmultiplycT->SetFillStyle(3004);
721 hmultiplycT->SetFillColor(38);
722 hmultiplycT->Draw("hist err");
723 hMCcT1D->Draw("hist same err");
724
725 /*
726 TFile* file_histo = new TFile("fileHisto_180004.root","RECREATE");
727 hMCpt1D->Write("hMCpt1D");
728 hRECpt1D->Write("hRECpt1D");
729 hMCy1D->Write("hMCy1D");
730 hRECy1D->Write("hRECy1D");
731 hMCcTS1D->Write("hMCcTS1D");
732 hRECcTS1D->Write("hRECcTS1D");
733 hMCptPi1D->Write("hMCptPi1D");
734 hRECptPi1D->Write("hRECptPi1D");
735 hMCptK1D->Write("hMCptK1D");
736 hRECptK1D->Write("hRECptK1D");
737 hMCcT1D->Write("hMCcT1D");
738 hRECcT1D->Write("hRECcT1D");
739 hpteffCF->Write("hpteffCF");
740 hyeffCF->Write("hyeffCF");
741 hcTSeffCF->Write("hcTSeffCF");
742 hptPieffCF->Write("hptPieffCF");
743 hptKeffCF->Write("hptKeffCF");
744 hcTeffCF->Write("hcTeffCF");
745 hmultiplypt->Write("");
746 hmultiplyy->Write("");
747 hmultiplycTS->Write("");
748 hmultiplyptPi->Write("");
749 hmultiplyptK->Write("");
750 hmultiplycT->Write("");
751 file_histo->Close();
752 */
753
754 Int_t nsliceVars = 5;
755 Int_t sliceVars[5];
756 sliceVars[0] = 1;
757 sliceVars[1] = 2;
758 sliceVars[2] = 3;
759 sliceVars[3] = 4;
760 sliceVars[4] = 5;
761 Double_t varMin[6] = {0.5, -2, -1, 0., 0., 0. };
762 Double_t varMax[6] = {1.5, 2, 1, 10., 10., 500.};
763 AliCFContainer* data_sliced = data->MakeSlice(nsliceVars, sliceVars, varMin, varMax);
764 cout << " the container now has " << data_sliced->GetNVar() << " dimensions " << endl;
765
766}