9 #include <boost/test/data/test_case.hpp>
10 #include <boost/test/unit_test.hpp>
47 using namespace Acts::UnitLiterals;
49 constexpr
auto eps = 8 * std::numeric_limits<ActsScalar>::epsilon();
78 BOOST_CHECK_EQUAL(params.
charge(), q);
81 void runTest(
const std::shared_ptr<const Surface>&
surface,
double l0,
82 double l1,
double time,
double phi,
double theta,
double p) {
84 phi = ((0 <
theta) and (theta < M_PI)) ? phi : 0.0;
93 pos4.segment<3>(
ePos0) = pos;
107 checkParameters(params, l0, l1, time, phi, theta, p, 0_e, pos, dir);
113 checkParameters(params, l0, l1, time, phi, theta, p, 0_e, pos, dir);
114 BOOST_CHECK(params.covariance());
115 BOOST_CHECK_EQUAL(params.covariance().value(),
cov);
128 checkParameters(params, l0, l1, time, phi, theta, p, -1_e, pos, dir);
129 BOOST_CHECK(not params.covariance());
134 checkParameters(params, l0, l1, time, phi, theta, p, -1_e, pos, dir);
135 BOOST_CHECK(params.covariance());
136 BOOST_CHECK_EQUAL(params.covariance().value(),
cov);
149 checkParameters(params, l0, l1, time, phi, theta, p, 1_e, pos, dir);
150 BOOST_CHECK(not params.covariance());
155 checkParameters(params, l0, l1, time, phi, theta, p, 1_e, pos, dir);
156 BOOST_CHECK(params.covariance());
157 BOOST_CHECK_EQUAL(params.covariance().value(),
cov);
170 checkParameters(params, l0, l1, time, phi, theta, p, -2_e, pos, dir);
171 BOOST_CHECK(not params.covariance());
176 checkParameters(params, l0, l1, time, phi, theta, p, -2_e, pos, dir);
177 BOOST_CHECK(params.covariance());
178 BOOST_CHECK_EQUAL(params.covariance().value(),
cov);
186 checkParameters(params, l0, l1, time, phi, theta, p, 0_e, pos, dir);
187 BOOST_CHECK(not params.covariance());
195 checkParameters(params, l0, l1, time, phi, theta, p, -1_e, pos, dir);
196 BOOST_CHECK(not params.covariance());
204 checkParameters(params, l0, l1, time, phi, theta, p, 1_e, pos, dir);
205 BOOST_CHECK(not params.covariance());
213 checkParameters(params, l0, l1, time, phi, theta, p, 0_e, pos, dir);
214 BOOST_CHECK(not params.covariance());
219 surface,
geoCtx, pos4, dir, -2_e / p, std::nullopt,
222 checkParameters(params, l0, l1, time, phi, theta, p, -2_e, pos, dir);
223 BOOST_CHECK(not params.covariance());
228 surface,
geoCtx, pos4, dir, 3_e / p, std::nullopt,
231 checkParameters(params, l0, l1, time, phi, theta, p, 3_e, pos, dir);
232 BOOST_CHECK(not params.covariance());
239 const auto cones = bdata::make({
240 Surface::makeShared<ConeSurface>(Transform3::Identity(),
243 const auto cylinders = bdata::make({
244 Surface::makeShared<CylinderSurface>(Transform3::Identity(),
247 const auto discs = bdata::make({
248 Surface::makeShared<DiscSurface>(Transform3::Identity(), 0 ,
251 const auto perigees = bdata::make({
252 Surface::makeShared<PerigeeSurface>(
Vector3(0, 0, -1.5)),
254 const auto planes = bdata::make({
255 Surface::makeShared<PlaneSurface>(
Vector3(1, 2, 3), Vector3::UnitX()),
256 Surface::makeShared<PlaneSurface>(
Vector3(-2, -3, -4), Vector3::UnitY()),
257 Surface::makeShared<PlaneSurface>(
Vector3(3, -4, 5), Vector3::UnitZ()),
259 const auto straws = bdata::make({
260 Surface::makeShared<StrawSurface>(Transform3::Identity(), 2.0 ,
266 BOOST_AUTO_TEST_SUITE(EventDataBoundTrackParameters)
269 cones* posAngle* posPositiveNonzero* ts* phis*
thetas*
ps,
270 surface, lphi, lz, time, phi, theta, p) {
273 const auto r = lz * surface->bounds().tanAlpha();
275 runTest(surface, (0 < lz) ? (
r * lphi) : 0.0, lz, time, phi, theta, p);
280 cylinders* posSymmetric* posSymmetric* ts* phis*
thetas*
ps, surface, lrphi,
281 lz, time, phi, theta, p) {
282 runTest(surface, lrphi, lz, time, phi, theta, p);
286 discs* posPositive* posAngle* ts* phis*
thetas*
ps,
287 surface, lr, lphi, time, phi, theta, p) {
289 runTest(surface, lr, (0 < lr) ? lphi : 0.0, time, phi, theta, p);
294 perigees* posSymmetric* posSymmetric* ts* phis* thetasNoForwardBackward*
ps,
295 surface, d0, z0, time, phi, theta, p) {
297 runTest(surface, d0, z0, time, phi, theta, p);
301 planes* posSymmetric* posSymmetric* ts* phis*
thetas*
ps,
302 surface, l0, l1, time, phi, theta, p) {
303 runTest(surface, l0, l1, time, phi, theta, p);
308 straws* posPositive* posSymmetric* ts* phis* thetasNoForwardBackward*
ps,
309 surface, lr, lz, time, phi, theta, p) {
311 runTest(surface, lr, lz, time, phi, theta, p);
314 BOOST_AUTO_TEST_SUITE_END()