1414#include " detray/materials/detail/concepts.hpp"
1515#include " detray/materials/detail/material_accessor.hpp"
1616#include " detray/materials/material.hpp"
17+ #include " detray/navigation/accelerators/search_window.hpp"
1718#include " detray/navigation/concepts.hpp"
1819
1920namespace detray ::detail {
@@ -67,27 +68,6 @@ struct surface_getter {
6768 }
6869};
6970
70- // / A functor to access the daughter volumes of a volume
71- template <typename functor_t >
72- struct volume_getter {
73-
74- // / Call operator that forwards the functor call to all contained daughter
75- // / volumes
76- template <concepts::accelerator_collection accel_coll_t ,
77- typename accel_index_t , typename ... Args>
78- DETRAY_HOST_DEVICE inline void operator ()(const accel_coll_t &,
79- const accel_index_t ,
80- Args &&...) const {
81-
82- using accel_type = typename accel_coll_t ::value_type;
83-
84- if constexpr (concepts::volume_accelerator<accel_type>) {
85- // Run over all the daughter volumes
86- // TODO: Implement e.g. BVH
87- }
88- }
89- };
90-
9171// / A functor to find surfaces in the neighborhood of a track position
9272template <typename functor_t >
9373struct neighborhood_getter {
@@ -96,30 +76,46 @@ struct neighborhood_getter {
9676 // / to a surface finder data structure
9777 template <concepts::accelerator_collection accel_coll_t ,
9878 typename accel_index_t , typename detector_t , typename track_t ,
99- typename config_t , typename ... Args>
79+ concepts::arithmetic window_size_t , typename ... Args>
10080 DETRAY_HOST_DEVICE inline void operator ()(
10181 const accel_coll_t &coll, const accel_index_t index,
10282 const detector_t &det, const typename detector_t ::volume_type &volume,
103- const track_t &track, const config_t &cfg ,
83+ const track_t &track, const search_window< window_size_t , 2 > &win_size ,
10484 const typename detector_t ::geometry_context &ctx,
10585 Args &&...args) const {
10686
87+ using accel_type = typename accel_coll_t ::value_type;
88+
10789 decltype (auto ) accel = coll[index];
10890
109- // Run over the surfaces in a single acceleration data structure
110- for (const auto &sf : accel.search (det, volume, track, cfg, ctx)) {
111- functor_t {}(sf, std::forward<Args>(args)...);
91+ if constexpr (concepts::surface_accelerator<accel_type>) {
92+ // Run over the surfaces in a single acceleration data structure
93+ for (const auto &sf :
94+ accel.search (det, volume, track, win_size, ctx)) {
95+ functor_t {}(sf, std::forward<Args>(args)...);
96+ }
11297 }
11398 }
11499};
115100
116- // / Query the maximal number of candidates from the acceleration
117- struct n_candidates_getter {
101+ // / A functor to access the daughter volumes of a volume
102+ template <typename functor_t >
103+ struct volume_getter {
104+
105+ // / Call operator that forwards the functor call to all contained daughter
106+ // / volumes
118107 template <concepts::accelerator_collection accel_coll_t ,
119- typename accel_index_t >
120- DETRAY_HOST_DEVICE inline auto operator ()(const accel_coll_t &coll,
121- const accel_index_t index) const {
122- return coll[index].n_max_candidates ();
108+ typename accel_index_t , typename ... Args>
109+ DETRAY_HOST_DEVICE inline void operator ()(const accel_coll_t &,
110+ const accel_index_t ,
111+ Args &&...) const {
112+
113+ using accel_type = typename accel_coll_t ::value_type;
114+
115+ if constexpr (concepts::volume_accelerator<accel_type>) {
116+ // Run over all the daughter volumes
117+ // TODO: Implement e.g. BVH
118+ }
123119 }
124120};
125121
0 commit comments