Re: removing objects from gDirectory without deleting them

From: Alexander Zvyagin (zvyagin@mail.cern.ch)
Date: Wed Mar 22 2000 - 10:40:19 MET


Hi,

On Wed, 22 Mar 2000, Rene Brun wrote:

> Hi Peter,
> Victor has already posted the solution using TH1::SetDirectory(0).
> Currently TH1 objects and TTree objects are automatically added (by
> their constructors) to the list of objects in memory in the current
> directory.
> This has the advantage that histograms in particular can be
> automatically
> written to the file in one call.
> We could provide a function to disable this feature. I see several
> possibilities:
>  1- gROOT->SetAutoAppend(Bool_t append=kTRUE);
>     This will set a global switch for all directories
>  2- gDirectory->SetAutoAppend(Bool_t append=kTRUE);
>     apply only to the specified directory
>  3- TH1::SetAutoAppend(Bool_t append=kTRUE);
>     a static function in TH1.
>     same in TTree.
> 
> My prefered solution would be 1. Please give me your suggestions.

I believe that this "autosaving" feature of an object is more related to
the object class properties (TH1) rather than to TDirectory or TROOT.
So I prefer solution number 3.

Alexander.



This archive was generated by hypermail 2b29 : Tue Jan 02 2001 - 11:50:21 MET