From 177c8eb74a6feeade6f43eddc40a16b8ed550b36 Mon Sep 17 00:00:00 2001 From: Gerhard Raven <gerhard.raven@nikhef.nl> Date: Tue, 25 Feb 2025 16:51:37 +0100 Subject: [PATCH] fix bug introduced in Rec!4079 --- .../FunctorCore/include/Functors/Combination.h | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/Phys/FunctorCore/include/Functors/Combination.h b/Phys/FunctorCore/include/Functors/Combination.h index 422aaa6eb62..ee5efe8adcd 100644 --- a/Phys/FunctorCore/include/Functors/Combination.h +++ b/Phys/FunctorCore/include/Functors/Combination.h @@ -64,7 +64,7 @@ namespace Functors::detail { // to use the right ToolHandle... public: template <typename T> - Parent( T* ptr, const std::string& geom_name ) + Parent( T* ptr ) : m_parent{ ptr } , m_get_condition_context{ []( const void* parent, const EventContext& ctx ) -> decltype( auto ) { return static_cast<T const*>( parent )->getConditionContext( ctx ); @@ -72,7 +72,7 @@ namespace Functors::detail { , m_get_warning{ []( const void* parent ) -> decltype( auto ) { return static_cast<T const*>( parent )->warning(); } } - , m_geom( ptr, geom_name ) {} + , m_geom( ptr, LHCb::standard_geometry_top ) {} MsgStream& warning() const { return ( *m_get_warning )( m_parent ); } @@ -85,14 +85,11 @@ namespace Functors::detail { std::optional<Parent> m_parent; std::optional<ToolHandle<IDistanceCalculator>> m_tool; std::string m_tool_name; - std::string m_geom_name; public: - IDistanceCalculatorHolder( std::string instance, std::string geom = LHCb::standard_geometry_top ) - : m_tool_name{ std::move( instance ) }, m_geom_name{ std::move( geom ) } {} + IDistanceCalculatorHolder( std::string instance ) : m_tool_name{ std::move( instance ) } {} - IDistanceCalculatorHolder( IDistanceCalculatorHolder&& rhs ) - : m_tool_name{ std::move( rhs.m_tool_name ) }, m_geom_name{ std::move( rhs.m_geom_name ) } { + IDistanceCalculatorHolder( IDistanceCalculatorHolder&& rhs ) : m_tool_name{ std::move( rhs.m_tool_name ) } { if ( m_parent.has_value() || m_dist.has_value() || m_tool.has_value() ) throw GaudiException{ "DistanceOfClosestApproach(&&)", "attempt to move after bind", StatusCode::FAILURE }; } @@ -100,11 +97,9 @@ namespace Functors::detail { if ( m_parent.has_value() || m_dist.has_value() || m_tool.has_value() ) throw GaudiException{ "DistanceOfClosestApproach(&&)", "attempt to move after bind", StatusCode::FAILURE }; m_tool_name = std::move( rhs.m_tool_name ); - m_geom_name = std::move( rhs.m_geom_name ); return *this; } - IDistanceCalculatorHolder( IDistanceCalculatorHolder const& rhs ) - : m_tool_name{ rhs.m_tool_name }, m_geom_name{ rhs.m_geom_name } { + IDistanceCalculatorHolder( IDistanceCalculatorHolder const& rhs ) : m_tool_name{ rhs.m_tool_name } { if ( m_parent.has_value() || m_dist.has_value() || m_tool.has_value() ) throw GaudiException{ "DistanceOfClosestApproach(&&)", "attempt to copy after bind", StatusCode::FAILURE }; } @@ -112,7 +107,6 @@ namespace Functors::detail { if ( m_parent.has_value() || m_dist.has_value() || m_tool.has_value() ) throw GaudiException{ "DistanceOfClosestApproach(&&)", "attempt to copy after bind", StatusCode::FAILURE }; m_tool_name = rhs.m_tool_name; - m_geom_name = rhs.m_geom_name; return *this; } @@ -122,7 +116,7 @@ namespace Functors::detail { auto try_emplace = [&]( auto* parent ) { if ( parent ) { - m_parent.emplace( parent, m_geom_name ); + m_parent.emplace( parent ); m_tool->retrieve().ignore(); } return parent; -- GitLab