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 
9 #pragma once
10 
22 
23 #include <map>
24 
25 namespace Acts {
26 
27 class Surface;
28 class ISurfaceMaterial;
29 class BinUtility;
30 class Volume;
31 class VolumeBounds;
32 class TrackingVolume;
33 class ApproachDescriptor;
34 
35 // Simple surface intersection
37 
38 // master typedef
39 class Layer;
40 using LayerPtr = std::shared_ptr<const Layer>;
41 using MutableLayerPtr = std::shared_ptr<Layer>;
42 using NextLayers = std::pair<const Layer*, const Layer*>;
43 
48 enum LayerType { navigation = -1, passive = 0, active = 1 };
49 
79 class Layer : public virtual GeometryObject {
82  friend class TrackingVolume;
83 
84  public:
86  Layer() = delete;
87 
89  Layer(const Layer&) = delete;
90 
92  virtual ~Layer() = default;
93 
97  Layer& operator=(const Layer&) = delete;
98 
100  const SurfaceArray* surfaceArray() const;
101 
104 
108  virtual const Surface& surfaceRepresentation() const = 0;
109 
110  // Non-const version
111  virtual Surface& surfaceRepresentation() = 0;
112 
115  double thickness() const;
116 
126  virtual bool isOnLayer(const GeometryContext& gctx, const Vector3D& position,
127  const BoundaryCheck& bcheck = true) const;
128 
130  const ApproachDescriptor* approachDescriptor() const;
131 
134 
140  template <typename options_t>
141  bool resolve(const options_t& options) const {
142  return resolve(options.resolveSensitive, options.resolveMaterial,
143  options.resolvePassive);
144  }
145 
153  virtual bool resolve(bool resolveSensitive, bool resolveMaterial,
154  bool resolvePassive) const;
155 
166  template <typename options_t>
167  std::vector<SurfaceIntersection> compatibleSurfaces(
168  const GeometryContext& gctx, const Vector3D& position,
169  const Vector3D& direction, const options_t& options) const;
170 
184  template <typename options_t>
186  const Vector3D& position,
187  const Vector3D& direction,
188  const options_t& options) const;
189 
197  const Layer* nextLayer(const GeometryContext& gctx, const Vector3D& position,
198  const Vector3D& direction) const;
199 
203  const TrackingVolume* trackingVolume() const;
204 
208  const AbstractVolume* representingVolume() const;
209 
211  LayerType layerType() const;
212 
213  protected:
220  Layer(std::unique_ptr<SurfaceArray> surfaceArray, double thickness = 0.,
221  std::unique_ptr<ApproachDescriptor> ades = nullptr,
222  LayerType laytyp = passive);
223 
233  void encloseTrackingVolume(const TrackingVolume& tvol);
234 
237 
240  const BinUtility* m_nextLayerUtility = nullptr;
241 
247  std::unique_ptr<const SurfaceArray> m_surfaceArray = nullptr;
248 
250  double m_layerThickness = 0.;
251 
257  std::unique_ptr<const ApproachDescriptor> m_approachDescriptor = nullptr;
258 
261 
264  std::unique_ptr<AbstractVolume> m_representingVolume = nullptr;
265 
268 
273 
274  private:
284  void closeGeometry(const IMaterialDecorator* materialDecorator,
285  const GeometryIdentifier& layerID);
286 };
287 
291 
292 } // namespace Acts
293