9 #include <boost/test/data/test_case.hpp>
10 #include <boost/test/unit_test.hpp>
44 using RandomGenerator = std::default_random_engine;
46 struct SterileSmearer {
50 std::make_pair<double, double>(value + 0., 0.));
60 std::make_pair<double, double>(value +
offset, 3.));
64 struct InvalidSmearer {
68 ActsFatras::DigitizationError::SmearingError);
78 std::shared_ptr<Acts::Surface>
surface;
88 gid(Acts::GeometryIdentifier().setVolume(1).setLayer(2).setSensitive(
90 pid(ActsFatras::Barcode().setVertexPrimary(12).setParticle(23)),
93 using namespace Acts::UnitLiterals;
130 constexpr
auto tol = 128 * std::numeric_limits<double>::epsilon();
134 BOOST_AUTO_TEST_SUITE(FatrasUncorrelatedHitSmearer)
144 auto ret =
s(f.rng, f.hit, *f.surface, f.geoCtx);
145 BOOST_CHECK(ret.ok());
146 auto [par,
cov] = ret.value();
152 auto ret =
s(f.rng, f.hit, *f.surface, f.geoCtx);
153 BOOST_CHECK(ret.ok());
154 auto [par,
cov] = ret.value();
160 auto ret =
s(f.rng, f.hit, *f.surface, f.geoCtx);
161 BOOST_CHECK(not ret.ok());
162 BOOST_CHECK(ret.error());
177 auto ret =
s(f.rng, f.hit, *f.surface, f.geoCtx);
178 BOOST_CHECK(ret.ok());
179 auto [par,
cov] = ret.value();
180 for (
size_t i = 0;
i < s.
indices.size(); ++
i) {
181 BOOST_TEST_INFO(
"Comparing smeared measurement "
182 <<
i <<
" originating from bound parameter "
190 auto ret =
s(f.rng, f.hit, *f.surface, f.geoCtx);
191 BOOST_CHECK(ret.ok());
192 auto [par,
cov] = ret.value();
193 for (
size_t i = 0;
i < s.
indices.size(); ++
i) {
194 BOOST_TEST_INFO(
"Comparing smeared measurement "
195 <<
i <<
" originating from bound parameter "
204 auto ret =
s(f.rng, f.hit, *f.surface, f.geoCtx);
205 BOOST_CHECK(not ret.ok());
206 BOOST_CHECK(ret.error());
218 auto ret =
s(f.rng, f.hit);
219 BOOST_CHECK(ret.ok());
220 auto [par,
cov] = ret.value();
226 auto ret =
s(f.rng, f.hit);
227 BOOST_CHECK(ret.ok());
228 auto [par,
cov] = ret.value();
234 auto ret =
s(f.rng, f.hit);
235 BOOST_CHECK(not ret.ok());
236 BOOST_CHECK(ret.error());
249 auto ret =
s(f.rng, f.hit);
250 BOOST_CHECK(ret.ok());
251 auto [par,
cov] = ret.value();
252 for (
size_t i = 0;
i < s.
indices.size(); ++
i) {
253 BOOST_TEST_INFO(
"Comparing smeared measurement "
254 <<
i <<
" originating from free parameter "
262 auto ret =
s(f.rng, f.hit);
263 BOOST_CHECK(ret.ok());
264 auto [par,
cov] = ret.value();
265 for (
size_t i = 0;
i < s.
indices.size(); ++
i) {
266 BOOST_TEST_INFO(
"Comparing smeared measurement "
267 <<
i <<
" originating from free parameter "
276 auto ret =
s(f.rng, f.hit);
277 BOOST_CHECK(not ret.ok());
278 BOOST_CHECK(ret.error());
282 BOOST_AUTO_TEST_SUITE_END()