some more updates
[u/mrichter/AliRoot.git] / PWGPP / macros / plotSparseK0.C
CommitLineData
687e1ab3 1{
2
3TFile f("output/pp-trunk010709-pdc1-00XXX.root")
4//TFile f("results_V0QA_v416rev08_090709.root");
5
6
7THnSparseF* sparseK0;
8
9sparseK0=(THnSparseF*)(outputTRD->FindObject("sparseK0"));
10
11sparseK0->GetAxis(5)->SetRangeUser(0.,3.9);
12sparseK0->GetAxis(9)->SetRangeUser(0.,3.9);
13
14
15TH1* ptgeantPPhys=sparseK0->Projection(5);
16TH1* etageantPPhys=sparseK0->Projection(6);
17TH1* phigeantPPhys=sparseK0->Projection(7);
18
19TH1* ptResSinglePPhys=sparseK0->Projection(13);
20TH1* etasinglePPhys=sparseK0->Projection(14);
21TH1* phisinglePPhys=sparseK0->Projection(15);
22
23
24TH1* ptgeantNPhys=sparseK0->Projection(9);
25TH1* etageantNPhys=sparseK0->Projection(10);
26TH1* phigeantNPhys=sparseK0->Projection(11);
27
28TH1* ptResSingleNPhys=sparseK0->Projection(21);
29TH1* etasingleNPhys=sparseK0->Projection(22);
30TH1* phisingleNPhys=sparseK0->Projection(23);
31
32
33
34
35
36
37TH1* efiEtaSingPPhys=(TH1*) etageantPPhys->Clone();
38efiEtaSingPPhys->Sumw2();
39efiEtaSingPPhys->Divide(etasinglePPhys,etageantPPhys);
40efiEtaSingPPhys->SetMinimum(0.);
41efiEtaSingPPhys->SetMaximum(1.2);
42efiEtaSingPPhys->SetAxisRange(-1.5,1.5);
43efiEtaSingPPhys->SetMarkerStyle(20);
44efiEtaSingPPhys->SetMarkerColor(2);
45
46
47
48TH1* efiEtaSingNPhys=(TH1*) etageantNPhys->Clone();
49efiEtaSingNPhys->Sumw2();
50efiEtaSingNPhys->Divide(etasingleNPhys,etageantNPhys);
51efiEtaSingNPhys->SetMinimum(0.);
52efiEtaSingNPhys->SetMaximum(1.2);
53efiEtaSingNPhys->SetAxisRange(-1.5,1.5);
54efiEtaSingNPhys->SetMarkerStyle(20);
55efiEtaSingNPhys->SetMarkerColor(2);
56
57
58
59TH1* efiPhiSingPPhys=(TH1*) phigeantPPhys->Clone();
60efiPhiSingPPhys->Sumw2();
61efiPhiSingPPhys->Divide(phisinglePPhys,phigeantPPhys);
62efiPhiSingPPhys->SetMinimum(0.);
63efiPhiSingPPhys->SetMaximum(1.2);
64efiPhiSingPPhys->SetAxisRange(-TMath::Pi(),TMath::Pi());
65efiPhiSingPPhys->SetMarkerStyle(20);
66efiPhiSingPPhys->SetMarkerColor(2);
67
68
69TH1* efiPhiSingNPhys=(TH1*) phigeantNPhys->Clone();
70efiPhiSingNPhys->Sumw2();
71efiPhiSingNPhys->Divide(phisingleNPhys,phigeantNPhys);
72efiPhiSingNPhys->SetMinimum(0.);
73efiPhiSingNPhys->SetMaximum(1.2);
74efiPhiSingNPhys->SetAxisRange(-TMath::Pi(),TMath::Pi());
75efiPhiSingNPhys->SetMarkerStyle(20);
76efiPhiSingNPhys->SetMarkerColor(2);
77
78
79
80// reconstructable tracks
81
82// track Lenght
83sparseK0->GetAxis(8)->SetRangeUser(50,200);
84sparseK0->GetAxis(12)->SetRangeUser(50,200);
85// momentum
86sparseK0->GetAxis(5)->SetRangeUser(0.,3.9);
87sparseK0->GetAxis(9)->SetRangeUser(0.,3.9);
88
89
90
91TH1* rgeantTrk=sparseK0->Projection(3);
92TH1* ptgeantPTrk=sparseK0->Projection(5);
93TH1* etageantPTrk=sparseK0->Projection(6);
94TH1* phigeantPTrk=sparseK0->Projection(7);
95
96
97TH1* ptgeantNTrk=sparseK0->Projection(9);
98TH1* etageantNTrk=sparseK0->Projection(10);
99TH1* phigeantNTrk=sparseK0->Projection(11);
100
101 sparseK0->GetAxis(20)->SetRangeUser(0,2.);
102 sparseK0->GetAxis(28)->SetRangeUser(0,2.);
103
104TH1* rsingleTrk=sparseK0->Projection(3);
105TH1* ptsinglePTrk=sparseK0->Projection(5);
106TH1* etasinglePTrk=sparseK0->Projection(6);
107TH1* phisinglePTrk=sparseK0->Projection(7);
108
109
110
111
112TH1* ptsingleNTrk=sparseK0->Projection(9);
113TH1* etasingleNTrk=sparseK0->Projection(10);
114TH1* phisingleNTrk=sparseK0->Projection(11);
115
116
117 sparseK0->GetAxis(32)->SetRangeUser(0,2.);
118 sparseK0->GetAxis(36)->SetRangeUser(0,2.);
119
120TH1* rV0Trk=sparseK0->Projection(3);
121TH1* ptV0PTrk=sparseK0->Projection(5);
122TH1* etaV0PTrk=sparseK0->Projection(6);
123TH1* phiV0PTrk=sparseK0->Projection(7);
124
125
126
127TH1* ptV0NTrk=sparseK0->Projection(9);
128TH1* etaV0NTrk=sparseK0->Projection(10);
129TH1* phiV0NTrk=sparseK0->Projection(11);
130
131
132TH1* efiSingPPhys=(TH1*) ptgeantPPhys->Clone();
133efiSingPPhys->Sumw2();
134efiSingPPhys->Divide(ptgeantPTrk,ptgeantPPhys);
135efiSingPPhys->SetAxisRange(0.,5);
136efiSingPPhys->SetMinimum(0.);
137efiSingPPhys->SetMaximum(1.2);
138efiSingPPhys->SetMarkerStyle(20);
139efiSingPPhys->SetMarkerColor(2);
140
141
142TH1* efiSingNPhys=(TH1*) ptgeantNPhys->Clone();
143efiSingNPhys->Sumw2();
144efiSingNPhys->Divide(ptgeantNTrk,ptgeantNPhys);
145efiSingNPhys->SetAxisRange(0.,5);
146efiSingNPhys->SetMinimum(0.);
147efiSingNPhys->SetMaximum(1.2);
148efiSingNPhys->SetMarkerStyle(20);
149efiSingNPhys->SetMarkerColor(2);
150
151TH1* efiSingPTrk=(TH1*) ptgeantPTrk->Clone();
152efiSingPTrk->Sumw2();
153efiSingPTrk->Divide(ptsinglePTrk,ptgeantPTrk);
154efiSingPTrk->SetAxisRange(0.,5);
155efiSingPTrk->SetMinimum(0.);
156efiSingPTrk->SetMaximum(1.2);
157efiSingPTrk->SetMarkerStyle(21);
158efiSingPTrk->SetMarkerColor(4);
159
160
161TH1* efiSingNTrk=(TH1*) ptgeantNTrk->Clone();
162efiSingNTrk->Sumw2();
163efiSingNTrk->Divide(ptsingleNTrk,ptgeantNTrk);
164efiSingNTrk->SetAxisRange(0.,5);
165efiSingNTrk->SetMinimum(0.);
166efiSingNTrk->SetMaximum(1.2);
167efiSingNTrk->SetMarkerStyle(21);
168efiSingNTrk->SetMarkerColor(4);
169
170
171TH1* efiV0PTrk=(TH1*) ptsinglePTrk->Clone();
172efiV0PTrk->Sumw2();
173efiV0PTrk->Divide(ptV0PTrk,ptsinglePTrk);
174efiV0PTrk->SetAxisRange(0.,5);
175efiV0PTrk->SetMinimum(0.);
176efiV0PTrk->SetMaximum(1.2);
177efiV0PTrk->SetMarkerStyle(21);
178efiV0PTrk->SetMarkerColor(3);
179
180
181
182TH1* efiV0NTrk=(TH1*) ptsingleNTrk->Clone();
183efiV0NTrk->Sumw2();
184efiV0NTrk->Divide(ptV0NTrk,ptsingleNTrk);
185efiV0NTrk->SetAxisRange(0.,5);
186efiV0NTrk->SetMinimum(0.);
187efiV0NTrk->SetMaximum(1.2);
188efiV0NTrk->SetMarkerStyle(21);
189efiV0NTrk->SetMarkerColor(3);
190
191
192TH1* efiEtaSingPTrk=(TH1*) etageantPTrk->Clone();
193efiEtaSingPTrk->Sumw2();
194efiEtaSingPTrk->Divide(etasinglePTrk,etageantPTrk);
195efiEtaSingPTrk->SetMinimum(0.);
196efiEtaSingPTrk->SetMaximum(1.2);
197efiEtaSingPTrk->SetAxisRange(-1.5,1.5);
198efiEtaSingPTrk->SetMarkerStyle(21);
199efiEtaSingPTrk->SetMarkerColor(4);
200
201
202TH1* efiEtaSingNTrk=(TH1*) etageantNTrk->Clone();
203efiEtaSingNTrk->Sumw2();
204efiEtaSingNTrk->Divide(etasingleNTrk,etageantNTrk);
205efiEtaSingNTrk->SetMinimum(0.);
206efiEtaSingNTrk->SetMaximum(1.2);
207efiEtaSingNTrk->SetAxisRange(-1.5,1.5);
208efiEtaSingNTrk->SetMarkerStyle(21);
209efiEtaSingNTrk->SetMarkerColor(4);
210
211
212TH1* efiEtaV0PTrk=(TH1*) etasinglePTrk->Clone();
213efiEtaV0PTrk->Sumw2();
214efiEtaV0PTrk->Divide(etaV0PTrk,etasinglePTrk);
215efiEtaV0PTrk->SetMinimum(0.);
216efiEtaV0PTrk->SetMaximum(1.2);
217efiEtaV0PTrk->SetMarkerStyle(21);
218efiEtaV0PTrk->SetMarkerColor(3);
219
220
221TH1* efiEtaV0NTrk=(TH1*) etasingleNTrk->Clone();
222efiEtaV0NTrk->Sumw2();
223efiEtaV0NTrk->Divide(etaV0NTrk,etasingleNTrk);
224efiEtaV0NTrk->SetMinimum(0.);
225efiEtaV0NTrk->SetMaximum(1.2);
226efiEtaV0NTrk->SetMarkerStyle(21);
227efiEtaV0NTrk->SetMarkerColor(3);
228
229
230
231TH1* efiPhiSingPTrk=(TH1*) phigeantPTrk->Clone();
232efiPhiSingPTrk->Sumw2();
233efiPhiSingPTrk->Divide(phisinglePTrk,phigeantPTrk);
234efiPhiSingPTrk->SetMinimum(0.);
235efiPhiSingPTrk->SetMaximum(1.2);
236efiPhiSingPTrk->SetAxisRange(-TMath::Pi(),TMath::Pi());
237efiPhiSingPTrk->SetMarkerStyle(20);
238efiPhiSingPTrk->SetMarkerColor(4);
239
240
241TH1* efiPhiSingNTrk=(TH1*) phigeantNTrk->Clone();
242efiPhiSingNTrk->Sumw2();
243efiPhiSingNTrk->Divide(phisingleNTrk,phigeantNTrk);
244efiPhiSingNTrk->SetMinimum(0.);
245efiPhiSingNTrk->SetMaximum(1.2);
246efiPhiSingNTrk->SetAxisRange(-TMath::Pi(),TMath::Pi());
247efiPhiSingNTrk->SetMarkerStyle(20);
248efiPhiSingNTrk->SetMarkerColor(4);
249
250
251TH1* efiPhiV0PTrk=(TH1*) phisinglePTrk->Clone();
252efiPhiV0PTrk->Sumw2();
253efiPhiV0PTrk->Divide(phiV0PTrk,phisinglePTrk);
254efiPhiV0PTrk->SetMinimum(0.);
255efiPhiV0PTrk->SetMaximum(1.2);
256efiPhiV0PTrk->SetMarkerStyle(21);
257efiPhiV0PTrk->SetMarkerColor(3);
258
259
260TH1* efiPhiV0NTrk=(TH1*) phisingleNTrk->Clone();
261efiPhiV0NTrk->Sumw2();
262efiPhiV0NTrk->Divide(phiV0NTrk,phisingleNTrk);
263efiPhiV0NTrk->SetMinimum(0.);
264efiPhiV0NTrk->SetMaximum(1.2);
265efiPhiV0NTrk->SetMarkerStyle(21);
266efiPhiV0NTrk->SetMarkerColor(3);
267
268
269
270sparseK0->GetAxis(32)->SetRangeUser(-2,0.);
271 sparseK0->GetAxis(36)->SetRangeUser(-2,0.);
272
273
274
275TH1* sigbXYZEPlusRecSingle=sparseK0->Projection(17);
276TH1* sigbXYZEMinusRecSingle=sparseK0->Projection(25);
277
278TH1* ptsinglePTrkNo=sparseK0->Projection(5);
279TH1* etasinglePTrkNo=sparseK0->Projection(6);
280TH1* phisinglePTrkNo=sparseK0->Projection(7);
281
282TH1* ptsingleNTrkNo=sparseK0->Projection(9);
283TH1* etasingleNTrkNo=sparseK0->Projection(10);
284TH1* phisingleNTrkNo=sparseK0->Projection(11);
285
286
287
288
289
290TH1* efiV0PTrkNo=(TH1*) ptsinglePTrkNo->Clone();
291efiV0PTrkNo->Sumw2();
292efiV0PTrkNo->Divide(ptsinglePTrkNo,ptsinglePTrk);
293efiV0PTrkNo->SetAxisRange(0.,5);
294efiV0PTrkNo->SetMinimum(0.);
295efiV0PTrkNo->SetMaximum(1.2);
296efiV0PTrkNo->SetMarkerStyle(21);
297efiV0PTrkNo->SetMarkerColor(6);
298
299
300
301TH1* efiV0NTrkNo=(TH1*) ptsingleNTrkNo->Clone();
302efiV0NTrkNo->Sumw2();
303efiV0NTrkNo->Divide(ptsingleNTrkNo,ptsingleNTrk);
304efiV0NTrkNo->SetAxisRange(0.,5);
305efiV0NTrkNo->SetMinimum(0.);
306efiV0NTrkNo->SetMaximum(1.2);
307efiV0NTrkNo->SetMarkerStyle(21);
308efiV0NTrkNo->SetMarkerColor(6);
309
310
311TH1* efiEtaV0PTrkNo=(TH1*) etasinglePTrkNo->Clone();
312efiEtaV0PTrkNo->Sumw2();
313efiEtaV0PTrkNo->Divide(etasinglePTrkNo,etasinglePTrk);
314efiEtaV0PTrkNo->SetAxisRange(-1.5,1.5);
315efiEtaV0PTrkNo->SetMinimum(0.);
316efiEtaV0PTrkNo->SetMaximum(1.2);
317efiEtaV0PTrkNo->SetMarkerStyle(21);
318efiEtaV0PTrkNo->SetMarkerColor(6);
319
320
321
322TH1* efiEtaV0NTrkNo=(TH1*) etasingleNTrkNo->Clone();
323efiEtaV0NTrkNo->Sumw2();
324efiEtaV0NTrkNo->Divide(etasingleNTrkNo,etasingleNTrk);
325efiEtaV0NTrkNo->SetAxisRange(-1.5,1.5);
326efiEtaV0NTrkNo->SetMinimum(0.);
327efiEtaV0NTrkNo->SetMaximum(1.2);
328efiEtaV0NTrkNo->SetMarkerStyle(21);
329efiEtaV0NTrkNo->SetMarkerColor(6);
330
331
332TH1* efiPhiV0PTrkNo=(TH1*) phisinglePTrkNo->Clone();
333efiPhiV0PTrkNo->Sumw2();
334efiPhiV0PTrkNo->Divide(phisinglePTrkNo,phisinglePTrk);
335efiPhiV0PTrkNo->SetAxisRange(-3.5,3.5);
336efiPhiV0PTrkNo->SetMinimum(0.);
337efiPhiV0PTrkNo->SetMaximum(1.2);
338efiPhiV0PTrkNo->SetMarkerStyle(21);
339efiPhiV0PTrkNo->SetMarkerColor(6);
340
341
342TH1* efiPhiV0NTrkNo=(TH1*) phisingleNTrkNo->Clone();
343efiPhiV0NTrkNo->Sumw2();
344efiPhiV0NTrkNo->Divide(phisingleNTrkNo,phisingleNTrk);
345efiPhiV0NTrkNo->SetAxisRange(-3.5,3.5);
346efiPhiV0NTrkNo->SetMinimum(0.);
347efiPhiV0NTrkNo->SetMaximum(1.2);
348efiPhiV0NTrkNo->SetMarkerStyle(21);
349efiPhiV0NTrkNo->SetMarkerColor(6);
350
351
352 TCanvas* c1 = new TCanvas("c1","MC Info",200,10,700,900);
353 c1->Divide(2,4);
354 c1->SetFillColor(0);
355 c1->GetFrame()->SetFillColor(0);
356 c1->SetBorderMode(0);
357 TPad *c1_1 = (TPad*)(c1->GetPrimitive("c1_1"));
358 TPad *c1_2 = (TPad*)(c1->GetPrimitive("c1_2"));
359 TPad *c1_3 = (TPad*)(c1->GetPrimitive("c1_3"));
360 TPad *c1_4 = (TPad*)(c1->GetPrimitive("c1_4"));
361 TPad *c1_5 = (TPad*)(c1->GetPrimitive("c1_5"));
362 TPad *c1_6 = (TPad*)(c1->GetPrimitive("c1_6"));
363
364
365 c1_1->SetGridx(1);
366 c1_3->SetGridx(1);
367 c1_2->SetGridx(1);
368 c1_4->SetGridx(1);
369 c1_5->SetGridx(1);
370 c1_6->SetGridx(1);
371
372 c1_1->SetGridy(1);
373 c1_3->SetGridy(1);
374 c1_2->SetGridy(1);
375 c1_4->SetGridy(1);
376 c1_5->SetGridy(1);
377 c1_6->SetGridy(1);
378
379
380c1->cd(1);
381efiSingPTrk->Draw();
382efiSingPTrk->SetXTitle("1/sqrt(pt) pos (sqrt(GeV))");
383efiSingPPhys->Draw("same");
384efiV0PTrk->Draw("same");
385efiV0PTrkNo->Draw("same");
386
387TLegend *leg1 = new TLegend(0.6,0.75,0.9,0.9);
388leg1->AddEntry(efiSingPTrk,"Single tracking eff");
389leg1->AddEntry(efiV0PTrk,"V0 tracking eff");
390leg1->AddEntry(efiV0PTrkNo,"V0 tracking ineff");
391leg1->Draw();
392c1->cd(2);
393efiSingNTrk->Draw();
394efiSingNTrk->SetXTitle("1/sqrt(pt) neg (sqrt(GeV))");
395efiSingNPhys->Draw("same");
396efiV0NTrk->Draw("same");
397efiV0NTrkNo->Draw("same");
398
399c1->cd(3);
400efiEtaSingPTrk->Draw();
401efiEtaV0PTrk->Draw("same");
402efiEtaV0PTrkNo->Draw("same");
403
404c1->cd(4);
405efiEtaSingNTrk->Draw();
406efiEtaV0NTrk->Draw("same");
407efiEtaV0NTrkNo->Draw("same");
408
409c1->cd(5);
410efiPhiSingPTrk->Draw();
411//efiPhiSingPPhys->Draw("same");
412efiPhiV0PTrk->Draw("same");
413efiPhiV0PTrkNo->Draw("same");
414
415c1->cd(6);
416efiPhiSingNTrk->Draw();
417//efiPhiSingNPhys->Draw("same");
418efiPhiV0NTrk->Draw("same");
419efiPhiV0NTrkNo->Draw("same");
420
421c1->cd(7);
422TH1* efiRSingTrk=(TH1*) rgeantTrk->Clone();
423efiRSingTrk->Sumw2();
424efiRSingTrk->Divide(rsingleTrk,rgeantTrk);
425
426efiRSingTrk->SetMinimum(0.);
427efiRSingTrk->SetMaximum(1.2);
428efiRSingTrk->SetMarkerStyle(21);
429efiRSingTrk->SetMarkerColor(4);
430
431efiRSingTrk->Draw();
432
433TH1* efiRV0Trk=(TH1*) rgeantTrk->Clone();
434efiRV0Trk->Sumw2();
435efiRV0Trk->Divide(rV0Trk,rsingleTrk);
436
437
438efiRV0Trk->SetMinimum(0.);
439efiRV0Trk->SetMaximum(1.2);
440efiRV0Trk->SetMarkerStyle(21);
441efiRV0Trk->SetMarkerColor(3);
442efiRV0Trk->Draw("same");
443
444
445//c1->Print("Effi-K0-norefit-v416rev08-090709.ps");
446c1->Print("Effi-K0-norefit-trunk010709.ps");
447
448}