9 #include <boost/test/unit_test.hpp>
29 template <
typename surface_type>
43 std::vector<std::shared_ptr<Acts::Experimental::DetectorVolume>>
64 BOOST_AUTO_TEST_SUITE(Detector)
94 std::vector<Acts::BinningValue> detectorBinning = {
Acts::binR};
95 std::vector<Acts::ActsScalar> detectorBoundaries = {detectorIr, detectorOr,
99 auto detectorBpr = std::make_unique<Acts::Experimental::Blueprint::Node>(
101 detectorBoundaries, detectorBinning);
104 std::vector<Acts::ActsScalar> beamPipeBoundaries = {detectorIr, beamPipeOr,
107 auto beamPipeStructure =
108 std::make_shared<SurfaceBuilder<Acts::CylinderSurface>>(
109 Acts::Transform3::Identity(), 18, 0.99 * detectorHz);
110 auto beamPipe = std::make_unique<Acts::Experimental::Blueprint::Node>(
112 beamPipeBoundaries, beamPipeStructure);
116 std::vector<Acts::ActsScalar> pixelBoundaries = {pixelIr, pixelOr,
118 std::vector<Acts::BinningValue> pixelBinning = {
Acts::binZ};
119 auto pixel = std::make_unique<Acts::Experimental::Blueprint::Node>(
121 pixelBoundaries, pixelBinning);
124 std::vector<Acts::ActsScalar> pixelEcBoundaries = {pixelIr, pixelOr - 5.,
126 std::vector<Acts::BinningValue> pixelEcBinning = {
Acts::binZ};
129 Acts::Transform3::Identity() *
132 auto pixelNec = std::make_unique<Acts::Experimental::Blueprint::Node>(
134 pixelEcBoundaries, pixelEcBinning);
137 std::vector<Acts::ActsScalar> pixelNecBoundaries = {pixelIr + 2, pixelOr - 7.,
140 auto pixelNecLayerStructure =
141 std::make_shared<SurfaceBuilder<Acts::DiscSurface>>(
142 pixelNecTransform, pixelIr + 10., pixelOr - 10.);
144 auto pixelNecLayer = std::make_unique<Acts::Experimental::Blueprint::Node>(
146 pixelNecBoundaries, pixelNecLayerStructure);
151 std::vector<Acts::ActsScalar> pixelBarrelBoundaries = {
152 pixelIr + 1, pixelOr - 1., detectorHz - 2 * pixelEcHz};
153 std::vector<Acts::BinningValue> pixelBarrelBinning = {
Acts::binR};
155 auto pixelBarrel = std::make_unique<Acts::Experimental::Blueprint::Node>(
156 "pixel_barrel", Acts::Transform3::Identity(),
159 auto pixelBarrelL0Structure =
160 std::make_shared<SurfaceBuilder<Acts::CylinderSurface>>(
161 Acts::Transform3::Identity(), 62.5, detectorHz - 2 * pixelEcHz - 10.);
162 std::vector<Acts::ActsScalar> pixelBarrelL0Boundaries = {
163 60, 65., detectorHz - 2 * pixelEcHz};
164 auto pixelBarrelL0 = std::make_unique<Acts::Experimental::Blueprint::Node>(
165 "pixel_barrel_l0", Acts::Transform3::Identity(),
167 pixelBarrelL0Structure);
169 auto pixelBarrelL1Structure =
170 std::make_shared<SurfaceBuilder<Acts::CylinderSurface>>(
171 Acts::Transform3::Identity(), 102.5,
172 detectorHz - 2 * pixelEcHz - 10.);
174 std::vector<Acts::ActsScalar> pixelBarrelL1Boundaries = {
175 100, 105., detectorHz - 2 * pixelEcHz};
176 auto pixelBarrelL1 = std::make_unique<Acts::Experimental::Blueprint::Node>(
177 "pixel_barrel_l1", Acts::Transform3::Identity(),
179 pixelBarrelL1Structure);
180 pixelBarrel->add(
std::move(pixelBarrelL0));
181 pixelBarrel->add(
std::move(pixelBarrelL1));
184 Acts::Transform3::Identity() *
187 auto pixelPec = std::make_unique<Acts::Experimental::Blueprint::Node>(
189 pixelEcBoundaries, pixelEcBinning);
191 std::vector<Acts::ActsScalar> pixelPecBoundaries = {pixelIr + 2, pixelOr - 7.,
194 auto pixelPecLayerStructure =
195 std::make_shared<SurfaceBuilder<Acts::DiscSurface>>(
196 pixelPecTransform, pixelIr + 10., pixelOr - 10.);
198 auto pixelPecLayer = std::make_unique<Acts::Experimental::Blueprint::Node>(
200 pixelPecBoundaries, pixelPecLayerStructure);
213 detectorBpr->rootVolumeFinderBuilder =
214 std::make_shared<Acts::Experimental::IndexedRootVolumeFinderBuilder>(
218 detectorBpr->geoIdGenerator =
219 std::make_shared<Acts::Experimental::GeometryIdGenerator>(
228 detectorBpr->dotStream(fs,
"blueprint2cylinder");
234 auto detectorBuilder =
235 std::make_shared<Acts::Experimental::CylindricalContainerBuilder>(
241 "*** Test : auto generated cylindrical detector builder ***";
242 dCfg.name =
"Cylindrical detector from blueprint";
243 dCfg.builder = detectorBuilder;
244 dCfg.geoIdGenerator = detectorBpr->geoIdGenerator;
265 BOOST_CHECK(
detector->volumes().size() == 14
u);
266 BOOST_CHECK(
detector->volumes()[0]->name() ==
"beam_pipe");
267 BOOST_CHECK(
detector->volumes()[1]->name() ==
"detector_gap_0");
268 BOOST_CHECK(
detector->volumes()[2]->name() ==
"pixel_nec_gap_0");
269 BOOST_CHECK(
detector->volumes()[3]->name() ==
"pixel_nec_layer");
270 BOOST_CHECK(
detector->volumes()[4]->name() ==
"pixel_nec_gap_1");
271 BOOST_CHECK(
detector->volumes()[5]->name() ==
"pixel_barrel_gap_0");
272 BOOST_CHECK(
detector->volumes()[6]->name() ==
"pixel_barrel_l0");
273 BOOST_CHECK(
detector->volumes()[7]->name() ==
"pixel_barrel_gap_1");
274 BOOST_CHECK(
detector->volumes()[8]->name() ==
"pixel_barrel_l1");
275 BOOST_CHECK(
detector->volumes()[9]->name() ==
"pixel_barrel_gap_2");
276 BOOST_CHECK(
detector->volumes()[10]->name() ==
"pixel_pec_gap_0");
277 BOOST_CHECK(
detector->volumes()[11]->name() ==
"pixel_pec_layer");
278 BOOST_CHECK(
detector->volumes()[12]->name() ==
"pixel_pec_gap_1");
279 BOOST_CHECK(
detector->volumes()[13]->name() ==
"detector_gap_1");
282 BOOST_AUTO_TEST_SUITE_END()