Skip to content
Snippets Groups Projects
Commit 9536f35b authored by Tim Martin's avatar Tim Martin
Browse files

Revert "Merge branch 'TrkSurfaceOptimisation' into '21.1'"

This reverts commit aa5fed68 [formerly 32a5a7f8934e1d99834cf295dad9b50bf445b6a7], reversing
changes made to a0d90e4a [formerly 1888a6f1424c63e186731715a77e46192b99b3d2].


Former-commit-id: f5dbbc024a73b2e85125732361d16386f6a91d9a
parent 9f0d5432
No related branches found
No related tags found
No related merge requests found
......@@ -229,13 +229,16 @@ bool Trk::PlaneSurface::isOnSurface(const Amg::Vector3D& glopo,
/** distance to surface */
Trk::DistanceSolution Trk::PlaneSurface::straightLineDistanceEstimate(const Amg::Vector3D& pos,const Amg::Vector3D& dir) const
{
static const double tol = 0.001;
double tol = 0.001;
const Amg::Vector3D& C = center();
const Amg::Vector3D& N = normal();
const double d = (pos - center()).dot(N);
double S = C.dot(N);
double b = S < 0. ? -1 : 1 ;
double d = (pos-C).dot(N); // distance to surface
const double A = dir.dot(N);//ignore sign
double A = b*dir.dot(N);
if(A==0.) { // direction parallel to surface
if ( fabs(d)<tol ) {
return Trk::DistanceSolution(1,0.,true,0.);
......@@ -244,7 +247,7 @@ Trk::DistanceSolution Trk::PlaneSurface::straightLineDistanceEstimate(const Amg:
}
}
return Trk::DistanceSolution(1,d,true,-d/A);
return Trk::DistanceSolution(1,d,true,b*( S - ( pos.dot(N) ) )/A );
}
Trk::DistanceSolution Trk::PlaneSurface::straightLineDistanceEstimate(const Amg::Vector3D& pos,const Amg::Vector3D& dir,bool bound) const
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment