Skip to content

Commit

Permalink
Merge branch 'main' into fatras
Browse files Browse the repository at this point in the history
  • Loading branch information
kodiakhq[bot] authored Dec 16, 2024
2 parents 2872d74 + 1960d7a commit 18f8846
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 19 deletions.
19 changes: 2 additions & 17 deletions Core/include/Acts/TrackFitting/GaussianSumFitter.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,20 +77,6 @@ struct GaussianSumFitter {
/// The actor type
using GsfActor = detail::GsfActor<bethe_heitler_approx_t, traj_t>;

/// This allows to break the propagation by setting the navigationBreak
/// TODO refactor once we can do this more elegantly
struct NavigationBreakAborter {
NavigationBreakAborter() = default;

template <typename propagator_state_t, typename stepper_t,
typename navigator_t>
bool checkAbort(propagator_state_t& state, const stepper_t& /*stepper*/,
const navigator_t& navigator,
const Logger& /*logger*/) const {
return navigator.navigationBreak(state.navigation);
}
};

/// @brief The fit function for the Direct navigator
template <typename source_link_it_t, typename start_parameters_t,
TrackContainerFrontend track_container_t>
Expand All @@ -105,7 +91,7 @@ struct GaussianSumFitter {

// Initialize the forward propagation with the DirectNavigator
auto fwdPropInitializer = [&sSequence, this](const auto& opts) {
using Actors = ActorList<GsfActor, NavigationBreakAborter>;
using Actors = ActorList<GsfActor>;
using PropagatorOptions = typename propagator_t::template Options<Actors>;

PropagatorOptions propOptions(opts.geoContext, opts.magFieldContext);
Expand Down Expand Up @@ -151,8 +137,7 @@ struct GaussianSumFitter {

// Initialize the forward propagation with the DirectNavigator
auto fwdPropInitializer = [this](const auto& opts) {
using Actors =
ActorList<GsfActor, EndOfWorldReached, NavigationBreakAborter>;
using Actors = ActorList<GsfActor, EndOfWorldReached>;
using PropagatorOptions = typename propagator_t::template Options<Actors>;

PropagatorOptions propOptions(opts.geoContext, opts.magFieldContext);
Expand Down
11 changes: 9 additions & 2 deletions Core/include/Acts/TrackFitting/detail/GsfActor.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -317,13 +317,20 @@ struct GsfActor {
applyMultipleScattering(state, stepper, navigator,
MaterialUpdateStage::PostUpdate);
}
}

// Break the navigation if we found all measurements
template <typename propagator_state_t, typename stepper_t,
typename navigator_t>
bool checkAbort(propagator_state_t& /*state*/, const stepper_t& /*stepper*/,
const navigator_t& /*navigator*/, const result_type& result,
const Logger& /*logger*/) const {
if (m_cfg.numberMeasurements &&
result.measurementStates == m_cfg.numberMeasurements) {
ACTS_VERBOSE("Stop navigation because all measurements are found");
navigator.navigationBreak(state.navigation, true);
return true;
}

return false;
}

template <typename propagator_state_t, typename stepper_t,
Expand Down

0 comments on commit 18f8846

Please sign in to comment.