Pointers of branch objects inside a TObjArray

From: GENTIT Francois-Xavier DAPNIA <GENTIT_at_dapnia.cea.fr>
Date: Mon, 28 Feb 2005 16:41:57 +0100

 

Hello rooters,

Suppose I have a TTree with N branches containing the same type of objects. If I store the pointers to these objects into an array, like:

and if I give the address of these pointers to TTree::SetBranchAddress() by:

everything goes fine. If now the pointers to the towers are NOT in an array, but are in a TObjArray, and if I give to SetBranchAddress the address of those pointers in a TObjArray, ROOT crashes at the call to TBranch::GetEntry(). I only succeeded in making the pointers reintegrate the TObjArray by first getting them into the array fTow, and then inserting them into the TObjArray by the method TObjArray::AddAt(). Is it a feature or do I do something wrong?

Thanks a lot in advance.

F.X.Gentit

DAPNIA/SPP CEA Saclay

http://gentit.home.cern.ch/gentit/  

image001.jpg
Received on Mon Feb 28 2005 - 16:45:07 MET

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