Analysis Software
Documentation for sPHENIX simulation 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 
23 
24 #include <memory>
25 #include <utility>
26 #include <vector>
27 
28 namespace Acts {
29 
30 class Surface;
31 class ISurfaceMaterial;
32 class BinUtility;
33 class Volume;
34 class VolumeBounds;
35 class TrackingVolume;
36 class ApproachDescriptor;
37 class IMaterialDecorator;
38 template <typename T>
40 
41 // Simple surface intersection
43 
44 // master typedef
45 class Layer;
46 
47 using LayerPtr = std::shared_ptr<const Layer>;
48 using MutableLayerPtr = std::shared_ptr<Layer>;
49 using NextLayers = std::pair<const Layer*, const Layer*>;
50 
55 enum LayerType { navigation = -1, passive = 0, active = 1 };
56 
86 class Layer : public virtual GeometryObject {
89  friend class TrackingVolume;
90 
91  public:
93  Layer() = delete;
94 
96  Layer(const Layer&) = delete;
97 
99  virtual ~Layer() = default;
100 
104  Layer& operator=(const Layer& layer) = delete;
105 
107  const SurfaceArray* surfaceArray() const;
108 
111 
115  virtual const Surface& surfaceRepresentation() const = 0;
116 
117  // Non-const version
118  virtual Surface& surfaceRepresentation() = 0;
119 
122  double thickness() const;
123 
133  virtual bool isOnLayer(const GeometryContext& gctx, const Vector3& position,
134  const BoundaryCheck& bcheck = true) const;
135 
137  const ApproachDescriptor* approachDescriptor() const;
138 
141 
147  template <typename options_t>
148  bool resolve(const options_t& options) const {
149  return resolve(options.resolveSensitive, options.resolveMaterial,
150  options.resolvePassive);
151  }
152 
160  virtual bool resolve(bool resolveSensitive, bool resolveMaterial,
161  bool resolvePassive) const;
162 
171  boost::container::small_vector<SurfaceIntersection, 10> compatibleSurfaces(
172  const GeometryContext& gctx, const Vector3& position,
173  const Vector3& direction,
174  const NavigationOptions<Surface>& options) const;
175 
187  const GeometryContext& gctx, const Vector3& position,
188  const Vector3& direction, const NavigationOptions<Layer>& options) const;
189 
197  const Layer* nextLayer(const GeometryContext& gctx, const Vector3& position,
198  const Vector3& 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:
287  void closeGeometry(const IMaterialDecorator* materialDecorator,
288  const GeometryIdentifier& layerID,
289  const GeometryIdentifierHook& hook,
290  const Logger& logger = getDummyLogger());
291 };
292 
296 
297 } // namespace Acts
298