File indexing completed on 2025-08-05 08:09:17
0001
0002
0003
0004
0005
0006
0007
0008
0009 #pragma once
0010
0011 #include "Acts/Definitions/Algebra.hpp"
0012 #include "Acts/Definitions/Direction.hpp"
0013 #include "Acts/Definitions/Tolerance.hpp"
0014 #include "Acts/Propagator/ConstrainedStep.hpp"
0015 #include "Acts/Surfaces/BoundaryCheck.hpp"
0016 #include "Acts/Surfaces/Surface.hpp"
0017 #include "Acts/Utilities/Intersection.hpp"
0018 #include "Acts/Utilities/Logger.hpp"
0019
0020 namespace Acts::detail {
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032 template <typename stepper_t>
0033 Acts::Intersection3D::Status updateSingleSurfaceStatus(
0034 const stepper_t& stepper, typename stepper_t::State& state,
0035 const Surface& surface, std::uint8_t index, Direction navDir,
0036 const BoundaryCheck& bcheck, ActsScalar surfaceTolerance,
0037 const Logger& logger) {
0038 ACTS_VERBOSE("Update single surface status for surface: "
0039 << surface.geometryId() << " index " << (int)index);
0040
0041 auto sIntersection = surface.intersect(
0042 state.geoContext, stepper.position(state),
0043 navDir * stepper.direction(state), bcheck, surfaceTolerance)[index];
0044
0045
0046 if (sIntersection.status() == Intersection3D::Status::onSurface) {
0047
0048 state.stepSize.release(ConstrainedStep::actor);
0049 ACTS_VERBOSE("Intersection: state is ON SURFACE");
0050 return Intersection3D::Status::onSurface;
0051 }
0052
0053
0054 const double nearLimit = stepper.overstepLimit(state);
0055 const double farLimit = state.stepSize.value(ConstrainedStep::aborter);
0056
0057 if (sIntersection && detail::checkIntersection(sIntersection.intersection(),
0058 nearLimit, farLimit, logger)) {
0059 ACTS_VERBOSE("Surface is reachable");
0060 stepper.updateStepSize(state, sIntersection.pathLength(),
0061 ConstrainedStep::actor);
0062 return Intersection3D::Status::reachable;
0063 }
0064
0065 ACTS_VERBOSE("Surface is NOT reachable");
0066 return Intersection3D::Status::unreachable;
0067 }
0068
0069
0070
0071
0072
0073
0074
0075
0076
0077 template <typename stepper_t, typename object_intersection_t>
0078 void updateSingleStepSize(typename stepper_t::State& state,
0079 const object_intersection_t& oIntersection,
0080 bool release = true) {
0081 double stepSize = oIntersection.pathLength();
0082 state.stepSize.update(stepSize, ConstrainedStep::actor, release);
0083 }
0084
0085 }