File indexing completed on 2025-07-09 07:49:46
0001
0002
0003
0004
0005
0006
0007
0008
0009 #pragma once
0010
0011 #include "Acts/Definitions/Algebra.hpp"
0012 #include "Acts/Surfaces/BoundaryTolerance.hpp"
0013 #include "Acts/Surfaces/DiscBounds.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 class RadialBounds : public DiscBounds {
0030 public:
0031 enum BoundValues {
0032 eMinR = 0,
0033 eMaxR = 1,
0034 eHalfPhiSector = 2,
0035 eAveragePhi = 3,
0036 eSize = 4
0037 };
0038
0039
0040
0041
0042
0043
0044
0045 explicit RadialBounds(double minR, double maxR,
0046 double halfPhi = std::numbers::pi,
0047 double avgPhi = 0.) noexcept(false)
0048 : m_values({minR, maxR, halfPhi, avgPhi}) {
0049 checkConsistency();
0050 }
0051
0052
0053
0054
0055 explicit RadialBounds(const std::array<double, eSize>& values) noexcept(false)
0056 : m_values(values) {
0057 checkConsistency();
0058 }
0059
0060 BoundsType type() const final { return SurfaceBounds::eDisc; }
0061
0062
0063
0064
0065 std::vector<double> values() const final;
0066
0067
0068
0069
0070
0071
0072
0073 bool inside(const Vector2& lposition,
0074 const BoundaryTolerance& boundaryTolerance) const final;
0075
0076
0077
0078
0079 std::ostream& toStream(std::ostream& sl) const final;
0080
0081
0082 double rMin() const final { return get(eMinR); }
0083
0084
0085 double rMax() const final { return get(eMaxR); }
0086
0087
0088
0089 double get(BoundValues bValue) const { return m_values[bValue]; }
0090
0091
0092 bool coversFullAzimuth() const final {
0093 return (get(eHalfPhiSector) == std::numbers::pi);
0094 }
0095
0096
0097
0098 bool insideRadialBounds(double R, double tolerance = 0.) const final {
0099 return (R + tolerance > get(eMinR) && R - tolerance < get(eMaxR));
0100 }
0101
0102
0103 double binningValueR() const final { return 0.5 * (get(eMinR) + get(eMaxR)); }
0104
0105
0106 double binningValuePhi() const final { return get(eAveragePhi); }
0107
0108 private:
0109 std::array<double, eSize> m_values;
0110
0111
0112
0113 void checkConsistency() noexcept(false);
0114
0115
0116
0117
0118
0119 Vector2 shifted(const Vector2& lposition) const;
0120
0121
0122
0123
0124
0125
0126
0127
0128
0129
0130
0131 std::vector<Vector2> vertices(unsigned int lseg) const final;
0132 };
0133
0134 }