[ROOT] TTree Write

From: Jiri Chudoba (Jiri.Chudoba@cern.ch)
Date: Tue Mar 19 2002 - 08:04:25 MET


Hello,

the TTree knows its (ROOT) directory, where it was created (fDirectory),
but when it is written, it writes itself to gDirectory. Is there any
reason for that? Could it be changed that the default directory for
writing would be to fDirectory?

The workarround is simple:

 TDirectory *cwd = gDirectory;
 treeD->GetDirectory()->cd();
 treeD->Write(fTreeD->GetName(),option);
 cwd->cd();

but it could be directly in the root code.

                 Cheers,
                               Jiri.

PS: root 3.02.07, linux RedHat 6.1

*************************************************************************
* E-mail address:  Jiri.Chudoba@cern.ch                                 *
* WWW Homepage  :  http://delphiwww.troja.mff.cuni.cz/chudoba/          *
* Telephone     :  +41 22 76 72288                                      *
* Fax           :  +41 22 76 79480                                      *
*************************************************************************



This archive was generated by hypermail 2b29 : Sat Jan 04 2003 - 23:50:46 MET