Skip to content

Commit

Permalink
refactor: Generalise voidKalmanComponents (#2394)
Browse files Browse the repository at this point in the history
Since we are now using the `voidKalmanComponents` in KF, CKF, GSF, and GX2F we should generalise them. This removes a misleading dependency of the other fitters on the KF.

Co-authored-by: Paul Gessinger <1058585+paulgessinger@users.noreply.github.com>
  • Loading branch information
AJPfleger and paulgessinger committed Sep 4, 2023
1 parent 6974f92 commit 07c292a
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 25 deletions.
8 changes: 4 additions & 4 deletions Core/include/Acts/TrackFinding/CombinatorialKalmanFilter.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
#include "Acts/TrackFinding/CombinatorialKalmanFilterError.hpp"
#include "Acts/TrackFinding/SourceLinkAccessorConcept.hpp"
#include "Acts/TrackFitting/KalmanFitter.hpp"
#include "Acts/TrackFitting/detail/VoidKalmanComponents.hpp"
#include "Acts/TrackFitting/detail/VoidFitterComponents.hpp"
#include "Acts/Utilities/CalibrationContext.hpp"
#include "Acts/Utilities/Logger.hpp"
#include "Acts/Utilities/Result.hpp"
Expand Down Expand Up @@ -94,9 +94,9 @@ struct CombinatorialKalmanFilterExtensions {

/// Default constructor which connects the default void components
CombinatorialKalmanFilterExtensions() {
calibrator.template connect<&voidKalmanCalibrator<traj_t>>();
updater.template connect<&voidKalmanUpdater<traj_t>>();
smoother.template connect<&voidKalmanSmoother<traj_t>>();
calibrator.template connect<&detail::voidFitterCalibrator<traj_t>>();
updater.template connect<&detail::voidFitterUpdater<traj_t>>();
smoother.template connect<&detail::voidFitterSmoother<traj_t>>();
branchStopper.connect<voidBranchStopper>();
measurementSelector.template connect<voidMeasurementSelector>();
}
Expand Down
10 changes: 5 additions & 5 deletions Core/include/Acts/TrackFitting/GlobalChiSquareFitter.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
#include "Acts/Propagator/StraightLineStepper.hpp"
#include "Acts/Propagator/detail/PointwiseMaterialInteraction.hpp"
#include "Acts/TrackFitting/detail/KalmanUpdateHelpers.hpp"
#include "Acts/TrackFitting/detail/VoidKalmanComponents.hpp"
#include "Acts/TrackFitting/detail/VoidFitterComponents.hpp"
#include "Acts/Utilities/CalibrationContext.hpp"
#include "Acts/Utilities/Delegate.hpp"
#include "Acts/Utilities/Logger.hpp"
Expand Down Expand Up @@ -78,12 +78,12 @@ struct Gx2FitterExtensions {
/// Retrieves the associated surface from a source link
SourceLinkSurfaceAccessor surfaceAccessor;

// TODO get an own Calibrator and Updater
// @TODO get an own Calibrator and Updater
/// Default constructor which connects the default void components
Gx2FitterExtensions() {
calibrator.template connect<&voidKalmanCalibrator<traj_t>>();
updater.template connect<&voidKalmanUpdater<traj_t>>();
outlierFinder.template connect<&voidOutlierFinder<traj_t>>();
calibrator.template connect<&detail::voidFitterCalibrator<traj_t>>();
updater.template connect<&detail::voidFitterUpdater<traj_t>>();
outlierFinder.template connect<&detail::voidOutlierFinder<traj_t>>();
}
};

Expand Down
8 changes: 4 additions & 4 deletions Core/include/Acts/TrackFitting/GsfOptions.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#include "Acts/MagneticField/MagneticFieldContext.hpp"
#include "Acts/Propagator/MultiEigenStepperLoop.hpp"
#include "Acts/Propagator/Propagator.hpp"
#include "Acts/TrackFitting/detail/VoidKalmanComponents.hpp"
#include "Acts/TrackFitting/detail/VoidFitterComponents.hpp"
#include "Acts/Utilities/CalibrationContext.hpp"
#include "Acts/Utilities/Delegate.hpp"
#include "Acts/Utilities/Logger.hpp"
Expand Down Expand Up @@ -61,9 +61,9 @@ struct GsfExtensions {

/// Default constructor which connects the default void components
GsfExtensions() {
calibrator.template connect<&voidKalmanCalibrator<traj_t>>();
updater.template connect<&voidKalmanUpdater<traj_t>>();
outlierFinder.template connect<&voidOutlierFinder<traj_t>>();
calibrator.template connect<&detail::voidFitterCalibrator<traj_t>>();
updater.template connect<&detail::voidFitterUpdater<traj_t>>();
outlierFinder.template connect<&detail::voidOutlierFinder<traj_t>>();
}
};

Expand Down
12 changes: 6 additions & 6 deletions Core/include/Acts/TrackFitting/KalmanFitter.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
#include "Acts/Propagator/detail/PointwiseMaterialInteraction.hpp"
#include "Acts/TrackFitting/KalmanFitterError.hpp"
#include "Acts/TrackFitting/detail/KalmanUpdateHelpers.hpp"
#include "Acts/TrackFitting/detail/VoidKalmanComponents.hpp"
#include "Acts/TrackFitting/detail/VoidFitterComponents.hpp"
#include "Acts/Utilities/CalibrationContext.hpp"
#include "Acts/Utilities/Delegate.hpp"
#include "Acts/Utilities/Logger.hpp"
Expand Down Expand Up @@ -90,12 +90,12 @@ struct KalmanFitterExtensions {

/// Default constructor which connects the default void components
KalmanFitterExtensions() {
calibrator.template connect<&voidKalmanCalibrator<traj_t>>();
updater.template connect<&voidKalmanUpdater<traj_t>>();
smoother.template connect<&voidKalmanSmoother<traj_t>>();
outlierFinder.template connect<&voidOutlierFinder<traj_t>>();
calibrator.template connect<&detail::voidFitterCalibrator<traj_t>>();
updater.template connect<&detail::voidFitterUpdater<traj_t>>();
smoother.template connect<&detail::voidFitterSmoother<traj_t>>();
outlierFinder.template connect<&detail::voidOutlierFinder<traj_t>>();
reverseFilteringLogic
.template connect<&voidReverseFilteringLogic<traj_t>>();
.template connect<&detail::voidReverseFilteringLogic<traj_t>>();
}
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,18 @@
#include "Acts/Utilities/Result.hpp"
#include "Acts/Utilities/TypeTraits.hpp"

namespace Acts {
namespace Acts::detail {

template <typename traj_t>
void voidKalmanCalibrator(const GeometryContext& /*gctx*/,
void voidFitterCalibrator(const GeometryContext& /*gctx*/,
const CalibrationContext& /*cctx*/,
const SourceLink& /*sourceLink*/,
typename traj_t::TrackStateProxy /*trackState*/) {
throw std::runtime_error{"VoidKalmanCalibrator should not ever execute"};
throw std::runtime_error{"voidFitterCalibrator should not ever execute"};
}

template <typename traj_t>
Result<void> voidKalmanUpdater(const GeometryContext& /*gctx*/,
Result<void> voidFitterUpdater(const GeometryContext& /*gctx*/,
typename traj_t::TrackStateProxy trackState,
Direction /*direction*/,
const Logger& /*logger*/) {
Expand All @@ -38,7 +38,7 @@ Result<void> voidKalmanUpdater(const GeometryContext& /*gctx*/,
}

template <typename traj_t>
Result<void> voidKalmanSmoother(const GeometryContext& /*gctx*/,
Result<void> voidFitterSmoother(const GeometryContext& /*gctx*/,
traj_t& trackStates, size_t entry,
const Logger& /*logger*/) {
trackStates.applyBackwards(entry, [](auto trackState) {
Expand All @@ -64,4 +64,4 @@ inline const Surface* voidSurfaceAccessor(const SourceLink& /*sourceLink*/) {
throw std::runtime_error{"voidSurfaceAccessor should not ever execute"};
return nullptr;
}
} // namespace Acts
} // namespace Acts::detail

0 comments on commit 07c292a

Please sign in to comment.