Transition PWG0 -> PWGUD
[u/mrichter/AliRoot.git] / PWGUD / selectors / eventStats / show.C
1 void show(const char* fileName = "event_stat.root")
2 {
3   if (TString(fileName).BeginsWith("alien://"))
4     TGrid::Connect("alien://");
5
6   TFile::Open(fileName);
7   
8   c = new TCanvas("c", "c", 1200, 600);
9   hist = (TH1*) gFile->Get("physics_selection/fHistStatistics");
10   hist->SetStats(0);
11   hist->Draw("TEXT");
12   hist->SetTitle("");
13   hist->SetMarkerSize(1.5);
14   c->SetLeftMargin(0.20);
15   c->SetBottomMargin(0.2);
16   c->SaveAs("stat.png");
17   
18   c = new TCanvas("c2", "c2", 800, 600);
19   c->SetLeftMargin(0.25);
20   hist = (TH1*) gFile->Get("physics_selection/fHistBunchCrossing");
21   hist->SetStats(0);
22   hist->SetTitle("");
23   hist->Draw("COL");
24   c->SaveAs("bc.png");
25
26   // BG
27   gStyle->SetStatX(0.87);
28   gStyle->SetStatY(0.93);
29
30   TH2F * hBB  = (TH2F*) gDirectory->Get("physics_selection/background_identification/hCvsTCuts_CINT1B-ABCE-NOPF-ALL");
31   TH2F * hBE  = (TH2F*) gDirectory->Get("physics_selection/background_identification/hCvsTCuts_CINT1C-ABCE-NOPF-ALL");
32   TH2F * hBEA = (TH2F*) gDirectory->Get("physics_selection/background_identification/hCvsTCuts_CINT1A-ABCE-NOPF-ALL");
33
34   if(!hBB || !hBE || !hBEA) {
35     printf("WARNING: no BG histos\n");
36   }
37   else
38   {
39     hBE->Add(hBEA);
40     hBE->SetTitle("CINT1A-ABCE-NOPF-ALL + CINT1C-ABCE-NOPF-ALL");
41     c = new TCanvas("cbg","cbg",800,400);
42     c->Divide(2,1);
43     c->cd(1);
44     hBB->Draw("colz");
45     c->cd(2);
46     hBE->Draw("colz");
47     c->Print("bg.png");
48   }
49 }