-
-Bool_t AliL3HoughTrack::GetCrossingPoint(Int_t slice,Int_t padrow,Float_t *xyz)
-{
- //Calculate the crossing point in transverse plane of this track and given
- //padrow (y = a*x + b). Point is given in local coordinates in slice.
- //Assumes the track is given in global coordinates.
-
- if(!fIsHelix)
- {
- printf("AliL3HoughTrack::GetCrossingPoint : Track is not a helix\n");
- return 0;
- }
-
-
- if(IsLocal())
- {
- printf("GetCrossingPoint: Track is given in local coordintes!!!\n");
- return false;
- }
-
- Double_t padrowradii = fTransform->Row2X(padrow);
-
-
- Float_t rotation_angle = (slice*20)*ToRad;
-
- Float_t cs,sn;
- cs = cos(rotation_angle);
- sn = sin(rotation_angle);
-
- Double_t a = -1.*cs/sn;
- Double_t b = padrowradii/sn;
-
- Double_t ycPrime = GetCenterY() - b ;
- Double_t aa = ( 1. + a * a ) ;
- Double_t bb = -2. * ( GetCenterX() + a * ycPrime ) ;
- Double_t cc = ( GetCenterX() * GetCenterX() + ycPrime * ycPrime - GetRadius() * GetRadius() ) ;
-
- Double_t racine = bb * bb - 4. * aa * cc ;
- if ( racine < 0 ) return false ;
- Double_t rootRacine = sqrt(racine) ;
-
- Double_t oneOverA = 1./aa;
-//
-// First solution
-//
- Double_t x1 = 0.5 * oneOverA * ( -1. * bb + rootRacine ) ;
- Double_t y1 = a * x1 + b ;
- Double_t r1 = sqrt(x1*x1+y1*y1);
-//
-// Second solution
-//
- Double_t x2 = 0.5 * oneOverA * ( -1. * bb - rootRacine ) ;
- Double_t y2 = a * x2 + b ;
- Double_t r2 = sqrt(x2*x2+y2*y2);
-//
-// Choose close to (0,0)
-//
- Double_t xHit ;
- Double_t yHit ;
- if ( r1 < r2 ) {
- xHit = x1 ;
- yHit = y1 ;
- }
- else {
- xHit = x2 ;
- yHit = y2 ;
- }
-
- xyz[0] = xHit;
- xyz[1] = yHit;
- xyz[2] = 0;
-
- fTransform->Global2Local(xyz,slice);
-
- return true;
-}
-*/