9 #include <boost/test/unit_test.hpp>
18 namespace Experimental {
19 class IInternalStructureBuilder {};
23 BOOST_AUTO_TEST_SUITE(Experimental)
27 std::vector<Acts::BinningValue> detectorBinning = {
Acts::binR};
28 std::vector<Acts::ActsScalar> detectorBoundaries = {0., 50., 100.};
29 auto detector = std::make_unique<Acts::Experimental::Blueprint::Node>(
31 detectorBoundaries, detectorBinning);
33 BOOST_CHECK(
detector->parent ==
nullptr);
34 BOOST_CHECK(
detector->children.empty());
35 BOOST_CHECK(
detector->name ==
"detector");
37 std::vector<Acts::BinningValue> pixelsBinning = {
Acts::binZ};
38 std::vector<Acts::ActsScalar> pixelsBoundaries = {20., 50., 100.};
40 auto pixels = std::make_unique<Acts::Experimental::Blueprint::Node>(
42 pixelsBoundaries, pixelsBinning);
44 std::vector<Acts::ActsScalar> beamPipeBoundaries = {0., 20., 100.};
45 auto beamPipe = std::make_unique<Acts::Experimental::Blueprint::Node>(
49 std::vector<Acts::ActsScalar> gapBoundaries = {20., 50., 10.};
50 auto gap0 = std::make_unique<Acts::Experimental::Blueprint::Node>(
54 std::vector<Acts::ActsScalar> layerBoundaries = {20., 50., 80.};
55 auto layer = std::make_unique<Acts::Experimental::Blueprint::Node>(
58 std::make_shared<Acts::Experimental::IInternalStructureBuilder>());
60 auto gap1 = std::make_unique<Acts::Experimental::Blueprint::Node>(
72 std::ofstream
fs(
"detector_unordered.dot");
80 BOOST_CHECK(
detector->children.front()->name ==
"beam_pipe");
81 BOOST_CHECK(
detector->children.back()->name ==
"pixels");
82 BOOST_CHECK(
detector->children.back()->children.front()->name ==
"gap0");
83 BOOST_CHECK(
detector->children.back()->children[1
u]->name ==
"layer");
84 BOOST_CHECK(
detector->children.back()->children.back()->name ==
"gap1");
86 std::ofstream fs2(
"detector_ordered.dot");
106 std::make_shared<Acts::Experimental::IInternalStructureBuilder>();
109 std::vector<Acts::BinningValue> detectorBinning = {
Acts::binR};
110 std::vector<Acts::ActsScalar> detectorBoundaries = {detectorIr, detectorOr,
114 auto detector = std::make_unique<Acts::Experimental::Blueprint::Node>(
116 detectorBoundaries, detectorBinning);
119 std::vector<Acts::ActsScalar> beamPipeBoundaries = {detectorIr, beamPipeOr,
121 auto beamPipe = std::make_unique<Acts::Experimental::Blueprint::Node>(
123 beamPipeBoundaries, innerBuilder);
127 std::vector<Acts::ActsScalar> pixelBoundaries = {pixelIr, pixelOr,
129 std::vector<Acts::BinningValue> pixelBinning = {
Acts::binZ};
130 auto pixel = std::make_unique<Acts::Experimental::Blueprint::Node>(
132 pixelBoundaries, pixelBinning);
135 std::vector<Acts::ActsScalar> pixelEcBoundaries = {pixelIr, pixelOr - 5.,
137 std::vector<Acts::BinningValue> pixelEcBinning = {
Acts::binZ};
139 auto pixelNec = std::make_unique<Acts::Experimental::Blueprint::Node>(
141 Acts::Transform3::Identity() *
146 std::vector<Acts::ActsScalar> pixelNecBoundaries = {pixelIr + 2, pixelOr - 7.,
148 auto pixelNecLayer = std::make_unique<Acts::Experimental::Blueprint::Node>(
150 Acts::Transform3::Identity() *
157 std::vector<Acts::ActsScalar> pixelBarrelBoundaries = {
158 pixelIr + 1, pixelOr - 1., detectorHz - 2 * pixelEcHz};
159 std::vector<Acts::BinningValue> pixelBarrelBinning = {
Acts::binR};
161 auto pixelBarrel = std::make_unique<Acts::Experimental::Blueprint::Node>(
162 "pixelBarrel", Acts::Transform3::Identity(),
165 std::vector<Acts::ActsScalar> pixelBarrelL0Boundaries = {
166 60, 65., detectorHz - 2 * pixelEcHz};
167 auto pixelBarrelL0 = std::make_unique<Acts::Experimental::Blueprint::Node>(
168 "pixelBarrelL0", Acts::Transform3::Identity(),
171 std::vector<Acts::ActsScalar> pixelBarrelL1Boundaries = {
172 100, 105., detectorHz - 2 * pixelEcHz};
173 auto pixelBarrelL1 = std::make_unique<Acts::Experimental::Blueprint::Node>(
174 "pixelBarrelL1", Acts::Transform3::Identity(),
176 pixelBarrel->add(
std::move(pixelBarrelL0));
177 pixelBarrel->add(
std::move(pixelBarrelL1));
179 auto pixelPec = std::make_unique<Acts::Experimental::Blueprint::Node>(
181 Acts::Transform3::Identity() *
185 std::vector<Acts::ActsScalar> pixelPecBoundaries = {pixelIr + 2, pixelOr - 7.,
187 auto pixelPecLayer = std::make_unique<Acts::Experimental::Blueprint::Node>(
189 Acts::Transform3::Identity() *
202 std::ofstream
fs(
"detector_with_gaps.dot");
207 BOOST_CHECK(
detector->children.size() == 2
u);
208 BOOST_CHECK(
detector->children[0
u]->name ==
"beam_pipe");
209 BOOST_CHECK(
detector->children[1
u]->name ==
"pixel");
215 BOOST_CHECK(
detector->children.size() == 4
u);
216 BOOST_CHECK(
detector->children[0
u]->name ==
"beam_pipe");
217 BOOST_CHECK(
detector->children[1
u]->name ==
"detector_gap_0");
218 BOOST_CHECK(
detector->children[2
u]->name ==
"pixel");
219 BOOST_CHECK(
detector->children[3
u]->name ==
"detector_gap_1");
222 BOOST_CHECK(
detector->children[1
u]->boundaryValues[0] == beamPipeOr);
223 BOOST_CHECK(
detector->children[1
u]->boundaryValues[1] == pixelIr);
224 BOOST_CHECK(
detector->children[1
u]->boundaryValues[2] == detectorHz);
226 BOOST_CHECK(
detector->children[3
u]->boundaryValues[0] == pixelOr);
227 BOOST_CHECK(
detector->children[3
u]->boundaryValues[1] == detectorOr);
228 BOOST_CHECK(
detector->children[3
u]->boundaryValues[2] == detectorHz);
231 BOOST_CHECK(
detector->children[2
u]->children.size() == 3
u);
232 BOOST_CHECK(
detector->children[2
u]->children[0
u]->children.size() == 3
u);
233 BOOST_CHECK(
detector->children[2
u]->children[1
u]->children.size() == 5
u);
234 BOOST_CHECK(
detector->children[2
u]->children[2
u]->children.size() == 3
u);
238 detector->children[2
u]->children[0
u]->children[0]->boundaryValues[0] ==
241 detector->children[2
u]->children[0
u]->children[0]->boundaryValues[1] ==
245 detector->children[2
u]->children[0
u]->children[1]->boundaryValues[0] ==
248 detector->children[2
u]->children[0
u]->children[1]->boundaryValues[1] ==
252 detector->children[2
u]->children[0
u]->children[2]->boundaryValues[0] ==
255 detector->children[2
u]->children[0
u]->children[2]->boundaryValues[1] ==
258 std::ofstream fs2(
"detector_without_gaps.dot");
265 std::make_shared<Acts::Experimental::IInternalStructureBuilder>();
268 std::vector<Acts::ActsScalar> detectorBoundaries = {0., 50., 100.};
269 std::vector<Acts::BinningValue> detectorBinning = {
Acts::binX};
270 auto detector = std::make_unique<Acts::Experimental::Blueprint::Node>(
272 detectorBoundaries, detectorBinning);
274 std::vector<Acts::ActsScalar> cubeOneBoundaries = {0., 20., 100.};
275 auto cubeOne = std::make_unique<Acts::Experimental::Blueprint::Node>(
277 cubeOneBoundaries, innerBuilder);
290 std::vector<Acts::ActsScalar> volTwoBoundaries = {0., 20., 100.};
291 auto volTwo = std::make_unique<Acts::Experimental::Blueprint::Node>(
293 volTwoBoundaries, innerBuilder);
302 BOOST_AUTO_TEST_SUITE_END()