9 #include <boost/test/data/test_case.hpp>
10 #include <boost/test/unit_test.hpp>
31 using namespace Acts::Test;
46 std::default_random_engine
rng(123);
53 BOOST_AUTO_TEST_SUITE(EventDataMeasurement)
56 auto [params,
cov] = generateParametersCovariance<ActsScalar, 1u>(
rng);
59 BOOST_CHECK_EQUAL(meas.size(), 1);
60 for (
auto i : boundIndices) {
62 BOOST_CHECK(meas.contains(
i));
64 BOOST_CHECK(not meas.contains(
i));
67 BOOST_CHECK_EQUAL(meas.parameters(), params);
68 BOOST_CHECK_EQUAL(meas.covariance(),
cov);
69 BOOST_CHECK_EQUAL(meas.sourceLink().template get<TestSourceLink>(),
79 for (
auto i : boundIndices) {
80 BOOST_CHECK(meas.contains(
i));
82 BOOST_CHECK_EQUAL(meas.parameters(), params);
83 BOOST_CHECK_EQUAL(meas.covariance(),
cov);
84 BOOST_CHECK_EQUAL(meas.sourceLink().get<
TestSourceLink>(), sourceOrig);
92 const std::vector<std::tuple<double, double, double>> kPhiDataset = {
96 {0.25, 2 * M_PI - 0.25, 0.5},
97 {2 * M_PI - 0.125, 0.125, -0.25},
101 {2 * M_PI - 0.25, 2 * M_PI + 0.25, -0.5},
105 {2 * M_PI + 0.25, 2 * M_PI - 0.25, 0.5},
115 MeasurementVector params = MeasurementVector::Zero();
116 MeasurementCovariance
cov = MeasurementCovariance::Zero();
124 auto res = measurement.residuals(reference);
125 CHECK_CLOSE_ABS(res[0], phiRes, std::numeric_limits<ActsScalar>::epsilon());
129 auto [params,
cov] = generateParametersCovariance<ActsScalar, 1u>(
rng);
132 BOOST_CHECK_EQUAL(meas.size(), 1);
133 for (
auto i : freeIndices) {
135 BOOST_CHECK(meas.contains(
i));
137 BOOST_CHECK(not meas.contains(
i));
140 BOOST_CHECK_EQUAL(meas.parameters(), params);
141 BOOST_CHECK_EQUAL(meas.covariance(),
cov);
142 BOOST_CHECK_EQUAL(meas.sourceLink().template get<TestSourceLink>(),
146 constexpr
auto tol = std::numeric_limits<ActsScalar>::epsilon();
148 auto res = meas.residuals(
ref);
158 BOOST_CHECK_EQUAL(meas.size(),
eFreeSize);
159 for (
auto i : freeIndices) {
160 BOOST_CHECK(meas.contains(
i));
162 BOOST_CHECK_EQUAL(meas.parameters(), params);
163 BOOST_CHECK_EQUAL(meas.covariance(),
cov);
164 BOOST_CHECK_EQUAL(meas.sourceLink().get<
TestSourceLink>(), sourceOrig);
167 constexpr
auto tol = std::numeric_limits<ActsScalar>::epsilon();
174 auto [par1, cov1] = generateParametersCovariance<ActsScalar, 1u>(
rng);
179 BOOST_CHECK_EQUAL(
m.size(), 1);
208 auto [par2, cov2] = generateParametersCovariance<ActsScalar, 2u>(
rng);
213 BOOST_CHECK_EQUAL(
m.size(), 2);
245 BOOST_AUTO_TEST_SUITE_END()