Class BoundaryCheck¶
Defined in File BoundaryCheck.hpp
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(...)
anddistance(...)
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
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 0checkLocal1
: Boolean directive to check coordinate 1tolerance0
: Tolerance along coordinate 0tolerance1
: Tolerance along coordinate 1
-
BoundaryCheck
(const SymMatrix2D &localCovariance, double sigmaMax = 1)¶ Construct a chi2-based check.
- Parameters
localCovariance
: Coverance matrix in local coordinatessigmaMax
: Significance for the compatibility test
-
template<typename
Vector2DContainer
>
Acts::Vector2DcomputeClosestPointOnPolygon
(const Acts::Vector2D &point, const Vector2DContainer &vertices) const¶
-
SymMatrix2D
covariance
() const¶
-
template<typename
Vector2DContainer
>
doubledistance
(const Vector2D &point, const Vector2DContainer &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 pointvertices
: Forward iterable container of convex polygon vertices. Callingstd::begin
/std::end
on the container must return an iterator where*it
must be convertible to anActs::Vector2D
.
-
double
distance
(const Vector2D &point, const Vector2D &lowerLeft, const Vector2D &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 pointloc0Min
: Minimal value along the first local axisloc0Max
: Maximal value along the first local axisloc1Min
: Minimal value along the first local axisloc1Max
: Maximal value along the first local axis
-
template<typename
Vector2DContainer
>
boolisInside
(const Vector2D &point, const Vector2DContainer &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 pointvertices
: Forward iterable container of convex polygon vertices. Callingstd::begin
/std::end
on the container must return an iterator where*it
must be convertible to anActs::Vector2D
.
-
bool
isInside
(const Vector2D &point, const Vector2D &lowerLeft, const Vector2D &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 pointloc0Min
: Lower bound along first axisloc0Max
: Upper bound along first axisloc1Min
: Lower bound along second axisloc1Max
: Upper bound along second axis
-
operator bool
() const¶
-
bool
operator!
() const¶