Re: [ROOT] TClonesArray of tracks : case of tracks with error matrices

From: Rene Brun (Rene.Brun@cern.ch)
Date: Wed Apr 18 2001 - 16:03:34 MEST


Hi Pasha,

TClonesArray in version 3.01 permit variable length elements in the objects
of the arrays. These elements can be allocated dynamically by your objects.

However, this defeats somewhow the principle of a TClonesArray that is to
minimize the memory allocation/deallocation via new/delete.

In your case, you would like in your class Track, a member of the type
  double fCovar[5][5];  //with fixed matrix dimensions.

What is missing now is the possibility to pass the address of fCovar
to the TMatrixD class in order to use the TMatrixD functionality.
With 3.01, TMatrixD can be a member of your class Track, but again,
TMatrixD allocates its array dynamically and you want to avoid this.
TMatrixD has too much encapsulation. Something like TArrayD::Adopt should be
implemented in the TMatrix and TVector classes.

Rene Brun


Pasha Murat (630)840-8237@169G wrote:
> 
> Dear ROOTers,
> 
> recently I came across a technical problem, which hopefully has already been
> solved. Here it is:
> 
> - I have a list of reconstructed tracks, each of tracks has its
>   covariance matrix defined. Track data is a fixed length record.
> 
> - for many reasons, in particular, in order to optimize the performance,
>   I'd like to keep the tracks in TClonesArray.
> 
> - the problem is related to the choice of the representation for the
>   track error matrices: I don't see a proper matrix class in ROOT, which would
>   allow to store tracks in TClonesArray. TMatrix* classes allocate memory
>   dynamically and this seems to exclude them from the consideration.
> 
> I certainly realize that I can use TObjArrays to keep tracks. THe question,
> however is if there is any way to have track covariance matrix represented by
> one of the ROOT matrix classes and the tracks stored in TClonesArray's?
> 
>                                                         thanks, Pasha



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