ATLAS Offline Software
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
18 typedef float TDD_real_t;
19 #else
20 typedef double TDD_real_t;
21 #endif
22 
23 class MsgStream;
24 
25 namespace Trk {
26 
45 class CylinderBounds final: public SurfaceBounds
46 {
47 public:
50  {
51  bv_radius = 0,
54  bv_halfZ = 3,
55  bv_length = 4
56  };
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 
123  double averagePhi() const;
124 
127 
129  double halflengthZ() const;
130 
132  virtual MsgStream& dump(MsgStream& sl) const override;
133 
135  virtual std::ostream& dump(std::ostream& sl) const override;
136 
137 private:
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
Trk::CylinderBounds::minDistance
virtual double minDistance(const Amg::Vector2D &pos) const override final
Minimal distance to boundary ( > 0 if outside and <=0 if inside)
Definition: CylinderBounds.cxx:62
Trk::SurfaceBounds::BoundsType
BoundsType
Definition: SurfaceBounds.h:59
Trk::CylinderBounds::halfPhiSector
double halfPhiSector() const
This method returns the halfPhiSector angle.
Trk::z
@ z
global position (cartesian)
Definition: ParamDefs.h:63
Trk::CylinderBounds::insideLoc2
virtual bool insideLoc2(const Amg::Vector2D &locpo, double tol2=0.) const override final
This method checks inside bounds in loc1.
Trk::CylinderBounds::insideLoc1
virtual bool insideLoc1(const Amg::Vector2D &locpo, double tol1=0.) const override final
This method checks inside bounds in loc1.
Trk::CylinderBounds::inside
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.
Amg::Vector2D
Eigen::Matrix< double, 2, 1 > Vector2D
Definition: GeoPrimitives.h:48
Trk::CylinderBounds::CylinderBounds
CylinderBounds()
Default Constructor.
Definition: CylinderBounds.cxx:18
Trk::SurfaceBounds
Definition: SurfaceBounds.h:47
Trk::CylinderBounds::insideLocZ
bool insideLocZ(double z, double tol2) const
const
bool const RAWDATA *ch2 const
Definition: LArRodBlockPhysicsV0.cxx:562
ParamDefs.h
Trk::CylinderBounds::bv_averagePhi
@ bv_averagePhi
Definition: CylinderBounds.h:52
Trk::CylinderBounds::operator=
CylinderBounds & operator=(CylinderBounds &&cylbo)=default
Move assignment operator.
Trk::CylinderBounds::bv_halfPhiSector
@ bv_halfPhiSector
Definition: CylinderBounds.h:53
GeoPrimitives.h
SurfaceBounds.h
Trk::CylinderBounds::m_checkPhi
bool m_checkPhi
Definition: CylinderBounds.h:144
Trk::CylinderBounds::bv_halfZ
@ bv_halfZ
Definition: CylinderBounds.h:54
Trk::CylinderBounds::inside
virtual bool inside(const Amg::Vector2D &locpo, const BoundaryCheck &bchk) const override final
vector
Definition: MultiHisto.h:13
Trk::CylinderBounds
Definition: CylinderBounds.h:46
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
Trk::CylinderBounds::CylinderBounds
CylinderBounds(CylinderBounds &&cylbo)=default
Move Constructor.
private
#define private
Definition: DetDescrConditionsDict_dict_fixes.cxx:13
Trk::CylinderBounds::type
virtual BoundsType type() const override final
Return the bounds type.
Definition: CylinderBounds.h:95
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
TDD_real_t
double TDD_real_t
Definition: CylinderBounds.h:20
ParticleGun_SamplingFraction.radius
radius
Definition: ParticleGun_SamplingFraction.py:96
python.LumiBlobConversion.pos
pos
Definition: LumiBlobConversion.py:18
Trk::CylinderBounds::BoundValues
BoundValues
BoundValues for readablility.
Definition: CylinderBounds.h:50
Trk::CylinderBounds::operator=
CylinderBounds & operator=(const CylinderBounds &cylbo)=default
Assignment operator.
Trk::CylinderBounds::insideRadius
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)
Trk::BoundaryCheck
Definition: BoundaryCheck.h:51
Trk::CylinderBounds::dump
virtual MsgStream & dump(MsgStream &sl) const override
Output Method for MsgStream.
Definition: CylinderBounds.cxx:88
Trk::CylinderBounds::operator==
virtual bool operator==(const SurfaceBounds &sbo) const override
Equality operator.
Definition: CylinderBounds.cxx:52
Trk::CylinderBounds::bv_length
@ bv_length
Definition: CylinderBounds.h:55
Trk::CylinderBounds::clone
virtual CylinderBounds * clone() const override
Virtual constructor.
Trk::phi
@ phi
Definition: ParamDefs.h:81
Trk::CylinderBounds::CylinderBounds
CylinderBounds(const CylinderBounds &cylbo)=default
Copy Constructor.
Trk::CylinderBounds::m_boundValues
std::vector< TDD_real_t > m_boundValues
internal storage of the geometry parameters
Definition: CylinderBounds.h:143
Trk::CylinderBounds::averagePhi
double averagePhi() const
This method returns the average phi.
Trk::CylinderBounds::~CylinderBounds
virtual ~CylinderBounds()=default
Destructor.
Trk::CylinderBounds::bv_radius
@ bv_radius
Definition: CylinderBounds.h:51
Trk::CylinderBounds::inside3D
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,...
Trk::CylinderBounds::halflengthZ
double halflengthZ() const
This method returns the halflengthZ.
Trk::CylinderBounds::operator==
bool operator==(const CylinderBounds &bo) const
TDD_real_t
double TDD_real_t
Definition: AnnulusBounds.h:20
Trk::SurfaceBounds::Cylinder
@ Cylinder
Definition: SurfaceBounds.h:61
Trk::CylinderBounds::r
virtual double r() const override final
This method returns the radius.