ATLAS Offline Software
Loading...
Searching...
No Matches
AnnulusBounds.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3*/
4
6// AnnulusBounds.h, (c) ATLAS Detector software
8
9#ifndef TRKSURFACES_ANNULUSBOUNDS_H
10#define TRKSURFACES_ANNULUSBOUNDS_H
11
13//#include "TrkEventPrimitives/ParamDefs.h"
14//#include <math.h>
15#include <iosfwd> //ostream fwd declaration
16#include <vector>
17
19
20class MsgStream;
21
22#ifdef TRKDETDESCR_USEFLOATPRECISON
23typedef float TDD_real_t;
24#else
25typedef double TDD_real_t;
26#endif
27
28namespace Trk {
29
43
44class AnnulusBounds final: public SurfaceBounds
45{
46
47public:
52 {
55 bv_R = 2,
56 bv_phi = 3,
59 };
60
64 AnnulusBounds(double minR, double maxR, double R, double phi, double phiS);
65
67 AnnulusBounds(const AnnulusBounds& annbo) = default;
69 AnnulusBounds& operator=(const AnnulusBounds& sbo) = default;
71 AnnulusBounds(AnnulusBounds&& annbo) = default;
74
76 virtual ~AnnulusBounds() = default;
77
79 virtual AnnulusBounds* clone() const override;
80
82 virtual BoundsType type() const override { return SurfaceBounds::Annulus; }
83
85 bool operator==(const SurfaceBounds& annbo) const override;
86
88 double minR() const;
89
91 double maxR() const;
92
97 double waferCentreR() const;
98
100 double phi() const;
101
103 double phiS() const;
104
116 std::array<std::pair<double, double>, 4> corners() const;
117
119 virtual double r() const override;
120
122 // double alpha() const;
123
125 // double beta() const;
126
151 virtual bool inside(const Amg::Vector2D& locpo, double tol1 = 0., double tol2 = 0.) const override final;
152 virtual bool inside(const Amg::Vector2D& locpo, const BoundaryCheck& bchk) const override final;
153
158
159 virtual bool insideLoc1(const Amg::Vector2D& locpo, double tol1 = 0.) const override final;
160
165 virtual bool insideLoc2(const Amg::Vector2D& locpo, double tol2 = 0.) const override final;
166
168 virtual double minDistance(const Amg::Vector2D& pos) const override final;
169
171 virtual MsgStream& dump(MsgStream& sl) const override;
172
174 virtual std::ostream& dump(std::ostream& sl) const override;
175
184 std::array<TDD_real_t,4> getEdgeLines() const;
185
187
188private:
189 // bool m_forceCovEllipse;
190
192
193 static bool isAbove(const Amg::Vector2D& locpo, double tol1, double tol2, double x1, double y1, double x2, double y2) ;
194
195 static bool isRight(const Amg::Vector2D& locpo, double tol1, double tol2, double x1, double y1, double x2, double y2) ;
196
197 static bool isLeft(const Amg::Vector2D& locpo, double tol1, double tol2, double x1, double y1, double x2, double y2) ;
198
199 // check whether an ellipse intersects a line
200 static bool EllipseIntersectLine(const Amg::Vector2D& locpo, double h, double k, double x1, double y1, double x2, double y2)
201 ;
202
204 static double distanceToLine(const Amg::Vector2D& locpo, const std::vector<TDD_real_t>& P1, const std::vector<TDD_real_t>& P2) ;
205
207 static double distanceToArc(const Amg::Vector2D& locpo,
208 double R,
210 const std::vector<TDD_real_t>& sR) ;
211
222 static std::vector<double> circleLineIntersection(double R, double k, double d) ;
223
225
230
235
240
245};
246
247} // end of namespace
248
249#include "TrkSurfaces/AnnulusBounds.icc"
250#endif // TRKSURFACES_ANNULUSBOUNDS_H
double TDD_real_t
Header file for AthHistogramAlgorithm.
AnnulusBounds(const AnnulusBounds &annbo)=default
Copy constructor.
static bool isAbove(const Amg::Vector2D &locpo, double tol1, double tol2, double x1, double y1, double x2, double y2)
isAbove() method for checking whether a point lies above or under a straight line
AnnulusBounds & operator=(const AnnulusBounds &sbo)=default
Assignment operator.
double minR() const
This method returns the smaller radius.
bool operator==(const SurfaceBounds &annbo) const override
Equality operator.
double maxR() const
This method returns the bigger radius.
static std::vector< double > circleLineIntersection(double R, double k, double d)
Circle and line intersection.
virtual double minDistance(const Amg::Vector2D &pos) const override final
Minimal distance to boundary ( > 0 if outside and <=0 if inside)
static double distanceToLine(const Amg::Vector2D &locpo, const std::vector< TDD_real_t > &P1, const std::vector< TDD_real_t > &P2)
Distance to line.
static bool isLeft(const Amg::Vector2D &locpo, double tol1, double tol2, double x1, double y1, double x2, double y2)
virtual bool inside(const Amg::Vector2D &locpo, double tol1=0., double tol2=0.) const override final
This method returns the opening angle alpha in point A (negative local phi)
virtual AnnulusBounds * clone() const override
Virtual constructor.
std::array< TDD_real_t, 4 > getEdgeLines() const
Returns the gradient and y-intercept of the left and right module edges.
static bool EllipseIntersectLine(const Amg::Vector2D &locpo, double h, double k, double x1, double y1, double x2, double y2)
AnnulusBounds(AnnulusBounds &&annbo)=default
Move constructor.
const std::vector< TDD_real_t > & getBoundsValues() const
virtual ~AnnulusBounds()=default
Destructor.
std::vector< TDD_real_t > m_solution_L_min
std::vector< TDD_real_t > m_solution_R_max
double phiS() const
This method returns the tilt angle.
virtual BoundsType type() const override
Return the type of the bounds for persistency.
double phi() const
This method returns the opening angle.
virtual double r() const override
This method returns the maximal extension on the local plane.
BoundValues
NB bv_R is the radius of the wafer centre which may different from the assumed surface centre.
std::vector< TDD_real_t > m_solution_R_min
virtual bool insideLoc2(const Amg::Vector2D &locpo, double tol2=0.) const override final
This method checks inside bounds in loc2.
static bool isRight(const Amg::Vector2D &locpo, double tol1, double tol2, double x1, double y1, double x2, double y2)
virtual bool insideLoc1(const Amg::Vector2D &locpo, double tol1=0.) const override final
This method checks inside bounds in loc1.
AnnulusBounds()
Default Constructor, needed for persistency.
AnnulusBounds & operator=(AnnulusBounds &&sbo)=default
Move assignment.
static double distanceToArc(const Amg::Vector2D &locpo, double R, const std::vector< TDD_real_t > &sL, const std::vector< TDD_real_t > &sR)
Distance to arc.
double waferCentreR() const
This method returns the R-parameter from design of sensors, which is the radius that the original cen...
std::vector< TDD_real_t > m_solution_L_max
std::array< std::pair< double, double >, 4 > corners() const
Returns the four corners of the bounds.
std::vector< TDD_real_t > m_boundValues
The BoundaryCheck class allows to steer the way surface boundaries are used for inside/outside checks...
Abstract base class for surface bounds to be specified.
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.
@ phi
Definition ParamDefs.h:75
-event-from-file
STL namespace.
#define private