ACTS
Experiment-independent tracking
Loading...
Searching...
No Matches
detray::geometry::surface< det_t > Class Template Reference

Facade for a detray detector surface. More...

#include <detray/geometry/surface.hpp>

Inheritance diagram for detray::geometry::surface< det_t >:
[legend]

Public Types

using algebra_type = typename detector_t::algebra_type
 Algebra backend used by the detector geometry.
using context = typename detector_t::geometry_context
 Geometry context type used for contextual transforms.
using point2_type = dpoint2D<algebra_type>
 Two-dimensional local point type.
using point3_type = dpoint3D<algebra_type>
 Three-dimensional point type.
using scalar_type = dscalar<algebra_type>
 Scalar type used for geometry calculations.
using transform3_type = dtransform3D<algebra_type>
 Transform type used to place the surface.
using vector3_type = dvector3D<algebra_type>
 Three-dimensional vector type.

Public Member Functions

 surface ()=delete
 Not allowed: always needs a detector and a descriptor.
constexpr surface (const detector_t &det, const descr_t &desc)
 Construct a surface facade from its detector and descriptor.
constexpr surface (const detector_t &det, const dindex sf_idx)
 Constructor from detector det and surface index sf_idx.
constexpr surface (const detector_t &det, const geometry::identifier geo_id)
 Constructor from detector det and identifier geo_id in that detector.
constexpr auto boundary (std::size_t index) const
constexpr auto center (const context &ctx) const -> point3_type
constexpr auto centroid () const -> point3_type
constexpr auto extra () const -> dindex
constexpr point2_type global_to_bound (const context &ctx, const point3_type &global, const vector3_type &dir) const
constexpr point3_type global_to_local (const context &ctx, const point3_type &global, const vector3_type &dir) const
constexpr bool has_material () const
constexpr auto id () const -> surface_id
constexpr auto identifier () const -> geometry::identifier
constexpr auto index () const -> dindex
template<concepts::point point_t = point2_type>
constexpr bool is_inside (const point_t &loc_p, const scalar_type tol) const
constexpr auto is_passive () const -> bool
constexpr auto is_portal () const -> bool
constexpr auto is_sensitive () const -> bool
template<concepts::point point_t = point2_type>
constexpr point3_type local_to_global (const context &ctx, const point_t &local, const vector3_type &dir) const
constexpr const material< scalar_type > * material_parameters (const point2_type &loc_p) const
std::size_t n_masks () const
template<concepts::point point_t = point2_type>
constexpr auto normal (const context &ctx, const point_t &p) const -> vector3_type
template<typename detector_type = detector_t>
requires (!std::is_const_v<detector_type>)
constexpr operator surface< const detector_type > () const
 Allow conversion from surface<detector_t> to surface<const detector_t>, which has no semantic difference (the detector is always const internally).
constexpr auto operator== (const surface &rhs) const -> bool
 Equality operator.
bool self_check (std::ostream &os) const
 Do a consistency check on the surface after building the detector.
constexpr auto shape_id () const
std::string shape_name () const
constexpr auto source () const
constexpr auto transform (const context &ctx) const -> const transform3_type &
template<typename functor_t, typename... Args>
constexpr auto visit_mask (Args &&...args) const
 Call a functor on the surfaces mask with additional arguments.
template<typename functor_t, typename... Args>
constexpr auto visit_material (Args &&...args) const
 Call a functor on the surfaces material with additional arguments.
constexpr auto volume () const -> dindex
constexpr auto volume_links () const

Protected Member Functions

descr_t descriptor () const
const detector_t & detector () const

Detailed Description

template<concepts::detector det_t>
class detray::geometry::surface< det_t >

Facade for a detray detector surface.

Provides an interface to geometry specific functionality like local-to-global coordinate transforms or mask and material visitors. It wraps a detector instance that contains the data and a surface descriptor that contains the indices into the detector data containers for the specific surface instance.

Constructor & Destructor Documentation

◆ surface() [1/3]

template<concepts::detector det_t>
detray::geometry::surface< det_t >::surface ( const detector_t & det,
const descr_t & desc )
constexpr

Construct a surface facade from its detector and descriptor.

Parameters
detDetector that owns the surface data.
descfrom that detector.

◆ surface() [2/3]

template<concepts::detector det_t>
detray::geometry::surface< det_t >::surface ( const detector_t & det,
const geometry::identifier geo_id )
constexpr

Constructor from detector det and identifier geo_id in that detector.

Parameters
detDetector that owns the surface data.
geo_idIdentifier of the surface in that detector.

◆ surface() [3/3]

template<concepts::detector det_t>
detray::geometry::surface< det_t >::surface ( const detector_t & det,
const dindex sf_idx )
constexpr

Constructor from detector det and surface index sf_idx.

Parameters
detDetector that owns the surface data.
sf_idxIndex of the surface in the detector's surface lookup.

Member Function Documentation

◆ boundary()

template<concepts::detector det_t>
auto detray::geometry::surface< det_t >::boundary ( std::size_t index) const
constexpr
Parameters
indexIndex of the requested boundary value.
Returns
a boundary value of the surface, according to index

◆ center()

template<concepts::detector det_t>
auto detray::geometry::surface< det_t >::center ( const context & ctx) const->point3_type
constexpr
Parameters
ctxGeometry context used to resolve the surface transform.
Returns
the center position of the surface in global coordinates
Note
for shapes like the annulus this is not synonymous to the centroid but instead the focal point of the strip system

◆ centroid()

template<concepts::detector det_t>
auto detray::geometry::surface< det_t >::centroid ( ) const->point3_type
constexpr
Returns
the centroid of the surface mask in local cartesian coordinates

◆ descriptor()

template<concepts::detector det_t>
descr_t detray::geometry::surface< det_t >::descriptor ( ) const
protected
Returns
access to the underlying surface descriptor object

◆ detector()

template<concepts::detector det_t>
const detector_t & detray::geometry::surface< det_t >::detector ( ) const
protected
Returns
access to the underlying detector object

◆ extra()

template<concepts::detector det_t>
auto detray::geometry::surface< det_t >::extra ( ) const->dindex
constexpr
Returns
the extra bits in the identifier

◆ global_to_bound()

template<concepts::detector det_t>
point2_type detray::geometry::surface< det_t >::global_to_bound ( const context & ctx,
const point3_type & global,
const vector3_type & dir ) const
constexpr
Parameters
ctxGeometry context used to resolve the surface transform.
globalPoint in global coordinates.
dirTrack direction used by the local coordinate frame.
Returns
the bound (2D) position to the global point global for a given geometry context ctx and track direction dir

◆ global_to_local()

template<concepts::detector det_t>
point3_type detray::geometry::surface< det_t >::global_to_local ( const context & ctx,
const point3_type & global,
const vector3_type & dir ) const
constexpr
Parameters
ctxGeometry context used to resolve the surface transform.
globalPoint in global coordinates.
dirTrack direction used by the local coordinate frame.
Returns
the local position to the global point global for a given geometry context ctx and track direction dir

◆ has_material()

template<concepts::detector det_t>
bool detray::geometry::surface< det_t >::has_material ( ) const
constexpr
Returns
true if the surface carries material.

◆ id()

template<concepts::detector det_t>
auto detray::geometry::surface< det_t >::id ( ) const->surface_id
constexpr
Returns
the surface id (sensitive, passive or portal)

◆ identifier()

template<concepts::detector det_t>
auto detray::geometry::surface< det_t >::identifier ( ) const->geometry::identifier
constexpr
Returns
the surface identifier

◆ index()

template<concepts::detector det_t>
auto detray::geometry::surface< det_t >::index ( ) const->dindex
constexpr
Returns
the index of the surface in the detector surface lookup

◆ is_inside()

template<concepts::detector det_t>
template<concepts::point point_t = point2_type>
bool detray::geometry::surface< det_t >::is_inside ( const point_t & loc_p,
const scalar_type tol ) const
constexpr
Parameters
loc_pPoint in the local surface frame.
tolTolerance used by the mask boundary check.
Returns
the mask volume link

◆ is_passive()

template<concepts::detector det_t>
auto detray::geometry::surface< det_t >::is_passive ( ) const->bool
constexpr
Returns
true if the surface is a passive detector element.

◆ is_portal()

template<concepts::detector det_t>
auto detray::geometry::surface< det_t >::is_portal ( ) const->bool
constexpr
Returns
true if the surface is a portal.

◆ is_sensitive()

template<concepts::detector det_t>
auto detray::geometry::surface< det_t >::is_sensitive ( ) const->bool
constexpr
Returns
true if the surface is a sensitive detector module.

◆ local_to_global()

template<concepts::detector det_t>
template<concepts::point point_t = point2_type>
point3_type detray::geometry::surface< det_t >::local_to_global ( const context & ctx,
const point_t & local,
const vector3_type & dir ) const
constexpr
Parameters
ctxGeometry context used to resolve the surface transform.
localPoint in the local or bound frame.
dirTrack direction used by the local coordinate frame.
Returns
the global position to the given local position local for a given geometry context ctx

◆ material_parameters()

template<concepts::detector det_t>
const material< scalar_type > * detray::geometry::surface< det_t >::material_parameters ( const point2_type & loc_p) const
constexpr
Parameters
loc_pLocal position where material parameters are queried.
Returns
a pointer to the material parameters at the local position

◆ n_masks()

template<concepts::detector det_t>
std::size_t detray::geometry::surface< det_t >::n_masks ( ) const
Returns
the number of masks associated with this surface

◆ normal()

template<concepts::detector det_t>
template<concepts::point point_t = point2_type>
auto detray::geometry::surface< det_t >::normal ( const context & ctx,
const point_t & p ) const->vector3_type
constexpr
Parameters
ctxGeometry context used to resolve the surface transform.
pLocal or bound position at which to evaluate the normal.
Returns
the surface normal in global coordinates at a given bound/local position p

◆ operator surface< const detector_type >()

template<concepts::detector det_t>
template<typename detector_type = detector_t>
requires (!std::is_const_v<detector_type>)
detray::geometry::surface< det_t >::operator surface< const detector_type > ( ) const
constexpr

Allow conversion from surface<detector_t> to surface<const detector_t>, which has no semantic difference (the detector is always const internally).

Returns
An equivalent facade with a const detector type.

◆ operator==()

template<concepts::detector det_t>
auto detray::geometry::surface< det_t >::operator== ( const surface< det_t > & rhs) const->bool
constexpr

Equality operator.

Parameters
rhsis the right hand side to be compared to
Returns
True when both facades refer to the same detector and descriptor.

◆ self_check()

template<concepts::detector det_t>
bool detray::geometry::surface< det_t >::self_check ( std::ostream & os) const

Do a consistency check on the surface after building the detector.

Parameters
osoutput stream for error messages.
Returns
true if the surface is consistent

◆ shape_id()

template<concepts::detector det_t>
auto detray::geometry::surface< det_t >::shape_id ( ) const
constexpr
Returns
an id for the surface type (e.g. 'rectangle')

◆ shape_name()

template<concepts::detector det_t>
std::string detray::geometry::surface< det_t >::shape_name ( ) const
Returns
the mask shape name

◆ source()

template<concepts::detector det_t>
auto detray::geometry::surface< det_t >::source ( ) const
constexpr
Returns
the surface source link

◆ transform()

template<concepts::detector det_t>
auto detray::geometry::surface< det_t >::transform ( const context & ctx) const->consttransform3_type &
constexpr
Returns
the coordinate transform matrix of the surface
Parameters
ctxGeometry context used to resolve the transform.

◆ visit_mask()

template<concepts::detector det_t>
template<typename functor_t, typename... Args>
auto detray::geometry::surface< det_t >::visit_mask ( Args &&... args) const
constexpr

Call a functor on the surfaces mask with additional arguments.

Template Parameters
functor_tthe prescription to be applied to the mask
Argstypes of additional arguments to the functor
Parameters
argsArguments forwarded to the mask visitor.
Returns
The result produced by the visitor.

◆ visit_material()

template<concepts::detector det_t>
template<typename functor_t, typename... Args>
auto detray::geometry::surface< det_t >::visit_material ( Args &&... args) const
constexpr

Call a functor on the surfaces material with additional arguments.

Template Parameters
functor_tthe prescription to be applied to the material
Argstypes of additional arguments to the functor
Parameters
argsArguments forwarded to the material visitor.
Returns
The result produced by the visitor.

◆ volume()

template<concepts::detector det_t>
auto detray::geometry::surface< det_t >::volume ( ) const->dindex
constexpr
Returns
the index of the mother volume

◆ volume_links()

template<concepts::detector det_t>
auto detray::geometry::surface< det_t >::volume_links ( ) const
constexpr
Returns
the mask volume link