9 #include <boost/test/data/test_case.hpp>
10 #include <boost/test/unit_test.hpp>
29 namespace tt = boost::test_tools;
44 std::uniform_real_distribution<>(-1000., 1000.))) ^
47 std::uniform_real_distribution<>(-1000., 1000.))) ^
50 std::uniform_real_distribution<>(-1000., 1000.))) ^
53 bdata::distribution = std::uniform_real_distribution<>(0.,
M_PI))) ^
56 bdata::distribution = std::uniform_real_distribution<>(0.,
M_PI))) ^
59 bdata::distribution = std::uniform_real_distribution<>(0.,
M_PI))) ^
64 auto transform = std::make_shared<Transform3D>();
72 auto bounds = std::make_shared<RectangleBounds>(100., 100.);
73 auto pSurface = Surface::makeShared<PlaneSurface>(
transform, bounds);
77 std::array<double, 6> pars_array = {
78 {-0.1234, 9.8765, 0.45, 0.888, 0.001, 21.}};
80 pars << pars_array[0], pars_array[1], pars_array[2], pars_array[3],
81 pars_array[4], pars_array[5];
83 const double phi = pars_array[2];
84 const double theta = pars_array[3];
85 double p = fabs(1. / pars_array[4]);
86 Vector3D direction(cos(phi) * sin(theta), sin(phi) * sin(theta), cos(theta));
90 center + pars_array[0] * rot.col(0) + pars_array[1] * rot.col(1);
111 BOOST_CHECK_EQUAL(&n_ataPlane_from_pars.
referenceSurface(), pSurface.get());
114 BOOST_CHECK_EQUAL(pSurface.use_count(), 5
u);
127 Vector3D uposition = rot * lPosition3D + center;
141 sin(uphi) * sin(utheta), cos(utheta));
151 bdata::distribution =
152 std::uniform_real_distribution<>(-1000., 1000.))) ^
154 bdata::distribution =
155 std::uniform_real_distribution<>(-1000., 1000.))) ^
157 bdata::distribution =
158 std::uniform_real_distribution<>(-1000., 1000.))) ^
161 bdata::distribution = std::uniform_real_distribution<>(0.,
M_PI))) ^
164 bdata::distribution = std::uniform_real_distribution<>(0.,
M_PI))) ^
167 bdata::distribution = std::uniform_real_distribution<>(0.,
M_PI))) ^
169 x,
y,
z,
a,
b,
c, index) {
172 auto transform = std::make_shared<Transform3D>();
180 auto bounds = std::make_shared<RadialBounds>(100., 1200.);
181 auto dSurface = Surface::makeShared<DiscSurface>(
transform, bounds);
185 std::array<double, 6> pars_array = {{125., 0.345, 0.45, 0.888, 0.001, 21.}};
187 pars << pars_array[0], pars_array[1], pars_array[2], pars_array[3],
188 pars_array[4], pars_array[5];
190 const double phi = pars_array[2];
191 const double theta = pars_array[3];
192 double p = fabs(1. / pars_array[4]);
193 Vector3D direction(cos(phi) * sin(theta), sin(phi) * sin(theta), cos(theta));
195 Vector3D pos = (pars_array[0] * cos(pars_array[1])) * rot.col(0) +
196 (pars_array[0] * sin(pars_array[1])) * rot.col(1) + center;
220 BOOST_CHECK_EQUAL(dSurface.use_count(), 5
u);
224 const auto& dRotation =
225 dSurface->transform(
tgContext).matrix().block<3, 3>(0, 0);
232 bound_to_cylinder_test,
234 bdata::distribution =
235 std::uniform_real_distribution<>(-1000., 1000.))) ^
237 bdata::distribution =
238 std::uniform_real_distribution<>(-1000., 1000.))) ^
240 bdata::distribution =
241 std::uniform_real_distribution<>(-1000., 1000.))) ^
244 bdata::distribution = std::uniform_real_distribution<>(0.,
M_PI))) ^
247 bdata::distribution = std::uniform_real_distribution<>(0.,
M_PI))) ^
250 bdata::distribution = std::uniform_real_distribution<>(0.,
M_PI))) ^
252 x,
y,
z,
a,
b,
c, index) {
256 auto transform = std::make_shared<Transform3D>();
264 auto bounds = std::make_shared<CylinderBounds>(100., 1200.);
265 std::shared_ptr<const Surface>
cSurface =
266 Surface::makeShared<CylinderSurface>(
transform, bounds);
270 std::array<double, 6> pars_array = {{125., 343., 0.45, 0.888, 0.001, 21.}};
272 pars << pars_array[0], pars_array[1], pars_array[2], pars_array[3],
273 pars_array[4], pars_array[5];
275 const double phi = pars_array[2];
276 const double theta = pars_array[3];
277 double p = fabs(1. / pars_array[4]);
278 Vector3D direction(cos(phi) * sin(theta), sin(phi) * sin(theta), cos(theta));
283 const double phi_l = pars_array[0] /
r;
284 Vector3D pos = (r * cos(phi_l)) * rot.col(0) + (r * sin(phi_l)) * rot.col(1) +
285 (pars_array[1]) * rot.col(2) + center;
305 BOOST_CHECK_EQUAL(&ataCylinder_from_pars.
referenceSurface(), cSurface.get());
312 BOOST_CHECK_EQUAL(cSurface.use_count(), 5
u);
314 auto pPosition = ataCylinder_from_pars.
position();
319 Vector3D transverse_x = transverse_y.cross(normal_at_intersect);
321 refframe.col(0) = transverse_x;
322 refframe.col(1) = transverse_y;
323 refframe.col(2) = normal_at_intersect;
332 bound_to_perigee_test,
335 bdata::distribution = std::uniform_real_distribution<>(-10., 10.))) ^
337 bdata::distribution =
338 std::uniform_real_distribution<>(-10., 10.))) ^
340 bdata::distribution =
341 std::uniform_real_distribution<>(-10., 10.))) ^
344 bdata::distribution = std::uniform_real_distribution<>(0., 0.05))) ^
347 bdata::distribution = std::uniform_real_distribution<>(0., 0.05))) ^
349 x,
y,
z,
a,
b, index) {
352 auto transform = std::make_shared<Transform3D>();
360 std::shared_ptr<const Surface> pSurface = Surface::makeShared<PerigeeSurface>(
361 std::make_shared<const Transform3D>(*transform));
365 std::array<double, 6> pars_array = {{-0.7321, 22.5, 0.45, 0.888, 0.001, 21.}};
367 pars << pars_array[0], pars_array[1], pars_array[2], pars_array[3],
368 pars_array[4], pars_array[5];
388 BOOST_CHECK_EQUAL(&ataPerigee_from_pars.
referenceSurface(), pSurface.get());
391 BOOST_CHECK_EQUAL(&n_ataPerigee_from_pars.
referenceSurface(), pSurface.get());
394 BOOST_CHECK_EQUAL(pSurface.use_count(), 5
u);
402 bdata::distribution =
403 std::uniform_real_distribution<>(-1000., 1000.))) ^
405 bdata::distribution =
406 std::uniform_real_distribution<>(-1000., 1000.))) ^
408 bdata::distribution =
409 std::uniform_real_distribution<>(-1000., 1000.))) ^
412 bdata::distribution = std::uniform_real_distribution<>(0.,
M_PI))) ^
415 bdata::distribution = std::uniform_real_distribution<>(0.,
M_PI))) ^
418 bdata::distribution = std::uniform_real_distribution<>(0.,
M_PI))) ^
420 x,
y,
z,
a,
b,
c, index) {
421 using namespace Acts::UnitLiterals;
426 auto transform = std::make_shared<Transform3D>();
435 auto sSurface = Surface::makeShared<StrawSurface>(
transform, 2
_mm, 1
_m);
439 std::array<double, 6> pars_array = {{0.2321, 22.5, 0.45, 0.888, 0.001, 21.}};
441 pars << pars_array[0], pars_array[1], pars_array[2], pars_array[3],
442 pars_array[4], pars_array[5];
469 BOOST_CHECK_EQUAL(sSurface.use_count(), 5
u);