Back to home page

EIC code displayed by LXR

 
 

    


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

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/Geometry/TrivialPortalLink.hpp"
0010 
0011 #include "Acts/Geometry/GridPortalLink.hpp"
0012 #include "Acts/Geometry/TrackingVolume.hpp"
0013 
0014 #include <memory>
0015 
0016 namespace Acts {
0017 
0018 std::unique_ptr<GridPortalLink> TrivialPortalLink::makeGrid(
0019     AxisDirection direction) const {
0020   return GridPortalLink::make(m_surface, *m_volume, direction);
0021 }
0022 
0023 Result<const TrackingVolume*> TrivialPortalLink::resolveVolume(
0024     const GeometryContext& /*gctx*/, const Vector2& /*position*/,
0025     double /*tolerance*/) const {
0026   return m_volume;
0027 }
0028 
0029 Result<const TrackingVolume*> TrivialPortalLink::resolveVolume(
0030     const GeometryContext& gctx, const Vector3& position,
0031     double tolerance) const {
0032   static_cast<void>(gctx);
0033   static_cast<void>(position);
0034   static_cast<void>(tolerance);
0035   assert(m_surface->isOnSurface(gctx, position, BoundaryTolerance::None(),
0036                                 tolerance) &&
0037          "Trivial portal lookup point should be on surface");
0038   return m_volume;
0039 }
0040 
0041 void TrivialPortalLink::toStream(std::ostream& os) const {
0042   os << "TrivialPortalLink<vol=" << m_volume->volumeName() << ">";
0043 }
0044 
0045 const TrackingVolume& TrivialPortalLink::volume() const {
0046   return *m_volume;
0047 }
0048 
0049 }  // namespace Acts