Re: [ROOT] TTree & pointers

From: Rene Brun (Rene.Brun@cern.ch)
Date: Tue Feb 16 1999 - 09:49:14 MET


Matevz Tadel wrote:
> 
> Hi ...
> 
> I have a case like:
> 
> class Ev:public TObject{
>   TOrdCollection        *mFoo; // Collection of Bar objects
>   Bar                   *mBar; // Points to one of the Bars in mFoo
> };
> 
> When writing Ev to a tree, Bar that is pointed to by mBar gets written
> twice. Have I done sth wrong or is it a feature?
> 

If you want this functionality, you cannot use the split mode, unless
your objects mFoo and mBar are part of the same branch.
Note that if you need links between branches, this means that you need
the two branches in memory. There is no need to split in this case.
There is a technical difficulty in supporting this facility. You can
read only one branch, and in case you read the two branches, this may
happen
in the order (branch1, branch2) or (branch2,branch1).
In case of pointers to TClonesArray, I have announced several times our
intention to support references to objects in a TClonesArray.

Rene Brun



This archive was generated by hypermail 2b29 : Tue Jan 04 2000 - 00:43:29 MET