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

Surface factory decorator that adds material maps to surfaces. More...

#include <detray/builders/material_map_generator.hpp>

Inheritance diagram for detray::material_map_generator< detector_t >:
[legend]
Collaboration diagram for detray::material_map_generator< detector_t >:
[legend]

Public Member Functions

 material_map_generator (std::unique_ptr< surface_factory_interface< detector_t > > factory, const material_map_config< scalar_t > &cfg)
 Construct from configuration cfg.
template<typename bin_data_t, std::size_t N>
auto operator() (typename detector_t::surface_lookup_container &surfaces, const typename detector_t::mask_container &masks, std::map< dindex, std::vector< bin_data_t > > &material_map, std::map< dindex, darray< std::size_t, N > > &n_bins)
 Create material maps for all surfaces that the underlying surface factory builds.
auto operator() (typename detector_t::volume_type &volume, typename detector_t::surface_lookup_container &surfaces, typename detector_t::transform_container &transforms, typename detector_t::mask_container &masks, typename detector_t::geometry_context ctx={}) -> dindex_range override
 Call the underlying surface factory and record the surface range that was produced.
Public Member Functions inherited from detray::factory_decorator< detector_t >
 factory_decorator (std::unique_ptr< surface_factory_interface< detector_t > > factory)
 Wrap a concrete surface factory and forward interface calls to it.
const surface_factory_interface< detector_t > * get_factory () const
dindex size () const override
 Overwrite interface functions using callbacks to the base factory.
void push_back (surface_data< detector_t > &&data) override
 Add data to the factory.
void push_back (std::vector< surface_data< detector_t > > &&data) override
 Forward a batch of surface records to the wrapped factory.
void clear () override
 Clear all data in the factory.
Public Member Functions inherited from detray::surface_factory_interface< detector_t >

Additional Inherited Members

Public Types inherited from detray::surface_factory_interface< detector_t >
using navigation_link = typename detector_t::surface_type::navigation_link
 Navigation link type used by surfaces produced by the factory.
Protected Member Functions inherited from detray::factory_decorator< detector_t >
surface_factory_interface< detector_t > * get_factory ()
Protected Member Functions inherited from detray::surface_factory_interface< detector_t >
template<typename container_t, typename... Args>
dindex insert_in_container (container_t &cont, const typename container_t::value_type value, const dindex idx, Args &&...args) const
 Insert a value in a container at a specific index.

Detailed Description

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

Surface factory decorator that adds material maps to surfaces.

Template Parameters
detector_tthe type of detector the volume belongs to.

Constructor & Destructor Documentation

◆ material_map_generator()

template<concepts::detector detector_t>
detray::material_map_generator< detector_t >::material_map_generator ( std::unique_ptr< surface_factory_interface< detector_t > > factory,
const material_map_config< scalar_t > & cfg )

Construct from configuration cfg.

Parameters
factorySurface factory whose surfaces receive material maps.
cfgBinning and material variation settings.

Member Function Documentation

◆ operator()() [1/2]

template<concepts::detector detector_t>
template<typename bin_data_t, std::size_t N>
auto detray::material_map_generator< detector_t >::operator() ( typename detector_t::surface_lookup_container & surfaces,
const typename detector_t::mask_container & masks,
std::map< dindex, std::vector< bin_data_t > > & material_map,
std::map< dindex, darray< std::size_t, N > > & n_bins )

Create material maps for all surfaces that the underlying surface factory builds.

Parameters
surfacessurface container of the volume builder that should get decorated with material maps.
masksmask store of the volume builder that contains the shapes and extents of the surfaces.
material_mapmap the local bin indices and their content to a volume local surface index.
n_binsthe number of bins per axis per surface.
Returns
No value; material map data and bin counts are written in place.

◆ operator()() [2/2]

template<concepts::detector detector_t>
auto detray::material_map_generator< detector_t >::operator() ( typename detector_t::volume_type & volume,
typename detector_t::surface_lookup_container & surfaces,
typename detector_t::transform_container & transforms,
typename detector_t::mask_container & masks,
typename detector_t::geometry_context ctx = {} )->dindex_range
overridevirtual

Call the underlying surface factory and record the surface range that was produced.

Parameters
volumethe volume the portals need to be added to.
surfacesthe surface collection to wrap and to add the portals to
transformsthe transforms of the surfaces.
masksthe masks of the surfaces.
ctxthe geometry context (not needed for portals).
Returns
Range of surfaces produced by the wrapped factory.

Reimplemented from detray::factory_decorator< detector_t >.