Revision 8ab25493f0a074bb85b050389cb146b7ce527ff0 authored by Fons Rademakers on 29 September 2006, 08:18:19 UTC, committed by Fons Rademakers on 29 September 2006, 08:18:19 UTC
git-svn-id: http://root.cern.ch/svn/root/trunk@16380 27541ba8-7e3a-0410-8455-c3a389f83636
1 parent f029540
loopdir.C
void loopdir() {
// example of script to loop on all the objects of a directory
// and print on Postscript all TH1 derived objects
// This script uses the file generated by tutorial hsimple.C
TFile f("hsimple.root");
TIter next(f.GetListOfKeys());
TKey *key;
TCanvas c1;
c1.Print("hsimple.ps[");
while ((key = (TKey*)next())) {
TClass *cl = gROOT->GetClass(key->GetClassName());
if (!cl->InheritsFrom("TH1")) continue;
TH1 *h = (TH1*)key->ReadObj();
h->Draw();
c1.Print("hsimple.ps");
}
c1.Print("hsimple.ps]");
}
![swh spinner](/static/img/swh-spinner.gif)
Computing file changes ...