diff --git a/Core/include/Acts/Surfaces/AnnulusBounds.hpp b/Core/include/Acts/Surfaces/AnnulusBounds.hpp index 283bed583ae..5693dc9d8c1 100644 --- a/Core/include/Acts/Surfaces/AnnulusBounds.hpp +++ b/Core/include/Acts/Surfaces/AnnulusBounds.hpp @@ -187,17 +187,6 @@ class AnnulusBounds : public DiscBounds { /// if consistency is not given void checkConsistency() noexcept(false); - /// Inside check for the bounds object driven by the boundary check directive - /// Each Bounds has a method inside, which checks if a LocalPosition is inside - /// the bounds Inside can be called without/with tolerances. - /// - /// @param lposition Local position (assumed to be in right surface frame) - /// @param tolR tolerance on the radius - /// @param tolPhi tolerance on the polar angle phi - /// @return boolean indicator for the success of this operation - virtual bool inside(const Vector2& lposition, double tolR, - double tolPhi) const final; - /// Transform the strip cartesian /// into the module polar system /// diff --git a/Core/include/Acts/Surfaces/ConeBounds.hpp b/Core/include/Acts/Surfaces/ConeBounds.hpp index c6d258a5266..4ab780265da 100644 --- a/Core/include/Acts/Surfaces/ConeBounds.hpp +++ b/Core/include/Acts/Surfaces/ConeBounds.hpp @@ -94,7 +94,7 @@ class ConeBounds : public SurfaceBounds { /// @copydoc SurfaceBounds::inside bool inside(const Vector2& lposition) const final; - /// @copydoc SurfaceBounds::inside + /// @copydoc SurfaceBounds::closestPoint Vector2 closestPoint(const Vector2& lposition, const std::optional& metric) const final; diff --git a/Core/src/Surfaces/AnnulusBounds.cpp b/Core/src/Surfaces/AnnulusBounds.cpp index c2d8f75700e..fde3bef837a 100644 --- a/Core/src/Surfaces/AnnulusBounds.cpp +++ b/Core/src/Surfaces/AnnulusBounds.cpp @@ -192,7 +192,26 @@ SquareMatrix2 AnnulusBounds::boundToCartesianMetric( } bool AnnulusBounds::inside(const Vector2& lposition) const { - return inside(lposition, 0., 0.); + // locpo is PC in STRIP SYSTEM + // need to perform internal rotation induced by average phi + Vector2 locpo_rotated = m_rotationStripPC * lposition; + double phiLoc = locpo_rotated[1]; + double rLoc = locpo_rotated[0]; + + if (phiLoc < get(eMinPhiRel) || phiLoc > get(eMaxPhiRel)) { + return false; + } + + // calculate R in MODULE SYSTEM to evaluate R-bounds + // don't need R, can use R^2 + double r_mod2 = m_shiftPC[0] * m_shiftPC[0] + rLoc * rLoc + + 2 * m_shiftPC[0] * rLoc * cos(phiLoc - m_shiftPC[1]); + + if (r_mod2 < get(eMinR) * get(eMinR) || r_mod2 > get(eMaxR) * get(eMaxR)) { + return false; + } + + return true; } Vector2 AnnulusBounds::closestPoint( @@ -335,41 +354,6 @@ Vector2 AnnulusBounds::closestPoint( return currentClosest; } -bool AnnulusBounds::inside(const Vector2& lposition, double tolR, - double tolPhi) const { - // locpo is PC in STRIP SYSTEM - // need to perform internal rotation induced by average phi - Vector2 locpo_rotated = m_rotationStripPC * lposition; - double phiLoc = locpo_rotated[1]; - double rLoc = locpo_rotated[0]; - - if (phiLoc < (get(eMinPhiRel) - tolPhi) || - phiLoc > (get(eMaxPhiRel) + tolPhi)) { - return false; - } - - // calculate R in MODULE SYSTEM to evaluate R-bounds - if (tolR == 0.) { - // don't need R, can use R^2 - double r_mod2 = m_shiftPC[0] * m_shiftPC[0] + rLoc * rLoc + - 2 * m_shiftPC[0] * rLoc * cos(phiLoc - m_shiftPC[1]); - - if (r_mod2 < get(eMinR) * get(eMinR) || r_mod2 > get(eMaxR) * get(eMaxR)) { - return false; - } - } else { - // use R - double r_mod = sqrt(m_shiftPC[0] * m_shiftPC[0] + rLoc * rLoc + - 2 * m_shiftPC[0] * rLoc * cos(phiLoc - m_shiftPC[1])); - - if (r_mod < (get(eMinR) - tolR) || r_mod > (get(eMaxR) + tolR)) { - return false; - } - } - - return true; -} - Vector2 AnnulusBounds::stripXYToModulePC(const Vector2& vStripXY) const { Vector2 vecModuleXY = vStripXY + m_shiftXY; return {vecModuleXY.norm(), VectorHelpers::phi(vecModuleXY)};