Skip to content

Commit

Permalink
fix: MultiTrajectory parameters and covariance constness (#2009)
Browse files Browse the repository at this point in the history
I believe these functions were not fully usable before if used through a const `MultiTrajectory`.
  • Loading branch information
paulgessinger committed Apr 5, 2023
1 parent ff07dd9 commit 76e9db6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions Core/include/Acts/EventData/MultiTrajectory.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -508,14 +508,14 @@ class TrackStateProxy {
/// first parameters that are set in this order: predicted -> filtered ->
/// smoothed
/// @return one of predicted, filtered or smoothed parameters
Parameters parameters() const;
ConstParameters parameters() const;

/// Track parameters covariance matrix. This tries to be somewhat smart and
/// return the
/// first parameters that are set in this order: predicted -> filtered ->
/// smoothed
/// @return one of predicted, filtered or smoothed covariances
Covariance covariance() const;
ConstCovariance covariance() const;

/// Predicted track parameters vector
/// @return The predicted parameters
Expand Down
6 changes: 4 additions & 2 deletions Core/include/Acts/EventData/MultiTrajectory.ipp
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ TrackStatePropMask TrackStateProxy<D, M, ReadOnly>::getMask() const {
}

template <typename D, size_t M, bool ReadOnly>
inline auto TrackStateProxy<D, M, ReadOnly>::parameters() const -> Parameters {
inline auto TrackStateProxy<D, M, ReadOnly>::parameters() const
-> ConstParameters {
if (hasSmoothed()) {
return smoothed();
} else if (hasFiltered()) {
Expand All @@ -58,7 +59,8 @@ inline auto TrackStateProxy<D, M, ReadOnly>::parameters() const -> Parameters {
}

template <typename D, size_t M, bool ReadOnly>
inline auto TrackStateProxy<D, M, ReadOnly>::covariance() const -> Covariance {
inline auto TrackStateProxy<D, M, ReadOnly>::covariance() const
-> ConstCovariance {
if (hasSmoothed()) {
return smoothedCovariance();
} else if (hasFiltered()) {
Expand Down

0 comments on commit 76e9db6

Please sign in to comment.