Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Layer.ipp
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file Layer.ipp
1 // This file is part of the Acts project.
2 //
3 // Copyright (C) 2016-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 
9 #include <limits>
10 #include <map>
11 
12 namespace Acts {
13 
14 inline const SurfaceArray* Layer::surfaceArray() const {
15  return m_surfaceArray.get();
16 }
17 
19  return const_cast<SurfaceArray*>(m_surfaceArray.get());
20 }
21 
22 inline double Layer::thickness() const {
23  return m_layerThickness;
24 }
25 
26 inline LayerType Layer::layerType() const {
27  return m_layerType;
28 }
29 
30 inline const TrackingVolume* Layer::trackingVolume() const {
31  return m_trackingVolume;
32 }
33 
34 inline void Layer::encloseTrackingVolume(const TrackingVolume& tvol) {
35  m_trackingVolume = &(tvol);
36 }
37 
39  return m_representingVolume.get();
40 }
41 
42 inline const Layer* Layer::nextLayer(const GeometryContext& /*gctx*/,
43  const Vector3& position,
44  const Vector3& direction) const {
45  // no binutility -> no chance to find out the direction
46  if (m_nextLayerUtility == nullptr) {
47  return nullptr;
48  }
49  return (m_nextLayerUtility->nextDirection(position, direction) < 0)
50  ? m_nextLayers.first
51  : m_nextLayers.second;
52 }
53 
54 inline bool Layer::resolve(bool resolveSensitive, bool resolveMaterial,
55  bool resolvePassive) const {
56  if (resolvePassive) {
57  return true;
58  }
59  if (resolveSensitive && m_surfaceArray) {
60  return true;
61  }
62  if (resolveMaterial &&
64  (surfaceRepresentation().surfaceMaterial() != nullptr))) {
65  return true;
66  }
67  return false;
68 }
69 
71  const Vector3& position,
72  const BoundaryCheck& bcheck) const {
73  if (m_representingVolume != nullptr) {
74  return m_representingVolume->inside(position);
75  }
76  return (surfaceRepresentation())
77  .isOnSurface(gctx, position, Vector3::Zero(), bcheck);
78 }
79 
80 } // namespace Acts