From a6bddfc66fb5b629774627aacb4dabb3316007ba Mon Sep 17 00:00:00 2001 From: Xiaocong Ai <xiaocong.ai@cern.ch> Date: Mon, 28 Oct 2024 09:39:26 +0100 Subject: [PATCH] report WARNINT for re-fit failure --- Tracking/Acts/FaserActsKalmanFilter/src/CKF2.cxx | 6 +++--- .../FaserActsKalmanFilter/src/KalmanFitterTool.cxx | 13 ++++++++----- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/Tracking/Acts/FaserActsKalmanFilter/src/CKF2.cxx b/Tracking/Acts/FaserActsKalmanFilter/src/CKF2.cxx index 1bdb46e54..77dffaa07 100644 --- a/Tracking/Acts/FaserActsKalmanFilter/src/CKF2.cxx +++ b/Tracking/Acts/FaserActsKalmanFilter/src/CKF2.cxx @@ -252,11 +252,11 @@ StatusCode CKF2::execute() { ATH_MSG_WARNING("No fitted parameters at target position" << targetZposition); } - std::unique_ptr<Trk::Track> trk = m_createTrkTrackTool->createTrack(gctx, track, fittedParams, m_backwardPropagation); + std::unique_ptr<Trk::Track> trk = std::move(m_createTrkTrackTool->createTrack(gctx, track, fittedParams, m_backwardPropagation)); m_numberOfSelectedTracks++; //@todo: make the KF refit configurable - std::unique_ptr<Trk::Track> trk2 = m_kalmanFitterTool1->fit( - ctx, gctx, trk.get(), Acts::BoundVector::Zero(), m_isMC); + std::unique_ptr<Trk::Track> trk2 = std::move(m_kalmanFitterTool1->fit( + ctx, gctx, trk.get(), Acts::BoundVector::Zero(), m_isMC)); if (trk2 != nullptr) { outputTracks->push_back(std::move(trk2)); } else { diff --git a/Tracking/Acts/FaserActsKalmanFilter/src/KalmanFitterTool.cxx b/Tracking/Acts/FaserActsKalmanFilter/src/KalmanFitterTool.cxx index 380edcd19..6971ae7a4 100644 --- a/Tracking/Acts/FaserActsKalmanFilter/src/KalmanFitterTool.cxx +++ b/Tracking/Acts/FaserActsKalmanFilter/src/KalmanFitterTool.cxx @@ -346,12 +346,12 @@ KalmanFitterTool::fit(const EventContext &ctx, const Acts::GeometryContext &gctx std::unique_ptr<Trk::Track> newTrack = nullptr; if (!inputTrack->measurementsOnTrack() || inputTrack->measurementsOnTrack()->size() < m_minMeasurements) { - ATH_MSG_DEBUG("Input track has no or too little measurements and cannot be fitted"); + ATH_MSG_WARNING("Input track has only " << inputTrack->measurementsOnTrack()->size() <<" measurements and cannot be fitted"); return nullptr; } if (!inputTrack->trackParameters() || inputTrack->trackParameters()->empty()) { - ATH_MSG_DEBUG("Input track has no track parameters and cannot be fitted"); + ATH_MSG_WARNING("Input track has no track parameters and cannot be fitted"); return nullptr; } @@ -420,8 +420,11 @@ KalmanFitterTool::fit(const EventContext &ctx, const Acts::GeometryContext &gctx //} else { // ATH_MSG_DEBUG("No fitted parameters for track"); //} - newTrack = m_createTrkTrackTool->createTrack(gctx, track); - } + newTrack = std::move(m_createTrkTrackTool->createTrack(gctx, track)); + } else { + ATH_MSG_WARNING("Fit failed for parameters starting at " << trackParameters.position(gctx).transpose() <<" and " << actsSls.size() <<" measurements with error" << result.error()); + } + if (m_statesWriter && !m_noDiagnostics) { StatusCode statusStatesWriterTool = m_trajectoryStatesWriterTool->write(gctx, tracks, isMC); @@ -430,7 +433,7 @@ KalmanFitterTool::fit(const EventContext &ctx, const Acts::GeometryContext &gctx StatusCode statusSummaryWriterTool = m_trajectorySummaryWriterTool->write(gctx, tracks, isMC); } - return newTrack; + return std::move(newTrack); } -- GitLab