ATLAS Offline Software
Loading...
Searching...
No Matches
ConeBounds.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// ConeBounds.h, (c) ATLAS Detector software
8
9#ifndef TRKSURFACES_ConeBounds_H
10#define TRKSURFACES_ConeBounds_H
11
14
15#include <cfloat>
16
18
19#ifdef TRKDETDESCR_USEFLOATPRECISON
20typedef float TDD_real_t;
21const float MAXBOUNDVALUE = FLT_MAX;
22#else
23typedef double TDD_real_t;
24const double MAXBOUNDVALUE = DBL_MAX;
25#endif
26
27class MsgStream;
28
29namespace Trk {
30
42
43class ConeBounds final: public SurfaceBounds
44{
45public:
56
58 ConeBounds();
59
62 ConeBounds(double alpha, bool symm, double halfphi = M_PI, double avphi = 0.);
63
66 ConeBounds(double alpha, double zmin, double zmax, double halfphi = M_PI, double avphi = 0.);
67
69 ConeBounds(const ConeBounds& cylbo) = default;
70
72 ConeBounds& operator=(const ConeBounds& cylbo) = default;
73
75 ConeBounds(ConeBounds&& annbo) = default;
77 ConeBounds& operator=(ConeBounds&& sbo) = default;
78
79
81 virtual ~ConeBounds() = default;
82
84 virtual bool operator==(const SurfaceBounds& sbo) const override;
85
86 // Needed to prevent ambiguities with c++20.
87 bool operator==(const ConeBounds& bo) const;
88
90 virtual ConeBounds* clone() const override;
91
93 virtual BoundsType type() const override { return SurfaceBounds::Cone; }
94
96 virtual bool inside(const Amg::Vector2D& locpo, double tol1, double tol2) const override final;
97 virtual bool inside(const Amg::Vector2D& locpo, const BoundaryCheck& bchk = true) const override final;
98
101 virtual bool inside(const Amg::Vector3D& gp, double tol1 = 0., double tol2 = 0.) const final;
102 virtual bool inside(const Amg::Vector3D& locpo, const BoundaryCheck& bchk) const final;
103
106 virtual bool insideLoc1(const Amg::Vector2D& locpo, double tol1 = 0.) const override final;
107
110 virtual bool insideLoc2(const Amg::Vector2D& locpo, double tol2 = 0.) const override final;
111
113 virtual double minDistance(const Amg::Vector2D& pos) const override;
114
116 virtual double r() const override;
117
119 double r(double z) const;
120
122 double tanAlpha() const;
123 double sinAlpha() const;
124 double cosAlpha() const;
125 double alpha() const;
126
129 double minZ() const;
130
133 double maxZ() const;
134
137
143
145 virtual MsgStream& dump(MsgStream& sl) const override;
147 virtual std::ostream& dump(std::ostream& sl) const override;
148
149private:
155
157 virtual void initCache() override final;
158
168};
169
170}
171
173#endif // TRKSURFACES_CONEBOUNDS_H
#define M_PI
double TDD_real_t
const double MAXBOUNDVALUE
Definition ConeBounds.h:24
Eigen::Matrix< double, 3, 1 > Vector3D
The BoundaryCheck class allows to steer the way surface boundaries are used for inside/outside checks...
ConeBounds(const ConeBounds &cylbo)=default
Copy Constructor.
ConeBounds & operator=(ConeBounds &&sbo)=default
Move assignment.
ConeBounds(ConeBounds &&annbo)=default
Move constructor.
virtual BoundsType type() const override
Return the bounds type.
Definition ConeBounds.h:93
bool operator==(const ConeBounds &bo) const
virtual ConeBounds * clone() const override
Virtual constructor.
virtual ~ConeBounds()=default
Destructor.
TDD_real_t m_sinAlpha
Definition ConeBounds.h:153
double minZ() const
This method returns the minimum z value in the local framee.
TDD_real_t m_tanAlpha
Definition ConeBounds.h:152
double alpha() const
double tanAlpha() const
This method returns the average phi.
double minPhi() const
Helpers for inside() functions.
Definition ConeBounds.h:160
virtual bool operator==(const SurfaceBounds &sbo) const override
Equality operator.
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.
double sinAlpha() const
virtual bool insideLoc2(const Amg::Vector2D &locpo, double tol2=0.) const override final
This method checks inside bounds in loc1.
double maxPhi() const
Definition ConeBounds.h:164
virtual bool inside(const Amg::Vector2D &locpo, const BoundaryCheck &bchk=true) const override final
double maxZ() const
This method returns the maximum z value in the local framee.
double halfPhiSector() const
This method returns the half-phi width of the sector (so that averagePhi +/- halfPhiSector gives the ...
std::vector< TDD_real_t > m_boundValues
internal storage of the geometry parameters
Definition ConeBounds.h:151
ConeBounds & operator=(const ConeBounds &cylbo)=default
Assignment operator.
BoundValues
BoundValues for readablility.
Definition ConeBounds.h:48
virtual bool insideLoc1(const Amg::Vector2D &locpo, double tol1=0.) const override final
This method checks inside bounds in loc1.
double cosAlpha() const
virtual void initCache() override final
Helper function for angle parameter initialization.
virtual double r() const override
This method returns the maximal radius - for an unbound cone it returns MAXBOUNDVALUE.
ConeBounds()
Default Constructor.
double averagePhi() const
This method returns the average phi value (i.e.
TDD_real_t m_cosAlpha
Definition ConeBounds.h:154
virtual double minDistance(const Amg::Vector2D &pos) const override
Minimal distance to boundary ( > 0 if outside and <=0 if inside)
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
Ensure that the ATLAS eigen extensions are properly loaded.
@ z
global position (cartesian)
Definition ParamDefs.h:57
-event-from-file
STL namespace.
#define private