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 **************************************************************************/
20 //_________________________________________________________________________
21 // Class for PMD reconstructed space points
22 // usually coming from the clusterisation algorithms
25 //////////////////////////////////////////////////////////////////////////////
27 // --- ROOT system ---
29 #include "TObjArray.h"
31 // --- Standard library ---
33 // --- AliRoot header files ---
35 #include "AliPMDRecPoint.h"
36 #include "AliGeometry.h"
37 #include "AliDigitNew.h"
39 ClassImp(AliPMDRecPoint)
42 //____________________________________________________________________________
43 //____________________________________________________________________________
44 void AliPMDRecPoint::AddDigit(AliDigitNew & digit)
46 // adds a digit to the digits list
47 // and accumulates the total amplitude and the multiplicity
50 if ( fMulDigit >= fMaxDigit ) { // increase the size of the list
51 int * tempo = new ( int[fMaxDigit*=2] ) ;
55 for ( index = 0 ; index < fMulDigit ; index++ )
56 tempo[index] = fDigitsList[index] ;
62 fDigitsList[fMulDigit] = digit.GetIndexInList() ;
64 fAmp += digit.GetAmp() ;
67 //____________________________________________________________________________
68 void AliPMDRecPoint::Copy(AliPMDRecPoint& recp) const
71 // Copy *this onto pts
75 ((TObject*) this)->Copy((TObject&)recp);
78 recp.fIndexInList = fIndexInList;
79 recp.fLocPos = fLocPos;
80 recp.fLocPosM = new TMatrix(*fLocPosM);
81 recp.fMaxDigit = fMaxDigit;
82 recp.fMulDigit = fMulDigit;
83 recp.fMaxTrack = fMaxTrack;
84 recp.fMulTrack = fMulTrack;
86 // Duplicate pointed objects
87 recp.fDigitsList = new Int_t[fMulDigit];
88 memcpy(recp.fDigitsList,fDigitsList,fMulDigit*sizeof(Int_t));
89 recp.fTracksList = new Int_t[fMulTrack];
90 memcpy(recp.fTracksList,fTracksList,fMulTrack*sizeof(Int_t));
94 //____________________________________________________________________________
95 void AliPMDRecPoint::GetCovarianceMatrix(TMatrix & mat)
97 // returns the covariant matrix for the local position
103 //____________________________________________________________________________
104 void AliPMDRecPoint::GetLocalPosition(TVector3 & pos) const
106 // returns the position of the cluster in the local reference system of the sub-detector
113 //____________________________________________________________________________
114 AliPMDRecPoint & AliPMDRecPoint::operator= (const AliPMDRecPoint &recp)
121 //____________________________________________________________________________
122 void AliPMDRecPoint::GetGlobalPosition(TVector3 & gpos, TMatrix & gmat) const
124 // returns the position of the cluster in the global reference system of ALICE
125 // and the uncertainty on this position
128 fGeom->GetGlobal(this, gpos, gmat) ;