How to loop over histos in file

Norbert Danneberg (Norbert.Danneberg@psi.ch)
Mon, 15 Jun 1998 15:37:56 +0200


HI Rooters,

I try too loop over all histos within a file using the following code :

BrowseFile(Char_t *FileName){

f1 = new TFile(FileName);
TList *MyList = f1->GetList();
TIter next(MyList);
MyList->ls();
TObject *obj;
while((obj = (TObject*)next())){
if(obj->InheritsFrom(TH1::Class)) obj->Draw();
}
c1.Update();
while(!getchar());

f1.Close();
f1.Delete();
}

It seems f1->GetList does not return the content of the file. What am I
doing wrong ??

Thanks Norbert

--
-------------------------------------
Norbert Danneberg

Institut f"ur Teilchenphysik Eidg. Techn. Hochschule Z"urich WLGA/E27 CH-5232 Villigen PSI

Phone: 0041-56-310-3284 Fax : 0041-56-310-4362 email: Norbert.Danneberg@psi.ch -------------------------------------