ROOT logo
void showAll(const char* fileName = "trigger.root")
{
  TH1* fStats[100];

  TFile::Open(fileName);
  
  Int_t count = 0;
  while (1)
  {
    hist = (TH1*) gFile->Get(Form("fStats_%d", count));
    if (!hist)
      break;
    
    c = new TCanvas;
    hist->Rebin(10);
    hist->Draw();
    c->SaveAs(Form("trigger_%d.png", count));
    Printf("%s: %d", hist->GetTitle(), (Int_t) hist->GetEntries());
    
    fStats[count] = hist;
    count++;
  }

  Int_t base = 1;
  if (fStats[0])
    base = (Int_t) fStats[0]->Integral(0, fStats[0]->GetNbinsX()+1);

  for (Int_t i=0; i<count; i++)
    if (fStats[i])
    {
      c->cd(i+1);
      fStats[i]->Draw();
      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);
    }

}

void show(const char* fileName = "trigger.root")
{
  TFile::Open(fileName);
  
  c = new TCanvas("c", "c", 1500, 1000);
  c->Divide(4, 3);
  
  for (Int_t i=0; i<4; i++)
  {
    for (Int_t j=6; j<=8; j++)
    {
      hist = (TH1*) gFile->Get(Form("fStats_%d_%d", i, j));
      c->cd((j-6)*4+i+1);
      hist->Rebin(2);
      hist->Rebin(2);
      hist->Rebin(2);
      hist->Draw();
    }
  }  
      
  c->SaveAs("trigger_rates.png");
}

 show.C:1
 show.C:2
 show.C:3
 show.C:4
 show.C:5
 show.C:6
 show.C:7
 show.C:8
 show.C:9
 show.C:10
 show.C:11
 show.C:12
 show.C:13
 show.C:14
 show.C:15
 show.C:16
 show.C:17
 show.C:18
 show.C:19
 show.C:20
 show.C:21
 show.C:22
 show.C:23
 show.C:24
 show.C:25
 show.C:26
 show.C:27
 show.C:28
 show.C:29
 show.C:30
 show.C:31
 show.C:32
 show.C:33
 show.C:34
 show.C:35
 show.C:36
 show.C:37
 show.C:38
 show.C:39
 show.C:40
 show.C:41
 show.C:42
 show.C:43
 show.C:44
 show.C:45
 show.C:46
 show.C:47
 show.C:48
 show.C:49
 show.C:50
 show.C:51
 show.C:52
 show.C:53
 show.C:54
 show.C:55
 show.C:56
 show.C:57
 show.C:58
 show.C:59
 show.C:60
 show.C:61