File indexing completed on 2026-05-22 07:46:51
0001
0002
0003
0004
0005
0006
0007
0008
0009 #pragma once
0010
0011 #include "Acts/Definitions/TrackParametrization.hpp"
0012 #include "Acts/EventData/AnyTrackStateProxy.hpp"
0013 #include "Acts/Geometry/GeometryContext.hpp"
0014 #include "Acts/Utilities/Logger.hpp"
0015 #include "Acts/Utilities/Result.hpp"
0016
0017 #include <cstddef>
0018 #include <utility>
0019
0020 namespace Acts {
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034
0035
0036
0037
0038
0039 class MbfSmoother {
0040 public:
0041
0042
0043
0044
0045
0046
0047
0048 template <typename traj_t>
0049 Result<void> operator()(const GeometryContext& gctx, traj_t& trajectory,
0050 std::size_t entryIndex,
0051 const Logger& logger = getDummyLogger()) const {
0052 static_cast<void>(gctx);
0053 static_cast<void>(logger);
0054
0055 using TrackStateProxy = typename traj_t::TrackStateProxy;
0056
0057 TrackStateProxy startTs = trajectory.getTrackState(entryIndex);
0058
0059
0060
0061 BoundMatrix bigLambdaHat = BoundMatrix::Zero();
0062 BoundVector smallLambdaHat = BoundVector::Zero();
0063
0064 trajectory.applyBackwards(startTs.index(), [&](TrackStateProxy ts) {
0065
0066 ts.addComponents(TrackStatePropMask::Smoothed);
0067
0068 AnyMutableTrackStateProxy internalTrackState(ts);
0069
0070
0071 calculateSmoothed(internalTrackState, bigLambdaHat, smallLambdaHat);
0072
0073
0074 if (!ts.hasPrevious()) {
0075 return;
0076 }
0077
0078
0079 if (ts.typeFlags().isMeasurement()) {
0080 visitMeasurement(AnyConstTrackStateProxy{ts}, bigLambdaHat,
0081 smallLambdaHat);
0082 } else {
0083 visitNonMeasurement(std::as_const(ts).jacobian(), bigLambdaHat,
0084 smallLambdaHat);
0085 }
0086 });
0087
0088 return Result<void>::success();
0089 }
0090
0091 private:
0092
0093 void calculateSmoothed(AnyMutableTrackStateProxy& ts,
0094 const BoundMatrix& bigLambdaHat,
0095 const BoundVector& smallLambdaHat) const;
0096
0097
0098 void visitNonMeasurement(
0099 const AnyConstTrackStateProxy::ConstCovarianceMap& jacobian,
0100 BoundMatrix& bigLambdaHat, BoundVector& smallLambdaHat) const;
0101
0102
0103 void visitMeasurement(const AnyConstTrackStateProxy& ts,
0104 BoundMatrix& bigLambdaHat,
0105 BoundVector& smallLambdaHat) const;
0106
0107 template <std::size_t N>
0108 void visitMeasurementImpl(const AnyConstTrackStateProxy& ts,
0109 BoundMatrix& bigLambdaHat,
0110 BoundVector& smallLambdaHat) const;
0111 };
0112
0113 }