9 #include <boost/test/unit_test.hpp>
19 using namespace Acts::Experimental;
32 std::invalid_argument);
38 std::invalid_argument);
45 coneValsConfig.
boundValues = {0.2, -200., 0.3, -300., 100.};
46 coneValsConfig.
boundsType = VolumeBounds::BoundsType::eCone;
52 auto [transformVals, boundsVals, portalGeneratorVals] =
54 BOOST_CHECK(transformVals.isApprox(Transform3::Identity()));
55 BOOST_CHECK(boundsVals !=
nullptr);
56 BOOST_CHECK(boundsVals->type() == VolumeBounds::BoundsType::eCone);
57 BOOST_CHECK(boundsVals->values().size() == 7
u);
58 BOOST_CHECK(boundsVals->values().at(0
u) == 0.2);
59 BOOST_CHECK(boundsVals->values().at(1
u) == -200.);
60 BOOST_CHECK(boundsVals->values().at(2
u) == 0.3);
61 BOOST_CHECK(boundsVals->values().at(3
u) == -300.);
62 BOOST_CHECK(boundsVals->values().at(4
u) == 100.);
67 coneMis1Config.
boundsType = VolumeBounds::BoundsType::eCone;
78 coneMis2Config.boundsType = VolumeBounds::BoundsType::eCone;
92 cuboidValsConfig.
boundsType = VolumeBounds::BoundsType::eCuboid;
98 auto [transformVals, boundsVals, portalGeneratorVals] =
100 BOOST_CHECK(transformVals.isApprox(Transform3::Identity()));
101 BOOST_CHECK(boundsVals !=
nullptr);
102 BOOST_CHECK(boundsVals->type() == VolumeBounds::BoundsType::eCuboid);
103 BOOST_CHECK(boundsVals->values().size() == 3
u);
104 BOOST_CHECK(boundsVals->values().at(0
u) == 100.);
105 BOOST_CHECK(boundsVals->values().at(1
u) == 200.);
106 BOOST_CHECK(boundsVals->values().at(2
u) == 300.);
110 cuboidExtent.
set(
binX, -100, 100);
111 cuboidExtent.
set(
binY, -200, 200);
112 cuboidExtent.
set(
binZ, -300, 300);
115 cuboidExtentConfig.
boundsType = VolumeBounds::BoundsType::eCuboid;
116 cuboidExtentConfig.
extent = cuboidExtent;
122 auto [transformExtent, boundsExtent, portalGeneratorExtent] =
125 BOOST_CHECK(transformExtent.isApprox(Transform3::Identity()));
126 BOOST_CHECK(boundsExtent !=
nullptr);
127 BOOST_CHECK(boundsExtent->type() == VolumeBounds::BoundsType::eCuboid);
128 BOOST_CHECK(boundsExtent->values().size() == 3
u);
129 BOOST_CHECK(boundsExtent->values().at(0
u) == 100.);
130 BOOST_CHECK(boundsExtent->values().at(1
u) == 200.);
131 BOOST_CHECK(boundsExtent->values().at(2
u) == 300.);
136 cuboidMis1Config.
boundsType = VolumeBounds::BoundsType::eCuboid;
147 cuboidMis2Config.boundsType = VolumeBounds::BoundsType::eCuboid;
160 ccylValsConfig.
boundValues = {100, 120., 200, 300., 280.};
161 ccylValsConfig.
boundsType = VolumeBounds::BoundsType::eCutoutCylinder;
167 auto [transformVals, boundsVals, portalGeneratorVals] =
169 BOOST_CHECK(transformVals.isApprox(Transform3::Identity()));
170 BOOST_CHECK(boundsVals !=
nullptr);
171 BOOST_CHECK(boundsVals->type() == VolumeBounds::BoundsType::eCutoutCylinder);
172 BOOST_CHECK(boundsVals->values().size() == 5
u);
173 BOOST_CHECK(boundsVals->values().at(0
u) == 100.);
174 BOOST_CHECK(boundsVals->values().at(1
u) == 120.);
175 BOOST_CHECK(boundsVals->values().at(2
u) == 200.);
176 BOOST_CHECK(boundsVals->values().at(3
u) == 300.);
177 BOOST_CHECK(boundsVals->values().at(4
u) == 280.);
182 ccylMis1Config.
boundsType = VolumeBounds::BoundsType::eCutoutCylinder;
193 ccylMis2Config.boundsType = VolumeBounds::BoundsType::eCutoutCylinder;
206 cylValsConfig.
boundValues = {100, 200, 400., 0.3, 0.};
207 cylValsConfig.
boundsType = VolumeBounds::BoundsType::eCylinder;
213 auto [transformVals, boundsVals, portalGeneratorVals] =
215 BOOST_CHECK(transformVals.isApprox(Transform3::Identity()));
216 BOOST_CHECK(boundsVals !=
nullptr);
217 BOOST_CHECK(boundsVals->type() == VolumeBounds::BoundsType::eCylinder);
218 BOOST_CHECK(boundsVals->values().size() == 7
u);
219 BOOST_CHECK(boundsVals->values().at(0
u) == 100.);
220 BOOST_CHECK(boundsVals->values().at(1
u) == 200.);
221 BOOST_CHECK(boundsVals->values().at(2
u) == 400.);
222 BOOST_CHECK(boundsVals->values().at(3
u) == 0.3);
226 cylinderExtent.
set(
binR, 100., 200.);
227 cylinderExtent.
set(
binZ, -800., 0.);
230 cylExtentConfig.
extent = cylinderExtent;
231 cylExtentConfig.
boundsType = VolumeBounds::BoundsType::eCylinder;
237 auto [transformExtent, boundsExtent, portalGeneratorExtent] =
241 shifted.pretranslate(
Vector3(0., 0., -400.));
243 BOOST_CHECK(transformExtent.isApprox(shifted));
244 BOOST_CHECK(boundsExtent !=
nullptr);
245 BOOST_CHECK(boundsExtent->type() == VolumeBounds::BoundsType::eCylinder);
246 BOOST_CHECK(boundsExtent->values().size() == 7
u);
247 BOOST_CHECK(boundsExtent->values().at(0
u) == 100.);
248 BOOST_CHECK(boundsExtent->values().at(1
u) == 200.);
249 BOOST_CHECK(boundsExtent->values().at(2
u) == 400.);
254 cylMis1Config.
boundsType = VolumeBounds::BoundsType::eCylinder;
265 cylMis2Config.boundsType = VolumeBounds::BoundsType::eCylinder;
278 gcubValsConfig.
boundValues = {0, 0, 0, 2, 0, 0.4, 2, 1, 0.4, 0, 1, 0,
279 0, 0, 1, 1.8, 0, 1, 1.8, 1, 1, 0, 1, 1};
280 gcubValsConfig.
boundsType = VolumeBounds::BoundsType::eGenericCuboid;
286 auto [transformVals, boundsVals, portalGeneratorVals] =
288 BOOST_CHECK(transformVals.isApprox(Transform3::Identity()));
289 BOOST_CHECK(boundsVals !=
nullptr);
290 BOOST_CHECK(boundsVals->type() == VolumeBounds::BoundsType::eGenericCuboid);
291 BOOST_CHECK(boundsVals->values().size() == 24
u);
295 gcubMis1Config.
boundsType = VolumeBounds::BoundsType::eGenericCuboid;
296 gcubMis1Config.boundValues = {100.};
306 gcubMis2Config.
boundsType = VolumeBounds::BoundsType::eGenericCuboid;
307 gcubMis2Config.extent =
Extent{};
318 trapValsConfig.
boundValues = {100., 200., 300., 10.};
319 trapValsConfig.
boundsType = VolumeBounds::BoundsType::eTrapezoid;
325 auto [transformVals, boundsVals, portalGeneratorVals] =
327 BOOST_CHECK(transformVals.isApprox(Transform3::Identity()));
328 BOOST_CHECK(boundsVals !=
nullptr);
329 BOOST_CHECK(boundsVals->type() == VolumeBounds::BoundsType::eTrapezoid);
330 BOOST_CHECK(boundsVals->values().size() == 6
u);
331 BOOST_CHECK(boundsVals->values().at(0
u) == 100.);
332 BOOST_CHECK(boundsVals->values().at(1
u) == 200.);
333 BOOST_CHECK(boundsVals->values().at(2
u) == 300.);
334 BOOST_CHECK(boundsVals->values().at(3
u) == 10.);
338 trapMis1Config.
boundsType = VolumeBounds::BoundsType::eTrapezoid;
349 trapMis2Config.
boundsType = VolumeBounds::BoundsType::eTrapezoid;
350 trapMis2Config.extent =
Extent{};
357 BOOST_AUTO_TEST_SUITE_END()