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.4 2000/05/16 08:30:02 fca
19 Using automatic streamer for c arrays
21 Revision 1.3 2000/03/20 14:22:25 fca
22 New version to support new PHOS code
24 Revision 1.2 2000/02/15 09:43:54 fca
26 - a bug in the streamer (wrong size of the arrays)
27 - replace Read/WriteArray by Read/WriteFastArray (suggestion R.Brun)
29 Revision 1.1 1999/12/17 09:01:14 fca
30 Y.Schutz new classes for reconstruction
35 //_________________________________________________________________________
36 // Base Class of Cluster (empty cxx needed by Root)
37 //*-- Author : Yves Schutz SUBATECH
38 //////////////////////////////////////////////////////////////////////////////
40 // --- ROOT system ---
42 #include "TObjArray.h"
44 // --- Standard library ---
46 // --- AliRoot header files ---
48 #include "AliRecPoint.h"
53 //____________________________________________________________________________
54 AliRecPoint::AliRecPoint()
59 fLocPos.SetXYZ(0., 0., 0.) ;
60 fLocPosM = new TMatrix(3,3) ;
63 fDigitsList = new int[fMaxDigit]; ;
66 fTracksList = new int[fMaxTrack]; ;
67 fIndexInList = -1 ; // to be set when the point is already stored
70 //____________________________________________________________________________
71 AliRecPoint::AliRecPoint(const AliRecPoint& recp)
79 //____________________________________________________________________________
80 AliRecPoint::~AliRecPoint()
92 //____________________________________________________________________________
93 void AliRecPoint::AddDigit(AliDigitNew & digit)
95 // adds a digit to the digits list
96 // and accumulates the total amplitude and the multiplicity
99 if ( fMulDigit >= fMaxDigit ) { // increase the size of the list
100 int * tempo = new ( int[fMaxDigit*=2] ) ;
104 for ( index = 0 ; index < fMulDigit ; index++ )
105 tempo[index] = fDigitsList[index] ;
108 fDigitsList = tempo ;
111 fDigitsList[fMulDigit] = digit.GetIndexInList() ;
113 fAmp += digit.GetAmp() ;
116 //____________________________________________________________________________
117 // void AliRecPoint::AddTrack(AliTrack & track)
119 // // adds a digit to the digits list
120 // // and accumulates the total amplitude and the multiplicity
123 // if ( fMulTrack >= fMaxTrack ) { // increase the size of the list
124 // int * tempo = new int[fMaxTrack*=2] ;
126 // for ( index = 0 ; index < fMulTrack ; index++ )
127 // tempo[index] = fTracksList[index] ;
128 // delete fTracksList ;
129 // fTracksList = tempo ;
132 // fTracksList[fMulTrack++]= (int) &Track ;
135 //____________________________________________________________________________
136 void AliRecPoint::Copy(AliRecPoint& recp) const
139 // Copy *this onto pts
143 ((TObject*) this)->Copy((TObject&)recp);
146 recp.fIndexInList = fIndexInList;
147 recp.fLocPos = fLocPos;
148 recp.fLocPosM = new TMatrix(*fLocPosM);
149 recp.fMaxDigit = fMaxDigit;
150 recp.fMulDigit = fMulDigit;
151 recp.fMaxTrack = fMaxTrack;
152 recp.fMulTrack = fMulTrack;
154 // Duplicate pointed objects
155 recp.fDigitsList = new Int_t[fMulDigit];
156 memcpy(recp.fDigitsList,fDigitsList,fMulDigit*sizeof(Int_t));
157 recp.fTracksList = new Int_t[fMulTrack];
158 memcpy(recp.fTracksList,fTracksList,fMulTrack*sizeof(Int_t));
162 //____________________________________________________________________________
163 void AliRecPoint::GetCovarianceMatrix(TMatrix & mat)
165 // returns the covariant matrix for the local position
171 //____________________________________________________________________________
172 void AliRecPoint::GetLocalPosition(TVector3 & pos)
174 // returns the position of the cluster in the local reference system of the sub-detector
181 //____________________________________________________________________________
182 AliRecPoint & AliRecPoint::operator= (const AliRecPoint &recp)
189 //____________________________________________________________________________
190 void AliRecPoint::GetGlobalPosition(TVector3 & gpos, TMatrix & gmat)
192 // returns the position of the cluster in the global reference system of ALICE
193 // and the uncertainty on this position
196 fGeom->GetGlobal(this, gpos, gmat) ;