ATLAS Offline Software
Loading...
Searching...
No Matches
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
18class MsgStream;
20
21#ifdef TRKDETDESCR_USEFLOATPRECISON
22typedef float TDD_real_t;
23#else
24typedef double TDD_real_t;
25#endif
26
27namespace Trk {
28
41
42class TrapezoidBounds final: public SurfaceBounds
43{
44
45public:
54
57
59 TrapezoidBounds(const TrapezoidBounds& trabo) = default;
60
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
147
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
165private:
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
double TDD_real_t
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.
TrapezoidBounds & operator=(TrapezoidBounds &&sbo) noexcept=default
Move Assignment operator.
double maxHalflengthPhi() const
This method returns the maximal halflength in phi (first coordinate of local surface frame)
double beta() const
This method returns the opening angle beta in point B (positive local phi)
virtual bool operator==(const SurfaceBounds &trabo) const override
Equality operator.
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
virtual BoundsType type() const override
Return the type of the bounds for persistency.
double minHalflengthPhi() const
This method returns the minimal halflength in phi (first coordinate of local surface frame)
virtual TrapezoidBounds * clone() const override
Virtual constructor.
virtual ~TrapezoidBounds()=default
Destructor.
virtual bool insideLoc2(const Amg::Vector2D &locpo, double tol2=0.) const override
This method checks inside bounds in loc2.
std::vector< TDD_real_t > m_boundValues
double halflengthEta() const
This method returns the halflength in eta (second coordinate of local surface frame)
TrapezoidBounds(const TrapezoidBounds &trabo)=default
Copy constructor.
double alpha() const
This method returns the opening angle alpha in point A (negative local phi)
double halflengthY() const
This method returns the halflength in Y (second coordinate of local surface frame)
virtual bool insideLoc1(const Amg::Vector2D &locpo, double tol1=0.) const override
This method checks inside bounds in loc1.
virtual double minDistance(const Amg::Vector2D &pos) const override
Minimal distance to boundary ( > 0 if outside and <=0 if inside)
TrapezoidBounds()
Default Constructor, needed for persistency.
double minHalflengthX() const
This method returns the minimal halflength in X (first coordinate of local surface frame)
double maxHalflengthX() const
This method returns the maximal halflength in X (first coordinate of local surface frame)
TrapezoidBounds(TrapezoidBounds &&trabo) noexcept=default
Move constructor.
BoundValues
for readability
virtual double r() const override
This method returns the maximal extension on the local plane.
bool insideFull(const Amg::Vector2D &locpo, double tol1=0., double tol2=0.) const
inside() method for a full symmetric trapezoid
TrapezoidBounds & operator=(const TrapezoidBounds &sbo)=default
Assignment operator.
bool insideExclude(const Amg::Vector2D &locpo, double tol1=0., double tol2=0.) const
inside() method for the triangular exclude area for an arbitrary trapezoid
Eigen::Matrix< double, 2, 1 > Vector2D
Ensure that the ATLAS eigen extensions are properly loaded.
-event-from-file