AliPhysics  a4b41ad (a4b41ad)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DrawCuts.C
Go to the documentation of this file.
1 
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 
const char * filename
Definition: TestFCM.C:1
void DrawCuts(const char *filename="forward.root")
Definition: DrawCuts.C:19
TCanvas * c
Definition: TestFitELoss.C:172
Definition: External.C:220
TFile * file