ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Layer.hpp
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file Layer.hpp
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 
10 // Layer.h, Acts project
12 
13 #pragma once
14 
15 // Core module
16 #include <map>
28 
29 namespace Acts {
30 
31 class Surface;
32 class ISurfaceMaterial;
33 class BinUtility;
34 class Volume;
35 class VolumeBounds;
36 class TrackingVolume;
37 class ApproachDescriptor;
38 
39 // Simple surface intersection
41 
42 // master typedef
43 class Layer;
44 using LayerPtr = std::shared_ptr<const Layer>;
45 using MutableLayerPtr = std::shared_ptr<Layer>;
46 using NextLayers = std::pair<const Layer*, const Layer*>;
47 
52 enum LayerType { navigation = -1, passive = 0, active = 1 };
53 
83 class Layer : public virtual GeometryObject {
86  friend class TrackingVolume;
87 
88  public:
90  Layer() = delete;
91 
93  Layer(const Layer&) = delete;
94 
96  virtual ~Layer() = default;
97 
101  Layer& operator=(const Layer&) = delete;
102 
104  const SurfaceArray* surfaceArray() const;
105 
108 
112  virtual const Surface& surfaceRepresentation() const = 0;
113 
114  // Non-const version
115  virtual Surface& surfaceRepresentation() = 0;
116 
119  double thickness() const;
120 
130  virtual bool isOnLayer(const GeometryContext& gctx, const Vector3D& position,
131  const BoundaryCheck& bcheck = true) const;
132 
134  const ApproachDescriptor* approachDescriptor() const;
135 
138 
144  template <typename options_t>
145  bool resolve(const options_t& options) const {
146  return resolve(options.resolveSensitive, options.resolveMaterial,
147  options.resolvePassive);
148  }
149 
157  virtual bool resolve(bool resolveSensitive, bool resolveMaterial,
158  bool resolvePassive) const;
159 
170  template <typename options_t>
171  std::vector<SurfaceIntersection> compatibleSurfaces(
172  const GeometryContext& gctx, const Vector3D& position,
173  const Vector3D& direction, const options_t& options) const;
174 
188  template <typename options_t>
190  const Vector3D& position,
191  const Vector3D& direction,
192  const options_t& options) const;
193 
201  const Layer* nextLayer(const GeometryContext& gctx, const Vector3D& position,
202  const Vector3D& direction) const;
203 
207  const TrackingVolume* trackingVolume() const;
208 
212  const AbstractVolume* representingVolume() const;
213 
215  LayerType layerType() const;
216 
217  protected:
224  Layer(std::unique_ptr<SurfaceArray> surfaceArray, double thickness = 0.,
225  std::unique_ptr<ApproachDescriptor> ades = nullptr,
226  LayerType laytyp = passive);
227 
237  void encloseTrackingVolume(const TrackingVolume& tvol);
238 
241 
244  const BinUtility* m_nextLayerUtility = nullptr;
245 
251  std::unique_ptr<const SurfaceArray> m_surfaceArray = nullptr;
252 
254  double m_layerThickness = 0.;
255 
261  std::unique_ptr<const ApproachDescriptor> m_approachDescriptor = nullptr;
262 
265 
268  std::unique_ptr<AbstractVolume> m_representingVolume = nullptr;
269 
272 
277 
278  private:
288  void closeGeometry(const IMaterialDecorator* materialDecorator,
289  const GeometryID& layerID);
290 };
291 
295 
296 } // namespace Acts
297