File indexing completed on 2025-09-17 08:01:52
0001
0002
0003
0004
0005
0006
0007
0008
0009 #pragma once
0010
0011 #include "Acts/Definitions/Algebra.hpp"
0012 #include "Acts/Surfaces/PlanarBounds.hpp"
0013 #include "Acts/Surfaces/RectangleBounds.hpp"
0014 #include "Acts/Surfaces/SurfaceBounds.hpp"
0015
0016 #include <array>
0017 #include <iosfwd>
0018 #include <numbers>
0019 #include <vector>
0020
0021 namespace Acts {
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032 class EllipseBounds : public PlanarBounds {
0033 public:
0034 enum BoundValues {
0035 eInnerRx = 0,
0036 eInnerRy = 1,
0037 eOuterRx = 2,
0038 eOuterRy = 3,
0039 eHalfPhiSector = 4,
0040 eAveragePhi = 5,
0041 eSize = 6
0042 };
0043
0044
0045
0046
0047
0048
0049
0050
0051
0052 explicit EllipseBounds(double innerRx, double innerRy, double outerRx,
0053 double outerRy, double halfPhi = std::numbers::pi,
0054 double averagePhi = 0.) noexcept(false)
0055 : m_values({innerRx, innerRy, outerRx, outerRy, halfPhi, averagePhi}),
0056 m_boundingBox(m_values[eInnerRy], m_values[eOuterRy]) {
0057 checkConsistency();
0058 }
0059
0060
0061
0062
0063 explicit EllipseBounds(const std::array<double, eSize>& values) noexcept(
0064 false)
0065 : m_values(values), m_boundingBox(values[eInnerRy], values[eOuterRy]) {
0066 checkConsistency();
0067 }
0068
0069
0070 BoundsType type() const final { return eEllipse; }
0071
0072
0073
0074
0075 std::vector<double> values() const final;
0076
0077
0078 bool inside(const Vector2& lposition) const final;
0079
0080
0081 Vector2 closestPoint(const Vector2& lposition,
0082 const SquareMatrix2& metric) const final;
0083
0084 using SurfaceBounds::inside;
0085
0086
0087 Vector2 center() const final;
0088
0089
0090
0091
0092
0093
0094
0095
0096
0097 std::vector<Vector2> vertices(unsigned int quarterSegments) const final;
0098
0099
0100 const RectangleBounds& boundingBox() const final;
0101
0102
0103 std::ostream& toStream(std::ostream& sl) const final;
0104
0105
0106
0107 double get(BoundValues bValue) const { return m_values[bValue]; }
0108
0109 private:
0110 std::array<double, eSize> m_values;
0111 RectangleBounds m_boundingBox;
0112
0113
0114
0115 void checkConsistency() noexcept(false);
0116 };
0117
0118 }