Re: A class with TClonesArray in TTree

From: Rene Brun <brun_at_pcroot.cern.ch>
Date: Fri, 9 Sep 2005 15:49:46 +0200 (MEST)


Maxim,

Philippe will investigate this problem as soon as he will be back online.

Rene Brun

On Wed, 7 Sep 2005, Maxim A. Nikulin wrote:

> Hi,
>
> I encountered a problem with TClonesArray contained in an event class as a
> member. Please, find attached a set of files demonstrating the problem. The
> header EventTcaMember.h contains definition of two classes.
> "Track" is a simple class to be put in TClonesArray, it has "p" data field.
> EventTcaMember has the member "tca" of type TClonesArray. If I write this
> event class to a tree and ask TTree::Draw plot any function of "p", ROOT
> reports segmentation violation. The script testEventTcaMember.C writes file
> test.root and attempts to draw cos(p).
> Type
>
> root
> .L EventTcaMember.cc+
> .x testEventTcaMember.C
>
> to reproduce the problem. I see it in ROOT-5.02/00 on Pentium IV with Fedora
> Core 2 Linux.
>
> It seems that with pointer to TClonesArray instead of member of this type
> everything works. I wonder when I should use pointers and when I can include
> classes as members.
>
> Thanks in advance
>
Received on Fri Sep 09 2005 - 15:49:54 MEST

This archive was generated by hypermail 2.2.0 : Tue Jan 02 2007 - 14:45:12 MET