ATLAS Offline Software
Layer.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2023 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
26 
27 #include <memory>
28 
29 namespace Trk {
30 
31 class Surface;
32 class MaterialProperties;
33 class BinUtility;
34 class Volume;
35 class VolumeBounds;
36 class TrackingVolume;
37 class DetachedTrackingVolume;
38 class ICompatibilityEstimator;
39 
42 
48 enum LayerType { passive = 0, active = 1 };
49 
73 class Layer {
74  public:
76  Layer();
77 
79  Layer(const LayerMaterialProperties& laymatprop, double thickness = 0.,
80  std::unique_ptr<OverlapDescriptor> od = nullptr,
81  int ltype = int(passive));
82 
84  Layer(std::unique_ptr<SurfaceArray> surfaceArray, double thickness = 0.,
85  std::unique_ptr<OverlapDescriptor> = nullptr, int ltype = int(passive));
86 
89  Layer(std::unique_ptr<SurfaceArray> surfaceArray, const LayerMaterialProperties& laymatprop,
90  double thickness = 0., std::unique_ptr<OverlapDescriptor> od = nullptr,
91  int ltype = int(passive));
92 
94  virtual ~Layer() = default;
95 
97  const SurfaceArray* surfaceArray() const;
98 
101 
105  const Surface* subSurface(const Amg::Vector3D& gp) const;
106 
110  const Surface* subSurface(const Amg::Vector2D& lp) const;
111 
117  const Surface* subSurfaceReference(unsigned int idx = 0) const;
118 
120  virtual const Surface& surfaceRepresentation() const = 0;
122 
123 
125  double thickness() const;
126 
128  template <class T>
129  bool onLayer(const T& parameters,
130  const BoundaryCheck& bcheck = BoundaryCheck(true)) const;
131 
133  virtual bool isOnLayer(
134  const Amg::Vector3D& gp,
135  const BoundaryCheck& bcheck = BoundaryCheck(true)) const;
136 
139 
142  const TrackParameters& par) const;
143 
146  PropDirection) const {
147  return 1.;
148  }
149 
152  PropDirection) const {
153  return 0.;
154  }
155 
160  const Layer* previousLayer(bool skipNavLayer = false) const;
162  void setPreviousLayer(const Layer*);
163 
166  const Layer* nextLayer(const Amg::Vector3D& gp,
167  const Amg::Vector3D& udir) const;
170  const Layer* nextLayer(bool skipNavLayer = false) const;
172  void setNextLayer(const Layer*);
173 
175  const BinUtility* binUtility() const;
177  void setBinUtility(const BinUtility*);
178 
181  virtual const Surface& surfaceOnApproach(
183  const BoundaryCheck& bcheck, bool resolveSubSurfaces = 0,
184  const ICompatibilityEstimator* ice = nullptr) const;
185 
187  size_t compatibleSurfaces(std::vector<SurfaceIntersection>& cSurfaces,
189  const BoundaryCheck& bcheck,
190  bool materialSurfacesOnly = true,
191  const Surface* startSurface = nullptr,
192  const Surface* endSurface = nullptr,
193  const ICompatibilityEstimator* ice = nullptr) const;
194 
196  size_t compatibleSurfaces(std::vector<SurfaceIntersection>& cSurfaces,
198  const BoundaryCheck& bcheck,
199  bool materialSurfacesOnly = true,
200  const Surface* startSurface = nullptr,
201  const Surface* endSurface = nullptr,
202  const ICompatibilityEstimator* ice = nullptr) const;
203 
208  virtual bool hasSubStructure(bool resolveSensitive = false) const;
209 
212 
215 
217  const LayerIndex& layerIndex() const;
218 
220  int layerType() const;
221 
224 
227  double scale = 1.0);
228 
230  virtual void moveLayer(Amg::Transform3D&) = 0;
231 
233  void registerRepresentingVolume(const Volume* theVol);
234 
236  const Volume* representingVolume() const;
237 
239  void setRef(double);
240 
242  double getRef() const;
243 
247 
249  template <class T>
251  std::vector<SurfaceIntersection>& cSurfaces, const T& pars,
252  PropDirection pdir, const BoundaryCheck& bcheck,
253  bool materialSurfacesOnly = true, const Surface* startSurface = nullptr,
254  const Surface* endSurface = nullptr,
255  const ICompatibilityEstimator* ice = nullptr) const;
256 
258  void compactify(size_t& cSurfaces, size_t& tSurfaces);
259 
261  void registerLayerIndex(const LayerIndex& lIdx);
262 
273  virtual void resizeLayer(const VolumeBounds&, double) = 0;
274 
276  virtual void resizeAndRepositionLayer(const VolumeBounds& vBounds,
277  const Amg::Vector3D& vCenter,
278  double envelope = 1.) = 0;
279 
280  protected:
282  Layer(const Layer& lay);
284  Layer& operator=(const Layer& lay);
285 
287  std::unique_ptr<SurfaceArray> m_surfaceArray;
289  std::unique_ptr<LayerMaterialProperties> m_layerMaterialProperties;
293  std::unique_ptr<OverlapDescriptor> m_overlapDescriptor;
294 
295  // These are stored by not owning pointers belong to the Volume
306 
309  double m_ref;
310 };
311 
312 } // namespace Trk
313 #include "Layer.icc"
314 #endif // TRKGEOMETRY_LAYER_H
315 
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:149
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:151
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:183
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:297
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:289
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:293
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:287
OverlapDescriptor.h
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:200
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:131
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:145
Trk::Layer::moveLayer
virtual void moveLayer(Amg::Transform3D &)=0
move the Layer
Trk::passive
@ passive
Definition: Layer.h:48
Trk::Layer::surfaceArray
const SurfaceArray * surfaceArray() const
Return the entire SurfaceArray, returns nullptr if no SurfaceArray.
GeoPrimitives.h
Trk::VolumeBounds
Definition: VolumeBounds.h:45
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:121
Trk::Layer::assignMaterialProperties
void assignMaterialProperties(const LayerMaterialProperties &, double scale=1.0)
assignMaterialPropeties
Definition: Layer.cxx:191
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:48
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:308
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:98
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:175
Trk::Layer::m_enclosingTrackingVolume
const TrackingVolume * m_enclosingTrackingVolume
Enclosing DetachedTrackingVolume.
Definition: Layer.h:303
Trk::Layer::m_ref
double m_ref
reference measure for local coordinate convertors
Definition: Layer.h:309
Trk::Layer::hasSubStructure
virtual bool hasSubStructure(bool resolveSensitive=false) const
Has sub-structure method:
Definition: Layer.cxx:252
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,...
SharedObject.h
Trk::SurfaceIntersection
ObjectIntersection< Surface > SurfaceIntersection
Definition: Layer.h:38
LayerIndex.h
beamspotman.dir
string dir
Definition: beamspotman.py:623
Trk::BinUtility
Definition: BinUtility.h:39
Trk::Layer::Layer
Layer()
Default Constructor.
Definition: Layer.cxx:18
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:29
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:299
Trk::OverlapDescriptor
Definition: OverlapDescriptor.h:41
python.LumiBlobConversion.pos
pos
Definition: LumiBlobConversion.py:18
Trk::Layer::binUtility
const BinUtility * binUtility() const
access the BinUtility
Trk::Layer::m_binUtility
const BinUtility * m_binUtility
Enclosing TrackingVolume.
Definition: Layer.h:301
Layer.icc
Trk::SurfaceArray
BinnedArray< Surface > SurfaceArray
Definition: Layer.h:41
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:155
Trk::Layer::m_index
LayerIndex m_index
LayerIndex.
Definition: Layer.h:307
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:291
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:180
Trk::BinnedArray
Definition: BinnedArray.h:38
Trk::LayerType
LayerType
Definition: Layer.h:48
Trk::DetachedTrackingVolume
Definition: DetachedTrackingVolume.h:46
Trk::Surface
Definition: Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/Surface.h:75
checker_macros.h
Define macros for attributes used to control the static checker.
Trk::Volume
Definition: Volume.h:35
Trk::TrackingVolume
Definition: TrackingVolume.h:121
Intersection.h
Trk::Layer::m_enclosingDetachedTrackingVolume
const DetachedTrackingVolume * m_enclosingDetachedTrackingVolume
Definition: Layer.h:305
LayerMaterialProperties.h
Trk::Layer
Definition: Layer.h:73
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:223