Skip to content

Commit

Permalink
add safer filling
Browse files Browse the repository at this point in the history
  • Loading branch information
AJPfleger committed Oct 9, 2023
1 parent d2d7310 commit f8012c2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
1 change: 0 additions & 1 deletion Core/include/Acts/EventData/TrackStatePropMask.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ enum struct TrackStatePropMask : std::uint8_t {
Filtered = 1 << 1,
Smoothed = 1 << 2,
Jacobian = 1 << 3,

Calibrated = 1 << 4,

All = std::numeric_limits<std::uint8_t>::max(), // should be all ones
Expand Down
11 changes: 9 additions & 2 deletions Core/include/Acts/TrackFitting/detail/FitterHelpers.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,19 @@ auto getTrackStateProxy(propagator_state_t &state, const stepper_t &stepper,
auto &[boundParams, jacobian, pathLength] = *res;

// Fill the track state
trackStateProxy.predicted() = std::move(boundParams.parameters());
if ((mask & TrackStatePropMask::Predicted) != TrackStatePropMask::None) {
trackStateProxy.predicted() = std::move(boundParams.parameters());
}

if (boundParams.covariance().has_value()) {
trackStateProxy.predictedCovariance() =
std::move(*boundParams.covariance());
}
trackStateProxy.jacobian() = std::move(jacobian);

if ((mask & TrackStatePropMask::Jacobian) != TrackStatePropMask::None) {
trackStateProxy.jacobian() = std::move(jacobian);
}

trackStateProxy.pathLength() = std::move(pathLength);

return trackStateProxy;
Expand Down

0 comments on commit f8012c2

Please sign in to comment.