From 0cf3438e3330550b7aae801a3aa08a7998dce209 Mon Sep 17 00:00:00 2001 From: Andreas Stefl Date: Wed, 2 Oct 2024 15:54:50 +0200 Subject: [PATCH 1/7] feat: Add `estimateTrackParamCovariance` to Core --- .../Seeding/EstimateTrackParamsFromSeed.hpp | 44 ++++++++++++++ .../src/TrackParamsEstimationAlgorithm.cpp | 57 +++++-------------- .../TruthTracking/ParticleSmearing.cpp | 34 ++++------- 3 files changed, 67 insertions(+), 68 deletions(-) diff --git a/Core/include/Acts/Seeding/EstimateTrackParamsFromSeed.hpp b/Core/include/Acts/Seeding/EstimateTrackParamsFromSeed.hpp index 4b491c6ddc5..342b8599527 100644 --- a/Core/include/Acts/Seeding/EstimateTrackParamsFromSeed.hpp +++ b/Core/include/Acts/Seeding/EstimateTrackParamsFromSeed.hpp @@ -289,4 +289,48 @@ std::optional estimateTrackParamsFromSeed( return params; } +struct EstimateTrackParamCovarianceConfig { + BoundVector initialSigmas = {1. * UnitConstants::mm, + 1. * UnitConstants::mm, + 1. * UnitConstants::degree, + 1. * UnitConstants::degree, + 1. * UnitConstants::e / UnitConstants::GeV, + 1. * UnitConstants::ns}; + + double initialSigmaPtRel = 0.1; + + BoundVector initialVarInflation = {1., 1., 1., 1., 1., 1.}; +}; + +BoundMatrix estimateTrackParamCovariance( + const BoundVector& params, + const EstimateTrackParamCovarianceConfig& config) { + BoundSquareMatrix result = BoundSquareMatrix::Zero(); + + for (std::size_t i = eBoundLoc0; i < eBoundSize; ++i) { + double sigma = config.initialSigmas[i]; + double variance = sigma * sigma; + + if (i == eBoundQOverP) { + // note that we rely on the fact that sigma theta is already computed + double varianceTheta = result(eBoundTheta, eBoundTheta); + + // transverse momentum contribution + variance += std::pow(config.initialSigmaPtRel * params[eBoundQOverP], 2); + + // theta contribution + variance += + varianceTheta * + std::pow(params[eBoundQOverP] / std::tan(params[eBoundTheta]), 2); + } + + // Inflate the initial covariance + variance *= config.initialVarInflation[i]; + + result(i, i) = variance; + } + + return result; +} + } // namespace Acts diff --git a/Examples/Algorithms/TrackFinding/src/TrackParamsEstimationAlgorithm.cpp b/Examples/Algorithms/TrackFinding/src/TrackParamsEstimationAlgorithm.cpp index c5dbc8bb625..b0b9609ea94 100644 --- a/Examples/Algorithms/TrackFinding/src/TrackParamsEstimationAlgorithm.cpp +++ b/Examples/Algorithms/TrackFinding/src/TrackParamsEstimationAlgorithm.cpp @@ -35,48 +35,6 @@ namespace ActsExamples { -namespace { - -Acts::BoundSquareMatrix makeInitialCovariance( - const TrackParamsEstimationAlgorithm::Config& config, - const Acts::BoundVector& params, const SimSpacePoint& sp) { - Acts::BoundSquareMatrix result = Acts::BoundSquareMatrix::Zero(); - - for (std::size_t i = Acts::eBoundLoc0; i < Acts::eBoundSize; ++i) { - double sigma = config.initialSigmas[i]; - double variance = sigma * sigma; - - if (i == Acts::eBoundQOverP) { - // note that we rely on the fact that sigma theta is already computed - double varianceTheta = result(Acts::eBoundTheta, Acts::eBoundTheta); - - // transverse momentum contribution - variance += - std::pow(config.initialSigmaPtRel * params[Acts::eBoundQOverP], 2); - - // theta contribution - variance += - varianceTheta * std::pow(params[Acts::eBoundQOverP] * - std::tan(params[Acts::eBoundTheta]), - 2); - } - - // Inflate the time uncertainty if no time measurement is available - if (i == Acts::eBoundTime && !sp.t().has_value()) { - variance *= config.noTimeVarInflation; - } - - // Inflate the initial covariance - variance *= config.initialVarInflation[i]; - - result(i, i) = variance; - } - - return result; -} - -} // namespace - ActsExamples::TrackParamsEstimationAlgorithm::TrackParamsEstimationAlgorithm( ActsExamples::TrackParamsEstimationAlgorithm::Config cfg, Acts::Logging::Level lvl) @@ -171,8 +129,19 @@ ActsExamples::ProcessCode ActsExamples::TrackParamsEstimationAlgorithm::execute( const auto& params = optParams.value(); - Acts::BoundSquareMatrix cov = - makeInitialCovariance(m_cfg, params, *bottomSP); + Acts::BoundSquareMatrix cov = Acts::estimateTrackParamCovariance( + params, + Acts::EstimateTrackParamCovarianceConfig{ + .initialSigmas = + Eigen::Map{m_cfg.initialSigmas.data()}, + .initialSigmaPtRel = m_cfg.initialSigmaPtRel, + .initialVarInflation = Eigen::Map{ + m_cfg.initialVarInflation.data()}}); + + // Inflate the time uncertainty if no time measurement is available + if (!bottomSP->t().has_value()) { + cov(Acts::eBoundTime, Acts::eBoundTime) *= m_cfg.noTimeVarInflation; + } trackParameters.emplace_back(surface->getSharedPtr(), params, cov, m_cfg.particleHypothesis); diff --git a/Examples/Algorithms/TruthTracking/ActsExamples/TruthTracking/ParticleSmearing.cpp b/Examples/Algorithms/TruthTracking/ActsExamples/TruthTracking/ParticleSmearing.cpp index f0d20f1a370..139df282b41 100644 --- a/Examples/Algorithms/TruthTracking/ActsExamples/TruthTracking/ParticleSmearing.cpp +++ b/Examples/Algorithms/TruthTracking/ActsExamples/TruthTracking/ParticleSmearing.cpp @@ -11,6 +11,7 @@ #include "Acts/Definitions/Algebra.hpp" #include "Acts/Definitions/TrackParametrization.hpp" #include "Acts/EventData/ParticleHypothesis.hpp" +#include "Acts/Seeding/EstimateTrackParamsFromSeed.hpp" #include "Acts/Surfaces/PerigeeSurface.hpp" #include "Acts/Surfaces/Surface.hpp" #include "Acts/Utilities/Helpers.hpp" @@ -128,31 +129,16 @@ ActsExamples::ProcessCode ActsExamples::ParticleSmearing::execute( Acts::BoundSquareMatrix cov = Acts::BoundSquareMatrix::Zero(); if (m_cfg.initialSigmas) { // use the initial sigmas if set - for (std::size_t i = Acts::eBoundLoc0; i < Acts::eBoundSize; ++i) { - double sigma = (*m_cfg.initialSigmas)[i]; - double variance = sigma * sigma; - - if (i == Acts::eBoundQOverP) { - // note that we rely on the fact that sigma theta is already - // computed - double varianceTheta = cov(Acts::eBoundTheta, Acts::eBoundTheta); - - // transverse momentum contribution - variance += std::pow( - m_cfg.initialSigmaPtRel * params[Acts::eBoundQOverP], 2); - - // theta contribution - variance += varianceTheta * - std::pow(params[Acts::eBoundQOverP] * - std::tan(params[Acts::eBoundTheta]), - 2); - } - // Inflate the initial covariance - variance *= m_cfg.initialVarInflation[i]; - - cov(i, i) = variance; - } + cov = Acts::estimateTrackParamCovariance( + params, + Acts::EstimateTrackParamCovarianceConfig{ + .initialSigmas = + Eigen::Map{ + m_cfg.initialSigmas->data()}, + .initialSigmaPtRel = m_cfg.initialSigmaPtRel, + .initialVarInflation = Eigen::Map{ + m_cfg.initialVarInflation.data()}}); } else { // otherwise use the smearing sigmas From 480ceb8adc0feb933dbb6c0fd7ad15b607cf79d7 Mon Sep 17 00:00:00 2001 From: Andreas Stefl Date: Wed, 2 Oct 2024 21:18:10 +0200 Subject: [PATCH 2/7] move impl to cpp --- Core/CMakeLists.txt | 1 + .../Seeding/EstimateTrackParamsFromSeed.hpp | 29 +------------------ 2 files changed, 2 insertions(+), 28 deletions(-) diff --git a/Core/CMakeLists.txt b/Core/CMakeLists.txt index eeb6bc8b92a..554656f514c 100644 --- a/Core/CMakeLists.txt +++ b/Core/CMakeLists.txt @@ -110,6 +110,7 @@ add_subdirectory(src/MagneticField) add_subdirectory(src/Material) add_subdirectory(src/Navigation) add_subdirectory(src/Propagator) +add_subdirectory(src/Seeding) add_subdirectory(src/Surfaces) add_subdirectory(src/TrackFinding) add_subdirectory(src/TrackFitting) diff --git a/Core/include/Acts/Seeding/EstimateTrackParamsFromSeed.hpp b/Core/include/Acts/Seeding/EstimateTrackParamsFromSeed.hpp index 342b8599527..794855c3b93 100644 --- a/Core/include/Acts/Seeding/EstimateTrackParamsFromSeed.hpp +++ b/Core/include/Acts/Seeding/EstimateTrackParamsFromSeed.hpp @@ -304,33 +304,6 @@ struct EstimateTrackParamCovarianceConfig { BoundMatrix estimateTrackParamCovariance( const BoundVector& params, - const EstimateTrackParamCovarianceConfig& config) { - BoundSquareMatrix result = BoundSquareMatrix::Zero(); - - for (std::size_t i = eBoundLoc0; i < eBoundSize; ++i) { - double sigma = config.initialSigmas[i]; - double variance = sigma * sigma; - - if (i == eBoundQOverP) { - // note that we rely on the fact that sigma theta is already computed - double varianceTheta = result(eBoundTheta, eBoundTheta); - - // transverse momentum contribution - variance += std::pow(config.initialSigmaPtRel * params[eBoundQOverP], 2); - - // theta contribution - variance += - varianceTheta * - std::pow(params[eBoundQOverP] / std::tan(params[eBoundTheta]), 2); - } - - // Inflate the initial covariance - variance *= config.initialVarInflation[i]; - - result(i, i) = variance; - } - - return result; -} + const EstimateTrackParamCovarianceConfig& config); } // namespace Acts From 014c1729ae96e04d25fe1a61d452c89bccc6ee2e Mon Sep 17 00:00:00 2001 From: Andreas Stefl Date: Wed, 2 Oct 2024 21:21:43 +0200 Subject: [PATCH 3/7] add missing --- Core/src/Seeding/CMakeLists.txt | 1 + .../Seeding/EstimateTrackParamsFromSeed.cpp | 40 +++++++++++++++++++ 2 files changed, 41 insertions(+) create mode 100644 Core/src/Seeding/CMakeLists.txt create mode 100644 Core/src/Seeding/EstimateTrackParamsFromSeed.cpp diff --git a/Core/src/Seeding/CMakeLists.txt b/Core/src/Seeding/CMakeLists.txt new file mode 100644 index 00000000000..770037b1dfd --- /dev/null +++ b/Core/src/Seeding/CMakeLists.txt @@ -0,0 +1 @@ +target_sources(ActsCore PRIVATE EstimateTrackParamsFromSeed.cpp) diff --git a/Core/src/Seeding/EstimateTrackParamsFromSeed.cpp b/Core/src/Seeding/EstimateTrackParamsFromSeed.cpp new file mode 100644 index 00000000000..efa7be01969 --- /dev/null +++ b/Core/src/Seeding/EstimateTrackParamsFromSeed.cpp @@ -0,0 +1,40 @@ +// This file is part of the ACTS project. +// +// Copyright (C) 2016 CERN for the benefit of the ACTS project +// +// This Source Code Form is subject to the terms of the Mozilla Public +// License, v. 2.0. If a copy of the MPL was not distributed with this +// file, You can obtain one at https://mozilla.org/MPL/2.0/. + +#include "Acts/Seeding/EstimateTrackParamsFromSeed.hpp" + +Acts::BoundMatrix Acts::estimateTrackParamCovariance( + const BoundVector& params, + const EstimateTrackParamCovarianceConfig& config) { + BoundSquareMatrix result = BoundSquareMatrix::Zero(); + + for (std::size_t i = eBoundLoc0; i < eBoundSize; ++i) { + double sigma = config.initialSigmas[i]; + double variance = sigma * sigma; + + if (i == eBoundQOverP) { + // note that we rely on the fact that sigma theta is already computed + double varianceTheta = result(eBoundTheta, eBoundTheta); + + // transverse momentum contribution + variance += std::pow(config.initialSigmaPtRel * params[eBoundQOverP], 2); + + // theta contribution + variance += + varianceTheta * + std::pow(params[eBoundQOverP] / std::tan(params[eBoundTheta]), 2); + } + + // Inflate the initial covariance + variance *= config.initialVarInflation[i]; + + result(i, i) = variance; + } + + return result; +} From c4658fa818b2cbc4531ffb59750538d5e4007bc2 Mon Sep 17 00:00:00 2001 From: Andreas Stefl Date: Thu, 3 Oct 2024 08:15:49 +0200 Subject: [PATCH 4/7] refactor to include no-time case --- .../Seeding/EstimateTrackParamsFromSeed.hpp | 5 +++-- .../Seeding/EstimateTrackParamsFromSeed.cpp | 11 ++++++++-- .../src/TrackParamsEstimationAlgorithm.cpp | 20 ++++++++----------- .../TruthTracking/ParticleSmearing.cpp | 18 ++++++++--------- 4 files changed, 29 insertions(+), 25 deletions(-) diff --git a/Core/include/Acts/Seeding/EstimateTrackParamsFromSeed.hpp b/Core/include/Acts/Seeding/EstimateTrackParamsFromSeed.hpp index 794855c3b93..a57b7d84e7a 100644 --- a/Core/include/Acts/Seeding/EstimateTrackParamsFromSeed.hpp +++ b/Core/include/Acts/Seeding/EstimateTrackParamsFromSeed.hpp @@ -300,10 +300,11 @@ struct EstimateTrackParamCovarianceConfig { double initialSigmaPtRel = 0.1; BoundVector initialVarInflation = {1., 1., 1., 1., 1., 1.}; + double noTimeVarInflation = 100.; }; BoundMatrix estimateTrackParamCovariance( - const BoundVector& params, - const EstimateTrackParamCovarianceConfig& config); + const EstimateTrackParamCovarianceConfig& config, const BoundVector& params, + bool hasTime); } // namespace Acts diff --git a/Core/src/Seeding/EstimateTrackParamsFromSeed.cpp b/Core/src/Seeding/EstimateTrackParamsFromSeed.cpp index efa7be01969..dee2ab64f7b 100644 --- a/Core/src/Seeding/EstimateTrackParamsFromSeed.cpp +++ b/Core/src/Seeding/EstimateTrackParamsFromSeed.cpp @@ -8,9 +8,11 @@ #include "Acts/Seeding/EstimateTrackParamsFromSeed.hpp" +#include "Acts/Definitions/TrackParametrization.hpp" + Acts::BoundMatrix Acts::estimateTrackParamCovariance( - const BoundVector& params, - const EstimateTrackParamCovarianceConfig& config) { + const EstimateTrackParamCovarianceConfig& config, const BoundVector& params, + bool hasTime) { BoundSquareMatrix result = BoundSquareMatrix::Zero(); for (std::size_t i = eBoundLoc0; i < eBoundSize; ++i) { @@ -30,6 +32,11 @@ Acts::BoundMatrix Acts::estimateTrackParamCovariance( std::pow(params[eBoundQOverP] / std::tan(params[eBoundTheta]), 2); } + if (i == eBoundTime && !hasTime) { + // Inflate the time uncertainty if no time measurement is available + variance *= config.noTimeVarInflation; + } + // Inflate the initial covariance variance *= config.initialVarInflation[i]; diff --git a/Examples/Algorithms/TrackFinding/src/TrackParamsEstimationAlgorithm.cpp b/Examples/Algorithms/TrackFinding/src/TrackParamsEstimationAlgorithm.cpp index b0b9609ea94..30cf8c75e02 100644 --- a/Examples/Algorithms/TrackFinding/src/TrackParamsEstimationAlgorithm.cpp +++ b/Examples/Algorithms/TrackFinding/src/TrackParamsEstimationAlgorithm.cpp @@ -129,19 +129,15 @@ ActsExamples::ProcessCode ActsExamples::TrackParamsEstimationAlgorithm::execute( const auto& params = optParams.value(); + Acts::EstimateTrackParamCovarianceConfig config{ + .initialSigmas = + Eigen::Map{m_cfg.initialSigmas.data()}, + .initialSigmaPtRel = m_cfg.initialSigmaPtRel, + .initialVarInflation = Eigen::Map{ + m_cfg.initialVarInflation.data()}}; + Acts::BoundSquareMatrix cov = Acts::estimateTrackParamCovariance( - params, - Acts::EstimateTrackParamCovarianceConfig{ - .initialSigmas = - Eigen::Map{m_cfg.initialSigmas.data()}, - .initialSigmaPtRel = m_cfg.initialSigmaPtRel, - .initialVarInflation = Eigen::Map{ - m_cfg.initialVarInflation.data()}}); - - // Inflate the time uncertainty if no time measurement is available - if (!bottomSP->t().has_value()) { - cov(Acts::eBoundTime, Acts::eBoundTime) *= m_cfg.noTimeVarInflation; - } + config, params, bottomSP->t().has_value()); trackParameters.emplace_back(surface->getSharedPtr(), params, cov, m_cfg.particleHypothesis); diff --git a/Examples/Algorithms/TruthTracking/ActsExamples/TruthTracking/ParticleSmearing.cpp b/Examples/Algorithms/TruthTracking/ActsExamples/TruthTracking/ParticleSmearing.cpp index 139df282b41..cfc62ab9da9 100644 --- a/Examples/Algorithms/TruthTracking/ActsExamples/TruthTracking/ParticleSmearing.cpp +++ b/Examples/Algorithms/TruthTracking/ActsExamples/TruthTracking/ParticleSmearing.cpp @@ -130,15 +130,15 @@ ActsExamples::ProcessCode ActsExamples::ParticleSmearing::execute( if (m_cfg.initialSigmas) { // use the initial sigmas if set - cov = Acts::estimateTrackParamCovariance( - params, - Acts::EstimateTrackParamCovarianceConfig{ - .initialSigmas = - Eigen::Map{ - m_cfg.initialSigmas->data()}, - .initialSigmaPtRel = m_cfg.initialSigmaPtRel, - .initialVarInflation = Eigen::Map{ - m_cfg.initialVarInflation.data()}}); + Acts::EstimateTrackParamCovarianceConfig config{ + .initialSigmas = + Eigen::Map{ + m_cfg.initialSigmas->data()}, + .initialSigmaPtRel = m_cfg.initialSigmaPtRel, + .initialVarInflation = Eigen::Map{ + m_cfg.initialVarInflation.data()}}; + + cov = Acts::estimateTrackParamCovariance(config, params, false); } else { // otherwise use the smearing sigmas From 9474370877f5e3f89ad6ce1ac9c94c755ed1383b Mon Sep 17 00:00:00 2001 From: Andreas Stefl Date: Thu, 3 Oct 2024 09:14:59 +0200 Subject: [PATCH 5/7] assert --- Core/src/Seeding/EstimateTrackParamsFromSeed.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Core/src/Seeding/EstimateTrackParamsFromSeed.cpp b/Core/src/Seeding/EstimateTrackParamsFromSeed.cpp index dee2ab64f7b..83d950fc3a1 100644 --- a/Core/src/Seeding/EstimateTrackParamsFromSeed.cpp +++ b/Core/src/Seeding/EstimateTrackParamsFromSeed.cpp @@ -13,6 +13,9 @@ Acts::BoundMatrix Acts::estimateTrackParamCovariance( const EstimateTrackParamCovarianceConfig& config, const BoundVector& params, bool hasTime) { + assert((params[eBoundTheta] > 0 && params[eBoundTheta] < M_PI) && + "Theta must be in the range (0, pi)"); + BoundSquareMatrix result = BoundSquareMatrix::Zero(); for (std::size_t i = eBoundLoc0; i < eBoundSize; ++i) { From b4acc3c876089ec690cdec46e384b9dd3e869bb8 Mon Sep 17 00:00:00 2001 From: Andreas Stefl Date: Thu, 17 Oct 2024 14:50:10 +0200 Subject: [PATCH 6/7] update hashees --- Examples/Python/tests/root_file_hashes.txt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Examples/Python/tests/root_file_hashes.txt b/Examples/Python/tests/root_file_hashes.txt index 6ddb1a405cd..39df454b3e8 100644 --- a/Examples/Python/tests/root_file_hashes.txt +++ b/Examples/Python/tests/root_file_hashes.txt @@ -39,16 +39,16 @@ test_ckf_tracks_example[generic-full_seeding]__performance_seeding_trees.root: 0 test_ckf_tracks_example[generic-truth_estimated]__trackstates_ckf.root: a8c5c6f6c1e6303b887d47b509b7f71a2ffa5f38638fe46ce5bce76fd20d64ca test_ckf_tracks_example[generic-truth_estimated]__tracksummary_ckf.root: 417f7326e1e1bb4519f1378145ac733bdda6653eb9871fd69e455e0269d996a6 test_ckf_tracks_example[generic-truth_estimated]__performance_seeding.root: 1facb05c066221f6361b61f015cdf0918e94d9f3fce2269ec7b6a4dffeb2bc7e -test_ckf_tracks_example[generic-truth_smeared]__trackstates_ckf.root: de11c0868a70ade0dcc80465d4e6dcf1dd7fcf8149603b47ee7d87d862a6534a -test_ckf_tracks_example[generic-truth_smeared]__tracksummary_ckf.root: f18e9ecce6d9585fd150c5aafc9ac225a5bab342aaab50a28283ba879691af1f +test_ckf_tracks_example[generic-truth_smeared]__trackstates_ckf.root: edf0b06ce9ee0e4fcb153e41859af7b5153271de18f49a6842a23ad2d66b7e09 +test_ckf_tracks_example[generic-truth_smeared]__tracksummary_ckf.root: 06d6ae1d05cb611b19df3c59531997c9b0108f5ef6027d76c4827bd2d9edb921 test_ckf_tracks_example[odd-full_seeding]__trackstates_ckf.root: 463d6aaed4d869652b5b184940e789cde0fb441bdd135813b85462a515e6480a test_ckf_tracks_example[odd-full_seeding]__tracksummary_ckf.root: a8ad83a07b48d4cfcf70d0e6fdc3c8997eb03c1f8c2a7be27ea888b099000d79 test_ckf_tracks_example[odd-full_seeding]__performance_seeding_trees.root: 43c58577aafe07645e5660c4f43904efadf91d8cda45c5c04c248bbe0f59814f test_ckf_tracks_example[odd-truth_estimated]__trackstates_ckf.root: 247dd581cc177625c0286718261c004e2149536d70c8281dfaf697879a84d76d test_ckf_tracks_example[odd-truth_estimated]__tracksummary_ckf.root: 1b08a80e73aedf5cf38a3a407794b82297bec37f556ad4efcda3489a1b17d4d2 test_ckf_tracks_example[odd-truth_estimated]__performance_seeding.root: 1a36b7017e59f1c08602ef3c2cb0483c51df248f112e3780c66594110719c575 -test_ckf_tracks_example[odd-truth_smeared]__trackstates_ckf.root: 7adfc2bf5ee35a126b713187dd8b11f4497cf864a4a83e57a40885688974413e -test_ckf_tracks_example[odd-truth_smeared]__tracksummary_ckf.root: 7a9de8a8bd1c09f7b4d1c547f824af6c8123afb044dd429180b0d13e47d6f975 +test_ckf_tracks_example[odd-truth_smeared]__trackstates_ckf.root: a9621b535ea2912d172142394f51f68e4e7dc255b32d479d6305fa599152b420 +test_ckf_tracks_example[odd-truth_smeared]__tracksummary_ckf.root: af1a6bb16a070db7ed8043e2188d56f0034843099fc3c332731c4cf86ba39c57 test_vertex_fitting_reading[Truth-False-100]__performance_vertexing.root: 76ef6084d758dfdfc0151ddec2170e12d73394424e3dac4ffe46f0f339ec8293 test_vertex_fitting_reading[Iterative-False-100]__performance_vertexing.root: 60372210c830a04f95ceb78c6c68a9b0de217746ff59e8e73053750c837b57eb test_vertex_fitting_reading[Iterative-True-100]__performance_vertexing.root: e34f217d524a5051dbb04a811d3407df3ebe2cc4bb7f54f6bda0847dbd7b52c3 From 8515b65ff2cabcd7392c0f7528a03243db732645 Mon Sep 17 00:00:00 2001 From: Andreas Stefl Date: Thu, 17 Oct 2024 15:53:08 +0200 Subject: [PATCH 7/7] doc --- .../Seeding/EstimateTrackParamsFromSeed.hpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/Core/include/Acts/Seeding/EstimateTrackParamsFromSeed.hpp b/Core/include/Acts/Seeding/EstimateTrackParamsFromSeed.hpp index 1b4959f47ae..f3850e102ce 100644 --- a/Core/include/Acts/Seeding/EstimateTrackParamsFromSeed.hpp +++ b/Core/include/Acts/Seeding/EstimateTrackParamsFromSeed.hpp @@ -287,7 +287,10 @@ std::optional estimateTrackParamsFromSeed( return params; } +/// Configuration for the estimation of the covariance matrix of the track +/// parameters with `estimateTrackParamCovariance`. struct EstimateTrackParamCovarianceConfig { + /// The initial sigmas for the track parameters BoundVector initialSigmas = {1. * UnitConstants::mm, 1. * UnitConstants::mm, 1. * UnitConstants::degree, @@ -295,12 +298,28 @@ struct EstimateTrackParamCovarianceConfig { 1. * UnitConstants::e / UnitConstants::GeV, 1. * UnitConstants::ns}; + /// The initial relative uncertainty of the q/pt double initialSigmaPtRel = 0.1; + /// The inflation factors for the variances of the track parameters BoundVector initialVarInflation = {1., 1., 1., 1., 1., 1.}; + /// The inflation factor for time uncertainty if the time parameter was not + /// estimated double noTimeVarInflation = 100.; }; +/// Estimate the covariance matrix of the given track parameters based on the +/// provided configuration. The assumption is that we can model the uncertainty +/// of the track parameters as a diagonal matrix with the provided initial +/// sigmas. The inflation factors are used to inflate the initial variances +/// based on the provided configuration. The uncertainty of q/p is estimated +/// based on the relative uncertainty of the q/pt and the theta uncertainty. +/// +/// @param config is the configuration for the estimation +/// @param params is the track parameters +/// @param hasTime is true if the track parameters have time +/// +/// @return the covariance matrix of the track parameters BoundMatrix estimateTrackParamCovariance( const EstimateTrackParamCovarianceConfig& config, const BoundVector& params, bool hasTime);