Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Acts::detail::VerticesHelper Namespace Reference

Helper methods for polyhedron vertices drawing and inside/outside checks. More...

Functions

std::vector< ActsScalarphiSegments (ActsScalar phiMin=-M_PI, ActsScalar phiMax=M_PI, const std::vector< ActsScalar > &phiRefs={}, ActsScalar phiTolerance=1e-6)
 
template<typename vertex_t , typename transform_t >
void createSegment (std::vector< vertex_t > &vertices, std::pair< ActsScalar, ActsScalar > rxy, ActsScalar phi1, ActsScalar phi2, unsigned int lseg, int addon=0, const vertex_t &offset=vertex_t::Zero(), const transform_t &transform=transform_t::Identity())
 
std::vector< Vector2ellipsoidVertices (ActsScalar innerRx, ActsScalar innerRy, ActsScalar outerRx, ActsScalar outerRy, ActsScalar avgPhi=0., ActsScalar halfPhi=M_PI, unsigned int lseg=1)
 
std::vector< Vector2circularVertices (ActsScalar innerR, ActsScalar outerR, ActsScalar avgPhi=0., ActsScalar halfPhi=M_PI, unsigned int lseg=1)
 
template<typename vertex_t , typename vertex_container_t >
bool isInsidePolygon (const vertex_t &point, const vertex_container_t &vertices)
 
template<typename vertex_t >
bool isInsideRectangle (const vertex_t &point, const vertex_t &lowerLeft, const vertex_t &upperRight)
 
bool onHyperPlane (const std::vector< Vector3 > &vertices, ActsScalar tolerance=s_onSurfaceTolerance)
 

Detailed Description

Helper methods for polyhedron vertices drawing and inside/outside checks.

Function Documentation

std::vector< Acts::Vector2 > Acts::detail::VerticesHelper::circularVertices ( ActsScalar  innerR,
ActsScalar  outerR,
ActsScalar  avgPhi = 0.,
ActsScalar  halfPhi = M_PI,
unsigned int  lseg = 1 
)

Construct vertices on an disc/wheel-like bound object.

Parameters
innerRThe radius of the inner circle (sector)
outerRThe radius of the outer circle (sector)
avgPhiThe phi direction of the center if sector
halfPhiThe half phi sector if sector
lsegThe number of segments for for a full 2*pi segment
Returns
a vector of 2d-vectors

Definition at line 97 of file VerticesHelper.cpp.

View newest version in sPHENIX GitHub at line 97 of file VerticesHelper.cpp

References ellipsoidVertices().

Referenced by Acts::RadialBounds::vertices().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

template<typename vertex_t , typename transform_t >
void Acts::detail::VerticesHelper::createSegment ( std::vector< vertex_t > &  vertices,
std::pair< ActsScalar, ActsScalar >  rxy,
ActsScalar  phi1,
ActsScalar  phi2,
unsigned int  lseg,
int  addon = 0,
const vertex_t &  offset = vertex_t::Zero(),
const transform_t &  transform = transform_t::Identity() 
)

Helper method to create a regular 2 or 3 D segment between two phi values

Template Parameters
vertex_tType of vertex to be applied
transform_tOptional transform
Parameters
vertices[in,out] The 3D vertices to be filled
rxyThe radius description if first +/= second: ellipse
phi1The first phi value
phi2The second phi value
lsegThe number of segments for full 2*PI
addonThe additional segments to be built
offsetThe out of plane offset position of the bow
transformThe transform applied (optional)

Definition at line 52 of file VerticesHelper.hpp.

View newest version in sPHENIX GitHub at line 52 of file VerticesHelper.hpp

References offset, ActsTests::PropagationDatasets::phi, and Acts::Test::transform.

Referenced by Acts::CylinderBounds::createCircles(), Acts::StrawSurface::polyhedronRepresentation(), and Acts::ConeSurface::polyhedronRepresentation().

+ Here is the caller graph for this function:

std::vector< Acts::Vector2 > Acts::detail::VerticesHelper::ellipsoidVertices ( ActsScalar  innerRx,
ActsScalar  innerRy,
ActsScalar  outerRx,
ActsScalar  outerRy,
ActsScalar  avgPhi = 0.,
ActsScalar  halfPhi = M_PI,
unsigned int  lseg = 1 
)

Construct vertices on an ellipse-like bound object.

Parameters
innerRxThe radius of the inner ellipse (in x), 0 if sector
innerRyThe radius of the inner ellipse (in y), 0 if sector
outerRxThe radius of the outer ellipse (in x)
outerRyThe radius of the outer ellipse (in y)
avgPhiThe phi direction of the center if sector
halfPhiThe half phi sector if sector
lsegThe number of segments for for a full 2*pi segment
Returns
a vector of 2d-vectors

Definition at line 50 of file VerticesHelper.cpp.

View newest version in sPHENIX GitHub at line 50 of file VerticesHelper.cpp

References Acts::closed, phiSegments(), and Acts::s_onSurfaceTolerance.

Referenced by circularVertices(), and Acts::EllipseBounds::vertices().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

template<typename vertex_t , typename vertex_container_t >
bool Acts::detail::VerticesHelper::isInsidePolygon ( const vertex_t &  point,
const vertex_container_t &  vertices 
)

Check if the point is inside the polygon w/o any tolerances.

Template Parameters
vertex_container_tis an iterable container
Parameters
pointis the Vector2Type to check
verticesForward iterable container of convex polygon vertices. Calling std::begin/ std::end on the container must return an iterator where *it must be convertible to an Vector2Type.
Returns
bool for inside/outside

Definition at line 113 of file VerticesHelper.hpp.

View newest version in sPHENIX GitHub at line 113 of file VerticesHelper.hpp

References parse_cmake_options::begin, physmon_vertexing::delta, end, and testSigmaEff::l1.

Referenced by Acts::BoundaryCheck::distance(), Acts::Polyhedron::extent(), and Acts::BoundaryCheck::isInside().

+ Here is the caller graph for this function:

template<typename vertex_t >
bool Acts::detail::VerticesHelper::isInsideRectangle ( const vertex_t &  point,
const vertex_t &  lowerLeft,
const vertex_t &  upperRight 
)

Check if the point is inside the rectangle.

Template Parameters
vertex_tis vector with [0],[1] access
Parameters
pointis the Vector2Type to check
verticesForward iterable container of convex polygon vertices. Calling std::begin/ std::end on the container must return an iterator where *it must be convertible to an Vector2Type.
Returns
bool for inside/outside

Definition at line 159 of file VerticesHelper.hpp.

View newest version in sPHENIX GitHub at line 159 of file VerticesHelper.hpp

Referenced by Acts::BoundaryCheck::distance(), and Acts::BoundaryCheck::isInside().

+ Here is the caller graph for this function:

bool Acts::detail::VerticesHelper::onHyperPlane ( const std::vector< Vector3 > &  vertices,
ActsScalar  tolerance = s_onSurfaceTolerance 
)

This method checks if a cloud of points are on 2D hyper-plane in 3D space.

Parameters
verticesThe list of vertices to test
toleranceThe allowed out of plane tolerance
Returns
boolean to indicate if all points are inside/outside

Definition at line 104 of file VerticesHelper.cpp.

View newest version in sPHENIX GitHub at line 104 of file VerticesHelper.cpp

References Acts::Test::tolerance.

Referenced by Acts::detail::Test::BOOST_AUTO_TEST_CASE(), and Acts::Polyhedron::extent().

+ Here is the caller graph for this function:

std::vector< Acts::ActsScalar > Acts::detail::VerticesHelper::phiSegments ( ActsScalar  phiMin = -M_PI,
ActsScalar  phiMax = M_PI,
const std::vector< ActsScalar > &  phiRefs = {},
ActsScalar  phiTolerance = 1e-6 
)

A method that inserts the cartesian extrema points and segments a curved segment into sub segments

Parameters
phiMinthe minimum Phi of the bounds object
phiMaxthe maximum Phi of the bounds object
phiRefis a vector of reference phi values to be included as well
phiToleranceis the tolerance for reference phi insertion
Returns
a vector

Definition at line 14 of file VerticesHelper.cpp.

View newest version in sPHENIX GitHub at line 14 of file VerticesHelper.cpp

References Acts::Experimental::detail::BlueprintHelper::sort().

Referenced by Acts::CylinderBounds::createCircles(), ellipsoidVertices(), Acts::StrawSurface::polyhedronRepresentation(), Acts::ConeSurface::polyhedronRepresentation(), and Acts::AnnulusBounds::vertices().

+ Here is the call graph for this function:

+ Here is the caller graph for this function: