File indexing completed on 2026-07-26 08:19:03
0001
0002
0003
0004
0005
0006
0007
0008
0009 #include "Acts/Surfaces/PointBounds.hpp"
0010
0011 #include "Acts/Utilities/detail/OstreamStateGuard.hpp"
0012
0013 #include <iomanip>
0014 #include <iostream>
0015 #include <stdexcept>
0016
0017 namespace Acts {
0018
0019 std::vector<double> PointBounds::values() const {
0020 return {m_values.begin(), m_values.end()};
0021 }
0022
0023 void PointBounds::checkConsistency() noexcept(false) {
0024 if (get(eR) < 0.) {
0025 throw std::invalid_argument("PointBounds: negative radius.");
0026 }
0027 }
0028
0029 bool PointBounds::inside(const Vector2& lposition) const {
0030 const double r = get(eR);
0031 return lposition.squaredNorm() <= r * r;
0032 }
0033
0034 Vector2 PointBounds::closestPoint(const Vector2& lposition,
0035 const SquareMatrix2& metric) const {
0036 static_cast<void>(metric);
0037
0038
0039
0040 const double r = get(eR);
0041 const double norm = lposition.norm();
0042 if (norm == 0.) {
0043 return Vector2(r, 0.);
0044 }
0045 return lposition * (r / norm);
0046 }
0047
0048 std::ostream& PointBounds::toStream(std::ostream& sl) const {
0049 detail::OstreamStateGuard guard{sl};
0050 sl << std::fixed << std::setprecision(7);
0051 sl << "Acts::PointBounds: (maxDistance) = ";
0052 sl << "(" << get(eR) << ")";
0053 return sl;
0054 }
0055
0056 }