9 #include <boost/test/unit_test.hpp>
30 using namespace Acts::Experimental;
36 std::vector<std::shared_ptr<DetectorVolume>> createVolumes(
37 std::vector<std::shared_ptr<Test::DetectorElementStub>>& detectorStore) {
40 auto gap0VoumeBounds = std::make_unique<CylinderVolumeBounds>(0, 80, 200);
42 auto gap0Volume = DetectorVolumeFactory::construct(
46 std::vector<ActsScalar> layer0Radii = {100, 102, 104, 106, 108, 110};
47 auto layer0VolumeBounds =
48 std::make_unique<CylinderVolumeBounds>(80, 130, 200);
49 std::vector<std::shared_ptr<Surface>> layer0Surfaces = {};
50 for (
const auto [ir,
r] :
enumerate(layer0Radii)) {
53 auto detElement = std::make_shared<Test::DetectorElementStub>(
54 Transform3::Identity(), std::make_shared<CylinderBounds>(
r, 190),
56 detectorStore.push_back(detElement);
57 layer0Surfaces.push_back(detElement->surface().getSharedPtr());
60 layer0Surfaces.push_back(Surface::makeShared<CylinderSurface>(
61 Transform3::Identity(), std::make_shared<CylinderBounds>(
r, 190)));
65 auto layer0Volume = DetectorVolumeFactory::construct(
70 auto gap1VoumeBounds = std::make_unique<CylinderVolumeBounds>(130, 200, 200);
72 auto gap1Volume = DetectorVolumeFactory::construct(
76 return {gap0Volume, layer0Volume, gap1Volume};
83 std::vector<std::shared_ptr<Test::DetectorElementStub>> detectorStore;
85 auto volumes = createVolumes(detectorStore);
97 BOOST_CHECK(volumes[0]->geometryId().volume() == 1);
98 for (
auto [ip,
p] :
enumerate(volumes[0]->portals())) {
99 BOOST_CHECK(
p->surface().geometryId().boundary() == ip + 1);
102 BOOST_CHECK(volumes[1]->geometryId().volume() == 2);
103 for (
auto [ip,
p] :
enumerate(volumes[1]->portals())) {
104 BOOST_CHECK(
p->surface().geometryId().boundary() == ip + 1);
106 for (
auto [is,
s] :
enumerate(volumes[1]->surfaces())) {
108 BOOST_CHECK(
s->geometryId().sensitive() == is + 1);
110 BOOST_CHECK(
s->geometryId().passive() == is - 3);
114 BOOST_CHECK(volumes[2]->geometryId().volume() == 3);
115 for (
auto [ip,
p] :
enumerate(volumes[2]->portals())) {
116 BOOST_CHECK(
p->surface().geometryId().boundary() == ip + 1);
121 std::vector<std::shared_ptr<Test::DetectorElementStub>> detectorStore;
123 auto volumes = createVolumes(detectorStore);
136 BOOST_CHECK(volumes[0]->geometryId().volume() == 1);
137 unsigned int portalCounter = 1;
138 for (
auto [ip,
p] :
enumerate(volumes[0]->portals())) {
139 BOOST_CHECK(
p->surface().geometryId().boundary() == portalCounter++);
142 BOOST_CHECK(volumes[1]->geometryId().volume() == 2);
143 for (
auto [ip,
p] :
enumerate(volumes[1]->portals())) {
144 BOOST_CHECK(
p->surface().geometryId().boundary() == portalCounter++);
147 BOOST_CHECK(volumes[2]->geometryId().volume() == 3);
148 for (
auto [ip,
p] :
enumerate(volumes[2]->portals())) {
149 BOOST_CHECK(
p->surface().geometryId().boundary() == portalCounter++);
154 std::vector<std::shared_ptr<Test::DetectorElementStub>> detectorStore;
156 auto volumes = createVolumes(detectorStore);
169 BOOST_CHECK(volumes[0]->geometryId().volume() == 15);
170 BOOST_CHECK(volumes[0]->geometryId().
layer() == 1);
171 BOOST_CHECK(volumes[1]->geometryId().volume() == 15);
172 BOOST_CHECK(volumes[1]->geometryId().
layer() == 2);
173 BOOST_CHECK(volumes[2]->geometryId().volume() == 15);
174 BOOST_CHECK(volumes[2]->geometryId().
layer() == 3);
177 BOOST_AUTO_TEST_SUITE_END()