ECCE @ EIC 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 
12 
14  // go through the surfaces
15  for (auto& sf : m_surfaceCache) {
16  auto mutableSf = const_cast<Surface*>(sf);
17  mutableSf->associateLayer(lay);
18  }
19 }
20 
23  const GeometryContext& gctx, const Vector3D& position,
24  const Vector3D& direction, const BoundaryCheck& bcheck) const {
25  // the intersection estimates
26  std::vector<ObjectIntersection<Surface>> sIntersections;
27  sIntersections.reserve(m_surfaceCache.size());
28  for (auto& sf : m_surfaceCache) {
29  // intersect
30  auto intersection =
31  sf->intersectionEstimate(gctx, position, direction, bcheck);
32  sIntersections.push_back(ObjectIntersection<Surface>(intersection, sf));
33  }
34  // Sort them & return the closest
35  std::sort(sIntersections.begin(), sIntersections.end());
36  return (*sIntersections.begin());
37 }
38 
39 const std::vector<const Acts::Surface*>&
41  return m_surfaceCache;
42 }
43 
44 std::vector<const Acts::Surface*>&
46  return m_surfaceCache;
47 }