ATLAS Offline Software
SubtractedDiscSurface.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 // SubtractedDiscSurface.h, (c) ATLAS Detector software
8 
9 #ifndef TRKGEOMETRYSURFACES_SUBTRACTEDDISCSURFACE_H
10 #define TRKGEOMETRYSURFACES_SUBTRACTEDDISCSURFACE_H
11 
12 // Trk
16 
17 // Geometry & Maths
19 
20 class MsgStream;
21 
22 namespace Trk {
23 
32 class SubtractedDiscSurface final : public DiscSurface
33 {
34 public:
37 
40 
43  const Amg::Transform3D& shift);
44 
47 
50 
53 
55  virtual bool operator==(const Surface& sf) const override;
56 
58  bool shared() const;
59 
61  virtual bool insideBounds(const Amg::Vector2D& locpos,
62  double tol1 = 0.,
63  double tol2 = 0.) const override final;
64 
67 
69  virtual std::string name() const override final
70  {
71  return "Trk::SubtractedDiscSurface";
72  }
73 
74 protected:
76  bool m_shared;
77 };
78 
79 inline bool
81  double tol1,
82  double tol2) const
83 {
84  // no subtracted Volume exists
85  if (!m_subtrVol.get()) {
86  return (this->bounds().inside(locpos, tol1, tol2));
87  }
88  // subtracted Volume exists, needs to be checked
89  double rPos = locpos[Trk::locR];
90  double phiPos = locpos[Trk::locPhi];
91  Amg::Vector3D gp(rPos * cos(phiPos), rPos * sin(phiPos), 0.);
92  if (m_shared) {
93  return (this->bounds().inside(locpos, tol1, tol2) &&
94  m_subtrVol.get()->inside(gp, 0.));
95  }
96  bool in(this->bounds().inside(locpos, tol1, tol2) &&
97  !m_subtrVol.get()->inside(gp, 0.));
98 
99  return in;
100 }
101 
102 inline bool
104 {
105  return m_shared;
106 }
107 
110 {
111  return m_subtrVol;
112 }
113 
114 } // end of namespace
115 
116 #endif // TRKGEOMETRYSURFACES_SUBTRACTEDDISCSURFACE_H
AreaExcluder.h
Trk::SubtractedDiscSurface::~SubtractedDiscSurface
virtual ~SubtractedDiscSurface()
Destructor.
Amg::Vector2D
Eigen::Matrix< double, 2, 1 > Vector2D
Definition: GeoPrimitives.h:48
Trk::SubtractedDiscSurface
Definition: SubtractedDiscSurface.h:33
Trk::DiscSurface
Definition: DiscSurface.h:54
Trk::locR
@ locR
Definition: ParamDefs.h:50
drawFromPickle.cos
cos
Definition: drawFromPickle.py:36
const
bool const RAWDATA *ch2 const
Definition: LArRodBlockPhysicsV0.cxx:562
ParamDefs.h
GeoPrimitives.h
Trk::SubtractedDiscSurface::operator=
SubtractedDiscSurface & operator=(const SubtractedDiscSurface &psf)
Assignment operator.
Definition: SubtractedDiscSurface.cxx:47
Amg::Transform3D
Eigen::Affine3d Transform3D
Definition: GeoPrimitives.h:46
Trk::SubtractedDiscSurface::subtractedVolume
SharedObject< AreaExcluder > subtractedVolume() const
This method allows access to the subtracted part.
Definition: SubtractedDiscSurface.h:109
Trk::DiscSurface::bounds
const SurfaceBounds & bounds() const override final
This method returns the bounds by reference.
Trk::SubtractedDiscSurface::shared
bool shared() const
This method indicates the subtraction mode.
Definition: SubtractedDiscSurface.h:103
Trk::SubtractedDiscSurface::name
virtual std::string name() const override final
Return properly formatted class name for screen output.
Definition: SubtractedDiscSurface.h:69
Trk::AreaExcluder
Definition: AreaExcluder.h:26
Trk
Ensure that the ATLAS eigen extensions are properly loaded.
Definition: FakeTrackBuilder.h:9
Trk::SubtractedDiscSurface::SubtractedDiscSurface
SubtractedDiscSurface(const SubtractedDiscSurface &psf)
Copy Constructor.
Trk::SubtractedDiscSurface::m_subtrVol
SharedObject< AreaExcluder > m_subtrVol
Definition: SubtractedDiscSurface.h:75
Trk::locPhi
@ locPhi
local polar
Definition: ParamDefs.h:51
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
Trk::SubtractedDiscSurface::SubtractedDiscSurface
SubtractedDiscSurface()
Default Constructor - needed for persistency.
Definition: SubtractedDiscSurface.cxx:18
Trk::inside
@ inside
Definition: PropDirection.h:29
Trk::SharedObject
std::shared_ptr< T > SharedObject
Definition: SharedObject.h:24
mapkey::sf
@ sf
Definition: TElectronEfficiencyCorrectionTool.cxx:38
DiscSurface.h
Trk::SubtractedDiscSurface::insideBounds
virtual bool insideBounds(const Amg::Vector2D &locpos, double tol1=0., double tol2=0.) const override final
This method calls the inside() method of the Bounds.
Definition: SubtractedDiscSurface.h:80
Trk::SubtractedDiscSurface::operator==
virtual bool operator==(const Surface &sf) const override
Equality operator.
Definition: SubtractedDiscSurface.cxx:59
drawFromPickle.sin
sin
Definition: drawFromPickle.py:36
Trk::Surface
Definition: Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/Surface.h:75
Trk::SubtractedDiscSurface::m_shared
bool m_shared
Definition: SubtractedDiscSurface.h:76