Skip to content

Commit

Permalink
Update detray to v0.80.0
Browse files Browse the repository at this point in the history
Brings changes to the stepper states and the wire chambers.
  • Loading branch information
stephenswat committed Oct 24, 2024
1 parent d4d6531 commit d48fbe5
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 14 deletions.
2 changes: 1 addition & 1 deletion core/include/traccc/finding/actors/ckf_aborter.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
9 changes: 5 additions & 4 deletions core/include/traccc/fitting/kalman_filter/kalman_actor.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ struct kalman_actor : detray::actor {

const bool res =
sf.template visit_mask<gain_matrix_updater<algebra_t>>(
trk_state, propagation._stepping._bound_params);
trk_state, propagation._stepping.bound_params());

// Abort if the Kalman update fails
if (!res) {
Expand All @@ -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();
Expand All @@ -132,4 +133,4 @@ struct kalman_actor : detray::actor {
}
};

} // namespace traccc
} // namespace traccc
2 changes: 1 addition & 1 deletion core/src/finding/find_tracks.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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});
Expand Down
4 changes: 2 additions & 2 deletions examples/simulation/simulate_wire_chamber.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion extern/detray/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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 )
Expand Down
4 changes: 2 additions & 2 deletions simulation/include/traccc/simulation/smearing_writer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand All @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions tests/common/tests/kalman_fitting_wire_chamber_test.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 <array>
Expand Down Expand Up @@ -76,7 +76,7 @@ class KalmanFittingWireChamberTests : public KalmanFittingTests {
// wire_chamber_cfg.m_thickness = 100.f * detray::unit<scalar>::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{}
Expand Down

0 comments on commit d48fbe5

Please sign in to comment.