[ROOT] TClonesArrays as Leaf in TTree

From: Mark Horner (mjhorner@lbl.gov)
Date: Thu Jul 29 2004 - 02:23:25 MEST

Hi Rooters

I want to make a TTree where every entry in a branch is a TClonesArray. 
My code seg-faults on the Fill() and simple script
to reproduce the behaviour is:

 void test()
  TTree mytree("mytree","Tree");
  TClonesArray *arr = new TClonesArray("StMuTrack",10);
  StMuTrack* v0 = new StMuTrack();
  new((StMuTrack*)arr[0]) StMuTrack(*v0);
  new((StMuTrack*)arr[1]) StMuTrack(*v0);

I presume I just don't understand how the TTree handles the TClonesArray 
and that I have made some stupid error.

The class StMuTrack does has a working copy constructor and is available 
elsewhere in a TClonesArray so I don't think this is the problem but
the code is here:

Could somone point out what I am doing wrong or send me in the correct 
general direction?



This archive was generated by hypermail 2b29 : Sun Jan 02 2005 - 05:50:09 MET