ACTS
Experiment-independent tracking
Loading...
Searching...
No Matches
detray::material_map_builder< detector_t, DIM, mat_map_factory_t > Class Template Referencefinal

Build the material maps for a given volume. More...

#include <detray/builders/material_map_builder.hpp>

Inheritance diagram for detray::material_map_builder< detector_t, DIM, mat_map_factory_t >:
[legend]
Collaboration diagram for detray::material_map_builder< detector_t, DIM, mat_map_factory_t >:
[legend]

Public Types

using bin_data_type
 Bin payload containing a local bin index and its material values.
using detector_type = detector_t
 Detector type whose geometry and material stores are populated.
using scalar_type = dscalar<typename detector_t::algebra_type>
 Scalar type used by material map bins.
using value_type = material_slab<scalar_type>
 Material slab type stored in each bin.
Public Types inherited from detray::volume_decorator< detector_t >
using scalar_t = dscalar<typename detector_t::algebra_type>
 Scalar type used by the detector's algebra.
Public Types inherited from detray::volume_builder_interface< detector_t >
using algebra_type = typename detector_t::algebra_type
 Algebra type used by the detector.
using scalar_type = dscalar<algebra_type>
 Scalar type used by the detector's algebra.

Public Member Functions

 material_map_builder (std::unique_ptr< volume_builder_interface< detector_t > > vol_builder)
auto build (detector_t &det, const volume_builder_options &opt, typename detector_t::geometry_context ctx={}) -> typename detector_t::volume_type *override
 Add the volume and the material maps to the detector det.
auto data () const -> const std::map< dindex, std::vector< bin_data_type > > &
void add_surfaces (std::shared_ptr< surface_factory_interface< detector_t > > sf_factory, typename detector_t::geometry_context ctx={}) override
 Overwrite, to add material maps in addition to surfaces.
Public Member Functions inherited from detray::volume_decorator< detector_t >
 volume_decorator (std::unique_ptr< volume_builder_interface< detector_t > > vol_builder)
 Wraps a volume builder.
void add_surfaces (std::shared_ptr< surface_factory_interface< detector_t > > sf_factory, typename detector_t::geometry_context ctx={}) override
 Adds surfaces through the wrapped builder's factory interface.
void add_volume_placement (const typename detector_t::point3_type &t) override
 Adds a placement using a translation and identity rotation.
void add_volume_placement (const typename detector_t::point3_type &t, const typename detector_t::vector3_type &x, const typename detector_t::vector3_type &z) override
 Adds a placement using a translation and its x- and z-axes.
void add_volume_placement (const typename detector_t::transform3_type &trf={}) override
 Adds a placement transform to the wrapped builder.
auto build (detector_t &det, const volume_builder_options &opt, typename detector_t::geometry_context={}) -> typename detector_t::volume_type *override
 Builds the wrapped volume in the detector.
bool has_accel () const override
 Returns whether sensitive surfaces are added to brute force lookup.
void has_accel (bool toggle) override
 Forwards the brute-force acceleration setting to the wrapped builder.
std::string_view name () override
 Returns the wrapped volume's name.
auto operator() () -> typename detector_t::volume_type &override
 Returns the mutable volume being built.
auto operator() () const -> const typename detector_t::volume_type &override
 Returns const access to the wrapped volume.
void set_name (std::string volume_name) override
 Sets the wrapped volume's name.
auto vol_index () const -> dindex override
 Returns the index assigned by the wrapped builder.
Public Member Functions inherited from detray::volume_builder_interface< detector_t >
virtual void add_volume_placement (const dpoint3D< algebra_type > &t)=0
 Add the transform for the volume placement from the translation t.
virtual void add_volume_placement (const dpoint3D< algebra_type > &t, const dvector3D< algebra_type > &x, const dvector3D< algebra_type > &z)=0
 Add the transform for the volume placement from the translation t , the new x- and z-axis (x, z).
virtual void add_volume_placement (const dtransform3D< algebra_type > &trf={})=0
 Add the transform for the volume placement - copy.

Additional Inherited Members

Protected Member Functions inherited from detray::volume_decorator< detector_t >
volume_builder_interface< detector_t > * get_builder ()
 Access to underlying builderReturns a pointer to the wrapped builder.
detector_t::surface_lookup_container & surfaces () override
 Returns mutable access to the wrapped builder's surface lookup container.
detector_t::transform_container & transforms () override
 Returns mutable access to the wrapped builder's transforms.
detector_t::mask_container & masks () override
 Returns mutable access to the wrapped builder's masks.
Protected Member Functions inherited from detray::volume_builder_interface< detector_t >

Detailed Description

template<concepts::detector detector_t, std::size_t DIM = 2u, typename mat_map_factory_t = material_grid_factory<typename detector_t::algebra_type>>
class detray::material_map_builder< detector_t, DIM, mat_map_factory_t >

Build the material maps for a given volume.

Decorator class to a volume builder that adds material maps to either surfaces or volumes

Member Typedef Documentation

◆ bin_data_type

template<concepts::detector detector_t, std::size_t DIM = 2u, typename mat_map_factory_t = material_grid_factory<typename detector_t::algebra_type>>
using detray::material_map_builder< detector_t, DIM, mat_map_factory_t >::bin_data_type
Initial value:
typename fill_by_bin::template bin_data<DIM, value_type>

Bin payload containing a local bin index and its material values.

Constructor & Destructor Documentation

◆ material_map_builder()

template<concepts::detector detector_t, std::size_t DIM = 2u, typename mat_map_factory_t = material_grid_factory<typename detector_t::algebra_type>>
detray::material_map_builder< detector_t, DIM, mat_map_factory_t >::material_map_builder ( std::unique_ptr< volume_builder_interface< detector_t > > vol_builder)
explicit
Parameters
vol_buildervolume builder that should be decorated with material maps

Member Function Documentation

◆ add_surfaces()

template<concepts::detector detector_t, std::size_t DIM = 2u, typename mat_map_factory_t = material_grid_factory<typename detector_t::algebra_type>>
void detray::material_map_builder< detector_t, DIM, mat_map_factory_t >::add_surfaces ( std::shared_ptr< surface_factory_interface< detector_t > > sf_factory,
typename detector_t::geometry_context ctx = {} )
overridevirtual

Overwrite, to add material maps in addition to surfaces.

Parameters
sf_factoryFactory providing surfaces and material-map data.
ctxGeometry context forwarded to the underlying volume builder.

Implements detray::volume_builder_interface< detector_t >.

◆ build()

template<concepts::detector detector_t, std::size_t DIM = 2u, typename mat_map_factory_t = material_grid_factory<typename detector_t::algebra_type>>
auto detray::material_map_builder< detector_t, DIM, mat_map_factory_t >::build ( detector_t & det,
const volume_builder_options & opt,
typename detector_t::geometry_context ctx = {} )->typenamedetector_t::volume_type *
overridevirtual

Add the volume and the material maps to the detector det.

Parameters
detDetector receiving the volume and material maps.
optOptions controlling map construction and deduplication.
ctxGeometry context used for transform lookup.
Returns
Pointer to the built volume.

Implements detray::volume_builder_interface< detector_t >.

◆ data()

template<concepts::detector detector_t, std::size_t DIM = 2u, typename mat_map_factory_t = material_grid_factory<typename detector_t::algebra_type>>
auto detray::material_map_builder< detector_t, DIM, mat_map_factory_t >::data ( ) const->conststd::map< dindex, std::vector< bin_data_type > > &
Returns
the raw materials and their local bin indices that are currently staged in the builder