File indexing completed on 2025-01-18 09:11:31
0001
0002
0003
0004
0005
0006
0007
0008
0009 #include "Acts/Utilities/Intersection.hpp"
0010
0011 #include "Acts/Definitions/Tolerance.hpp"
0012
0013 namespace Acts {
0014
0015 bool detail::checkPathLength(double pathLength, double nearLimit,
0016 double farLimit, const Logger& logger) {
0017
0018 const double tolerance = s_onSurfaceTolerance;
0019
0020 ACTS_VERBOSE(" -> near limit, far limit, distance: "
0021 << nearLimit << ", " << farLimit << ", " << pathLength);
0022
0023 const bool coCriterion = pathLength > nearLimit;
0024 const bool cpCriterion = pathLength < farLimit + tolerance;
0025
0026 const bool accept = coCriterion && cpCriterion;
0027
0028 if (accept) {
0029 ACTS_VERBOSE("Intersection is WITHIN limit");
0030 } else {
0031 ACTS_VERBOSE("Intersection is OUTSIDE limit because: ");
0032 if (!coCriterion) {
0033 ACTS_VERBOSE("- intersection path length "
0034 << pathLength << " <= near limit " << nearLimit);
0035 }
0036 if (!cpCriterion) {
0037 ACTS_VERBOSE("- intersection path length "
0038 << pathLength << " is over the far limit "
0039 << (farLimit + tolerance) << " (including tolerance of "
0040 << tolerance << ")");
0041 }
0042 }
0043
0044 return accept;
0045 }
0046
0047 }