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.6 2000/10/02 21:28:14 fca
19 Removal of useless dependecies via forward declarations
21 Revision 1.5 2000/07/11 18:24:59 fca
22 Coding convention corrections + few minor bug fixes
24 Revision 1.4 2000/05/16 08:30:02 fca
25 Using automatic streamer for c arrays
27 Revision 1.3 2000/03/20 14:22:25 fca
28 New version to support new PHOS code
30 Revision 1.2 2000/02/15 09:43:54 fca
32 - a bug in the streamer (wrong size of the arrays)
33 - replace Read/WriteArray by Read/WriteFastArray (suggestion R.Brun)
35 Revision 1.1 1999/12/17 09:01:14 fca
36 Y.Schutz new classes for reconstruction
41 //_________________________________________________________________________
42 // Base Class for reconstructed space points
43 // usually coming from the clusterisation algorithms
46 //*-- Author : Yves Schutz SUBATECH
47 //////////////////////////////////////////////////////////////////////////////
50 // --- ROOT system ---
52 // --- Standard library ---
54 // --- AliRoot header files ---
56 #include "AliRecPoint.h"
57 #include "AliGeometry.h"
58 #include "AliDigitNew.h"
63 //____________________________________________________________________________
64 AliRecPoint::AliRecPoint()
69 fLocPos.SetXYZ(0., 0., 0.) ;
70 fLocPosM = new TMatrix(3,3) ;
73 fDigitsList = new int[fMaxDigit]; ;
76 fTracksList = new int[fMaxTrack]; ;
77 fIndexInList = -1 ; // to be set when the point is already stored
80 //____________________________________________________________________________
81 AliRecPoint::AliRecPoint(const AliRecPoint& recp)
89 //____________________________________________________________________________
90 AliRecPoint::~AliRecPoint()
102 //____________________________________________________________________________
103 void AliRecPoint::AddDigit(AliDigitNew & digit)
105 // adds a digit to the digits list
106 // and accumulates the total amplitude and the multiplicity
109 if ( fMulDigit >= fMaxDigit ) { // increase the size of the list
110 int * tempo = new ( int[fMaxDigit*=2] ) ;
114 for ( index = 0 ; index < fMulDigit ; index++ )
115 tempo[index] = fDigitsList[index] ;
118 fDigitsList = tempo ;
121 fDigitsList[fMulDigit] = digit.GetIndexInList() ;
123 fAmp += digit.GetAmp() ;
126 //____________________________________________________________________________
127 // void AliRecPoint::AddTrack(AliTrack & track)
129 // // adds a digit to the digits list
130 // // and accumulates the total amplitude and the multiplicity
133 // if ( fMulTrack >= fMaxTrack ) { // increase the size of the list
134 // int * tempo = new int[fMaxTrack*=2] ;
136 // for ( index = 0 ; index < fMulTrack ; index++ )
137 // tempo[index] = fTracksList[index] ;
138 // delete fTracksList ;
139 // fTracksList = tempo ;
142 // fTracksList[fMulTrack++]= (int) &Track ;
145 //____________________________________________________________________________
146 void AliRecPoint::Copy(AliRecPoint& recp) const
149 // Copy *this onto pts
153 ((TObject*) this)->Copy((TObject&)recp);
156 recp.fIndexInList = fIndexInList;
157 recp.fLocPos = fLocPos;
158 recp.fLocPosM = new TMatrix(*fLocPosM);
159 recp.fMaxDigit = fMaxDigit;
160 recp.fMulDigit = fMulDigit;
161 recp.fMaxTrack = fMaxTrack;
162 recp.fMulTrack = fMulTrack;
164 // Duplicate pointed objects
165 recp.fDigitsList = new Int_t[fMulDigit];
166 memcpy(recp.fDigitsList,fDigitsList,fMulDigit*sizeof(Int_t));
167 recp.fTracksList = new Int_t[fMulTrack];
168 memcpy(recp.fTracksList,fTracksList,fMulTrack*sizeof(Int_t));
172 //____________________________________________________________________________
173 void AliRecPoint::GetCovarianceMatrix(TMatrix & mat)
175 // returns the covariant matrix for the local position
181 //____________________________________________________________________________
182 void AliRecPoint::GetLocalPosition(TVector3 & pos) const
184 // returns the position of the cluster in the local reference system of the sub-detector
191 //____________________________________________________________________________
192 AliRecPoint & AliRecPoint::operator= (const AliRecPoint &recp)
199 //____________________________________________________________________________
200 void AliRecPoint::GetGlobalPosition(TVector3 & gpos, TMatrix & gmat) const
202 // returns the position of the cluster in the global reference system of ALICE
203 // and the uncertainty on this position
206 fGeom->GetGlobal(this, gpos, gmat) ;