Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:11:31

0001 // This file is part of the ACTS project.
0002 //
0003 // Copyright (C) 2016 CERN for the benefit of the ACTS project
0004 //
0005 // This Source Code Form is subject to the terms of the Mozilla Public
0006 // License, v. 2.0. If a copy of the MPL was not distributed with this
0007 // file, You can obtain one at https://mozilla.org/MPL/2.0/.
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   // TODO why?
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 }  // namespace Acts