FairRoot/PandaRoot
Functions
plot_all.C File Reference
#include "TString.h"
#include "TFile.h"
#include "TCanvas.h"
#include "TKey.h"
#include <iostream>
#include "TH1F.h"
#include "TRandom.h"

Go to the source code of this file.

Functions

bool plot_all (TString fn="QA_histograms.root")
 

Function Documentation

bool plot_all ( TString  fn = "QA_histograms.root")

Definition at line 12 of file plot_all.C.

References c1, f, h, name, next, obj, and TString.

13 {
14  TCanvas *c1 = new TCanvas();
15  c1->Divide(6,6);
16 
17  TFile *f=new TFile(fn,"READ");
18  if (!f->IsZombie())
19  {
20  TKey *key;
21  TIter next(f->GetListOfKeys());
22 
23  Int_t yy = 0;
24  while ( (key = (TKey*)next()) )
25  {
26  c1->cd(yy+1);
27  TObject *obj = key->ReadObj();
28 
29  // only check TH1Fs
30  if (!obj->InheritsFrom("TH1F")) continue;
31 
32  TString name = obj->GetName();
33  cout << name << endl;
34  TH1F* h = (TH1F*) obj;
35  h->SetLineColor(2);
36  h->SetLineWidth(2);
37  h->Draw();
38  yy++;
39  }
40 
41  }
42 }
TFile * f
Definition: bump_analys.C:12
c1
Definition: plot_dirc.C:35
TString name
static int next[96]
Definition: ranlxd.cxx:374
PndAnaPidSelector *& obj