Skip to content

Commit 7a19579

Browse files
authored
Merge pull request #1174 from niermann999/fix-parameter-resetter
fix: add parameter resetter to CKF
2 parents 3aae9c5 + c29e882 commit 7a19579

File tree

4 files changed

+33
-21
lines changed

4 files changed

+33
-21
lines changed

core/include/traccc/finding/actors/ckf_aborter.hpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ struct ckf_aborter : detray::actor {
3838
propagator_state_t &prop_state) const {
3939

4040
auto &navigation = prop_state._navigation;
41-
auto &stepping = prop_state._stepping;
41+
const auto &stepping = prop_state._stepping;
4242

4343
abrt_state.count++;
4444
abrt_state.path_from_surface += stepping.step_size();
@@ -51,8 +51,7 @@ struct ckf_aborter : detray::actor {
5151
}
5252

5353
// Reset path from surface
54-
if (navigation.is_on_sensitive() ||
55-
navigation.encountered_sf_material()) {
54+
if (navigation.is_on_sensitive()) {
5655
abrt_state.path_from_surface = 0.f;
5756
}
5857

core/include/traccc/finding/details/combinatorial_kalman_filter.hpp

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -477,20 +477,22 @@ combinatorial_kalman_filter(
477477
traccc::details::ckf_interactor_t::state s2;
478478
typename interaction_register<
479479
traccc::details::ckf_interactor_t>::state s1{s2};
480-
typename detray::momentum_aborter<scalar_type>::state s3{};
481-
typename ckf_aborter::state s4;
480+
// typename detray::parameter_resetter<
481+
// typename detector_t::algebra_type>::state s3{};
482+
typename detray::momentum_aborter<scalar_type>::state s4{};
483+
typename ckf_aborter::state s5;
482484
// Update the actor config
483-
s4.min_step_length = config.min_step_length_for_next_surface;
484-
s4.max_count = config.max_step_counts_for_next_surface;
485-
s3.min_pT(static_cast<scalar_type>(config.min_pT));
486-
s3.min_p(static_cast<scalar_type>(config.min_p));
485+
s4.min_pT(static_cast<scalar_type>(config.min_pT));
486+
s4.min_p(static_cast<scalar_type>(config.min_p));
487+
s5.min_step_length = config.min_step_length_for_next_surface;
488+
s5.max_count = config.max_step_counts_for_next_surface;
487489

488490
// Propagate to the next surface
489-
propagator.propagate(propagation, detray::tie(s0, s1, s2, s3, s4));
491+
propagator.propagate(propagation, detray::tie(s0, s1, s2, s4, s5));
490492

491493
// If a surface found, add the parameter for the next
492494
// step
493-
if (s4.success) {
495+
if (s5.success) {
494496
assert(propagation._navigation.is_on_sensitive());
495497
assert(!propagation._stepping.bound_params().is_invalid());
496498

@@ -499,14 +501,14 @@ combinatorial_kalman_filter(
499501
}
500502
// Unless the track found a surface, it is considered a
501503
// tip
502-
else if (!s4.success &&
504+
else if (!s5.success &&
503505
(step >= (config.min_track_candidates_per_track - 1u))) {
504506
tips.push_back({step, link_id});
505507
}
506508

507509
// If no more CKF step is expected, current candidate is
508510
// kept as a tip
509-
if (s4.success &&
511+
if (s5.success &&
510512
(step == (config.max_track_candidates_per_track - 1u))) {
511513
tips.push_back({step, link_id});
512514
}

core/include/traccc/finding/details/combinatorial_kalman_filter_types.hpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
#include <detray/navigation/navigator.hpp>
1818
#include <detray/propagator/actor_chain.hpp>
1919
#include <detray/propagator/actors/aborters.hpp>
20+
#include <detray/propagator/actors/parameter_resetter.hpp>
2021
#include <detray/propagator/actors/parameter_transporter.hpp>
2122
#include <detray/propagator/actors/pointwise_material_interactor.hpp>
2223
#include <detray/propagator/constrained_step.hpp>
@@ -49,6 +50,7 @@ using ckf_actor_chain_t =
4950
detray::parameter_transporter<traccc::default_algebra>,
5051
interaction_register<ckf_interactor_t>,
5152
ckf_interactor_t,
53+
detray::parameter_resetter<traccc::default_algebra>,
5254
detray::momentum_aborter<traccc::scalar>, ckf_aborter>;
5355

5456
/// Propagator type used in the Combinatorial Kalman Filter (CKF)

device/common/include/traccc/finding/device/impl/propagate_to_next_surface.ipp

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -77,25 +77,34 @@ TRACCC_HOST_DEVICE inline void propagate_to_next_surface(
7777
// @NOTE: Post material interaction might be required here
7878
using actor_tuple_type =
7979
typename propagator_t::actor_chain_type::actor_tuple;
80+
// Pathlimit aborter
8081
typename detray::detail::tuple_element<0, actor_tuple_type>::type::state
8182
s0{};
83+
// CKF-interactor
8284
typename detray::detail::tuple_element<3, actor_tuple_type>::type::state
8385
s3{};
86+
// Interaction register
8487
typename detray::detail::tuple_element<2, actor_tuple_type>::type::state s2{
8588
s3};
86-
typename detray::detail::tuple_element<4, actor_tuple_type>::type::state s4;
87-
89+
// Parameter resetter
90+
// typename detray::detail::tuple_element<4, actor_tuple_type>::type::state
91+
// s4{
92+
// cfg.propagation};
93+
// Momentum aborter
8894
typename detray::detail::tuple_element<5, actor_tuple_type>::type::state s5;
89-
s5.min_step_length = cfg.min_step_length_for_next_surface;
90-
s5.max_count = cfg.max_step_counts_for_next_surface;
91-
s4.min_pT(static_cast<scalar_t>(cfg.min_pT));
92-
s4.min_p(static_cast<scalar_t>(cfg.min_p));
95+
// CKF aborter
96+
typename detray::detail::tuple_element<6, actor_tuple_type>::type::state s6;
97+
98+
s6.min_step_length = cfg.min_step_length_for_next_surface;
99+
s6.max_count = cfg.max_step_counts_for_next_surface;
100+
s5.min_pT(static_cast<scalar_t>(cfg.min_pT));
101+
s5.min_p(static_cast<scalar_t>(cfg.min_p));
93102

94103
// Propagate to the next surface
95-
propagator.propagate(propagation, detray::tie(s0, s2, s3, s4, s5));
104+
propagator.propagate(propagation, detray::tie(s0, s2, s3, s5, s6));
96105

97106
// If a surface found, add the parameter for the next step
98-
if (s5.success) {
107+
if (s6.success) {
99108
assert(propagation._navigation.is_on_sensitive());
100109
assert(!propagation._stepping.bound_params().is_invalid());
101110

0 commit comments

Comments
 (0)