Re: [ROOT] Pointer to element of TClonesArray

From: Rene Brun (Rene.Brun@cern.ch)
Date: Thu Feb 15 2001 - 22:52:49 MET


Hi Stefan,
If you want to preserve the advantages of a TClonesArray, do not use
pointers inside the objects of the array. Use indices instead.
Indices will be far more efficient for I/O.
With the new version of TTreeFormula recently developped by Philippe
Canal, you have now the possibility to use an element of an array
as an index of another array. See his recent announcement to roottalk.
This is supported since 3.00/04.

Rene Brun

On Thu, 15 Feb 2001, Stefan Steinbeck wrote:

> Hello,
> 
> I did set up a tree (splitlevel=1) with consist among other members-
> subbranches of two TClonesArray's a,b (storing two different particles,
> wich one decays into the other). 
> Is there a way to set up a pointer (or something equivalent in usage) from
> one element of the first TClonesArray a to an element of the other
> TClonesArray b? 
> 
> In principle the source looks the following way:
> 
> class RecoPsi : public TObject{
> ...
>   RecoMu	*mu1,*mu2;		// something like that
> ...}
> class RecoMu : public TObject {
> ...}
> class MuEvent: public TObject {
> ...
>   TClonesArray          *psi;
>   TClonesArray		*mu;
> ...}
> 
> Thank you very much in advance for your help!
> 
> Best regards,
> 	Stefan 
> 
> 



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