ACTS
Experiment-independent tracking
Loading...
Searching...
No Matches
detray::volume_descriptor< ID, acc_link_t, mat_link_t > Class Template Reference

The detray detector volume descriptor. More...

#include <detray/geometry/volume_descriptor.hpp>

Inheritance diagram for detray::volume_descriptor< ID, acc_link_t, mat_link_t >:
[legend]

Public Types

using accel_link_type = dmulti_index<acc_link_t, ID::e_size>
 How to access objects (e.g.
using material_id = typename material_link::id_type
 Identifier type used by the volume material link.
using material_link = mat_link_t
 How to link to the volume material, if any.
using object_id = ID
 Ids of objects that can be distinguished by the volume.
using sf_link_type
 How to access the surface ranges in the detector surface lookup.

Public Member Functions

constexpr volume_descriptor ()=default
 Default constructor builds an ~infinitely long cylinder.
constexpr volume_descriptor (const volume_id id)
 Constructor from shape id.
template<ID obj_id>
constexpr auto accel_link () const -> const acc_link_t &
constexpr auto accel_link () const -> const accel_link_type &
constexpr auto accel_link (const ID &id) const -> const acc_link_t &
constexpr auto full_sf_range () const -> typename sf_link_type::index_type
constexpr auto has_material () const -> bool
constexpr auto id () const -> volume_id
constexpr auto index () const -> dindex
constexpr auto material () const -> const material_link &
constexpr dindex n_surfaces () const
constexpr auto operator== (const volume_descriptor &rhs) const -> bool
 Equality operator.
template<ID obj_id>
constexpr auto set_accel_link (const acc_link_t link) -> void
 Set surface finder link from.
constexpr auto set_accel_link (const ID obj_id, const typename acc_link_t::id_type accel_id, const typename acc_link_t::index_type index) -> void
 Set link for a type of surfaces ( obj_id ) from accel_id and index of the acceleration data structure (e.g.
template<ID obj_id>
constexpr auto set_accel_link (const typename acc_link_t::id_type id, const typename acc_link_t::index_type index) -> void
 Set link from.
constexpr auto set_index (const dindex index) -> void
constexpr auto set_material (const material_id mat_id, const dindex mat_idx) -> void
 Set the volume material link using the given material type id.
constexpr auto set_material (const material_link &mat_link) -> void
 Set the volume material link to.
constexpr auto set_transform (const dindex trf_idx) -> void
template<surface_id id>
constexpr auto sf_link () -> typename sf_link_type::index_type &
constexpr auto sf_link () const -> const sf_link_type &
template<surface_id id>
constexpr auto sf_link () const -> const typename sf_link_type::index_type &
constexpr dindex to_global_sf_index (dindex sf_idx) const
constexpr dindex to_local_sf_index (dindex sf_idx) const
constexpr auto transform () const -> dindex
template<surface_id id>
auto update_sf_link (const typename sf_link_type::index_type &other) noexcept -> void
 Set or update the index into a geometry container identified by the obj_id.
template<surface_id id>
auto update_sf_link (std::size_t shift, std::size_t n_surfaces=0) noexcept -> void
 Set or update the index into a geometry container identified by the obj_id.

Static Public Member Functions

static consteval bool is_surface_id (const object_id id)
static consteval bool is_volume_id (const object_id id)

Detailed Description

template<typename ID, typename acc_link_t = dtyped_index<dindex, dindex>, typename mat_link_t = dtyped_index<dindex, dindex>>
class detray::volume_descriptor< ID, acc_link_t, mat_link_t >

The detray detector volume descriptor.

Contains the data and links to describe a detector volume. This is the type that is stored in the detector data stores.

Template Parameters
IDenum of object types contained in the volume (
See also
default_metadata ).
Template Parameters
link_tthe type of link to the volumes surfaces finder(s) (accelerator structure, e.g. a grid). The surface finder types cannot be given directly, since the containers differ between host and device. The surface finders reside in an 'unrollable tuple container' and are called per volume in the navigator during local navigation.

Member Typedef Documentation

◆ accel_link_type

template<typename ID, typename acc_link_t = dtyped_index<dindex, dindex>, typename mat_link_t = dtyped_index<dindex, dindex>>
using detray::volume_descriptor< ID, acc_link_t, mat_link_t >::accel_link_type = dmulti_index<acc_link_t, ID::e_size>

How to access objects (e.g.

sensitives/passives/portals) in this volume. Keeps one accelerator structure link per object type (by ID):

acc_link_t : id and index of the accelerator structure in the detector's surface store.

E.g. a 'portal' can be found under ID::e_portal in this link, and will then receive link to the brute_force acceleration structure that holds the portals (the accelerator structure's id and index).

◆ sf_link_type

template<typename ID, typename acc_link_t = dtyped_index<dindex, dindex>, typename mat_link_t = dtyped_index<dindex, dindex>>
using detray::volume_descriptor< ID, acc_link_t, mat_link_t >::sf_link_type
Initial value:
static_cast<std::size_t>(
static_cast<std::underlying_type_t<surface_id>>(
surface_id::e_all))>
detail::index_range< dindex > dindex_range
Index ranges and sequences.
Definition indexing.hpp:24
detail::multi_index< index_t, DIM > dmulti_index
Index that consists of multiple subindices.
Definition indexing.hpp:33

How to access the surface ranges in the detector surface lookup.

Constructor & Destructor Documentation

◆ volume_descriptor()

template<typename ID, typename acc_link_t = dtyped_index<dindex, dindex>, typename mat_link_t = dtyped_index<dindex, dindex>>
detray::volume_descriptor< ID, acc_link_t, mat_link_t >::volume_descriptor ( const volume_id id)
explicitconstexpr

Constructor from shape id.

Parameters
idid values that determines how to interpret the bounds.

Member Function Documentation

◆ accel_link() [1/3]

template<typename ID, typename acc_link_t = dtyped_index<dindex, dindex>, typename mat_link_t = dtyped_index<dindex, dindex>>
template<ID obj_id>
auto detray::volume_descriptor< ID, acc_link_t, mat_link_t >::accel_link ( ) const->constacc_link_t &
constexpr
Returns
acc data structure link for a specific type of object - const

◆ accel_link() [2/3]

template<typename ID, typename acc_link_t = dtyped_index<dindex, dindex>, typename mat_link_t = dtyped_index<dindex, dindex>>
auto detray::volume_descriptor< ID, acc_link_t, mat_link_t >::accel_link ( ) const->constaccel_link_type &
constexpr
Returns
link to all acceleration data structures - const access

◆ accel_link() [3/3]

template<typename ID, typename acc_link_t = dtyped_index<dindex, dindex>, typename mat_link_t = dtyped_index<dindex, dindex>>
auto detray::volume_descriptor< ID, acc_link_t, mat_link_t >::accel_link ( const ID & id) const->constacc_link_t &
constexpr
Parameters
idObject type whose accelerator link is requested.
Returns
acc data structure link for a specific type of object - const version with runtime indexing

◆ full_sf_range()

template<typename ID, typename acc_link_t = dtyped_index<dindex, dindex>, typename mat_link_t = dtyped_index<dindex, dindex>>
auto detray::volume_descriptor< ID, acc_link_t, mat_link_t >::full_sf_range ( ) const->typenamesf_link_type::index_type
constexpr
Returns
surface descriptor link for all surface types

◆ has_material()

template<typename ID, typename acc_link_t = dtyped_index<dindex, dindex>, typename mat_link_t = dtyped_index<dindex, dindex>>
auto detray::volume_descriptor< ID, acc_link_t, mat_link_t >::has_material ( ) const->bool
constexpr
Returns
true if the volume descriptor has a valid material link

◆ id()

template<typename ID, typename acc_link_t = dtyped_index<dindex, dindex>, typename mat_link_t = dtyped_index<dindex, dindex>>
auto detray::volume_descriptor< ID, acc_link_t, mat_link_t >::id ( ) const->volume_id
constexpr
Returns
the volume shape id, e.g. 'cylinder'

◆ index()

template<typename ID, typename acc_link_t = dtyped_index<dindex, dindex>, typename mat_link_t = dtyped_index<dindex, dindex>>
auto detray::volume_descriptor< ID, acc_link_t, mat_link_t >::index ( ) const->dindex
constexpr
Returns
the index of the volume in the detector volume container.

◆ is_surface_id()

template<typename ID, typename acc_link_t = dtyped_index<dindex, dindex>, typename mat_link_t = dtyped_index<dindex, dindex>>
consteval bool detray::volume_descriptor< ID, acc_link_t, mat_link_t >::is_surface_id ( const object_id id)
staticconsteval
Parameters
idObject identifier to classify.
Returns
true if the object ID corresponds to a surface

◆ is_volume_id()

template<typename ID, typename acc_link_t = dtyped_index<dindex, dindex>, typename mat_link_t = dtyped_index<dindex, dindex>>
consteval bool detray::volume_descriptor< ID, acc_link_t, mat_link_t >::is_volume_id ( const object_id id)
staticconsteval
Parameters
idObject identifier to classify.
Returns
true if the object ID corresponds to a [daughter] volume

◆ material()

template<typename ID, typename acc_link_t = dtyped_index<dindex, dindex>, typename mat_link_t = dtyped_index<dindex, dindex>>
auto detray::volume_descriptor< ID, acc_link_t, mat_link_t >::material ( ) const->constmaterial_link &
constexpr
Returns
the volume material link

◆ n_surfaces()

template<typename ID, typename acc_link_t = dtyped_index<dindex, dindex>, typename mat_link_t = dtyped_index<dindex, dindex>>
dindex detray::volume_descriptor< ID, acc_link_t, mat_link_t >::n_surfaces ( ) const
constexpr
Returns
the total number of surfaces contained in the volume

◆ operator==()

template<typename ID, typename acc_link_t = dtyped_index<dindex, dindex>, typename mat_link_t = dtyped_index<dindex, dindex>>
auto detray::volume_descriptor< ID, acc_link_t, mat_link_t >::operator== ( const volume_descriptor< ID, acc_link_t, mat_link_t > & rhs) const->bool
constexpr

Equality operator.

Parameters
rhsis the right-hand side to compare against.
Returns
True when the volume shape, index, and accelerator links match.

◆ set_accel_link() [1/3]

template<typename ID, typename acc_link_t = dtyped_index<dindex, dindex>, typename mat_link_t = dtyped_index<dindex, dindex>>
template<ID obj_id>
auto detray::volume_descriptor< ID, acc_link_t, mat_link_t >::set_accel_link ( const acc_link_t link) ->void
constexpr

Set surface finder link from.

Parameters
link

◆ set_accel_link() [2/3]

template<typename ID, typename acc_link_t = dtyped_index<dindex, dindex>, typename mat_link_t = dtyped_index<dindex, dindex>>
auto detray::volume_descriptor< ID, acc_link_t, mat_link_t >::set_accel_link ( const ID obj_id,
const typename acc_link_t::id_type accel_id,
const typename acc_link_t::index_type index )->void
constexpr

Set link for a type of surfaces ( obj_id ) from accel_id and index of the acceleration data structure (e.g.

type and index of a grid in the accelerator store)

Parameters
obj_idObject type to associate with the link.
accel_idAccelerator structure type.
indexIndex of the accelerator structure in its store.

◆ set_accel_link() [3/3]

template<typename ID, typename acc_link_t = dtyped_index<dindex, dindex>, typename mat_link_t = dtyped_index<dindex, dindex>>
template<ID obj_id>
auto detray::volume_descriptor< ID, acc_link_t, mat_link_t >::set_accel_link ( const typename acc_link_t::id_type id,
const typename acc_link_t::index_type index )->void
constexpr

Set link from.

Parameters
idand
indexof the acceleration data structure (e.g. type and index of a grid in the accelerator store)

◆ set_index()

template<typename ID, typename acc_link_t = dtyped_index<dindex, dindex>, typename mat_link_t = dtyped_index<dindex, dindex>>
auto detray::volume_descriptor< ID, acc_link_t, mat_link_t >::set_index ( const dindex index) ->void
constexpr
Parameters
indexthe index of the volume in the detector volume container.

◆ set_material() [1/2]

template<typename ID, typename acc_link_t = dtyped_index<dindex, dindex>, typename mat_link_t = dtyped_index<dindex, dindex>>
auto detray::volume_descriptor< ID, acc_link_t, mat_link_t >::set_material ( const material_id mat_id,
const dindex mat_idx )->void
constexpr

Set the volume material link using the given material type id.

Parameters
mat_idand index of the material instance
mat_idx

◆ set_material() [2/2]

template<typename ID, typename acc_link_t = dtyped_index<dindex, dindex>, typename mat_link_t = dtyped_index<dindex, dindex>>
auto detray::volume_descriptor< ID, acc_link_t, mat_link_t >::set_material ( const material_link & mat_link) ->void
constexpr

Set the volume material link to.

Parameters
mat_link

◆ set_transform()

template<typename ID, typename acc_link_t = dtyped_index<dindex, dindex>, typename mat_link_t = dtyped_index<dindex, dindex>>
auto detray::volume_descriptor< ID, acc_link_t, mat_link_t >::set_transform ( const dindex trf_idx) ->void
constexpr
Parameters
trf_idxIndex of this volume's transform in the transform store.

◆ sf_link() [1/3]

template<typename ID, typename acc_link_t = dtyped_index<dindex, dindex>, typename mat_link_t = dtyped_index<dindex, dindex>>
template<surface_id id>
auto detray::volume_descriptor< ID, acc_link_t, mat_link_t >::sf_link ( ) ->typenamesf_link_type::index_type &
constexpr
Returns
surface descriptor link for a specific type of object

◆ sf_link() [2/3]

template<typename ID, typename acc_link_t = dtyped_index<dindex, dindex>, typename mat_link_t = dtyped_index<dindex, dindex>>
auto detray::volume_descriptor< ID, acc_link_t, mat_link_t >::sf_link ( ) const->constsf_link_type &
constexpr
Returns
surface link for all object types - const

◆ sf_link() [3/3]

template<typename ID, typename acc_link_t = dtyped_index<dindex, dindex>, typename mat_link_t = dtyped_index<dindex, dindex>>
template<surface_id id>
auto detray::volume_descriptor< ID, acc_link_t, mat_link_t >::sf_link ( ) const->consttypenamesf_link_type::index_type &
constexpr
Returns
surface descriptor link for a specific type of object - const

◆ to_global_sf_index()

template<typename ID, typename acc_link_t = dtyped_index<dindex, dindex>, typename mat_link_t = dtyped_index<dindex, dindex>>
dindex detray::volume_descriptor< ID, acc_link_t, mat_link_t >::to_global_sf_index ( dindex sf_idx) const
constexpr
Parameters
sf_idxSurface index relative to this volume's surface range.
Returns
a surface index with respect to the global detector containers

◆ to_local_sf_index()

template<typename ID, typename acc_link_t = dtyped_index<dindex, dindex>, typename mat_link_t = dtyped_index<dindex, dindex>>
dindex detray::volume_descriptor< ID, acc_link_t, mat_link_t >::to_local_sf_index ( dindex sf_idx) const
constexpr
Parameters
sf_idxSurface index in the detector-wide surface collection.
Returns
a surface index with respect to the volume surface range

◆ transform()

template<typename ID, typename acc_link_t = dtyped_index<dindex, dindex>, typename mat_link_t = dtyped_index<dindex, dindex>>
auto detray::volume_descriptor< ID, acc_link_t, mat_link_t >::transform ( ) const->dindex
constexpr
Returns
the index of the volume transform in the transform store.

◆ update_sf_link() [1/2]

template<typename ID, typename acc_link_t = dtyped_index<dindex, dindex>, typename mat_link_t = dtyped_index<dindex, dindex>>
template<surface_id id>
auto detray::volume_descriptor< ID, acc_link_t, mat_link_t >::update_sf_link ( const typename sf_link_type::index_type & other) ->void
noexcept

Set or update the index into a geometry container identified by the obj_id.

Note
There is no check of overlapping index ranges between the object types. Use with care!
Parameters
otherSurface index range

◆ update_sf_link() [2/2]

template<typename ID, typename acc_link_t = dtyped_index<dindex, dindex>, typename mat_link_t = dtyped_index<dindex, dindex>>
template<surface_id id>
auto detray::volume_descriptor< ID, acc_link_t, mat_link_t >::update_sf_link ( std::size_t shift,
std::size_t n_surfaces = 0 )->void
noexcept

Set or update the index into a geometry container identified by the obj_id.

Note
There is no check of overlapping index ranges between the object types. Use with care!
Parameters
shiftshift of the surface range in a larger container.
n_surfacesthe number of surfaces in this range.