]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWG0/trigger/show.C
extra bit for TPC and Global constrained flagging
[u/mrichter/AliRoot.git] / PWG0 / trigger / show.C
1 void showAll(const char* fileName = "trigger.root")
2 {
3   TH1* fStats[100];
4
5   TFile::Open(fileName);
6   
7   Int_t count = 0;
8   while (1)
9   {
10     hist = (TH1*) gFile->Get(Form("fStats_%d", count));
11     if (!hist)
12       break;
13     
14     c = new TCanvas;
15     hist->Rebin(10);
16     hist->Draw();
17     c->SaveAs(Form("trigger_%d.png", count));
18     Printf("%s: %d", hist->GetTitle(), (Int_t) hist->GetEntries());
19     
20     fStats[count] = hist;
21     count++;
22   }
23
24   Int_t base = 1;
25   if (fStats[0])
26     base = (Int_t) fStats[0]->Integral(0, fStats[0]->GetNbinsX()+1);
27
28   for (Int_t i=0; i<count; i++)
29     if (fStats[i])
30     {
31       c->cd(i+1);
32       fStats[i]->Draw();
33       Printf("%s: %d triggers | %f %% of all triggered", fStats[i]->GetTitle(), (UInt_t) fStats[i]->Integral(0, fStats[i]->GetNbinsX()+1), 100.0 * fStats[i]->Integral(0, fStats[i]->GetNbinsX()+1) / base);
34     }
35
36 }
37
38 void show(const char* fileName = "trigger.root")
39 {
40   TFile::Open(fileName);
41   
42   c = new TCanvas("c", "c", 1500, 1000);
43   c->Divide(4, 3);
44   
45   for (Int_t i=0; i<4; i++)
46   {
47     for (Int_t j=6; j<=8; j++)
48     {
49       hist = (TH1*) gFile->Get(Form("fStats_%d_%d", i, j));
50       c->cd((j-6)*4+i+1);
51       hist->Rebin(2);
52       hist->Rebin(2);
53       hist->Rebin(2);
54       hist->Draw();
55     }
56   }  
57       
58   c->SaveAs("trigger_rates.png");
59 }
60