From 430542a0764b3cc35fb2ef221e7cf3240e1f9e09 Mon Sep 17 00:00:00 2001 From: Andreas Stefl Date: Thu, 31 Oct 2024 11:42:45 +0100 Subject: [PATCH 1/9] feat: Estimate parameters on surface also if bottom SP is not on surface --- .../Seeding/EstimateTrackParamsFromSeed.hpp | 81 +++++++++++++++---- 1 file changed, 67 insertions(+), 14 deletions(-) diff --git a/Core/include/Acts/Seeding/EstimateTrackParamsFromSeed.hpp b/Core/include/Acts/Seeding/EstimateTrackParamsFromSeed.hpp index f3850e102ce..9a2dd06530a 100644 --- a/Core/include/Acts/Seeding/EstimateTrackParamsFromSeed.hpp +++ b/Core/include/Acts/Seeding/EstimateTrackParamsFromSeed.hpp @@ -10,7 +10,15 @@ #include "Acts/Definitions/TrackParametrization.hpp" #include "Acts/Definitions/Units.hpp" +#include "Acts/EventData/ParticleHypothesis.hpp" +#include "Acts/EventData/TrackParameters.hpp" #include "Acts/Geometry/GeometryContext.hpp" +#include "Acts/MagneticField/ConstantBField.hpp" +#include "Acts/MagneticField/MagneticFieldContext.hpp" +#include "Acts/Propagator/ActorList.hpp" +#include "Acts/Propagator/EigenStepper.hpp" +#include "Acts/Propagator/Propagator.hpp" +#include "Acts/Propagator/VoidNavigator.hpp" #include "Acts/Surfaces/Surface.hpp" #include "Acts/Utilities/Logger.hpp" #include "Acts/Utilities/MathHelpers.hpp" @@ -19,6 +27,7 @@ #include #include #include +#include #include namespace Acts { @@ -249,34 +258,78 @@ std::optional estimateTrackParamsFromSeed( // Transform it back to the original frame Vector3 direction = rotation * transDirection.normalized(); - // Initialize the bound parameters vector - BoundVector params = BoundVector::Zero(); + // The estimated q/pt in [GeV/c]^-1 (note that the pt is the projection of + // momentum on the transverse plane of the new frame) + ActsScalar qOverPt = sign * (UnitConstants::m) / (0.3 * bFieldInTesla * R); - // The estimated phi and theta - params[eBoundPhi] = VectorHelpers::phi(direction); - params[eBoundTheta] = VectorHelpers::theta(direction); + Vector4 parameterOrigin(spGlobalPositions[0].x(), spGlobalPositions[0].y(), + spGlobalPositions[0].z(), + spGlobalTimes[0].value_or(0.)); // Transform the bottom space point to local coordinates of the provided // surface - auto lpResult = surface.globalToLocal(gctx, spGlobalPositions[0], direction); + auto lpResult = + surface.globalToLocal(gctx, parameterOrigin.head<3>(), direction); if (!lpResult.ok()) { - ACTS_ERROR( - "Global to local transformation did not succeed. Please make sure the " - "bottom space point lies on the provided surface."); - return std::nullopt; + // no cov transport matrix is needed here + // particle hypothesis does not matter here + CurvilinearTrackParameters estimatedParams(parameterOrigin, direction, + qOverPt, std::nullopt, + ParticleHypothesis::pion()); + + auto surfaceIntersection = + surface.intersect(gctx, parameterOrigin.head<3>(), direction).closest(); + + if (!surfaceIntersection.isValid()) { + ACTS_INFO( + "The surface does not intersect with the origin and estimated " + "direction."); + return std::nullopt; + } + + Direction propagatorDirection = + Direction::fromScalarZeroAsPositive(surfaceIntersection.pathLength()); + + Propagator propagator( + EigenStepper<>(std::make_shared(bField)), + VoidNavigator(), logger().cloneWithSuffix("Propagator")); + MagneticFieldContext mctx; + auto propagatorOptions = decltype(propagator)::Options<>(gctx, mctx); + propagatorOptions.direction = propagatorDirection; + + auto result = + propagator.propagate(estimatedParams, surface, propagatorOptions); + + if (!result.ok()) { + ACTS_INFO("The propagation failed."); + return std::nullopt; + } + if (!result.value().endParameters.has_value()) { + ACTS_INFO("The propagation did not reach the surface."); + return std::nullopt; + } + + return result.value().endParameters.value().parameters(); } + Vector2 bottomLocalPos = lpResult.value(); + + // Initialize the bound parameters vector + BoundVector params = BoundVector::Zero(); + // The estimated loc0 and loc1 params[eBoundLoc0] = bottomLocalPos.x(); params[eBoundLoc1] = bottomLocalPos.y(); - params[eBoundTime] = spGlobalTimes[0].value_or(0.); - // The estimated q/pt in [GeV/c]^-1 (note that the pt is the projection of - // momentum on the transverse plane of the new frame) - ActsScalar qOverPt = sign * (UnitConstants::m) / (0.3 * bFieldInTesla * R); + // The estimated phi and theta + params[eBoundPhi] = VectorHelpers::phi(direction); + params[eBoundTheta] = VectorHelpers::theta(direction); + // The estimated q/p in [GeV/c]^-1 params[eBoundQOverP] = qOverPt / fastHypot(1., invTanTheta); + params[eBoundTime] = spGlobalTimes[0].value_or(0.); + if (params.hasNaN()) { ACTS_ERROR( "The NaN value exists at the estimated track parameters from seed with" From cf1dcf2603fa171443edc0d0b3280cbd8bea197e Mon Sep 17 00:00:00 2001 From: Andreas Stefl Date: Thu, 31 Oct 2024 11:52:44 +0100 Subject: [PATCH 2/9] fix --- Core/include/Acts/Seeding/EstimateTrackParamsFromSeed.hpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Core/include/Acts/Seeding/EstimateTrackParamsFromSeed.hpp b/Core/include/Acts/Seeding/EstimateTrackParamsFromSeed.hpp index 9a2dd06530a..7e82839061b 100644 --- a/Core/include/Acts/Seeding/EstimateTrackParamsFromSeed.hpp +++ b/Core/include/Acts/Seeding/EstimateTrackParamsFromSeed.hpp @@ -294,7 +294,8 @@ std::optional estimateTrackParamsFromSeed( EigenStepper<>(std::make_shared(bField)), VoidNavigator(), logger().cloneWithSuffix("Propagator")); MagneticFieldContext mctx; - auto propagatorOptions = decltype(propagator)::Options<>(gctx, mctx); + auto propagatorOptions = + decltype(propagator)::template Options<>(gctx, mctx); propagatorOptions.direction = propagatorDirection; auto result = From 5a9eb62c0f0690746355cf144b73fb5089ef3969 Mon Sep 17 00:00:00 2001 From: Andreas Stefl Date: Thu, 31 Oct 2024 14:53:50 +0100 Subject: [PATCH 3/9] fix? --- Core/include/Acts/Seeding/EstimateTrackParamsFromSeed.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Core/include/Acts/Seeding/EstimateTrackParamsFromSeed.hpp b/Core/include/Acts/Seeding/EstimateTrackParamsFromSeed.hpp index 7e82839061b..1ea07eda8c8 100644 --- a/Core/include/Acts/Seeding/EstimateTrackParamsFromSeed.hpp +++ b/Core/include/Acts/Seeding/EstimateTrackParamsFromSeed.hpp @@ -295,7 +295,7 @@ std::optional estimateTrackParamsFromSeed( VoidNavigator(), logger().cloneWithSuffix("Propagator")); MagneticFieldContext mctx; auto propagatorOptions = - decltype(propagator)::template Options<>(gctx, mctx); + typename decltype(propagator)::template Options<>(gctx, mctx); propagatorOptions.direction = propagatorDirection; auto result = From f8c2490e3796d02c5b1f60626328d485e8625eb5 Mon Sep 17 00:00:00 2001 From: Andreas Stefl Date: Fri, 22 Nov 2024 15:53:42 +0100 Subject: [PATCH 4/9] pr feedback --- .../Seeding/EstimateTrackParamsFromSeed.hpp | 8 +++---- .../Seeding/EstimateTrackParamsFromSeed.cpp | 12 +++++++---- .../src/TrackParamsEstimationAlgorithm.cpp | 21 +++---------------- .../EstimateTrackParamsFromSeedTest.cpp | 4 ++-- 4 files changed, 17 insertions(+), 28 deletions(-) diff --git a/Core/include/Acts/Seeding/EstimateTrackParamsFromSeed.hpp b/Core/include/Acts/Seeding/EstimateTrackParamsFromSeed.hpp index 7d441c61edf..690a73f1a41 100644 --- a/Core/include/Acts/Seeding/EstimateTrackParamsFromSeed.hpp +++ b/Core/include/Acts/Seeding/EstimateTrackParamsFromSeed.hpp @@ -10,7 +10,7 @@ #include "Acts/Definitions/Algebra.hpp" #include "Acts/Definitions/TrackParametrization.hpp" -#include "Acts/EventData/TrackParameters.hpp" +#include "Acts/Definitions/Units.hpp" #include "Acts/Surfaces/Surface.hpp" #include "Acts/Utilities/Zip.hpp" @@ -65,7 +65,7 @@ Result estimateTrackParamsFromSeedAtSurface( const Surface& surface, const Vector3& sp0, const Vector3& sp1, const Vector3& sp2, const std::shared_ptr& bField, - const std::shared_ptr& propagator, + const std::shared_ptr& propagator = nullptr, const Acts::Logger& logger = getDummyLogger()); /// Estimate the full track parameters from three space points @@ -141,11 +141,11 @@ FreeVector estimateTrackParamsFromSeed(spacepoint_range_t spRange, /// /// @return bound parameters template -Result estimateTrackParamsFromSeed( +Result estimateTrackParamsFromSeedAtSurface( const GeometryContext& gctx, const MagneticFieldContext& mctx, const Surface& surface, spacepoint_range_t spRange, const std::shared_ptr& bField, - const std::shared_ptr& propagator, + const std::shared_ptr& propagator = nullptr, const Acts::Logger& logger = getDummyLogger()) { // Check the number of provided space points if (spRange.size() != 3) { diff --git a/Core/src/Seeding/EstimateTrackParamsFromSeed.cpp b/Core/src/Seeding/EstimateTrackParamsFromSeed.cpp index b0845623829..86477ee7749 100644 --- a/Core/src/Seeding/EstimateTrackParamsFromSeed.cpp +++ b/Core/src/Seeding/EstimateTrackParamsFromSeed.cpp @@ -46,7 +46,8 @@ class EstimateTrackParamsFromSeedErrorCategory : public std::error_category { } // namespace -std::error_code Acts::make_error_code(Acts::PropagatorError e) { +std::error_code Acts::make_error_code( + Acts::EstimateTrackParamsFromSeedError e) { static EstimateTrackParamsFromSeedErrorCategory c; return {static_cast(e), c}; } @@ -195,8 +196,9 @@ Acts::Result Acts::estimateTrackParamsFromSeedAtSurface( if (!lpResult.ok()) { // no cov transport matrix is needed here // particle hypothesis does not matter here - CurvilinearTrackParameters estimatedParams( - origin, direction, qOverPt, std::nullopt, ParticleHypothesis::pion()); + CurvilinearTrackParameters estimatedParams(freeParams.segment<4>(eFreePos0), + direction, qOverPt, std::nullopt, + ParticleHypothesis::pion()); auto surfaceIntersection = surface.intersect(gctx, origin, direction).closest(); @@ -221,7 +223,9 @@ Acts::Result Acts::estimateTrackParamsFromSeedAtSurface( ? propagator->propagateToSurface(estimatedParams, surface, propagatorOptions) : Propagator(EigenStepper<>(bField), VoidNavigator(), - logger().cloneWithSuffix("Propagator")); + logger().cloneWithSuffix("Propagator")) + .propagateToSurface(estimatedParams, surface, + propagatorOptions); if (!result.ok()) { ACTS_INFO("The propagation failed."); return Result::failure( diff --git a/Examples/Algorithms/TrackFinding/src/TrackParamsEstimationAlgorithm.cpp b/Examples/Algorithms/TrackFinding/src/TrackParamsEstimationAlgorithm.cpp index f2711ce1d1a..b8dbd2f99c1 100644 --- a/Examples/Algorithms/TrackFinding/src/TrackParamsEstimationAlgorithm.cpp +++ b/Examples/Algorithms/TrackFinding/src/TrackParamsEstimationAlgorithm.cpp @@ -8,7 +8,6 @@ #include "ActsExamples/TrackFinding/TrackParamsEstimationAlgorithm.hpp" -#include "Acts/Definitions/Algebra.hpp" #include "Acts/Definitions/TrackParametrization.hpp" #include "Acts/EventData/Seed.hpp" #include "Acts/Geometry/GeometryIdentifier.hpp" @@ -101,24 +100,10 @@ ProcessCode TrackParamsEstimationAlgorithm::execute( continue; } - // Get the magnetic field at the bottom space point - auto fieldRes = m_cfg.magneticField->getField( - {bottomSP->x(), bottomSP->y(), bottomSP->z()}, bCache); - if (!fieldRes.ok()) { - ACTS_ERROR("Field lookup error: " << fieldRes.error()); - return ProcessCode::ABORT; - } - Acts::Vector3 field = *fieldRes; - - if (field.norm() < m_cfg.bFieldMin) { - ACTS_WARNING("Magnetic field at seed " << iseed << " is too small " - << field.norm()); - continue; - } - // Estimate the track parameters from seed - const auto paramsResult = Acts::estimateTrackParamsFromSeed( - ctx.geoContext, seed.sp(), *surface, field); + const auto paramsResult = Acts::estimateTrackParamsFromSeedAtSurface( + ctx.geoContext, ctx.magFieldContext, *surface, seed.sp(), + m_cfg.magneticField); if (!paramsResult.ok()) { ACTS_WARNING("Skip track because param estimation failed " << paramsResult.error()); diff --git a/Tests/UnitTests/Core/Seeding/EstimateTrackParamsFromSeedTest.cpp b/Tests/UnitTests/Core/Seeding/EstimateTrackParamsFromSeedTest.cpp index 45dbbd9d0bb..592dfcd1dbd 100644 --- a/Tests/UnitTests/Core/Seeding/EstimateTrackParamsFromSeedTest.cpp +++ b/Tests/UnitTests/Core/Seeding/EstimateTrackParamsFromSeedTest.cpp @@ -174,8 +174,8 @@ BOOST_AUTO_TEST_CASE(trackparameters_estimation_test) { BOOST_CHECK(!estFreeParams.hasNaN()); // Test the bound track parameters estimator - auto estFullParamsResult = estimateTrackParamsFromSeed( - geoCtx, spacePointPtrs, *bottomSurface, bField); + auto estFullParamsResult = estimateTrackParamsFromSeedAtSurface( + geoCtx, magCtx, *bottomSurface, spacePointPtrs, field); BOOST_CHECK(estFullParamsResult.ok()); const auto& estFullParams = estFullParamsResult.value(); BOOST_TEST_INFO( From 401ee4d0814ae28d91cabf96f79213380be6aaeb Mon Sep 17 00:00:00 2001 From: Andreas Stefl Date: Sat, 23 Nov 2024 08:33:16 +0100 Subject: [PATCH 5/9] fix --- .../UnitTests/Core/Seeding/EstimateTrackParamsFromSeedTest.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tests/UnitTests/Core/Seeding/EstimateTrackParamsFromSeedTest.cpp b/Tests/UnitTests/Core/Seeding/EstimateTrackParamsFromSeedTest.cpp index 592dfcd1dbd..6b9811d3bba 100644 --- a/Tests/UnitTests/Core/Seeding/EstimateTrackParamsFromSeedTest.cpp +++ b/Tests/UnitTests/Core/Seeding/EstimateTrackParamsFromSeedTest.cpp @@ -97,7 +97,7 @@ BOOST_AUTO_TEST_CASE(trackparameters_estimation_test) { }); const Vector3 bField(0, 0, 2._T); auto field = std::make_shared(bField); - ConstantFieldStepper stepper(std::move(field)); + ConstantFieldStepper stepper(field); ConstantFieldPropagator propagator(std::move(stepper), std::move(navigator)); From 9ae65dc546bd3a6ff0a7ec76c703891f89bd43a8 Mon Sep 17 00:00:00 2001 From: Andreas Stefl Date: Mon, 25 Nov 2024 16:04:08 +0100 Subject: [PATCH 6/9] doc --- .../Seeding/EstimateTrackParamsFromSeed.hpp | 57 ++++++++++--------- 1 file changed, 31 insertions(+), 26 deletions(-) diff --git a/Core/include/Acts/Seeding/EstimateTrackParamsFromSeed.hpp b/Core/include/Acts/Seeding/EstimateTrackParamsFromSeed.hpp index 690a73f1a41..8cad18599ae 100644 --- a/Core/include/Acts/Seeding/EstimateTrackParamsFromSeed.hpp +++ b/Core/include/Acts/Seeding/EstimateTrackParamsFromSeed.hpp @@ -60,6 +60,26 @@ FreeVector estimateTrackParamsFromSeed(const Vector3& sp0, const Vector3& sp1, const Vector3& sp2, const Vector3& bField); +/// Estimate the full track parameters from three space points +/// +/// This is a purely spatial estimation, i.e. the time parameter will be set to +/// 0. +/// +/// See the free parameter version for more details. +/// +/// @tparam spacepoint_iterator_t The type of space point iterator +/// +/// @param gctx the geometry context +/// @param mctx the magnetic field context +/// @param surface the surface where the bound parameters should be expressed +/// @param sp0 the bottom space point +/// @param sp1 the middle space point +/// @param sp2 the top space point +/// @param bField the magnetic field provider +/// @param propagator is the propagator used in case the bottom spacepoint is not on the surface +/// @param logger the logger to be used +/// +/// @return bound parameters result Result estimateTrackParamsFromSeedAtSurface( const GeometryContext& gctx, const MagneticFieldContext& mctx, const Surface& surface, const Vector3& sp0, const Vector3& sp1, @@ -70,15 +90,8 @@ Result estimateTrackParamsFromSeedAtSurface( /// Estimate the full track parameters from three space points /// -/// This method is based on the conformal map transformation. It estimates the -/// full free track parameters, i.e. (x, y, z, t, dx, dy, dz, q/p) at the bottom -/// space point. The bottom space is assumed to be the first element in the -/// range defined by the iterators. The magnetic field (which might be along any -/// direction) is also necessary for the momentum estimation. -/// -/// It resembles the method used in ATLAS for the track parameters estimated -/// from seed, i.e. the function InDet::SiTrackMaker_xk::getAtaPlane here: -/// https://acode-browser.usatlas.bnl.gov/lxr/source/athena/InnerDetector/InDetRecTools/SiTrackMakerTool_xk/src/SiTrackMaker_xk.cxx +/// See the free parameter version with the explicit spacepoints for more +/// details. /// /// @tparam spacepoint_iterator_t The type of space point iterator /// @@ -119,27 +132,19 @@ FreeVector estimateTrackParamsFromSeed(spacepoint_range_t spRange, /// Estimate the full track parameters from three space points /// -/// This method is based on the conformal map transformation. It estimates the -/// full bound track parameters, i.e. (loc0, loc1, phi, theta, q/p, t) at the -/// bottom space point. The bottom space is assumed to be the first element -/// in the range defined by the iterators. It must lie on the surface provided -/// for the representation of the bound track parameters. The magnetic field -/// (which might be along any direction) is also necessary for the momentum -/// estimation. -/// -/// It resembles the method used in ATLAS for the track parameters estimated -/// from seed, i.e. the function InDet::SiTrackMaker_xk::getAtaPlane here: -/// https://acode-browser.usatlas.bnl.gov/lxr/source/athena/InnerDetector/InDetRecTools/SiTrackMakerTool_xk/src/SiTrackMaker_xk.cxx +/// See the free parameter version for more details. /// /// @tparam spacepoint_iterator_t The type of space point iterator /// -/// @param gctx is the geometry context -/// @param spRange is the range of space points -/// @param surface is the surface of the bottom space point. The estimated bound -/// track parameters will be represented also at this surface -/// @param bField is the magnetic field vector +/// @param gctx the geometry context +/// @param mctx the magnetic field context +/// @param surface the surface where the bound parameters should be expressed +/// @param spRange the range of space points (bottom, middle, top) +/// @param bField the magnetic field provider +/// @param propagator is the propagator used in case the bottom spacepoint is not on the surface +/// @param logger the logger to be used /// -/// @return bound parameters +/// @return bound parameters result template Result estimateTrackParamsFromSeedAtSurface( const GeometryContext& gctx, const MagneticFieldContext& mctx, From 939a6f30f033599013e67ece0b192552457c18f0 Mon Sep 17 00:00:00 2001 From: Andreas Stefl Date: Mon, 25 Nov 2024 17:26:29 +0100 Subject: [PATCH 7/9] fix exatrkx --- .../src/PrototracksToParameters.cpp | 19 +++---------------- 1 file changed, 3 insertions(+), 16 deletions(-) diff --git a/Examples/Algorithms/TrackFindingExaTrkX/src/PrototracksToParameters.cpp b/Examples/Algorithms/TrackFindingExaTrkX/src/PrototracksToParameters.cpp index 53fe1cdbdad..4da4c6e829b 100644 --- a/Examples/Algorithms/TrackFindingExaTrkX/src/PrototracksToParameters.cpp +++ b/Examples/Algorithms/TrackFindingExaTrkX/src/PrototracksToParameters.cpp @@ -55,7 +55,6 @@ PrototracksToParameters::~PrototracksToParameters() {} ProcessCode PrototracksToParameters::execute( const AlgorithmContext &ctx) const { - auto bCache = m_cfg.magneticField->makeCache(ctx.magFieldContext); const auto &sps = m_inputSpacePoints(ctx); auto prototracks = m_inputProtoTracks(ctx); @@ -154,21 +153,9 @@ ProcessCode PrototracksToParameters::execute( .geometryId(); const auto &surface = *m_cfg.geometry->findSurface(geoId); - auto fieldRes = m_cfg.magneticField->getField( - {bottomSP->x(), bottomSP->y(), bottomSP->z()}, bCache); - if (!fieldRes.ok()) { - ACTS_ERROR("Field lookup error: " << fieldRes.error()); - return ProcessCode::ABORT; - } - Acts::Vector3 field = *fieldRes; - - if (field.norm() < m_cfg.bFieldMin) { - ACTS_WARNING("Magnetic field at seed is too small " << field.norm()); - continue; - } - - auto parsResult = Acts::estimateTrackParamsFromSeed( - ctx.geoContext, seed.sp(), surface, field); + auto parsResult = Acts::estimateTrackParamsFromSeedAtSurface( + ctx.geoContext, ctx.magFieldContext, surface, seed.sp(), + m_cfg.magneticField); if (!parsResult.ok()) { ACTS_WARNING("Skip track because of bad params"); } From b682e16f759b6a75e36b88b4ae6c0643e3d18780 Mon Sep 17 00:00:00 2001 From: Andreas Stefl Date: Tue, 26 Nov 2024 14:54:52 +0100 Subject: [PATCH 8/9] pr feedback --- Core/include/Acts/Seeding/EstimateTrackParamsFromSeed.hpp | 4 ++-- Core/src/Seeding/EstimateTrackParamsFromSeed.cpp | 3 +-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/Core/include/Acts/Seeding/EstimateTrackParamsFromSeed.hpp b/Core/include/Acts/Seeding/EstimateTrackParamsFromSeed.hpp index 8cad18599ae..d78b7dc49db 100644 --- a/Core/include/Acts/Seeding/EstimateTrackParamsFromSeed.hpp +++ b/Core/include/Acts/Seeding/EstimateTrackParamsFromSeed.hpp @@ -85,7 +85,7 @@ Result estimateTrackParamsFromSeedAtSurface( const Surface& surface, const Vector3& sp0, const Vector3& sp1, const Vector3& sp2, const std::shared_ptr& bField, - const std::shared_ptr& propagator = nullptr, + const BasePropagator* propagator = nullptr, const Acts::Logger& logger = getDummyLogger()); /// Estimate the full track parameters from three space points @@ -150,7 +150,7 @@ Result estimateTrackParamsFromSeedAtSurface( const GeometryContext& gctx, const MagneticFieldContext& mctx, const Surface& surface, spacepoint_range_t spRange, const std::shared_ptr& bField, - const std::shared_ptr& propagator = nullptr, + const BasePropagator* propagator = nullptr, const Acts::Logger& logger = getDummyLogger()) { // Check the number of provided space points if (spRange.size() != 3) { diff --git a/Core/src/Seeding/EstimateTrackParamsFromSeed.cpp b/Core/src/Seeding/EstimateTrackParamsFromSeed.cpp index 86477ee7749..c36a320be01 100644 --- a/Core/src/Seeding/EstimateTrackParamsFromSeed.cpp +++ b/Core/src/Seeding/EstimateTrackParamsFromSeed.cpp @@ -174,8 +174,7 @@ Acts::Result Acts::estimateTrackParamsFromSeedAtSurface( const Surface& surface, const Vector3& sp0, const Vector3& sp1, const Vector3& sp2, const std::shared_ptr& bField, - const std::shared_ptr& propagator, - const Acts::Logger& logger) { + const BasePropagator* propagator, const Acts::Logger& logger) { MagneticFieldProvider::Cache bFieldCache = bField->makeCache(mctx); Result bFieldResult = bField->getField(sp0, bFieldCache); From 2b04317f67bde50f3a7ad588e56a4a3da2f74dca Mon Sep 17 00:00:00 2001 From: Andreas Stefl Date: Tue, 26 Nov 2024 17:02:36 +0100 Subject: [PATCH 9/9] stuff --- Core/include/Acts/Seeding/EstimateTrackParamsFromSeed.hpp | 7 ++----- Core/src/Seeding/EstimateTrackParamsFromSeed.cpp | 8 +++----- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/Core/include/Acts/Seeding/EstimateTrackParamsFromSeed.hpp b/Core/include/Acts/Seeding/EstimateTrackParamsFromSeed.hpp index d78b7dc49db..4790c3483be 100644 --- a/Core/include/Acts/Seeding/EstimateTrackParamsFromSeed.hpp +++ b/Core/include/Acts/Seeding/EstimateTrackParamsFromSeed.hpp @@ -83,7 +83,7 @@ FreeVector estimateTrackParamsFromSeed(const Vector3& sp0, const Vector3& sp1, Result estimateTrackParamsFromSeedAtSurface( const GeometryContext& gctx, const MagneticFieldContext& mctx, const Surface& surface, const Vector3& sp0, const Vector3& sp1, - const Vector3& sp2, + const Vector3& sp2, double timeSp0, const std::shared_ptr& bField, const BasePropagator* propagator = nullptr, const Acts::Logger& logger = getDummyLogger()); @@ -176,10 +176,7 @@ Result estimateTrackParamsFromSeedAtSurface( Result paramsResult = estimateTrackParamsFromSeedAtSurface( gctx, mctx, surface, spPositions[0], spPositions[1], spPositions[2], - bField, propagator, logger); - if (paramsResult.ok()) { - paramsResult.value()[eBoundTime] = spTimes[0].value_or(0); - } + spTimes[0].value_or(0), bField, propagator, logger); return paramsResult; } diff --git a/Core/src/Seeding/EstimateTrackParamsFromSeed.cpp b/Core/src/Seeding/EstimateTrackParamsFromSeed.cpp index c36a320be01..754b5acafdf 100644 --- a/Core/src/Seeding/EstimateTrackParamsFromSeed.cpp +++ b/Core/src/Seeding/EstimateTrackParamsFromSeed.cpp @@ -172,7 +172,7 @@ Acts::BoundMatrix Acts::estimateTrackParamCovariance( Acts::Result Acts::estimateTrackParamsFromSeedAtSurface( const GeometryContext& gctx, const MagneticFieldContext& mctx, const Surface& surface, const Vector3& sp0, const Vector3& sp1, - const Vector3& sp2, + const Vector3& sp2, double timeSp0, const std::shared_ptr& bField, const BasePropagator* propagator, const Acts::Logger& logger) { MagneticFieldProvider::Cache bFieldCache = bField->makeCache(mctx); @@ -186,6 +186,7 @@ Acts::Result Acts::estimateTrackParamsFromSeedAtSurface( FreeVector freeParams = estimateTrackParamsFromSeed(sp0, sp1, sp2, bFieldVector); + freeParams[eFreeTime] = timeSp0; Vector3 origin = sp0; Vector3 direction = freeParams.segment<3>(eFreeDir0); @@ -206,7 +207,6 @@ Acts::Result Acts::estimateTrackParamsFromSeedAtSurface( ACTS_INFO( "The surface does not intersect with the origin and estimated " "direction."); - // TODO return Result::failure( EstimateTrackParamsFromSeedError::SurfaceIntersectionFailed); } @@ -222,7 +222,7 @@ Acts::Result Acts::estimateTrackParamsFromSeedAtSurface( ? propagator->propagateToSurface(estimatedParams, surface, propagatorOptions) : Propagator(EigenStepper<>(bField), VoidNavigator(), - logger().cloneWithSuffix("Propagator")) + logger.cloneWithSuffix("Propagator")) .propagateToSurface(estimatedParams, surface, propagatorOptions); if (!result.ok()) { @@ -243,8 +243,6 @@ Acts::Result Acts::estimateTrackParamsFromSeedAtSurface( // The estimated loc0 and loc1 params[eBoundLoc0] = bottomLocalPos.x(); params[eBoundLoc1] = bottomLocalPos.y(); - // We need the bottom space point time later - params[eBoundTime] = 0; return Result::success(params); }