]>
Commit | Line | Data |
---|---|---|
a6c02c85 | 1 | // @(#) $Id$ |
4aa41877 | 2 | // Original: AliHLTConfMapPoint.cxx,v 1.10 2005/06/23 17:46:55 hristov |
a6c02c85 | 3 | |
2a083ac4 | 4 | /************************************************************************** |
9be2600f | 5 | * This file is property of and copyright by the ALICE HLT Project * |
6 | * ALICE Experiment at CERN, All rights reserved. * | |
2a083ac4 | 7 | * * |
9be2600f | 8 | * Primary Authors: Anders Vestbo, maintained by * |
9 | * Matthias Richter <Matthias.Richter@ift.uib.no> * | |
10 | * for The ALICE HLT Project. * | |
2a083ac4 | 11 | * * |
12 | * Permission to use, copy, modify and distribute this software and its * | |
13 | * documentation strictly for non-commercial purposes is hereby granted * | |
14 | * without fee, provided that the above copyright notice appears in all * | |
15 | * copies and that both the copyright notice and this permission notice * | |
16 | * appear in the supporting documentation. The authors make no claims * | |
17 | * about the suitability of this software for any purpose. It is * | |
18 | * provided "as is" without express or implied warranty. * | |
19 | **************************************************************************/ | |
20 | ||
21 | /** @file AliHLTTPCConfMapPoint.cxx | |
22 | @author Anders Vestbo, maintained by Matthias Richter | |
23 | @date | |
24 | @brief Hit class for conformal mapper | |
25 | */ | |
a6c02c85 | 26 | |
a6c02c85 | 27 | #include "AliHLTTPCLogging.h" |
28 | #include "AliHLTTPCConfMapPoint.h" | |
29 | #include "AliHLTTPCSpacePointData.h" | |
30 | #include "AliHLTTPCVertex.h" | |
31 | #include "AliHLTTPCConfMapTrack.h" | |
32 | ||
33 | /** | |
34 | <pre> | |
35 | //_____________________________________________________________ | |
36 | // AliHLTTPCConfMapPoint | |
37 | // | |
38 | // Hit class for conformal mapper | |
86268ca8 | 39 | </pre> |
a6c02c85 | 40 | */ |
41 | ||
86268ca8 | 42 | /** ROOT macro for the implementation of ROOT specific class methods */ |
43 | ClassImp(AliHLTTPCConfMapPoint); | |
a6c02c85 | 44 | |
45 | Bool_t AliHLTTPCConfMapPoint::fgDontMap=kFALSE; | |
46 | ||
47 | AliHLTTPCConfMapPoint::AliHLTTPCConfMapPoint() | |
48 | { | |
49 | //Constructor | |
50 | ||
51 | SetUsage(false); | |
52 | SetHitNumber(-1); | |
53 | SetX(0); | |
54 | SetY(0); | |
55 | SetZ(0); | |
56 | SetXerr(0); | |
57 | SetYerr(0); | |
58 | SetZerr(0); | |
59 | ||
60 | SetPhi(0.); | |
61 | SetEta(0.); | |
62 | ||
63 | SetXprime(0.); | |
64 | SetYprime(0.); | |
65 | SetXprimeerr(0.); | |
66 | SetYprimeerr(0.); | |
67 | SetIntPoint(0., 0., 0., 0., 0., 0.); | |
68 | SetShiftedCoord(); | |
69 | SetMCTrackID(0,0,0); | |
70 | } | |
71 | ||
2a083ac4 | 72 | AliHLTTPCConfMapPoint::AliHLTTPCConfMapPoint(const AliHLTTPCConfMapPoint&) |
73 | { | |
74 | // dummy copy constructor | |
75 | //HLTFatal("copy constructor untested"); | |
76 | } | |
77 | ||
78 | AliHLTTPCConfMapPoint& AliHLTTPCConfMapPoint::operator=(const AliHLTTPCConfMapPoint&) | |
79 | { | |
80 | // dummy assignment operator | |
81 | //HLTFatal("assignment operator untested"); | |
82 | return *this; | |
83 | } | |
84 | ||
a6c02c85 | 85 | AliHLTTPCConfMapPoint::~AliHLTTPCConfMapPoint() |
86 | { | |
87 | // Destructor. | |
a6c02c85 | 88 | } |
89 | ||
90 | Bool_t AliHLTTPCConfMapPoint::ReadHits(AliHLTTPCSpacePointData* hits ) | |
91 | { | |
92 | //read the hits | |
93 | SetHitNumber(hits->fID); | |
94 | SetPadRow(hits->fPadRow); | |
95 | Int_t slice = (hits->fID>>25) & 0x7f; | |
96 | SetSector(slice); | |
97 | SetX(hits->fX); | |
98 | SetY(hits->fY); | |
99 | SetZ(hits->fZ); | |
100 | SetXerr(sqrt(hits->fSigmaY2)); | |
101 | SetYerr(sqrt(hits->fSigmaY2)); | |
102 | SetZerr(sqrt(hits->fSigmaZ2)); | |
103 | return kTRUE; | |
104 | } | |
105 | ||
106 | void AliHLTTPCConfMapPoint::Reset() | |
107 | { | |
108 | //Reset this point. | |
109 | SetUsage(kFALSE); | |
110 | SetS(0); | |
111 | fNextRowHit = 0; | |
112 | fNextVolumeHit=0; | |
113 | fNextTrackHit=0; | |
114 | } | |
115 | ||
116 | void AliHLTTPCConfMapPoint::Setup(AliHLTTPCVertex *vertex) | |
117 | { | |
118 | //Setup. Sets the vertex, conformal coordinates, | |
119 | //and phi and eta of each hit. | |
120 | ||
121 | SetIntPoint(vertex->GetX(), vertex->GetY(), vertex->GetZ(), | |
122 | vertex->GetXErr(), vertex->GetYErr(), vertex->GetZErr()); | |
123 | SetShiftedCoord(); | |
124 | SetConfCoord(); | |
125 | // The angles are set properly if they are set after | |
126 | // the interaction point and the shifted coordinates | |
127 | SetAngles(); | |
128 | //SetDist(0., 0.); | |
129 | return; | |
130 | } | |
131 | ||
132 | void AliHLTTPCConfMapPoint::SetIntPoint(Double_t inx, Double_t iny, Double_t inz, | |
133 | Double_t inxerr, Double_t inyerr, Double_t inzerr) | |
134 | { | |
135 | // Defines a new interaction point. This point is needed to calculate | |
136 | // the conformal coordinates. | |
137 | ||
138 | SetXt(inx); | |
139 | SetYt(iny); | |
140 | SetZt(inz); | |
141 | SetXterr(inxerr); | |
142 | SetYterr(inyerr); | |
143 | SetZterr(inzerr); | |
144 | ||
145 | return; | |
146 | } | |
147 | ||
148 | void AliHLTTPCConfMapPoint::SetAllCoord(const AliHLTTPCConfMapPoint *precedinghit) | |
149 | { | |
150 | // Sets the interaction point, the shifted coordinates, and the conformal mapping coordinates. | |
151 | // These values are calculated from the interaction point of the given cluster which should be a | |
152 | // already found cluster on the same track. | |
153 | ||
154 | if (this == precedinghit) { | |
155 | SetIntPoint(precedinghit->GetX(), precedinghit->GetY(), precedinghit->GetZ(), | |
156 | precedinghit->GetXerr(), precedinghit->GetYerr(), precedinghit->GetZerr()); | |
157 | } | |
158 | ||
159 | else { | |
160 | SetIntPoint(precedinghit->GetXt(), precedinghit->GetYt(), precedinghit->GetZt(), | |
161 | precedinghit->GetXterr(), precedinghit->GetYterr(), precedinghit->GetZterr()); | |
162 | } | |
163 | ||
164 | SetShiftedCoord(); | |
165 | SetConfCoord(); | |
166 | ||
167 | return; | |
168 | } | |
169 | ||
170 | void AliHLTTPCConfMapPoint::SetShiftedCoord() | |
171 | { | |
172 | // Sets the coordinates with resepct to the given vertex point | |
173 | ||
174 | SetXv(GetX() - fXt); | |
175 | SetYv(GetY() - fYt); | |
176 | SetZv(GetZ() - fZt); | |
177 | /* | |
178 | SetXverr(TMath::Sqrt(GetXerr()*GetXerr() + fXterr*fXterr)); | |
179 | SetYverr(TMath::Sqrt(GetYerr()*GetYerr() + fYterr*fYterr)); | |
180 | SetZverr(TMath::Sqrt(GetZerr()*GetZerr() + fZterr*fZterr)); | |
181 | */ | |
182 | return; | |
183 | } | |
184 | ||
185 | void AliHLTTPCConfMapPoint::SetConfCoord() | |
186 | { | |
187 | // Calculates the conformal coordinates of one cluster. | |
188 | // If the option "vertex_constraint" applies the interaction point is | |
189 | // assumed to be at (0, 0, 0). Otherwise the function will use the | |
190 | // interaction point specified by fXt and fYt. | |
191 | ||
192 | if(fgDontMap){ | |
193 | fXprime = fx; | |
194 | fYprime = fy; | |
195 | fWxy = 0; | |
196 | fs = 0; //track trajectory | |
197 | fWz = 0; | |
198 | return; | |
199 | } | |
200 | ||
201 | Double_t r2; | |
202 | Double_t xyErrorScale = 1; | |
203 | Double_t szErrorScale = 1; | |
204 | ||
205 | if ((r2 = fXv*fXv + fYv*fYv)) | |
206 | { | |
207 | fXprime = fXv / r2; | |
208 | fYprime = -fYv / r2; | |
209 | ||
210 | //set weights: | |
211 | fWxy = r2*r2 / ((xyErrorScale*xyErrorScale)*((fxerr*fxerr)+(fyerr*fyerr))); | |
212 | fs = 0; //track trajectory | |
213 | fWz = (Double_t)(1./(szErrorScale*fzerr*fzerr)); | |
214 | } else { | |
215 | fXprime = 0.; | |
216 | fYprime = 0.; | |
217 | fXprimeerr = 0.; | |
218 | fYprimeerr = 0.; | |
219 | fWxy = 0; | |
220 | fWz = 0; | |
221 | fs = 0; | |
222 | } | |
223 | ||
224 | return; | |
225 | } | |
226 | ||
227 | void AliHLTTPCConfMapPoint::SetAngles() | |
228 | { | |
229 | // Calculates the angle phi and the pseudorapidity eta for each cluster. | |
230 | /* | |
231 | Double_t r = TMath::Sqrt(x*x + y*y); | |
232 | ||
233 | fPhi = TMath::ATan2(y,x); | |
234 | if(fPhi<0) fPhi = fPhi + 2*TMath::Pi(); | |
235 | fEta = 3.*z/(TMath::Abs(z)+2.*r); | |
236 | return; | |
237 | */ | |
238 | // Double_t r3dim = TMath::Sqrt(fXv*fXv + fYv*fYv + fZv*fZv); | |
239 | Double_t r3dim = sqrt(fXv*fXv + fYv*fYv + fZv*fZv); | |
240 | //Double_t r2dim = TMath::Sqrt(fXv*fXv + fYv*fYv); | |
241 | ||
242 | /*if (r2dim == 0.) { | |
243 | // If r2dim == 0 the pseudorapidity eta cannot be calculated (division by zero)! | |
244 | // This can only happen if the point is lying on the z-axis and this should never be possible. | |
245 | cerr << "The pseudorapidity eta cannot be calculated (division by zero)! Set to 1.e-10." << endl; | |
246 | r2dim = 1.e-10; | |
247 | } | |
248 | ||
249 | if (fXv == 0.) { | |
250 | fPhi = (fYv > 0.) ? TMath::Pi() / 2. : - TMath::Pi() / 2.; | |
251 | } | |
252 | ||
253 | else { | |
254 | fPhi = (fXv > 0.) ? TMath::ASin(fYv/r2dim) : TMath::Pi() - TMath::ASin(fYv/r2dim); | |
255 | } | |
256 | ||
257 | if (fPhi < 0.) { | |
258 | fPhi += 2. * TMath::Pi(); | |
259 | } | |
260 | */ | |
261 | //fPhi = TMath::ATan2(y,x); | |
262 | fPhi = atan2(fy,fx); | |
263 | //if(fPhi<0) fPhi = fPhi + 2*TMath::Pi(); | |
264 | ||
265 | //fEta = 0.5 * TMath::Log((r3dim + fZv)/(r3dim - fZv)); | |
266 | fEta = 0.5 * log((r3dim + fZv)/(r3dim - fZv)); | |
267 | return; | |
268 | } | |
269 | ||
270 | /* | |
271 | AliHLTTPCConfMapTrack *AliHLTTPCConfMapPoint::GetTrack(TClonesArray *tracks) const | |
272 | { | |
273 | // Returns the pointer to the track to which this hit belongs. | |
274 | ||
275 | return (AliHLTTPCConfMapTrack*)tracks->At(this->GetTrackNumber()); | |
276 | } | |
277 | */ |