9 #include <boost/test/unit_test.hpp>
14 namespace tt = boost::test_tools;
32 Vector3D direction{sqrt(5. / 22.), 3. * sqrt(2. / 55.), 7. / sqrt(110.)};
35 parameters <<
position[0], position[1], position[2],
time, direction[0],
36 direction[1], direction[2], qop;
40 Covariance covariance = Covariance::Identity();
41 Jacobian jacobian = 2. * Jacobian::Identity();
42 FreeMatrix transportJacobian = 3. * FreeMatrix::Identity();
44 derivatives << 9., 10., 11., 12., 13., 14., 15., 16.;
49 derivatives, jacobianLocalToGlobal, direction);
52 BOOST_CHECK_NE(covariance, Covariance::Identity());
53 BOOST_CHECK_NE(jacobian, 2. * Jacobian::Identity());
54 BOOST_CHECK_EQUAL(transportJacobian, FreeMatrix::Identity());
55 BOOST_CHECK_EQUAL(derivatives, FreeVector::Zero());
56 BOOST_CHECK_NE(jacobianLocalToGlobal, 4. * BoundToFreeMatrix::Identity());
57 BOOST_CHECK_EQUAL(direction,
Vector3D(sqrt(5. / 22.), 3. * sqrt(2. / 55.),
61 covariance = Covariance::Identity();
62 jacobian = 2. * Jacobian::Identity();
63 transportJacobian = 3. * FreeMatrix::Identity();
64 derivatives << 9., 10., 11., 12., 13., 14., 15., 16.;
65 jacobianLocalToGlobal = 4. * BoundToFreeMatrix::Identity();
70 transportJacobian, derivatives,
71 jacobianLocalToGlobal, parameters, *
surface);
73 BOOST_CHECK_NE(covariance, Covariance::Identity());
74 BOOST_CHECK_NE(jacobian, 2. * Jacobian::Identity());
75 BOOST_CHECK_EQUAL(transportJacobian, FreeMatrix::Identity());
76 BOOST_CHECK_EQUAL(derivatives, FreeVector::Zero());
77 BOOST_CHECK_NE(jacobianLocalToGlobal, 4. * BoundToFreeMatrix::Identity());
78 BOOST_CHECK_EQUAL(parameters, startParameters);
82 covariance, jacobian, transportJacobian, derivatives,
83 jacobianLocalToGlobal, parameters,
false, 1337.);
84 BOOST_CHECK(!std::get<0>(curvResult).covariance().has_value());
85 BOOST_CHECK_EQUAL(std::get<2>(curvResult), 1337.);
88 covariance = Covariance::Identity();
89 jacobian = 2. * Jacobian::Identity();
90 transportJacobian = 3. * FreeMatrix::Identity();
91 derivatives << 9., 10., 11., 12., 13., 14., 15., 16.;
92 jacobianLocalToGlobal = 4. * BoundToFreeMatrix::Identity();
96 derivatives, jacobianLocalToGlobal,
97 parameters,
true, 1337.);
98 BOOST_CHECK(std::get<0>(curvResult).covariance().has_value());
99 BOOST_CHECK_NE(*(std::get<0>(curvResult).covariance()),
100 Covariance::Identity());
101 BOOST_CHECK_NE(std::get<1>(curvResult), 2. * Jacobian::Identity());
102 BOOST_CHECK_EQUAL(std::get<2>(curvResult), 1337.);
106 tgContext, covariance, jacobian, transportJacobian, derivatives,
107 jacobianLocalToGlobal, parameters,
false, 1337., *
surface);
108 BOOST_CHECK(!std::get<0>(boundResult).covariance().has_value());
109 BOOST_CHECK_EQUAL(std::get<2>(boundResult), 1337.);
112 covariance = Covariance::Identity();
113 jacobian = 2. * Jacobian::Identity();
114 transportJacobian = 3. * FreeMatrix::Identity();
115 derivatives << 9., 10., 11., 12., 13., 14., 15., 16.;
116 jacobianLocalToGlobal = 4. * BoundToFreeMatrix::Identity();
120 tgContext, covariance, jacobian, transportJacobian, derivatives,
121 jacobianLocalToGlobal, parameters,
true, 1337., *
surface);
122 BOOST_CHECK(std::get<0>(boundResult).covariance().has_value());
123 BOOST_CHECK_NE(*(std::get<0>(boundResult).covariance()),
124 Covariance::Identity());
125 BOOST_CHECK_NE(std::get<1>(boundResult), 2. * Jacobian::Identity());
126 BOOST_CHECK_EQUAL(std::get<2>(boundResult), 1337.);