ATLAS Offline Software
Loading...
Searching...
No Matches
CylinderVolumeBounds.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// CylinderVolumeBounds.h, (c) ATLAS Detector software
8
9#ifndef TRKVOLUMES_CYLINDERVOLUMESBOUNDS_H
10#define TRKVOLUMES_CYLINDERVOLUMESBOUNDS_H
11
12// Trk
16
17class MsgStream;
18
19namespace Trk {
20
21class Surface;
22class DiscBounds;
23class CylinderBounds;
24class RectangleBounds;
25
69
71 public:
74
76 CylinderVolumeBounds(double radius, double halez);
77
79 CylinderVolumeBounds(double rinner, double router, double halez);
80
82 CylinderVolumeBounds(double rinner, double router, double halfPhiSector,
83 double halez);
84
87
90
93
95 CylinderVolumeBounds* clone() const override;
96
99 bool inside(const Amg::Vector3D&, double tol = 0.) const override final;
100
103 (const Amg::Transform3D& transform) override final;
104
107 const Amg::Vector3D& gp, const Amg::Vector3D& dir,
108 bool forceInside = false) const override final;
109
111 double innerRadius() const;
112
114 double outerRadius() const;
115
117 double mediumRadius() const;
118
120 double deltaRadius() const;
121
123 double halfPhiSector() const;
124
126 double halflengthZ() const;
127
129 MsgStream& dump(MsgStream& sl) const override final;
131 std::ostream& dump(std::ostream& sl) const override final;
132
133 private:
137
141
144 std::shared_ptr<DiscBounds> bottomDiscBounds() const;
145
148 std::shared_ptr<DiscBounds> topDiscBounds() const;
149
153
156
160 double m_halfZ;
161
166
169};
170
172 return new CylinderVolumeBounds(*this);
173}
174
176 double tol) const {
177 double ros = pos.perp();
178 // bool insidePhi = fabs(pos.phi()) <= m_halfPhiSector + tol;
179 bool insidePhi = cos(pos.phi()) >= cos(m_halfPhiSector) - tol;
180 bool insideR =
181 insidePhi ? ((ros >= m_innerRadius - tol) && (ros <= m_outerRadius + tol))
182 : false;
183 bool insideZ = insideR ? (fabs(pos.z()) <= m_halfZ + tol) : false;
184 return (insideZ && insideR && insidePhi);
185}
186
188 return m_innerRadius;
189}
190
192 return m_outerRadius;
193}
194
196 return 0.5 * (m_innerRadius + m_outerRadius);
197}
198
200 return (m_outerRadius - m_innerRadius);
201}
202
204 return m_halfPhiSector;
205}
206
207inline double CylinderVolumeBounds::halflengthZ() const { return m_halfZ; }
208
209inline std::shared_ptr<DiscBounds> CylinderVolumeBounds::topDiscBounds() const {
210 return this->bottomDiscBounds();
211}
212
213} // namespace Trk
214
215#endif // TRKVOLUMES_CYLINDERVOLUMESBOUNDS_H
216
Eigen::Affine3d Transform3D
Eigen::Matrix< double, 3, 1 > Vector3D
Bounds for a cylindrical Surface.
Different Accessor types for a cylindrical Volume, if returs accessors to the volume boundary surface...
double mediumRadius() const
This method returns the medium radius.
virtual std::vector< std::unique_ptr< Trk::Surface > > decomposeToSurfaces(const Amg::Transform3D &transform) override final
Method to decompose the Bounds into boundarySurfaces.
bool inside(const Amg::Vector3D &, double tol=0.) const override final
This method checks if position in the 3D volume frame is inside the cylinder.
CylinderVolumeBoundaryAccessors m_boundaryAccessors
Accessors for Boundary surface access - static is not possible due to mismatched delete() / free () w...
virtual ~CylinderVolumeBounds()
Destructor.
double innerRadius() const
This method returns the inner radius.
double halflengthZ() const
This method returns the halflengthZ.
double deltaRadius() const
This method returns the delta radius.
static const double s_numericalStable
numerical stability
std::shared_ptr< CylinderBounds > outerCylinderBounds() const
This method returns the associated CylinderBounds of the outer CylinderSurfaces.
void createBoundarySurfaceAccessors()
Private method to construct the accessors.
std::shared_ptr< DiscBounds > bottomDiscBounds() const
This method returns the associated DiscBounds for the bottom/top DiscSurface.
CylinderVolumeBounds & operator=(const CylinderVolumeBounds &cylbo)
Assignment operator.
CylinderVolumeBounds()
Default Constructor.
double outerRadius() const
This method returns the outer radius.
std::shared_ptr< DiscBounds > topDiscBounds() const
This method returns the associated DiscBounds for the bottom/top DiscSurface.
double halfPhiSector() const
This method returns the halfPhiSector angle.
CylinderVolumeBounds * clone() const override
Virtual constructor.
ObjectAccessor boundarySurfaceAccessor(const Amg::Vector3D &gp, const Amg::Vector3D &dir, bool forceInside=false) const override final
Provide accessor for BoundarySurfaces.
std::shared_ptr< CylinderBounds > innerCylinderBounds() const
This method returns the associated CylinderBounds of the inner CylinderSurfaces.
std::shared_ptr< RectangleBounds > sectorPlaneBounds() const
This method returns the associated PlaneBounds limiting a sectoral CylinderVolume.
Class to describe the bounds for a planar DiscSurface.
Definition DiscBounds.h:44
Bounds for a rectangular, planar surface.
Abstract Base Class for tracking surfaces.
VolumeBounds()
Default Constructor.
STL class.
STL class.
Definition of ATLAS Math & Geometry primitives (Amg)
Eigen::Matrix< double, 3, 1 > Vector3D
Ensure that the ATLAS eigen extensions are properly loaded.
-event-from-file
STL namespace.
#define private