ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Acts::BoundaryCheck Class Reference

#include <acts/blob/master/Core/include/Acts/Surfaces/BoundaryCheck.hpp>

Public Types

enum  Type
 

Public Member Functions

 BoundaryCheck (bool check)
 Construct either hard cut in both dimensions or no cut at all.
 
 BoundaryCheck (bool checkLocal0, bool checkLocal1, double tolerance0=0, double tolerance1=0)
 
 BoundaryCheck (const ActsSymMatrixD< 2 > &localCovariance, double sigmaMax=1)
 
 operator bool () const
 
bool operator! () const
 
template<typename Vector2DContainer >
bool isInside (const Vector2D &point, const Vector2DContainer &vertices) const
 
bool isInside (const Vector2D &point, const Vector2D &lowerLeft, const Vector2D &upperRight) const
 
template<typename Vector2DContainer >
double distance (const Vector2D &point, const Vector2DContainer &vertices) const
 
double distance (const Vector2D &point, const Vector2D &lowerLeft, const Vector2D &upperRight) const
 
Type type () const
 Broadcast the type.
 
const Vector2Dtolerance () const
 
ActsSymMatrixD< 2 > covariance () const
 

Private Member Functions

BoundaryCheck transformed (const ActsMatrixD< 2, 2 > &jacobian) const
 
bool isTolerated (const Vector2D &delta) const
 Check if the distance vector is within the absolute or relative limits.
 
double squaredNorm (const Vector2D &x) const
 Compute vector norm based on the covariance.
 
template<typename Vector2DContainer >
Vector2D computeClosestPointOnPolygon (const Vector2D &point, const Vector2DContainer &vertices) const
 Calculate the closest point on the polygon.
 
Vector2D computeEuclideanClosestPointOnRectangle (const Vector2D &point, const Vector2D &lowerLeft, const Vector2D &upperRight) const
 Calculate the closest point on the box.
 

Private Attributes

ActsSymMatrixD< 2 > m_weight
 metric weight matrix: identity for absolute mode or inverse covariance
 
Vector2D m_tolerance
 dual use: absolute tolerances or relative chi2/ sigma cut.
 
Type m_type
 

Friends

class CylinderBounds
 
class RectangleBounds
 
class DiscTrapezoidBounds
 
class EllipseBounds
 

Detailed Description

The BoundaryCheck class provides boundary checks and distance calculations for aligned box-like and polygonal boundaries on local surfaces. Different types of boundary checks are supported and are transparently selected when calling the isInside(...) and distance(...) methods:

  • Hard checks w/o any tolerances
  • Tolerance-based checks in one or in both local coordinates
  • Chi2-based checks based on a covariance matrix. Non-vanishing correlations are correctly taken into account.

With a defined covariance matrix, the closest point and the distance are not defined along the usual Euclidean metric, but by the Mahalanobis distance induced by the the covariance.

Definition at line 36 of file BoundaryCheck.hpp.

View newest version in sPHENIX GitHub at line 36 of file BoundaryCheck.hpp

Member Enumeration Documentation

Definition at line 114 of file BoundaryCheck.hpp.

View newest version in sPHENIX GitHub at line 114 of file BoundaryCheck.hpp

Constructor & Destructor Documentation

Acts::BoundaryCheck::BoundaryCheck ( bool  check)
inline

Construct either hard cut in both dimensions or no cut at all.

Definition at line 183 of file BoundaryCheck.hpp.

View newest version in sPHENIX GitHub at line 183 of file BoundaryCheck.hpp

Acts::BoundaryCheck::BoundaryCheck ( bool  checkLocal0,
bool  checkLocal1,
double  tolerance0 = 0,
double  tolerance1 = 0 
)
inline

Construct a tolerance based check.

Parameters
checkLocal0Boolean directive to check coordinate 0
checkLocal1Boolean directive to check coordinate 1
tolerance0Tolerance along coordinate 0
tolerance1Tolerance along coordinate 1

Definition at line 188 of file BoundaryCheck.hpp.

View newest version in sPHENIX GitHub at line 188 of file BoundaryCheck.hpp

Acts::BoundaryCheck::BoundaryCheck ( const ActsSymMatrixD< 2 > &  localCovariance,
double  sigmaMax = 1 
)
inline

Construct a chi2-based check.

Parameters
localCovarianceCoverance matrix in local coordinates
sigmaMaxSignificance for the compatibility test

Definition at line 195 of file BoundaryCheck.hpp.

View newest version in sPHENIX GitHub at line 195 of file BoundaryCheck.hpp

Member Function Documentation

template<typename Vector2DContainer >
Acts::Vector2D Acts::BoundaryCheck::computeClosestPointOnPolygon ( const Vector2D point,
const Vector2DContainer &  vertices 
) const
inlineprivate

Calculate the closest point on the polygon.

Definition at line 318 of file BoundaryCheck.hpp.

View newest version in sPHENIX GitHub at line 318 of file BoundaryCheck.hpp

References field_utils::clamp(), f, n, and Acts::UnitConstants::u.

+ Here is the call graph for this function:

Acts::Vector2D Acts::BoundaryCheck::computeEuclideanClosestPointOnRectangle ( const Vector2D point,
const Vector2D lowerLeft,
const Vector2D upperRight 
) const
inlineprivate

Calculate the closest point on the box.

Definition at line 359 of file BoundaryCheck.hpp.

View newest version in sPHENIX GitHub at line 359 of file BoundaryCheck.hpp

References kdfinder::abs(), and test().

+ Here is the call graph for this function:

Acts::ActsSymMatrixD< 2 > Acts::BoundaryCheck::covariance ( ) const
inline

Definition at line 179 of file BoundaryCheck.hpp.

View newest version in sPHENIX GitHub at line 179 of file BoundaryCheck.hpp

Referenced by Acts::AnnulusBounds::inside().

+ Here is the caller graph for this function:

template<typename Vector2DContainer >
double Acts::BoundaryCheck::distance ( const Vector2D point,
const Vector2DContainer &  vertices 
) const
inline

Calculate the signed, weighted, closest distance to a polygonal boundary.

Parameters
pointTest point
verticesForward iterable container of convex polygon vertices. Calling std::begin/ std::end on the container must return an iterator where *it must be convertible to an Acts::Vector2D.
Returns
Negative value if inside, positive if outside

If a covariance is defined, the distance is the corresponding Mahalanobis distance. Otherwise, it is the Eucleadian distance.

Definition at line 271 of file BoundaryCheck.hpp.

View newest version in sPHENIX GitHub at line 271 of file BoundaryCheck.hpp

References d, and Acts::detail::VerticesHelper::isInsidePolygon().

Referenced by Acts::Test::BOOST_AUTO_TEST_CASE(), Acts::RadialBounds::distanceToBoundary(), Acts::RectangleBounds::distanceToBoundary(), Acts::DiscTrapezoidBounds::distanceToBoundary(), Acts::DiamondBounds::distanceToBoundary(), Acts::ConeBounds::distanceToBoundary(), Acts::CylinderBounds::distanceToBoundary(), Acts::ConvexPolygonBounds< N >::distanceToBoundary(), and Acts::TrapezoidBounds::distanceToBoundary().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

double Acts::BoundaryCheck::distance ( const Vector2D point,
const Vector2D lowerLeft,
const Vector2D upperRight 
) const
inline

Calculate the signed, weighted, closest distance to an aligned box.

Parameters
pointTest point
loc0MinMinimal value along the first local axis
loc0MaxMaximal value along the first local axis
loc1MinMinimal value along the first local axis
loc1MaxMaximal value along the first local axis
Returns
Negative value if inside, positive if outside

If a covariance is defined, the distance is the corresponding Mahalanobis distance. Otherwise, it is the Eucleadian distance.

Definition at line 279 of file BoundaryCheck.hpp.

View newest version in sPHENIX GitHub at line 279 of file BoundaryCheck.hpp

References d, Acts::detail::VerticesHelper::isInsideRectangle(), and norm.

+ Here is the call graph for this function:

template<typename Vector2DContainer >
bool Acts::BoundaryCheck::isInside ( const Vector2D point,
const Vector2DContainer &  vertices 
) const
inline

Check if the point is inside a polygon.

Parameters
pointTest point
verticesForward iterable container of convex polygon vertices. Calling std::begin/ std::end on the container must return an iterator where *it must be convertible to an Acts::Vector2D.

The check takes into account whether tolerances or covariances are defined for the boundary check.

Definition at line 216 of file BoundaryCheck.hpp.

View newest version in sPHENIX GitHub at line 216 of file BoundaryCheck.hpp

References Acts::detail::VerticesHelper::isInsidePolygon().

Referenced by Acts::Test::BOOST_AUTO_TEST_CASE(), Acts::LineBounds::inside(), Acts::RadialBounds::inside(), Acts::RectangleBounds::inside(), Acts::DiscTrapezoidBounds::inside(), Acts::DiamondBounds::inside(), Acts::CylinderBounds::inside(), Acts::ConeBounds::inside(), Acts::ConvexPolygonBounds< N >::inside(), Acts::TrapezoidBounds::inside(), and Acts::CylinderBounds::inside3D().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool Acts::BoundaryCheck::isInside ( const Vector2D point,
const Vector2D lowerLeft,
const Vector2D upperRight 
) const
inline

Check if the point is inside a box aligned with the local axes.

Parameters
pointTest point
loc0MinLower bound along first axis
loc0MaxUpper bound along first axis
loc1MinLower bound along second axis
loc1MaxUpper bound along second axis

The check takes into account whether tolerances or covariances are defined for the boundary check.

Definition at line 244 of file BoundaryCheck.hpp.

View newest version in sPHENIX GitHub at line 244 of file BoundaryCheck.hpp

References Acts::detail::VerticesHelper::isInsideRectangle().

+ Here is the call graph for this function:

bool Acts::BoundaryCheck::isTolerated ( const Vector2D delta) const
inlineprivate

Check if the distance vector is within the absolute or relative limits.

Definition at line 301 of file BoundaryCheck.hpp.

View newest version in sPHENIX GitHub at line 301 of file BoundaryCheck.hpp

References kdfinder::abs().

+ Here is the call graph for this function:

Acts::BoundaryCheck::operator bool ( ) const
inline

Definition at line 56 of file BoundaryCheck.hpp.

View newest version in sPHENIX GitHub at line 56 of file BoundaryCheck.hpp

References m_type.

bool Acts::BoundaryCheck::operator! ( ) const
inline

Definition at line 57 of file BoundaryCheck.hpp.

View newest version in sPHENIX GitHub at line 57 of file BoundaryCheck.hpp

double Acts::BoundaryCheck::squaredNorm ( const Vector2D x) const
inlineprivate

Compute vector norm based on the covariance.

Definition at line 313 of file BoundaryCheck.hpp.

View newest version in sPHENIX GitHub at line 313 of file BoundaryCheck.hpp

References x.

const Acts::Vector2D & Acts::BoundaryCheck::tolerance ( ) const
inline

Definition at line 175 of file BoundaryCheck.hpp.

View newest version in sPHENIX GitHub at line 175 of file BoundaryCheck.hpp

Referenced by Acts::AnnulusBounds::inside(), and Acts::CylinderSurface::intersect().

+ Here is the caller graph for this function:

Acts::BoundaryCheck Acts::BoundaryCheck::transformed ( const ActsMatrixD< 2, 2 > &  jacobian) const
inlineprivate

Return a new BoundaryCheck with updated covariance.

Parameters
jacobianTranform Jacobian for the covariance
Warning
This currently only transforms the covariance and does not work for the tolerance based check.

Definition at line 201 of file BoundaryCheck.hpp.

View newest version in sPHENIX GitHub at line 201 of file BoundaryCheck.hpp

References m_tolerance, and m_weight.

Referenced by Acts::DiscTrapezoidBounds::inside(), Acts::CylinderBounds::inside(), and Acts::CylinderBounds::inside3D().

+ Here is the caller graph for this function:

Acts::BoundaryCheck::Type Acts::BoundaryCheck::type ( ) const
inline

Broadcast the type.

Definition at line 171 of file BoundaryCheck.hpp.

View newest version in sPHENIX GitHub at line 171 of file BoundaryCheck.hpp

References m_type.

Referenced by Acts::AnnulusBounds::inside(), and Acts::CylinderSurface::intersect().

+ Here is the caller graph for this function:

Friends And Related Function Documentation

Definition at line 160 of file BoundaryCheck.hpp.

View newest version in sPHENIX GitHub at line 160 of file BoundaryCheck.hpp

friend class DiscTrapezoidBounds
friend

Definition at line 164 of file BoundaryCheck.hpp.

View newest version in sPHENIX GitHub at line 164 of file BoundaryCheck.hpp

friend class EllipseBounds
friend

Definition at line 166 of file BoundaryCheck.hpp.

View newest version in sPHENIX GitHub at line 166 of file BoundaryCheck.hpp

friend class RectangleBounds
friend

Definition at line 161 of file BoundaryCheck.hpp.

View newest version in sPHENIX GitHub at line 161 of file BoundaryCheck.hpp

Member Data Documentation

Vector2D Acts::BoundaryCheck::m_tolerance
private

dual use: absolute tolerances or relative chi2/ sigma cut.

Definition at line 156 of file BoundaryCheck.hpp.

View newest version in sPHENIX GitHub at line 156 of file BoundaryCheck.hpp

Referenced by Acts::EllipseBounds::inside(), Acts::CylinderBounds::inside3D(), and transformed().

Type Acts::BoundaryCheck::m_type
private

Definition at line 157 of file BoundaryCheck.hpp.

View newest version in sPHENIX GitHub at line 157 of file BoundaryCheck.hpp

Referenced by Acts::CylinderBounds::inside3D(), operator bool(), and type().

ActsSymMatrixD<2> Acts::BoundaryCheck::m_weight
private

metric weight matrix: identity for absolute mode or inverse covariance

Definition at line 153 of file BoundaryCheck.hpp.

View newest version in sPHENIX GitHub at line 153 of file BoundaryCheck.hpp

Referenced by transformed().


The documentation for this class was generated from the following file: