ATLAS Offline Software
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 
20 class MsgStream;
21 
22 #ifdef TRKDETDESCR_USEFLOATPRECISON
23 typedef float TDD_real_t;
24 #else
25 typedef double TDD_real_t;
26 #endif
27 
28 namespace Trk {
29 
44 class AnnulusBounds final: public SurfaceBounds
45 {
46 
47 public:
52  {
53  bv_minR = 0,
54  bv_maxR = 1,
55  bv_R = 2,
56  bv_phi = 3,
57  bv_phiS = 4,
58  bv_length = 5
59  };
60 
62  AnnulusBounds();
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 
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 
185 
187 
188 private:
189  // bool m_forceCovEllipse;
190 
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,
209  const std::vector<TDD_real_t>& sL,
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
plotBeamSpotCompare.x1
x1
Definition: plotBeamSpotCompare.py:216
Trk::SurfaceBounds::BoundsType
BoundsType
Definition: SurfaceBounds.h:59
Trk::AnnulusBounds::minDistance
virtual double minDistance(const Amg::Vector2D &pos) const override final
Minimal distance to boundary ( > 0 if outside and <=0 if inside)
Definition: AnnulusBounds.cxx:423
Trk::AnnulusBounds::m_solution_L_max
std::vector< TDD_real_t > m_solution_L_max
Definition: AnnulusBounds.h:242
Trk::AnnulusBounds::waferCentreR
double waferCentreR() const
This method returns the R-parameter from design of sensors, which is the radius that the original cen...
Trk::AnnulusBounds::distanceToArc
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.
Definition: AnnulusBounds.cxx:533
Trk::AnnulusBounds::maxR
double maxR() const
This method returns the bigger radius.
Trk::AnnulusBounds::EllipseIntersectLine
static bool EllipseIntersectLine(const Amg::Vector2D &locpo, double h, double k, double x1, double y1, double x2, double y2)
Definition: AnnulusBounds.cxx:555
Trk::AnnulusBounds::insideLoc1
virtual bool insideLoc1(const Amg::Vector2D &locpo, double tol1=0.) const override final
This method checks inside bounds in loc1.
Amg::Vector2D
Eigen::Matrix< double, 2, 1 > Vector2D
Definition: GeoPrimitives.h:48
Trk::AnnulusBounds::inside
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)
Definition: AnnulusBounds.cxx:210
hist_file_dump.d
d
Definition: hist_file_dump.py:137
Trk::SurfaceBounds
Definition: SurfaceBounds.h:47
Trk::AnnulusBounds
Definition: AnnulusBounds.h:45
Trk::AnnulusBounds::type
virtual BoundsType type() const override
Return the type of the bounds for persistency.
Definition: AnnulusBounds.h:82
plotBeamSpotCompare.x2
x2
Definition: plotBeamSpotCompare.py:218
Trk::AnnulusBounds::m_minYin
TDD_real_t m_minYin
Definition: AnnulusBounds.h:232
Trk::AnnulusBounds::isRight
static bool isRight(const Amg::Vector2D &locpo, double tol1, double tol2, double x1, double y1, double x2, double y2)
Definition: AnnulusBounds.cxx:364
Trk::AnnulusBounds::dump
virtual MsgStream & dump(MsgStream &sl) const override
Output Method for MsgStream.
Definition: AnnulusBounds.cxx:628
Trk::SurfaceBounds::Annulus
@ Annulus
Definition: SurfaceBounds.h:70
Trk::AnnulusBounds::m_k_R
TDD_real_t m_k_R
Definition: AnnulusBounds.h:237
Trk::AnnulusBounds::phi
double phi() const
This method returns the opening angle.
Trk::AnnulusBounds::bv_phi
@ bv_phi
Definition: AnnulusBounds.h:56
Trk::AnnulusBounds::isLeft
static bool isLeft(const Amg::Vector2D &locpo, double tol1, double tol2, double x1, double y1, double x2, double y2)
Definition: AnnulusBounds.cxx:394
Trk::AnnulusBounds::m_maxXin
TDD_real_t m_maxXin
Definition: AnnulusBounds.h:233
const
bool const RAWDATA *ch2 const
Definition: LArRodBlockPhysicsV0.cxx:560
Trk::AnnulusBounds::m_d_R
TDD_real_t m_d_R
Definition: AnnulusBounds.h:239
Trk::AnnulusBounds::m_maxXout
TDD_real_t m_maxXout
Definition: AnnulusBounds.h:228
Trk::AnnulusBounds::m_solution_R_max
std::vector< TDD_real_t > m_solution_R_max
Definition: AnnulusBounds.h:244
Trk::AnnulusBounds::m_maxYout
TDD_real_t m_maxYout
Definition: AnnulusBounds.h:226
makeTRTBarrelCans.y1
tuple y1
Definition: makeTRTBarrelCans.py:15
Trk::AnnulusBounds::isAbove
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
Definition: AnnulusBounds.cxx:344
GeoPrimitives.h
SurfaceBounds.h
Trk::AnnulusBounds::clone
virtual AnnulusBounds * clone() const override
Virtual constructor.
Trk::AnnulusBounds::~AnnulusBounds
virtual ~AnnulusBounds()=default
Destructor.
Trk::AnnulusBounds::AnnulusBounds
AnnulusBounds(AnnulusBounds &&annbo)=default
Move constructor.
Trk::AnnulusBounds::AnnulusBounds
AnnulusBounds()
Default Constructor, needed for persistency.
Definition: AnnulusBounds.cxx:127
vector
Definition: MultiHisto.h:13
makeTRTBarrelCans.y2
tuple y2
Definition: makeTRTBarrelCans.py:18
Trk::AnnulusBounds::m_solution_L_min
std::vector< TDD_real_t > m_solution_L_min
Definition: AnnulusBounds.h:241
Trk::AnnulusBounds::bv_phiS
@ bv_phiS
Definition: AnnulusBounds.h:57
Trk::AnnulusBounds::minR
double minR() const
This method returns the smaller radius.
Trk::AnnulusBounds::m_minXout
TDD_real_t m_minXout
Definition: AnnulusBounds.h:229
Trk::AnnulusBounds::distanceToLine
static double distanceToLine(const Amg::Vector2D &locpo, const std::vector< TDD_real_t > &P1, const std::vector< TDD_real_t > &P2)
Distance to line.
Definition: AnnulusBounds.cxx:500
Trk::AnnulusBounds::operator=
AnnulusBounds & operator=(AnnulusBounds &&sbo)=default
Move assignment.
lumiFormat.array
array
Definition: lumiFormat.py:91
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::AnnulusBounds::insideLoc2
virtual bool insideLoc2(const Amg::Vector2D &locpo, double tol2=0.) const override final
This method checks inside bounds in loc2.
Trk::AnnulusBounds::m_minXin
TDD_real_t m_minXin
Definition: AnnulusBounds.h:234
private
#define private
Definition: DetDescrConditionsDict_dict_fixes.cxx:13
python.LumiBlobConversion.pos
pos
Definition: LumiBlobConversion.py:18
Trk::AnnulusBounds::bv_R
@ bv_R
Definition: AnnulusBounds.h:55
Trk::AnnulusBounds::phiS
double phiS() const
This method returns the tilt angle.
Trk::AnnulusBounds::bv_minR
@ bv_minR
Definition: AnnulusBounds.h:53
Trk::AnnulusBounds::getEdgeLines
std::array< TDD_real_t, 4 > getEdgeLines() const
Returns the gradient and y-intercept of the left and right module edges.
Definition: AnnulusBounds.cxx:659
Trk::AnnulusBounds::bv_length
@ bv_length
Definition: AnnulusBounds.h:58
Trk::AnnulusBounds::getBoundsValues
const std::vector< TDD_real_t > & getBoundsValues()
Trk::AnnulusBounds::operator=
AnnulusBounds & operator=(const AnnulusBounds &sbo)=default
Assignment operator.
h
Trk::AnnulusBounds::AnnulusBounds
AnnulusBounds(const AnnulusBounds &annbo)=default
Copy constructor.
Trk::BoundaryCheck
Definition: BoundaryCheck.h:51
Trk::AnnulusBounds::m_solution_R_min
std::vector< TDD_real_t > m_solution_R_min
Definition: AnnulusBounds.h:243
Trk::AnnulusBounds::m_boundValues
std::vector< TDD_real_t > m_boundValues
Definition: AnnulusBounds.h:224
Trk::AnnulusBounds::corners
std::array< std::pair< double, double >, 4 > corners() const
Returns the four corners of the bounds.
Definition: AnnulusBounds.cxx:615
Trk::AnnulusBounds::circleLineIntersection
static std::vector< double > circleLineIntersection(double R, double k, double d)
Circle and line intersection.
Definition: AnnulusBounds.cxx:461
Trk::AnnulusBounds::r
virtual double r() const override
This method returns the maximal extension on the local plane.
Trk::AnnulusBounds::m_maxYin
TDD_real_t m_maxYin
Definition: AnnulusBounds.h:231
Trk::AnnulusBounds::m_k_L
TDD_real_t m_k_L
Definition: AnnulusBounds.h:236
Trk::AnnulusBounds::operator==
bool operator==(const SurfaceBounds &annbo) const override
Equality operator.
Definition: AnnulusBounds.cxx:199
Trk::AnnulusBounds::m_d_L
TDD_real_t m_d_L
Definition: AnnulusBounds.h:238
Trk::AnnulusBounds::bv_maxR
@ bv_maxR
Definition: AnnulusBounds.h:54
fitman.k
k
Definition: fitman.py:528
TDD_real_t
double TDD_real_t
Definition: AnnulusBounds.h:20
Trk::AnnulusBounds::BoundValues
BoundValues
NB bv_R is the radius of the wafer centre which may different from the assumed surface centre.
Definition: AnnulusBounds.h:52
Trk::AnnulusBounds::m_minYout
TDD_real_t m_minYout
Definition: AnnulusBounds.h:227