]>
Commit | Line | Data |
---|---|---|
2a33668d | 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 | ||
acd84897 | 16 | /* $Id$ */ |
2a33668d | 17 | |
18 | //-*-C++-*- | |
19 | //_________________________________________________________________________ | |
94de3818 | 20 | // Base Class for reconstructed space points |
21 | // usually coming from the clusterisation algorithms | |
22 | // run on the digits | |
23 | // | |
2a33668d | 24 | //*-- Author : Yves Schutz SUBATECH |
25 | ////////////////////////////////////////////////////////////////////////////// | |
26 | ||
2a33668d | 27 | |
65fb704d | 28 | // --- ROOT system --- |
2a33668d | 29 | |
30 | // --- Standard library --- | |
31 | ||
32 | // --- AliRoot header files --- | |
33 | ||
34 | #include "AliRecPoint.h" | |
94de3818 | 35 | #include "AliGeometry.h" |
36 | #include "AliDigitNew.h" | |
2a33668d | 37 | |
38 | ClassImp(AliRecPoint) | |
39 | ||
40 | ||
e2afb3b6 | 41 | //_______________________________________________________________________ |
42 | AliRecPoint::AliRecPoint(): | |
43 | fAmp(0), | |
44 | fGeom(0), | |
45 | fIndexInList(-1), // to be set when the point is already stored | |
46 | fLocPos(0,0,0), | |
47 | fLocPosM(0), | |
48 | fMaxDigit(100), | |
49 | fMulDigit(0), | |
50 | fMaxTrack(5), | |
51 | fMulTrack(0), | |
52 | fDigitsList(0), | |
53 | fTracksList(0) | |
ef07487e | 54 | { |
e2afb3b6 | 55 | // |
ef07487e | 56 | // default ctor |
e2afb3b6 | 57 | // |
ef07487e | 58 | } |
59 | ||
e2afb3b6 | 60 | //_______________________________________________________________________ |
61 | AliRecPoint::AliRecPoint(const char * ): | |
62 | fAmp(0), | |
63 | fGeom(0), | |
64 | fIndexInList(-1), // to be set when the point is already stored | |
65 | fLocPos(0,0,0), | |
e8d02863 | 66 | fLocPosM(new TMatrixF(3,3)), |
e2afb3b6 | 67 | fMaxDigit(100), |
68 | fMulDigit(0), | |
69 | fMaxTrack(5), | |
70 | fMulTrack(0), | |
71 | fDigitsList(new int[fMaxDigit]), | |
72 | fTracksList(new int[fMaxTrack]) | |
2a33668d | 73 | { |
e2afb3b6 | 74 | // |
75 | // Standard ctor | |
76 | // | |
2a33668d | 77 | } |
78 | ||
e2afb3b6 | 79 | //_______________________________________________________________________ |
80 | AliRecPoint::AliRecPoint(const AliRecPoint& recp): | |
81 | TObject(recp), | |
82 | fAmp(0), | |
83 | fGeom(0), | |
84 | fIndexInList(-1), // to be set when the point is already stored | |
85 | fLocPos(0,0,0), | |
86 | fLocPosM(0), | |
87 | fMaxDigit(100), | |
88 | fMulDigit(0), | |
89 | fMaxTrack(5), | |
90 | fMulTrack(0), | |
91 | fDigitsList(0), | |
92 | fTracksList(0) | |
aee8290b | 93 | { |
94 | // | |
95 | // Copy constructor | |
96 | // | |
97 | recp.Copy(*this); | |
98 | } | |
99 | ||
e2afb3b6 | 100 | //_______________________________________________________________________ |
2a33668d | 101 | AliRecPoint::~AliRecPoint() |
102 | { | |
103 | // dtor | |
104 | ||
105 | delete fLocPosM ; | |
ef07487e | 106 | delete [] fDigitsList ; |
107 | delete [] fTracksList ; | |
2a33668d | 108 | |
109 | } | |
110 | ||
e2afb3b6 | 111 | //_______________________________________________________________________ |
2a33668d | 112 | void AliRecPoint::AddDigit(AliDigitNew & digit) |
113 | { | |
114 | // adds a digit to the digits list | |
115 | // and accumulates the total amplitude and the multiplicity | |
116 | ||
117 | ||
118 | if ( fMulDigit >= fMaxDigit ) { // increase the size of the list | |
6fea183e | 119 | int * tempo = new int[fMaxDigit*2]; |
2a33668d | 120 | |
121 | Int_t index ; | |
122 | ||
123 | for ( index = 0 ; index < fMulDigit ; index++ ) | |
124 | tempo[index] = fDigitsList[index] ; | |
125 | ||
a161fd32 | 126 | delete [] fDigitsList ; |
2a33668d | 127 | fDigitsList = tempo ; |
128 | } | |
129 | ||
65a2d2b0 | 130 | fDigitsList[fMulDigit] = digit.GetIndexInList() ; |
131 | fMulDigit++ ; | |
2a33668d | 132 | fAmp += digit.GetAmp() ; |
133 | } | |
134 | ||
e2afb3b6 | 135 | //_______________________________________________________________________ |
2a33668d | 136 | // void AliRecPoint::AddTrack(AliTrack & track) |
137 | // { | |
138 | // // adds a digit to the digits list | |
139 | // // and accumulates the total amplitude and the multiplicity | |
140 | ||
141 | ||
142 | // if ( fMulTrack >= fMaxTrack ) { // increase the size of the list | |
143 | // int * tempo = new int[fMaxTrack*=2] ; | |
144 | // Int_t index ; | |
145 | // for ( index = 0 ; index < fMulTrack ; index++ ) | |
146 | // tempo[index] = fTracksList[index] ; | |
147 | // delete fTracksList ; | |
148 | // fTracksList = tempo ; | |
149 | // } | |
150 | ||
151 | // fTracksList[fMulTrack++]= (int) &Track ; | |
152 | // } | |
153 | ||
e2afb3b6 | 154 | //_______________________________________________________________________ |
6c4904c2 | 155 | void AliRecPoint::Copy(TObject& recp) const |
aee8290b | 156 | { |
157 | // | |
158 | // Copy *this onto pts | |
159 | // | |
160 | // Copy all first | |
b166d013 | 161 | if((TObject*)this != &recp) { |
6c4904c2 | 162 | ((TObject*) this)->Copy(recp); |
163 | (dynamic_cast<AliRecPoint&>(recp)).fAmp = fAmp; | |
164 | (dynamic_cast<AliRecPoint&>(recp)).fGeom = fGeom; | |
165 | (dynamic_cast<AliRecPoint&>(recp)).fIndexInList = fIndexInList; | |
166 | (dynamic_cast<AliRecPoint&>(recp)).fLocPos = fLocPos; | |
e8d02863 | 167 | (dynamic_cast<AliRecPoint&>(recp)).fLocPosM = new TMatrixF(*fLocPosM); |
6c4904c2 | 168 | (dynamic_cast<AliRecPoint&>(recp)).fMaxDigit = fMaxDigit; |
169 | (dynamic_cast<AliRecPoint&>(recp)).fMulDigit = fMulDigit; | |
170 | (dynamic_cast<AliRecPoint&>(recp)).fMaxTrack = fMaxTrack; | |
171 | (dynamic_cast<AliRecPoint&>(recp)).fMulTrack = fMulTrack; | |
aee8290b | 172 | |
173 | // Duplicate pointed objects | |
6c4904c2 | 174 | (dynamic_cast<AliRecPoint&>(recp)).fDigitsList = new Int_t[fMulDigit]; |
175 | memcpy((dynamic_cast<AliRecPoint&>(recp)).fDigitsList,fDigitsList,fMulDigit*sizeof(Int_t)); | |
176 | (dynamic_cast<AliRecPoint&>(recp)).fTracksList = new Int_t[fMulTrack]; | |
177 | memcpy((dynamic_cast<AliRecPoint&>(recp)).fTracksList,fTracksList,fMulTrack*sizeof(Int_t)); | |
aee8290b | 178 | } |
179 | } | |
180 | ||
e2afb3b6 | 181 | //_______________________________________________________________________ |
e8d02863 | 182 | void AliRecPoint::GetCovarianceMatrix(TMatrixF & mat) const |
2a33668d | 183 | { |
184 | // returns the covariant matrix for the local position | |
185 | ||
186 | mat = *fLocPosM ; | |
187 | ||
188 | } | |
189 | ||
190 | //____________________________________________________________________________ | |
94de3818 | 191 | void AliRecPoint::GetLocalPosition(TVector3 & pos) const |
2a33668d | 192 | { |
193 | // returns the position of the cluster in the local reference system of the sub-detector | |
194 | ||
195 | pos = fLocPos; | |
196 | ||
197 | ||
198 | } | |
199 | ||
200 | //____________________________________________________________________________ | |
e8d02863 | 201 | void AliRecPoint::GetGlobalPosition(TVector3 & gpos, TMatrixF & gmat) const |
2a33668d | 202 | { |
203 | // returns the position of the cluster in the global reference system of ALICE | |
204 | // and the uncertainty on this position | |
205 | ||
206 | ||
207 | fGeom->GetGlobal(this, gpos, gmat) ; | |
208 | ||
209 | } | |
210 | ||
65a2d2b0 | 211 |