ATLAS Offline Software
SubtractedCylinderSurface.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 // SubtractedCylinderSurface.cxx, (c) ATLAS Detector Software
8 
9 // Trk
11 // STD
12 #include <iomanip>
13 #include <iostream>
14 
15 // default constructor
17  : Trk::CylinderSurface()
18  , m_subtrVol()
19  , m_shared(true)
20 {}
21 
22 // copy constructor
24 
25 = default;
26 
27 // copy constructor with shift
29  const Amg::Transform3D& transf)
30  : Trk::CylinderSurface(psf, transf)
31  , m_subtrVol(psf.m_subtrVol)
32  , m_shared(psf.m_shared)
33 {}
34 
35 // constructor
37  AreaExcluder* vol,
38  bool shared)
39  : Trk::CylinderSurface(ps)
40  , m_subtrVol(Trk::SharedObject<Trk::AreaExcluder>(vol))
41  , m_shared(shared)
42 {}
43 
44 // destructor (will call destructor from base class which deletes objects)
46 
49 {
50 
51  if (this != &psf) {
53  m_subtrVol = psf.m_subtrVol;
54  m_shared = psf.m_shared;
55  }
56  return *this;
57 }
58 
59 bool
61 {
62  // first check the type not to compare apples with oranges
63  const Trk::SubtractedCylinderSurface* scsf = dynamic_cast<const Trk::SubtractedCylinderSurface*>(&sf);
64  if (!scsf)
65  return false;
66  bool surfaceEqual = Trk::CylinderSurface::operator==(sf);
67  bool sharedEqual = (surfaceEqual) ? (shared() == scsf->shared()) : false;
68  return sharedEqual;
69 }
Trk::SubtractedCylinderSurface::m_shared
bool m_shared
Definition: SubtractedCylinderSurface.h:78
Trk::SubtractedCylinderSurface::shared
bool shared() const
This method indicates the subtraction mode.
Trk::CylinderSurface::operator==
virtual bool operator==(const Surface &sf) const override
Equality operator.
Definition: CylinderSurface.cxx:179
Trk::SubtractedCylinderSurface::~SubtractedCylinderSurface
virtual ~SubtractedCylinderSurface()
Destructor.
Trk::SubtractedCylinderSurface
Definition: SubtractedCylinderSurface.h:33
Trk::SubtractedCylinderSurface::operator=
SubtractedCylinderSurface & operator=(const SubtractedCylinderSurface &psf)
Assignment operator.
Definition: SubtractedCylinderSurface.cxx:48
Trk::CylinderSurface
Definition: CylinderSurface.h:55
Amg::Transform3D
Eigen::Affine3d Transform3D
Definition: GeoPrimitives.h:46
SubtractedCylinderSurface.h
Trk::AreaExcluder
Definition: AreaExcluder.h:26
Trk::SubtractedCylinderSurface::SubtractedCylinderSurface
SubtractedCylinderSurface()
Default Constructor - needed for persistency.
Definition: SubtractedCylinderSurface.cxx:16
Trk::SubtractedCylinderSurface::operator==
virtual bool operator==(const Surface &sf) const override final
Equality operator.
Definition: SubtractedCylinderSurface.cxx:60
Trk::SubtractedCylinderSurface::m_subtrVol
SharedObject< AreaExcluder > m_subtrVol
Definition: SubtractedCylinderSurface.h:77
Trk
Ensure that the ATLAS eigen extensions are properly loaded.
Definition: FakeTrackBuilder.h:9
Trk::CylinderSurface::operator=
CylinderSurface & operator=(const CylinderSurface &csf)
Assignment operator.
Definition: CylinderSurface.cxx:115
Trk::SharedObject
std::shared_ptr< T > SharedObject
Definition: SharedObject.h:24
mapkey::sf
@ sf
Definition: TElectronEfficiencyCorrectionTool.cxx:38
Trk::Surface
Definition: Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/Surface.h:75