Commit 41925768 authored by Andrei Gheata's avatar Andrei Gheata
Browse files

Fix for on surface and moving out condition for grazing rays on sphere.

parent 6ded99f6
......@@ -17,12 +17,14 @@ inline namespace VECGEOM_IMPL_NAMESPACE {
#ifdef VECGEOM_FLOAT_PRECISION
using Precision = float;
VECGEOM_CONST Precision kTolerance = 1e-3;
VECGEOM_CONST Precision kSqrtTolerance = 3.1622777e-2;
VECGEOM_CONST Precision kAngTolerance = 1e-2;
VECGEOM_CONST Precision kConeTolerance = 1e-3;
VECGEOM_CONST Precision kFarAway = 1e5;
#else
using Precision = double;
VECGEOM_CONST Precision kTolerance = 1e-9;
VECGEOM_CONST Precision kSqrtTolerance = 3.1622777e-5;
VECGEOM_CONST Precision kAngTolerance = 1e-9;
VECGEOM_CONST Precision kConeTolerance = 1e-7;
VECGEOM_CONST Precision kFarAway = 1e10;
......
......@@ -146,18 +146,18 @@ typename vecCore::Mask_v<Real_v> IsPointOnRadialSurfaceAndMovingOut(UnplacedStru
Vector3D<Real_v> const &point,
Vector3D<Real_v> const &dir)
{
// Rays from rmax+tolerance or rmin-tolerance can be moving out even if not going fully "backward"
if (MovingOut) {
if (ForInnerRadius) {
return IsPointOnInnerRadius<Real_v>(unplaced, point) && (dir.Dot(-point) > Real_v(0.));
return IsPointOnInnerRadius<Real_v>(unplaced, point) && (dir.Dot(-point) > Real_v(kSqrtTolerance));
} else {
return IsPointOnOuterRadius<Real_v>(unplaced, point) && (dir.Dot(point) > Real_v(0.));
return IsPointOnOuterRadius<Real_v>(unplaced, point) && (dir.Dot(point) > Real_v(kSqrtTolerance));
}
} else {
if (ForInnerRadius) {
return IsPointOnInnerRadius<Real_v>(unplaced, point) && (dir.Dot(-point) < Real_v(0.));
return IsPointOnInnerRadius<Real_v>(unplaced, point) && (dir.Dot(-point) < Real_v(-kSqrtTolerance));
} else
return IsPointOnOuterRadius<Real_v>(unplaced, point) && (dir.Dot(point) < Real_v(0.));
return IsPointOnOuterRadius<Real_v>(unplaced, point) && (dir.Dot(point) < Real_v(-kSqrtTolerance));
}
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment