ATLAS Offline Software
TrapezoidBounds.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 // TrapezoidBounds.h, (c) ATLAS Detector software
8 
9 #ifndef TRKSURFACES_TRAPEZOIDBOUNDS_H
10 #define TRKSURFACES_TRAPEZOIDBOUNDS_H
11 
14 #include <math.h>
15 
17 
18 class MsgStream;
20 
21 #ifdef TRKDETDESCR_USEFLOATPRECISON
22 typedef float TDD_real_t;
23 #else
24 typedef double TDD_real_t;
25 #endif
26 
27 namespace Trk {
28 
42 class TrapezoidBounds final: public SurfaceBounds
43 {
44 
45 public:
48  {
51  bv_halfY = 2,
52  bv_length = 3
53  };
54 
57 
59  TrapezoidBounds(const TrapezoidBounds& trabo) = default;
60 
62  TrapezoidBounds& operator=(const TrapezoidBounds& sbo) = default;
63 
65  TrapezoidBounds(TrapezoidBounds&& trabo) noexcept = default;
66 
68  TrapezoidBounds& operator=(TrapezoidBounds&& sbo) noexcept = default;
69 
71  virtual ~TrapezoidBounds() = default;
72 
73 
75  TrapezoidBounds(double minhalex, double maxhalex, double haley);
76 
78  TrapezoidBounds(double minhalex, double haley, double alpha, double beta);
79 
81  virtual TrapezoidBounds* clone() const override;
82 
84  virtual BoundsType type() const override { return SurfaceBounds::Trapezoid; }
85 
87  virtual bool operator==(const SurfaceBounds& trabo) const override;
88 
90  double minHalflengthPhi() const;
91 
93  double maxHalflengthPhi() const;
94 
96  double halflengthEta() const;
97 
99  double minHalflengthX() const;
100 
102  double maxHalflengthX() const;
103 
105  double halflengthY() const;
106 
108  virtual double r() const override;
109 
111  double alpha() const;
112 
114  double beta() const;
115 
140  virtual bool inside(const Amg::Vector2D& locpo, double tol1 = 0., double tol2 = 0.) const override;
141  virtual bool inside(const Amg::Vector2D& locpo, const BoundaryCheck& bchk) const override;
142 
148  virtual bool insideLoc1(const Amg::Vector2D& locpo, double tol1 = 0.) const override;
149 
154  virtual bool insideLoc2(const Amg::Vector2D& locpo, double tol2 = 0.) const override;
155 
157  virtual double minDistance(const Amg::Vector2D& pos) const override;
158 
160  virtual MsgStream& dump(MsgStream& sl) const override;
161 
163  virtual std::ostream& dump(std::ostream& sl) const override;
164 
165 private:
166  friend class ::TrapezoidBoundsCnv_p1;
167 
169  bool insideFull(const Amg::Vector2D& locpo, double tol1 = 0., double tol2 = 0.) const;
170 
172  bool insideExclude(const Amg::Vector2D& locpo, double tol1 = 0., double tol2 = 0.) const;
173 
175  static bool isAbove(const Amg::Vector2D& locpo, double tol1, double tol2, double k, double d) ;
176 
177  std::vector<TDD_real_t> m_boundValues;
180 };
181 
182 } // end of namespace
184 #endif // TRKSURFACES_TRAPEZOIDBOUNDS_H
Trk::TrapezoidBounds::~TrapezoidBounds
virtual ~TrapezoidBounds()=default
Destructor.
Trk::TrapezoidBounds::maxHalflengthX
double maxHalflengthX() const
This method returns the maximal halflength in X (first coordinate of local surface frame)
Trk::TrapezoidBounds::insideFull
bool insideFull(const Amg::Vector2D &locpo, double tol1=0., double tol2=0.) const
inside() method for a full symmetric trapezoid
Definition: TrapezoidBounds.cxx:148
Trk::TrapezoidBounds::alpha
double alpha() const
This method returns the opening angle alpha in point A (negative local phi)
Trk::SurfaceBounds::BoundsType
BoundsType
Definition: SurfaceBounds.h:59
Trk::TrapezoidBounds::m_boundValues
std::vector< TDD_real_t > m_boundValues
Definition: TrapezoidBounds.h:177
Trk::TrapezoidBounds::bv_minHalfX
@ bv_minHalfX
Definition: TrapezoidBounds.h:49
Trk::TrapezoidBounds::insideLoc2
virtual bool insideLoc2(const Amg::Vector2D &locpo, double tol2=0.) const override
This method checks inside bounds in loc2.
Trk::TrapezoidBounds::minDistance
virtual double minDistance(const Amg::Vector2D &pos) const override
Minimal distance to boundary ( > 0 if outside and <=0 if inside)
Definition: TrapezoidBounds.cxx:200
Amg::Vector2D
Eigen::Matrix< double, 2, 1 > Vector2D
Definition: GeoPrimitives.h:48
Trk::TrapezoidBounds::m_beta
TDD_real_t m_beta
Definition: TrapezoidBounds.h:179
hist_file_dump.d
d
Definition: hist_file_dump.py:137
Trk::SurfaceBounds
Definition: SurfaceBounds.h:47
Trk::TrapezoidBounds::halflengthY
double halflengthY() const
This method returns the halflength in Y (second coordinate of local surface frame)
TrapezoidBounds.icc
Trk::TrapezoidBounds::inside
virtual bool inside(const Amg::Vector2D &locpo, double tol1=0., double tol2=0.) const override
The orientation of the Trapezoid is according to the figure above, in words: the shorter of the two p...
Definition: TrapezoidBounds.cxx:139
Trk::TrapezoidBounds::operator=
TrapezoidBounds & operator=(const TrapezoidBounds &sbo)=default
Assignment operator.
Trk::TrapezoidBounds::minHalflengthX
double minHalflengthX() const
This method returns the minimal halflength in X (first coordinate of local surface frame)
Trk::TrapezoidBounds::bv_halfY
@ bv_halfY
Definition: TrapezoidBounds.h:51
ParamDefs.h
Trk::TrapezoidBounds::minHalflengthPhi
double minHalflengthPhi() const
This method returns the minimal halflength in phi (first coordinate of local surface frame)
GeoPrimitives.h
SurfaceBounds.h
Trk::TrapezoidBounds::clone
virtual TrapezoidBounds * clone() const override
Virtual constructor.
Trk::TrapezoidBounds::isAbove
static bool isAbove(const Amg::Vector2D &locpo, double tol1, double tol2, double k, double d)
isAbove() method for checking whether a point lies above or under a straight line
Definition: TrapezoidBounds.cxx:192
Trk::TrapezoidBounds::bv_maxHalfX
@ bv_maxHalfX
Definition: TrapezoidBounds.h:50
Trk::TrapezoidBounds::operator==
virtual bool operator==(const SurfaceBounds &trabo) const override
Equality operator.
Definition: TrapezoidBounds.cxx:53
Trk::TrapezoidBounds::TrapezoidBounds
TrapezoidBounds(TrapezoidBounds &&trabo) noexcept=default
Move constructor.
Trk::TrapezoidBounds::r
virtual double r() const override
This method returns the maximal extension on the local plane.
Trk::TrapezoidBounds::TrapezoidBounds
TrapezoidBounds(const TrapezoidBounds &trabo)=default
Copy constructor.
Trk
Ensure that the ATLAS eigen extensions are properly loaded.
Definition: FakeTrackBuilder.h:9
Trk::TrapezoidBounds::halflengthEta
double halflengthEta() const
This method returns the halflength in eta (second coordinate of local surface frame)
Trk::TrapezoidBounds::TrapezoidBounds
TrapezoidBounds()
Default Constructor, needed for persistency.
Definition: TrapezoidBounds.cxx:19
Trk::SurfaceBounds::Trapezoid
@ Trapezoid
Definition: SurfaceBounds.h:67
Trk::TrapezoidBounds::operator=
TrapezoidBounds & operator=(TrapezoidBounds &&sbo) noexcept=default
Move Assignment operator.
TrapezoidBoundsCnv_p1
Definition: TrapezoidBoundsCnv_p1.h:23
Trk::TrapezoidBounds
Definition: TrapezoidBounds.h:43
python.LumiBlobConversion.pos
pos
Definition: LumiBlobConversion.py:18
Trk::TrapezoidBounds::m_alpha
TDD_real_t m_alpha
Definition: TrapezoidBounds.h:178
Trk::TrapezoidBounds::dump
virtual MsgStream & dump(MsgStream &sl) const override
Output Method for MsgStream.
Definition: TrapezoidBounds.cxx:257
Trk::TrapezoidBounds::insideLoc1
virtual bool insideLoc1(const Amg::Vector2D &locpo, double tol1=0.) const override
This method checks inside bounds in loc1.
Trk::TrapezoidBounds::maxHalflengthPhi
double maxHalflengthPhi() const
This method returns the maximal halflength in phi (first coordinate of local surface frame)
Trk::BoundaryCheck
Definition: BoundaryCheck.h:51
Trk::TrapezoidBounds::beta
double beta() const
This method returns the opening angle beta in point B (positive local phi)
Trk::TrapezoidBounds::insideExclude
bool insideExclude(const Amg::Vector2D &locpo, double tol1=0., double tol2=0.) const
inside() method for the triangular exclude area for an arbitrary trapezoid
Definition: TrapezoidBounds.cxx:176
TDD_real_t
double TDD_real_t
Definition: TrapezoidBounds.h:19
Trk::TrapezoidBounds::type
virtual BoundsType type() const override
Return the type of the bounds for persistency.
Definition: TrapezoidBounds.h:84
Trk::TrapezoidBounds::bv_length
@ bv_length
Definition: TrapezoidBounds.h:52
fitman.k
k
Definition: fitman.py:528
TDD_real_t
double TDD_real_t
Definition: AnnulusBounds.h:20
Trk::TrapezoidBounds::BoundValues
BoundValues
Definition: TrapezoidBounds.h:48