File indexing completed on 2025-10-16 08:02:13
0001
0002
0003
0004
0005
0006
0007
0008
0009 #pragma once
0010
0011 #include "Acts/Definitions/Direction.hpp"
0012 #include "Acts/Propagator/ConstrainedStep.hpp"
0013 #include "Acts/Surfaces/BoundaryTolerance.hpp"
0014 #include "Acts/Surfaces/Surface.hpp"
0015 #include "Acts/Utilities/Intersection.hpp"
0016 #include "Acts/Utilities/Logger.hpp"
0017
0018 #include <limits>
0019
0020 namespace Acts::detail {
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034
0035
0036
0037
0038
0039
0040 template <typename stepper_t>
0041 IntersectionStatus updateSingleSurfaceStatus(
0042 const stepper_t& stepper, typename stepper_t::State& state,
0043 const Surface& surface, std::uint8_t index, Direction direction,
0044 const BoundaryTolerance& boundaryTolerance, double surfaceTolerance,
0045 ConstrainedStep::Type stype, const Logger& logger) {
0046 ACTS_VERBOSE("Update single surface status for surface: "
0047 << surface.geometryId() << " index " << static_cast<int>(index));
0048
0049 auto sIntersection =
0050 surface
0051 .intersect(state.options.geoContext, stepper.position(state),
0052 direction * stepper.direction(state), boundaryTolerance,
0053 surfaceTolerance)
0054 .at(index);
0055
0056
0057 if (sIntersection.status() == IntersectionStatus::onSurface) {
0058 ACTS_VERBOSE("Intersection: state is ON SURFACE");
0059 state.stepSize.release(stype);
0060 stepper.updateStepSize(state, sIntersection.pathLength(), stype);
0061 return IntersectionStatus::onSurface;
0062 }
0063
0064 const double nearLimit = std::numeric_limits<double>::lowest();
0065 const double farLimit = std::numeric_limits<double>::max();
0066
0067 if (sIntersection.isValid() &&
0068 detail::checkPathLength(sIntersection.pathLength(), nearLimit, farLimit,
0069 logger)) {
0070 ACTS_VERBOSE("Surface is reachable");
0071 stepper.releaseStepSize(state, stype);
0072 stepper.updateStepSize(state, sIntersection.pathLength(), stype);
0073 return IntersectionStatus::reachable;
0074 }
0075
0076 ACTS_VERBOSE("Surface is NOT reachable");
0077 return IntersectionStatus::unreachable;
0078 }
0079
0080 }