ACTS
Experiment-independent tracking
Loading...
Searching...
No Matches
detray::annulus2D Class Reference

Geometrical shape of a stereo annulus that is used for the ITk strip endcaps. More...

#include <detray/geometry/shapes/annulus2D.hpp>

Collaboration diagram for detray::annulus2D:
[legend]

Public Types

enum  boundaries : unsigned int {
  e_min_r = 0u , e_max_r = 1u , e_min_phi_rel = 2u , e_max_phi_rel = 3u ,
  e_average_phi = 4u , e_shift_x = 5u , e_shift_y = 6u , e_size = 7u
}
 Names for the mask boundary values.
template<concepts::scalar scalar_t>
using bounds_type = darray<scalar_t, boundaries::e_size>
 Container definition for the shape boundary values.
template<concepts::algebra algebra_t>
using local_frame_type = polar2D<algebra_t>
 Local coordinate frame ( focal system ).
template<typename bool_t>
using result_type = detail::boundary_check_result<bool_t>
 Result type of a boundary check.

Public Member Functions

template<concepts::scalar scalar_t>
constexpr scalar_t area (const bounds_type< scalar_t > &) const
 The area of a the shape.
template<concepts::algebra algebra_t>
dpoint3D< algebra_t > centroid (const bounds_type< dscalar< algebra_t > > &bounds) const
template<concepts::scalar scalar_t>
constexpr bool check_consistency (const bounds_type< scalar_t > &bounds, std::ostream &os) const
 Check consistency of boundary values.
template<concepts::scalar scalar_t>
darray< scalar_t, 8 > corners (const bounds_type< scalar_t > &bounds) const
 Stereo annulus corners in polar strip system.
template<concepts::scalar scalar_t, concepts::point point_t>
scalar_t get_phi_rel (const bounds_type< scalar_t > &bounds, const point_t &loc_p) const
template<concepts::scalar scalar_t, concepts::point point_t>
scalar_t get_r2_beam_frame (const bounds_type< scalar_t > &bounds, const point_t &loc_p) const
template<concepts::algebra algebra_t>
darray< dscalar< algebra_t >, 6 > local_min_bounds (const bounds_type< dscalar< algebra_t > > &bounds, const dscalar< algebra_t > env=std::numeric_limits< dscalar< algebra_t > >::epsilon()) const
 Lower and upper point for minimal axis aligned bounding box.
template<concepts::scalar scalar_t>
constexpr scalar_t measure (const bounds_type< scalar_t > &bounds) const
 Measure of the shape: Area.
template<concepts::scalar scalar_t>
constexpr bounds_type< scalar_t > merge (const bounds_type< scalar_t > &bounds, const bounds_type< scalar_t > &o_bounds) const
 Merge two annulus shapes.
template<concepts::scalar scalar_t, concepts::point point_t>
scalar_t min_dist_to_boundary (const bounds_type< scalar_t > &bounds, const point_t &loc_p) const
 Find the minimum distance to any boundary.
template<concepts::scalar scalar_t>
darray< scalar_t, 8 > stereo_angle (const bounds_type< scalar_t > &bounds) const
template<concepts::algebra algebra_t>
dvector< dpoint3D< algebra_t > > vertices (const bounds_type< dscalar< algebra_t > > &bounds, dindex n_seg) const
 Generate vertices in local cartesian frame.
template<concepts::algebra algebra_t>
constexpr result_type< dbool< algebra_t > > check_boundaries (const bounds_type< dscalar< algebra_t > > &bounds, const dtransform3D< algebra_t > &trf, const dpoint3D< algebra_t > &glob_p, const dscalar< algebra_t > tol=std::numeric_limits< dscalar< algebra_t > >::epsilon(), const dscalar< algebra_t > edge_tol=0.f) const
 Check boundary values for a local point.
template<concepts::scalar scalar_t, concepts::point point_t>
constexpr auto check_boundaries (const bounds_type< scalar_t > &bounds, const point_t &loc_p, const scalar_t tol=std::numeric_limits< scalar_t >::epsilon(), const scalar_t edge_tol=0.f) const

Static Public Attributes

static constexpr std::size_t dim {2u}
 Dimension of the local coordinate system.
static constexpr std::string_view name = "(stereo) annulus2D"
 The name for this shape.

Detailed Description

Geometrical shape of a stereo annulus that is used for the ITk strip endcaps.

The stereo annulus is defined in two different(!) polar coordinate systems that differ by an origin shift. The boundaries are the inner and outer radius (bounds[0] and bounds[1]) in the polar coordinate system of an endcap disc (called beam system in the following) that is centered on the beam axis, as well as the two phi boundaries that are defined in the system that is shifted into the focal point of the strips on a given sensor (called focal system in the following). Note, that the local coordinate system of the annulus surface is the same as the shifted disc (focal) system! The mask phi boundaries (bounds[2] and bounds[3]) are defined relative to the average phi position ( bounds[6]) of the strips in the focal system. Due to the focal polar coordinate system of the strips needing a different origin from the beam polar system, two additional conversion parameters are included (bounds[4], bounds[5]). These are the origin shift in x and y respectively.

Member Function Documentation

◆ area()

template<concepts::scalar scalar_t>
scalar_t detray::annulus2D::area ( const bounds_type< scalar_t > & ) const
constexpr

The area of a the shape.

Note
(not yet implemented!)
Returns
the stereo annulus area.

◆ centroid()

template<concepts::algebra algebra_t>
dpoint3D< algebra_t > detray::annulus2D::centroid ( const bounds_type< dscalar< algebra_t > > & bounds) const
Parameters
boundsBoundary values used to determine the center.
Returns
the shapes centroid in local cartesian coordinates
Note
the calculated centroid position is only an approximation (centroid of the four corner points)!

◆ check_boundaries() [1/2]

template<concepts::algebra algebra_t>
result_type< dbool< algebra_t > > detray::annulus2D::check_boundaries ( const bounds_type< dscalar< algebra_t > > & bounds,
const dtransform3D< algebra_t > & trf,
const dpoint3D< algebra_t > & glob_p,
const dscalar< algebra_t > tol = std::numeric_limits<dscalar<algebra_t>>::epsilon(),
const dscalar< algebra_t > edge_tol = 0.f ) const
constexpr

Check boundary values for a local point.

Parameters
boundsthe boundary values for this shape
trfthe surface transform
glob_pthe point to be checked in the global coordinate system
toldynamic tolerance determined by caller
edge_tolAdditional tolerance used to classify points near an edge.
Returns
true if the local point lies within the given boundaries.

◆ check_boundaries() [2/2]

template<concepts::scalar scalar_t, concepts::point point_t>
auto detray::annulus2D::check_boundaries ( const bounds_type< scalar_t > & bounds,
const point_t & loc_p,
const scalar_t tol = std::numeric_limits<scalar_t>::epsilon(),
const scalar_t edge_tol = 0.f ) const
constexpr
Note
the point is expected to be given in local coordinates by the caller. For the annulus shape, the local coordinate system of the strips is used (focal system).
Parameters
boundsthe boundary values for this shape
loc_pthe point to be checked in the local coordinate system
toldynamic tolerance determined by caller
edge_tolAdditional tolerance used to classify points near an edge.
Returns
true if the local point lies within the given boundaries.

◆ check_consistency()

template<concepts::scalar scalar_t>
bool detray::annulus2D::check_consistency ( const bounds_type< scalar_t > & bounds,
std::ostream & os ) const
constexpr

Check consistency of boundary values.

Parameters
boundsthe boundary values for this shape
osoutput stream for error messages
Returns
true if the bounds are consistent.

◆ corners()

template<concepts::scalar scalar_t>
darray< scalar_t, 8 > detray::annulus2D::corners ( const bounds_type< scalar_t > & bounds) const

Stereo annulus corners in polar strip system.

Parameters
boundsthe boundary values for the stereo annulus
Note
see calculation of strip lengths in https://cds.cern.ch/record/1514636?ln=en p10-13
Returns
an array of coordinates that contains the lower point (first four values) and the upper point (latter four values).

◆ get_phi_rel()

template<concepts::scalar scalar_t, concepts::point point_t>
scalar_t detray::annulus2D::get_phi_rel ( const bounds_type< scalar_t > & bounds,
const point_t & loc_p ) const
Returns
The phi position in relative to the average phi of the annulus.
Parameters
boundsAnnulus boundary values, including its average azimuth.
loc_pPoint in the annulus local frame.

◆ get_r2_beam_frame()

template<concepts::scalar scalar_t, concepts::point point_t>
scalar_t detray::annulus2D::get_r2_beam_frame ( const bounds_type< scalar_t > & bounds,
const point_t & loc_p ) const
Returns
The squared radial position in the beam frame.
Parameters
boundsAnnulus boundaries and beam-frame center shift.
loc_pPoint in the annulus local frame.

◆ local_min_bounds()

template<concepts::algebra algebra_t>
darray< dscalar< algebra_t >, 6 > detray::annulus2D::local_min_bounds ( const bounds_type< dscalar< algebra_t > > & bounds,
const dscalar< algebra_t > env = std::numeric_limits<dscalar<algebra_t>>::epsilon() ) const

Lower and upper point for minimal axis aligned bounding box.

Computes the min and max vertices in a local cartesian frame.

Parameters
boundsthe boundary values for this shape
envdynamic envelope around the shape
Returns
and array of coordinates that contains the lower point (first three values) and the upper point (latter three values).

◆ measure()

template<concepts::scalar scalar_t>
scalar_t detray::annulus2D::measure ( const bounds_type< scalar_t > & bounds) const
constexpr

Measure of the shape: Area.

Note
(not yet implemented!)
Parameters
boundsthe boundary values for this shape
Returns
the stereo annulus area on the plane.

◆ merge()

template<concepts::scalar scalar_t>
bounds_type< scalar_t > detray::annulus2D::merge ( const bounds_type< scalar_t > & bounds,
const bounds_type< scalar_t > & o_bounds ) const
constexpr

Merge two annulus shapes.

Parameters
boundsthe boundary values for this shape
o_boundsthe boundary values for the other shape
Returns
merged bound values

◆ min_dist_to_boundary()

template<concepts::scalar scalar_t, concepts::point point_t>
scalar_t detray::annulus2D::min_dist_to_boundary ( const bounds_type< scalar_t > & bounds,
const point_t & loc_p ) const

Find the minimum distance to any boundary.

Note
the point is expected to be given in local coordinates by the caller. For the annulus shape, the local coordinate system of the strips is used (focal system).
Parameters
boundsthe boundary values for this shape
loc_pthe point to be checked in the local coordinate system
Returns
the minimum distance.

◆ stereo_angle()

template<concepts::scalar scalar_t>
darray< scalar_t, 8 > detray::annulus2D::stereo_angle ( const bounds_type< scalar_t > & bounds) const
Returns
the stereo angle calculated from the mask
Parameters
bounds.

◆ vertices()

template<concepts::algebra algebra_t>
dvector< dpoint3D< algebra_t > > detray::annulus2D::vertices ( const bounds_type< dscalar< algebra_t > > & bounds,
dindex n_seg ) const

Generate vertices in local cartesian frame.

Parameters
boundsthe boundary values for the stereo annulus
n_segis the number of line segments
Returns
a generated list of vertices