9 #include <boost/test/unit_test.hpp>
23 namespace tt = boost::test_tools;
55 direction =
Vector3(1., 1., 999.).normalized();
60 sinPhi = std::sin(phi);
61 cosPhi = std::cos(phi);
62 sinTheta = std::sin(theta);
63 cosTheta = std::cos(theta);
65 const ActsScalar c = std::hypot(direction.y(), direction.z());
73 -direction.x() * direction.y() * invC, 1
e-5);
75 -direction.x() * direction.z() * invC, 1
e-5);
78 direction =
Vector3(7., 8., 9.).normalized();
83 sinPhi = std::sin(phi);
84 cosPhi = std::cos(phi);
85 sinTheta = std::sin(theta);
86 cosTheta = std::cos(theta);
104 direction =
Vector3(2., 3., 4.).normalized();
109 auto roundTrip = a2dJacobian * d2aJacobian;
110 BOOST_CHECK_EQUAL(roundTrip.cols(), 8);
111 BOOST_CHECK_EQUAL(roundTrip.rows(), 8);
133 auto oSurface = Surface::makeShared<PlaneSurface>(
position, odirection);
137 freeParameters << position[0], position[1], position[2],
time, direction[0],
138 direction[1], direction[2], qop;
148 FreeMatrix noTransportJacobian = FreeMatrix::Identity();
149 FreeMatrix realTransportJacobian = 2 * FreeMatrix::Identity();
152 pSurface->freeToPathDerivative(tgContext, freeParameters);
154 pSurface->boundToFreeJacobian(tgContext, boundParameters);
159 tgContext, freeParameters, boundToFreeJacobian, noTransportJacobian,
162 b2bTransportJacobian * boundCovariance * b2bTransportJacobian.transpose();
163 BOOST_CHECK(boundCovariance.isApprox(newBoundCovariance));
166 tgContext, freeParameters, boundToFreeJacobian, noTransportJacobian,
167 freeToPathDerivatives, *oSurface);
169 b2bTransportJacobian * boundCovariance * b2bTransportJacobian.transpose();
170 BOOST_CHECK(not boundCovariance.isApprox(newBoundCovariance));
174 tgContext, freeParameters, boundToFreeJacobian, realTransportJacobian,
177 b2bTransportJacobian * boundCovariance * b2bTransportJacobian.transpose();
178 BOOST_CHECK(not boundCovariance.isApprox(newBoundCovariance));
187 tgContext, freeParameters, directionToAnglesJacobian,
188 anglesToDirectionJacobian, noTransportJacobian, freeToPathDerivatives,
192 f2bTransportJacobian * freeCovariance * f2bTransportJacobian.transpose();
193 BOOST_CHECK(not boundCovariance.isApprox(newBoundCovariance));
215 freeParameters << position[0], position[1], position[2],
time, direction[0],
216 direction[1], direction[2], qop;
226 FreeMatrix noTransportJacobian = FreeMatrix::Identity();
229 pSurface->freeToPathDerivative(tgContext, freeParameters);
237 direction, boundToFreeJacobian, noTransportJacobian,
238 freeToPathDerivatives);
240 b2cTransportJacobian * boundCovariance * b2cTransportJacobian.transpose();
241 BOOST_CHECK(boundCovariance.isApprox(newBoundCovariance));
244 Vector3(4., 5., 6.).normalized(), boundToFreeJacobian,
245 noTransportJacobian, freeToPathDerivatives);
247 b2cTransportJacobian * boundCovariance * b2cTransportJacobian.transpose();
248 BOOST_CHECK(not boundCovariance.isApprox(newBoundCovariance));
258 direction, directionToAnglesJacobian, anglesToDirectionJacobian,
259 noTransportJacobian, freeToPathDerivatives);
262 f2cTransportJacobian * freeCovariance * f2cTransportJacobian.transpose();
263 BOOST_CHECK(not boundCovariance.isApprox(newBoundCovariance));
285 freeParameters << position[0], position[1], position[2],
time, direction[0],
286 direction[1], direction[2], qop;
296 FreeMatrix noTransportJacobian = FreeMatrix::Identity();
299 pSurface->boundToFreeJacobian(tgContext, boundParameters);
303 boundToFreeJacobian, noTransportJacobian);
306 b2fTransportJacobian * boundCovariance * b2fTransportJacobian.transpose();
307 BOOST_CHECK(not newFreeCovariance1.isApprox(freeCovariance));
312 boundToFreeJacobian, noTransportJacobian);
315 c2fTransportJacobian * boundCovariance * c2fTransportJacobian.transpose();
316 BOOST_CHECK(not newFreeCovariance2.isApprox(freeCovariance));
318 BOOST_CHECK(newFreeCovariance1.isApprox(newFreeCovariance2));