1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
18 Revision 1.1 1999/12/17 09:01:14 fca
19 Y.Schutz new classes for reconstruction
24 //_________________________________________________________________________
25 // Base Class of Cluster (empty cxx needed by Root)
26 //*-- Author : Yves Schutz SUBATECH
27 //////////////////////////////////////////////////////////////////////////////
29 // --- ROOT system ---
31 #include "TObjArray.h"
33 // --- Standard library ---
35 // --- AliRoot header files ---
37 #include "AliRecPoint.h"
42 //____________________________________________________________________________
43 AliRecPoint::AliRecPoint()
48 fLocPos.SetXYZ(0., 0., 0.) ;
49 fLocPosM = new TMatrix(3,3) ;
52 fDigitsList = new int[fMaxDigit]; ;
55 fTracksList = new int[fMaxTrack]; ;
58 //____________________________________________________________________________
59 AliRecPoint::~AliRecPoint()
64 if ( fDigitsList ) delete fDigitsList ;
65 if ( fTracksList ) delete fTracksList ;
69 //____________________________________________________________________________
70 void AliRecPoint::AddDigit(AliDigitNew & digit)
72 // adds a digit to the digits list
73 // and accumulates the total amplitude and the multiplicity
76 if ( fMulDigit >= fMaxDigit ) { // increase the size of the list
77 int * tempo = new ( int[fMaxDigit*=2] ) ;
81 for ( index = 0 ; index < fMulDigit ; index++ )
82 tempo[index] = fDigitsList[index] ;
88 fDigitsList[fMulDigit++]= (int) &digit ;
89 fAmp += digit.GetAmp() ;
92 //____________________________________________________________________________
93 // void AliRecPoint::AddTrack(AliTrack & track)
95 // // adds a digit to the digits list
96 // // and accumulates the total amplitude and the multiplicity
99 // if ( fMulTrack >= fMaxTrack ) { // increase the size of the list
100 // int * tempo = new int[fMaxTrack*=2] ;
102 // for ( index = 0 ; index < fMulTrack ; index++ )
103 // tempo[index] = fTracksList[index] ;
104 // delete fTracksList ;
105 // fTracksList = tempo ;
108 // fTracksList[fMulTrack++]= (int) &Track ;
111 //____________________________________________________________________________
112 void AliRecPoint::GetCovarianceMatrix(TMatrix & mat)
114 // returns the covariant matrix for the local position
120 //____________________________________________________________________________
121 void AliRecPoint::GetLocalPosition(TVector3 & pos)
123 // returns the position of the cluster in the local reference system of the sub-detector
130 //____________________________________________________________________________
131 void AliRecPoint::GetGlobalPosition(TVector3 & gpos, TMatrix & gmat)
133 // returns the position of the cluster in the global reference system of ALICE
134 // and the uncertainty on this position
137 fGeom->GetGlobal(this, gpos, gmat) ;
141 //______________________________________________________________________________
142 void AliRecPoint::Streamer(TBuffer &R__b)
144 // Stream an object of class AliRecPoint.
146 if (R__b.IsReading()) {
147 Version_t R__v = R__b.ReadVersion(); if (R__v) { }
148 TObject::Streamer(R__b);
150 R__b.ReadArray(fDigitsList);
152 fLocPos.Streamer(R__b);
156 R__b.ReadArray(fTracksList);
158 R__b.WriteVersion(AliRecPoint::IsA());
159 TObject::Streamer(R__b);
161 R__b.WriteArray(fDigitsList, fMaxDigit);
163 fLocPos.Streamer(R__b);
167 R__b.WriteArray(fTracksList, fMaxTrack);