Re: [ROOT] Fill TClonesArray

From: Rene Brun (Rene.Brun@cern.ch)
Date: Wed May 09 2001 - 10:56:10 MEST


Hi Valerie,

A TClonesArray expects a class derived from TObject. It cannot be a basic type.
For arrays of basic types, use classes like TArrayI or even simpler
   Int_t      fN;      //array length
   Int_t      fArray;  //[fN] indicates that the array fArray is of length fN

The interest of this simple last form is that you can immediatly browse
your array or do tree.Draw("fArray")

Rene Brun

Valerie Halyo wrote:
> 
> Hi,
> 
> I have a small problem
> I made a class where one of its variables
>    is a  TClonesArray of Int_t's
>   I was wondering if there exist an example of
>   How to fill this TClonesArray with integers
> I wrote
>  TClonesArray* array = new TClonesArray("Int_t", 10);
> but I could not fill the "array" correctly.
> 
> Thanks a lot
> Valerie



This archive was generated by hypermail 2b29 : Tue Jan 01 2002 - 17:50:44 MET