Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-06-21 08:08:32

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 #pragma once
0010 
0011 #include "Acts/Geometry/Layer.hpp"
0012 
0013 namespace Acts {
0014 
0015 inline const SurfaceArray* Layer::surfaceArray() const {
0016   return m_surfaceArray.get();
0017 }
0018 
0019 inline SurfaceArray* Layer::surfaceArray() {
0020   return const_cast<SurfaceArray*>(m_surfaceArray.get());
0021 }
0022 
0023 inline double Layer::thickness() const {
0024   return m_layerThickness;
0025 }
0026 
0027 inline LayerType Layer::layerType() const {
0028   return m_layerType;
0029 }
0030 
0031 inline const TrackingVolume* Layer::trackingVolume() const {
0032   return m_trackingVolume;
0033 }
0034 
0035 inline void Layer::encloseTrackingVolume(const TrackingVolume& tvol) {
0036   m_trackingVolume = &tvol;
0037 }
0038 
0039 inline const Volume* Layer::representingVolume() const {
0040   return m_representingVolume.get();
0041 }
0042 
0043 inline const Layer* Layer::nextLayer(const GeometryContext& /*gctx*/,
0044                                      const Vector3& position,
0045                                      const Vector3& direction) const {
0046   // no binutility -> no chance to find out the direction
0047   if (m_nextLayerUtility == nullptr) {
0048     return nullptr;
0049   }
0050   return (m_nextLayerUtility->nextDirection(position, direction) < 0)
0051              ? m_nextLayers.first
0052              : m_nextLayers.second;
0053 }
0054 
0055 inline bool Layer::resolve(bool resolveSensitive, bool resolveMaterial,
0056                            bool resolvePassive) const {
0057   if (resolvePassive) {
0058     return true;
0059   }
0060   if (resolveSensitive && m_surfaceArray) {
0061     return true;
0062   }
0063   if (resolveMaterial &&
0064       (m_ssSensitiveSurfaces > 1 || m_ssApproachSurfaces > 1 ||
0065        (surfaceRepresentation().surfaceMaterial() != nullptr))) {
0066     return true;
0067   }
0068   return false;
0069 }
0070 
0071 inline bool Layer::isOnLayer(const GeometryContext& gctx,
0072                              const Vector3& position,
0073                              const BoundaryTolerance& boundaryTolerance) const {
0074   if (m_representingVolume != nullptr) {
0075     return m_representingVolume->inside(position);
0076   }
0077   return surfaceRepresentation().isOnSurface(gctx, position, Vector3::Zero(),
0078                                              boundaryTolerance);
0079 }
0080 
0081 }  // namespace Acts