9 #include <boost/test/unit_test.hpp>
34 std::vector<std::shared_ptr<Acts::Surface>> unpackSurfaces(
35 const std::vector<const Acts::Surface*>& surfaces) {
36 std::vector<std::shared_ptr<Acts::Surface>> uSurfaces;
37 uSurfaces.reserve(surfaces.size());
38 for (
const auto&
s : surfaces) {
40 uSurfaces.push_back(ncs->getSharedPtr());
50 auto nominal = Acts::Transform3::Identity();
52 BOOST_AUTO_TEST_SUITE(ActSvg)
67 auto tubeCylinderBounds =
68 std::make_unique<Acts::CylinderVolumeBounds>(rInner, rOuter,
zHalfL);
70 auto tubeCylinderVolume =
79 tContext, *tubeCylinderVolume, volumeOptions);
80 pVolume._name = tubeCylinderVolume->name();
85 std::vector<actsvg::style::color> colors = {
red};
86 pVolume.colorize(colors);
101 std::vector<Acts::ActsScalar> avgPhi = {0., 0.75};
102 std::vector<std::string> avgPhiTag = {
"zero",
"nonzero"};
108 std::vector<actsvg::svg::object> volumesXY;
111 auto sectorCylinderBounds = std::make_unique<Acts::CylinderVolumeBounds>(
112 rInner, rOuter,
zHalfL, phiSector, aphi);
114 auto sectorCylinderVolume =
124 tContext, *sectorCylinderVolume, volumeOptions);
129 std::vector<actsvg::style::color> colors = {
blue};
130 pVolume.colorize(colors);
141 auto rSurfaces =
cGeometry.surfacesRing(dStore, 6.4, 12.4, 36., 0.125, 0.,
144 auto endcapSurfaces = std::make_shared<
146 unpackSurfaces(rSurfaces));
149 lsConfig.
auxiliary =
"*** Endcap with 22 surfaces ***";
150 lsConfig.surfacesProvider = endcapSurfaces;
152 Acts::binPhi, Acts::detail::AxisBoundaryType::Closed, -M_PI, M_PI, 22
u,
156 std::make_shared<Acts::Experimental::LayerStructureBuilder>(
161 shapeConfig.
boundValues = {10, 100, 10., M_PI, 0.};
164 shapeConfig.boundsType = Acts::VolumeBounds::BoundsType::eCylinder;
167 std::make_shared<Acts::Experimental::VolumeStructureBuilder>(
172 dvCfg.
auxiliary =
"*** Test 1 - Cylinder with internal Surface ***";
173 dvCfg.name =
"CylinderWithSurface";
174 dvCfg.externalsBuilder = shapeBuilder;
175 dvCfg.internalsBuilder = layerBuilder;
177 auto dvBuilder = std::make_shared<Acts::Experimental::DetectorVolumeBuilder>(
180 auto [
volumes, portals, roots] = dvBuilder->construct(tContext);
182 auto volume = volumes.front();
192 tContext, *volume, volumeOptions);
209 auto cSurfaces =
cGeometry.surfacesCylinder(dStore, 8.4, 36., 0.15, 0.145, 72,
212 auto barrelSurfaces = std::make_shared<
214 unpackSurfaces(cSurfaces));
218 lsConfig.
auxiliary =
"*** Barrel with 448 surfaces ***";
219 lsConfig.surfacesProvider = barrelSurfaces;
221 Acts::binZ, Acts::detail::AxisBoundaryType::Bound,
222 -480., 480., 14
u, 1
u},
225 -M_PI, M_PI, 32
u, 1
u)};
228 std::make_shared<Acts::Experimental::LayerStructureBuilder>(
233 shapeConfig.
boundValues = {60., 80., 800., M_PI, 0.};
234 shapeConfig.boundsType = Acts::VolumeBounds::BoundsType::eCylinder;
237 std::make_shared<Acts::Experimental::VolumeStructureBuilder>(
242 dvCfg.
auxiliary =
"*** Test 1 - Cylinder with internal Surface ***";
243 dvCfg.name =
"CylinderWithSurface";
244 dvCfg.externalsBuilder = shapeBuilder;
245 dvCfg.internalsBuilder = barrelBuilder;
247 auto dvBuilder = std::make_shared<Acts::Experimental::DetectorVolumeBuilder>(
250 auto [
volumes, portals, roots] = dvBuilder->construct(tContext);
252 auto volume = volumes.front();
262 tContext, *volume, volumeOptions);
277 BOOST_AUTO_TEST_SUITE_END()