ATLAS Offline Software
Loading...
Searching...
No Matches
CylinderBounds.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// CylinderBounds.h, (c) ATLAS Detector software
8
9#ifndef TRKSURFACES_CYLINDERBOUNDS_H
10#define TRKSURFACES_CYLINDERBOUNDS_H
11
14// Eigen Primitives
16
17#ifdef TRKDETDESCR_USEFLOATPRECISON
18typedef float TDD_real_t;
19#else
20typedef double TDD_real_t;
21#endif
22
23class MsgStream;
24
25namespace Trk {
26
44
45class CylinderBounds final: public SurfaceBounds
46{
47public:
57
60
62 CylinderBounds(double radius, double halez);
63
65 CylinderBounds(double radius, double halfphi, double halez);
66
68 CylinderBounds(double radius, double halfphi, double avphi, double halez);
69
71 CylinderBounds(const CylinderBounds& cylbo) = default;
72
74 CylinderBounds(CylinderBounds&& cylbo) = default;
75
77 virtual ~CylinderBounds() = default;
78
80 CylinderBounds& operator=(const CylinderBounds& cylbo) = default;
81
84
86 virtual bool operator==(const SurfaceBounds& sbo) const override;
87
88 // Needed to prevent ambiguities with c++20.
89 bool operator==(const CylinderBounds& bo) const;
90
92 virtual CylinderBounds* clone() const override;
93
95 virtual BoundsType type() const override final { return SurfaceBounds::Cylinder; }
96
98 virtual bool inside(const Amg::Vector2D& locpo, double tol1, double tol2) const override final;
99 virtual bool inside(const Amg::Vector2D& locpo, const BoundaryCheck& bchk) const override final;
100
103 bool inside3D(const Amg::Vector3D& gp, double tol1 = 0., double tol2 = 0.) const;
104
107 virtual bool insideLoc1(const Amg::Vector2D& locpo, double tol1 = 0.) const override final;
108
111 virtual bool insideLoc2(const Amg::Vector2D& locpo, double tol2 = 0.) const override final;
112
114 virtual double minDistance(const Amg::Vector2D& pos) const override final;
115
117 bool insideRadius(const Amg::Vector2D& locpo, double tol) const;
118
120 virtual double r() const override final;
121
124
127
130
132 virtual MsgStream& dump(MsgStream& sl) const override;
133
135 virtual std::ostream& dump(std::ostream& sl) const override;
136
137private:
139 bool inside(double r, double phi, double z, double tol1, double tol2) const;
140 bool insideLocZ(double z, double tol2) const;
141
145};
146}
147#include "TrkSurfaces/CylinderBounds.icc"
148#endif // TRKSURFACES_CYLINDERBOUNDS_H
double TDD_real_t
CylinderBounds()
Default Constructor.
The BoundaryCheck class allows to steer the way surface boundaries are used for inside/outside checks...
virtual double r() const override final
This method returns the radius.
virtual double minDistance(const Amg::Vector2D &pos) const override final
Minimal distance to boundary ( > 0 if outside and <=0 if inside)
virtual bool inside(const Amg::Vector2D &locpo, const BoundaryCheck &bchk) const override final
bool operator==(const CylinderBounds &bo) const
virtual ~CylinderBounds()=default
Destructor.
BoundValues
BoundValues for readablility.
bool inside3D(const Amg::Vector3D &gp, double tol1=0., double tol2=0.) const
This method checks if a GlobalPosition is inside the Cylinder - not an interface method,...
virtual bool insideLoc2(const Amg::Vector2D &locpo, double tol2=0.) const override final
This method checks inside bounds in loc1.
virtual BoundsType type() const override final
Return the bounds type.
bool insideRadius(const Amg::Vector2D &locpo, double tol) const
This method checks if a LocalPosition is inside z bounds and inside the radius (for straws)
virtual bool inside(const Amg::Vector2D &locpo, double tol1, double tol2) const override final
This method checks if a LocalPosition is inside z bounds and rphi value- interface method.
CylinderBounds & operator=(CylinderBounds &&cylbo)=default
Move assignment operator.
virtual bool insideLoc1(const Amg::Vector2D &locpo, double tol1=0.) const override final
This method checks inside bounds in loc1.
bool insideLocZ(double z, double tol2) const
double halfPhiSector() const
This method returns the halfPhiSector angle.
std::vector< TDD_real_t > m_boundValues
internal storage of the geometry parameters
virtual CylinderBounds * clone() const override
Virtual constructor.
CylinderBounds()
Default Constructor.
CylinderBounds(const CylinderBounds &cylbo)=default
Copy Constructor.
CylinderBounds & operator=(const CylinderBounds &cylbo)=default
Assignment operator.
virtual bool operator==(const SurfaceBounds &sbo) const override
Equality operator.
CylinderBounds(CylinderBounds &&cylbo)=default
Move Constructor.
double averagePhi() const
This method returns the average phi.
double halflengthZ() const
This method returns the halflengthZ.
SurfaceBounds()=default
Default Constructor.
BoundsType
This enumerator simplifies the persistency, by saving a dynamic_cast to happen.
STL class.
Definition of ATLAS Math & Geometry primitives (Amg)
Eigen::Matrix< double, 2, 1 > Vector2D
Eigen::Matrix< double, 3, 1 > Vector3D
Ensure that the ATLAS eigen extensions are properly loaded.
@ z
global position (cartesian)
Definition ParamDefs.h:57
@ phi
Definition ParamDefs.h:75
-event-from-file
STL namespace.
#define private