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