ATLAS Offline Software
SubtractedDiscSurface.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 // 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 
33 {
34 public:
36  SubtractedDiscSurface() = default;
39  virtual ~SubtractedDiscSurface() = default;
40 
42  SubtractedDiscSurface(const DiscSurface& ps, std::shared_ptr<const AreaExcluder> vol, bool shared);
43 
46 
49  const Amg::Transform3D& shift);
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:
75  std::shared_ptr<const AreaExcluder> m_subtrVol{nullptr};
76  bool m_shared{true};
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 
108 inline const AreaExcluder*
110 {
111  return m_subtrVol.get();
112 }
113 
114 } // end of namespace
115 
116 #endif // TRKGEOMETRYSURFACES_SUBTRACTEDDISCSURFACE_H
AreaExcluder.h
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:44
Trk::SubtractedDiscSurface::m_subtrVol
std::shared_ptr< const AreaExcluder > m_subtrVol
Definition: SubtractedDiscSurface.h:75
drawFromPickle.cos
cos
Definition: drawFromPickle.py:36
const
bool const RAWDATA *ch2 const
Definition: LArRodBlockPhysicsV0.cxx:560
ParamDefs.h
Trk::SubtractedDiscSurface::subtractedVolume
const AreaExcluder * subtractedVolume() const
This method allows access to the subtracted part.
Definition: SubtractedDiscSurface.h:109
GeoPrimitives.h
Trk::SubtractedDiscSurface::operator=
SubtractedDiscSurface & operator=(const SubtractedDiscSurface &psf)
Assignment operator.
python.SystemOfUnits.ps
float ps
Definition: SystemOfUnits.py:150
Amg::Transform3D
Eigen::Affine3d Transform3D
Definition: GeoPrimitives.h:46
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::SubtractedDiscSurface::SubtractedDiscSurface
SubtractedDiscSurface()=default
Defaults.
Trk::SubtractedDiscSurface::SubtractedDiscSurface
SubtractedDiscSurface(SubtractedDiscSurface &&)=default
Trk::AreaExcluder
Definition: AreaExcluder.h:26
columnar::final
CM final
Definition: ColumnAccessor.h:106
Trk
Ensure that the ATLAS eigen extensions are properly loaded.
Definition: FakeTrackBuilder.h:9
Trk::SubtractedDiscSurface::SubtractedDiscSurface
SubtractedDiscSurface(const SubtractedDiscSurface &psf)
Copy Constructor.
Trk::locPhi
@ locPhi
local polar
Definition: ParamDefs.h:45
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
Trk::inside
@ inside
Definition: PropDirection.h:29
mapkey::sf
@ sf
Definition: TElectronEfficiencyCorrectionTool.cxx:38
DiscSurface.h
Trk::SubtractedDiscSurface::~SubtractedDiscSurface
virtual ~SubtractedDiscSurface()=default
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:40
drawFromPickle.sin
sin
Definition: drawFromPickle.py:36
Trk::SubtractedDiscSurface::operator=
SubtractedDiscSurface & operator=(SubtractedDiscSurface &&)=default
Trk::Surface
Definition: Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/Surface.h:79
Trk::SubtractedDiscSurface::m_shared
bool m_shared
Definition: SubtractedDiscSurface.h:76