ATLAS Offline Software
MaterialLayer.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 // MaterialLayer.cxx, (c) ATLAS Detector software
8 
10 
12 #include "TrkSurfaces/Surface.h"
13 
14 // constructor with arguments
16  const LayerMaterialProperties& mlprop)
17  : Trk::Layer(),
18  // m_surfaceRepresentation(SharedObject<const
19  // Surface>(&surfaceRepresentation,true))
20 
21  /*
22  * The above line was setting the not delete ndel to true
23  * do the same with no-op deleter for shared_ptr
24  * Probably ownership might need some clean up here
25  */
26  m_surfaceRepresentation(SharedObject<Surface>(
27  &surfaceRepresentation, do_not_delete<Surface>)) {
28  m_layerMaterialProperties.reset(mlprop.clone());
29  m_layerThickness = 1.;
30 }
31 
32 // constructor with arguments
34  const SharedObject<Surface>& surfaceRepresentation,
35  const LayerMaterialProperties& mlprop)
36  : Trk::Layer(), m_surfaceRepresentation(surfaceRepresentation) {
37  m_layerMaterialProperties.reset(mlprop.clone());
38  m_layerThickness = 1.;
39 }
40 
41 // copy constructor
43  : Trk::Layer(lay), m_surfaceRepresentation(lay.m_surfaceRepresentation) {
44  m_layerThickness = 1.;
45 }
46 
47 // destructor
49 
51  const Trk::MaterialLayer& lay) {
52  if (this != &lay) {
54  m_surfaceRepresentation = lay.m_surfaceRepresentation;
55  }
56  return (*this);
57 }
58 
60  const BoundaryCheck& bcheck) const {
61  return m_surfaceRepresentation.get()->isOnSurface(gp, bcheck);
62 }
63 
Trk::MaterialLayer::MaterialLayer
MaterialLayer()
Default Constructor.
Definition: MaterialLayer.h:84
Surface.h
Trk::Layer::m_layerMaterialProperties
std::unique_ptr< LayerMaterialProperties > m_layerMaterialProperties
thickness of the Layer
Definition: Layer.h:289
Trk::MaterialLayer::operator=
MaterialLayer & operator=(const MaterialLayer &lay)
Assignment operator.
Definition: MaterialLayer.cxx:50
Trk::do_not_delete
const auto do_not_delete
Definition: SharedObject.h:27
Trk::MaterialLayer::~MaterialLayer
virtual ~MaterialLayer() override
Destructor.
Trk::LayerMaterialProperties
Definition: LayerMaterialProperties.h:62
Trk::Layer::operator=
Layer & operator=(const Layer &lay)
Assignment operator for Derived classes.
Definition: Layer.cxx:98
Trk::MaterialLayer::m_surfaceRepresentation
SharedObject< Surface > m_surfaceRepresentation
for the navigation Volume the surface is a private member *‍/
Definition: MaterialLayer.h:79
Trk
Ensure that the ATLAS eigen extensions are properly loaded.
Definition: FakeTrackBuilder.h:9
MaterialLayer.h
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
Trk::SharedObject
std::shared_ptr< T > SharedObject
Definition: SharedObject.h:24
Trk::BoundaryCheck
Definition: BoundaryCheck.h:51
Trk::MaterialLayer::isOnLayer
virtual bool isOnLayer(const Amg::Vector3D &gp, const BoundaryCheck &bcheck=BoundaryCheck(true)) const override final
isOnLayer() method, using isOnSurface() with Layer specific tolerance
Definition: MaterialLayer.cxx:59
Trk::LayerMaterialProperties::clone
virtual LayerMaterialProperties * clone() const =0
Pseudo-Constructor clone()
Trk::Layer::m_layerThickness
double m_layerThickness
descriptor for overlap/next surface (owning ptr)
Definition: Layer.h:291
Trk::MaterialLayer
Definition: MaterialLayer.h:37
Trk::Surface
Definition: Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/Surface.h:75
LayerMaterialProperties.h
Trk::Layer
Definition: Layer.h:73