Here's an example macro :
void loop(const char* filein="test.root")
{
TFile* fin = new TFile(filein) ;
if (!fin->IsOpen()) {
printf("<E> Cannot open input file %s\n",filein) ;
exit(1) ;
}
TList* list = fin->GetListOfKeys() ;
if (!list) { printf("<E> No keys found in file\n") ; exit(1) ; }
TIter next(list) ;
TKey* key ;
TObject* obj ;
while ( key = (TKey*)next() ) {
obj = key->ReadObj() ;
if ( (strcmp(obj->IsA()->GetName(),"TProfile")!=0)
&& (!obj->InheritsFrom("TH2"))
&& (!obj->InheritsFrom("TH1"))
) {
printf("<W> Object %s is not 1D or 2D histogram : "
"will not be converted\n",obj->GetName()) ;
}
printf("Histo name:%s title:%s\n",obj->GetName(),obj->GetTitle());
}
}
-- APHECETCHE Laurent (mailto:Laurent.Aphecetche@subatech.in2p3.fr) SUBATECH-Ecole des Mines de Nantes-4 rue Alfred Kastler-44070 NANTES cedex 03 TEL (+33/0) 2 51 85 84 17 - FAX (+33/0) 2 51 85 84 24 WWW: http://www-subatech.in2p3.fr/~photons