File indexing completed on 2025-01-19 09:23:34
0001
0002
0003
0004
0005
0006
0007
0008
0009 #pragma once
0010
0011 #include "Acts/Definitions/Algebra.hpp"
0012 #include "Acts/Surfaces/BoundaryCheck.hpp"
0013 #include "Acts/Surfaces/SurfaceBounds.hpp"
0014
0015 #include <array>
0016 #include <iosfwd>
0017 #include <stdexcept>
0018 #include <vector>
0019
0020 namespace Acts {
0021
0022
0023
0024
0025 class LineBounds : public SurfaceBounds {
0026 public:
0027 enum BoundValues : int { eR = 0, eHalfLengthZ = 1, eSize = 2 };
0028
0029 LineBounds() = delete;
0030
0031
0032
0033
0034
0035 LineBounds(double r, double halfZ) noexcept(false) : m_values({r, halfZ}) {
0036 checkConsistency();
0037 }
0038
0039
0040
0041
0042 LineBounds(const std::array<double, eSize>& values) noexcept(false)
0043 : m_values(values) {
0044 checkConsistency();
0045 }
0046
0047 ~LineBounds() override = default;
0048
0049 BoundsType type() const final;
0050
0051
0052
0053
0054 std::vector<double> values() const final;
0055
0056
0057
0058
0059
0060
0061
0062
0063
0064 bool inside(const Vector2& lposition,
0065 const BoundaryCheck& bcheck) const final;
0066
0067
0068
0069
0070 std::ostream& toStream(std::ostream& sl) const final;
0071
0072
0073
0074 double get(BoundValues bValue) const { return m_values[bValue]; }
0075
0076 private:
0077 std::array<double, eSize> m_values;
0078
0079
0080
0081 void checkConsistency() noexcept(false);
0082 };
0083
0084 inline std::vector<double> LineBounds::values() const {
0085 std::vector<double> valvector;
0086 valvector.insert(valvector.begin(), m_values.begin(), m_values.end());
0087 return valvector;
0088 }
0089
0090 inline void LineBounds::checkConsistency() noexcept(false) {
0091 if (get(eR) < 0.) {
0092 throw std::invalid_argument("LineBounds: zero radius.");
0093 }
0094 if (get(eHalfLengthZ) <= 0.) {
0095 throw std::invalid_argument("LineBounds: zero/negative length.");
0096 }
0097 }
0098
0099 }