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

From: Pierre-Luc Drouin (pldrouin@physics.carleton.ca)
Date: Tue Aug 12 2003 - 23:09:22 MEST


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