25 namespace Experimental {
44 template <
typename object_collection>
47 const std::vector<Acts::BinningValue>& binning,
51 if (binning.size() == 1
u) {
75 objects.size() == 2
u) {
78 gctx, objects, logLevel);
86 std::unique_ptr<const Acts::Logger>
logger)
90 throw std::invalid_argument(
91 "CylindricalContainerBuilder: no sub builders provided.");
98 throw std::invalid_argument(
99 "CylindricalContainerBuilder: 1D binning only supported in z, r, or "
106 throw std::invalid_argument(
107 "CylindricalContainerBuilder: 2D binning only supports wrapping in "
112 throw std::invalid_argument(
113 "CylindricalContainerBuilder: 2D wrapping in z-r requires exactly "
124 if (bpNode.
boundsType != VolumeBounds::BoundsType::eCylinder) {
125 throw std::invalid_argument(
126 "CylindricalContainerBuilder: boundary type must be cylinder - for "
127 "building from a blueprint node.");
130 std::vector<std::shared_ptr<const IDetectorComponentBuilder>> builders;
132 if (
child->isLeaf()) {
138 vsCfg.
auxiliary =
"*** acts auto-generated shape builder ***";
139 auto vsBuilder = std::make_shared<VolumeStructureBuilder>(
144 dvCfg.externalsBuilder = vsBuilder;
145 dvCfg.internalsBuilder =
child->internalsBuilder;
146 dvCfg.auxiliary =
"*** acts auto-generated volume builder ***";
148 m_cfg.
builders.push_back(std::make_shared<DetectorVolumeBuilder>(
153 std::make_shared<CylindricalContainerBuilder>(*
child, logLevel));
168 bool atNavigationLevel =
true;
177 std::vector<std::shared_ptr<DetectorVolume>>
volumes;
178 std::vector<DetectorComponent::PortalContainer> containers;
179 std::vector<std::shared_ptr<DetectorVolume>> rootVolumes;
182 m_cfg.builders.begin(),
m_cfg.builders.end(), [&](
const auto& builder) {
183 auto [cVolumes, cContainer, cRoots] = builder->construct(gctx);
184 atNavigationLevel = (atNavigationLevel and cVolumes.size() == 1
u);
186 volumes.insert(volumes.end(), cVolumes.begin(), cVolumes.end());
187 containers.push_back(cContainer);
188 rootVolumes.insert(rootVolumes.end(), cRoots.volumes.begin(),
189 cRoots.volumes.end());
193 if (atNavigationLevel) {
195 "Component volumes are at navigation level: connecting volumes.");
199 ACTS_VERBOSE(
"Components contain sub containers: connect containers.");
203 ACTS_VERBOSE(
"Number of root volumes: " << rootVolumes.size());
206 if (
m_cfg.rootVolumeFinderBuilder) {
213 m_cfg.rootVolumeFinderBuilder->construct(gctx, rootVolumes)}};
217 if (
m_cfg.geoIdGenerator !=
nullptr) {
218 ACTS_DEBUG(
"Assigning geometry ids to the detector");
219 auto cache =
m_cfg.geoIdGenerator->generateCache();
220 if (
m_cfg.geoIdReverseGen) {
221 std::for_each(rootVolumes.rbegin(), rootVolumes.rend(), [&](
auto&
v) {
222 m_cfg.geoIdGenerator->assignGeometryId(cache, *
v);
225 std::for_each(rootVolumes.begin(), rootVolumes.end(), [&](
auto&
v) {
226 m_cfg.geoIdGenerator->assignGeometryId(cache, *
v);