From 8ce9fd3641eda5e48c0b90ff9d23b59bc206b185 Mon Sep 17 00:00:00 2001 From: felix-russo <72298366+felix-russo@users.noreply.github.com> Date: Thu, 26 Oct 2023 01:23:22 +0200 Subject: [PATCH] refactor!: remove division of vertex covariance with weight (#2551) Reopen #2522 which we had to revert due to athena output changes Should go in for the next major version --- .../Vertexing/AdaptiveMultiVertexFitter.ipp | 2 -- .../AdaptiveMultiVertexFinderTests.cpp | 28 ++++++++++++------- 2 files changed, 18 insertions(+), 12 deletions(-) diff --git a/Core/include/Acts/Vertexing/AdaptiveMultiVertexFitter.ipp b/Core/include/Acts/Vertexing/AdaptiveMultiVertexFitter.ipp index cd29260f3a6..8f59ac534dc 100644 --- a/Core/include/Acts/Vertexing/AdaptiveMultiVertexFitter.ipp +++ b/Core/include/Acts/Vertexing/AdaptiveMultiVertexFitter.ipp @@ -84,8 +84,6 @@ Acts::AdaptiveMultiVertexFitter::fitImpl( } else if (vtx->fullCovariance() == SquareMatrix4::Zero()) { return VertexingError::NoCovariance; } - double weight = m_cfg.annealingTool.getWeight(state.annealingState, 1.); - vtx->setFullCovariance(vtx->fullCovariance() / weight); // Set vertexCompatibility for all TrackAtVertex objects // at the current vertex diff --git a/Tests/UnitTests/Core/Vertexing/AdaptiveMultiVertexFinderTests.cpp b/Tests/UnitTests/Core/Vertexing/AdaptiveMultiVertexFinderTests.cpp index ec6e6dcd3e6..0393d94337b 100644 --- a/Tests/UnitTests/Core/Vertexing/AdaptiveMultiVertexFinderTests.cpp +++ b/Tests/UnitTests/Core/Vertexing/AdaptiveMultiVertexFinderTests.cpp @@ -189,15 +189,19 @@ BOOST_AUTO_TEST_CASE(adaptive_multi_vertex_finder_test) { BOOST_CHECK_EQUAL(allVertices.size(), expNRecoVertices); + double relTol = 1e-2; + double small = 1e-3; for (int i = 0; i < expNRecoVertices; i++) { auto recoVtx = allVertices[i]; auto expVtx = verticesInfo[i]; - CHECK_CLOSE_ABS(recoVtx.position(), expVtx.position, 0.001_mm); - CHECK_CLOSE_ABS(recoVtx.covariance(), expVtx.covariance, 0.001_mm); + CHECK_CLOSE_OR_SMALL(recoVtx.position(), expVtx.position, relTol, small); + CHECK_CLOSE_OR_SMALL(recoVtx.covariance(), expVtx.covariance, relTol, + small); BOOST_CHECK_EQUAL(recoVtx.tracks().size(), expVtx.nTracks); - CHECK_CLOSE_ABS(recoVtx.tracks()[0].trackWeight, expVtx.trk1Weight, 0.003); - CHECK_CLOSE_ABS(recoVtx.tracks()[0].vertexCompatibility, expVtx.trk1Comp, - 0.003); + CHECK_CLOSE_OR_SMALL(recoVtx.tracks()[0].trackWeight, expVtx.trk1Weight, + relTol, small); + CHECK_CLOSE_OR_SMALL(recoVtx.tracks()[0].vertexCompatibility, + expVtx.trk1Comp, relTol, small); } } @@ -347,15 +351,19 @@ BOOST_AUTO_TEST_CASE(adaptive_multi_vertex_finder_usertype_test) { BOOST_CHECK_EQUAL(allVertices.size(), expNRecoVertices); + double relTol = 1e-2; + double small = 1e-3; for (int i = 0; i < expNRecoVertices; i++) { auto recoVtx = allVertices[i]; auto expVtx = verticesInfo[i]; - CHECK_CLOSE_ABS(recoVtx.position(), expVtx.position, 0.001_mm); - CHECK_CLOSE_ABS(recoVtx.covariance(), expVtx.covariance, 0.001_mm); + CHECK_CLOSE_OR_SMALL(recoVtx.position(), expVtx.position, relTol, small); + CHECK_CLOSE_OR_SMALL(recoVtx.covariance(), expVtx.covariance, relTol, + small); BOOST_CHECK_EQUAL(recoVtx.tracks().size(), expVtx.nTracks); - CHECK_CLOSE_ABS(recoVtx.tracks()[0].trackWeight, expVtx.trk1Weight, 0.003); - CHECK_CLOSE_ABS(recoVtx.tracks()[0].vertexCompatibility, expVtx.trk1Comp, - 0.003); + CHECK_CLOSE_OR_SMALL(recoVtx.tracks()[0].trackWeight, expVtx.trk1Weight, + relTol, small); + CHECK_CLOSE_OR_SMALL(recoVtx.tracks()[0].vertexCompatibility, + expVtx.trk1Comp, relTol, small); } }