Class BoundaryCheck

Class Documentation

class Acts::BoundaryCheck

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.

Public Types

enum Type

Values:

enumerator eNone

disable boundary check

enumerator eAbsolute

absolute cut

enumerator eChi2

chi2-based cut with full correlations

Public 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)

Construct a tolerance based check.

Parameters
  • checkLocal0: Boolean directive to check coordinate 0

  • checkLocal1: Boolean directive to check coordinate 1

  • tolerance0: Tolerance along coordinate 0

  • tolerance1: Tolerance along coordinate 1

BoundaryCheck(const SymMatrix2 &localCovariance, double sigmaMax = 1)

Construct a chi2-based check.

Parameters
  • localCovariance: Coverance matrix in local coordinates

  • sigmaMax: Significance for the compatibility test

template<typename Vector2Container>
Acts::Vector2 computeClosestPointOnPolygon(const Acts::Vector2 &point, const Vector2Container &vertices) const
SymMatrix2 covariance() const
template<typename Vector2Container>
double distance(const Vector2 &point, const Vector2Container &vertices) const

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

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

Return

Negative value if inside, positive if outside

Parameters
  • point: Test point

  • vertices: Forward 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::Vector2.

double distance(const Vector2 &point, const Vector2 &lowerLeft, const Vector2 &upperRight) const

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

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

Return

Negative value if inside, positive if outside

Parameters
  • point: Test point

  • loc0Min: Minimal value along the first local axis

  • loc0Max: Maximal value along the first local axis

  • loc1Min: Minimal value along the first local axis

  • loc1Max: Maximal value along the first local axis

template<typename Vector2Container>
bool isInside(const Vector2 &point, const Vector2Container &vertices) const

Check if the point is inside a polygon.

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

Parameters
  • point: Test point

  • vertices: Forward 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::Vector2.

bool isInside(const Vector2 &point, const Vector2 &lowerLeft, const Vector2 &upperRight) const

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

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

Parameters
  • point: Test point

  • loc0Min: Lower bound along first axis

  • loc0Max: Upper bound along first axis

  • loc1Min: Lower bound along second axis

  • loc1Max: Upper bound along second axis

operator bool() const
bool operator!() const
const Vector2 &tolerance() const
Type type() const

Broadcast the type.