Skip to content

Commit

Permalink
chore: Wire loggers in CKF correctly (#2146)
Browse files Browse the repository at this point in the history
That way updater and smoother logs will not be automatically silenced
  • Loading branch information
andiwand committed May 24, 2023
1 parent aff0c55 commit 5f46a6e
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions Core/include/Acts/TrackFinding/CombinatorialKalmanFilter.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,9 @@ class CombinatorialKalmanFilter {
getDefaultLogger("CKF", Logging::INFO))
: m_propagator(std::move(pPropagator)),
m_logger(std::move(_logger)),
m_actorLogger{m_logger->cloneWithSuffix("Actor")} {}
m_actorLogger{m_logger->cloneWithSuffix("Actor")},
m_updaterLogger{m_logger->cloneWithSuffix("Updater")},
m_smootherLogger{m_logger->cloneWithSuffix("Smoother")} {}

private:
using KalmanNavigator = typename propagator_t::Navigator;
Expand All @@ -301,6 +303,8 @@ class CombinatorialKalmanFilter {

std::unique_ptr<const Logger> m_logger;
std::shared_ptr<const Logger> m_actorLogger;
std::shared_ptr<const Logger> m_updaterLogger;
std::shared_ptr<const Logger> m_smootherLogger;

const Logger& logger() const { return *m_logger; }

Expand Down Expand Up @@ -950,7 +954,7 @@ class CombinatorialKalmanFilter {
} else {
// Kalman update
auto updateRes = m_extensions.updater(
gctx, trackState, Direction::Forward, getDummyLogger());
gctx, trackState, Direction::Forward, *updaterLogger);
if (!updateRes.ok()) {
ACTS_ERROR("Update step failed: " << updateRes.error());
return updateRes.error();
Expand Down Expand Up @@ -1131,7 +1135,7 @@ class CombinatorialKalmanFilter {
// Smooth the track states
auto smoothRes =
m_extensions.smoother(state.geoContext, *result.fittedStates,
lastMeasurementIndex, getDummyLogger());
lastMeasurementIndex, *smootherLogger);
if (!smoothRes.ok()) {
ACTS_ERROR("Smoothing step failed: " << smoothRes.error());
return smoothRes.error();
Expand Down Expand Up @@ -1232,8 +1236,12 @@ class CombinatorialKalmanFilter {
/// The Surface being targeted
SurfaceReached targetReached;

/// Logger instance
/// Actor logger instance
const Logger* actorLogger{nullptr};
/// Updater logger instance
const Logger* updaterLogger{nullptr};
/// Smoother logger instance
const Logger* smootherLogger{nullptr};

const Logger& logger() const { return *actorLogger; }
};
Expand Down Expand Up @@ -1316,6 +1324,8 @@ class CombinatorialKalmanFilter {
combKalmanActor.energyLoss = tfOptions.energyLoss;
combKalmanActor.smoothing = tfOptions.smoothing;
combKalmanActor.actorLogger = m_actorLogger.get();
combKalmanActor.updaterLogger = m_updaterLogger.get();
combKalmanActor.smootherLogger = m_smootherLogger.get();

// copy source link accessor, calibrator and measurement selector
combKalmanActor.m_sourcelinkAccessor = tfOptions.sourcelinkAccessor;
Expand Down

0 comments on commit 5f46a6e

Please sign in to comment.