ATLAS Offline Software
Loading...
Searching...
No Matches
TriangleBounds.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// TriangleBounds.h, (c) ATLAS Detector software
8
9#ifndef TRKSURFACES_TRIANGLEBOUNDS_H
10#define TRKSURFACES_TRIANGLEBOUNDS_H
11
15#include <utility>
16
17class MsgStream;
18
19#ifdef TRKDETDESCR_USEFLOATPRECISON
20typedef float TDD_real_t;
21#else
22typedef double TDD_real_t;
23#endif
24
25namespace Trk {
26
37
38class TriangleBounds final : public SurfaceBounds
39{
40
41public:
44 {
45 bv_x1 = 0,
46 bv_y1 = 1,
47 bv_x2 = 2,
48 bv_y2 = 3,
49 bv_x3 = 4,
50 bv_y3 = 5,
52 };
53
56
58 TriangleBounds(const TriangleBounds& tribo) = default;
59
61 TriangleBounds& operator=(const TriangleBounds& recbo) = default;
62
64 TriangleBounds(TriangleBounds&& tribo) noexcept = default;
65
67 TriangleBounds& operator=(TriangleBounds&& recbo) noexcept = default;
68
70 virtual ~TriangleBounds() = default;
71
73 TriangleBounds(const std::vector<std::pair<float, float>>&);
74
76 TriangleBounds(const std::vector<std::pair<double, double>>&);
77
79 TriangleBounds(const Amg::Vector2D& p1, const Amg::Vector2D& p2, const Amg::Vector2D& p3);
80
82 virtual bool operator==(const SurfaceBounds& sbo) const override;
83
85 virtual TriangleBounds* clone() const override;
86
88 virtual BoundsType type() const override final { return SurfaceBounds::Triangle; }
89
91 virtual bool inside(const Amg::Vector2D& locpo, double tol1 = 0., double tol2 = 0.) const override final;
92 virtual bool inside(const Amg::Vector2D& locpo, const BoundaryCheck& bchk) const override final;
93
96 virtual bool insideLoc1(const Amg::Vector2D& locpo, double tol1 = 0.) const override final;
97
100 virtual bool insideLoc2(const Amg::Vector2D& locpo, double tol2 = 0.) const override final;
101
103 virtual double minDistance(const Amg::Vector2D& pos) const override final;
104
107
109 virtual double r() const override final;
110
112 virtual MsgStream& dump(MsgStream& sl) const override;
113
115 virtual std::ostream& dump(std::ostream& sl) const override;
116
117private:
119};
120} // end of namespace
121
122#include "TrkSurfaces/TriangleBounds.icc"
123#endif // TRKSURFACES_RECTANGLEBOUNDS_H
double TDD_real_t
The BoundaryCheck class allows to steer the way surface boundaries are used for inside/outside checks...
SurfaceBounds()=default
Default Constructor.
BoundsType
This enumerator simplifies the persistency, by saving a dynamic_cast to happen.
TriangleBounds(const TriangleBounds &tribo)=default
Copy constructor.
TriangleBounds()
Default Constructor - needed for persistency.
TriangleBounds(TriangleBounds &&tribo) noexcept=default
Move constructor.
virtual double r() const override final
This method returns the maximal extension on the local plane, i.e.
BoundValues
for readability
virtual bool insideLoc2(const Amg::Vector2D &locpo, double tol2=0.) const override final
This method checks inside bounds in loc2.
virtual bool operator==(const SurfaceBounds &sbo) const override
Equality operator.
virtual bool insideLoc1(const Amg::Vector2D &locpo, double tol1=0.) const override final
This method checks inside bounds in loc1.
virtual TriangleBounds * clone() const override
Virtual constructor.
TriangleBounds & operator=(const TriangleBounds &recbo)=default
Assignment Operator.
virtual ~TriangleBounds()=default
Destructor.
TriangleBounds & operator=(TriangleBounds &&recbo) noexcept=default
Move Assignment Operator.
virtual BoundsType type() const override final
Return the type of the bounds for persistency.
std::vector< TDD_real_t > m_boundValues
std::vector< std::pair< TDD_real_t, TDD_real_t > > vertices() const
This method returns the coordinates of vertices.
virtual double minDistance(const Amg::Vector2D &pos) const override final
Minimal distance to boundary ( > 0 if outside and <=0 if inside)
STL class.
STL class.
Definition of ATLAS Math & Geometry primitives (Amg)
Eigen::Matrix< double, 2, 1 > Vector2D
Ensure that the ATLAS eigen extensions are properly loaded.
-event-from-file
STL namespace.
#define private