@@ -88,6 +88,12 @@ class tracking_volume {
8888 DETRAY_HOST_DEVICE
8989 constexpr auto index () const -> dindex { return m_desc.index (); }
9090
91+ // / @returns the volume name (add an offset for the detector name).
92+ DETRAY_HOST
93+ auto name (const name_map &names) const -> std::string {
94+ return names.empty () ? " unknown volume" : names.at (m_desc.index () + 1u );
95+ }
96+
9197 // / @returns the (non contextual) transform for the placement of the
9298 // / volume in the detector geometry.
9399 DETRAY_HOST_DEVICE
@@ -144,7 +150,7 @@ class tracking_volume {
144150 // / @tparam functor_t the prescription to be applied to the surfaces
145151 // / @tparam Args types of additional arguments to the functor
146152 template <object_id I, typename functor_t , typename ... Args>
147- DETRAY_HOST_DEVICE constexpr void visit_accelerator (Args &&... args) const {
153+ DETRAY_HOST_DEVICE constexpr void visit_accelerator (Args &&...args) const {
148154 static_assert (I < object_id::e_all);
149155
150156 if (const auto &link{m_desc.template accel_link <I>()};
@@ -163,8 +169,7 @@ class tracking_volume {
163169 // / @tparam Args types of additional arguments to the functor
164170 template <typename functor_t ,
165171 int I = static_cast <int >(object_id::e_all) - 1 , typename ... Args>
166- DETRAY_HOST_DEVICE constexpr void visit_accelerators (
167- Args &&... args) const {
172+ DETRAY_HOST_DEVICE constexpr void visit_accelerators (Args &&...args) const {
168173 // Get the acceleration data structures for this volume and only visit,
169174 // if object type is contained in volume
170175 visit_accelerator<static_cast <object_id>(I), functor_t >(
@@ -184,7 +189,7 @@ class tracking_volume {
184189 // / @tparam functor_t the prescription to be applied to the surfaces
185190 // / @tparam Args types of additional arguments to the functor
186191 template <surface_id I, typename functor_t , typename ... Args>
187- DETRAY_HOST_DEVICE constexpr void visit_surfaces (Args &&... args) const {
192+ DETRAY_HOST_DEVICE constexpr void visit_surfaces (Args &&...args) const {
188193 using surface_getter_t = detail::surface_getter<functor_t >;
189194
190195 // Dispatch to the correct acceleration structure
@@ -223,7 +228,7 @@ class tracking_volume {
223228 // / @tparam Args types of additional arguments to the functor
224229 template <surface_id I, typename functor_t , typename ... Args>
225230 DETRAY_HOST_DEVICE constexpr void visit_daughter_volumes (
226- Args &&... args) const {
231+ Args &&...args) const {
227232 using volume_getter_t = detail::volume_getter<functor_t >;
228233
229234 visit_accelerator<object_id::e_volume, volume_getter_t >(
@@ -243,9 +248,10 @@ class tracking_volume {
243248 // / @tparam Args types of additional arguments to the functor
244249 template <object_id I, typename functor_t , typename track_t ,
245250 typename config_t , typename ... Args>
246- DETRAY_HOST_DEVICE constexpr void visit_neighborhood (
247- const track_t &track, const config_t &cfg, const context_t &ctx,
248- Args &&... args) const {
251+ DETRAY_HOST_DEVICE constexpr void visit_neighborhood (const track_t &track,
252+ const config_t &cfg,
253+ const context_t &ctx,
254+ Args &&...args) const {
249255 if constexpr (I == object_id::e_all) {
250256 visit_accelerators<detail::neighborhood_getter<functor_t >>(
251257 m_detector, m_desc, track, cfg, ctx,
@@ -372,12 +378,6 @@ class tracking_volume {
372378 return true ;
373379 }
374380
375- // / @returns the volume name (add an offset for the detector name).
376- DETRAY_HOST_DEVICE
377- auto name (const name_map &names) const -> std::string {
378- return names.empty () ? " " : names.at (m_desc.index () + 1u );
379- }
380-
381381 // / @returns a string stream that prints the volume details
382382 DETRAY_HOST
383383 friend std::ostream &operator <<(std::ostream &os,
0 commit comments