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 //_________________________________________________________________________
19 // Class for PMD reconstructed space points
20 // usually coming from the clusterisation algorithms
23 //////////////////////////////////////////////////////////////////////////////
25 // --- ROOT system ---
27 #include "TObjArray.h"
29 // --- Standard library ---
31 // --- AliRoot header files ---
33 #include "AliPMDRecPoint.h"
34 #include "AliGeometry.h"
35 #include "AliDigitNew.h"
37 ClassImp(AliPMDRecPoint)
40 //____________________________________________________________________________
41 //____________________________________________________________________________
42 void AliPMDRecPoint::AddDigit(AliDigitNew & digit)
44 // adds a digit to the digits list
45 // and accumulates the total amplitude and the multiplicity
48 if ( fMulDigit >= fMaxDigit ) { // increase the size of the list
49 int * tempo = new ( int[fMaxDigit*=2] ) ;
53 for ( index = 0 ; index < fMulDigit ; index++ )
54 tempo[index] = fDigitsList[index] ;
60 fDigitsList[fMulDigit] = digit.GetIndexInList() ;
62 fAmp += digit.GetAmp() ;
65 //____________________________________________________________________________
66 void AliPMDRecPoint::Copy(AliPMDRecPoint& recp) const
69 // Copy *this onto pts
73 ((TObject*) this)->Copy((TObject&)recp);
76 recp.fIndexInList = fIndexInList;
77 recp.fLocPos = fLocPos;
78 recp.fLocPosM = new TMatrix(*fLocPosM);
79 recp.fMaxDigit = fMaxDigit;
80 recp.fMulDigit = fMulDigit;
81 recp.fMaxTrack = fMaxTrack;
82 recp.fMulTrack = fMulTrack;
84 // Duplicate pointed objects
85 recp.fDigitsList = new Int_t[fMulDigit];
86 memcpy(recp.fDigitsList,fDigitsList,fMulDigit*sizeof(Int_t));
87 recp.fTracksList = new Int_t[fMulTrack];
88 memcpy(recp.fTracksList,fTracksList,fMulTrack*sizeof(Int_t));
92 //____________________________________________________________________________
93 void AliPMDRecPoint::GetCovarianceMatrix(TMatrix & mat)
95 // returns the covariant matrix for the local position
101 //____________________________________________________________________________
102 void AliPMDRecPoint::GetLocalPosition(TVector3 & pos) const
104 // returns the position of the cluster in the local reference system of the sub-detector
111 //____________________________________________________________________________
112 AliPMDRecPoint & AliPMDRecPoint::operator= (const AliPMDRecPoint &recp)
119 //____________________________________________________________________________
120 void AliPMDRecPoint::GetGlobalPosition(TVector3 & gpos, TMatrix & gmat) const
122 // returns the position of the cluster in the global reference system of ALICE
123 // and the uncertainty on this position
126 fGeom->GetGlobal(this, gpos, gmat) ;