From aac1f4bf47f8964ed1bdaf27ea762937074f47ab Mon Sep 17 00:00:00 2001 From: Gerhard Raven <gerhard.raven@nikhef.nl> Date: Wed, 8 Dec 2021 21:18:26 +0100 Subject: [PATCH] adapt to changes in Rec!2653 --- .../include/VertexFit/ParticleVertexFitter.h | 33 +++++++++++-------- 1 file changed, 20 insertions(+), 13 deletions(-) diff --git a/Phys/VertexFit/include/VertexFit/ParticleVertexFitter.h b/Phys/VertexFit/include/VertexFit/ParticleVertexFitter.h index 4374e076e..74ce7e84a 100644 --- a/Phys/VertexFit/include/VertexFit/ParticleVertexFitter.h +++ b/Phys/VertexFit/include/VertexFit/ParticleVertexFitter.h @@ -350,19 +350,25 @@ namespace Sel::Fitters { SymNxN<4, float_v>& p4cov, Matrix<4, 3, float_v>& gainmatrix ) const { // first need to 'update' the momentum vector. but for that we // first need to 'transport'. - VecN<4, float_v> mom = m_particle.momentum(); // 4-momentum - float_v const pz = Sel::get::pz( mom ); - float_v const tx = m_q( 0 ); - float_v const ty = m_q( 1 ); + using Sel::Utils::fourMomentum; + auto mom = fourMomentum( m_particle ); // 4-momentum + float_v const pz = Z( mom ); + float_v const tx = m_q( 0 ); + float_v const ty = m_q( 1 ); // first update the residual - float_v const dz = Sel::get::z( vertexpos ) - Sel::get::z( m_particle ); - VecN<2, float_v> res{Sel::get::x( vertexpos ) - ( Sel::get::x( m_particle ) + tx * dz ), - Sel::get::y( vertexpos ) - ( Sel::get::y( m_particle ) + ty * dz )}; - auto const& R = m_state.covXX(); - auto const& Rinv = m_G; - SymNxN<4, float_v> const momCov = m_particle.momCovMatrix(); - Matrix<4, 3, float_v> const momPosCov = m_particle.momPosCovMatrix(); + using namespace LHCb::LinAlg; + using Sel::Utils::referencePoint; + auto particlepos = referencePoint( m_particle ); + float_v const dz = Z( vertexpos ) - particlepos.Z(); + VecN<2, float_v> res{X( vertexpos ) - ( particlepos.X() + tx * dz ), + Y( vertexpos ) - ( particlepos.Y() + ty * dz )}; + auto const& R = m_state.covXX(); + auto const& Rinv = m_G; + using Sel::Utils::momCovMatrix; + auto const momCov = momCovMatrix( m_particle ); + using Sel::Utils::momPosCovMatrix; + auto const momPosCov = momPosCovMatrix( m_particle ); // To do this right we need THREE projection matrices for the residual: // r = A*x_vertex + B*mom_dau + C*x_dau @@ -401,7 +407,7 @@ namespace Sel::Fitters { auto const deltap4 = K42 * res; p4 = p4 + mom + deltap4; // to understand this, compare to what is done for the track - p4cov = p4cov + momCov - LHCb::LinAlg::similarity( K42, R ); + p4cov = p4cov + momCov - similarity( K42, R ); gainmatrix = gainmatrix + K42 * m_A; } }; @@ -644,7 +650,8 @@ namespace Sel::Fitters { // TODO iron out API consistency, in the old model this would // have been child->endVertex()->position() if constexpr ( Sel::type_traits::has_endVertex_v<std::decay_t<decltype( child )>> ) { - tmp.emplace( child.endVertex(), mask_v{true} ); + using Sel::Utils::endVertexPos; + tmp.emplace( LHCb::LinAlg::convert( endVertexPos( child ) ), mask_v{true} ); } else { throw exception( "Resonance type didn't have an endVertex()" ); } -- GitLab