Line data Source code
1 : /**************************************************************************
2 : * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3 : * *
4 : * Author: The ALICE Off-line Project. *
5 : * Contributors are mentioned in the code where appropriate. *
6 : * *
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 : **************************************************************************/
15 :
16 : /* $Id$ */
17 :
18 : //_________________________________________________________________________
19 : // Class for PMD reconstructed space points
20 : // usually coming from the clusterisation algorithms
21 : // run on the digits
22 : //
23 : //////////////////////////////////////////////////////////////////////////////
24 :
25 : // --- ROOT system ---
26 :
27 : #include "TObjArray.h"
28 :
29 : // --- Standard library ---
30 :
31 : // --- AliRoot header files ---
32 :
33 : #include "AliPMDRecPoint.h"
34 : #include "AliGeometry.h"
35 : #include "AliDigitNew.h"
36 :
37 12 : ClassImp(AliPMDRecPoint)
38 :
39 :
40 : //____________________________________________________________________________
41 : //____________________________________________________________________________
42 : void AliPMDRecPoint::AddDigit(AliDigitNew & digit)
43 : {
44 : // adds a digit to the digits list
45 : // and accumulates the total amplitude and the multiplicity
46 :
47 :
48 0 : if ( fMulDigit >= fMaxDigit ) { // increase the size of the list
49 0 : int * tempo = new int[fMaxDigit*=2];
50 :
51 : Int_t index ;
52 :
53 0 : for ( index = 0 ; index < fMulDigit ; index++ )
54 0 : tempo[index] = fDigitsList[index] ;
55 :
56 0 : delete fDigitsList ;
57 0 : fDigitsList = tempo ;
58 0 : }
59 :
60 0 : fDigitsList[fMulDigit] = digit.GetIndexInList() ;
61 0 : fMulDigit++ ;
62 0 : fAmp += digit.GetAmp() ;
63 0 : }
64 :
65 : //____________________________________________________________________________
66 : void AliPMDRecPoint::Copy(TObject & recp) const
67 : {
68 : //
69 : // Copy *this onto pts
70 : //
71 : // Copy all first
72 :
73 0 : if(this != &recp) {
74 0 : ((TObject*) this)->Copy((TObject&)recp);
75 0 : ((AliPMDRecPoint&)recp).fAmp = fAmp;
76 0 : ((AliPMDRecPoint&)recp).fGeom = fGeom;
77 0 : ((AliPMDRecPoint&)recp).fIndexInList = fIndexInList;
78 0 : ((AliPMDRecPoint&)recp).fLocPos = fLocPos;
79 0 : ((AliPMDRecPoint&)recp).fLocPosM = new TMatrix(*fLocPosM);
80 0 : ((AliPMDRecPoint&)recp).fMaxDigit = fMaxDigit;
81 0 : ((AliPMDRecPoint&)recp).fMulDigit = fMulDigit;
82 0 : ((AliPMDRecPoint&)recp).fMaxTrack = fMaxTrack;
83 0 : ((AliPMDRecPoint&)recp).fMulTrack = fMulTrack;
84 :
85 : // Duplicate pointed objects
86 0 : ((AliPMDRecPoint&)recp).fDigitsList = new Int_t[fMulDigit];
87 0 : memcpy(((AliPMDRecPoint&)recp).fDigitsList,fDigitsList,fMulDigit*sizeof(Int_t));
88 0 : ((AliPMDRecPoint&)recp).fTracksList = new Int_t[fMulTrack];
89 0 : memcpy(((AliPMDRecPoint&)recp).fTracksList,fTracksList,fMulTrack*sizeof(Int_t));
90 0 : }
91 0 : }
92 :
93 : //____________________________________________________________________________
94 : void AliPMDRecPoint::GetCovarianceMatrix(TMatrix & mat) const
95 : {
96 : // returns the covariant matrix for the local position
97 :
98 0 : mat = *fLocPosM ;
99 :
100 0 : }
101 :
102 : //____________________________________________________________________________
103 : void AliPMDRecPoint::GetLocalPosition(TVector3 & pos) const
104 : {
105 : // returns the position of the cluster in the local reference system of the sub-detector
106 :
107 0 : pos = fLocPos;
108 :
109 :
110 0 : }
111 :
112 : //____________________________________________________________________________
113 : AliPMDRecPoint & AliPMDRecPoint::operator= (const AliPMDRecPoint &recp)
114 : {
115 0 : recp.Copy(*this);
116 0 : return (*this);
117 : }
118 :
119 :
120 : //____________________________________________________________________________
121 : void AliPMDRecPoint::GetGlobalPosition(TVector3 & gpos, TMatrix & gmat) const
122 : {
123 : // returns the position of the cluster in the global reference system of ALICE
124 : // and the uncertainty on this position
125 :
126 :
127 0 : fGeom->GetGlobal(this, gpos, gmat) ;
128 :
129 0 : }
130 :
131 :
132 :
133 :
134 :
135 :
136 :
137 :
138 :
|