3 // Author: Anders Vestbo <mailto:vestbo@fi.uib.no>
4 //*-- Copyright © ALICE HLT Group
6 /** \class AliL3HoughTransformer
8 //_____________________________________________________________
9 // AliL3HoughTransformer
11 // Hough transformation class
16 #include "AliL3StandardIncludes.h"
18 #include "AliL3Logging.h"
19 #include "AliL3HoughTransformer.h"
20 #include "AliL3MemHandler.h"
21 #include "AliL3Transform.h"
22 #include "AliL3DigitData.h"
23 #include "AliL3HistogramAdaptive.h"
29 ClassImp(AliL3HoughTransformer)
31 AliL3HoughTransformer::AliL3HoughTransformer()
42 AliL3HoughTransformer::AliL3HoughTransformer(Int_t slice,Int_t patch,Int_t netasegments,Bool_t DoEtaOverlap,Bool_t /*DoMC*/) : AliL3HoughBaseTransformer(slice,patch,netasegments)
47 fEtaOverlap = DoEtaOverlap;
54 AliL3HoughTransformer::~AliL3HoughTransformer()
61 for(Int_t i=0; i<GetNEtaSegments(); i++)
63 if(!fTrackID[i]) continue;
71 void AliL3HoughTransformer::DeleteHistograms()
76 for(Int_t i=0; i<GetNEtaSegments(); i++)
78 if(!fParamSpace[i]) continue;
79 delete fParamSpace[i];
81 delete [] fParamSpace;
85 void AliL3HoughTransformer::CreateHistograms(Float_t ptmin,Float_t ptmax,Float_t ptres,
86 Int_t nybin,Float_t psi)
89 //_Only_ to be used in case of the adaptive histograms!
90 //phimax is given in radians!!
94 cerr<<"AliL3HoughTransformer::CreateHistograms: Error in ptrange "<<ptmin<<" "<<ptmax<<endl;
99 cerr<<"AliL3HoughTransformer::CreateHistograms: Wrong psi-angle "<<psi<<endl;
103 fParamSpace = new AliL3Histogram*[GetNEtaSegments()];
104 Char_t histname[256];
106 for(i=0; i<GetNEtaSegments(); i++)
108 sprintf(histname,"paramspace_%d",i);
109 fParamSpace[i] = new AliL3HistogramAdaptive(histname,ptmin,ptmax,ptres,nybin,-psi,psi);
113 void AliL3HoughTransformer::CreateHistograms(Int_t nxbin,Float_t ptmin,
114 Int_t nybin,Float_t phimin,Float_t phimax)
116 //Create the histograms (parameter space).
117 //These are 2D histograms, span by kappa (curvature of track) and phi0 (emission angle with x-axis).
118 //The arguments give the range and binning;
119 //nxbin = #bins in kappa
120 //nybin = #bins in phi0
121 //ptmin = mimium Pt of track (corresponding to maximum kappa)
122 //phimin = mimimum phi0
123 //phimax = maximum phi0
125 Double_t x = AliL3Transform::GetBFact()*AliL3Transform::GetBField()/ptmin;
126 //Double_t torad = AliL3Transform::Pi()/180;
128 CreateHistograms(nxbin,-1.*x,x,nybin,phimin/**torad*/,phimax/**torad*/);
131 void AliL3HoughTransformer::CreateHistograms(Int_t nxbin,Float_t xmin,Float_t xmax,
132 Int_t nybin,Float_t ymin,Float_t ymax)
134 //Create the histograms (parameter space).
137 //xmin xmax ymin ymax = histogram limits in X and Y
139 fParamSpace = new AliL3Histogram*[GetNEtaSegments()];
141 Char_t histname[256];
142 for(Int_t i=0; i<GetNEtaSegments(); i++)
144 sprintf(histname,"paramspace_%d",i);
145 //fParamSpace[i] = new AliL3HistogramAdaptive(histname,0.5,1.5,0.05,nybin,ymin,ymax);
146 fParamSpace[i] = new AliL3Histogram(histname,"",nxbin,xmin,xmax,nybin,ymin,ymax);
152 AliL3Histogram *hist = fParamSpace[0];
153 Int_t ncells = (hist->GetNbinsX()+2)*(hist->GetNbinsY()+2);
154 cout<<"Transformer: Allocating "<<GetNEtaSegments()*ncells*sizeof(AliL3TrackIndex)<<" bytes to fTrackID"<<endl;
155 fTrackID = new AliL3TrackIndex*[GetNEtaSegments()];
156 for(Int_t i=0; i<GetNEtaSegments(); i++)
157 fTrackID[i] = new AliL3TrackIndex[ncells];
162 void AliL3HoughTransformer::Reset()
164 //Reset all the histograms
168 LOG(AliL3Log::kWarning,"AliL3HoughTransformer::Reset","Histograms")
169 <<"No histograms to reset"<<ENDLOG;
173 for(Int_t i=0; i<GetNEtaSegments(); i++)
174 fParamSpace[i]->Reset();
179 AliL3Histogram *hist = fParamSpace[0];
180 Int_t ncells = (hist->GetNbinsX()+2)*(hist->GetNbinsY()+2);
181 for(Int_t i=0; i<GetNEtaSegments(); i++)
182 memset(fTrackID[i],0,ncells*sizeof(AliL3TrackIndex));
187 Int_t AliL3HoughTransformer::GetEtaIndex(Double_t eta) const
189 //Return the histogram index of the corresponding eta.
191 Double_t etaslice = (GetEtaMax() - GetEtaMin())/GetNEtaSegments();
192 Double_t index = (eta-GetEtaMin())/etaslice;
196 void AliL3HoughTransformer::GetEtaIndexes(Double_t eta,Int_t *indexes) const
198 //Return histogram indexes in case of overlapping etaslices.
200 Double_t etaslice = (GetEtaMax() - GetEtaMin())/GetNEtaSegments();
201 Int_t index = (Int_t)((eta-GetEtaMin())/etaslice);
205 indexes[1] = index - 1;
209 indexes[0] = index - 1;
214 AliL3Histogram *AliL3HoughTransformer::GetHistogram(Int_t etaindex)
216 // Return a pointer to the histogram which contains etaindex eta slice
217 if(!fParamSpace || etaindex >= GetNEtaSegments() || etaindex < 0)
219 if(!fParamSpace[etaindex])
221 return fParamSpace[etaindex];
224 Double_t AliL3HoughTransformer::GetEta(Int_t etaindex,Int_t /*slice*/) const
226 // Return eta calculated in the middle of the eta slice
227 Double_t etaslice = (GetEtaMax()-GetEtaMin())/GetNEtaSegments();
231 Int_t index = etaindex + 1;
232 eta=(Double_t)((index)*etaslice);
235 eta=(Double_t)((etaindex+0.5)*etaslice);
239 void AliL3HoughTransformer::TransformCircle()
241 //Transform the input data with a circle HT.
242 //The function loops over all the data, and transforms each pixel with the equations:
244 //kappa = 2/r*sin(phi - phi0)
246 //where r = sqrt(x*x +y*y), and phi = arctan(y/x)
248 //Each pixel then transforms into a curve in the (kappa,phi0)-space. In order to find
249 //which histogram in which the pixel should be transformed, the eta-value is calculated
250 //and the proper histogram index is found by GetEtaIndex(eta).
253 AliL3DigitRowData *tempPt = GetDataPointer();
256 LOG(AliL3Log::kError,"AliL3HoughTransformer::TransformCircle","Data")
257 <<"No input data "<<ENDLOG;
261 //Loop over the padrows:
262 for(Int_t i=AliL3Transform::GetFirstRow(GetPatch()); i<=AliL3Transform::GetLastRow(GetPatch()); i++)
264 //Get the data on this padrow:
265 AliL3DigitData *digPt = tempPt->fDigitData;
266 if(i != (Int_t)tempPt->fRow)
268 cerr<<"AliL3HoughTransform::TransformCircle : Mismatching padrow numbering "<<i<<" "<<(Int_t)tempPt->fRow<<endl;
272 //Loop over the data on this padrow:
273 for(UInt_t j=0; j<tempPt->fNDigit; j++)
275 UShort_t charge = digPt[j].fCharge;
276 UChar_t pad = digPt[j].fPad;
277 UShort_t time = digPt[j].fTime;
278 if((Int_t)charge <= GetLowerThreshold())
281 if((Int_t)charge > GetUpperThreshold())
282 charge = GetUpperThreshold();
287 //Transform data to local cartesian coordinates:
288 AliL3Transform::Slice2Sector(GetSlice(),i,sector,row);
289 AliL3Transform::Raw2Local(xyz,sector,row,(Int_t)pad,(Int_t)time);
292 Double_t eta = AliL3Transform::GetEta(xyz);
294 //Get the corresponding index, which determines which histogram to fill:
295 Int_t etaindex = GetEtaIndex(eta);
297 if(etaindex < 0 || etaindex >= GetNEtaSegments())
300 //Get the correct histogrampointer:
301 AliL3Histogram *hist = fParamSpace[etaindex];
304 cerr<<"AliL3HoughTransformer::TransformCircle : Error getting histogram in index "<<etaindex<<endl;
308 //Do the transformation:
309 Float_t r = sqrt(xyz[0]*xyz[0] + xyz[1]*xyz[1]);
310 Float_t phi = AliL3Transform::GetPhi(xyz);
313 //Fill the histogram along the phirange
314 for(Int_t b=hist->GetFirstYbin(); b<=hist->GetLastYbin(); b++)
316 Float_t phi0 = hist->GetBinCenterY(b);
317 Float_t kappa = 2*sin(phi - phi0)/r;
318 //hist->Fill(kappa,phi0,(int)rint(log((Float_t)charge)));
319 hist->Fill(kappa,phi0,charge);
320 //hist->Fill(kappa,phi0,1);
324 Int_t bin = hist->FindBin(kappa,phi0);
325 for(Int_t t=0; t<3; t++)
327 Int_t label = digPt[j].fTrackID[t];
330 for(c=0; c<MaxTrack; c++)
331 if(fTrackID[etaindex][bin].fLabel[c] == label || fTrackID[etaindex][bin].fNHits[c] == 0)
333 if(c == MaxTrack-1) cerr<<"AliL3HoughTransformer::TransformCircle : Array reached maximum!! "<<c<<endl;
334 fTrackID[etaindex][bin].fLabel[c] = label;
335 fTrackID[etaindex][bin].fNHits[c]++;
342 //Move the data pointer to the next padrow:
343 AliL3MemHandler::UpdateRowPointer(tempPt);
348 Int_t fRow; // Digit padrow
349 Double_t fR; // Digit radius in local coordinate system
350 Double_t fPhi; // Digit Phi angle in local coordinate system
351 Int_t fCharge; // Digit charge
352 AliL3Digit *fNext; // Next digit
355 struct AliL3EtaContainer {
356 AliL3Digit *fFirst; //First digit
357 AliL3Digit *fLast; //Last digit
360 void AliL3HoughTransformer::TransformCircleC(Int_t *rowrange,Int_t every)
362 //Circle transform, using combinations of every 2 points lying
363 //on different padrows and within the same etaslice.
365 AliL3DigitRowData *tempPt = GetDataPointer();
367 LOG(AliL3Log::kError,"AliL3HoughTransformer::TransformCircleC","Data")
368 <<"No input data "<<ENDLOG;
370 Int_t minrow = AliL3Transform::GetFirstRow(GetPatch());
371 Int_t maxrow = AliL3Transform::GetLastRow(GetPatch());
374 minrow = rowrange[0];
375 maxrow = rowrange[1];
376 if(minrow < AliL3Transform::GetFirstRow(GetPatch()) || minrow >= AliL3Transform::GetLastRow(GetPatch()))
377 minrow = AliL3Transform::GetFirstRow(GetPatch());
378 if(maxrow < AliL3Transform::GetFirstRow(GetPatch()) || maxrow >= AliL3Transform::GetLastRow(GetPatch()))
379 maxrow = AliL3Transform::GetLastRow(GetPatch());
380 if(minrow > maxrow || maxrow==minrow)
382 cerr<<"AliL3HoughTransformer::TransformCircleC : Bad row range "<<minrow<<" "<<maxrow<<endl;
388 minrow = AliL3Transform::GetFirstRow(GetPatch());
389 maxrow = AliL3Transform::GetLastRow(GetPatch());
393 for(Int_t i=AliL3Transform::GetFirstRow(GetPatch()); i<=AliL3Transform::GetLastRow(GetPatch()); i++)
395 counter += tempPt->fNDigit;
396 AliL3MemHandler::UpdateRowPointer(tempPt);
399 Int_t bound = (GetNEtaSegments()+1)*(AliL3Transform::GetNRows(GetPatch())+1);
400 AliL3EtaContainer *etaPt = new AliL3EtaContainer[bound];
401 memset(etaPt,0,bound*sizeof(AliL3EtaContainer));
403 AliL3Digit *digits = new AliL3Digit[counter];
404 cout<<"Allocating "<<counter*sizeof(AliL3Digit)<<" bytes to digitsarray"<<endl;
405 memset(digits,0,counter*sizeof(AliL3Digit));
407 Int_t sector,row,totcharge,pad,time,charge;
408 Double_t r1,r2,phi1,phi2,eta,kappa,phi0;
412 tempPt = GetDataPointer();
414 cout<<"Calculating digits in patch "<<GetPatch()<<endl;
415 for(Int_t i=AliL3Transform::GetFirstRow(GetPatch()); i<=AliL3Transform::GetLastRow(GetPatch()); i++)
417 AliL3DigitData *digPt = tempPt->fDigitData;
418 for(UInt_t di=0; di<tempPt->fNDigit; di++)
420 charge = digPt[di].fCharge;
421 pad = digPt[di].fPad;
422 time = digPt[di].fTime;
423 AliL3Transform::Slice2Sector(GetSlice(),i,sector,row);
424 AliL3Transform::Raw2Local(xyz,sector,row,(Int_t)pad,(Int_t)time);
425 eta = AliL3Transform::GetEta(xyz);
427 digits[counter].fRow = i;
428 digits[counter].fR = sqrt(xyz[0]*xyz[0] + xyz[1]*xyz[1]);
429 digits[counter].fPhi = atan2(xyz[1],xyz[0]);
430 digits[counter].fCharge = charge;
434 Int_t etaindex = GetEtaIndex(eta);
436 Int_t index = (GetNEtaSegments()+1)*(i-AliL3Transform::GetFirstRow(GetPatch())) + etaindex;
438 if(index > 0 && index < bound)
440 if(etaPt[index].fFirst == 0)
441 etaPt[index].fFirst = &digits[counter];
443 (etaPt[index].fLast)->fNext = &digits[counter];
444 etaPt[index].fLast = &digits[counter];
450 GetEtaIndexes(eta,etaindex);
452 index[0] = (GetNEtaSegments()+1)*(i-AliL3Transform::GetFirstRow(GetPatch())) + etaindex[0];
453 index[1] = (GetNEtaSegments()+1)*(i-AliL3Transform::GetFirstRow(GetPatch())) + etaindex[1];
454 if(index[0] == index[1])
456 cerr<<"Same etaindexes "<<index[0]<<" "<<index[1]<<endl;
460 Int_t ind = index[0];
461 if(ind > 0 && ind < bound)
463 if(etaPt[ind].fFirst == 0)
464 etaPt[ind].fFirst = &digits[counter];
466 (etaPt[ind].fLast)->fNext = &digits[counter];
467 etaPt[ind].fLast = &digits[counter];
471 if(ind > 0 && ind < bound)
473 if(etaPt[ind].fFirst == 0)
474 etaPt[ind].fFirst = &digits[counter];
476 (etaPt[ind].fLast)->fNext = &digits[counter];
477 etaPt[ind].fLast = &digits[counter];
483 AliL3MemHandler::UpdateRowPointer(tempPt);
486 cout<<"Doing the combinatorics"<<endl;
488 AliL3Digit *dPt1,*dPt2;
490 for(Int_t e=0; e<GetNEtaSegments(); e++)
492 for(Int_t i=minrow; i<=maxrow; i+=every)
494 Int_t index1 = (GetNEtaSegments()+1)*(i-AliL3Transform::GetFirstRow(GetPatch())) + e;
496 for(dPt1 = (AliL3Digit*)etaPt[index1].fFirst; dPt1 != 0; dPt1 = (AliL3Digit*)dPt1->fNext)
498 for(Int_t j=i+every; j<=maxrow; j+=every)
500 Int_t index2 = (GetNEtaSegments()+1)*(j-AliL3Transform::GetFirstRow(GetPatch())) + e;
502 for(dPt2 = (AliL3Digit*)etaPt[index2].fFirst; dPt2 != 0; dPt2 = (AliL3Digit*)dPt2->fNext)
504 if(dPt1->fRow == dPt2->fRow)
506 cerr<<"same row; indexes "<<index1<<" "<<index2<<endl;
510 //Get the correct histogrampointer:
511 AliL3Histogram *hist = fParamSpace[e];
514 printf("AliL3HoughTransformer::TransformCircleC() : No histogram at index %d\n",i);
523 phi0 = atan( (r2*sin(phi1)-r1*sin(phi2))/(r2*cos(phi1)-r1*cos(phi2)) );
524 kappa = 2*sin(phi2-phi0)/r2;
525 totcharge = dPt1->fCharge + dPt2->fCharge;
526 hist->Fill(kappa,phi0,totcharge);
540 void AliL3HoughTransformer::TransformLine(Int_t *rowrange,Float_t *phirange)
542 //Do a line transform on the data.
545 AliL3DigitRowData *tempPt = GetDataPointer();
548 LOG(AliL3Log::kError,"AliL3HoughTransformer::TransformLine","Data")
549 <<"No input data "<<ENDLOG;
553 Int_t minrow = AliL3Transform::GetFirstRow(GetPatch());
554 Int_t maxrow = AliL3Transform::GetLastRow(GetPatch());
557 minrow = rowrange[0];
558 maxrow = rowrange[1];
559 if(minrow < AliL3Transform::GetFirstRow(GetPatch()) || minrow >= AliL3Transform::GetLastRow(GetPatch()))
560 minrow = AliL3Transform::GetFirstRow(GetPatch());
561 if(maxrow < AliL3Transform::GetFirstRow(GetPatch()) || maxrow >= AliL3Transform::GetLastRow(GetPatch()))
562 maxrow = AliL3Transform::GetLastRow(GetPatch());
563 if(minrow > maxrow || maxrow==minrow)
565 cerr<<"AliL3HoughTransformer::TransformCircleC : Bad row range "<<minrow<<" "<<maxrow<<endl;
570 for(Int_t i=minrow; i<=maxrow; i++)
572 AliL3DigitData *digPt = tempPt->fDigitData;
573 if(i != (Int_t)tempPt->fRow)
575 printf("AliL3HoughTransform::TransformLine : Mismatching padrow numbering\n");
578 for(UInt_t j=0; j<tempPt->fNDigit; j++)
580 UShort_t charge = digPt[j].fCharge;
581 UChar_t pad = digPt[j].fPad;
582 UShort_t time = digPt[j].fTime;
583 if(charge < GetLowerThreshold())
587 AliL3Transform::Slice2Sector(GetSlice(),i,sector,row);
588 AliL3Transform::Raw2Local(xyz,sector,row,(Int_t)pad,(Int_t)time);
592 Float_t phi = AliL3Transform::GetPhi(xyz);
593 if(phi < phirange[0] || phi > phirange[1])
596 Float_t eta = AliL3Transform::GetEta(xyz);
597 Int_t etaindex = GetEtaIndex(eta);//(Int_t)(eta/etaslice);
598 if(etaindex < 0 || etaindex >= GetNEtaSegments())
601 xyz[0] = xyz[0] - AliL3Transform::Row2X(minrow);
603 //Get the correct histogram:
604 AliL3Histogram *hist = fParamSpace[etaindex];
607 printf("AliL3HoughTransformer::TransformLine : Error getting histogram in index %d\n",etaindex);
610 for(Int_t xbin=hist->GetFirstXbin(); xbin<hist->GetLastXbin(); xbin++)
612 Double_t theta = hist->GetBinCenterX(xbin);
613 Double_t rho = xyz[0]*cos(theta) + xyz[1]*sin(theta);
614 hist->Fill(theta,rho,charge);
617 AliL3MemHandler::UpdateRowPointer(tempPt);
623 Int_t fRow; // Digit rowpad
624 Int_t fCharge; // Digit charge
625 Float_t fY; // Y position of the digit in the local coor system
626 AliL3LDigit *fNext; // Next digit
628 struct AliL3LEtaContainer {
629 AliL3LDigit *fFirst; //First digit
630 AliL3LDigit *fLast; //Last digit
632 void AliL3HoughTransformer::TransformLineC(Int_t *rowrange,Float_t *phirange)
634 //Circle transform ??
635 AliL3DigitRowData *tempPt = GetDataPointer();
637 LOG(AliL3Log::kError,"AliL3HoughTransformer::TransformCircleC","Data")
638 <<"No input data "<<ENDLOG;
642 for(Int_t i=AliL3Transform::GetFirstRow(GetPatch()); i<=AliL3Transform::GetLastRow(GetPatch()); i++)
644 counter += tempPt->fNDigit;
645 AliL3MemHandler::UpdateRowPointer(tempPt);
648 Int_t bound = (GetNEtaSegments()+1)*(AliL3Transform::GetNRows(GetPatch())+1);
649 AliL3LEtaContainer *etaPt = new AliL3LEtaContainer[bound];
650 memset(etaPt,0,bound*sizeof(AliL3LEtaContainer));
652 AliL3LDigit *digits = new AliL3LDigit[counter];
653 cout<<"Allocating "<<counter*sizeof(AliL3LDigit)<<" bytes to digitsarray"<<endl;
654 memset(digits,0,counter*sizeof(AliL3LDigit));
660 tempPt = GetDataPointer();
662 cout<<"Calculating digits in patch "<<GetPatch()<<endl;
663 for(Int_t i=AliL3Transform::GetFirstRow(GetPatch()); i<=AliL3Transform::GetLastRow(GetPatch()); i++)
665 AliL3DigitData *digPt = tempPt->fDigitData;
666 for(UInt_t di=0; di<tempPt->fNDigit; di++)
668 Int_t charge = digPt[di].fCharge;
669 Int_t pad = digPt[di].fPad;
670 Int_t time = digPt[di].fTime;
671 AliL3Transform::Slice2Sector(GetSlice(),i,sector,row);
672 AliL3Transform::Raw2Local(xyz,sector,row,(Int_t)pad,(Int_t)time);
673 Double_t eta = AliL3Transform::GetEta(xyz);
675 Float_t phi = atan2(xyz[1],xyz[0]);
676 if(phi < phirange[0] || phi > phirange[1]) continue;
678 digits[counter].fRow = i;
679 digits[counter].fY = xyz[1];
680 digits[counter].fCharge = charge;
682 Int_t etaindex = GetEtaIndex(eta);
683 Int_t index = (GetNEtaSegments()+1)*(i-AliL3Transform::GetFirstRow(GetPatch())) + etaindex;
685 if(index > 0 && index < bound)
687 if(etaPt[index].fFirst == 0)
688 etaPt[index].fFirst = &digits[counter];
690 (etaPt[index].fLast)->fNext = &digits[counter];
691 etaPt[index].fLast = &digits[counter];
695 AliL3MemHandler::UpdateRowPointer(tempPt);
698 cout<<"Doing the combinatorics"<<endl;
700 AliL3LDigit *dPt1,*dPt2;
702 for(Int_t e=0; e<GetNEtaSegments(); e++)
704 for(Int_t i=rowrange[0]; i<=rowrange[1]; i++)
706 Int_t index1 = (GetNEtaSegments()+1)*(i-AliL3Transform::GetFirstRow(GetPatch())) + e;
708 for(dPt1 = (AliL3LDigit*)etaPt[index1].fFirst; dPt1 != 0; dPt1 = (AliL3LDigit*)dPt1->fNext)
710 for(Int_t j=i+1; j<=rowrange[1]; j++)
712 Int_t index2 = (GetNEtaSegments()+1)*(j-AliL3Transform::GetFirstRow(GetPatch())) + e;
714 for(dPt2 = (AliL3LDigit*)etaPt[index2].fFirst; dPt2 != 0; dPt2 = (AliL3LDigit*)dPt2->fNext)
716 if(dPt1->fRow == dPt2->fRow)
718 cerr<<"same row; indexes "<<index1<<" "<<index2<<endl;
722 //Get the correct histogrampointer:
723 AliL3Histogram *hist = fParamSpace[e];
726 printf("AliL3HoughTransformer::TransformCircleC() : No histogram at index %d\n",i);
731 float x1 = AliL3Transform::Row2X(dPt1->fRow) - AliL3Transform::Row2X(rowrange[0]);
732 float x2 = AliL3Transform::Row2X(dPt2->fRow) - AliL3Transform::Row2X(rowrange[0]);
735 float theta = atan2(x2-x1,y1-y2);
736 float rho = x1*cos(theta)+y1*sin(theta);
737 hist->Fill(theta,rho,1);//dPt1->charge+dPt2->charge);
750 Int_t AliL3HoughTransformer::GetTrackID(Int_t etaindex,Double_t kappa,Double_t psi) const
752 // Returns the MC label for a given peak found in the Hough space
755 cerr<<"AliL3HoughTransformer::GetTrackID : Flag switched off"<<endl;
759 if(etaindex < 0 || etaindex > GetNEtaSegments())
761 cerr<<"AliL3HoughTransformer::GetTrackID : Wrong etaindex "<<etaindex<<endl;
764 AliL3Histogram *hist = fParamSpace[etaindex];
765 Int_t bin = hist->FindBin(kappa,psi);
768 for(UInt_t i=0; i<MaxTrack; i++)
770 Int_t nhits=fTrackID[etaindex][bin].fNHits[i];
771 if(nhits == 0) break;
775 label = fTrackID[etaindex][bin].fLabel[i];
781 Int_t AliL3HoughTransformer::GetTrackID(Int_t /*etaindex*/,Double_t /*kappa*/,Double_t /*psi*/) const
783 // Returns the MC label for a given peak found in the Hough space
786 cerr<<"AliL3HoughTransformer::GetTrackID : Flag switched off"<<endl;
790 cout<<"AliL3HoughTransformer::GetTrackID : Compile with do_mc flag!"<<endl;