9 #include <boost/test/unit_test.hpp>
19 namespace tt = boost::test_tools;
26 using namespace Acts::UnitLiterals;
30 Vector3D translation{1_mm, 2_mm, 3_mm};
34 double rotationAngle = 60_degree;
35 Vector3D xPos(
cos(rotationAngle), 0., sin(rotationAngle));
37 Vector3D zPos(-sin(rotationAngle), 0.,
cos(rotationAngle));
38 rotation.col(0) = xPos;
39 rotation.col(1) = yPos;
40 rotation.col(2) = zPos;
44 transform.translation() = translation;
49 Volume volume(transform, std::make_shared<const CuboidVolumeBounds>(bounds));
50 BOOST_CHECK_EQUAL(volume.
transform().matrix(), transform.matrix());
53 BOOST_CHECK_EQUAL(volume.
center(), translation);
54 auto vBounds =
static_cast<const decltype(bounds)*
>(&volume.
volumeBounds());
55 BOOST_CHECK_EQUAL(*vBounds, bounds);
59 Vector3D shiftTranslation{-4_mm, -5_mm, -6_mm};
60 shift.translation() = shiftTranslation;
61 Volume volumeShift(volume, shift);
62 BOOST_CHECK_EQUAL(volumeShift.
center(),
63 (shift * volume.
transform()).translation());
64 BOOST_CHECK_EQUAL(volumeShift.
transform().rotation(),
68 BOOST_CHECK(volume.
inside(translation));
69 BOOST_CHECK(!volume.
inside({10_mm, 2_mm, 3_mm}));
70 BOOST_CHECK(
volume.inside({10_mm, 2_mm, 3_mm}, 2_mm));