ACTS
Experiment-independent tracking
Loading...
Searching...
No Matches
detray::tracking_volume< detector_t > Class Template Reference

Facade for a detray detector volume. More...

#include <detray/geometry/tracking_volume.hpp>

Public Types

using name_map = detray::name_map
 In case the geometry needs to be printed.
using object_id = descr_t::object_id
 Object identifier enum used by the volume descriptor's accelerator links.

Public Member Functions

 tracking_volume ()=delete
 Not allowed: always needs a detector and a descriptor.
constexpr tracking_volume (const detector_t &det, const descr_t &desc)
 Construct a volume facade from its detector and descriptor.
constexpr tracking_volume (const detector_t &det, const dindex vol_idx)
 Constructor from detector.
constexpr auto center () const -> point3_type
auto detector () const -> const detector_t &
constexpr bool has_material () const
constexpr auto id () const -> volume_id
constexpr auto index () const -> dindex
constexpr auto material_parameters (const point3_type &loc_p) const -> const detray::material< scalar_type > *
constexpr dindex n_passives () const
constexpr dindex n_portals () const
constexpr dindex n_sensitives () const
auto name (const name_map &names) const -> std::string
constexpr auto operator== (const tracking_volume &rhs) const -> bool
 Equality operator.
constexpr decltype(auto) portals () const
bool self_check (std::ostream &os) const
 Do a consistency check on the volume after building the detector.
template<surface_id sf_type = surface_id::e_all>
constexpr decltype(auto) surfaces () const
constexpr auto transform () const -> const typename detector_t::transform3_type &
template<object_id I, typename functor_t, typename... Args>
constexpr void visit_accelerator (Args &&...args) const
 Apply a functor to all surfaces in one of the volume's acceleration structures.
template<typename functor_t, int I = static_cast<int>(object_id::e_all) - 1, typename... Args>
constexpr void visit_accelerators (Args &&...args) const
 Apply a functor to all acceleration structures of this volume.
template<typename functor_t, typename... Args>
constexpr void visit_daughter_volumes (Args &&...args) const
 Apply a functor to all daughter volumes.
template<typename functor_t, typename... Args>
constexpr auto visit_material (Args &&...args) const
 Call a functor on the volume material with additional arguments.
template<object_id I, typename functor_t, typename track_t, concepts::arithmetic window_size_t, typename... Args>
constexpr void visit_neighborhood (const track_t &track, const search_window< window_size_t, 2 > &win_size, const context_t &ctx, Args &&...args) const
 Apply a functor to a neighborhood of geometric objects around a track position in the volume.
template<surface_id I, typename functor_t, typename... Args>
constexpr void visit_surfaces (Args &&...args) const
 Apply a functor to all surfaces of a given surface id (portal, passive, sensitive) in the volume.

Detailed Description

template<concepts::detector detector_t>
class detray::tracking_volume< detector_t >

Facade for a detray detector volume.

Volume class that acts as a logical container in the detector for geometry objects, i.e. surfaces. The volume boundary surfaces, the so-called portals, carry index links that join adjacent volumes. The volume class itself does not contain any data itself, but keeps a descriptor with index-based links into the data containers that are managed by the detector. Every type of surface that is known by the volume (determined by the type and size of the ID enum in the descriptor) lives in it's own geometry accelerator data structure, e.g. portals reside in a brute force accelerator (a simple vector), while sensitive surfaces are usually sorted into a spatial grid.

Constructor & Destructor Documentation

◆ tracking_volume() [1/2]

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

Construct a volume facade from its detector and descriptor.

Parameters
detDetector that owns the volume data.
descDescriptor containing links for this volume.

◆ tracking_volume() [2/2]

template<concepts::detector detector_t>
detray::tracking_volume< detector_t >::tracking_volume ( const detector_t & det,
const dindex vol_idx )
constexpr

Constructor from detector.

Parameters
detand volume index
vol_idxin that detector.

Member Function Documentation

◆ center()

template<concepts::detector detector_t>
auto detray::tracking_volume< detector_t >::center ( ) const->point3_type
constexpr
Returns
the center point of the volume.

◆ detector()

template<concepts::detector detector_t>
auto detray::tracking_volume< detector_t >::detector ( ) const->constdetector_t &
Returns
access to the underlying detector

◆ has_material()

template<concepts::detector detector_t>
bool detray::tracking_volume< detector_t >::has_material ( ) const
constexpr
Returns
true if the volume carries material.

◆ id()

template<concepts::detector detector_t>
auto detray::tracking_volume< detector_t >::id ( ) const->volume_id
constexpr
Returns
the volume shape id, e.g. 'cylinder'.

◆ index()

template<concepts::detector detector_t>
auto detray::tracking_volume< detector_t >::index ( ) const->dindex
constexpr
Returns
the index of the volume in the detector volume container.

◆ material_parameters()

template<concepts::detector detector_t>
auto detray::tracking_volume< detector_t >::material_parameters ( const point3_type & loc_p) const->constdetray::material< scalar_type > *
constexpr
Returns
a pointer to the material parameters at the local position
Parameters
loc_p

◆ n_passives()

template<concepts::detector detector_t>
dindex detray::tracking_volume< detector_t >::n_passives ( ) const
constexpr
Returns
the total number of passive surfaces contained in the volume

◆ n_portals()

template<concepts::detector detector_t>
dindex detray::tracking_volume< detector_t >::n_portals ( ) const
constexpr
Returns
the total number of portal surfaces contained in the volume

◆ n_sensitives()

template<concepts::detector detector_t>
dindex detray::tracking_volume< detector_t >::n_sensitives ( ) const
constexpr
Returns
the total number of sensitive surfaces contained in the volume

◆ name()

template<concepts::detector detector_t>
auto detray::tracking_volume< detector_t >::name ( const name_map & names) const->std::string
Parameters
namesOptional detector volume names indexed by volume index.
Returns
the volume name (add an offset for the detector name).

◆ operator==()

template<concepts::detector detector_t>
auto detray::tracking_volume< detector_t >::operator== ( const tracking_volume< detector_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.

◆ portals()

template<concepts::detector detector_t>
decltype(auto) detray::tracking_volume< detector_t >::portals ( ) const
constexpr
Returns
an iterator pair for the volume portals.

◆ self_check()

template<concepts::detector detector_t>
bool detray::tracking_volume< detector_t >::self_check ( std::ostream & os) const

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

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

◆ surfaces()

template<concepts::detector detector_t>
template<surface_id sf_type = surface_id::e_all>
decltype(auto) detray::tracking_volume< detector_t >::surfaces ( ) const
constexpr
Returns
an iterator pair for the requested type of surfaces.

◆ transform()

template<concepts::detector detector_t>
auto detray::tracking_volume< detector_t >::transform ( ) const->consttypenamedetector_t::transform3_type &
constexpr
Returns
the (non contextual) transform for the placement of the volume in the detector geometry.

◆ visit_accelerator()

template<concepts::detector detector_t>
template<object_id I, typename functor_t, typename... Args>
void detray::tracking_volume< detector_t >::visit_accelerator ( Args &&... args) const
constexpr

Apply a functor to all surfaces in one of the volume's acceleration structures.

Template Parameters
Itype of object to retrieve (passive, portal, sensitive etc)
functor_tthe prescription to be applied to the surfaces
Argstypes of additional arguments to the functor
Parameters
argsArguments forwarded to the accelerator visitor.

◆ visit_accelerators()

template<concepts::detector detector_t>
template<typename functor_t, int I = static_cast<int>(object_id::e_all) - 1, typename... Args>
void detray::tracking_volume< detector_t >::visit_accelerators ( Args &&... args) const
constexpr

Apply a functor to all acceleration structures of this volume.

Template Parameters
Itype of object to retrieve (surface types, daughters etc)
functor_tthe prescription to be applied to the acc structure
Argstypes of additional arguments to the functor
Parameters
argsArguments forwarded to each accelerator visitor.

◆ visit_daughter_volumes()

template<concepts::detector detector_t>
template<typename functor_t, typename... Args>
void detray::tracking_volume< detector_t >::visit_daughter_volumes ( Args &&... args) const
constexpr

Apply a functor to all daughter volumes.

Template Parameters
functor_tthe prescription to be applied to the daughter volumes
Argstypes of additional arguments to the functor
Parameters
argsArguments forwarded to the daughter-volume visitor.

◆ visit_material()

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

Call a functor on the volume 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 material visitor.

◆ visit_neighborhood()

template<concepts::detector detector_t>
template<object_id I, typename functor_t, typename track_t, concepts::arithmetic window_size_t, typename... Args>
void detray::tracking_volume< detector_t >::visit_neighborhood ( const track_t & track,
const search_window< window_size_t, 2 > & win_size,
const context_t & ctx,
Args &&... args ) const
constexpr

Apply a functor to a neighborhood of geometric objects around a track position in the volume.

Note
: The acceleration structures in the volume might return different geometric objects (e.g. surfaces vs. volumes). The passed functor must provide corresponding overloads of the call operator.
Template Parameters
functor_tthe prescription to be applied to the surfaces (customization point for the navigation)
track_tthe track around which to build up the neighborhood
Argstypes of additional arguments to the functor
Parameters
trackTrack position and direction used for neighborhood lookup.
win_sizeSearch window around the track position.
ctxGeometry context used to resolve transforms.
argsAdditional arguments forwarded to the neighborhood visitor.

◆ visit_surfaces()

template<concepts::detector detector_t>
template<surface_id I, typename functor_t, typename... Args>
void detray::tracking_volume< detector_t >::visit_surfaces ( Args &&... args) const
constexpr

Apply a functor to all surfaces of a given surface id (portal, passive, sensitive) in the volume.

Translates the detray surface type id to the volume geometry object id

Template Parameters
functor_tthe prescription to be applied to the surfaces
Argstypes of additional arguments to the functor
Parameters
argsArguments forwarded to the surface visitor.