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.5 2000/07/11 18:24:59 fca
19 Coding convention corrections + few minor bug fixes
21 Revision 1.4 2000/05/16 08:30:02 fca
22 Using automatic streamer for c arrays
24 Revision 1.3 2000/03/20 14:22:25 fca
25 New version to support new PHOS code
27 Revision 1.2 2000/02/15 09:43:54 fca
29 - a bug in the streamer (wrong size of the arrays)
30 - replace Read/WriteArray by Read/WriteFastArray (suggestion R.Brun)
32 Revision 1.1 1999/12/17 09:01:14 fca
33 Y.Schutz new classes for reconstruction
38 //_________________________________________________________________________
39 // Base Class for reconstructed space points
40 // usually coming from the clusterisation algorithms
43 //*-- Author : Yves Schutz SUBATECH
44 //////////////////////////////////////////////////////////////////////////////
46 // --- ROOT system ---
48 #include "TObjArray.h"
50 // --- Standard library ---
52 // --- AliRoot header files ---
54 #include "AliRecPoint.h"
55 #include "AliGeometry.h"
56 #include "AliDigitNew.h"
61 //____________________________________________________________________________
62 AliRecPoint::AliRecPoint()
67 fLocPos.SetXYZ(0., 0., 0.) ;
68 fLocPosM = new TMatrix(3,3) ;
71 fDigitsList = new int[fMaxDigit]; ;
74 fTracksList = new int[fMaxTrack]; ;
75 fIndexInList = -1 ; // to be set when the point is already stored
78 //____________________________________________________________________________
79 AliRecPoint::AliRecPoint(const AliRecPoint& recp)
87 //____________________________________________________________________________
88 AliRecPoint::~AliRecPoint()
100 //____________________________________________________________________________
101 void AliRecPoint::AddDigit(AliDigitNew & digit)
103 // adds a digit to the digits list
104 // and accumulates the total amplitude and the multiplicity
107 if ( fMulDigit >= fMaxDigit ) { // increase the size of the list
108 int * tempo = new ( int[fMaxDigit*=2] ) ;
112 for ( index = 0 ; index < fMulDigit ; index++ )
113 tempo[index] = fDigitsList[index] ;
116 fDigitsList = tempo ;
119 fDigitsList[fMulDigit] = digit.GetIndexInList() ;
121 fAmp += digit.GetAmp() ;
124 //____________________________________________________________________________
125 // void AliRecPoint::AddTrack(AliTrack & track)
127 // // adds a digit to the digits list
128 // // and accumulates the total amplitude and the multiplicity
131 // if ( fMulTrack >= fMaxTrack ) { // increase the size of the list
132 // int * tempo = new int[fMaxTrack*=2] ;
134 // for ( index = 0 ; index < fMulTrack ; index++ )
135 // tempo[index] = fTracksList[index] ;
136 // delete fTracksList ;
137 // fTracksList = tempo ;
140 // fTracksList[fMulTrack++]= (int) &Track ;
143 //____________________________________________________________________________
144 void AliRecPoint::Copy(AliRecPoint& recp) const
147 // Copy *this onto pts
151 ((TObject*) this)->Copy((TObject&)recp);
154 recp.fIndexInList = fIndexInList;
155 recp.fLocPos = fLocPos;
156 recp.fLocPosM = new TMatrix(*fLocPosM);
157 recp.fMaxDigit = fMaxDigit;
158 recp.fMulDigit = fMulDigit;
159 recp.fMaxTrack = fMaxTrack;
160 recp.fMulTrack = fMulTrack;
162 // Duplicate pointed objects
163 recp.fDigitsList = new Int_t[fMulDigit];
164 memcpy(recp.fDigitsList,fDigitsList,fMulDigit*sizeof(Int_t));
165 recp.fTracksList = new Int_t[fMulTrack];
166 memcpy(recp.fTracksList,fTracksList,fMulTrack*sizeof(Int_t));
170 //____________________________________________________________________________
171 void AliRecPoint::GetCovarianceMatrix(TMatrix & mat)
173 // returns the covariant matrix for the local position
179 //____________________________________________________________________________
180 void AliRecPoint::GetLocalPosition(TVector3 & pos) const
182 // returns the position of the cluster in the local reference system of the sub-detector
189 //____________________________________________________________________________
190 AliRecPoint & AliRecPoint::operator= (const AliRecPoint &recp)
197 //____________________________________________________________________________
198 void AliRecPoint::GetGlobalPosition(TVector3 & gpos, TMatrix & gmat) const
200 // returns the position of the cluster in the global reference system of ALICE
201 // and the uncertainty on this position
204 fGeom->GetGlobal(this, gpos, gmat) ;