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

Bounds for a trapezoidal, planar Surface. More...

#include <Acts/Surfaces/TrapezoidBounds.hpp>

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

Public Types

enum  BoundValues {
  eHalfLengthXnegY = 0 , eHalfLengthXposY = 1 , eHalfLengthY = 2 , eRotationAngle = 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

 TrapezoidBounds (const std::array< double, eSize > &values) noexcept(false)
 Constructor for symmetric Trapezoid - from fixed size array.
 TrapezoidBounds (double halfXnegY, double halfXposY, double halfY, double rotAngle=0.) noexcept(false)
 Constructor for symmetric Trapezoid.
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.
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.
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 ignoredSegments=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 trapezoidal, planar Surface.

Todo
can be speed optimized by calculating kappa/delta and caching it

Member Enumeration Documentation

◆ BoundValues

Enumeration for the bound values.

Enumerator
eHalfLengthXnegY 
eHalfLengthXposY 
eHalfLengthY 
eRotationAngle 
eSize 

Constructor & Destructor Documentation

◆ TrapezoidBounds() [1/2]

Acts::TrapezoidBounds::TrapezoidBounds ( double halfXnegY,
double halfXposY,
double halfY,
double rotAngle = 0. )
explicit

Constructor for symmetric Trapezoid.

Parameters
halfXnegYminimal half length X, definition at negative Y
halfXposYmaximal half length X, definition at positive Y
halfYhalf length Y - defined at x=0
rotAnglerotation angle of the bounds w.r.t coordinate axes

◆ TrapezoidBounds() [2/2]

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

Constructor for symmetric Trapezoid - from fixed size array.

Parameters
valuesthe values to be stream in

Member Function Documentation

◆ boundingBox()

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

Bounding box parameters.

Returns
rectangle bounds for a bounding box

Implements Acts::PlanarBounds.

◆ center()

Vector2 Acts::TrapezoidBounds::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 TrapezoidBounds: returns center of symmetry (0,0), accounting for rotation

Implements Acts::SurfaceBounds.

◆ closestPoint()

Vector2 Acts::TrapezoidBounds::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::TrapezoidBounds::get ( BoundValues bValue) const

Access to the bound values.

Parameters
bValuethe class nested enum for the array access
Returns
The bound value at the specified index

◆ inside() [1/2]

bool Acts::TrapezoidBounds::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

The orientation of the Trapezoid is according to the figure above, in words: the shorter of the two parallel sides of the trapezoid intersects with the negative \( y \) - axis of the local frame.


The cases are:
(0) \( y \) or \( x \) bounds are 0 || 0
(1) the local position is outside \( y \) bounds
(2) the local position is inside \( y \) bounds, but outside maximum \(x \) bounds
(3) the local position is inside \( y \) bounds AND inside minimum \( x \) bounds
(4) the local position is inside \( y \) bounds AND inside maximum \( x \) bounds, so that it depends on the \( eta \) coordinate (5) the local position fails test of (4)

The inside check is done using single equations of straight lines and one has to take care if a point lies on the positive \( x \) half area(I) or the negative one(II). Denoting \( |x_{min}| \) and \( | x_{max} | \) as minHalfX respectively maxHalfX, such as \( | y_{H} | \) as halfY, the equations for the straing lines in (I) and (II) can be written as:

  • (I): \( y = \kappa_{I} x + \delta_{I} \)
  • (II): \( y = \kappa_{II} x + \delta_{II} \) ,

    where \( \kappa_{I} = - \kappa_{II} = 2 \frac{y_{H}}{x_{max} - x_{min}} \)
    and \( \delta_{I} = \delta_{II} = - \frac{1}{2}\kappa_{I}(x_{max} + x_{min}) \)

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.

◆ toStream()

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

Output Method for std::ostream.

Parameters
slis the ostream to be dumped into
Returns
Modified ostream for chaining

Implements Acts::SurfaceBounds.

◆ type()

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

Return the bounds type - for persistency optimization.

Returns
the bounds type

Implements Acts::SurfaceBounds.

◆ values()

std::vector< double > Acts::TrapezoidBounds::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::TrapezoidBounds::vertices ( unsigned int ignoredSegments = 0u) const
finalvirtual

Return the vertices.

Parameters
ignoredSegmentsis and ignored parameter used to describe the number of segments to approximate curved sectors.
Note
the number of segments is ignored in this representation
Returns
vector for vertices in 2D

Implements Acts::PlanarBounds.