9 #include <boost/test/unit_test.hpp>
23 #include <initializer_list>
34 std::vector<std::tuple<double, BoundVector, BoundSquareMatrix>>
a;
35 a.push_back({1.0, BoundVector::Ones(), BoundSquareMatrix::Identity()});
37 std::vector<std::tuple<double, BoundVector, std::optional<BoundSquareMatrix>>>
39 b.push_back({1.0, BoundVector::Ones(), BoundSquareMatrix::Identity()});
41 auto surface = Acts::Surface::makeShared<Acts::PlaneSurface>(
42 Vector3::Ones(), Vector3::Ones().normalized());
49 surface, std::get<1>(a.front()), std::get<2>(a.front()),
52 surface, std::get<1>(b.front()), std::get<2>(b.front()),
55 BOOST_CHECK(b == ap.components());
56 BOOST_CHECK(ap.components() == bp.components());
57 BOOST_CHECK(bp.components() == aps.components());
58 BOOST_CHECK(aps.components() == bps.components());
62 using cov_t = std::optional<BoundSquareMatrix>;
63 for (
const auto &
cov : {
cov_t{},
cov_t{BoundSquareMatrix::Identity()},
64 cov_t{BoundSquareMatrix::Identity()}}) {
65 auto surface = Acts::Surface::makeShared<Acts::PlaneSurface>(
66 Vector3::Ones(), Vector3::Ones().normalized());
71 const auto multi_pars = [&]() {
73 std::tuple<double, BoundVector, std::optional<BoundSquareMatrix>>>
75 for (
int i = 0;
i < 4; ++
i) {
76 a.push_back({0.25, single_pars.parameters(), single_pars.covariance()});
81 BOOST_CHECK_EQUAL(multi_pars.absoluteMomentum(),
82 single_pars.absoluteMomentum());
83 BOOST_CHECK_EQUAL(multi_pars.charge(), single_pars.charge());
86 BOOST_CHECK_EQUAL(multi_pars.momentum(), single_pars.momentum());
87 BOOST_CHECK_EQUAL(multi_pars.parameters(), single_pars.parameters());
90 BOOST_CHECK_EQUAL(multi_pars.transverseMomentum(),
91 single_pars.transverseMomentum());
92 BOOST_CHECK_EQUAL(multi_pars.direction(), single_pars.direction());
95 if (
cov && *
cov != BoundSquareMatrix::Zero()) {
96 BOOST_CHECK_EQUAL(*multi_pars.covariance(), *single_pars.covariance());
98 BOOST_CHECK(not multi_pars.covariance());