ATLAS Offline Software
Loading...
Searching...
No Matches
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
20class MsgStream;
21
22namespace Trk {
23
31
33{
34public:
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
74protected:
75 std::shared_ptr<const AreaExcluder> m_subtrVol{nullptr};
76 bool m_shared{true};
77};
78
79inline 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
102inline bool
104{
105 return m_shared;
106}
107
108inline const AreaExcluder*
110{
111 return m_subtrVol.get();
112}
113
114} // end of namespace
115
116#endif // TRKGEOMETRYSURFACES_SUBTRACTEDDISCSURFACE_H
Pure abstract base class.
DiscSurface()
Default Constructor.
const SurfaceBounds & bounds() const override final
This method returns the bounds by reference.
SubtractedDiscSurface & operator=(SubtractedDiscSurface &&)=default
SubtractedDiscSurface()=default
Defaults.
virtual ~SubtractedDiscSurface()=default
std::shared_ptr< const AreaExcluder > m_subtrVol
virtual bool operator==(const Surface &sf) const override
Equality operator.
SubtractedDiscSurface(const SubtractedDiscSurface &psf)
Copy Constructor.
SubtractedDiscSurface & operator=(const SubtractedDiscSurface &psf)
Assignment operator.
const AreaExcluder * subtractedVolume() const
This method allows access to the subtracted part.
bool shared() const
This method indicates the subtraction mode.
SubtractedDiscSurface(SubtractedDiscSurface &&)=default
virtual std::string name() const override final
Return properly formatted class name for screen output.
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.
Abstract Base Class for tracking surfaces.
Eigen::Affine3d Transform3D
Eigen::Matrix< double, 2, 1 > Vector2D
Eigen::Matrix< double, 3, 1 > Vector3D
Ensure that the ATLAS eigen extensions are properly loaded.
@ locR
Definition ParamDefs.h:44
@ locPhi
local polar
Definition ParamDefs.h:45
STL namespace.