EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Acts::ConvexPolygonBounds< N > Class Template Reference

#include <acts/blob/sPHENIX/Core/include/Acts/Surfaces/ConvexPolygonBounds.hpp>

+ Inheritance diagram for Acts::ConvexPolygonBounds< N >:
+ Collaboration diagram for Acts::ConvexPolygonBounds< N >:

Public Types

using vertex_array = std::array< Vector2D, num_vertices >
 
using value_array = std::array< double, eSize >
 

Public Member Functions

 ConvexPolygonBounds ()=delete
 
 ConvexPolygonBounds (const std::vector< Vector2D > &vertices) noexcept(false)
 
 ConvexPolygonBounds (const vertex_array &vertices) noexcept(false)
 
 ConvexPolygonBounds (const value_array &values) noexcept(false)
 
 ~ConvexPolygonBounds () override=default
 
BoundsType type () const final
 
bool inside (const Vector2D &lposition, const BoundaryCheck &bcheck) const final
 
std::vector< Vector2Dvertices (unsigned int lseg=1) const final
 
const RectangleBoundsboundingBox () const final
 
- Public Member Functions inherited from Acts::ConvexPolygonBoundsBase
std::ostream & toStream (std::ostream &sl) const final
 
std::vector< double > values () const final
 

Static Public Attributes

static constexpr size_t num_vertices = N
 
static constexpr size_t eSize = 2 * N
 

Private Member Functions

void checkConsistency () const noexcept(false)
 

Private Attributes

vertex_array m_vertices
 
RectangleBounds m_boundingBox
 

Additional Inherited Members

- Static Protected Member Functions inherited from Acts::ConvexPolygonBoundsBase
template<typename coll_t >
static RectangleBounds makeBoundingBox (const coll_t &vertices)
 
template<typename coll_t >
static void convex_impl (const coll_t &vertices) noexcept(false)
 

Detailed Description

template<int N>
class Acts::ConvexPolygonBounds< N >

This is the actual implementation of the bounds. It is templated on the number of vertices, but there is a specialization for dynamic number of vertices, where the underlying storage is then a vector.

Template Parameters
NNumber of vertices

Definition at line 60 of file ConvexPolygonBounds.hpp.

View newest version in sPHENIX GitHub at line 60 of file ConvexPolygonBounds.hpp

Member Typedef Documentation

template<int N>
using Acts::ConvexPolygonBounds< N >::value_array = std::array<double, eSize>

Type that's used to store the vertices, in this case a fixed size array.

Definition at line 73 of file ConvexPolygonBounds.hpp.

View newest version in sPHENIX GitHub at line 73 of file ConvexPolygonBounds.hpp

template<int N>
using Acts::ConvexPolygonBounds< N >::vertex_array = std::array<Vector2D, num_vertices>

Type that's used to store the vertices, in this case a fixed size array.

Definition at line 67 of file ConvexPolygonBounds.hpp.

View newest version in sPHENIX GitHub at line 67 of file ConvexPolygonBounds.hpp

Constructor & Destructor Documentation

template<int N>
Acts::ConvexPolygonBounds< N >::ConvexPolygonBounds ( )
delete
template<int N>
Acts::ConvexPolygonBounds< N >::ConvexPolygonBounds ( const std::vector< Vector2D > &  vertices)
noexcept

Constructor from a vector of vertices, to facilitate construction. This will throw if the vector size does not match num_vertices. This will throw if the vertices do not form a convex polygon.

Parameters
verticesThe list of vertices.

Definition at line 67 of file ConvexPolygonBounds.ipp.

View newest version in sPHENIX GitHub at line 67 of file ConvexPolygonBounds.ipp

References charm_jet_strange_helicity::N, and throw_assert.

template<int N>
Acts::ConvexPolygonBounds< N >::ConvexPolygonBounds ( const vertex_array vertices)
noexcept

Constructor from a fixed size array of vertices. This will throw if the vertices do not form a convex polygon.

Parameters
verticesThe vertices

Definition at line 79 of file ConvexPolygonBounds.ipp.

View newest version in sPHENIX GitHub at line 79 of file ConvexPolygonBounds.ipp

template<int N>
Acts::ConvexPolygonBounds< N >::ConvexPolygonBounds ( const value_array values)
noexcept

Constructor from a fixed size array of parameters This will throw if the vertices do not form a convex polygon.

Parameters
valuesThe values to build up the vertices

Definition at line 86 of file ConvexPolygonBounds.ipp.

View newest version in sPHENIX GitHub at line 86 of file ConvexPolygonBounds.ipp

References charm_jet_strange_helicity::N, and Acts::Test::values.

template<int N>
Acts::ConvexPolygonBounds< N >::~ConvexPolygonBounds ( )
overridedefault

Member Function Documentation

template<int N>
const Acts::RectangleBounds & Acts::ConvexPolygonBounds< N >::boundingBox ( ) const
finalvirtual

Return a rectangle bounds object that encloses this polygon.

Returns
The rectangular bounds

Implements Acts::PlanarBounds.

Definition at line 114 of file ConvexPolygonBounds.ipp.

View newest version in sPHENIX GitHub at line 114 of file ConvexPolygonBounds.ipp

Referenced by Acts::Test::BOOST_AUTO_TEST_CASE().

+ Here is the caller graph for this function:

template<int N>
void Acts::ConvexPolygonBounds< N >::checkConsistency ( ) const
privatenoexcept

Return whether this bounds class is in fact convex throws a log error if not

Definition at line 119 of file ConvexPolygonBounds.ipp.

View newest version in sPHENIX GitHub at line 119 of file ConvexPolygonBounds.ipp

template<int N>
bool Acts::ConvexPolygonBounds< N >::inside ( const Vector2D lposition,
const BoundaryCheck bcheck 
) const
finalvirtual

Return whether a local 2D point lies inside of the bounds defined by this object.

Parameters
lpositionThe local position to check
bcheckThe BoundaryCheck object handling tolerances.
Returns
Whether the points is inside

Implements Acts::SurfaceBounds.

Definition at line 102 of file ConvexPolygonBounds.ipp.

View newest version in sPHENIX GitHub at line 102 of file ConvexPolygonBounds.ipp

References Acts::BoundaryCheck::isInside().

Referenced by Acts::Test::BOOST_AUTO_TEST_CASE().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

template<int N>
Acts::SurfaceBounds::BoundsType Acts::ConvexPolygonBounds< N >::type ( ) const
finalvirtual

Return the bounds type - for persistency optimization

Returns
is a BoundsType enum

Implements Acts::SurfaceBounds.

Definition at line 97 of file ConvexPolygonBounds.ipp.

View newest version in sPHENIX GitHub at line 97 of file ConvexPolygonBounds.ipp

References Acts::SurfaceBounds::eConvexPolygon.

template<int N>
std::vector< Acts::Vector2D > Acts::ConvexPolygonBounds< N >::vertices ( unsigned int  lseg = 1) const
finalvirtual

Return the vertices

Parameters
lsegthe number of segments used to approximate and eventually curved line
Note
the number of segements is ignored in this representation
Returns
vector for vertices in 2D

Implements Acts::PlanarBounds.

Definition at line 108 of file ConvexPolygonBounds.ipp.

View newest version in sPHENIX GitHub at line 108 of file ConvexPolygonBounds.ipp

Member Data Documentation

template<int N>
constexpr size_t Acts::ConvexPolygonBounds< N >::eSize = 2 * N
static

Expose number of parameters as a template parameter

Definition at line 70 of file ConvexPolygonBounds.hpp.

View newest version in sPHENIX GitHub at line 70 of file ConvexPolygonBounds.hpp

template<int N>
RectangleBounds Acts::ConvexPolygonBounds< N >::m_boundingBox
private

Definition at line 123 of file ConvexPolygonBounds.hpp.

View newest version in sPHENIX GitHub at line 123 of file ConvexPolygonBounds.hpp

template<int N>
vertex_array Acts::ConvexPolygonBounds< N >::m_vertices
private

Definition at line 122 of file ConvexPolygonBounds.hpp.

View newest version in sPHENIX GitHub at line 122 of file ConvexPolygonBounds.hpp

template<int N>
constexpr size_t Acts::ConvexPolygonBounds< N >::num_vertices = N
static

Expose number of vertices given as template parameter.

Definition at line 64 of file ConvexPolygonBounds.hpp.

View newest version in sPHENIX GitHub at line 64 of file ConvexPolygonBounds.hpp


The documentation for this class was generated from the following files: