]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWG2/FORWARD/analysis2/qa/DrawCuts.C
Major overhaul of the QA code.
[u/mrichter/AliRoot.git] / PWG2 / FORWARD / analysis2 / qa / DrawCuts.C
1 /**
2  * @file   DrawCuts.C
3  * @author Christian Holm Christensen <cholm@nbi.dk>
4  * @date   Thu Nov 17 11:20:22 2011
5  * 
6  * @brief  Draw the cuts used in the analysis
7  * 
8  * @ingroup pwg2_forward_scripts_qa
9  * 
10  */
11 /** 
12  * Draw cuts used in analysis
13  * 
14  * @param filename Input file name 
15  *
16  * @ingroup pwg2_forward_scripts_qa
17  */
18 void
19 DrawCuts(const char* filename="forward.root")
20 {
21   gStyle->SetPalette(1);
22   gStyle->SetOptFit(0);
23   gStyle->SetOptStat(0);
24   gStyle->SetTitleW(.4);
25   gStyle->SetTitleH(.1);
26   gStyle->SetTitleColor(0);
27   gStyle->SetTitleStyle(0);
28   gStyle->SetTitleBorderSize(0);
29   gStyle->SetTitleX(.6);
30
31   TFile* file = TFile::Open(filename, "READ");
32   if (!file) { 
33     Error("DrawCuts", "failed to open %s", filename);
34     return;
35   }
36
37   TList* forward = static_cast<TList*>(file->Get("Forward"));
38   if (!forward) { 
39     Error("DrawCuts", "List Forward not found in %s", filename);
40     return;
41   }
42
43   TList* dc = static_cast<TList*>(forward->FindObject("fmdDensityCalculator"));
44   if (!dc) { 
45     Error("DrawCuts", "List fmdDensityCalculator not found in Forward");
46     return;
47   }
48   TList* sf = static_cast<TList*>(forward->FindObject("fmdSharingFilter"));
49   if (!dc) { 
50     Error("DrawCuts", "List fmdSharingFilter not found in Forward");
51     return;
52   }
53   TList* hc = static_cast<TList*>(forward->FindObject("fmdHistCollector"));
54   if (!hc) { 
55     Error("DrawCuts", "List fmdHistCollector not found in Forward");
56     return;
57   }
58   TH2* hC = static_cast<TH2*>(sf->FindObject("highCuts"));
59   if (!hC) { 
60     Error("DrawCuts", "Histogram highCuts found in %s", sf->GetName());
61     return;
62   }
63   TH2* lC = static_cast<TH2*>(dc->FindObject("lowCuts"));
64   if (!lC) { 
65     Error("DrawCuts", "Histogram lowCuts found in %s", dc->GetName());
66     return;
67   }
68   TH2* co = static_cast<TH2*>(hc->FindObject("coverage"));
69   if (!co) { 
70     Error("DrawCuts", "Histogram coverage found in %s", hc->GetName());
71     return;
72   }
73   TCanvas* c = new TCanvas("cuts", "Cuts used in the analysis", 900, 700);
74   c->SetFillColor(0);
75   c->SetBorderSize(0);
76   c->Divide(3,1);
77   
78   c->cd(1); hC->Draw("colz");
79   c->cd(2); lC->Draw("colz");
80   c->cd(3); co->Draw("colz");
81   c->cd();
82
83 }
84
85   
86   
87