EIC Software
Reference for
EIC
simulation and reconstruction software on GitHub
|
Helper methods for polyhedron vertices drawing and inside/outside checks. More...
Functions | |
std::vector< double > | phiSegments (double phiMin=-M_PI, double phiMax=M_PI, const std::vector< double > &phiRefs={}, double phiTolerance=1e-6) |
template<typename vertex_t , typename transform_t > | |
void | createSegment (std::vector< vertex_t > &vertices, std::pair< double, double > rxy, double phi1, double phi2, unsigned int lseg, int addon=0, const vertex_t &offset=vertex_t::Zero(), const transform_t &transform=transform_t::Identity()) |
std::vector< Vector2D > | ellipsoidVertices (double innerRx, double innerRy, double outerRx, double outerRy, double avgPhi=0., double halfPhi=M_PI, unsigned int lseg=1) |
std::vector< Vector2D > | circularVertices (double innerR, double outerR, double avgPhi=0., double 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< Vector3D > &vertices, double tolerance=s_onSurfaceTolerance) |
Helper methods for polyhedron vertices drawing and inside/outside checks.
std::vector< Acts::Vector2D > Acts::detail::VerticesHelper::circularVertices | ( | double | innerR, |
double | outerR, | ||
double | avgPhi = 0. , |
||
double | halfPhi = M_PI , |
||
unsigned int | lseg = 1 |
||
) |
Construct vertices on an disc/wheel-like bound object.
innerR | The radius of the inner circle (sector) |
outerR | The radius of the outer circle (sector) |
avgPhi | The phi direction of the center if sector |
halfPhi | The half phi sector if sector |
lseg | The number of segments for for a full 2*pi segment |
Definition at line 93 of file VerticesHelper.cpp.
View newest version in sPHENIX GitHub at line 93 of file VerticesHelper.cpp
References ellipsoidVertices().
Referenced by Acts::RadialBounds::vertices().
void Acts::detail::VerticesHelper::createSegment | ( | std::vector< vertex_t > & | vertices, |
std::pair< double, double > | rxy, | ||
double | phi1, | ||
double | 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
vertex_t | Type of vertex to be applied |
transform_t | Optional transform |
vertices | [in,out] The 3D vertices to be filled |
rxy | The radius description if first +/= second: ellipse |
phi1 | The first phi value |
phi2 | The second phi value |
lseg | The number of segments for full 2*PI |
addon | The additional segments to be built |
offset | The out of plane offset position of the bow |
transform | The transform applied (optional) |
Definition at line 48 of file VerticesHelper.hpp.
View newest version in sPHENIX GitHub at line 48 of file VerticesHelper.hpp
References kdfinder::abs(), cos(), M_PI, offset, phi, and Acts::Test::transform.
Referenced by Acts::StrawSurface::polyhedronRepresentation(), Acts::ConeSurface::polyhedronRepresentation(), and Acts::CylinderSurface::polyhedronRepresentation().
std::vector< Acts::Vector2D > Acts::detail::VerticesHelper::ellipsoidVertices | ( | double | innerRx, |
double | innerRy, | ||
double | outerRx, | ||
double | outerRy, | ||
double | avgPhi = 0. , |
||
double | halfPhi = M_PI , |
||
unsigned int | lseg = 1 |
||
) |
Construct vertices on an ellipse-like bound object.
innerRx | The radius of the inner ellipse (in x), 0 if sector |
innerRy | The radius of the inner ellipse (in y), 0 if sector |
outerRx | The radius of the outer ellipse (in x) |
outerRy | The radius of the outer ellipse (in y) |
avgPhi | The phi direction of the center if sector |
halfPhi | The half phi sector if sector |
lseg | The number of segments for for a full 2*pi segment |
Definition at line 47 of file VerticesHelper.cpp.
View newest version in sPHENIX GitHub at line 47 of file VerticesHelper.cpp
References kdfinder::abs(), Acts::closed, M_PI, phiSegments(), and Acts::s_onSurfaceTolerance.
Referenced by circularVertices(), and Acts::EllipseBounds::vertices().
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.
vertex_container_t | is an iterable container |
point | is the Vector2DType to check |
vertices | Forward 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 Vector2DType . |
Definition at line 107 of file VerticesHelper.hpp.
View newest version in sPHENIX GitHub at line 107 of file VerticesHelper.hpp
References Acts::Test::delta.
Referenced by Acts::BoundaryCheck::distance(), Acts::Polyhedron::extent(), and Acts::BoundaryCheck::isInside().
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.
vertex_t | is vector with [0],[1] access |
point | is the Vector2DType to check |
vertices | Forward 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 Vector2DType . |
Definition at line 153 of file VerticesHelper.hpp.
View newest version in sPHENIX GitHub at line 153 of file VerticesHelper.hpp
Referenced by Acts::BoundaryCheck::distance(), and Acts::BoundaryCheck::isInside().
bool Acts::detail::VerticesHelper::onHyperPlane | ( | const std::vector< Vector3D > & | vertices, |
double | tolerance = s_onSurfaceTolerance |
||
) |
This method checks if a cloud of points are on 2D hyper-plane in 3D space.
vertices | The list of vertices to test |
tolerance | The allowed out of plane tolerance |
Definition at line 100 of file VerticesHelper.cpp.
View newest version in sPHENIX GitHub at line 100 of file VerticesHelper.cpp
References ip(), and Acts::Test::tolerance.
Referenced by Acts::detail::Test::BOOST_AUTO_TEST_CASE(), and Acts::Polyhedron::extent().
std::vector< double > Acts::detail::VerticesHelper::phiSegments | ( | double | phiMin = -M_PI , |
double | phiMax = M_PI , |
||
const std::vector< double > & | phiRefs = {} , |
||
double | phiTolerance = 1e-6 |
||
) |
A method that inserts the cartesian extrema points and segments a curved segment into sub segments
phiMin | the minimum Phi of the bounds object |
phiMax | the maximum Phi of the bounds object |
phiRef | is a vector of reference phi values to be included as well |
phiTolerance | is the tolerance for reference phi insertion |
Definition at line 11 of file VerticesHelper.cpp.
View newest version in sPHENIX GitHub at line 11 of file VerticesHelper.cpp
References kdfinder::abs(), and M_PI.
Referenced by ellipsoidVertices(), Acts::StrawSurface::polyhedronRepresentation(), Acts::ConeSurface::polyhedronRepresentation(), Acts::CylinderSurface::polyhedronRepresentation(), and Acts::AnnulusBounds::vertices().