File indexing completed on 2025-01-18 09:10:51
0001
0002
0003
0004
0005
0006
0007
0008
0009 #pragma once
0010
0011 #include "Acts/Definitions/Algebra.hpp"
0012 #include "Acts/Geometry/Volume.hpp"
0013 #include "Acts/Geometry/VolumeBounds.hpp"
0014 #include "Acts/Utilities/AxisDefinitions.hpp"
0015
0016 #include <array>
0017 #include <iosfwd>
0018 #include <memory>
0019 #include <vector>
0020
0021 namespace Acts {
0022
0023 class CylinderBounds;
0024 class DiscBounds;
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034
0035
0036
0037
0038 class CutoutCylinderVolumeBounds : public VolumeBounds {
0039 public:
0040
0041 enum BoundValues : int {
0042 eMinR = 0,
0043 eMedR = 1,
0044 eMaxR = 2,
0045 eHalfLengthZ = 3,
0046 eHalfLengthZcutout = 4,
0047 eSize
0048 };
0049
0050
0051
0052
0053
0054
0055
0056
0057 CutoutCylinderVolumeBounds(double rmin, double rmed, double rmax, double hlZ,
0058 double hlZc) noexcept(false)
0059 : m_values({rmin, rmed, rmax, hlZ, hlZc}) {
0060 checkConsistency();
0061 buildSurfaceBounds();
0062 }
0063
0064
0065
0066
0067 CutoutCylinderVolumeBounds(const std::array<double, eSize>& values) noexcept(
0068 false)
0069 : m_values(values) {
0070 checkConsistency();
0071 buildSurfaceBounds();
0072 }
0073
0074 VolumeBounds::BoundsType type() const final {
0075 return VolumeBounds::eCutoutCylinder;
0076 }
0077
0078
0079
0080
0081 std::vector<double> values() const final;
0082
0083
0084
0085
0086
0087
0088 bool inside(const Vector3& gpos, double tol = 0) const override;
0089
0090
0091
0092
0093
0094
0095
0096
0097
0098
0099
0100 std::vector<OrientedSurface> orientedSurfaces(
0101 const Transform3& transform = Transform3::Identity()) const override;
0102
0103
0104
0105
0106
0107
0108
0109 Volume::BoundingBox boundingBox(const Transform3* trf = nullptr,
0110 const Vector3& envelope = {0, 0, 0},
0111 const Volume* entity = nullptr) const final;
0112
0113
0114
0115
0116
0117 std::vector<AxisDirection> canonicalAxes() const override {
0118 using enum AxisDirection;
0119 return {AxisR, AxisPhi, AxisZ};
0120 };
0121
0122
0123
0124
0125
0126 std::ostream& toStream(std::ostream& sl) const override;
0127
0128
0129
0130 double get(BoundValues bValue) const { return m_values[bValue]; }
0131
0132 private:
0133 std::array<double, eSize> m_values;
0134
0135
0136 std::shared_ptr<const CylinderBounds> m_innerCylinderBounds{nullptr};
0137 std::shared_ptr<const CylinderBounds> m_cutoutCylinderBounds{nullptr};
0138 std::shared_ptr<const CylinderBounds> m_outerCylinderBounds{nullptr};
0139 std::shared_ptr<const DiscBounds> m_outerDiscBounds{nullptr};
0140 std::shared_ptr<const DiscBounds> m_innerDiscBounds{nullptr};
0141
0142
0143 void buildSurfaceBounds();
0144
0145
0146
0147 void checkConsistency() noexcept(false);
0148 };
0149
0150 }