File indexing completed on 2025-01-18 09:11:30
0001
0002
0003
0004
0005
0006
0007
0008
0009 #include "Acts/Surfaces/LineBounds.hpp"
0010
0011 #include "Acts/Surfaces/BoundaryTolerance.hpp"
0012 #include "Acts/Surfaces/detail/BoundaryCheckHelper.hpp"
0013
0014 #include <iomanip>
0015 #include <iostream>
0016
0017 namespace Acts {
0018
0019 std::vector<double> LineBounds::values() const {
0020 return {m_values.begin(), m_values.end()};
0021 }
0022
0023 void LineBounds::checkConsistency() noexcept(false) {
0024 if (get(eR) < 0.) {
0025 throw std::invalid_argument("LineBounds: zero radius.");
0026 }
0027 if (get(eHalfLengthZ) <= 0.) {
0028 throw std::invalid_argument("LineBounds: zero/negative length.");
0029 }
0030 }
0031
0032 bool LineBounds::inside(const Vector2& lposition,
0033 const BoundaryTolerance& boundaryTolerance) const {
0034 double r = get(LineBounds::eR);
0035 double halfLengthZ = get(LineBounds::eHalfLengthZ);
0036 return detail::insideAlignedBox(Vector2(-r, -halfLengthZ),
0037 Vector2(r, halfLengthZ), boundaryTolerance,
0038 lposition, std::nullopt);
0039 }
0040
0041 std::ostream& LineBounds::toStream(std::ostream& sl) const {
0042 sl << std::setiosflags(std::ios::fixed);
0043 sl << std::setprecision(7);
0044 sl << "Acts::LineBounds: (radius, halflengthInZ) = ";
0045 sl << "(" << get(LineBounds::eR) << ", " << get(LineBounds::eHalfLengthZ)
0046 << ")";
0047 sl << std::setprecision(-1);
0048 return sl;
0049 }
0050
0051 }