9 #include <boost/test/data/test_case.hpp>
10 #include <boost/test/unit_test.hpp>
38 detectorVolume.
name =
"detector-container";
43 beamPipe.
name =
"beam-pipe";
48 pixelContainer.
name =
"pixel-container";
53 pixelNec.
name =
"pixel-nec";
57 pixelBarrel.
name =
"pixel-barrel";
62 pixelBarrelL0.
name =
"pixel-barrel-l0";
65 Acts::Surface::SurfaceType::Cylinder};
68 pixelBarrelL1.
name =
"pixel-barrel-l1";
71 Acts::Surface::SurfaceType::Cylinder};
74 {pixelBarrelL0, pixelBarrelL1},
79 pixelPec.
name =
"pixel-pec";
83 {pixelNec, pixelBarrel, pixelPec},
87 {beamPipe, pixelContainer},
91 detector.name =
"detector";
92 detector.worldVolume = detectorVolume;
103 BOOST_AUTO_TEST_SUITE(Detector)
107 auto detector = createProtoDetector();
111 auto& detectorVolume =
detector.worldVolume;
115 std::numeric_limits<ActsScalar>::epsilon());
118 std::numeric_limits<ActsScalar>::epsilon());
121 BOOST_CHECK(detectorVolume.
container.has_value());
122 BOOST_CHECK(not detectorVolume.
internal.has_value());
124 auto& cts = detectorVolume.
container.value();
126 BOOST_CHECK(cts.constituentBinning.size() == 1
u);
128 BOOST_CHECK(cts.constituentBinning[0].binvalue ==
Acts::binR);
130 const auto& binBoundaries = cts.constituentBinning[0].boundaries();
131 BOOST_CHECK(binBoundaries.size() == 3
u);
133 std::numeric_limits<ActsScalar>::epsilon());
135 std::numeric_limits<ActsScalar>::epsilon());
137 std::numeric_limits<ActsScalar>::epsilon());
141 auto& beamPipe = cts.constituentVolumes[0
u];
143 BOOST_CHECK(beamPipe.
name ==
"beam-pipe");
145 std::numeric_limits<ActsScalar>::epsilon());
148 std::numeric_limits<ActsScalar>::epsilon());
152 std::numeric_limits<ActsScalar>::epsilon());
155 auto& pixelContainer = cts.constituentVolumes[1
u];
156 BOOST_CHECK(pixelContainer.name ==
"pixel-container");
160 std::numeric_limits<ActsScalar>::epsilon());
162 std::numeric_limits<ActsScalar>::epsilon());
164 std::numeric_limits<ActsScalar>::epsilon());
166 std::numeric_limits<ActsScalar>::epsilon());
169 BOOST_CHECK(pixelContainer.container.has_value());
170 auto& cts1 = pixelContainer.container.value();
174 for (
auto& pv : cts1.constituentVolumes) {
176 std::numeric_limits<ActsScalar>::epsilon());
179 std::numeric_limits<ActsScalar>::epsilon());
183 BOOST_CHECK(cts1.constituentBinning.size() == 1
u);
185 BOOST_CHECK(cts1.constituentBinning[0].binvalue ==
Acts::binZ);
187 const auto& binBoundariesZ = cts1.constituentBinning[0].boundaries();
188 BOOST_CHECK(binBoundariesZ.size() == 4
u);
190 std::numeric_limits<ActsScalar>::epsilon());
192 std::numeric_limits<ActsScalar>::epsilon());
194 std::numeric_limits<ActsScalar>::epsilon());
196 std::numeric_limits<ActsScalar>::epsilon());
199 auto& pixelBarrel = cts1.constituentVolumes[1
u];
200 BOOST_CHECK(pixelBarrel.
name ==
"pixel-barrel");
203 BOOST_CHECK(pixelBarrel.
container.has_value());
204 auto& cts2 = pixelBarrel.
container.value();
206 BOOST_CHECK(cts2.layerContainer);
207 for (
auto& lVolume : cts2.constituentVolumes) {
208 BOOST_CHECK(lVolume.internal.has_value());
214 auto detector = createProtoDetector();
216 std::cout <<
detector.toString() << std::endl;
219 BOOST_AUTO_TEST_SUITE_END()