Major overhaul of the QA code.
[u/mrichter/AliRoot.git] / PWG2 / FORWARD / analysis2 / qa / DrawCuts.C
CommitLineData
2dbde04b 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 */
56199f2b 11/**
12 * Draw cuts used in analysis
13 *
2dbde04b 14 * @param filename Input file name
56199f2b 15 *
f0ef1e71 16 * @ingroup pwg2_forward_scripts_qa
56199f2b 17 */
0919aa56 18void
19DrawCuts(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) {
2dbde04b 33 Error("DrawCuts", "failed to open %s", filename);
0919aa56 34 return;
35 }
36
37 TList* forward = static_cast<TList*>(file->Get("Forward"));
38 if (!forward) {
2dbde04b 39 Error("DrawCuts", "List Forward not found in %s", filename);
0919aa56 40 return;
41 }
42
43 TList* dc = static_cast<TList*>(forward->FindObject("fmdDensityCalculator"));
44 if (!dc) {
2dbde04b 45 Error("DrawCuts", "List fmdDensityCalculator not found in Forward");
0919aa56 46 return;
47 }
48 TList* sf = static_cast<TList*>(forward->FindObject("fmdSharingFilter"));
49 if (!dc) {
2dbde04b 50 Error("DrawCuts", "List fmdSharingFilter not found in Forward");
0919aa56 51 return;
52 }
53 TList* hc = static_cast<TList*>(forward->FindObject("fmdHistCollector"));
54 if (!hc) {
2dbde04b 55 Error("DrawCuts", "List fmdHistCollector not found in Forward");
0919aa56 56 return;
57 }
58 TH2* hC = static_cast<TH2*>(sf->FindObject("highCuts"));
59 if (!hC) {
2dbde04b 60 Error("DrawCuts", "Histogram highCuts found in %s", sf->GetName());
0919aa56 61 return;
62 }
63 TH2* lC = static_cast<TH2*>(dc->FindObject("lowCuts"));
64 if (!lC) {
2dbde04b 65 Error("DrawCuts", "Histogram lowCuts found in %s", dc->GetName());
0919aa56 66 return;
67 }
68 TH2* co = static_cast<TH2*>(hc->FindObject("coverage"));
69 if (!co) {
2dbde04b 70 Error("DrawCuts", "Histogram coverage found in %s", hc->GetName());
0919aa56 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