a75e4c3b64e97b6829d22285e5e218733cb771d1
[u/mrichter/AliRoot.git] / HLT / comp / AliL3ModelTrack.cxx
1 // @(#) $Id$
2
3 // Author: Anders Vestbo <mailto:vestbo$fi.uib.no>
4 //*-- Copyright &copy ALICE HLT Group
5
6 #include "AliL3StandardIncludes.h"
7
8 #include "AliL3Logging.h"
9 #include "AliL3ModelTrack.h"
10 #include "AliL3Transform.h"
11 #include "AliL3DataCompressor.h"
12
13 #if GCCVERSION == 3
14 using namespace std;
15 #endif
16
17 //_____________________________________________________________
18 // AliL3ModelTrack
19 //
20 // 
21
22 ClassImp(AliL3ModelTrack)
23
24 AliL3ModelTrack::AliL3ModelTrack() 
25 {
26   fNClusters = 0;
27   fClusters = 0;
28   fOverlap = 0;
29   fPad=0;
30   fTime=0;
31   fNoverlaps=0;
32   fClusterCharge=0;
33   fTrackModel=0;
34   fCrossingAngle=0;
35   fParSigmaY2=0;
36   fParSigmaZ2=0;
37 }
38
39
40 AliL3ModelTrack::~AliL3ModelTrack()
41 {
42   if(fClusters)
43     delete [] fClusters;
44   if(fPad)
45     delete [] fPad;
46   if(fTime)
47     delete [] fTime;
48   if(fCrossingAngle)
49     delete [] fCrossingAngle;
50   if(fParSigmaY2)
51     delete [] fParSigmaY2;
52   if(fParSigmaZ2)
53     delete [] fParSigmaZ2;
54   if(fTrackModel)
55     delete fTrackModel;
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     }
64 }
65
66 void AliL3ModelTrack::Init(Int_t slice,Int_t patch)
67 {
68   fNClusters=AliL3Transform::GetNRows(patch);//is not incremented in setcluster anymore
69   //fSlice=slice;
70   fPatch=patch;
71   Int_t nrows = AliL3Transform::GetNRows(fPatch);
72   fClusters = new AliL3ClusterModel[nrows];
73   fPad = new Float_t[nrows];
74   fTime = new Float_t[nrows];
75   fCrossingAngle = new Float_t[nrows];
76   fParSigmaY2 = new Float_t[nrows];
77   fParSigmaZ2 = new Float_t[nrows];
78   fTrackModel = new AliL3TrackModel;
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));
85   memset(fClusters,0,nrows*sizeof(AliL3ClusterModel));
86   memset(fPad,0,nrows*sizeof(Float_t));
87   memset(fTime,0,nrows*sizeof(Float_t));
88   memset(fCrossingAngle,0,nrows*sizeof(Float_t));
89   memset(fParSigmaY2,0,nrows*sizeof(Float_t));
90   memset(fParSigmaZ2,0,nrows*sizeof(Float_t));
91   memset(fTrackModel,0,sizeof(AliL3TrackModel));
92   for(Int_t i=0; i<nrows; i++)
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     }
99
100 }
101
102 void AliL3ModelTrack::CalculateClusterWidths(Int_t row,Bool_t parametrize)
103 {
104   //Cluster widths
105   
106   Float_t xyz[3];
107   Int_t sr,lr;
108   Int_t index = row - AliL3Transform::GetFirstRow(fPatch);
109   if(index < 0 || index > AliL3Transform::GetNRows(fPatch))
110     {
111       cerr<<"AliL3ModelTrack::CalculcateClusterWidths : Wrond index "<<index<<" row "<<row<<endl;
112       return;
113     }
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
138 void 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 {
141   AliL3ClusterModel *cl = GetClusterModel(row);
142   
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);
149   if(!charge || npads == 1)
150     {
151       cl->fPresent &= ~0x1; //set first bit to false
152     }
153   else
154     {
155       cl->fPresent|=0x1;//set first bit to true
156       cl->fDTime = (ftime - GetTimeHit(row))/(AliL3DataCompressor::GetZResidualStep(row)/AliL3Transform::GetZWidth());   
157       cl->fDPad = (fpad - GetPadHit(row))/(AliL3DataCompressor::GetXYResidualStep(row)/AliL3Transform::GetPadPitchWidth(patch));
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         }
170       cl->fNPads = npads;
171     }
172   
173   //fNClusters++;
174 }
175
176 void 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
205 }
206
207 Int_t AliL3ModelTrack::GetNPresentClusters()
208 {
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   
213   Int_t count=0;
214
215   for(Int_t i=AliL3Transform::GetFirstRow(fPatch); i<=AliL3Transform::GetLastRow(fPatch); i++)
216     if(IsPresent(i))
217       count++;
218
219   return count;
220 }
221
222 void AliL3ModelTrack::FillModel()
223 {
224   //Fill the track structure
225   
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
232   if(!fTrackModel)
233     {
234       cerr<<"AliL3ModelTrack::FillModel() : No trackmodel "<<endl;
235       return;
236     }
237   fTrackModel->fKappa = GetKappa();
238
239   fTrackModel->fFirstPointX = GetFirstPointX();
240   fTrackModel->fFirstPointY = GetFirstPointY();
241   fTrackModel->fFirstPointZ = GetFirstPointZ();
242   fTrackModel->fTgl = GetTgl();
243   fTrackModel->fPsi = GetPsi();
244   //fTrackModel->fLength = (Short_t)GetLength();
245   //fTrackModel->fNClusters = fNClusters;
246 }
247
248 void AliL3ModelTrack::FillTrack()
249 {
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);
262   //SetLength(fTrackModel->fLength);
263   fNClusters = AliL3Transform::GetNRows(fPatch);//fTrackModel->fNClusters;
264   SetPt((AliL3Transform::GetBFact()*AliL3Transform::GetBField())/fabs(GetKappa()));
265     
266   CalculateHelix();
267
268   for(Int_t i=AliL3Transform::GetFirstRow(fPatch); i<=AliL3Transform::GetLastRow(fPatch); i++)
269     {
270       AliL3ClusterModel *cl = GetClusterModel(i);
271       if(!cl) continue;
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
306       SetPadHit(i,hit[1]);
307       SetTimeHit(i,hit[2]);
308
309       Float_t crossingangle = GetCrossingAngle(i,cl->fSlice);
310       
311       SetCrossingAngleLUT(i,crossingangle);
312       CalculateClusterWidths(i,kTRUE);
313       
314     }
315 }
316
317 void AliL3ModelTrack::SetPadHit(Int_t row,Float_t pad)
318 {
319   Int_t index = row-AliL3Transform::GetFirstRow(fPatch);
320   if(index < 0 || index > AliL3Transform::GetNRows(fPatch))
321     {
322       cerr<<"AliL3ModelTrack::SetPadHit() : Wrong index: "<<index<<endl;
323       return;
324     }
325   fPad[index]=pad;
326 }
327
328 void AliL3ModelTrack::SetTimeHit(Int_t row,Float_t time)
329 {
330   Int_t index = row-AliL3Transform::GetFirstRow(fPatch);
331   if(index < 0 || index > AliL3Transform::GetNRows(fPatch))
332     {
333       cerr<<"AliL3ModelTrack::SetTimeHit() : Wrong index: "<<index<<endl;
334       return;
335     }
336   fTime[index]=time;
337 }
338
339 void 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
350 void AliL3ModelTrack::SetOverlap(Int_t row,Int_t id)
351 {
352
353   Int_t index = row-AliL3Transform::GetFirstRow(fPatch);
354   if(index < 0 || index > AliL3Transform::GetNRows(fPatch))
355     {
356       cerr<<"AliL3ModelTrack::SetOverlap() : Wrong index: "<<index<<endl;
357       return;
358     }
359   if(fNoverlaps[index] >= fMaxOverlaps) return;
360   fOverlap[index][fNoverlaps[index]++] = id;
361 }
362
363 Bool_t AliL3ModelTrack::IsPresent(Int_t row)
364 {
365   AliL3ClusterModel *cl = GetClusterModel(row);
366   return (Bool_t)(cl->fPresent & 0x1);
367 }
368
369 Bool_t AliL3ModelTrack::IsSet(Int_t row)
370 {
371   AliL3ClusterModel *cl = GetClusterModel(row);
372   return (Bool_t)(cl->fPresent & 0x2);
373 }
374
375 Int_t AliL3ModelTrack::GetNPads(Int_t row)
376 {
377   AliL3ClusterModel *cl = GetClusterModel(row);
378   return cl->fNPads;
379 }
380
381 Bool_t AliL3ModelTrack::GetPad(Int_t row,Float_t &pad)
382 {
383   //(ftime - GetTimeHit(fNClusters))/AliL3DataCompressor::GetXYResidualStep();
384   //(fpad - GetPadHit(fNClusters))/AliL3DataCompressor::GetZResidualStep();
385
386   AliL3ClusterModel *cl = GetClusterModel(row);
387   Int_t patch = AliL3Transform::GetPatch(row);
388   pad = cl->fDPad*(AliL3DataCompressor::GetXYResidualStep(row)/AliL3Transform::GetPadPitchWidth(patch)) + GetPadHit(row);
389   
390   return IsPresent(row);
391 }
392
393 Bool_t AliL3ModelTrack::GetTime(Int_t row,Float_t &time)
394 {
395   AliL3ClusterModel *cl = GetClusterModel(row);
396   time = cl->fDTime*(AliL3DataCompressor::GetZResidualStep(row)/AliL3Transform::GetZWidth()) + GetTimeHit(row);
397   
398   return IsPresent(row);
399 }
400
401 Bool_t AliL3ModelTrack::GetClusterCharge(Int_t row,Int_t &charge)
402 {
403   AliL3ClusterModel *cl = GetClusterModel(row);
404   charge = (Int_t)cl->fDCharge;// + AliL3DataCompressor::GetClusterCharge();
405   
406   return IsPresent(row);
407 }
408
409 Bool_t AliL3ModelTrack::GetXYWidth(Int_t row,Float_t &width)
410 {
411   //cl->fDSigmaY2 = (sigmaY2 - GetParSigmaY2(row))/AliL3DataCompressor::GetXYWidthStep();
412   AliL3ClusterModel *cl = GetClusterModel(row);
413   Int_t patch = AliL3Transform::GetPatch(row);
414   width = cl->fDSigmaY2*(AliL3DataCompressor::GetXYWidthStep()/pow(AliL3Transform::GetPadPitchWidth(patch),2)) + GetParSigmaY2(row);
415
416   return IsPresent(row);
417 }
418
419 Bool_t AliL3ModelTrack::GetZWidth(Int_t row,Float_t &width)
420 {
421   AliL3ClusterModel *cl = GetClusterModel(row);
422   width = cl->fDSigmaZ2*(AliL3DataCompressor::GetZWidthStep()/pow(AliL3Transform::GetZWidth(),2)) + GetParSigmaZ2(row);
423
424   return IsPresent(row);
425 }
426
427 Bool_t AliL3ModelTrack::GetPadResidual(Int_t row,Float_t &res)
428 {
429   AliL3ClusterModel *cl = GetClusterModel(row);
430   res = cl->fDPad;
431   return IsPresent(row);
432 }
433
434 Bool_t AliL3ModelTrack::GetTimeResidual(Int_t row,Float_t &res)
435 {
436   AliL3ClusterModel *cl = GetClusterModel(row);
437   res = cl->fDTime;
438   return IsPresent(row);
439 }
440
441 Bool_t AliL3ModelTrack::GetXYWidthResidual(Int_t row,Float_t &res)
442 {
443   AliL3ClusterModel *cl = GetClusterModel(row);
444   res = cl->fDSigmaY2;
445   return IsPresent(row);
446 }
447
448 Bool_t AliL3ModelTrack::GetZWidthResidual(Int_t row,Float_t &res)
449 {
450   AliL3ClusterModel *cl = GetClusterModel(row);
451   res = cl->fDSigmaZ2;
452   return IsPresent(row);
453 }
454
455 Int_t AliL3ModelTrack::GetSlice(Int_t row)
456 {
457   AliL3ClusterModel *cl = GetClusterModel(row);
458   return cl->fSlice;
459 }
460
461 Float_t AliL3ModelTrack::GetPadHit(Int_t row)
462 {
463   Int_t index = row-AliL3Transform::GetFirstRow(fPatch);
464   if(index < 0 || index > AliL3Transform::GetNRows(fPatch))
465     {
466       cerr<<"AliL3ModelTrack::GetPadHit() : Wrong index: "<<index<<" row "<<row<<endl;
467       return 0;
468     }
469   return fPad[index];
470 }
471
472 Float_t AliL3ModelTrack::GetTimeHit(Int_t row)
473 {
474   Int_t index = row-AliL3Transform::GetFirstRow(fPatch);
475   if(index < 0 || index > AliL3Transform::GetNRows(fPatch))
476     {
477       cerr<<"AliL3ModelTrack::GetTimeHit() : Wrong index: "<<index<<" row "<<row<<endl;
478       return 0;
479     }
480   return fTime[index];
481 }
482
483 Float_t AliL3ModelTrack::GetCrossingAngleLUT(Int_t row)
484 {
485   Int_t index = row-AliL3Transform::GetFirstRow(fPatch);
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
494 Float_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
505 Float_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
516 Int_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
527 Int_t *AliL3ModelTrack::GetOverlaps(Int_t row)
528 {
529   Int_t index = row - AliL3Transform::GetFirstRow(fPatch);
530   if(index < 0 || index > AliL3Transform::GetNRows(fPatch))
531     {
532       cerr<<"AliL3ModelTrack::GetOverlap() : Wrong index: "<<index<<endl;
533       return 0;
534     }
535   return fOverlap[index];
536 }
537
538 AliL3ClusterModel *AliL3ModelTrack::GetClusterModel(Int_t row)
539 {
540   if(!fClusters) return 0; 
541   Int_t index = row-AliL3Transform::GetFirstRow(fPatch);
542   if(index < 0 || index > AliL3Transform::GetNRows(fPatch))
543     {
544       cerr<<"AliL3ModelTrack::GetClusterModel() : Wrong index: "<<index<<endl;
545       return 0;
546     }
547   return &fClusters[index];
548 }
549
550 void AliL3ModelTrack::Print(Bool_t everything)
551 {
552   //Print info
553
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;
558   if(!everything)
559     return;
560   cout<<"NHits "<<GetNClusters()<<endl;
561
562   cout<<"Clusters:"<<endl;
563   Int_t origslice=-1,counter=0;
564   Float_t fpad,ftime;
565   for(Int_t i=AliL3Transform::GetFirstRow(fPatch); i<=AliL3Transform::GetLastRow(fPatch); i++)
566     {
567       AliL3ClusterModel *cl = GetClusterModel(i);
568       
569       if(!IsPresent(i))
570         cout<<i<<" Empty"<<" Slice "<<cl->fSlice<<" Padcrossing "<<GetPadHit(i)<<" Timecrossing "<<GetTimeHit(i)<<" ";
571       else
572         {
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++;
584         }
585       cout<<endl;
586     }
587 }
588
589 void AliL3ModelTrack::SetClusterLabel(Int_t row,Int_t *trackID)
590 {
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;
598 }
599
600 void AliL3ModelTrack::GetClusterLabel(Int_t row,Int_t *trackID)
601 {
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;
609 }
610