Hello All,
I would like to write a simple code to open a root file and print the total no of entries in each tree. How do I loop over the trees. I tried the following but it does not seem to work:
[code] ...
const char *keyname;
file = TFile::Open(ROOTfilename);
...
TIter next(file->GetListOfKeys());
TKey *key;
while ((key=(TKey*)next())) {
keyname=key->GetName();
totalEvents = keyname->GetEntries();
printf("%50s\t%i\n",keyname,totalEvents);
}
...[/code]
Thanks in advance,
Karthik.