Re: [ROOT] TDirectory::Get() with objects in memory

From: Rene Brun (Rene.Brun@cern.ch)
Date: Wed Aug 13 2003 - 08:31:14 MEST


Pierre-Luc,

I cannot reproduce this problem. Please send a short script.

Rene Brun

Pierre-Luc Drouin wrote:
> 
> Hi,
> 
> There is something I don't understand with TDirectory::Get(). Suppose I've
> a
> TNamed object and a object from a class that I've derived from
> TNamed. Both objects have been added in gDirectory using
> gDirectory->Add(). The object names are respectively "tnamed" and
> "tnamedd". Why do I get this result:
> 
> gDirectory->Get("tnamed") returns a pointer to the TNamed object
> gDirectory->Get("tnamedd") returns a NULL pointer (not a pointer to the
> TNamed derived object)
> 
> If both objects are written a TKey into gDirectory, I get valid pointers
> with the 2 lines
> 
> I get also this problem with ROOT classes. With a TObjString object, I get
> a valid pointer. With a TMatrixD object, I get a NULL
> pointer.
> 
> TDirectory::FindObject() behaves the same way (with objects in memory of
> course)
> 
> Thank you!
> 
> Pierre-Luc Drouin



This archive was generated by hypermail 2b29 : Thu Jan 01 2004 - 17:50:14 MET