File indexing completed on 2025-01-18 09:10:55
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.intersect(state.options.geoContext, stepper.position(state),
0051 direction * stepper.direction(state), boundaryTolerance,
0052 surfaceTolerance)[index];
0053
0054
0055 if (sIntersection.status() == IntersectionStatus::onSurface) {
0056 ACTS_VERBOSE("Intersection: state is ON SURFACE");
0057 state.stepSize.release(stype);
0058 stepper.updateStepSize(state, sIntersection.pathLength(), stype);
0059 return IntersectionStatus::onSurface;
0060 }
0061
0062 const double nearLimit = std::numeric_limits<double>::lowest();
0063 const double farLimit = std::numeric_limits<double>::max();
0064
0065 if (sIntersection.isValid() &&
0066 detail::checkPathLength(sIntersection.pathLength(), nearLimit, farLimit,
0067 logger)) {
0068 ACTS_VERBOSE("Surface is reachable");
0069 stepper.releaseStepSize(state, stype);
0070 stepper.updateStepSize(state, sIntersection.pathLength(), stype);
0071 return IntersectionStatus::reachable;
0072 }
0073
0074 ACTS_VERBOSE("Surface is NOT reachable");
0075 return IntersectionStatus::unreachable;
0076 }
0077
0078 }