diff --git a/Phys/VertexFit/include/VertexFit/ParticleVertexFitter.h b/Phys/VertexFit/include/VertexFit/ParticleVertexFitter.h index 4374e076e074bbd37b73b37ecc0b220e216c8c8a..74ce7e84a782a7afb7a2f209e9a85cff04bb4d9b 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()" ); }