File indexing completed on 2025-07-13 07:50:09
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/BoundingBox.hpp"
0015
0016 #include <array>
0017 #include <iomanip>
0018 #include <memory>
0019 #include <ostream>
0020 #include <vector>
0021
0022 namespace Acts {
0023
0024 class CylinderBounds;
0025 class ConeBounds;
0026 class RadialBounds;
0027 class PlanarBounds;
0028
0029
0030
0031
0032
0033
0034 class ConeVolumeBounds : public VolumeBounds {
0035 public:
0036
0037 enum BoundValues : unsigned int {
0038 eInnerAlpha = 0,
0039 eInnerOffsetZ = 1,
0040 eOuterAlpha = 2,
0041 eOuterOffsetZ = 3,
0042 eHalfLengthZ = 4,
0043 eAveragePhi = 5,
0044 eHalfPhiSector = 6,
0045 eSize
0046 };
0047
0048 ConeVolumeBounds() = delete;
0049
0050
0051
0052
0053
0054
0055
0056
0057
0058
0059 ConeVolumeBounds(double innerAlpha, double innerOffsetZ, double outerAlpha,
0060 double outerOffsetZ, double halflengthZ, double averagePhi,
0061 double halfPhiSector) noexcept(false);
0062
0063
0064
0065
0066
0067
0068
0069
0070
0071
0072
0073
0074 ConeVolumeBounds(double cylinderR, double alpha, double offsetZ,
0075 double halflengthZ, double averagePhi,
0076 double halfPhiSector) noexcept(false);
0077
0078
0079
0080
0081 explicit ConeVolumeBounds(const std::array<double, eSize>& values) noexcept(
0082 false)
0083 : m_values(values) {
0084 checkConsistency();
0085 buildSurfaceBounds();
0086 }
0087
0088 ConeVolumeBounds(const ConeVolumeBounds& cobo) = default;
0089 ~ConeVolumeBounds() override = default;
0090 ConeVolumeBounds& operator=(const ConeVolumeBounds& cobo) = default;
0091
0092 VolumeBounds::BoundsType type() const final { return VolumeBounds::eCone; }
0093
0094
0095
0096
0097 std::vector<double> values() const final;
0098
0099
0100
0101
0102
0103
0104 bool inside(const Vector3& pos, double tol = 0.) const final;
0105
0106
0107
0108
0109
0110
0111
0112
0113
0114
0115
0116 std::vector<OrientedSurface> orientedSurfaces(
0117 const Transform3& transform = Transform3::Identity()) const final;
0118
0119
0120
0121
0122
0123
0124 Volume::BoundingBox boundingBox(const Transform3* trf = nullptr,
0125 const Vector3& envelope = {0, 0, 0},
0126 const Volume* entity = nullptr) const final;
0127
0128
0129
0130 double get(BoundValues bValue) const { return m_values[bValue]; }
0131
0132
0133 double innerRmin() const;
0134
0135
0136 double innerRmax() const;
0137
0138
0139 double innerTanAlpha() const;
0140
0141
0142 double outerRmin() const;
0143
0144
0145 double outerRmax() const;
0146
0147
0148 double outerTanAlpha() const;
0149
0150
0151
0152
0153 std::ostream& toStream(std::ostream& os) const final;
0154
0155 private:
0156
0157
0158 void checkConsistency() noexcept(false);
0159
0160
0161 void buildSurfaceBounds();
0162
0163
0164 std::array<double, eSize> m_values;
0165 std::shared_ptr<CylinderBounds> m_innerCylinderBounds{nullptr};
0166 std::shared_ptr<ConeBounds> m_innerConeBounds{nullptr};
0167 std::shared_ptr<ConeBounds> m_outerConeBounds{nullptr};
0168 std::shared_ptr<CylinderBounds> m_outerCylinderBounds{nullptr};
0169 std::shared_ptr<RadialBounds> m_negativeDiscBounds{nullptr};
0170 std::shared_ptr<RadialBounds> m_positiveDiscBounds{nullptr};
0171 std::shared_ptr<PlanarBounds> m_sectorBounds{nullptr};
0172
0173
0174 double m_innerRmin = 0.;
0175 double m_innerRmax = 0.;
0176 double m_innerTanAlpha = 0.;
0177 double m_outerRmin = 0.;
0178 double m_outerRmax = 0.;
0179 double m_outerTanAlpha = 0.;
0180 };
0181
0182 }