ATLAS Offline Software
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 
17 class MsgStream;
18 
19 namespace Trk {
20 
21 class Surface;
22 class DiscBounds;
23 class CylinderBounds;
24 class RectangleBounds;
25 
70 class CylinderVolumeBounds final: public VolumeBounds {
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 
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 
145 
149 
153 
156 
160  double m_halfZ;
161 
166 
168  static const double s_numericalStable;
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 
187 inline double CylinderVolumeBounds::innerRadius() const {
188  return m_innerRadius;
189 }
190 
191 inline double CylinderVolumeBounds::outerRadius() const {
192  return m_outerRadius;
193 }
194 
195 inline double CylinderVolumeBounds::mediumRadius() const {
196  return 0.5 * (m_innerRadius + m_outerRadius);
197 }
198 
199 inline double CylinderVolumeBounds::deltaRadius() const {
200  return (m_outerRadius - m_innerRadius);
201 }
202 
203 inline double CylinderVolumeBounds::halfPhiSector() const {
204  return m_halfPhiSector;
205 }
206 
207 inline double CylinderVolumeBounds::halflengthZ() const { return m_halfZ; }
208 
210  return this->bottomDiscBounds();
211 }
212 
213 } // namespace Trk
214 
215 #endif // TRKVOLUMES_CYLINDERVOLUMESBOUNDS_H
216 
Trk::CylinderVolumeBounds::~CylinderVolumeBounds
virtual ~CylinderVolumeBounds()
Destructor.
Trk::RectangleBounds
Definition: RectangleBounds.h:38
CylinderVolumeBoundaryAccessors.h
Surface
Definition: Trigger/TrigAccel/TrigCudaFitter/src/Surface.h:8
Trk::CylinderVolumeBounds::m_halfZ
double m_halfZ
Definition: CylinderVolumeBounds.h:160
VolumeBounds.h
drawFromPickle.cos
cos
Definition: drawFromPickle.py:36
Trk::CylinderVolumeBounds::topDiscBounds
DiscBounds * topDiscBounds() const
This method returns the associated DiscBounds for the bottom/top DiscSurface.
Definition: CylinderVolumeBounds.h:209
const
bool const RAWDATA *ch2 const
Definition: LArRodBlockPhysicsV0.cxx:560
Trk::CylinderVolumeBounds::dump
MsgStream & dump(MsgStream &sl) const override final
Output Method for MsgStream.
Definition: CylinderVolumeBounds.cxx:380
Trk::CylinderVolumeBounds::inside
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.
Definition: CylinderVolumeBounds.h:175
Trk::CylinderVolumeBounds::m_halfPhiSector
double m_halfPhiSector
Definition: CylinderVolumeBounds.h:159
Trk::CylinderVolumeBoundaryAccessors
Definition: CylinderVolumeBoundaryAccessors.h:62
Trk::CylinderVolumeBounds::CylinderVolumeBounds
CylinderVolumeBounds()
Default Constructor.
Definition: CylinderVolumeBounds.cxx:30
GeoPrimitives.h
Trk::VolumeBounds
Definition: VolumeBounds.h:45
Trk::CylinderVolumeBounds::m_outerRadius
double m_outerRadius
Definition: CylinderVolumeBounds.h:158
Trk::CylinderVolumeBounds::boundarySurfaceAccessor
ObjectAccessor boundarySurfaceAccessor(const Amg::Vector3D &gp, const Amg::Vector3D &dir, bool forceInside=false) const override final
Provide accessor for BoundarySurfaces.
Definition: CylinderVolumeBounds.cxx:164
vector
Definition: MultiHisto.h:13
Trk::CylinderBounds
Definition: CylinderBounds.h:46
Trk::CylinderVolumeBounds::m_boundaryAccessors
CylinderVolumeBoundaryAccessors m_boundaryAccessors
Accessors for Boundary surface access - static is not possible due to mismatched delete() / free () w...
Definition: CylinderVolumeBounds.h:165
Amg::Transform3D
Eigen::Affine3d Transform3D
Definition: GeoPrimitives.h:46
Amg::transform
Amg::Vector3D transform(Amg::Vector3D &v, Amg::Transform3D &tr)
Transform a point from a Trasformation3D.
Definition: GeoPrimitivesHelpers.h:156
Trk::CylinderVolumeBounds::halflengthZ
double halflengthZ() const
This method returns the halflengthZ.
Definition: CylinderVolumeBounds.h:207
Trk::CylinderVolumeBounds::bottomDiscBounds
DiscBounds * bottomDiscBounds() const
This method returns the associated DiscBounds for the bottom/top DiscSurface.
Definition: CylinderVolumeBounds.cxx:365
maskDeadModules.ros
ros
Definition: maskDeadModules.py:35
Trk::CylinderVolumeBounds::m_innerRadius
double m_innerRadius
Definition: CylinderVolumeBounds.h:157
beamspotman.dir
string dir
Definition: beamspotman.py:623
Trk::CylinderVolumeBounds
Definition: CylinderVolumeBounds.h:70
Trk
Ensure that the ATLAS eigen extensions are properly loaded.
Definition: FakeTrackBuilder.h:9
Amg
Definition of ATLAS Math & Geometry primitives (Amg)
Definition: AmgStringHelpers.h:19
private
#define private
Definition: DetDescrConditionsDict_dict_fixes.cxx:13
Trk::CylinderVolumeBounds::outerRadius
double outerRadius() const
This method returns the outer radius.
Definition: CylinderVolumeBounds.h:191
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
Trk::CylinderVolumeBounds::outerCylinderBounds
CylinderBounds * outerCylinderBounds() const
This method returns the associated CylinderBounds of the outer CylinderSurfaces.
Definition: CylinderVolumeBounds.cxx:359
ParticleGun_SamplingFraction.radius
radius
Definition: ParticleGun_SamplingFraction.py:96
Trk::CylinderVolumeBounds::halfPhiSector
double halfPhiSector() const
This method returns the halfPhiSector angle.
Definition: CylinderVolumeBounds.h:203
python.LumiBlobConversion.pos
pos
Definition: LumiBlobConversion.py:18
Trk::ObjectAccessor
Definition: ObjectAccessor.h:15
Trk::CylinderVolumeBounds::innerRadius
double innerRadius() const
This method returns the inner radius.
Definition: CylinderVolumeBounds.h:187
Trk::CylinderVolumeBounds::innerCylinderBounds
CylinderBounds * innerCylinderBounds() const
This method returns the associated CylinderBounds of the inner CylinderSurfaces.
Definition: CylinderVolumeBounds.cxx:353
Trk::CylinderVolumeBounds::deltaRadius
double deltaRadius() const
This method returns the delta radius.
Definition: CylinderVolumeBounds.h:199
Trk::CylinderVolumeBounds::s_numericalStable
static const double s_numericalStable
numerical stability
Definition: CylinderVolumeBounds.h:168
Trk::CylinderVolumeBounds::sectorPlaneBounds
RectangleBounds * sectorPlaneBounds() const
This method returns the associated PlaneBounds limiting a sectoral CylinderVolume.
Definition: CylinderVolumeBounds.cxx:371
Trk::CylinderVolumeBounds::decomposeToSurfaces
const std::vector< const Trk::Surface * > * decomposeToSurfaces(const Amg::Transform3D &transform) override final
Method to decompose the Bounds into boundarySurfaces.
Definition: CylinderVolumeBounds.cxx:99
Trk::CylinderVolumeBounds::operator=
CylinderVolumeBounds & operator=(const CylinderVolumeBounds &cylbo)
Assignment operator.
Definition: CylinderVolumeBounds.cxx:86
Trk::CylinderVolumeBounds::createBoundarySurfaceAccessors
void createBoundarySurfaceAccessors()
Private method to construct the accessors.
Trk::Surface
Definition: Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/Surface.h:75
Trk::CylinderVolumeBounds::clone
CylinderVolumeBounds * clone() const override
Virtual constructor.
Definition: CylinderVolumeBounds.h:171
Trk::CylinderVolumeBounds::mediumRadius
double mediumRadius() const
This method returns the medium radius.
Definition: CylinderVolumeBounds.h:195
Trk::DiscBounds
Definition: DiscBounds.h:44