File indexing completed on 2025-09-18 08:11:50
0001
0002
0003
0004
0005
0006
0007
0008
0009 #pragma once
0010
0011 #include "Acts/Definitions/Algebra.hpp"
0012 #include "Acts/Definitions/Tolerance.hpp"
0013 #include "Acts/Surfaces/DiscBounds.hpp"
0014 #include "Acts/Surfaces/SurfaceBounds.hpp"
0015
0016 #include <array>
0017 #include <cmath>
0018 #include <iosfwd>
0019 #include <numbers>
0020 #include <vector>
0021
0022 namespace Acts {
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034 class AnnulusBounds : public DiscBounds {
0035 public:
0036 enum BoundValues : int {
0037 eMinR = 0,
0038 eMaxR = 1,
0039 eMinPhiRel = 2,
0040 eMaxPhiRel = 3,
0041 eAveragePhi = 4,
0042 eOriginX = 5,
0043 eOriginY = 6,
0044 eSize = 7
0045 };
0046
0047
0048
0049
0050
0051
0052
0053
0054
0055
0056 explicit AnnulusBounds(double minR, double maxR, double minPhiRel,
0057 double maxPhiRel, const Vector2& moduleOrigin = {0, 0},
0058 double avgPhi = 0) noexcept(false)
0059 : AnnulusBounds({minR, maxR, minPhiRel, maxPhiRel, avgPhi,
0060 moduleOrigin.x(), moduleOrigin.y()}) {}
0061
0062
0063
0064
0065 explicit AnnulusBounds(const std::array<double, eSize>& values) noexcept(
0066 false);
0067
0068 BoundsType type() const final { return eAnnulus; }
0069
0070
0071 bool isCartesian() const final { return false; }
0072
0073
0074 SquareMatrix2 boundToCartesianJacobian(const Vector2& lposition) const final;
0075
0076
0077 SquareMatrix2 boundToCartesianMetric(const Vector2& lposition) const final;
0078
0079
0080
0081 std::vector<double> values() const final;
0082
0083
0084 bool inside(const Vector2& lposition) const final;
0085
0086
0087 Vector2 closestPoint(const Vector2& lposition,
0088 const SquareMatrix2& metric) const final;
0089
0090 using SurfaceBounds::inside;
0091
0092
0093
0094 Vector2 center() const final;
0095
0096
0097
0098 std::ostream& toStream(std::ostream& sl) const final;
0099
0100
0101
0102 double get(BoundValues bValue) const { return m_values[bValue]; }
0103
0104
0105
0106 double phiMin() const { return get(eMinPhiRel) + get(eAveragePhi); }
0107
0108
0109
0110 double phiMax() const { return get(eMaxPhiRel) + get(eAveragePhi); }
0111
0112
0113 bool coversFullAzimuth() const final {
0114 return (std::abs((get(eMinPhiRel) - get(eMaxPhiRel)) - std::numbers::pi) <
0115 s_onSurfaceTolerance);
0116 }
0117
0118
0119
0120 bool insideRadialBounds(double R, double tolerance = 0.) const final {
0121 return ((R + tolerance) > get(eMinR) && (R - tolerance) < get(eMaxR));
0122 }
0123
0124
0125 double binningValueR() const final { return 0.5 * (get(eMinR) + get(eMaxR)); }
0126
0127
0128 double binningValuePhi() const final { return get(eAveragePhi); }
0129
0130
0131
0132
0133
0134 Vector2 moduleOrigin() const;
0135
0136
0137
0138
0139
0140 std::vector<Vector2> corners() const;
0141
0142
0143
0144
0145
0146
0147
0148
0149
0150
0151
0152
0153
0154
0155 std::vector<Vector2> vertices(
0156 unsigned int quarterSegments = 2u) const override;
0157
0158
0159 double rMin() const final { return get(eMinR); }
0160
0161
0162 double rMax() const final { return get(eMaxR); }
0163
0164 private:
0165 std::array<double, eSize> m_values;
0166
0167
0168 Vector2 m_moduleOrigin{
0169 Vector2::Zero()};
0170 Vector2 m_shiftXY{Vector2::Zero()};
0171 Vector2 m_shiftPC{Vector2::Zero()};
0172 Transform2 m_rotationStripPC{Transform2::Identity()};
0173 Transform2 m_translation{Transform2::Identity()};
0174
0175
0176 Vector2 m_outLeftStripPC{Vector2::Zero()};
0177 Vector2 m_inLeftStripPC{Vector2::Zero()};
0178 Vector2 m_outRightStripPC{Vector2::Zero()};
0179 Vector2 m_inRightStripPC{Vector2::Zero()};
0180
0181 Vector2 m_outLeftModulePC{Vector2::Zero()};
0182 Vector2 m_inLeftModulePC{Vector2::Zero()};
0183 Vector2 m_outRightModulePC{Vector2::Zero()};
0184 Vector2 m_inRightModulePC{Vector2::Zero()};
0185
0186 Vector2 m_outLeftStripXY{Vector2::Zero()};
0187 Vector2 m_inLeftStripXY{Vector2::Zero()};
0188 Vector2 m_outRightStripXY{Vector2::Zero()};
0189 Vector2 m_inRightStripXY{Vector2::Zero()};
0190
0191
0192 Vector2 m_center{Vector2::Zero()};
0193
0194
0195
0196 void checkConsistency() noexcept(false);
0197
0198
0199
0200
0201
0202 Vector2 stripXYToModulePC(const Vector2& vStripXY) const;
0203
0204 Vector2 stripPCToModulePC(const Vector2& vStripPC) const;
0205
0206 Vector2 modulePCToStripPC(const Vector2& vModulePC) const;
0207
0208 SquareMatrix2 stripPCToModulePCJacobian(
0209 const Vector2& lpositionRotated) const;
0210 };
0211
0212 }