12#include "detray/builders/detail/bin_association.hpp"
13#include "detray/core/concepts.hpp"
14#include "detray/utils/grid/axis.hpp"
15#include "detray/utils/grid/concepts.hpp"
16#include "detray/utils/grid/populators.hpp"
32 template <std::
size_t DIM,
typename value_t>
42 template <concepts::gr
id gr
id_t>
49 typename surface_container_t,
typename mask_container,
50 typename transform_container,
typename context_t,
typename... Args>
52 const surface_container_t & ,
53 const mask_container & ,
58 grid.template populate<attach<>>(bd.local_bin_idx, bd.single_element);
77 typename surface_container_t,
typename mask_container,
78 typename transform_container,
typename context_t,
typename... Args>
80 const surface_container_t &surfaces,
81 const transform_container &transforms,
82 const mask_container & ,
83 const context_t ctx, Args &&...) const
86 for (
const auto &sf : surfaces) {
88 if (sf.volume() == vol.index() && sf.is_sensitive()) {
89 const auto &sf_trf = transforms.at(sf.transform(), ctx);
90 const auto &t = sf_trf.translation();
93 const auto loc_pos =
grid.project(vol.transform(), t, t);
96 grid.template populate<attach<>>(loc_pos, sf);
117 const volume_type &vol,
118 const typename detector_t::geometry_context ctx,
119 Args &&...) const ->
void {
120 this->
operator()(grid, det.surfaces(vol), det.mask_store(),
121 det.transform_store(), ctx);
131 typename surface_container_t,
typename mask_container,
132 typename transform_container,
typename context_t,
typename... Args>
134 const surface_container_t &surfaces,
135 const transform_container &transforms,
136 const mask_container &masks,
const context_t ctx,
137 Args &&...) const ->
void {
142 bin_association(ctx, surfaces, transforms, masks,
grid,
Check if a type can be used as a detector.
Definition concepts.hpp:47
Definition concepts.hpp:64
Grid that contains surfaces (used e.g.
Definition concepts.hpp:115
Detray include(s).
Definition array_operators.hpp:18
get_scalar_t< A, T > dscalar
Scalar type for algebra A and value type T.
Definition algebra.hpp:64
std::array< value_t, kDIM > darray
Fixed-size array container.
Definition containers.hpp:30
grid_impl< coordinate_axes< axes_t, algebra_t, ownership, containers >, bin_t, simple_serializer > grid
Type alias for easier construction.
Definition grid.hpp:422
Multi-bin: contains bin indices from multiple axes.
Definition axis.hpp:36
Fill a grid surface finder by bin association.
Definition bin_fillers.hpp:108
auto operator()(grid_t &grid, const volume_t &, const surface_container_t &surfaces, const transform_container &transforms, const mask_container &masks, const context_t ctx, Args &&...) const -> void
Associate supplied surfaces with bins by matching their contours.
Definition bin_fillers.hpp:133
auto operator()(grid_t &grid, detector_t &det, const volume_type &vol, const typename detector_t::geometry_context ctx, Args &&...) const -> void
Associate detector surfaces with bins based on their boundaries.
Definition bin_fillers.hpp:116
Single piece of data for a grid bin.
Definition bin_fillers.hpp:33
typename grid_t::value_type single_element
Definition bin_fillers.hpp:38
detray::axis::multi_bin< DIM > local_bin_idx
Definition bin_fillers.hpp:35
Fill a surface grid using a local bin index of the grid and a payload.
Definition bin_fillers.hpp:30
bin_data< grid_t::dim, typename grid_t::value_type > bin_data_type
Grid-bin payload type used by the bin filler.
Definition bin_fillers.hpp:43
auto operator()(grid_t &grid, const volume_t &, const surface_container_t &, const mask_container &, const context_t, std::vector< bin_data_type< grid_t > > &bins) const -> void
Populate a grid from the supplied bin indices and payload values.
Definition bin_fillers.hpp:51
Fill a surface grid using the surface translation.
Definition bin_fillers.hpp:69
auto operator()(grid_t &grid, const volume_t &vol, const surface_container_t &surfaces, const transform_container &transforms, const mask_container &, const context_t ctx, Args &&...) const -> void
Populate a surface grid from the translations of its sensitive surfaces.
Definition bin_fillers.hpp:79