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 **************************************************************************/
19 //_________________________________________________________________________
20 // Base Class for reconstructed space points
21 // usually coming from the clusterisation algorithms
24 //*-- Author : Yves Schutz SUBATECH
25 //////////////////////////////////////////////////////////////////////////////
28 // --- ROOT system ---
30 // --- Standard library ---
32 // --- AliRoot header files ---
34 #include "AliRecPoint.h"
35 #include "AliGeometry.h"
36 #include "AliDigitNew.h"
41 //_______________________________________________________________________
42 AliRecPoint::AliRecPoint():
45 fIndexInList(-1), // to be set when the point is already stored
60 //_______________________________________________________________________
61 AliRecPoint::AliRecPoint(const char * ):
64 fIndexInList(-1), // to be set when the point is already stored
66 fLocPosM(new TMatrixF(3,3)),
71 fDigitsList(new int[fMaxDigit]),
72 fTracksList(new int[fMaxTrack])
79 //_______________________________________________________________________
80 AliRecPoint::AliRecPoint(const AliRecPoint& recp):
84 fIndexInList(-1), // to be set when the point is already stored
100 //_______________________________________________________________________
101 AliRecPoint::~AliRecPoint()
106 delete [] fDigitsList ;
107 delete [] fTracksList ;
111 //_______________________________________________________________________
112 void AliRecPoint::AddDigit(AliDigitNew & digit)
114 // adds a digit to the digits list
115 // and accumulates the total amplitude and the multiplicity
118 if ( fMulDigit >= fMaxDigit ) { // increase the size of the list
119 int * tempo = new int[fMaxDigit*2];
123 for ( index = 0 ; index < fMulDigit ; index++ )
124 tempo[index] = fDigitsList[index] ;
126 delete [] fDigitsList ;
127 fDigitsList = tempo ;
130 fDigitsList[fMulDigit] = digit.GetIndexInList() ;
132 fAmp += digit.GetAmp() ;
135 //_______________________________________________________________________
136 // void AliRecPoint::AddTrack(AliTrack & track)
138 // // adds a digit to the digits list
139 // // and accumulates the total amplitude and the multiplicity
142 // if ( fMulTrack >= fMaxTrack ) { // increase the size of the list
143 // int * tempo = new int[fMaxTrack*=2] ;
145 // for ( index = 0 ; index < fMulTrack ; index++ )
146 // tempo[index] = fTracksList[index] ;
147 // delete fTracksList ;
148 // fTracksList = tempo ;
151 // fTracksList[fMulTrack++]= (int) &Track ;
154 //_______________________________________________________________________
155 void AliRecPoint::Copy(TObject& recp) const
158 // Copy *this onto pts
161 if((TObject*)this != &recp) {
162 ((TObject*) this)->Copy(recp);
163 (dynamic_cast<AliRecPoint&>(recp)).fAmp = fAmp;
164 (dynamic_cast<AliRecPoint&>(recp)).fGeom = fGeom;
165 (dynamic_cast<AliRecPoint&>(recp)).fIndexInList = fIndexInList;
166 (dynamic_cast<AliRecPoint&>(recp)).fLocPos = fLocPos;
167 (dynamic_cast<AliRecPoint&>(recp)).fLocPosM = new TMatrixF(*fLocPosM);
168 (dynamic_cast<AliRecPoint&>(recp)).fMaxDigit = fMaxDigit;
169 (dynamic_cast<AliRecPoint&>(recp)).fMulDigit = fMulDigit;
170 (dynamic_cast<AliRecPoint&>(recp)).fMaxTrack = fMaxTrack;
171 (dynamic_cast<AliRecPoint&>(recp)).fMulTrack = fMulTrack;
173 // Duplicate pointed objects
174 (dynamic_cast<AliRecPoint&>(recp)).fDigitsList = new Int_t[fMulDigit];
175 memcpy((dynamic_cast<AliRecPoint&>(recp)).fDigitsList,fDigitsList,fMulDigit*sizeof(Int_t));
176 (dynamic_cast<AliRecPoint&>(recp)).fTracksList = new Int_t[fMulTrack];
177 memcpy((dynamic_cast<AliRecPoint&>(recp)).fTracksList,fTracksList,fMulTrack*sizeof(Int_t));
181 //_______________________________________________________________________
182 void AliRecPoint::GetCovarianceMatrix(TMatrixF & mat) const
184 // returns the covariant matrix for the local position
190 //____________________________________________________________________________
191 void AliRecPoint::GetLocalPosition(TVector3 & pos) const
193 // returns the position of the cluster in the local reference system of the sub-detector
200 //____________________________________________________________________________
201 void AliRecPoint::GetGlobalPosition(TVector3 & gpos, TMatrixF & gmat) const
203 // returns the position of the cluster in the global reference system of ALICE
204 // and the uncertainty on this position
207 fGeom->GetGlobal(this, gpos, gmat) ;