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

#include <Acts/Surfaces/RectangleBounds.hpp>

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

Public Types

enum  BoundValues : int {
  eMinX = 0 , eMinY = 1 , eMaxX = 2 , eMaxY = 3 ,
  eSize = 4
}
 Enumeration for the bound values. More...
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...

Public Member Functions

 RectangleBounds (const std::array< double, eSize > &values) noexcept(false)
 Constructor - from fixed size array - generic.
 RectangleBounds (const Vector2 &min, const Vector2 &max) noexcept(false)
 Constructor - from min/max - generic.
 RectangleBounds (double halfX, double halfY) noexcept(false)
 Constructor with halflength in x and y - symmetric.
const RectangleBoundsboundingBox () const final
 Bounding box parameters.
Vector2 center () const final
 Calculate the center of the surface bounds in local coordinates.
Vector2 closestPoint (const Vector2 &lposition, const SquareMatrix2 &metric) const final
 Calculates the closest point on the bounds to a given local position.
double get (BoundValues bValue) const
 Access to the bound values.
double halfLengthX () const
 Access to the half length in X.
double halfLengthY () const
 Access to the half length in Y.
bool inside (const Vector2 &lposition) const final
 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.
const Vector2max () const
 Get the max vertex defining the bounds.
const Vector2min () const
 Get the min vertex defining the bounds.
std::ostream & toStream (std::ostream &sl) const final
 Output Method for std::ostream.
BoundsType type () const final
 Return the bounds type - for persistency optimization.
std::vector< double > values () const final
 Access method for bound values, this is a dynamically sized vector containing the parameters needed to describe these bounds.
std::vector< Vector2vertices (unsigned int quarterSegments=0u) const final
 Return the vertices.
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.
Public Member Functions inherited from Acts::SurfaceBounds
virtual ~SurfaceBounds ()=default
virtual double distance (const Vector2 &lposition) const
 Calculates the distance to the bounds from a given local position.

Detailed Description

Bounds for a rectangular, planar surface - it can be used to for rectangles that are symmetrically centered around (0./0.) and for generic shifted rectangles

Member Enumeration Documentation

◆ BoundValues

Enumeration for the bound values.

Enumerator
eMinX 
eMinY 
eMaxX 
eMaxY 
eSize 

Constructor & Destructor Documentation

◆ RectangleBounds() [1/3]

Acts::RectangleBounds::RectangleBounds ( double halfX,
double halfY )

Constructor with halflength in x and y - symmetric.

Parameters
halfXhalflength in X
halfYhalflength in Y

◆ RectangleBounds() [2/3]

Acts::RectangleBounds::RectangleBounds ( const std::array< double, eSize > & values)
explicitnoexcept

Constructor - from fixed size array - generic.

Parameters
valuesThe parameter values

◆ RectangleBounds() [3/3]

Acts::RectangleBounds::RectangleBounds ( const Vector2 & min,
const Vector2 & max )

Constructor - from min/max - generic.

Parameters
minThe left bottom corner
maxThe right top corning

Member Function Documentation

◆ boundingBox()

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

Bounding box parameters.

Returns
rectangle bounds for a bounding box

Implements Acts::PlanarBounds.

◆ center()

Vector2 Acts::RectangleBounds::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 RectangleBounds: returns the geometric center (min + max) / 2

Implements Acts::SurfaceBounds.

◆ closestPoint()

Vector2 Acts::RectangleBounds::closestPoint ( const Vector2 & lposition,
const SquareMatrix2 & metric ) const
finalvirtual

Calculates the closest point on the bounds to a given local position.

Parameters
lpositionis the local position
metricto be used for the distance calculation
Returns
the closest point on the bounds

Implements Acts::SurfaceBounds.

◆ get()

double Acts::RectangleBounds::get ( BoundValues bValue) const

Access to the bound values.

Parameters
bValuethe class nested enum for the array access
Returns
The requested bound value

◆ halfLengthX()

double Acts::RectangleBounds::halfLengthX ( ) const

Access to the half length in X.

Returns
Half the width of the rectangle in X direction

◆ halfLengthY()

double Acts::RectangleBounds::halfLengthY ( ) const

Access to the half length in Y.

Returns
Half the width of the rectangle in Y direction

◆ inside() [1/2]

bool Acts::RectangleBounds::inside ( const Vector2 & lposition) const
finalvirtual

Inside check for the bounds object.

Parameters
lpositionis the local position
Returns
true if the local position is inside the bounds

Implements Acts::SurfaceBounds.

◆ inside() [2/2]

virtual bool Acts::SurfaceBounds::inside ( const Vector2 & lposition,
const BoundaryTolerance & boundaryTolerance ) const
virtual

Inside check for the bounds object given a boundary tolerance.

Parameters
lpositionis the local position
boundaryToleranceis the boundary tolerance object
Returns
true if the local position is inside the bounds and tolerance

Reimplemented from Acts::SurfaceBounds.

◆ max()

const Vector2 & Acts::RectangleBounds::max ( ) const

Get the max vertex defining the bounds.

Returns
The max vertex

◆ min()

const Vector2 & Acts::RectangleBounds::min ( ) const

Get the min vertex defining the bounds.

Returns
The min vertex

◆ toStream()

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

Output Method for std::ostream.

Parameters
slis the ostream for the dump
Returns
Reference to the output stream after writing

Implements Acts::SurfaceBounds.

◆ type()

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

Return the bounds type - for persistency optimization.

Returns
the bounds type

Implements Acts::SurfaceBounds.

◆ values()

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

Access method for bound values, this is a dynamically sized vector containing the parameters needed to describe these bounds.

Returns
of the stored values for this SurfaceBounds object

Implements Acts::SurfaceBounds.

◆ vertices()

std::vector< Vector2 > Acts::RectangleBounds::vertices ( unsigned int quarterSegments = 0u) const
finalvirtual

Return the vertices.

Parameters
quarterSegmentsis the number of segments used to describe curved segments in a quarter of the phi range.
Note
the number of segments is ignored in this representation
Returns
vector for vertices in 2D

Implements Acts::PlanarBounds.