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