9 #include <boost/test/unit_test.hpp>
27 namespace tt = boost::test_tools;
47 Vector3 direction{sqrt(5. / 22.), 3. * sqrt(2. / 55.), 7. / sqrt(110.)};
50 parameters <<
position[0], position[1], position[2],
time, direction[0],
51 direction[1], direction[2], qop;
56 Jacobian jacobian = 2. * Jacobian::Identity();
57 FreeMatrix transportJacobian = 3. * FreeMatrix::Identity();
59 derivatives << 9., 10., 11., 12., 13., 14., 15., 16.;
64 transportJacobian, derivatives,
65 boundToFreeJacobian, direction);
68 BOOST_CHECK_NE(covariance, Covariance::Identity());
69 BOOST_CHECK_NE(jacobian, 2. * Jacobian::Identity());
70 BOOST_CHECK_EQUAL(transportJacobian, FreeMatrix::Identity());
71 BOOST_CHECK_EQUAL(derivatives, FreeVector::Zero());
72 BOOST_CHECK_NE(boundToFreeJacobian, 4. * BoundToFreeMatrix::Identity());
74 direction,
Vector3(sqrt(5. / 22.), 3. * sqrt(2. / 55.), 7. / sqrt(110.)));
77 covariance = Covariance::Identity();
78 jacobian = 2. * Jacobian::Identity();
79 transportJacobian = 3. * FreeMatrix::Identity();
80 derivatives << 9., 10., 11., 12., 13., 14., 15., 16.;
81 boundToFreeJacobian = 4. * BoundToFreeMatrix::Identity();
87 tgContext, covariance, jacobian, transportJacobian, derivatives,
88 boundToFreeJacobian, parameters, *
surface, freeToBoundCorrection);
90 BOOST_CHECK_NE(covariance, Covariance::Identity());
91 BOOST_CHECK_NE(jacobian, 2. * Jacobian::Identity());
92 BOOST_CHECK_EQUAL(transportJacobian, FreeMatrix::Identity());
93 BOOST_CHECK_EQUAL(derivatives, FreeVector::Zero());
94 BOOST_CHECK_NE(boundToFreeJacobian, 4. * BoundToFreeMatrix::Identity());
95 BOOST_CHECK_EQUAL(parameters, startParameters);
100 covariance, jacobian, transportJacobian, derivatives, boundToFreeJacobian,
102 BOOST_CHECK(std::get<0>(curvResult).
covariance().has_value());
103 BOOST_CHECK_EQUAL(*(std::get<0>(curvResult).
covariance()), covarianceBefore);
104 BOOST_CHECK_EQUAL(std::get<2>(curvResult), 1337.);
107 covariance = Covariance::Identity();
108 jacobian = 2. * Jacobian::Identity();
109 transportJacobian = 3. * FreeMatrix::Identity();
110 derivatives << 9., 10., 11., 12., 13., 14., 15., 16.;
111 boundToFreeJacobian = 4. * BoundToFreeMatrix::Identity();
115 covariance, jacobian, transportJacobian, derivatives, boundToFreeJacobian,
117 BOOST_CHECK(std::get<0>(curvResult).
covariance().has_value());
118 BOOST_CHECK_NE(*(std::get<0>(curvResult).
covariance()),
119 Covariance::Identity());
120 BOOST_CHECK_NE(std::get<1>(curvResult), 2. * Jacobian::Identity());
121 BOOST_CHECK_EQUAL(std::get<2>(curvResult), 1337.);
127 derivatives, boundToFreeJacobian, parameters,
129 freeToBoundCorrection)
131 BOOST_CHECK(std::get<0>(curvResult).
covariance().has_value());
132 BOOST_CHECK_EQUAL(*(std::get<0>(curvResult).
covariance()), covarianceBefore);
133 BOOST_CHECK_EQUAL(std::get<2>(boundResult), 1337.);
136 covariance = Covariance::Identity();
137 jacobian = 2. * Jacobian::Identity();
138 transportJacobian = 3. * FreeMatrix::Identity();
139 derivatives << 9., 10., 11., 12., 13., 14., 15., 16.;
140 boundToFreeJacobian = 4. * BoundToFreeMatrix::Identity();
145 derivatives, boundToFreeJacobian, parameters,
147 freeToBoundCorrection)
149 BOOST_CHECK(std::get<0>(boundResult).
covariance().has_value());
150 BOOST_CHECK_NE(*(std::get<0>(boundResult).
covariance()),
151 Covariance::Identity());
152 BOOST_CHECK_NE(std::get<1>(boundResult), 2. * Jacobian::Identity());
153 BOOST_CHECK_EQUAL(std::get<2>(boundResult), 1337.);
156 freeToBoundCorrection.
apply =
true;
161 derivatives, boundToFreeJacobian, parameters,
163 freeToBoundCorrection)
165 BOOST_CHECK(std::get<0>(boundResult).
covariance().has_value());
166 BOOST_CHECK_NE(*(std::get<0>(boundResult).
covariance()),
167 Covariance::Identity());