ATLAS Offline Software
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 
12 class MsgStream;
13 
14 // Amg
16 // Trk
25 //
26 #include <memory>
27 
28 namespace Trk {
29 
30 class Surface;
31 class MaterialProperties;
32 class BinUtility;
33 class Volume;
34 class VolumeBounds;
35 class TrackingVolume;
36 class DetachedTrackingVolume;
37 class ICompatibilityEstimator;
38 
41 
47 enum LayerType { passive = 0, active = 1 };
48 
72 class 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;
161  void setPreviousLayer(const Layer*);
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;
176  void setBinUtility(const BinUtility*);
177 
180  virtual const Surface& surfaceOnApproach(
182  const BoundaryCheck& bcheck, bool resolveSubSurfaces = 0,
183  const ICompatibilityEstimator* ice = nullptr) const;
184 
186  size_t compatibleSurfaces(std::vector<SurfaceIntersection>& cSurfaces,
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,
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 
223 
226  double scale = 1.0);
227 
229  virtual void moveLayer(Amg::Transform3D&) = 0;
230 
232  void registerRepresentingVolume(const Volume* theVol);
233 
235  const Volume* representingVolume() const;
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 
260  void registerLayerIndex(const LayerIndex& lIdx);
261 
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 
Trk::Layer::setRef
void setRef(double)
set the reference measure
make_hlt_rep.pars
pars
Definition: make_hlt_rep.py:90
Trk::Layer::isOnLayer
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
Trk::Layer::setPreviousLayer
void setPreviousLayer(const Layer *)
set the previous Layer
Trk::Layer::postUpdateMaterialFactor
virtual double postUpdateMaterialFactor(const TrackParameters &, PropDirection) const
getting the MaterialProperties back - for pre-update
Definition: Layer.h:150
Trk::Layer::setNextLayer
void setNextLayer(const Layer *)
set the next Layer
Trk::Layer::fullUpdateMaterialProperties
const MaterialProperties * fullUpdateMaterialProperties(const TrackParameters &par) const
getting the MaterialProperties back - for full update
Definition: Layer.cxx:169
Trk::Layer::onLayer
bool onLayer(const T &parameters, const BoundaryCheck &bcheck=BoundaryCheck(true)) const
templated on Layer method
TrackParameters.h
Trk::Layer::setBinUtility
void setBinUtility(const BinUtility *)
set the BinUtility
Trk::Layer::setLayerType
void setLayerType(int identifier)
set the Layer coding
Trk::Layer::m_previousLayer
const Layer * m_previousLayer
< the previous Layer according to BinGenUtils
Definition: Layer.h:296
Amg::Vector2D
Eigen::Matrix< double, 2, 1 > Vector2D
Definition: GeoPrimitives.h:48
Trk::Layer::m_layerMaterialProperties
std::unique_ptr< LayerMaterialProperties > m_layerMaterialProperties
thickness of the Layer
Definition: Layer.h:288
BinnedArray.h
Trk::Layer::encloseTrackingVolume
void encloseTrackingVolume(const TrackingVolume &tvol)
private method to set the enclosed detached TV
Trk::Layer::m_overlapDescriptor
std::unique_ptr< OverlapDescriptor > m_overlapDescriptor
Definition: Layer.h:292
Trk::Layer::getRef
double getRef() const
get the reference measure
Trk::Layer::m_surfaceArray
std::unique_ptr< SurfaceArray > m_surfaceArray
MaterialPoperties of this layer Surface.
Definition: Layer.h:286
OverlapDescriptor.h
Trk::Layer::Layer
Layer()=default
Default Constructor.
Trk::Layer::compatibleSurfaces
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
Surface
Definition: Trigger/TrigAccel/TrigCudaFitter/src/Surface.h:8
Trk::Layer::overlapDescriptor
const OverlapDescriptor * overlapDescriptor() const
gettint hte overlap descriptor
Trk::Layer::compactify
void compactify(size_t &cSurfaces, size_t &tSurfaces)
register layer index for material map registration
Definition: Layer.cxx:186
Trk::ObjectIntersection
class extensions to return also the object
Definition: Intersection.h:44
Trk::Layer::enclosingDetachedTrackingVolume
const DetachedTrackingVolume * enclosingDetachedTrackingVolume() const
get the confining DetachedTrackingVolume
NeutralParameters.h
xAOD::identifier
identifier
Definition: UncalibratedMeasurement_v1.cxx:15
Trk::Layer::subSurfaceReference
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
Trk::Layer::representingVolume
const Volume * representingVolume() const
get the Volume associated to the layer
yodamerge_tmp.scale
scale
Definition: yodamerge_tmp.py:138
Trk::Layer::compatibleSurfaces
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
Trk::Layer::layerType
int layerType() const
get the Layer coding
Trk::Layer::preUpdateMaterialFactor
virtual double preUpdateMaterialFactor(const TrackParameters &, PropDirection) const
getting the MaterialProperties back - for pre-update
Definition: Layer.h:144
Trk::Layer::moveLayer
virtual void moveLayer(Amg::Transform3D &)=0
move the Layer
Trk::passive
@ passive
Definition: Layer.h:47
Trk::Layer::surfaceArray
const SurfaceArray * surfaceArray() const
Return the entire SurfaceArray, returns nullptr if no SurfaceArray.
GeoPrimitives.h
Trk::VolumeBounds
Definition: VolumeBounds.h:46
Trk::Layer::subSurface
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
Trk::Layer::assignMaterialProperties
void assignMaterialProperties(const LayerMaterialProperties &, double scale=1.0)
assignMaterialPropeties
Definition: Layer.cxx:177
Trk::PropDirection
PropDirection
Definition: PropDirection.h:19
Trk::Layer::surfaceRepresentation
virtual const Surface & surfaceRepresentation() const =0
Transforms the layer into a Surface representation for extrapolation.
Trk::active
@ active
Definition: Layer.h:47
Trk::LayerIndex
Definition: LayerIndex.h:37
Trk::Layer::surfaceArray
SurfaceArray * surfaceArray()
Return the entire SurfaceArray, returns nullptr if no SurfaceArray.
Trk::Layer::m_layerType
int m_layerType
active passive layer
Definition: Layer.h:307
Trk::LayerMaterialProperties
Definition: LayerMaterialProperties.h:62
Amg::Transform3D
Eigen::Affine3d Transform3D
Definition: GeoPrimitives.h:46
Trk::Layer::operator=
Layer & operator=(const Layer &lay)
Assignment operator for Derived classes.
Definition: Layer.cxx:84
Trk::Layer::nextLayer
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
Trk::Layer::m_enclosingTrackingVolume
const TrackingVolume * m_enclosingTrackingVolume
Enclosing DetachedTrackingVolume.
Definition: Layer.h:302
Trk::Layer::m_ref
double m_ref
reference measure for local coordinate convertors
Definition: Layer.h:308
Trk::Layer::hasSubStructure
virtual bool hasSubStructure(bool resolveSensitive=false) const
Has sub-structure method:
Definition: Layer.cxx:238
Trk::ParametersBase
Definition: ParametersBase.h:55
Trk::Layer::resizeLayer
virtual void resizeLayer(const VolumeBounds &, double)=0
private method to set enclosing TrackingVolume, called by friend class only optionally,...
Trk::SurfaceIntersection
ObjectIntersection< Surface > SurfaceIntersection
Definition: Layer.h:37
LayerIndex.h
beamspotman.dir
string dir
Definition: beamspotman.py:619
Trk::BinUtility
Definition: BinUtility.h:39
Trk::Layer::registerLayerIndex
void registerLayerIndex(const LayerIndex &lIdx)
Trk
Ensure that the ATLAS eigen extensions are properly loaded.
Definition: FakeTrackBuilder.h:9
Trk::Layer::resizeAndRepositionLayer
virtual void resizeAndRepositionLayer(const VolumeBounds &vBounds, const Amg::Vector3D &vCenter, double envelope=1.)=0
resize and reposition layer : dedicated for entry layers
createCoolChannelIdFile.par
par
Definition: createCoolChannelIdFile.py:28
Trk::Layer::registerRepresentingVolume
void registerRepresentingVolume(const Volume *theVol)
register Volume associated to the layer
Trk::Layer::thickness
double thickness() const
Return the Thickness of the Layer.
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
Trk::Layer::m_nextLayer
const Layer * m_nextLayer
BinUtility for next/previous decision.
Definition: Layer.h:298
Trk::OverlapDescriptor
Definition: OverlapDescriptor.h:41
python.LumiBlobConversion.pos
pos
Definition: LumiBlobConversion.py:16
Trk::Layer::binUtility
const BinUtility * binUtility() const
access the BinUtility
Trk::Layer::m_binUtility
const BinUtility * m_binUtility
Enclosing TrackingVolume.
Definition: Layer.h:300
Layer.icc
Trk::SurfaceArray
BinnedArray< Surface > SurfaceArray
Definition: Layer.h:40
Trk::MaterialProperties
Definition: MaterialProperties.h:40
Trk::Layer::getCompatibleSurfaces
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
Trk::BoundaryCheck
Definition: BoundaryCheck.h:51
Trk::Layer::previousLayer
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
Trk::Layer::m_index
LayerIndex m_index
LayerIndex.
Definition: Layer.h:306
Trk::Layer::enclosingTrackingVolume
const TrackingVolume * enclosingTrackingVolume() const
get the confining TrackingVolume
Trk::Layer::layerMaterialProperties
const LayerMaterialProperties * layerMaterialProperties() const
getting the LayerMaterialProperties including full/pre/post update
LArNewCalib_DelayDump_OFC_Cali.idx
idx
Definition: LArNewCalib_DelayDump_OFC_Cali.py:69
Trk::Layer::m_layerThickness
double m_layerThickness
descriptor for overlap/next surface (owning ptr)
Definition: Layer.h:290
Trk::Layer::surfaceRepresentation
virtual Surface & surfaceRepresentation()=0
physics_parameters.parameters
parameters
Definition: physics_parameters.py:144
LArNewCalib_Delay_OFC_Cali.pdir
string pdir
Definition: LArNewCalib_Delay_OFC_Cali.py:182
Trk::BinnedArray
Definition: BinnedArray.h:36
Trk::LayerType
LayerType
Definition: Layer.h:47
Trk::DetachedTrackingVolume
Definition: DetachedTrackingVolume.h:37
Trk::Surface
Definition: Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/Surface.h:79
checker_macros.h
Define macros for attributes used to control the static checker.
Trk::Volume
Definition: Volume.h:36
Trk::TrackingVolume
Definition: TrackingVolume.h:119
Intersection.h
Trk::Layer::m_enclosingDetachedTrackingVolume
const DetachedTrackingVolume * m_enclosingDetachedTrackingVolume
Definition: Layer.h:304
LayerMaterialProperties.h
Trk::Layer
Definition: Layer.h:72
Trk::Layer::layerIndex
const LayerIndex & layerIndex() const
get the layerIndex
Trk::Layer::encloseDetachedTrackingVolume
void encloseDetachedTrackingVolume(const DetachedTrackingVolume &tvol)
Trk::Layer::~Layer
virtual ~Layer()=default
Destructor.
Trk::Layer::surfaceOnApproach
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