Skip to content

Commit ed0b4b5

Browse files
author
Vakho Tsulaia
committed
Removed passing default value to geometry context argument in several functions in detray core
Addapted tests and tutorials to this change
1 parent 8e5f1fb commit ed0b4b5

File tree

9 files changed

+12
-12
lines changed

9 files changed

+12
-12
lines changed

core/include/detray/navigation/navigator.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -762,7 +762,7 @@ class navigator {
762762
template <typename track_t>
763763
DETRAY_HOST_DEVICE inline bool update_kernel(
764764
const track_t &track, state &navigation, const navigation::config &cfg,
765-
const context_type &ctx = {}) const {
765+
const context_type &ctx) const {
766766

767767
const auto &det = navigation.detector();
768768

core/include/detray/propagator/base_stepper.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ class base_stepper {
8585
DETRAY_HOST_DEVICE state(
8686
const bound_track_parameters_type &bound_params,
8787
const detector_t &det,
88-
const typename detector_t::geometry_context &ctx = {})
88+
const typename detector_t::geometry_context &ctx)
8989
: m_bound_params(bound_params) {
9090

9191
// Surface

core/include/detray/propagator/propagator.hpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ struct propagator {
6868
/// Construct the propagation state with free parameter
6969
DETRAY_HOST_DEVICE state(const free_track_parameters_type &free_params,
7070
const detector_type &det,
71-
const context_type &ctx = {})
71+
const context_type &ctx)
7272
: _stepping(free_params), _navigation(det), _context(ctx) {}
7373

7474
/// Construct the propagation state with free parameter
@@ -106,7 +106,7 @@ struct propagator {
106106
DETRAY_HOST_DEVICE state(const bound_track_parameters_type &param,
107107
const detector_type &det,
108108
const context_type &ctx = {})
109-
: _stepping(param, det), _navigation(det), _context(ctx) {}
109+
: _stepping(param, det, ctx), _navigation(det), _context(ctx) {}
110110

111111
/// Construct the propagation state with bound parameter
112112
template <typename field_t>

core/include/detray/propagator/rk_stepper.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ class rk_stepper final
8080
DETRAY_HOST_DEVICE state(
8181
const bound_track_parameters_type& bound_params,
8282
const magnetic_field_t& mag_field, const detector_t& det,
83-
const typename detector_t::geometry_context& ctx = {})
83+
const typename detector_t::geometry_context& ctx)
8484
: base_type::state(bound_params, det, ctx),
8585
m_magnetic_field(mag_field) {}
8686

tests/include/detray/test/validation/material_validation_utils.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ inline auto record_material(
262262
detray::tie(pathlimit_aborter_state, transporter_state, resetter_state,
263263
interactor_state, mat_tracer_state);
264264

265-
typename propagator_t::state propagation{track, det};
265+
typename propagator_t::state propagation{track, det, cfg.context};
266266

267267
// Run the propagation
268268
bool success = prop.propagate(propagation, actor_states);

tests/include/detray/test/validation/navigation_validation_utils.hpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ struct empty_bfield {};
3838
template <typename stepper_t, typename detector_t,
3939
typename bfield_t = empty_bfield>
4040
inline auto record_propagation(
41-
const typename detector_t::geometry_context,
41+
const typename detector_t::geometry_context ctx,
4242
vecmem::memory_resource *host_mr, const detector_t &det,
4343
const propagation::config &cfg,
4444
const free_track_parameters<typename detector_t::algebra_type> &track,
@@ -88,10 +88,10 @@ inline auto record_propagation(
8888
std::unique_ptr<typename propagator_t::state> propagation{nullptr};
8989
if constexpr (std::is_same_v<bfield_t, empty_bfield>) {
9090
propagation =
91-
std::make_unique<typename propagator_t::state>(track, det);
91+
std::make_unique<typename propagator_t::state>(track, det, ctx);
9292
} else {
9393
propagation =
94-
std::make_unique<typename propagator_t::state>(track, bfield, det);
94+
std::make_unique<typename propagator_t::state>(track, bfield, det, ctx);
9595
}
9696

9797
// Access to navigation information

tests/integration_tests/cpu/propagator/propagator.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ GTEST_TEST(detray_propagator, propagator_line_stepper) {
140140
propagation::config prop_cfg{};
141141
propagator_t p{prop_cfg};
142142

143-
propagator_t::state state(track, d);
143+
propagator_t::state state(track, d, prop_cfg.context);
144144

145145
EXPECT_TRUE(p.propagate(state))
146146
<< state._navigation.inspector().to_string() << std::endl;

tests/unit_tests/cpu/propagator/covariance_transport.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ GTEST_TEST(detray_propagator, covariance_transport) {
9797
propagation::config prop_cfg{};
9898
prop_cfg.navigation.overstep_tolerance = -100.f * unit<float>::um;
9999
propagator_t p{prop_cfg};
100-
propagator_t::state propagation(bound_param0, det);
100+
propagator_t::state propagation(bound_param0, det, prop_cfg.context);
101101

102102
// Run propagator
103103
p.propagate(propagation, detray::tie(bound_updater, rst));

tutorials/src/cpu/propagation/navigation_inspection.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ int main() {
9191
// the same volumes and distances along the way
9292
detray::free_track_parameters<detray::tutorial::algebra_t> track(
9393
ray.pos(), 0.f, ray.dir(), -1.f);
94-
propagator_t::state propagation(track, det);
94+
propagator_t::state propagation(track, det, prop_cfg.context);
9595

9696
// Run the actual propagation
9797
prop.propagate(propagation);

0 commit comments

Comments
 (0)