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

feat!: Allow trimming other non measurement track states #3993

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 14 additions & 5 deletions Core/include/Acts/Utilities/TrackHelpers.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -412,9 +412,10 @@ void calculateTrackQuantities(track_proxy_t track)
/// @param trimHoles whether to trim holes
/// @param trimOutliers whether to trim outliers
/// @param trimMaterial whether to trim pure material states
/// @param trimOther whether to trim other, non measurement, states
template <TrackProxyConcept track_proxy_t>
void trimTrackFront(track_proxy_t track, bool trimHoles, bool trimOutliers,
bool trimMaterial)
bool trimMaterial, bool trimOther = false)
requires(!track_proxy_t::ReadOnly)
{
using TrackStateProxy = typename track_proxy_t::TrackStateProxy;
Expand All @@ -435,6 +436,9 @@ void trimTrackFront(track_proxy_t track, bool trimHoles, bool trimOutliers,
!typeFlags.test(TrackStateFlag::MeasurementFlag)) {
continue;
}
if (trimOther && !typeFlags.test(TrackStateFlag::MeasurementFlag)) {
continue;
}

front = trackState;
}
Expand All @@ -450,9 +454,10 @@ void trimTrackFront(track_proxy_t track, bool trimHoles, bool trimOutliers,
/// @param trimHoles whether to trim holes
/// @param trimOutliers whether to trim outliers
/// @param trimMaterial whether to trim pure material states
/// @param trimOther whether to trim other, non measurement, states
template <TrackProxyConcept track_proxy_t>
void trimTrackBack(track_proxy_t track, bool trimHoles, bool trimOutliers,
bool trimMaterial)
bool trimMaterial, bool trimOther = false)
requires(!track_proxy_t::ReadOnly)
{
using TrackStateProxy = typename track_proxy_t::TrackStateProxy;
Expand All @@ -473,6 +478,9 @@ void trimTrackBack(track_proxy_t track, bool trimHoles, bool trimOutliers,
!typeFlags.test(TrackStateFlag::MeasurementFlag)) {
continue;
}
if (trimOther && !typeFlags.test(TrackStateFlag::MeasurementFlag)) {
continue;
}

break;
}
Expand All @@ -488,13 +496,14 @@ void trimTrackBack(track_proxy_t track, bool trimHoles, bool trimOutliers,
/// @param trimHoles whether to trim holes
/// @param trimOutliers whether to trim outliers
/// @param trimMaterial whether to trim pure material states
/// @param trimOther whether to trim other, non measurement, states
template <TrackProxyConcept track_proxy_t>
void trimTrack(track_proxy_t track, bool trimHoles, bool trimOutliers,
bool trimMaterial)
bool trimMaterial, bool trimOther = false)
requires(!track_proxy_t::ReadOnly)
{
trimTrackFront(track, trimHoles, trimOutliers, trimMaterial);
trimTrackBack(track, trimHoles, trimOutliers, trimMaterial);
trimTrackFront(track, trimHoles, trimOutliers, trimMaterial, trimOther);
trimTrackBack(track, trimHoles, trimOutliers, trimMaterial, trimOther);
andiwand marked this conversation as resolved.
Show resolved Hide resolved
}

/// Helper function to calculate the predicted residual and its covariance
Expand Down
Loading