9 #include <boost/test/data/test_case.hpp>
10 #include <boost/test/tools/output_test_stream.hpp>
11 #include <boost/test/unit_test.hpp>
28 BOOST_AUTO_TEST_SUITE(Surfaces)
34 double radius(0.5), halfz(10.), halfphi(M_PI / 2.0), averagePhi(M_PI / 2.0),
35 minBevelZ(-M_PI / 4), maxBevelZ(M_PI / 6);
45 BOOST_CHECK_EQUAL(
CylinderBounds(radius, halfz, (
double)M_PI, (
double)0.,
53 BOOST_CHECK_EQUAL(copyConstructedCylinderBounds, cylinderBounds);
59 double radius(0.5), halfz(10.);
62 auto valvector = original.values();
63 std::array<double, CylinderBounds::eSize>
values{};
66 BOOST_CHECK_EQUAL(original, recreated);
70 double radius(0.5), halfz(10.), halfphi(M_PI / 2.0), averagePhi(M_PI / 2.0);
73 BOOST_CHECK_THROW(
CylinderBounds(-radius, halfz, halfphi, averagePhi),
77 BOOST_CHECK_THROW(
CylinderBounds(radius, -halfz, halfphi, averagePhi),
81 BOOST_CHECK_THROW(
CylinderBounds(radius, halfz, -halfphi, averagePhi),
96 double nominalRadius{0.5};
97 double nominalHalfLength{20.};
98 double halfphi(M_PI / 4.0);
99 double averagePhi(0.0);
100 double bevelMinZ(M_PI / 4);
101 double bevelMaxZ(M_PI / 6);
102 CylinderBounds cylinderBoundsObject(nominalRadius, nominalHalfLength);
103 CylinderBounds cylinderBoundsSegment(nominalRadius, nominalHalfLength,
104 halfphi, averagePhi);
105 CylinderBounds cylinderBoundsBeveledObject(nominalRadius, nominalHalfLength,
106 M_PI, 0., bevelMinZ, bevelMaxZ);
113 const Vector2 atPiBy2{M_PI / 2., 0.0};
115 const Vector2 beyondEnd{0, 30.0};
117 const Vector2 unitPhi{1.0, 0.0};
118 const Vector2 withinBevelMin{0.5, -20.012};
119 const Vector2 outsideBevelMin{0.5, -40.};
120 const BoundaryCheck trueBoundaryCheckWithTolerance(
true,
true, 0.1, 0.1);
121 const BoundaryCheck trueBoundaryCheckWithLessTolerance(
true,
true, 0.01,
124 cylinderBoundsObject.
inside(atPiBy2, trueBoundaryCheckWithTolerance));
126 !cylinderBoundsSegment.
inside(unitPhi, trueBoundaryCheckWithTolerance));
128 cylinderBoundsObject.
inside(
origin, trueBoundaryCheckWithTolerance));
130 BOOST_CHECK(!cylinderBoundsObject.
inside(withinBevelMin,
131 trueBoundaryCheckWithLessTolerance));
132 BOOST_CHECK(cylinderBoundsBeveledObject.
inside(
133 withinBevelMin, trueBoundaryCheckWithLessTolerance));
134 BOOST_CHECK(!cylinderBoundsBeveledObject.
inside(
135 outsideBevelMin, trueBoundaryCheckWithLessTolerance));
138 const Vector3 origin3D{0., 0., 0.};
140 !cylinderBoundsObject.
inside3D(origin3D, trueBoundaryCheckWithTolerance));
148 averagePhi, 1
e-6, 1e-6);
157 nominalHalfLength, 1e-6);
166 boost::test_tools::output_test_stream dumpOuput;
167 cylinderBoundsObject.
toStream(dumpOuput);
168 BOOST_CHECK(dumpOuput.is_equal(
169 "Acts::CylinderBounds: (radius, halfLengthZ, halfPhiSector, "
170 "averagePhi, bevelMinZ, bevelMaxZ) = (0.5000000, 20.0000000, 3.1415927, "
171 "0.0000000, 0.0000000, 0.0000000)"));
175 double nominalRadius{0.5};
176 double nominalHalfLength{20.};
177 CylinderBounds cylinderBoundsObject(nominalRadius, nominalHalfLength);
179 assignedCylinderBounds = cylinderBoundsObject;
182 BOOST_CHECK_EQUAL(assignedCylinderBounds, cylinderBoundsObject);
185 BOOST_AUTO_TEST_SUITE_END()