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