Skip to content

Commit

Permalink
refactor!: remove division of vertex covariance with weight (#2551)
Browse files Browse the repository at this point in the history
Reopen #2522 which we had to revert due to athena output changes
Should go in for the next major version
  • Loading branch information
felix-russo authored Oct 25, 2023
1 parent e0d26d8 commit 8ce9fd3
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 12 deletions.
2 changes: 0 additions & 2 deletions Core/include/Acts/Vertexing/AdaptiveMultiVertexFitter.ipp
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,6 @@ Acts::AdaptiveMultiVertexFitter<input_track_t, linearizer_t>::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
Expand Down
28 changes: 18 additions & 10 deletions Tests/UnitTests/Core/Vertexing/AdaptiveMultiVertexFinderTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

Expand Down Expand Up @@ -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);
}
}

Expand Down

0 comments on commit 8ce9fd3

Please sign in to comment.