Skip to content

Commit

Permalink
feat: Allow trimming other non measurements states
Browse files Browse the repository at this point in the history
  • Loading branch information
andiwand committed Dec 17, 2024
1 parent 2bb167c commit a1b701d
Showing 1 changed file with 14 additions and 5 deletions.
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);
}

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

0 comments on commit a1b701d

Please sign in to comment.