9 #include <boost/test/unit_test.hpp>
45 using namespace Acts::Test;
46 using namespace Acts::UnitLiterals;
61 KalmanUpdater kfUpdater;
62 KalmanSmoother kfSmoother;
78 1_e / 1_GeV, cov,
pion);
86 const auto kfZeroPropagator =
87 makeConstantFieldPropagator<ConstantFieldStepper>(tester.geometry, 0_T);
90 std::default_random_engine
rng(42);
92 auto makeDefaultKalmanFitterOptions() {
95 .connect<&testSourceLinkCalibrator<VectorMultiTrajectory>>();
101 .connect<&Acts::Test::TestSourceLink::SurfaceAccessor::operator()>(
102 &tester.surfaceAccessor);
110 BOOST_AUTO_TEST_SUITE(TrackFittingKalmanFitter)
114 auto kfOptions = makeDefaultKalmanFitterOptions();
116 bool expected_reversed =
false;
117 bool expected_smoothed =
true;
118 tester.test_ZeroFieldNoSurfaceForward(kfZero, kfOptions,
start,
rng,
119 expected_reversed, expected_smoothed,
125 auto kfOptions = makeDefaultKalmanFitterOptions();
128 kfOptions.reversedFiltering =
false;
129 bool expected_reversed =
false;
130 bool expected_smoothed =
true;
131 tester.test_ZeroFieldWithSurfaceForward(kfZero, kfOptions,
start,
rng,
132 expected_reversed, expected_smoothed,
136 kfOptions.reversedFiltering =
true;
137 kfOptions.reversedFilteringCovarianceScaling = 100.0;
138 expected_reversed =
true;
139 expected_smoothed =
false;
140 tester.test_ZeroFieldWithSurfaceForward(kfZero, kfOptions,
start,
rng,
141 expected_reversed, expected_smoothed,
147 auto kfOptions = makeDefaultKalmanFitterOptions();
150 kfOptions.reversedFiltering =
false;
151 bool expected_reversed =
false;
152 bool expected_smoothed =
true;
153 tester.test_ZeroFieldWithSurfaceBackward(kfZero, kfOptions,
start,
rng,
154 expected_reversed, expected_smoothed,
158 kfOptions.reversedFiltering =
true;
159 kfOptions.reversedFilteringCovarianceScaling = 100.0;
160 expected_reversed =
true;
161 expected_smoothed =
false;
162 tester.test_ZeroFieldWithSurfaceBackward(kfZero, kfOptions,
start,
rng,
163 expected_reversed, expected_smoothed,
169 auto kfOptions = makeDefaultKalmanFitterOptions();
171 bool expected_reversed =
false;
172 bool expected_smoothed =
true;
173 tester.test_ZeroFieldWithSurfaceAtExit(kfZero, kfOptions,
start,
rng,
174 expected_reversed, expected_smoothed,
180 auto kfOptions = makeDefaultKalmanFitterOptions();
182 bool expected_reversed =
false;
183 bool expected_smoothed =
true;
184 tester.test_ZeroFieldShuffled(kfZero, kfOptions,
start,
rng,
185 expected_reversed, expected_smoothed,
true);
190 auto kfOptions = makeDefaultKalmanFitterOptions();
192 bool expected_reversed =
false;
193 bool expected_smoothed =
true;
194 tester.test_ZeroFieldWithHole(kfZero, kfOptions,
start,
rng,
195 expected_reversed, expected_smoothed,
true);
203 auto kfOptions = makeDefaultKalmanFitterOptions();
206 kfOptions.extensions.outlierFinder
209 bool expected_reversed =
false;
210 bool expected_smoothed =
true;
211 tester.test_ZeroFieldWithOutliers(kfZero, kfOptions,
start,
rng,
212 expected_reversed, expected_smoothed,
true);
218 auto test = [&](
double threshold,
bool reverse,
bool expected_reversed,
219 bool expected_smoothed) {
220 auto kfOptions = makeDefaultKalmanFitterOptions();
223 kfOptions.extensions.reverseFilteringLogic
227 kfOptions.reversedFiltering = reverse;
228 kfOptions.reversedFilteringCovarianceScaling = 100.0;
230 tester.test_ZeroFieldWithReverseFiltering(kfZero, kfOptions,
start,
rng,
232 expected_smoothed,
true);
237 test(0.1_GeV,
false,
false,
true);
241 test(10._GeV,
false,
true,
false);
245 test(0.1_GeV,
true,
true,
false);
252 auto kfOptions = makeDefaultKalmanFitterOptions();
254 tester.test_GlobalCovariance(kfZero, kfOptions,
start,
rng);
257 BOOST_AUTO_TEST_SUITE_END()