3 // Author: Anders Vestbo <mailto:vestbo@fi.uib.no>
4 //*-- Copyright © ALICE HLT Group
6 #include "AliL3StandardIncludes.h"
8 #include "AliL3Logging.h"
9 #include "AliL3HoughTransformer.h"
10 #include "AliL3MemHandler.h"
11 #include "AliL3Transform.h"
12 #include "AliL3DigitData.h"
13 #include "AliL3HistogramAdaptive.h"
19 /** \class AliL3HoughTransformer
21 //_____________________________________________________________
22 // AliL3HoughTransformer
24 // Hough transformation class
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;
84 void AliL3HoughTransformer::CreateHistograms(Float_t ptmin,Float_t ptmax,Float_t ptres,
85 Int_t nybin,Float_t psi)
88 //_Only_ to be used in case of the adaptive histograms!
89 //phimax is given in radians!!
93 cerr<<"AliL3HoughTransformer::CreateHistograms: Error in ptrange "<<ptmin<<" "<<ptmax<<endl;
98 cerr<<"AliL3HoughTransformer::CreateHistograms: Wrong psi-angle "<<psi<<endl;
102 fParamSpace = new AliL3Histogram*[GetNEtaSegments()];
103 Char_t histname[256];
105 for(i=0; i<GetNEtaSegments(); i++)
107 sprintf(histname,"paramspace_%d",i);
108 fParamSpace[i] = new AliL3HistogramAdaptive(histname,ptmin,ptmax,ptres,nybin,-psi,psi);
112 void AliL3HoughTransformer::CreateHistograms(Int_t nxbin,Float_t ptmin,
113 Int_t nybin,Float_t phimin,Float_t phimax)
115 //Create the histograms (parameter space).
116 //These are 2D histograms, span by kappa (curvature of track) and phi0 (emission angle with x-axis).
117 //The arguments give the range and binning;
118 //nxbin = #bins in kappa
119 //nybin = #bins in phi0
120 //ptmin = mimium Pt of track (corresponding to maximum kappa)
121 //phimin = mimimum phi0
122 //phimax = maximum phi0
124 Double_t x = AliL3Transform::GetBFact()*AliL3Transform::GetBField()/ptmin;
125 //Double_t torad = AliL3Transform::Pi()/180;
127 CreateHistograms(nxbin,-1.*x,x,nybin,phimin/**torad*/,phimax/**torad*/);
130 void AliL3HoughTransformer::CreateHistograms(Int_t nxbin,Float_t xmin,Float_t xmax,
131 Int_t nybin,Float_t ymin,Float_t ymax)
133 //Create the histograms (parameter space).
136 //xmin xmax ymin ymax = histogram limits in X and Y
138 fParamSpace = new AliL3Histogram*[GetNEtaSegments()];
140 Char_t histname[256];
141 for(Int_t i=0; i<GetNEtaSegments(); i++)
143 sprintf(histname,"paramspace_%d",i);
144 //fParamSpace[i] = new AliL3HistogramAdaptive(histname,0.5,1.5,0.05,nybin,ymin,ymax);
145 fParamSpace[i] = new AliL3Histogram(histname,"",nxbin,xmin,xmax,nybin,ymin,ymax);
151 AliL3Histogram *hist = fParamSpace[0];
152 Int_t ncells = (hist->GetNbinsX()+2)*(hist->GetNbinsY()+2);
153 cout<<"Transformer: Allocating "<<GetNEtaSegments()*ncells*sizeof(AliL3TrackIndex)<<" bytes to fTrackID"<<endl;
154 fTrackID = new AliL3TrackIndex*[GetNEtaSegments()];
155 for(Int_t i=0; i<GetNEtaSegments(); i++)
156 fTrackID[i] = new AliL3TrackIndex[ncells];
161 void AliL3HoughTransformer::Reset()
163 //Reset all the histograms
167 LOG(AliL3Log::kWarning,"AliL3HoughTransformer::Reset","Histograms")
168 <<"No histograms to reset"<<ENDLOG;
172 for(Int_t i=0; i<GetNEtaSegments(); i++)
173 fParamSpace[i]->Reset();
178 AliL3Histogram *hist = fParamSpace[0];
179 Int_t ncells = (hist->GetNbinsX()+2)*(hist->GetNbinsY()+2);
180 for(Int_t i=0; i<GetNEtaSegments(); i++)
181 memset(fTrackID[i],0,ncells*sizeof(AliL3TrackIndex));
186 Int_t AliL3HoughTransformer::GetEtaIndex(Double_t eta) const
188 //Return the histogram index of the corresponding eta.
190 Double_t etaslice = (GetEtaMax() - GetEtaMin())/GetNEtaSegments();
191 Double_t index = (eta-GetEtaMin())/etaslice;
195 void AliL3HoughTransformer::GetEtaIndexes(Double_t eta,Int_t *indexes) const
197 //Return histogram indexes in case of overlapping etaslices.
199 Double_t etaslice = (GetEtaMax() - GetEtaMin())/GetNEtaSegments();
200 Int_t index = (Int_t)((eta-GetEtaMin())/etaslice);
204 indexes[1] = index - 1;
208 indexes[0] = index - 1;
213 inline AliL3Histogram *AliL3HoughTransformer::GetHistogram(Int_t etaindex)
215 // Return a pointer to the histogram which contains etaindex eta slice
216 if(!fParamSpace || etaindex >= GetNEtaSegments() || etaindex < 0)
218 if(!fParamSpace[etaindex])
220 return fParamSpace[etaindex];
223 Double_t AliL3HoughTransformer::GetEta(Int_t etaindex,Int_t /*slice*/) const
225 // Return eta calculated in the middle of the eta slice
226 Double_t etaslice = (GetEtaMax()-GetEtaMin())/GetNEtaSegments();
230 Int_t index = etaindex + 1;
231 eta=(Double_t)((index)*etaslice);
234 eta=(Double_t)((etaindex+0.5)*etaslice);
238 void AliL3HoughTransformer::TransformCircle()
240 //Transform the input data with a circle HT.
241 //The function loops over all the data, and transforms each pixel with the equations:
243 //kappa = 2/r*sin(phi - phi0)
245 //where r = sqrt(x*x +y*y), and phi = arctan(y/x)
247 //Each pixel then transforms into a curve in the (kappa,phi0)-space. In order to find
248 //which histogram in which the pixel should be transformed, the eta-value is calculated
249 //and the proper histogram index is found by GetEtaIndex(eta).
252 AliL3DigitRowData *tempPt = GetDataPointer();
255 LOG(AliL3Log::kError,"AliL3HoughTransformer::TransformCircle","Data")
256 <<"No input data "<<ENDLOG;
260 //Loop over the padrows:
261 for(Int_t i=AliL3Transform::GetFirstRow(GetPatch()); i<=AliL3Transform::GetLastRow(GetPatch()); i++)
263 //Get the data on this padrow:
264 AliL3DigitData *digPt = tempPt->fDigitData;
265 if(i != (Int_t)tempPt->fRow)
267 cerr<<"AliL3HoughTransform::TransformCircle : Mismatching padrow numbering "<<i<<" "<<(Int_t)tempPt->fRow<<endl;
271 //Loop over the data on this padrow:
272 for(UInt_t j=0; j<tempPt->fNDigit; j++)
274 UShort_t charge = digPt[j].fCharge;
275 UChar_t pad = digPt[j].fPad;
276 UShort_t time = digPt[j].fTime;
277 if((Int_t)charge <= GetLowerThreshold())
280 if((Int_t)charge > GetUpperThreshold())
281 charge = GetUpperThreshold();
286 //Transform data to local cartesian coordinates:
287 AliL3Transform::Slice2Sector(GetSlice(),i,sector,row);
288 AliL3Transform::Raw2Local(xyz,sector,row,(Int_t)pad,(Int_t)time);
291 Double_t eta = AliL3Transform::GetEta(xyz);
293 //Get the corresponding index, which determines which histogram to fill:
294 Int_t etaindex = GetEtaIndex(eta);
296 if(etaindex < 0 || etaindex >= GetNEtaSegments())
299 //Get the correct histogrampointer:
300 AliL3Histogram *hist = fParamSpace[etaindex];
303 cerr<<"AliL3HoughTransformer::TransformCircle : Error getting histogram in index "<<etaindex<<endl;
307 //Do the transformation:
308 Float_t r = sqrt(xyz[0]*xyz[0] + xyz[1]*xyz[1]);
309 Float_t phi = AliL3Transform::GetPhi(xyz);
312 //Fill the histogram along the phirange
313 for(Int_t b=hist->GetFirstYbin(); b<=hist->GetLastYbin(); b++)
315 Float_t phi0 = hist->GetBinCenterY(b);
316 Float_t kappa = 2*sin(phi - phi0)/r;
317 //hist->Fill(kappa,phi0,(int)rint(log((Float_t)charge)));
318 hist->Fill(kappa,phi0,charge);
319 //hist->Fill(kappa,phi0,1);
323 Int_t bin = hist->FindBin(kappa,phi0);
324 for(Int_t t=0; t<3; t++)
326 Int_t label = digPt[j].fTrackID[t];
329 for(c=0; c<MaxTrack; c++)
330 if(fTrackID[etaindex][bin].fLabel[c] == label || fTrackID[etaindex][bin].fNHits[c] == 0)
332 if(c == MaxTrack-1) cerr<<"AliL3HoughTransformer::TransformCircle : Array reached maximum!! "<<c<<endl;
333 fTrackID[etaindex][bin].fLabel[c] = label;
334 fTrackID[etaindex][bin].fNHits[c]++;
341 //Move the data pointer to the next padrow:
342 AliL3MemHandler::UpdateRowPointer(tempPt);
347 Int_t fRow; // Digit padrow
348 Double_t fR; // Digit radius in local coordinate system
349 Double_t fPhi; // Digit Phi angle in local coordinate system
350 Int_t fCharge; // Digit charge
351 AliL3Digit *fNext; // Next digit
354 struct AliL3EtaContainer {
355 AliL3Digit *fFirst; //First digit
356 AliL3Digit *fLast; //Last digit
359 void AliL3HoughTransformer::TransformCircleC(Int_t *rowrange,Int_t every)
361 //Circle transform, using combinations of every 2 points lying
362 //on different padrows and within the same etaslice.
364 AliL3DigitRowData *tempPt = GetDataPointer();
366 LOG(AliL3Log::kError,"AliL3HoughTransformer::TransformCircleC","Data")
367 <<"No input data "<<ENDLOG;
369 Int_t minrow = AliL3Transform::GetFirstRow(GetPatch());
370 Int_t maxrow = AliL3Transform::GetLastRow(GetPatch());
373 minrow = rowrange[0];
374 maxrow = rowrange[1];
375 if(minrow < AliL3Transform::GetFirstRow(GetPatch()) || minrow >= AliL3Transform::GetLastRow(GetPatch()))
376 minrow = AliL3Transform::GetFirstRow(GetPatch());
377 if(maxrow < AliL3Transform::GetFirstRow(GetPatch()) || maxrow >= AliL3Transform::GetLastRow(GetPatch()))
378 maxrow = AliL3Transform::GetLastRow(GetPatch());
379 if(minrow > maxrow || maxrow==minrow)
381 cerr<<"AliL3HoughTransformer::TransformCircleC : Bad row range "<<minrow<<" "<<maxrow<<endl;
387 minrow = AliL3Transform::GetFirstRow(GetPatch());
388 maxrow = AliL3Transform::GetLastRow(GetPatch());
392 for(Int_t i=AliL3Transform::GetFirstRow(GetPatch()); i<=AliL3Transform::GetLastRow(GetPatch()); i++)
394 counter += tempPt->fNDigit;
395 AliL3MemHandler::UpdateRowPointer(tempPt);
398 Int_t bound = (GetNEtaSegments()+1)*(AliL3Transform::GetNRows(GetPatch())+1);
399 AliL3EtaContainer *etaPt = new AliL3EtaContainer[bound];
400 memset(etaPt,0,bound*sizeof(AliL3EtaContainer));
402 AliL3Digit *digits = new AliL3Digit[counter];
403 cout<<"Allocating "<<counter*sizeof(AliL3Digit)<<" bytes to digitsarray"<<endl;
404 memset(digits,0,counter*sizeof(AliL3Digit));
406 Int_t sector,row,totcharge,pad,time,charge;
407 Double_t r1,r2,phi1,phi2,eta,kappa,phi0;
411 tempPt = GetDataPointer();
413 cout<<"Calculating digits in patch "<<GetPatch()<<endl;
414 for(Int_t i=AliL3Transform::GetFirstRow(GetPatch()); i<=AliL3Transform::GetLastRow(GetPatch()); i++)
416 AliL3DigitData *digPt = tempPt->fDigitData;
417 for(UInt_t di=0; di<tempPt->fNDigit; di++)
419 charge = digPt[di].fCharge;
420 pad = digPt[di].fPad;
421 time = digPt[di].fTime;
422 AliL3Transform::Slice2Sector(GetSlice(),i,sector,row);
423 AliL3Transform::Raw2Local(xyz,sector,row,(Int_t)pad,(Int_t)time);
424 eta = AliL3Transform::GetEta(xyz);
426 digits[counter].fRow = i;
427 digits[counter].fR = sqrt(xyz[0]*xyz[0] + xyz[1]*xyz[1]);
428 digits[counter].fPhi = atan2(xyz[1],xyz[0]);
429 digits[counter].fCharge = charge;
433 Int_t etaindex = GetEtaIndex(eta);
435 Int_t index = (GetNEtaSegments()+1)*(i-AliL3Transform::GetFirstRow(GetPatch())) + etaindex;
437 if(index > 0 && index < bound)
439 if(etaPt[index].fFirst == 0)
440 etaPt[index].fFirst = &digits[counter];
442 (etaPt[index].fLast)->fNext = &digits[counter];
443 etaPt[index].fLast = &digits[counter];
449 GetEtaIndexes(eta,etaindex);
451 index[0] = (GetNEtaSegments()+1)*(i-AliL3Transform::GetFirstRow(GetPatch())) + etaindex[0];
452 index[1] = (GetNEtaSegments()+1)*(i-AliL3Transform::GetFirstRow(GetPatch())) + etaindex[1];
453 if(index[0] == index[1])
455 cerr<<"Same etaindexes "<<index[0]<<" "<<index[1]<<endl;
459 Int_t ind = index[0];
460 if(ind > 0 && ind < bound)
462 if(etaPt[ind].fFirst == 0)
463 etaPt[ind].fFirst = &digits[counter];
465 (etaPt[ind].fLast)->fNext = &digits[counter];
466 etaPt[ind].fLast = &digits[counter];
470 if(ind > 0 && ind < bound)
472 if(etaPt[ind].fFirst == 0)
473 etaPt[ind].fFirst = &digits[counter];
475 (etaPt[ind].fLast)->fNext = &digits[counter];
476 etaPt[ind].fLast = &digits[counter];
482 AliL3MemHandler::UpdateRowPointer(tempPt);
485 cout<<"Doing the combinatorics"<<endl;
487 AliL3Digit *dPt1,*dPt2;
489 for(Int_t e=0; e<GetNEtaSegments(); e++)
491 for(Int_t i=minrow; i<=maxrow; i+=every)
493 Int_t index1 = (GetNEtaSegments()+1)*(i-AliL3Transform::GetFirstRow(GetPatch())) + e;
495 for(dPt1 = (AliL3Digit*)etaPt[index1].fFirst; dPt1 != 0; dPt1 = (AliL3Digit*)dPt1->fNext)
497 for(Int_t j=i+every; j<=maxrow; j+=every)
499 Int_t index2 = (GetNEtaSegments()+1)*(j-AliL3Transform::GetFirstRow(GetPatch())) + e;
501 for(dPt2 = (AliL3Digit*)etaPt[index2].fFirst; dPt2 != 0; dPt2 = (AliL3Digit*)dPt2->fNext)
503 if(dPt1->fRow == dPt2->fRow)
505 cerr<<"same row; indexes "<<index1<<" "<<index2<<endl;
509 //Get the correct histogrampointer:
510 AliL3Histogram *hist = fParamSpace[e];
513 printf("AliL3HoughTransformer::TransformCircleC() : No histogram at index %d\n",i);
522 phi0 = atan( (r2*sin(phi1)-r1*sin(phi2))/(r2*cos(phi1)-r1*cos(phi2)) );
523 kappa = 2*sin(phi2-phi0)/r2;
524 totcharge = dPt1->fCharge + dPt2->fCharge;
525 hist->Fill(kappa,phi0,totcharge);
539 void AliL3HoughTransformer::TransformLine(Int_t *rowrange,Float_t *phirange)
541 //Do a line transform on the data.
544 AliL3DigitRowData *tempPt = GetDataPointer();
547 LOG(AliL3Log::kError,"AliL3HoughTransformer::TransformLine","Data")
548 <<"No input data "<<ENDLOG;
552 Int_t minrow = AliL3Transform::GetFirstRow(GetPatch());
553 Int_t maxrow = AliL3Transform::GetLastRow(GetPatch());
556 minrow = rowrange[0];
557 maxrow = rowrange[1];
558 if(minrow < AliL3Transform::GetFirstRow(GetPatch()) || minrow >= AliL3Transform::GetLastRow(GetPatch()))
559 minrow = AliL3Transform::GetFirstRow(GetPatch());
560 if(maxrow < AliL3Transform::GetFirstRow(GetPatch()) || maxrow >= AliL3Transform::GetLastRow(GetPatch()))
561 maxrow = AliL3Transform::GetLastRow(GetPatch());
562 if(minrow > maxrow || maxrow==minrow)
564 cerr<<"AliL3HoughTransformer::TransformCircleC : Bad row range "<<minrow<<" "<<maxrow<<endl;
569 for(Int_t i=minrow; i<=maxrow; i++)
571 AliL3DigitData *digPt = tempPt->fDigitData;
572 if(i != (Int_t)tempPt->fRow)
574 printf("AliL3HoughTransform::TransformLine : Mismatching padrow numbering\n");
577 for(UInt_t j=0; j<tempPt->fNDigit; j++)
579 UShort_t charge = digPt[j].fCharge;
580 UChar_t pad = digPt[j].fPad;
581 UShort_t time = digPt[j].fTime;
582 if(charge < GetLowerThreshold())
586 AliL3Transform::Slice2Sector(GetSlice(),i,sector,row);
587 AliL3Transform::Raw2Local(xyz,sector,row,(Int_t)pad,(Int_t)time);
591 Float_t phi = AliL3Transform::GetPhi(xyz);
592 if(phi < phirange[0] || phi > phirange[1])
595 Float_t eta = AliL3Transform::GetEta(xyz);
596 Int_t etaindex = GetEtaIndex(eta);//(Int_t)(eta/etaslice);
597 if(etaindex < 0 || etaindex >= GetNEtaSegments())
600 xyz[0] = xyz[0] - AliL3Transform::Row2X(minrow);
602 //Get the correct histogram:
603 AliL3Histogram *hist = fParamSpace[etaindex];
606 printf("AliL3HoughTransformer::TransformLine : Error getting histogram in index %d\n",etaindex);
609 for(Int_t xbin=hist->GetFirstXbin(); xbin<hist->GetLastXbin(); xbin++)
611 Double_t theta = hist->GetBinCenterX(xbin);
612 Double_t rho = xyz[0]*cos(theta) + xyz[1]*sin(theta);
613 hist->Fill(theta,rho,charge);
616 AliL3MemHandler::UpdateRowPointer(tempPt);
622 Int_t fRow; // Digit rowpad
623 Int_t fCharge; // Digit charge
624 Float_t fY; // Y position of the digit in the local coor system
625 AliL3LDigit *fNext; // Next digit
627 struct AliL3LEtaContainer {
628 AliL3LDigit *fFirst; //First digit
629 AliL3LDigit *fLast; //Last digit
631 void AliL3HoughTransformer::TransformLineC(Int_t *rowrange,Float_t *phirange)
633 //Circle transform ??
634 AliL3DigitRowData *tempPt = GetDataPointer();
636 LOG(AliL3Log::kError,"AliL3HoughTransformer::TransformCircleC","Data")
637 <<"No input data "<<ENDLOG;
641 for(Int_t i=AliL3Transform::GetFirstRow(GetPatch()); i<=AliL3Transform::GetLastRow(GetPatch()); i++)
643 counter += tempPt->fNDigit;
644 AliL3MemHandler::UpdateRowPointer(tempPt);
647 Int_t bound = (GetNEtaSegments()+1)*(AliL3Transform::GetNRows(GetPatch())+1);
648 AliL3LEtaContainer *etaPt = new AliL3LEtaContainer[bound];
649 memset(etaPt,0,bound*sizeof(AliL3LEtaContainer));
651 AliL3LDigit *digits = new AliL3LDigit[counter];
652 cout<<"Allocating "<<counter*sizeof(AliL3LDigit)<<" bytes to digitsarray"<<endl;
653 memset(digits,0,counter*sizeof(AliL3LDigit));
659 tempPt = GetDataPointer();
661 cout<<"Calculating digits in patch "<<GetPatch()<<endl;
662 for(Int_t i=AliL3Transform::GetFirstRow(GetPatch()); i<=AliL3Transform::GetLastRow(GetPatch()); i++)
664 AliL3DigitData *digPt = tempPt->fDigitData;
665 for(UInt_t di=0; di<tempPt->fNDigit; di++)
667 Int_t charge = digPt[di].fCharge;
668 Int_t pad = digPt[di].fPad;
669 Int_t time = digPt[di].fTime;
670 AliL3Transform::Slice2Sector(GetSlice(),i,sector,row);
671 AliL3Transform::Raw2Local(xyz,sector,row,(Int_t)pad,(Int_t)time);
672 Double_t eta = AliL3Transform::GetEta(xyz);
674 Float_t phi = atan2(xyz[1],xyz[0]);
675 if(phi < phirange[0] || phi > phirange[1]) continue;
677 digits[counter].fRow = i;
678 digits[counter].fY = xyz[1];
679 digits[counter].fCharge = charge;
681 Int_t etaindex = GetEtaIndex(eta);
682 Int_t index = (GetNEtaSegments()+1)*(i-AliL3Transform::GetFirstRow(GetPatch())) + etaindex;
684 if(index > 0 && index < bound)
686 if(etaPt[index].fFirst == 0)
687 etaPt[index].fFirst = &digits[counter];
689 (etaPt[index].fLast)->fNext = &digits[counter];
690 etaPt[index].fLast = &digits[counter];
694 AliL3MemHandler::UpdateRowPointer(tempPt);
697 cout<<"Doing the combinatorics"<<endl;
699 AliL3LDigit *dPt1,*dPt2;
701 for(Int_t e=0; e<GetNEtaSegments(); e++)
703 for(Int_t i=rowrange[0]; i<=rowrange[1]; i++)
705 Int_t index1 = (GetNEtaSegments()+1)*(i-AliL3Transform::GetFirstRow(GetPatch())) + e;
707 for(dPt1 = (AliL3LDigit*)etaPt[index1].fFirst; dPt1 != 0; dPt1 = (AliL3LDigit*)dPt1->fNext)
709 for(Int_t j=i+1; j<=rowrange[1]; j++)
711 Int_t index2 = (GetNEtaSegments()+1)*(j-AliL3Transform::GetFirstRow(GetPatch())) + e;
713 for(dPt2 = (AliL3LDigit*)etaPt[index2].fFirst; dPt2 != 0; dPt2 = (AliL3LDigit*)dPt2->fNext)
715 if(dPt1->fRow == dPt2->fRow)
717 cerr<<"same row; indexes "<<index1<<" "<<index2<<endl;
721 //Get the correct histogrampointer:
722 AliL3Histogram *hist = fParamSpace[e];
725 printf("AliL3HoughTransformer::TransformCircleC() : No histogram at index %d\n",i);
730 float x1 = AliL3Transform::Row2X(dPt1->fRow) - AliL3Transform::Row2X(rowrange[0]);
731 float x2 = AliL3Transform::Row2X(dPt2->fRow) - AliL3Transform::Row2X(rowrange[0]);
734 float theta = atan2(x2-x1,y1-y2);
735 float rho = x1*cos(theta)+y1*sin(theta);
736 hist->Fill(theta,rho,1);//dPt1->charge+dPt2->charge);
748 Int_t AliL3HoughTransformer::GetTrackID(Int_t etaindex,Double_t kappa,Double_t psi) const
750 // Returns the MC label for a given peak found in the Hough space
753 cerr<<"AliL3HoughTransformer::GetTrackID : Flag switched off"<<endl;
758 if(etaindex < 0 || etaindex > GetNEtaSegments())
760 cerr<<"AliL3HoughTransformer::GetTrackID : Wrong etaindex "<<etaindex<<endl;
763 AliL3Histogram *hist = fParamSpace[etaindex];
764 Int_t bin = hist->FindBin(kappa,psi);
767 for(UInt_t i=0; i<MaxTrack; i++)
769 Int_t nhits=fTrackID[etaindex][bin].fNHits[i];
770 if(nhits == 0) break;
774 label = fTrackID[etaindex][bin].fLabel[i];
780 cout<<"AliL3HoughTransformer::GetTrackID : Compile with do_mc flag!"<<endl;