ACTS
Experiment-independent tracking
Loading...
Searching...
No Matches
Acts::ConvexPolygonBoundsBase Class Reference

base class for convex polygon bounds More...

#include <Acts/Surfaces/ConvexPolygonBounds.hpp>

Inheritance diagram for Acts::ConvexPolygonBoundsBase:
[legend]
Collaboration diagram for Acts::ConvexPolygonBoundsBase:
[legend]

Public Member Functions

const RectangleBoundsboundingBox () const final
 Return a rectangle bounds object that encloses this polygon.
Vector2 center () const final
 Calculate the center of the surface bounds in local coordinates.
std::ostream & toStream (std::ostream &sl) const final
 Output Method for std::ostream.
BoundsType type () const final
 Return the bounds type of this bounds object.
std::vector< double > values () const final
 Return the bound values as dynamically sized vector.
Public Member Functions inherited from Acts::PlanarBounds
SquareMatrix2 boundToCartesianJacobian (const Vector2 &lposition) const final
 Computes the bound to cartesian jacobian at a given local position.
SquareMatrix2 boundToCartesianMetric (const Vector2 &lposition) const final
 Computes the bound to cartesian metric at a given local position.
bool isCartesian () const final
 Check if the bound coordinates are cartesian.
virtual std::vector< Vector2vertices (unsigned int quarterSegments=2u) const =0
 Return the vertices.
Public Member Functions inherited from Acts::SurfaceBounds
virtual ~SurfaceBounds ()=default
virtual Vector2 closestPoint (const Vector2 &lposition, const SquareMatrix2 &metric) const =0
 Calculates the closest point on the bounds to a given local position.
virtual double distance (const Vector2 &lposition) const
 Calculates the distance to the bounds from a given local position.
virtual bool inside (const Vector2 &lposition) const =0
 Inside check for the bounds object.
virtual bool inside (const Vector2 &lposition, const BoundaryTolerance &boundaryTolerance) const
 Inside check for the bounds object given a boundary tolerance.

Protected Member Functions

void calculateCenter (std::span< const Vector2 > vertices)
 Calculate and cache the center point from vertices.
void makeBoundingBox (std::span< const Vector2 > vertices)
 Creates a rectangle bounds instance that encloses a set of vertices.

Static Protected Member Functions

static void checkConsistency (std::span< const Vector2 > vertices) noexcept(false)
 Return whether this bounds class is in fact convex thorws a logic error if not.
template<typename coll_t>
requires std::same_as<typename coll_t::value_type, Acts::Vector2>
static void convex_impl (const coll_t &vertices) noexcept(false)
 Calculates whether a set of vertices forms a convex polygon.

Additional Inherited Members

Public Types inherited from Acts::SurfaceBounds
enum  BoundsType : int {
  eCone = 0 , eCylinder = 1 , eDiamond = 2 , eDisc = 3 ,
  eEllipse = 4 , eLine = 5 , eRectangle = 6 , eTrapezoid = 7 ,
  eTriangle = 8 , eDiscTrapezoid = 9 , eConvexPolygon = 10 , eAnnulus = 11 ,
  eBoundless = 12 , eOther = 13
}
 This is nested to the SurfaceBounds, as also VolumeBounds will have Bounds Type. More...

Detailed Description

base class for convex polygon bounds

This class serves as a base class for the actual bounds class. The only deriving type is the templated ConvexPolygonBounds.

Member Function Documentation

◆ boundingBox()

const RectangleBounds & Acts::ConvexPolygonBoundsBase::boundingBox ( ) const
finalvirtual

Return a rectangle bounds object that encloses this polygon.

Returns
The rectangular bounds

Implements Acts::PlanarBounds.

◆ calculateCenter()

void Acts::ConvexPolygonBoundsBase::calculateCenter ( std::span< const Vector2 > vertices)
protected

Calculate and cache the center point from vertices.

Parameters
verticesThe vertices to calculate center from

◆ center()

Vector2 Acts::ConvexPolygonBoundsBase::center ( ) const
finalvirtual

Calculate the center of the surface bounds in local coordinates.

This method returns a representative center point of the bounds region. The exact definition varies by bounds type and coordinate system:

Cartesian bounds (Rectangle, Diamond, Trapezoid):

  • Returns the geometric center or center of symmetry
  • For symmetric shapes: center of bounding box or origin (0,0)

Polar/Cylindrical bounds (Radial, Cylinder, Cone):

  • Returns (r, phi) where r is average radius, phi is average angle
  • Coordinates are in the bounds' natural coordinate system

Complex bounds (Annulus, ConvexPolygon):

  • Annulus: Pre-calculated from corner vertices (accounts for coordinate transforms)
  • Polygon: Average of all vertices (vertex centroid, not area centroid)

Infinite bounds: Returns conceptual center at (0,0)

Note
The returned point is guaranteed to be a reasonable representative center, but may not be the true geometric centroid for all shapes.
Returns
Vector2 representing the center position in local coordinates
Note
For ConvexPolygonBounds: returns average of all vertices (vertex centroid)

Implements Acts::SurfaceBounds.

◆ checkConsistency()

void Acts::ConvexPolygonBoundsBase::checkConsistency ( std::span< const Vector2 > vertices)
staticprotectednoexcept

Return whether this bounds class is in fact convex thorws a logic error if not.

Parameters
verticesThe vertices to check for consistency

◆ convex_impl()

template<typename coll_t>
requires std::same_as<typename coll_t::value_type, Acts::Vector2>
void Acts::ConvexPolygonBoundsBase::convex_impl ( const coll_t & vertices)
staticprotected

Calculates whether a set of vertices forms a convex polygon.

This is generic over the number of vertices, so it's factored out of the concrete classes and into this base class.

Parameters
verticesA collection of vertices. throws a logic error if this is not the case

◆ makeBoundingBox()

void Acts::ConvexPolygonBoundsBase::makeBoundingBox ( std::span< const Vector2 > vertices)
protected

Creates a rectangle bounds instance that encloses a set of vertices.

Parameters
verticesA collection of vertices to enclose.

◆ toStream()

std::ostream & Acts::ConvexPolygonBoundsBase::toStream ( std::ostream & sl) const
finalvirtual

Output Method for std::ostream.

Parameters
slis the ostream to be written into
Returns
Reference to the output stream after writing

Implements Acts::SurfaceBounds.

◆ type()

BoundsType Acts::ConvexPolygonBoundsBase::type ( ) const
finalvirtual

Return the bounds type of this bounds object.

Returns
The bounds type

Implements Acts::SurfaceBounds.

◆ values()

std::vector< double > Acts::ConvexPolygonBoundsBase::values ( ) const
finalvirtual

Return the bound values as dynamically sized vector.

Returns
this returns a copy of the internal values

Implements Acts::SurfaceBounds.