22 namespace Experimental {
28 : m_surface(std::
move(surface)) {
32 std::shared_ptr<Acts::Experimental::Portal>
38 return *m_surface.get();
42 return *m_surface.get();
47 return m_volumeUpdators;
52 return m_attachedVolumes;
55 std::shared_ptr<Acts::Experimental::Portal>
57 return shared_from_this();
60 std::shared_ptr<const Acts::Experimental::Portal>
62 return shared_from_this();
67 m_surface->assignGeometryId(geometryId);
78 if (not m_volumeUpdators[tDir.
index()].connected()) {
79 throw std::invalid_argument(
80 "Portal: trying to fuse portal (keep) with no links.");
84 if (not other->m_volumeUpdators[oDir.
index()].connected()) {
85 throw std::runtime_error(
86 "Portal: trying to fuse portal (waste) with no links.");
89 auto odx = oDir.
index();
90 m_volumeUpdators[odx] =
std::move(other->m_volumeUpdators[odx]);
91 m_attachedVolumes[odx] = other->m_attachedVolumes[odx];
93 other = getSharedPtr();
98 std::vector<std::shared_ptr<DetectorVolume>> attachedVolumes) {
106 std::vector<std::shared_ptr<DetectorVolume>> attachedVolumes) {
108 if (not m_volumeUpdators[0
u].connected() and
109 not m_volumeUpdators[1
u].connected()) {
110 throw std::runtime_error(
"Portal: portal has no link on either side.");
112 if (m_volumeUpdators[0
u].connected() and m_volumeUpdators[1
u].connected()) {
113 throw std::runtime_error(
"Portal: portal already has links on both sides.");
115 size_t idx = m_volumeUpdators[0
u].connected() ? 1
u : 0
u;
123 const auto& direction = nState.
direction;
126 const auto& vUpdator = m_volumeUpdators[dir.
index()];
127 if (vUpdator.connected()) {
128 vUpdator(gctx, nState);