File indexing completed on 2026-07-16 08:07:29
0001
0002
0003
0004
0005
0006
0007
0008
0009 #pragma once
0010
0011 #include "Acts/Definitions/Algebra.hpp"
0012 #include "Acts/Geometry/CuboidVolumeBounds.hpp"
0013 #include "Acts/Geometry/PortalShell.hpp"
0014 #include "Acts/Geometry/TrackingVolume.hpp"
0015 #include "Acts/Utilities/AxisDefinitions.hpp"
0016 #include "Acts/Utilities/Logger.hpp"
0017
0018 #include <array>
0019 #include <memory>
0020 #include <vector>
0021
0022 namespace Acts {
0023
0024
0025
0026
0027 class CuboidPortalShell : public PortalShellBase {
0028 public:
0029
0030 using Face = CuboidVolumeBounds::Face;
0031
0032
0033
0034
0035
0036 virtual std::shared_ptr<Portal> portal(Face face) = 0;
0037
0038
0039
0040
0041 virtual void setPortal(std::shared_ptr<Portal> portal, Face face) = 0;
0042
0043
0044 void fill(TrackingVolume& volume) override;
0045
0046
0047
0048 virtual const Transform3& localToGlobalTransform(
0049 const GeometryContext& gctx) const = 0;
0050 };
0051
0052
0053
0054
0055
0056 std::ostream& operator<<(std::ostream& os, CuboidPortalShell::Face face);
0057
0058
0059
0060 class SingleCuboidPortalShell : public CuboidPortalShell {
0061 public:
0062
0063
0064 explicit SingleCuboidPortalShell(TrackingVolume& volume);
0065
0066
0067 std::size_t size() const final;
0068
0069
0070 std::shared_ptr<Portal> portal(Face face) final;
0071
0072
0073 void setPortal(std::shared_ptr<Portal> portal, Face face) final;
0074
0075
0076 void applyToVolume() override;
0077
0078
0079 bool isValid() const override;
0080
0081
0082 std::string label() const override;
0083
0084 const Transform3& localToGlobalTransform(
0085 const GeometryContext& gctx) const override {
0086 return m_volume->localToGlobalTransform(gctx);
0087 };
0088
0089 private:
0090 std::array<std::shared_ptr<Portal>, 6> m_portals{};
0091
0092 TrackingVolume* m_volume;
0093 };
0094
0095
0096
0097 class CuboidStackPortalShell final : public CuboidPortalShell {
0098 public:
0099
0100
0101
0102
0103
0104
0105 CuboidStackPortalShell(const GeometryContext& gctx,
0106 std::vector<CuboidPortalShell*> shells,
0107 AxisDirection direction,
0108 const Logger& logger = getDummyLogger());
0109
0110
0111 std::size_t size() const override;
0112
0113
0114 std::shared_ptr<Portal> portal(Face face) override;
0115
0116
0117 void setPortal(std::shared_ptr<Portal> portal, Face face) override;
0118
0119 void applyToVolume() override {
0120
0121 }
0122
0123
0124 bool isValid() const override;
0125
0126
0127 std::string label() const override;
0128
0129
0130
0131 const Transform3& localToGlobalTransform(
0132 const GeometryContext& gctx) const override;
0133
0134 private:
0135
0136 AxisDirection m_direction;
0137
0138
0139 CuboidVolumeBounds::Face m_frontFace = Face::NegativeXFace;
0140
0141 CuboidVolumeBounds::Face m_backFace = Face::PositiveXFace;
0142
0143 std::array<CuboidVolumeBounds::Face, 4> m_sideFaces{
0144 Face::NegativeZFace, Face::PositiveZFace, Face::NegativeYFace,
0145 Face::PositiveYFace};
0146
0147 std::vector<CuboidPortalShell*> m_shells;
0148 };
0149
0150 }