From abd31555333f25837f6b0aa9211df29145bcc2fa Mon Sep 17 00:00:00 2001 From: Benjamin Huth Date: Thu, 19 Dec 2024 11:10:30 +0100 Subject: [PATCH] update --- .../ActsExamples/TrackFitting/RefittingAlgorithm.hpp | 2 ++ .../Algorithms/TrackFitting/src/RefittingAlgorithm.cpp | 7 ++++++- Examples/Python/src/TrackFitting.cpp | 2 +- Examples/Scripts/Python/truth_tracking_gsf_refitting.py | 1 + Examples/Scripts/Python/truth_tracking_kalman_refitting.py | 1 + 5 files changed, 11 insertions(+), 2 deletions(-) diff --git a/Examples/Algorithms/TrackFitting/include/ActsExamples/TrackFitting/RefittingAlgorithm.hpp b/Examples/Algorithms/TrackFitting/include/ActsExamples/TrackFitting/RefittingAlgorithm.hpp index 19e08f7572f..f9b133772c0 100644 --- a/Examples/Algorithms/TrackFitting/include/ActsExamples/TrackFitting/RefittingAlgorithm.hpp +++ b/Examples/Algorithms/TrackFitting/include/ActsExamples/TrackFitting/RefittingAlgorithm.hpp @@ -33,6 +33,8 @@ class RefittingAlgorithm final : public IAlgorithm { std::shared_ptr fit; /// Pick a single track for debugging (-1 process all tracks) int pickTrack = -1; + /// Inflate initial covariance. + std::array initialVarInflation = {1., 1., 1., 1., 1., 1.}; }; /// Constructor of the fitting algorithm diff --git a/Examples/Algorithms/TrackFitting/src/RefittingAlgorithm.cpp b/Examples/Algorithms/TrackFitting/src/RefittingAlgorithm.cpp index 79eb367589b..a72670b378c 100644 --- a/Examples/Algorithms/TrackFitting/src/RefittingAlgorithm.cpp +++ b/Examples/Algorithms/TrackFitting/src/RefittingAlgorithm.cpp @@ -80,10 +80,15 @@ ActsExamples::ProcessCode ActsExamples::RefittingAlgorithm::execute( Acts::PropagatorPlainOptions(ctx.geoContext, ctx.magFieldContext)}; options.doRefit = true; - const Acts::BoundTrackParameters initialParams( + Acts::BoundTrackParameters initialParams( track.referenceSurface().getSharedPtr(), track.parameters(), track.covariance(), track.particleHypothesis()); + // Inflate covariance + for (auto i = 0ul; i < m_cfg.initialVarInflation.size(); ++i) { + initialParams.covariance().value() *= m_cfg.initialVarInflation.at(i); + } + trackSourceLinks.clear(); surfSequence.clear(); diff --git a/Examples/Python/src/TrackFitting.cpp b/Examples/Python/src/TrackFitting.cpp index 6d1b9818e51..a0a50be2767 100644 --- a/Examples/Python/src/TrackFitting.cpp +++ b/Examples/Python/src/TrackFitting.cpp @@ -41,7 +41,7 @@ void addTrackFitting(Context& ctx) { ACTS_PYTHON_DECLARE_ALGORITHM(ActsExamples::RefittingAlgorithm, mex, "RefittingAlgorithm", inputTracks, outputTracks, - fit, pickTrack); + fit, pickTrack, initialVarInflation); { py::class_>( diff --git a/Examples/Scripts/Python/truth_tracking_gsf_refitting.py b/Examples/Scripts/Python/truth_tracking_gsf_refitting.py index 1cf0d1b7d95..1e4db8ecdf3 100755 --- a/Examples/Scripts/Python/truth_tracking_gsf_refitting.py +++ b/Examples/Scripts/Python/truth_tracking_gsf_refitting.py @@ -44,6 +44,7 @@ def runRefittingGsf( acts.logging.INFO, inputTracks="kf_tracks", outputTracks="gsf_refit_tracks", + initialVarInflation=[100.0] * 6, fit=acts.examples.makeGsfFitterFunction( trackingGeometry, field, **gsfOptions ), diff --git a/Examples/Scripts/Python/truth_tracking_kalman_refitting.py b/Examples/Scripts/Python/truth_tracking_kalman_refitting.py index 2d84808a15c..3d6a2ef91e9 100755 --- a/Examples/Scripts/Python/truth_tracking_kalman_refitting.py +++ b/Examples/Scripts/Python/truth_tracking_kalman_refitting.py @@ -41,6 +41,7 @@ def runRefittingKf( level=acts.logging.INFO, inputTracks="kf_tracks", outputTracks="kf_refit_tracks", + initialVarInflation=[100.0] * 6, fit=acts.examples.makeKalmanFitterFunction( trackingGeometry, field, **kalmanOptions ),