Re: [ROOT] problem in streaming TClonesArray in 3.03/9

From: Rene Brun (Rene.Brun@cern.ch)
Date: Thu Nov 21 2002 - 16:05:29 MET


Hi Wouter,

I can reproduce the problem and I have a temporary fix for this.
I am currently working on a few problems reported with TClonesArray
in some peculiar cases of inheritance or composition. I will include
my new version only when the reported problems (all connected)
will have been solved. This will not be before December.

Rene Brun

On Tue, 19 Nov 2002, Wouter Hulsbergen wrote:

> 
> Dear developers,
> 
> I have an event class which contains a TClonesArray of objects of type B,
> derived from type A. Type B also contains an object of type A:
> 
> class A : public TObject
> {
> }
> 
> class B : public A
> {
> private:
>   A _anA ;
> }
> 
> class Event
> {
> private:
>   TClonesArray* theAs ;
>   TClonesArray* theBs ;
> }
> 
> Processing the tree with tree->GetEvent(i) in a macro in interactive root,
> I found something strange:  The TClonesArray `theAs' and `theBs' are
> properly filled, except for one thing: The branches containing the
> elements `B::_anA' are all empty (zero).
> 
> If I use the TBrowser to browse through the elements `B::_anA', they are
> not zero, but instead take the values that are given to the corresponding
> elements in B itself (derived from A). So something is really mixed
> up.
> 
> I am sure that the elements are properly set before the ClonesArray is
> streamed. However, I cannot check that the TClonesArray is properly
> written to file, since I do not know how to implement a private Streamer
> in 3.03/09: The Streamer that I have written is not called.
> 
> What could be wrong?
> 
> Thanks and best regards,
> Wouter
> 



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