diff --git a/core/src/finding/find_tracks.hpp b/core/src/finding/find_tracks.hpp index 0cc58ed9d..7dc96f4f6 100644 --- a/core/src/finding/find_tracks.hpp +++ b/core/src/finding/find_tracks.hpp @@ -310,36 +310,45 @@ track_candidate_container_types::host find_tracks( .template set_constraint( config.propagation.stepping.step_constraint); - detray::pathlimit_aborter::state s0; - typename detray::parameter_transporter::state s1; - typename interactor_type::state s2; - typename ckf_aborter::state s3; - s3.min_step_length = config.min_step_length_for_next_surface; - s3.max_count = config.max_step_counts_for_next_surface; + // Generate actor states and references to the states + auto [actors_states, actor_chain_state] = + actor_type::make_actor_states(); + + auto& path_abrt_state = + detray::detail::get( + actors_states); + path_abrt_state.set_path_limit( + config.propagation.stepping.path_limit); + + auto& ckf_abrt_state = + detray::detail::get(actors_states); + ckf_abrt_state.min_step_length = + config.min_step_length_for_next_surface; + ckf_abrt_state.max_count = config.max_step_counts_for_next_surface; // @TODO: Should be removed once detray is fixed to set the // volume in the constructor propagation._navigation.set_volume(param.surface_link().volume()); // Propagate to the next surface - propagator.propagate_sync(propagation, detray::tie(s0, s1, s2, s3)); + propagator.propagate_sync(propagation, actor_chain_state); // If a surface found, add the parameter for the next // step - if (s3.success) { + if (ckf_abrt_state.success) { 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 // tip - else if (!s3.success && + else if (!ckf_abrt_state.success && (step >= (config.min_track_candidates_per_track - 1u))) { tips.push_back({step, link_id}); } // If no more CKF step is expected, current candidate is // kept as a tip - if (s3.success && + if (ckf_abrt_state.success && (step == (config.max_track_candidates_per_track - 1u))) { tips.push_back({step, link_id}); } 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 e4caa084b..33997a78a 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 @@ -23,7 +23,7 @@ namespace traccc::device { template TRACCC_DEVICE inline void propagate_to_next_surface( std::size_t globalIndex, const config_t cfg, - const propagate_to_next_surface_payload& payload) { + const propagate_to_next_surface_payload &payload) { if (globalIndex >= payload.n_in_params) { return; @@ -91,30 +91,29 @@ TRACCC_DEVICE inline void propagate_to_next_surface( .template set_constraint( cfg.propagation.stepping.step_constraint); - // Actor state - // @TODO: simplify the syntax here - // @NOTE: Post material interaction might be required here - using actor_list_type = - typename propagator_t::actor_chain_type::actor_list_type; - typename detray::detail::tuple_element<0, actor_list_type>::type::state - s0{}; - typename detray::detail::tuple_element<1, actor_list_type>::type::state - s1{}; - typename detray::detail::tuple_element<2, actor_list_type>::type::state - s2{}; - typename detray::detail::tuple_element<3, actor_list_type>::type::state s3; - s3.min_step_length = cfg.min_step_length_for_next_surface; - s3.max_count = cfg.max_step_counts_for_next_surface; + // Generate actor states and references to the states + using actor_chain_t = typename propagator_t::actor_chain_type; + auto [actors_states, actor_chain_state] = + actor_chain_t::make_actor_states(); + + auto &path_abrt_state = + detray::detail::get(actors_states); + path_abrt_state.set_path_limit(cfg.propagation.stepping.path_limit); + + auto &ckf_abrt_state = + detray::detail::get(actors_states); + ckf_abrt_state.min_step_length = cfg.min_step_length_for_next_surface; + ckf_abrt_state.max_count = cfg.max_step_counts_for_next_surface; // @TODO: Should be removed once detray is fixed to set the volume in the // constructor propagation._navigation.set_volume(in_par.surface_link().volume()); // Propagate to the next surface - propagator.propagate_sync(propagation, detray::tie(s0, s1, s2, s3)); + propagator.propagate_sync(propagation, actor_chain_state); // If a surface found, add the parameter for the next step - if (s3.success) { + if (ckf_abrt_state.success) { params[param_id] = propagation._stepping.bound_params(); if (payload.step == cfg.max_track_candidates_per_track - 1) {