Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor!: remove division of vertex covariance with weight #2551

Merged
merged 10 commits into from
Oct 25, 2023
3 changes: 0 additions & 3 deletions Core/include/Acts/Vertexing/AdaptiveMultiVertexFitter.ipp
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,6 @@ Acts::AdaptiveMultiVertexFitter<input_track_t, linearizer_t>::fitImpl(
} else if (currentVtx->fullCovariance() == SquareMatrix4::Zero()) {
return VertexingError::NoCovariance;
}
double weight =
1. / m_cfg.annealingTool.getWeight(state.annealingState, 1.);
currentVtx->setFullCovariance(currentVtx->fullCovariance() * weight);

// Set vertexCompatibility for all TrackAtVertex objects
// at 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
Loading