ATLAS Offline Software
Loading...
Searching...
No Matches
Layer.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3*/
4
6// Layer.h, (c) ATLAS Detector software
8
9#ifndef TRKGEOMETRY_LAYER_H
10#define TRKGEOMETRY_LAYER_H
11
12class MsgStream;
13
14// Amg
16// Trk
25//
26#include <memory>
27
28namespace Trk {
29
30class Surface;
32class BinUtility;
33class Volume;
34class VolumeBounds;
35class TrackingVolume;
37class ICompatibilityEstimator;
38
41
47enum LayerType { passive = 0, active = 1 };
48
71
72class Layer {
73 public:
75 Layer() = default;
77 virtual ~Layer() = default;
78
79
81 Layer(const LayerMaterialProperties& laymatprop, double thickness = 0.,
82 std::unique_ptr<OverlapDescriptor> od = nullptr,
83 int ltype = int(passive));
84
86 Layer(std::unique_ptr<SurfaceArray> surfaceArray, double thickness = 0.,
87 std::unique_ptr<OverlapDescriptor> = nullptr, int ltype = int(passive));
88
91 Layer(std::unique_ptr<SurfaceArray> surfaceArray, const LayerMaterialProperties& laymatprop,
92 double thickness = 0., std::unique_ptr<OverlapDescriptor> od = nullptr,
93 int ltype = int(passive));
94
96 const SurfaceArray* surfaceArray() const;
97
100
104 const Surface* subSurface(const Amg::Vector3D& gp) const;
105
109 const Surface* subSurface(const Amg::Vector2D& lp) const;
110
116 const Surface* subSurfaceReference(unsigned int idx = 0) const;
117
119 virtual const Surface& surfaceRepresentation() const = 0;
121
122
124 double thickness() const;
125
127 template <class T>
128 bool onLayer(const T& parameters,
129 const BoundaryCheck& bcheck = BoundaryCheck(true)) const;
130
132 virtual bool isOnLayer(
133 const Amg::Vector3D& gp,
134 const BoundaryCheck& bcheck = BoundaryCheck(true)) const;
135
138
141 const TrackParameters& par) const;
142
145 PropDirection) const {
146 return 1.;
147 }
148
151 PropDirection) const {
152 return 0.;
153 }
154
159 const Layer* previousLayer(bool skipNavLayer = false) const;
162
165 const Layer* nextLayer(const Amg::Vector3D& gp,
166 const Amg::Vector3D& udir) const;
169 const Layer* nextLayer(bool skipNavLayer = false) const;
171 void setNextLayer(const Layer*);
172
174 const BinUtility* binUtility() const;
177
180 virtual const Surface& surfaceOnApproach(
181 const Amg::Vector3D& pos, const Amg::Vector3D& dir, PropDirection pdir,
182 const BoundaryCheck& bcheck, bool resolveSubSurfaces = 0,
183 const ICompatibilityEstimator* ice = nullptr) const;
184
186 size_t compatibleSurfaces(std::vector<SurfaceIntersection>& cSurfaces,
187 const TrackParameters& pars, PropDirection pdir,
188 const BoundaryCheck& bcheck,
189 bool materialSurfacesOnly = true,
190 const Surface* startSurface = nullptr,
191 const Surface* endSurface = nullptr,
192 const ICompatibilityEstimator* ice = nullptr) const;
193
195 size_t compatibleSurfaces(std::vector<SurfaceIntersection>& cSurfaces,
196 const NeutralParameters& pars, PropDirection pdir,
197 const BoundaryCheck& bcheck,
198 bool materialSurfacesOnly = true,
199 const Surface* startSurface = nullptr,
200 const Surface* endSurface = nullptr,
201 const ICompatibilityEstimator* ice = nullptr) const;
202
207 virtual bool hasSubStructure(bool resolveSensitive = false) const;
208
211
214
216 const LayerIndex& layerIndex() const;
217
219 int layerType() const;
220
222 void setLayerType(int identifier);
223
226 double scale = 1.0);
227
229 virtual void moveLayer(Amg::Transform3D&) = 0;
230
233
236
238 void setRef(double);
239
241 double getRef() const;
242
246
248 template <class T>
250 std::vector<SurfaceIntersection>& cSurfaces, const T& pars,
251 PropDirection pdir, const BoundaryCheck& bcheck,
252 bool materialSurfacesOnly = true, const Surface* startSurface = nullptr,
253 const Surface* endSurface = nullptr,
254 const ICompatibilityEstimator* ice = nullptr) const;
255
257 void compactify(size_t& cSurfaces, size_t& tSurfaces);
258
261
269
272 virtual void resizeLayer(const VolumeBounds&, double) = 0;
273
275 virtual void resizeAndRepositionLayer(const VolumeBounds& vBounds,
276 const Amg::Vector3D& vCenter,
277 double envelope = 1.) = 0;
278
279 protected:
281 Layer(const Layer& lay);
283 Layer& operator=(const Layer& lay);
284
286 std::unique_ptr<SurfaceArray> m_surfaceArray{};
288 std::unique_ptr<LayerMaterialProperties> m_layerMaterialProperties{};
292 std::unique_ptr<OverlapDescriptor> m_overlapDescriptor{};
293
294 // These are stored by not owning pointers belong to the Volume
296 const Layer* m_previousLayer = nullptr;
298 const Layer* m_nextLayer = nullptr;
300 const BinUtility* m_binUtility = nullptr;
305
308 double m_ref{};
309};
310
311} // namespace Trk
312#include "Layer.icc"
313#endif // TRKGEOMETRY_LAYER_H
314
Define macros for attributes used to control the static checker.
Layer()=default
Default Constructor.
A generic symmetric BinUtility, for fully symmetric binning in terms of binning grid and binning type...
Definition BinUtility.h:39
Binned Array for avoiding map searches/.
Definition BinnedArray.h:36
The BoundaryCheck class allows to steer the way surface boundaries are used for inside/outside checks...
Base Class for a navigation object (active/passive) in the Tracking realm.
LayerIndex for the identification of layers in a simplified detector geometry of Cylinders and Discs.
Definition LayerIndex.h:37
This virtual base class encapsulates the logics to build pre/post/full update material for Layer stru...
void assignMaterialProperties(const LayerMaterialProperties &, double scale=1.0)
assignMaterialPropeties
Definition Layer.cxx:177
size_t compatibleSurfaces(std::vector< SurfaceIntersection > &cSurfaces, const TrackParameters &pars, PropDirection pdir, const BoundaryCheck &bcheck, bool materialSurfacesOnly=true, const Surface *startSurface=nullptr, const Surface *endSurface=nullptr, const ICompatibilityEstimator *ice=nullptr) const
get compatible surfaces starting from charged parameters
void compactify(size_t &cSurfaces, size_t &tSurfaces)
register layer index for material map registration
Definition Layer.cxx:186
SurfaceArray * surfaceArray()
Return the entire SurfaceArray, returns nullptr if no SurfaceArray.
int layerType() const
get the Layer coding
virtual const Surface & surfaceRepresentation() const =0
Transforms the layer into a Surface representation for extrapolation.
void registerRepresentingVolume(const Volume *theVol)
register Volume associated to the layer
const OverlapDescriptor * overlapDescriptor() const
gettint hte overlap descriptor
const Layer * previousLayer(bool skipNavLayer=false) const
getting what's stored to be the previous Layer, boolean to skip navigation layers
Definition Layer.cxx:141
virtual Surface & surfaceRepresentation()=0
size_t getCompatibleSurfaces(std::vector< SurfaceIntersection > &cSurfaces, const T &pars, PropDirection pdir, const BoundaryCheck &bcheck, bool materialSurfacesOnly=true, const Surface *startSurface=nullptr, const Surface *endSurface=nullptr, const ICompatibilityEstimator *ice=nullptr) const
get compatible surfaces starting from charged parameters
virtual ~Layer()=default
Destructor.
void setRef(double)
set the reference measure
Layer()=default
Default Constructor.
const MaterialProperties * fullUpdateMaterialProperties(const TrackParameters &par) const
getting the MaterialProperties back - for full update
Definition Layer.cxx:169
virtual bool isOnLayer(const Amg::Vector3D &gp, const BoundaryCheck &bcheck=BoundaryCheck(true)) const
isOnLayer() method, using isOnSurface() with Layer specific tolerance
Definition Layer.cxx:135
void setNextLayer(const Layer *)
set the next Layer
const Volume * representingVolume() const
get the Volume associated to the layer
LayerIndex m_index
LayerIndex.
Definition Layer.h:306
const Layer * m_previousLayer
< the previous Layer according to BinGenUtils
Definition Layer.h:296
const Layer * nextLayer(const Amg::Vector3D &gp, const Amg::Vector3D &udir) const
getting the next/previous Layer if registered - unit for direction vector required
Definition Layer.cxx:161
const SurfaceArray * surfaceArray() const
Return the entire SurfaceArray, returns nullptr if no SurfaceArray.
size_t compatibleSurfaces(std::vector< SurfaceIntersection > &cSurfaces, const NeutralParameters &pars, PropDirection pdir, const BoundaryCheck &bcheck, bool materialSurfacesOnly=true, const Surface *startSurface=nullptr, const Surface *endSurface=nullptr, const ICompatibilityEstimator *ice=nullptr) const
get compatible surfaces starting from neutral parameters
const LayerMaterialProperties * layerMaterialProperties() const
getting the LayerMaterialProperties including full/pre/post update
void registerLayerIndex(const LayerIndex &lIdx)
std::unique_ptr< OverlapDescriptor > m_overlapDescriptor
Definition Layer.h:292
void encloseTrackingVolume(const TrackingVolume &tvol)
private method to set the enclosed detached TV
const LayerIndex & layerIndex() const
get the layerIndex
virtual void resizeAndRepositionLayer(const VolumeBounds &vBounds, const Amg::Vector3D &vCenter, double envelope=1.)=0
resize and reposition layer : dedicated for entry layers
const Layer * m_nextLayer
BinUtility for next/previous decision.
Definition Layer.h:298
void setPreviousLayer(const Layer *)
set the previous Layer
double m_layerThickness
descriptor for overlap/next surface (owning ptr)
Definition Layer.h:290
virtual double postUpdateMaterialFactor(const TrackParameters &, PropDirection) const
getting the MaterialProperties back - for pre-update
Definition Layer.h:150
virtual double preUpdateMaterialFactor(const TrackParameters &, PropDirection) const
getting the MaterialProperties back - for pre-update
Definition Layer.h:144
double thickness() const
Return the Thickness of the Layer.
void encloseDetachedTrackingVolume(const DetachedTrackingVolume &tvol)
const DetachedTrackingVolume * m_enclosingDetachedTrackingVolume
Definition Layer.h:304
bool onLayer(const T &parameters, const BoundaryCheck &bcheck=BoundaryCheck(true)) const
templated on Layer method
const TrackingVolume * enclosingTrackingVolume() const
get the confining TrackingVolume
Layer & operator=(const Layer &lay)
Assignment operator for Derived classes.
Definition Layer.cxx:84
void setBinUtility(const BinUtility *)
set the BinUtility
double getRef() const
get the reference measure
const BinUtility * m_binUtility
Enclosing TrackingVolume.
Definition Layer.h:300
void setLayerType(int identifier)
set the Layer coding
virtual bool hasSubStructure(bool resolveSensitive=false) const
Has sub-structure method:
Definition Layer.cxx:238
virtual void resizeLayer(const VolumeBounds &, double)=0
private method to set enclosing TrackingVolume, called by friend class only optionally,...
int m_layerType
active passive layer
Definition Layer.h:307
const Surface * subSurface(const Amg::Vector3D &gp) const
If no subSurface array is defined or no subSurface can be found to the given Amg::Vector3D,...
Definition Layer.cxx:107
const DetachedTrackingVolume * enclosingDetachedTrackingVolume() const
get the confining DetachedTrackingVolume
double m_ref
reference measure for local coordinate convertors
Definition Layer.h:308
virtual void moveLayer(Amg::Transform3D &)=0
move the Layer
std::unique_ptr< LayerMaterialProperties > m_layerMaterialProperties
thickness of the Layer
Definition Layer.h:288
virtual const Surface & surfaceOnApproach(const Amg::Vector3D &pos, const Amg::Vector3D &dir, PropDirection pdir, const BoundaryCheck &bcheck, bool resolveSubSurfaces=0, const ICompatibilityEstimator *ice=nullptr) const
Surface seen on approach - if not defined differently, it is the surfaceRepresentation()
Definition Layer.cxx:209
const TrackingVolume * m_enclosingTrackingVolume
Enclosing DetachedTrackingVolume.
Definition Layer.h:302
std::unique_ptr< SurfaceArray > m_surfaceArray
MaterialPoperties of this layer Surface.
Definition Layer.h:286
const BinUtility * binUtility() const
access the BinUtility
const Surface * subSurfaceReference(unsigned int idx=0) const
Return a reference sub surface of the layer, usually the first one in the array.
Definition Layer.cxx:117
Material with information about thickness of material.
class extensions to return also the object
BaseClass to be overloaded for describing overlaps and next-by elements for the sub-detector implemen...
Abstract Base Class for tracking surfaces.
Full Volume description used in Tracking, it inherits from Volume to get the geometrical structure,...
Pure Absract Base Class for Volume bounds.
Base class for all volumes inside the tracking realm, it defines the interface for inherited Volume c...
Definition Volume.h:36
Eigen::Affine3d Transform3D
Eigen::Matrix< double, 2, 1 > Vector2D
Eigen::Matrix< double, 3, 1 > Vector3D
Ensure that the ATLAS eigen extensions are properly loaded.
PropDirection
PropDirection, enum for direction of the propagation.
BinnedArray< Surface > SurfaceArray
Definition Layer.h:40
ParametersBase< NeutralParametersDim, Neutral > NeutralParameters
ObjectIntersection< Surface > SurfaceIntersection
Definition Layer.h:39
ParametersBase< TrackParametersDim, Charged > TrackParameters
LayerType
For readability.
Definition Layer.h:47
@ passive
Definition Layer.h:47
@ active
Definition Layer.h:47