Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GenericApproachDescriptor.cpp
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file GenericApproachDescriptor.cpp
1 // This file is part of the Acts project.
2 //
3 // Copyright (C) 2018 CERN for the benefit of the Acts project
4 //
5 // This Source Code Form is subject to the terms of the Mozilla Public
6 // License, v. 2.0. If a copy of the MPL was not distributed with this
7 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 
10 
13 
14 #include <algorithm>
15 
16 #include <boost/container/small_vector.hpp>
17 
19  // go through the surfaces
20  for (auto& sf : m_surfaceCache) {
21  auto mutableSf = const_cast<Surface*>(sf);
22  mutableSf->associateLayer(lay);
23  }
24 }
25 
27  const GeometryContext& gctx, const Vector3& position,
28  const Vector3& direction, const BoundaryCheck& bcheck, double pLimit,
29  double oLimit, double tolerance) const {
30  // almost always 2
31  boost::container::small_vector<SurfaceIntersection, 2> sIntersections;
32  sIntersections.reserve(m_surfaceCache.size());
33  for (const auto& sf : m_surfaceCache) {
34  auto sfIntersection = sf->intersect(gctx, position, direction, bcheck);
35  for (const auto& intersection : sfIntersection.split()) {
36  if (intersection &&
37  detail::checkIntersection(intersection, pLimit, oLimit, tolerance)) {
38  sIntersections.push_back(intersection);
39  }
40  }
41  }
42  if (sIntersections.empty()) {
44  }
45  return *std::min_element(sIntersections.begin(), sIntersections.end(),
47 }
48 
49 const std::vector<const Acts::Surface*>&
51  return m_surfaceCache;
52 }
53 
54 std::vector<const Acts::Surface*>&
56  return m_surfaceCache;
57 }