]>
Commit | Line | Data |
---|---|---|
3e87ef69 | 1 | // @(#) $Id$ |
735e167e | 2 | |
3 | // Author: Anders Vestbo <mailto:vestbo$fi.uib.no> | |
3e87ef69 | 4 | //*-- Copyright © ALICE HLT Group |
735e167e | 5 | |
4994a25d | 6 | #include "AliL3StandardIncludes.h" |
735e167e | 7 | |
4994a25d | 8 | #include "AliL3Logging.h" |
735e167e | 9 | #include "AliL3ModelTrack.h" |
95a00d93 | 10 | #include "AliL3Transform.h" |
3e87ef69 | 11 | #include "AliL3DataCompressor.h" |
6f388e0d | 12 | #include "AliL3Vertex.h" |
735e167e | 13 | |
4994a25d | 14 | #if GCCVERSION == 3 |
15 | using namespace std; | |
16 | #endif | |
17 | ||
4a838220 | 18 | //_____________________________________________________________ |
19 | // AliL3ModelTrack | |
20 | // | |
21 | // | |
22 | ||
735e167e | 23 | ClassImp(AliL3ModelTrack) |
24 | ||
3e87ef69 | 25 | AliL3ModelTrack::AliL3ModelTrack() |
735e167e | 26 | { |
27 | fNClusters = 0; | |
28 | fClusters = 0; | |
029912b7 | 29 | fOverlap = 0; |
735e167e | 30 | fPad=0; |
31 | fTime=0; | |
3e87ef69 | 32 | fNoverlaps=0; |
735e167e | 33 | fClusterCharge=0; |
95a00d93 | 34 | fTrackModel=0; |
3e87ef69 | 35 | fCrossingAngle=0; |
36 | fParSigmaY2=0; | |
37 | fParSigmaZ2=0; | |
735e167e | 38 | } |
39 | ||
40 | ||
41 | AliL3ModelTrack::~AliL3ModelTrack() | |
42 | { | |
43 | if(fClusters) | |
44 | delete [] fClusters; | |
45 | if(fPad) | |
46 | delete [] fPad; | |
47 | if(fTime) | |
48 | delete [] fTime; | |
3e87ef69 | 49 | if(fCrossingAngle) |
50 | delete [] fCrossingAngle; | |
51 | if(fParSigmaY2) | |
52 | delete [] fParSigmaY2; | |
53 | if(fParSigmaZ2) | |
54 | delete [] fParSigmaZ2; | |
95a00d93 | 55 | if(fTrackModel) |
56 | delete fTrackModel; | |
3e87ef69 | 57 | if(fNoverlaps) |
58 | delete [] fNoverlaps; | |
59 | if(fOverlap) | |
60 | { | |
61 | for(Int_t i=0; i<AliL3Transform::GetNRows(fPatch); i++) | |
62 | delete [] fOverlap[i]; | |
63 | delete [] fOverlap; | |
64 | } | |
735e167e | 65 | } |
66 | ||
67 | void AliL3ModelTrack::Init(Int_t slice,Int_t patch) | |
68 | { | |
3e87ef69 | 69 | fNClusters=AliL3Transform::GetNRows(patch);//is not incremented in setcluster anymore |
70 | //fSlice=slice; | |
029912b7 | 71 | fPatch=patch; |
4a838220 | 72 | Int_t nrows = AliL3Transform::GetNRows(fPatch); |
95a00d93 | 73 | fClusters = new AliL3ClusterModel[nrows]; |
029912b7 | 74 | fPad = new Float_t[nrows]; |
75 | fTime = new Float_t[nrows]; | |
3e87ef69 | 76 | fCrossingAngle = new Float_t[nrows]; |
77 | fParSigmaY2 = new Float_t[nrows]; | |
78 | fParSigmaZ2 = new Float_t[nrows]; | |
95a00d93 | 79 | fTrackModel = new AliL3TrackModel; |
3e87ef69 | 80 | |
81 | fOverlap = new Int_t*[nrows]; | |
82 | fNoverlaps = new Int_t[nrows]; | |
83 | fMaxOverlaps = 5; | |
84 | ||
85 | memset(fNoverlaps,0,nrows*sizeof(Int_t)); | |
029912b7 | 86 | memset(fClusters,0,nrows*sizeof(AliL3ClusterModel)); |
87 | memset(fPad,0,nrows*sizeof(Float_t)); | |
88 | memset(fTime,0,nrows*sizeof(Float_t)); | |
3e87ef69 | 89 | memset(fCrossingAngle,0,nrows*sizeof(Float_t)); |
90 | memset(fParSigmaY2,0,nrows*sizeof(Float_t)); | |
91 | memset(fParSigmaZ2,0,nrows*sizeof(Float_t)); | |
029912b7 | 92 | memset(fTrackModel,0,sizeof(AliL3TrackModel)); |
93 | for(Int_t i=0; i<nrows; i++) | |
3e87ef69 | 94 | { |
95 | fOverlap[i] = new Int_t[fMaxOverlaps]; | |
96 | for(Int_t j=0; j<fMaxOverlaps; j++) | |
97 | fOverlap[i][j]=-1; | |
98 | fClusters[i].fSlice = -1; | |
99 | } | |
2357bb38 | 100 | |
735e167e | 101 | } |
102 | ||
3e87ef69 | 103 | void AliL3ModelTrack::CalculateClusterWidths(Int_t row,Bool_t parametrize) |
735e167e | 104 | { |
3e87ef69 | 105 | //Cluster widths |
029912b7 | 106 | |
3e87ef69 | 107 | Float_t xyz[3]; |
108 | Int_t sr,lr; | |
109 | Int_t index = row - AliL3Transform::GetFirstRow(fPatch); | |
4a838220 | 110 | if(index < 0 || index > AliL3Transform::GetNRows(fPatch)) |
029912b7 | 111 | { |
3e87ef69 | 112 | cerr<<"AliL3ModelTrack::CalculcateClusterWidths : Wrond index "<<index<<" row "<<row<<endl; |
029912b7 | 113 | return; |
114 | } | |
3e87ef69 | 115 | Int_t patch = AliL3Transform::GetPatch(row); |
116 | AliL3Transform::Slice2Sector(0,row,sr,lr); | |
117 | AliL3Transform::Raw2Local(xyz,sr,lr,GetPadHit(row),GetTimeHit(row)); | |
118 | fParSigmaY2[index] = AliL3Transform::GetParSigmaY2(row,xyz[2],GetCrossingAngleLUT(row)); | |
119 | fParSigmaZ2[index] = AliL3Transform::GetParSigmaZ2(row,xyz[2],GetTgl()); | |
120 | ||
121 | if(parametrize) | |
122 | { | |
123 | fParSigmaY2[index] = (fParSigmaY2[index] + (1./12)*pow(AliL3Transform::GetPadPitchWidth(patch),2) ); | |
124 | fParSigmaY2[index] *= 0.108; | |
125 | if(patch<2) | |
126 | fParSigmaY2[index] *= 2.07; | |
127 | ||
128 | fParSigmaZ2[index] = (fParSigmaZ2[index] + (1./12)*pow(AliL3Transform::GetZWidth(),2) ); | |
129 | fParSigmaZ2[index] *= 0.169; | |
130 | if(patch<2) | |
131 | fParSigmaZ2[index] *= 1.77; | |
132 | } | |
133 | ||
134 | //convert to raw coordinates: | |
135 | fParSigmaY2[index] /= pow(AliL3Transform::GetPadPitchWidth(patch),2); | |
136 | fParSigmaZ2[index] /= pow(AliL3Transform::GetZWidth(),2); | |
137 | } | |
138 | ||
139 | void AliL3ModelTrack::SetCluster(Int_t row,Float_t fpad,Float_t ftime,Float_t charge, | |
140 | Float_t sigmaY2,Float_t sigmaZ2,Int_t npads) | |
141 | { | |
029912b7 | 142 | AliL3ClusterModel *cl = GetClusterModel(row); |
2357bb38 | 143 | |
3e87ef69 | 144 | //First bit: Cluster is present or not |
145 | //Second bit: Cluster was set, meaning an fit attempt was done (if true) | |
146 | ||
147 | cl->fPresent |= 0x2; //set second bit to true, because a fit attempt has been made | |
148 | ||
2357bb38 | 149 | if(!charge || npads == 1) |
3e87ef69 | 150 | { |
151 | cl->fPresent &= ~0x1; //set first bit to false | |
152 | } | |
735e167e | 153 | else |
154 | { | |
3e87ef69 | 155 | cl->fPresent|=0x1;//set first bit to true |
6f388e0d | 156 | cl->fDPad = QuantizePad(row,fpad); |
157 | cl->fDTime = QuantizeTime(row,ftime); | |
158 | cl->fDCharge = charge; | |
3e87ef69 | 159 | if(sigmaY2==0 && sigmaZ2==0) |
160 | { | |
161 | cl->fDSigmaY2=0;//if width is zero, shape is not supposed to be written | |
162 | cl->fDSigmaZ2=0; | |
163 | } | |
164 | else | |
165 | { | |
6f388e0d | 166 | cl->fDSigmaY2 = QuantizeSigmaY2(row,sigmaY2); |
167 | cl->fDSigmaZ2 = QuantizeSigmaZ2(row,sigmaZ2); | |
3e87ef69 | 168 | } |
4a838220 | 169 | cl->fNPads = npads; |
735e167e | 170 | } |
3e87ef69 | 171 | } |
172 | ||
6f388e0d | 173 | |
3e87ef69 | 174 | void AliL3ModelTrack::Set(AliL3Track *tpt) |
175 | { | |
176 | AliL3ModelTrack *tr = (AliL3ModelTrack*)tpt; | |
177 | SetRowRange(tr->GetFirstRow(),tr->GetLastRow()); | |
178 | SetPhi0(tr->GetPhi0()); | |
179 | SetKappa(tr->GetKappa()); | |
180 | SetFirstPoint(tr->GetFirstPointX(),tr->GetFirstPointY(),tr->GetFirstPointZ()); | |
181 | SetLastPoint(tr->GetLastPointX(),tr->GetLastPointY(),tr->GetLastPointZ()); | |
182 | SetPt(tr->GetPt()); | |
183 | SetPsi(tr->GetPsi()); | |
184 | SetTgl(tr->GetTgl()); | |
185 | SetCharge(tr->GetCharge()); | |
186 | ||
187 | if(fClusters) | |
188 | { | |
189 | cerr<<"AliL3ModelTrack::Set : Init has already been called for this object!"<<endl; | |
190 | return; | |
191 | } | |
192 | ||
193 | //Init(tr->fSlice,tr->fPatch); | |
194 | Init(0,tr->fPatch); | |
195 | memcpy(fClusters,tr->fClusters,AliL3Transform::GetNRows(fPatch)*sizeof(AliL3ClusterModel)); | |
196 | memcpy(fPad,tr->fPad,AliL3Transform::GetNRows(fPatch)*sizeof(Float_t)); | |
197 | memcpy(fTime,tr->fTime,AliL3Transform::GetNRows(fPatch)*sizeof(Float_t)); | |
198 | memcpy(fParSigmaY2,tr->fParSigmaY2,AliL3Transform::GetNRows(fPatch)*sizeof(Float_t)); | |
199 | memcpy(fParSigmaZ2,tr->fParSigmaZ2,AliL3Transform::GetNRows(fPatch)*sizeof(Float_t)); | |
200 | memcpy(fCrossingAngle,tr->fCrossingAngle,AliL3Transform::GetNRows(fPatch)*sizeof(Float_t)); | |
201 | memcpy(fTrackModel,tr->fTrackModel,sizeof(AliL3TrackModel)); | |
202 | ||
735e167e | 203 | } |
204 | ||
2357bb38 | 205 | Int_t AliL3ModelTrack::GetNPresentClusters() |
4a838220 | 206 | { |
2357bb38 | 207 | //Return the number of assigned clusters to the track. |
208 | //Differs from fNClusters, which should be equal to the | |
209 | //number of padrows in the present patch. | |
210 | ||
4a838220 | 211 | Int_t count=0; |
212 | ||
213 | for(Int_t i=AliL3Transform::GetFirstRow(fPatch); i<=AliL3Transform::GetLastRow(fPatch); i++) | |
3e87ef69 | 214 | if(IsPresent(i)) |
215 | count++; | |
216 | ||
4a838220 | 217 | return count; |
218 | } | |
95a00d93 | 219 | |
95a00d93 | 220 | void AliL3ModelTrack::FillModel() |
221 | { | |
029912b7 | 222 | //Fill the track structure |
223 | ||
3e87ef69 | 224 | if(fNClusters != AliL3Transform::GetNRows(fPatch)) |
225 | { | |
226 | cout<<"AliL3ModelTrack::FillModel : fNClusters != nrows; beware, this could be caused by a bug!!!"<<endl; | |
227 | fNClusters = AliL3Transform::GetNRows(fPatch); | |
228 | } | |
229 | ||
029912b7 | 230 | if(!fTrackModel) |
231 | { | |
232 | cerr<<"AliL3ModelTrack::FillModel() : No trackmodel "<<endl; | |
233 | return; | |
234 | } | |
6f388e0d | 235 | Double_t impact[3]; |
236 | AliL3Vertex vertex; | |
237 | CalculateHelix(); | |
238 | GetClosestPoint(&vertex,impact[0],impact[1],impact[2]); | |
95a00d93 | 239 | fTrackModel->fKappa = GetKappa(); |
6f388e0d | 240 | fTrackModel->fPhi = atan2(impact[1],impact[0]); |
241 | fTrackModel->fD = sqrt(impact[0]*impact[0] + impact[1]*impact[1]); | |
242 | fTrackModel->fZ0 = impact[2]; | |
95a00d93 | 243 | fTrackModel->fTgl = GetTgl(); |
6f388e0d | 244 | |
245 | //We have to check on which of the vertex the track fit is lying | |
246 | //This we need to encode the azimuthal angle coordinate of the center of curvature. | |
247 | if(GetRadius() < sqrt(GetCenterX()*GetCenterX()+GetCenterY()*GetCenterY())) | |
248 | fTrackModel->fD *=-1; | |
249 | ||
95a00d93 | 250 | } |
251 | ||
029912b7 | 252 | void AliL3ModelTrack::FillTrack() |
95a00d93 | 253 | { |
029912b7 | 254 | //Fill the track parameters from the structure. |
255 | ||
256 | if(!fTrackModel) | |
257 | { | |
258 | cerr<<"AliL3ModelTrack::FillTrack() : No data!!"<<endl; | |
259 | return; | |
260 | } | |
261 | SetKappa(fTrackModel->fKappa); | |
6f388e0d | 262 | Double_t impact[3],psi; |
263 | Float_t trackPhi0 = fTrackModel->fPhi; | |
264 | if(fTrackModel->fD < 0) | |
265 | trackPhi0 += AliL3Transform::Pi(); | |
266 | Int_t charge = -1*(Int_t)copysign(1.,GetKappa()); | |
267 | impact[0] = fabs(fTrackModel->fD)*cos(fTrackModel->fPhi); | |
268 | impact[1] = fabs(fTrackModel->fD)*sin(fTrackModel->fPhi); | |
269 | impact[2] = fTrackModel->fZ0; | |
270 | ||
271 | psi = trackPhi0 - charge*0.5*AliL3Transform::Pi(); | |
272 | if(psi < 0) | |
273 | psi += 2*AliL3Transform::Pi(); | |
274 | ||
275 | SetCharge(charge); | |
276 | SetFirstPoint(impact[0],impact[1],impact[2]); | |
277 | SetPsi(psi); | |
029912b7 | 278 | SetTgl(fTrackModel->fTgl); |
3e87ef69 | 279 | SetPt((AliL3Transform::GetBFact()*AliL3Transform::GetBField())/fabs(GetKappa())); |
6f388e0d | 280 | fNClusters = AliL3Transform::GetNRows(fPatch); |
029912b7 | 281 | CalculateHelix(); |
6f388e0d | 282 | |
4a838220 | 283 | for(Int_t i=AliL3Transform::GetFirstRow(fPatch); i<=AliL3Transform::GetLastRow(fPatch); i++) |
029912b7 | 284 | { |
285 | AliL3ClusterModel *cl = GetClusterModel(i); | |
286 | if(!cl) continue; | |
3e87ef69 | 287 | |
288 | if(cl->fSlice == -1) | |
289 | { | |
290 | SetPadHit(i,-1); | |
291 | SetTimeHit(i,-1); | |
292 | continue; | |
293 | } | |
294 | if(cl->fSlice < 0 || cl->fSlice > 35) | |
295 | { | |
296 | cerr<<"AliL3ModelTrack::FillTrack : Slice out of range "<<cl->fSlice<<" on row "<<i<<endl; | |
297 | exit(5); | |
298 | } | |
299 | ||
300 | Float_t angle = 0; | |
301 | ||
302 | AliL3Transform::Local2GlobalAngle(&angle,cl->fSlice); | |
303 | if(!CalculateReferencePoint(angle,AliL3Transform::Row2X(i))) | |
304 | { | |
305 | if(IsPresent(i)) | |
306 | { | |
307 | cerr<<"AliL3ModelTrack::FillTrack : Track does not cross slice "<<cl->fSlice<<" row "<<i<<" Points " | |
308 | <<GetPointX()<<" "<<GetPointY()<<" "<<GetPointZ()<<endl; | |
309 | Print(); | |
310 | exit(5); | |
311 | } | |
312 | SetPadHit(i,-1); | |
313 | SetTimeHit(i,-1); | |
314 | continue; | |
315 | } | |
316 | Float_t hit[3] = {GetPointX(),GetPointY(),GetPointZ()}; | |
317 | Int_t sector,row; | |
318 | AliL3Transform::Slice2Sector(cl->fSlice,i,sector,row); | |
319 | AliL3Transform::Global2Raw(hit,sector,row); | |
320 | ||
029912b7 | 321 | SetPadHit(i,hit[1]); |
322 | SetTimeHit(i,hit[2]); | |
3e87ef69 | 323 | |
324 | Float_t crossingangle = GetCrossingAngle(i,cl->fSlice); | |
325 | ||
326 | SetCrossingAngleLUT(i,crossingangle); | |
327 | CalculateClusterWidths(i,kTRUE); | |
328 | ||
029912b7 | 329 | } |
330 | } | |
95a00d93 | 331 | |
6f388e0d | 332 | Float_t AliL3ModelTrack::QuantizePad(Int_t row,Float_t pad) |
333 | { | |
334 | Float_t diff = pad - GetPadHit(row); | |
335 | Float_t step = AliL3DataCompressor::GetPadResidualStep(row); | |
336 | return diff/step; | |
337 | } | |
338 | ||
339 | Float_t AliL3ModelTrack::RetrievePad(Int_t row,Float_t dpad) | |
340 | { | |
341 | Float_t step = AliL3DataCompressor::GetPadResidualStep(row); | |
342 | return dpad*step + GetPadHit(row); | |
343 | } | |
344 | ||
345 | Float_t AliL3ModelTrack::QuantizeTime(Int_t row,Float_t time) | |
346 | { | |
347 | Float_t diff = time - GetTimeHit(row); | |
348 | Float_t step = AliL3DataCompressor::GetTimeResidualStep(row); | |
349 | return diff/step; | |
350 | } | |
351 | ||
352 | Float_t AliL3ModelTrack::RetrieveTime(Int_t row,Float_t dtime) | |
353 | { | |
354 | Float_t step = AliL3DataCompressor::GetTimeResidualStep(row); | |
355 | return dtime*step + GetTimeHit(row); | |
356 | } | |
357 | ||
358 | Float_t AliL3ModelTrack::QuantizeSigmaY2(Int_t row,Float_t sigmaY2) | |
359 | { | |
360 | Float_t diff = sigmaY2 - GetParSigmaY2(row); | |
361 | Float_t step = AliL3DataCompressor::GetPadSigma2Step(AliL3Transform::GetPatch(row)); | |
362 | return diff/step; | |
363 | } | |
364 | ||
365 | Float_t AliL3ModelTrack::RetrieveSigmaY2(Int_t row,Float_t dsigmaY2) | |
366 | { | |
367 | Float_t step = AliL3DataCompressor::GetPadSigma2Step(AliL3Transform::GetPatch(row)); | |
368 | return dsigmaY2*step + GetParSigmaY2(row); | |
369 | } | |
370 | ||
371 | Float_t AliL3ModelTrack::QuantizeSigmaZ2(Int_t row,Float_t sigmaZ2) | |
372 | { | |
373 | Float_t diff = sigmaZ2 - GetParSigmaZ2(row); | |
374 | Float_t step = AliL3DataCompressor::GetTimeSigma2Step(); | |
375 | return diff/step; | |
376 | } | |
377 | ||
378 | Float_t AliL3ModelTrack::RetrieveSigmaZ2(Int_t row,Float_t dsigmaZ2) | |
379 | { | |
380 | Float_t step = AliL3DataCompressor::GetTimeSigma2Step(); | |
381 | return dsigmaZ2*step + GetParSigmaZ2(row); | |
382 | } | |
383 | ||
029912b7 | 384 | void AliL3ModelTrack::SetPadHit(Int_t row,Float_t pad) |
385 | { | |
4a838220 | 386 | Int_t index = row-AliL3Transform::GetFirstRow(fPatch); |
387 | if(index < 0 || index > AliL3Transform::GetNRows(fPatch)) | |
95a00d93 | 388 | { |
029912b7 | 389 | cerr<<"AliL3ModelTrack::SetPadHit() : Wrong index: "<<index<<endl; |
390 | return; | |
95a00d93 | 391 | } |
029912b7 | 392 | fPad[index]=pad; |
029912b7 | 393 | } |
394 | ||
395 | void AliL3ModelTrack::SetTimeHit(Int_t row,Float_t time) | |
396 | { | |
4a838220 | 397 | Int_t index = row-AliL3Transform::GetFirstRow(fPatch); |
398 | if(index < 0 || index > AliL3Transform::GetNRows(fPatch)) | |
029912b7 | 399 | { |
400 | cerr<<"AliL3ModelTrack::SetTimeHit() : Wrong index: "<<index<<endl; | |
401 | return; | |
402 | } | |
403 | fTime[index]=time; | |
404 | } | |
405 | ||
3e87ef69 | 406 | void AliL3ModelTrack::SetCrossingAngleLUT(Int_t row,Float_t angle) |
407 | { | |
408 | Int_t index = row-AliL3Transform::GetFirstRow(fPatch); | |
409 | if(index < 0 || index > AliL3Transform::GetNRows(fPatch)) | |
410 | { | |
411 | cerr<<"AliL3ModelTrack::SetCrossingAngle() : Wrong index: "<<index<<endl; | |
412 | return; | |
413 | } | |
414 | fCrossingAngle[index]=angle; | |
415 | } | |
416 | ||
029912b7 | 417 | void AliL3ModelTrack::SetOverlap(Int_t row,Int_t id) |
418 | { | |
3e87ef69 | 419 | |
4a838220 | 420 | Int_t index = row-AliL3Transform::GetFirstRow(fPatch); |
421 | if(index < 0 || index > AliL3Transform::GetNRows(fPatch)) | |
029912b7 | 422 | { |
423 | cerr<<"AliL3ModelTrack::SetOverlap() : Wrong index: "<<index<<endl; | |
424 | return; | |
425 | } | |
3e87ef69 | 426 | if(fNoverlaps[index] >= fMaxOverlaps) return; |
427 | fOverlap[index][fNoverlaps[index]++] = id; | |
029912b7 | 428 | } |
429 | ||
f64c4364 | 430 | Bool_t AliL3ModelTrack::IsPresent(Int_t row) |
431 | { | |
432 | AliL3ClusterModel *cl = GetClusterModel(row); | |
3e87ef69 | 433 | return (Bool_t)(cl->fPresent & 0x1); |
434 | } | |
435 | ||
436 | Bool_t AliL3ModelTrack::IsSet(Int_t row) | |
437 | { | |
438 | AliL3ClusterModel *cl = GetClusterModel(row); | |
439 | return (Bool_t)(cl->fPresent & 0x2); | |
f64c4364 | 440 | } |
8487f697 | 441 | |
4a838220 | 442 | Int_t AliL3ModelTrack::GetNPads(Int_t row) |
443 | { | |
444 | AliL3ClusterModel *cl = GetClusterModel(row); | |
445 | return cl->fNPads; | |
446 | } | |
447 | ||
029912b7 | 448 | Bool_t AliL3ModelTrack::GetPad(Int_t row,Float_t &pad) |
449 | { | |
029912b7 | 450 | AliL3ClusterModel *cl = GetClusterModel(row); |
6f388e0d | 451 | pad = RetrievePad(row,cl->fDPad); |
3e87ef69 | 452 | return IsPresent(row); |
029912b7 | 453 | } |
454 | ||
455 | Bool_t AliL3ModelTrack::GetTime(Int_t row,Float_t &time) | |
456 | { | |
457 | AliL3ClusterModel *cl = GetClusterModel(row); | |
6f388e0d | 458 | time = RetrieveTime(row,cl->fDTime); |
3e87ef69 | 459 | return IsPresent(row); |
029912b7 | 460 | } |
461 | ||
462 | Bool_t AliL3ModelTrack::GetClusterCharge(Int_t row,Int_t &charge) | |
463 | { | |
464 | AliL3ClusterModel *cl = GetClusterModel(row); | |
3e87ef69 | 465 | charge = (Int_t)cl->fDCharge;// + AliL3DataCompressor::GetClusterCharge(); |
3e87ef69 | 466 | return IsPresent(row); |
029912b7 | 467 | } |
468 | ||
469 | Bool_t AliL3ModelTrack::GetXYWidth(Int_t row,Float_t &width) | |
470 | { | |
471 | AliL3ClusterModel *cl = GetClusterModel(row); | |
6f388e0d | 472 | width = RetrieveSigmaY2(row,cl->fDSigmaY2); |
3e87ef69 | 473 | return IsPresent(row); |
029912b7 | 474 | } |
475 | ||
476 | Bool_t AliL3ModelTrack::GetZWidth(Int_t row,Float_t &width) | |
477 | { | |
478 | AliL3ClusterModel *cl = GetClusterModel(row); | |
6f388e0d | 479 | RetrieveSigmaZ2(row,cl->fDSigmaZ2); |
3e87ef69 | 480 | return IsPresent(row); |
95a00d93 | 481 | } |
482 | ||
483 | Bool_t AliL3ModelTrack::GetPadResidual(Int_t row,Float_t &res) | |
484 | { | |
4a838220 | 485 | AliL3ClusterModel *cl = GetClusterModel(row); |
486 | res = cl->fDPad; | |
3e87ef69 | 487 | return IsPresent(row); |
95a00d93 | 488 | } |
489 | ||
490 | Bool_t AliL3ModelTrack::GetTimeResidual(Int_t row,Float_t &res) | |
491 | { | |
4a838220 | 492 | AliL3ClusterModel *cl = GetClusterModel(row); |
493 | res = cl->fDTime; | |
3e87ef69 | 494 | return IsPresent(row); |
4a838220 | 495 | } |
496 | ||
497 | Bool_t AliL3ModelTrack::GetXYWidthResidual(Int_t row,Float_t &res) | |
498 | { | |
499 | AliL3ClusterModel *cl = GetClusterModel(row); | |
500 | res = cl->fDSigmaY2; | |
3e87ef69 | 501 | return IsPresent(row); |
4a838220 | 502 | } |
503 | ||
504 | Bool_t AliL3ModelTrack::GetZWidthResidual(Int_t row,Float_t &res) | |
505 | { | |
506 | AliL3ClusterModel *cl = GetClusterModel(row); | |
507 | res = cl->fDSigmaZ2; | |
3e87ef69 | 508 | return IsPresent(row); |
509 | } | |
510 | ||
511 | Int_t AliL3ModelTrack::GetSlice(Int_t row) | |
512 | { | |
513 | AliL3ClusterModel *cl = GetClusterModel(row); | |
514 | return cl->fSlice; | |
95a00d93 | 515 | } |
516 | ||
029912b7 | 517 | Float_t AliL3ModelTrack::GetPadHit(Int_t row) |
518 | { | |
4a838220 | 519 | Int_t index = row-AliL3Transform::GetFirstRow(fPatch); |
520 | if(index < 0 || index > AliL3Transform::GetNRows(fPatch)) | |
029912b7 | 521 | { |
522 | cerr<<"AliL3ModelTrack::GetPadHit() : Wrong index: "<<index<<" row "<<row<<endl; | |
523 | return 0; | |
524 | } | |
525 | return fPad[index]; | |
526 | } | |
527 | ||
528 | Float_t AliL3ModelTrack::GetTimeHit(Int_t row) | |
529 | { | |
4a838220 | 530 | Int_t index = row-AliL3Transform::GetFirstRow(fPatch); |
531 | if(index < 0 || index > AliL3Transform::GetNRows(fPatch)) | |
029912b7 | 532 | { |
533 | cerr<<"AliL3ModelTrack::GetTimeHit() : Wrong index: "<<index<<" row "<<row<<endl; | |
534 | return 0; | |
535 | } | |
536 | return fTime[index]; | |
537 | } | |
538 | ||
3e87ef69 | 539 | Float_t AliL3ModelTrack::GetCrossingAngleLUT(Int_t row) |
029912b7 | 540 | { |
4a838220 | 541 | Int_t index = row-AliL3Transform::GetFirstRow(fPatch); |
3e87ef69 | 542 | if(index < 0 || index > AliL3Transform::GetNRows(fPatch)) |
543 | { | |
544 | cerr<<"AliL3ModelTrack::GetCrossingAngleLUT() : Wrong index: "<<index<<" row "<<row<<endl; | |
545 | return 0; | |
546 | } | |
547 | return fCrossingAngle[index]; | |
548 | } | |
549 | ||
550 | Float_t AliL3ModelTrack::GetParSigmaY2(Int_t row) | |
551 | { | |
552 | Int_t index = row-AliL3Transform::GetFirstRow(fPatch); | |
553 | if(index < 0 || index > AliL3Transform::GetNRows(fPatch)) | |
554 | { | |
555 | cerr<<"AliL3ModelTrack::GetParSigmaY2() : Wrong index: "<<index<<" row "<<row<<endl; | |
556 | return 0; | |
557 | } | |
558 | return fParSigmaY2[index]; | |
559 | } | |
560 | ||
561 | Float_t AliL3ModelTrack::GetParSigmaZ2(Int_t row) | |
562 | { | |
563 | Int_t index = row-AliL3Transform::GetFirstRow(fPatch); | |
564 | if(index < 0 || index > AliL3Transform::GetNRows(fPatch)) | |
565 | { | |
566 | cerr<<"AliL3ModelTrack::GetParSigmaZ2() : Wrong index: "<<index<<" row "<<row<<endl; | |
567 | return 0; | |
568 | } | |
569 | return fParSigmaZ2[index]; | |
570 | } | |
571 | ||
572 | Int_t AliL3ModelTrack::GetNOverlaps(Int_t row) | |
573 | { | |
574 | Int_t index = row - AliL3Transform::GetFirstRow(fPatch); | |
575 | if(index < 0 || index > AliL3Transform::GetNRows(fPatch)) | |
576 | { | |
577 | cerr<<"AliL3ModelTrack::GetOverlap() : Wrong index: "<<index<<endl; | |
578 | return 0; | |
579 | } | |
580 | return fNoverlaps[index]; | |
581 | } | |
582 | ||
583 | Int_t *AliL3ModelTrack::GetOverlaps(Int_t row) | |
584 | { | |
585 | Int_t index = row - AliL3Transform::GetFirstRow(fPatch); | |
4a838220 | 586 | if(index < 0 || index > AliL3Transform::GetNRows(fPatch)) |
029912b7 | 587 | { |
588 | cerr<<"AliL3ModelTrack::GetOverlap() : Wrong index: "<<index<<endl; | |
589 | return 0; | |
590 | } | |
591 | return fOverlap[index]; | |
592 | } | |
593 | ||
594 | AliL3ClusterModel *AliL3ModelTrack::GetClusterModel(Int_t row) | |
595 | { | |
596 | if(!fClusters) return 0; | |
4a838220 | 597 | Int_t index = row-AliL3Transform::GetFirstRow(fPatch); |
598 | if(index < 0 || index > AliL3Transform::GetNRows(fPatch)) | |
029912b7 | 599 | { |
600 | cerr<<"AliL3ModelTrack::GetClusterModel() : Wrong index: "<<index<<endl; | |
601 | return 0; | |
602 | } | |
603 | return &fClusters[index]; | |
604 | } | |
605 | ||
3e87ef69 | 606 | void AliL3ModelTrack::Print(Bool_t everything) |
029912b7 | 607 | { |
608 | //Print info | |
609 | ||
029912b7 | 610 | cout<<"First point "<<GetFirstPointX()<<" "<<GetFirstPointY()<<" "<<GetFirstPointZ()<<endl; |
611 | cout<<"Last point "<<GetLastPointX()<<" "<<GetLastPointY()<<" "<<GetLastPointZ()<<endl; | |
612 | cout<<"Pt "<<GetPt()<<" kappa "<<GetKappa()<<" tgl "<<GetTgl()<<" psi "<<GetPsi()<<" charge "<<GetCharge()<<endl; | |
613 | cout<<"Center "<<GetCenterX()<<" "<<GetCenterY()<<endl<<endl; | |
3e87ef69 | 614 | if(!everything) |
615 | return; | |
029912b7 | 616 | cout<<"NHits "<<GetNClusters()<<endl; |
029912b7 | 617 | |
3e87ef69 | 618 | cout<<"Clusters:"<<endl; |
619 | Int_t origslice=-1,counter=0; | |
620 | Float_t fpad,ftime; | |
4a838220 | 621 | for(Int_t i=AliL3Transform::GetFirstRow(fPatch); i<=AliL3Transform::GetLastRow(fPatch); i++) |
029912b7 | 622 | { |
623 | AliL3ClusterModel *cl = GetClusterModel(i); | |
624 | ||
3e87ef69 | 625 | if(!IsPresent(i)) |
626 | cout<<i<<" Empty"<<" Slice "<<cl->fSlice<<" Padcrossing "<<GetPadHit(i)<<" Timecrossing "<<GetTimeHit(i)<<" "; | |
029912b7 | 627 | else |
628 | { | |
3e87ef69 | 629 | GetPad(i,fpad); |
630 | GetTime(i,ftime); | |
631 | if(counter==0) | |
632 | origslice=cl->fSlice; | |
633 | else if(cl->fSlice != origslice) | |
634 | cout<<"Change in slice "<<cl->fSlice<<" "<<origslice<<endl; | |
635 | cout<<i<<" Slice "<<cl->fSlice<<" Dpad "<<cl->fDPad<<" Dtime "<<cl->fDTime<<" Dcharge "<<cl->fDCharge; | |
636 | cout<<" sigmaY2 "<<GetParSigmaY2(i)<<" sigmaZ2 "<<GetParSigmaZ2(i); | |
637 | cout<<" Pad "<<fpad<<" padhit "<<GetPadHit(i)<<" Time "<<ftime<<" timehit "<<GetTimeHit(i)<<" "; | |
638 | cout<<"Number of pads "<<GetNPads(i)<<" Overlaps "<<GetNOverlaps(i); | |
639 | counter++; | |
029912b7 | 640 | } |
2357bb38 | 641 | cout<<endl; |
029912b7 | 642 | } |
643 | } | |
644 | ||
3e87ef69 | 645 | void AliL3ModelTrack::SetClusterLabel(Int_t row,Int_t *trackID) |
95a00d93 | 646 | { |
3e87ef69 | 647 | #ifdef do_mc |
648 | AliL3ClusterModel *cl = GetClusterModel(row); | |
649 | cl->fTrackID[0] = trackID[0]; | |
650 | cl->fTrackID[1] = trackID[1]; | |
651 | cl->fTrackID[2] = trackID[2]; | |
652 | #endif | |
653 | return; | |
95a00d93 | 654 | } |
655 | ||
3e87ef69 | 656 | void AliL3ModelTrack::GetClusterLabel(Int_t row,Int_t *trackID) |
95a00d93 | 657 | { |
3e87ef69 | 658 | #ifdef do_mc |
659 | AliL3ClusterModel *cl = GetClusterModel(row); | |
660 | trackID[0] = cl->fTrackID[0]; | |
661 | trackID[1] = cl->fTrackID[1]; | |
662 | trackID[2] = cl->fTrackID[2]; | |
663 | #endif | |
664 | return; | |
95a00d93 | 665 | } |
8487f697 | 666 |