From d48fbe5b92463ffd929a152a4e0d61d349f200ce Mon Sep 17 00:00:00 2001 From: Stephen Nicholas Swatman Date: Thu, 24 Oct 2024 14:27:47 +0200 Subject: [PATCH] Update detray to v0.80.0 Brings changes to the stepper states and the wire chambers. --- core/include/traccc/finding/actors/ckf_aborter.hpp | 2 +- .../traccc/fitting/kalman_filter/kalman_actor.hpp | 9 +++++---- core/src/finding/find_tracks.hpp | 2 +- .../finding/device/impl/propagate_to_next_surface.ipp | 2 +- examples/simulation/simulate_wire_chamber.cpp | 4 ++-- extern/detray/CMakeLists.txt | 2 +- simulation/include/traccc/simulation/smearing_writer.hpp | 4 ++-- tests/common/tests/kalman_fitting_wire_chamber_test.hpp | 4 ++-- 8 files changed, 15 insertions(+), 14 deletions(-) diff --git a/core/include/traccc/finding/actors/ckf_aborter.hpp b/core/include/traccc/finding/actors/ckf_aborter.hpp index 02eba824a0..d91b46bb2d 100644 --- a/core/include/traccc/finding/actors/ckf_aborter.hpp +++ b/core/include/traccc/finding/actors/ckf_aborter.hpp @@ -41,7 +41,7 @@ struct ckf_aborter : detray::actor { // Abort at the next sensitive surface if (navigation.is_on_sensitive() && - stepping._s > abrt_state.min_step_length) { + stepping.path_from_surface() > abrt_state.min_step_length) { prop_state._heartbeat &= navigation.abort(); abrt_state.success = true; } diff --git a/core/include/traccc/fitting/kalman_filter/kalman_actor.hpp b/core/include/traccc/fitting/kalman_filter/kalman_actor.hpp index 0775311402..23a8864906 100644 --- a/core/include/traccc/fitting/kalman_filter/kalman_actor.hpp +++ b/core/include/traccc/fitting/kalman_filter/kalman_actor.hpp @@ -106,7 +106,7 @@ struct kalman_actor : detray::actor { const bool res = sf.template visit_mask>( - trk_state, propagation._stepping._bound_params); + trk_state, propagation._stepping.bound_params()); // Abort if the Kalman update fails if (!res) { @@ -115,13 +115,14 @@ struct kalman_actor : detray::actor { } // Set full jacobian - trk_state.jacobian() = stepping._full_jacobian; + trk_state.jacobian() = stepping.full_jacobian(); // Change the charge of hypothesized particles when the sign of qop // is changed (This rarely happens when qop is set with a poor seed // resolution) propagation.set_particle(detail::correct_particle_hypothesis( - stepping._ptc, propagation._stepping._bound_params)); + stepping.particle_hypothesis(), + propagation._stepping.bound_params())); // Update iterator actor_state.next(); @@ -132,4 +133,4 @@ struct kalman_actor : detray::actor { } }; -} // namespace traccc \ No newline at end of file +} // namespace traccc diff --git a/core/src/finding/find_tracks.hpp b/core/src/finding/find_tracks.hpp index 4f8e611a06..5a33d4b4d6 100644 --- a/core/src/finding/find_tracks.hpp +++ b/core/src/finding/find_tracks.hpp @@ -324,7 +324,7 @@ track_candidate_container_types::host find_tracks( // If a surface found, add the parameter for the next // step if (s4.success) { - out_params.push_back(propagation._stepping._bound_params); + out_params.push_back(propagation._stepping.bound_params()); param_to_link[step].push_back(link_id); } // Unless the track found a surface, it is considered a diff --git a/device/common/include/traccc/finding/device/impl/propagate_to_next_surface.ipp b/device/common/include/traccc/finding/device/impl/propagate_to_next_surface.ipp index bb518215ce..06ea739494 100644 --- a/device/common/include/traccc/finding/device/impl/propagate_to_next_surface.ipp +++ b/device/common/include/traccc/finding/device/impl/propagate_to_next_surface.ipp @@ -117,7 +117,7 @@ TRACCC_DEVICE inline void propagate_to_next_surface( // If a surface found, add the parameter for the next step if (s4.success) { - params[param_id] = propagation._stepping._bound_params; + params[param_id] = propagation._stepping.bound_params(); if (payload.step == cfg.max_track_candidates_per_track - 1) { tips.push_back({payload.step, param_id}); diff --git a/examples/simulation/simulate_wire_chamber.cpp b/examples/simulation/simulate_wire_chamber.cpp index 071a67a088..1c9073d430 100644 --- a/examples/simulation/simulate_wire_chamber.cpp +++ b/examples/simulation/simulate_wire_chamber.cpp @@ -20,7 +20,7 @@ // detray include(s). #include "detray/detectors/bfield.hpp" #include "detray/io/frontend/detector_writer.hpp" -#include "detray/test/utils/detectors/create_wire_chamber.hpp" +#include "detray/test/utils/detectors/build_wire_chamber.hpp" #include "detray/test/utils/simulation/event_generator/track_generators.hpp" // VecMem include(s). @@ -62,7 +62,7 @@ int simulate(const traccc::opts::generation& generation_opts, // Create the toy geometry const auto [det, name_map] = - detray::create_wire_chamber(host_mr, wire_chamber_cfg); + detray::build_wire_chamber(host_mr, wire_chamber_cfg); /*************************** * Generate simulation data diff --git a/extern/detray/CMakeLists.txt b/extern/detray/CMakeLists.txt index ae2637e7b4..ddd15941c9 100644 --- a/extern/detray/CMakeLists.txt +++ b/extern/detray/CMakeLists.txt @@ -18,7 +18,7 @@ message( STATUS "Building Detray as part of the TRACCC project" ) # Declare where to get Detray from. set( TRACCC_DETRAY_SOURCE -"URL;https://github.com/acts-project/detray/archive/refs/tags/v0.79.0.tar.gz;URL_MD5;b2eb38b7a58c55f41aa5e295c21e1aeb" +"URL;https://github.com/acts-project/detray/archive/refs/tags/v0.80.0.tar.gz;URL_MD5;1ed6ae2925d8638e1e7e554f852b5f4a" CACHE STRING "Source for Detray, when built as part of this project" ) mark_as_advanced( TRACCC_DETRAY_SOURCE ) diff --git a/simulation/include/traccc/simulation/smearing_writer.hpp b/simulation/include/traccc/simulation/smearing_writer.hpp index b1c1cf81dd..523bcef2e0 100644 --- a/simulation/include/traccc/simulation/smearing_writer.hpp +++ b/simulation/include/traccc/simulation/smearing_writer.hpp @@ -120,7 +120,7 @@ struct smearing_writer : detray::actor { const auto track = stepping(); const auto pos = track.pos(); - const auto mom = track.mom(stepping._ptc.charge()); + const auto mom = track.mom(stepping.particle_hypothesis().charge()); const auto sf = navigation.get_surface(); @@ -138,7 +138,7 @@ struct smearing_writer : detray::actor { // Write measurements io::csv::measurement meas; - const auto bound_params = stepping._bound_params; + const auto bound_params = stepping.bound_params(); meas.measurement_id = writer_state.m_hit_count; meas.geometry_id = hit.geometry_id; diff --git a/tests/common/tests/kalman_fitting_wire_chamber_test.hpp b/tests/common/tests/kalman_fitting_wire_chamber_test.hpp index 075078ccd9..134fc64540 100644 --- a/tests/common/tests/kalman_fitting_wire_chamber_test.hpp +++ b/tests/common/tests/kalman_fitting_wire_chamber_test.hpp @@ -13,7 +13,7 @@ // Detray include(s). #include "detray/detectors/bfield.hpp" #include "detray/io/frontend/detector_writer.hpp" -#include "detray/test/utils/detectors/create_wire_chamber.hpp" +#include "detray/test/utils/detectors/build_wire_chamber.hpp" // System include(s) #include @@ -76,7 +76,7 @@ class KalmanFittingWireChamberTests : public KalmanFittingTests { // wire_chamber_cfg.m_thickness = 100.f * detray::unit::um; // Create telescope detector - auto [det, name_map] = create_wire_chamber(host_mr, wire_chamber_cfg); + auto [det, name_map] = build_wire_chamber(host_mr, wire_chamber_cfg); // Write detector file auto writer_cfg = detray::io::detector_writer_config{}