ATLAS Offline Software
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
20 typedef float TDD_real_t;
21 const float MAXBOUNDVALUE = FLT_MAX;
22 #else
23 typedef double TDD_real_t;
24 const double MAXBOUNDVALUE = DBL_MAX;
25 #endif
26 
27 class MsgStream;
28 
29 namespace Trk {
30 
43 class ConeBounds final: public SurfaceBounds
44 {
45 public:
48  {
49  bv_alpha = 0,
50  bv_minZ = 1,
51  bv_maxZ = 2,
54  bv_length = 5
55  };
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 
138  double averagePhi() const;
143 
145  virtual MsgStream& dump(MsgStream& sl) const override;
147  virtual std::ostream& dump(std::ostream& sl) const override;
148 
149 private:
155 
157  virtual void initCache() override final;
158 
160  inline double minPhi() const
161  {
163  }
164  inline double maxPhi() const
165  {
167  }
168 };
169 
170 }
171 
173 #endif // TRKSURFACES_CONEBOUNDS_H
Trk::ConeBounds::minDistance
virtual double minDistance(const Amg::Vector2D &pos) const override
Minimal distance to boundary ( > 0 if outside and <=0 if inside)
Definition: ConeBounds.cxx:74
Trk::ConeBounds::BoundValues
BoundValues
BoundValues for readablility.
Definition: ConeBounds.h:48
Trk::SurfaceBounds::BoundsType
BoundsType
Definition: SurfaceBounds.h:59
Trk::ConeBounds::m_tanAlpha
TDD_real_t m_tanAlpha
Definition: ConeBounds.h:152
Trk::z
@ z
global position (cartesian)
Definition: ParamDefs.h:57
Trk::ConeBounds::insideLoc1
virtual bool insideLoc1(const Amg::Vector2D &locpo, double tol1=0.) const override final
This method checks inside bounds in loc1.
Trk::SurfaceBounds::Cone
@ Cone
Definition: SurfaceBounds.h:60
Amg::Vector2D
Eigen::Matrix< double, 2, 1 > Vector2D
Definition: GeoPrimitives.h:48
PixelAthClusterMonAlgCfg.zmin
zmin
Definition: PixelAthClusterMonAlgCfg.py:169
Trk::SurfaceBounds
Definition: SurfaceBounds.h:47
Trk::ConeBounds::sinAlpha
double sinAlpha() const
ConeBounds.icc
Trk::ConeBounds::m_cosAlpha
TDD_real_t m_cosAlpha
Definition: ConeBounds.h:154
M_PI
#define M_PI
Definition: ActiveFraction.h:11
Trk::ConeBounds
Definition: ConeBounds.h:44
Trk::ConeBounds::maxPhi
double maxPhi() const
Definition: ConeBounds.h:164
Trk::ConeBounds::~ConeBounds
virtual ~ConeBounds()=default
Destructor.
Trk::ConeBounds::m_sinAlpha
TDD_real_t m_sinAlpha
Definition: ConeBounds.h:153
Trk::ConeBounds::dump
virtual MsgStream & dump(MsgStream &sl) const override
Output Method for MsgStream.
Definition: ConeBounds.cxx:145
Trk::ConeBounds::m_boundValues
std::vector< TDD_real_t > m_boundValues
internal storage of the geometry parameters
Definition: ConeBounds.h:151
const
bool const RAWDATA *ch2 const
Definition: LArRodBlockPhysicsV0.cxx:560
Trk::ConeBounds::averagePhi
double averagePhi() const
This method returns the average phi value (i.e.
ParamDefs.h
Trk::ConeBounds::halfPhiSector
double halfPhiSector() const
This method returns the half-phi width of the sector (so that averagePhi +/- halfPhiSector gives the ...
Trk::ConeBounds::cosAlpha
double cosAlpha() const
Trk::ConeBounds::minZ
double minZ() const
This method returns the minimum z value in the local framee.
Trk::ConeBounds::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.
GeoPrimitives.h
SurfaceBounds.h
TDD_real_t
double TDD_real_t
Definition: ConeBounds.h:23
Trk::ConeBounds::bv_maxZ
@ bv_maxZ
Definition: ConeBounds.h:51
Trk::ConeBounds::bv_halfPhiSector
@ bv_halfPhiSector
Definition: ConeBounds.h:53
Trk::ConeBounds::operator=
ConeBounds & operator=(const ConeBounds &cylbo)=default
Assignment operator.
Trk::ConeBounds::operator==
bool operator==(const ConeBounds &bo) const
Trk::ConeBounds::bv_alpha
@ bv_alpha
Definition: ConeBounds.h:49
Trk::ConeBounds::minPhi
double minPhi() const
Helpers for inside() functions.
Definition: ConeBounds.h:160
Trk::ConeBounds::ConeBounds
ConeBounds(const ConeBounds &cylbo)=default
Copy Constructor.
vector
Definition: MultiHisto.h:13
Trk::ConeBounds::initCache
virtual void initCache() override final
Helper function for angle parameter initialization.
Definition: ConeBounds.cxx:53
PixelAthClusterMonAlgCfg.zmax
zmax
Definition: PixelAthClusterMonAlgCfg.py:169
Trk::ConeBounds::operator=
ConeBounds & operator=(ConeBounds &&sbo)=default
Move assignment.
Trk::ConeBounds::type
virtual BoundsType type() const override
Return the bounds type.
Definition: ConeBounds.h:93
Trk::ConeBounds::operator==
virtual bool operator==(const SurfaceBounds &sbo) const override
Equality operator.
Definition: ConeBounds.cxx:65
Trk::ConeBounds::inside
virtual bool inside(const Amg::Vector2D &locpo, const BoundaryCheck &bchk=true) const override final
Trk::ConeBounds::insideLoc2
virtual bool insideLoc2(const Amg::Vector2D &locpo, double tol2=0.) const override final
This method checks inside bounds in loc1.
Trk::ConeBounds::bv_averagePhi
@ bv_averagePhi
Definition: ConeBounds.h:52
Trk::ConeBounds::r
virtual double r() const override
This method returns the maximal radius - for an unbound cone it returns MAXBOUNDVALUE.
Trk::ConeBounds::tanAlpha
double tanAlpha() const
This method returns the average phi.
Trk::ConeBounds::ConeBounds
ConeBounds()
Default Constructor.
Definition: ConeBounds.cxx:18
Trk::ConeBounds::bv_minZ
@ bv_minZ
Definition: ConeBounds.h:50
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::ConeBounds::clone
virtual ConeBounds * clone() const override
Virtual constructor.
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
python.LumiBlobConversion.pos
pos
Definition: LumiBlobConversion.py:18
Trk::ConeBounds::alpha
double alpha() const
Trk::ConeBounds::ConeBounds
ConeBounds(ConeBounds &&annbo)=default
Move constructor.
Trk::BoundaryCheck
Definition: BoundaryCheck.h:51
MAXBOUNDVALUE
const double MAXBOUNDVALUE
Definition: ConeBounds.h:24
Trk::ConeBounds::bv_length
@ bv_length
Definition: ConeBounds.h:54
Trk::ConeBounds::maxZ
double maxZ() const
This method returns the maximum z value in the local framee.
TDD_real_t
double TDD_real_t
Definition: AnnulusBounds.h:20