Re: reading variables form ntuples

Rene Brun (Rene.Brun@cern.ch)
Tue, 12 Aug 1997 11:50:02 +0200


Robert Loke wrote:
>
> Hi Rooters!
>
> concerning my previous posting:
> > I've got problems in reading variables from a NTuple, which was
> > ...
> > *** Interpreter error recovered ***
>
> >Does anybody have an idea what went wrong?
> I found the bug causing the problem. I'd some mismatch with the names
> in this files. It was my own stupidness. Sorry.
>
> > How can I get the names of the objects stored within this file?
> still an open question, as long as you don't want to use the browser ...
> Isn't it possible to extend the output of Map() and add the objects names?
>

I will extend TMap to also show the object names. Currently you can use
TFile::ls.
To loop on the objects stored in a file, you can do:
TKey *key;
TIter next(file.GetListOfKeys());
while (key = (TKey *) next())
char *name = key->GetName(); //*-* Loop on all the keys
}

Rene Brun