RE: reading TTree from a TDirectory

From: Philippe Canal <pcanal_at_fnal.gov>
Date: Wed, 17 Aug 2005 10:09:08 -0500


Hi,

Given a pointer to a TDirectory (or TFile) object 'mydir', the best is to do:

   TTree *t;
   mydir->GetObject("treename",t);

Then 't' is updated with the address of the TTree object. If treename is not in the directory or if treename points to something that is __not__ a TTree, 't' will be set to 0.

Cheers,
Philippe.

-----Original Message-----
From: owner-roottalk_at_pcroot.cern.ch [mailto:owner-roottalk_at_pcroot.cern.ch] On Behalf Of Tulun Ergin
Sent: Tuesday, August 16, 2005 9:30 PM
To: roottalk_at_pcroot.cern.ch
Subject: [ROOT] reading TTree from a TDirectory

Hi,

Could somebody tell me the way to read a tree, which is saved in a TDirectory. I could not find any answer in the Root manual and tutorials...

Thanx,

Tulun Ergin Received on Wed Aug 17 2005 - 17:14:34 MEST

This archive was generated by hypermail 2.2.0 : Tue Jan 02 2007 - 14:45:11 MET