]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWG2/FORWARD/analysis2/scripts/DrawCuts.C
Some utility scripts added
[u/mrichter/AliRoot.git] / PWG2 / FORWARD / analysis2 / scripts / DrawCuts.C
CommitLineData
0919aa56 1void
2DrawCuts(const char* filename="forward.root")
3{
4 gStyle->SetPalette(1);
5 gStyle->SetOptFit(0);
6 gStyle->SetOptStat(0);
7 gStyle->SetTitleW(.4);
8 gStyle->SetTitleH(.1);
9 gStyle->SetTitleColor(0);
10 gStyle->SetTitleStyle(0);
11 gStyle->SetTitleBorderSize(0);
12 gStyle->SetTitleX(.6);
13
14 TFile* file = TFile::Open(filename, "READ");
15 if (!file) {
16 Error("DrawMCResult", "failed to open %s", filename);
17 return;
18 }
19
20 TList* forward = static_cast<TList*>(file->Get("Forward"));
21 if (!forward) {
22 Error("DrawMCResult", "List Forward not found in %s", filename);
23 return;
24 }
25
26 TList* dc = static_cast<TList*>(forward->FindObject("fmdDensityCalculator"));
27 if (!dc) {
28 Error("DrawMCResult", "List fmdDensityCalculator not found in Forward");
29 return;
30 }
31 TList* sf = static_cast<TList*>(forward->FindObject("fmdSharingFilter"));
32 if (!dc) {
33 Error("DrawMCResult", "List fmdSharingFilter not found in Forward");
34 return;
35 }
36 TList* hc = static_cast<TList*>(forward->FindObject("fmdHistCollector"));
37 if (!hc) {
38 Error("DrawMCResult", "List fmdHistCollector not found in Forward");
39 return;
40 }
41 TH2* hC = static_cast<TH2*>(sf->FindObject("highCuts"));
42 if (!hC) {
43 Error("DrawMCResults", "Histogram highCuts found in %s", sf->GetName());
44 return;
45 }
46 TH2* lC = static_cast<TH2*>(dc->FindObject("lowCuts"));
47 if (!lC) {
48 Error("DrawMCResults", "Histogram lowCuts found in %s", dc->GetName());
49 return;
50 }
51 TH2* co = static_cast<TH2*>(hc->FindObject("coverage"));
52 if (!co) {
53 Error("DrawMCResults", "Histogram coverage found in %s", hc->GetName());
54 return;
55 }
56 TCanvas* c = new TCanvas("cuts", "Cuts used in the analysis", 900, 700);
57 c->SetFillColor(0);
58 c->SetBorderSize(0);
59 c->Divide(3,1);
60
61 c->cd(1); hC->Draw("colz");
62 c->cd(2); lC->Draw("colz");
63 c->cd(3); co->Draw("colz");
64 c->cd();
65
66}
67
68
69
70