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

From: Rene Brun (Rene.Brun@cern.ch)
Date: Sun Nov 24 2002 - 19:29:54 MET


Hi Wouter,

This problem should be fixed now in the development version in CVS.
I tested it with a configuration very close to yours.
It would be nice if you could make a test with your classes
to confirm that the problem is indeed fixed.
Let me know

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