FairRoot/PandaRoot
Functions
tut_makegifs.C File Reference

Go to the source code of this file.

Functions

 tut_makegifs (TString fn="signal_ana.root", TString type="gif")
 

Function Documentation

tut_makegifs ( TString  fn = "signal_ana.root",
TString  type = "gif" 
)

Definition at line 1 of file tut_makegifs.C.

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

2 {
3  TFile *f=new TFile(fn,"READ");
4 
5  TKey *key;
6 
7  TCanvas *c1=new TCanvas("c1","c1",10,10,700,600);
8  c1->cd();
9 
10  int i=1;
11 
12  TIter next(f->GetListOfKeys());
13 
14  while (key = (TKey*)next())
15  {
16  TObject *obj = key->ReadObj();
17  if (!obj->InheritsFrom("TH1")) continue;
18  TString name=TString(obj->GetName())+"."+type;
19  cout <<"Creating "<<name<<endl;
20  TH1* h=(TH1*) obj;
21  h->Draw();
22  c1->SaveAs(name);
23  }
24  //f->Close();
25 }
Int_t i
Definition: run_full.C:25
TFile * f
Definition: bump_analys.C:12
c1
Definition: plot_dirc.C:35
TString name
static int next[96]
Definition: ranlxd.cxx:374