ATLAS Offline Software
RectangleBounds.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 // RectangleBounds.h, (c) ATLAS Detector software
8 
9 #ifndef TRKSURFACES_RECTANGLEBOUNDS_H
10 #define TRKSURFACES_RECTANGLEBOUNDS_H
11 
13 
14 class MsgStream;
15 
16 #ifdef TRKDETDESCR_USEFLOATPRECISON
17 typedef float TDD_real_t;
18 #else
19 typedef double TDD_real_t;
20 #endif
21 
22 namespace Trk {
23 
37 class RectangleBounds final : public SurfaceBounds
38 {
39 
40 public:
43  {
44  bv_halfX = 0,
45  bv_halfY = 1,
46  bv_length = 2
47  };
48 
51 
53  RectangleBounds(const RectangleBounds& recbo);
54 
57 
59  RectangleBounds(RectangleBounds&& recbo) noexcept = default;
60 
62  RectangleBounds& operator=(RectangleBounds&& recbo) noexcept = default;
63 
65  virtual ~RectangleBounds() = default;
66 
68  RectangleBounds(double halex, double haley);
69 
71  virtual bool operator==(const SurfaceBounds& sbo) const override final;
72 
74  virtual RectangleBounds* clone() const override;
75 
77  virtual BoundsType type() const override final { return SurfaceBounds::Rectangle; }
78 
80  virtual bool inside(const Amg::Vector2D& locpo, double tol1 = 0., double tol2 = 0.) const override final;
81 
83  virtual bool inside(const Amg::Vector2D& locpo, const BoundaryCheck& bchk) const override final;
84 
87  virtual bool insideLoc1(const Amg::Vector2D& locpo, double tol1 = 0.) const override final;
88 
91  virtual bool insideLoc2(const Amg::Vector2D& locpo, double tol2 = 0.) const override final;
92 
94  virtual double minDistance(const Amg::Vector2D& pos) const override final;
95 
97  double halflengthPhi() const;
98 
101 
103  double halflengthX() const;
104 
106  double halflengthY() const;
107 
109  virtual double r() const override;
110 
112  virtual MsgStream& dump(MsgStream& sl) const override;
113 
115  virtual std::ostream& dump(std::ostream& sl) const override;
116 
117 private:
120 };
121 
122 } // end of namespace
123 #include "TrkSurfaces/RectangleBounds.icc"
124 #endif // TRKSURFACES_RECTANGLEBOUNDS_H
Trk::RectangleBounds::bv_length
@ bv_length
Definition: RectangleBounds.h:46
Trk::RectangleBounds
Definition: RectangleBounds.h:38
Trk::SurfaceBounds::BoundsType
BoundsType
Definition: SurfaceBounds.h:59
Trk::RectangleBounds::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::SurfaceBounds::Rectangle
@ Rectangle
Definition: SurfaceBounds.h:65
Trk::SurfaceBounds
Definition: SurfaceBounds.h:47
Trk::RectangleBounds::bv_halfX
@ bv_halfX
Definition: RectangleBounds.h:44
Trk::RectangleBounds::BoundValues
BoundValues
Definition: RectangleBounds.h:43
Trk::RectangleBounds::operator=
RectangleBounds & operator=(RectangleBounds &&recbo) noexcept=default
Move Assignment Operator.
Trk::RectangleBounds::dump
virtual MsgStream & dump(MsgStream &sl) const override
Output Method for MsgStream.
Definition: RectangleBounds.cxx:134
const
bool const RAWDATA *ch2 const
Definition: LArRodBlockPhysicsV0.cxx:562
Trk::RectangleBounds::r
virtual double r() const override
This method returns the maximal extension on the local plane, i.e.
Trk::RectangleBounds::halflengthEta
double halflengthEta() const
This method returns the halflength in Eta (second coordinate of local surface frame)
Trk::RectangleBounds::bv_halfY
@ bv_halfY
Definition: RectangleBounds.h:45
Trk::RectangleBounds::inside
virtual bool inside(const Amg::Vector2D &locpo, double tol1=0., double tol2=0.) const override final
This method checks if the provided local coordinates are inside the surface bounds.
SurfaceBounds.h
Trk::RectangleBounds::halflengthX
double halflengthX() const
for consistant naming
Trk::RectangleBounds::halflengthPhi
double halflengthPhi() const
This method returns the halflength in phi (first coordinate of local surface frame)
vector
Definition: MultiHisto.h:13
Trk::RectangleBounds::minDistance
virtual double minDistance(const Amg::Vector2D &pos) const override final
Minimal distance to boundary ( > 0 if outside and <=0 if inside)
Definition: RectangleBounds.cxx:118
Trk::RectangleBounds::RectangleBounds
RectangleBounds(RectangleBounds &&recbo) noexcept=default
Move constructor.
TDD_real_t
double TDD_real_t
Definition: RectangleBounds.h:14
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::RectangleBounds::~RectangleBounds
virtual ~RectangleBounds()=default
Destructor.
private
#define private
Definition: DetDescrConditionsDict_dict_fixes.cxx:13
Trk::RectangleBounds::halflengthY
double halflengthY() const
for consitant naming
Trk::RectangleBounds::type
virtual BoundsType type() const override final
Return the type of the bounds for persistency.
Definition: RectangleBounds.h:77
python.LumiBlobConversion.pos
pos
Definition: LumiBlobConversion.py:18
Trk::RectangleBounds::m_boundValues
std::vector< TDD_real_t > m_boundValues
The internal version of the bounds can be float/double.
Definition: RectangleBounds.h:119
Trk::RectangleBounds::clone
virtual RectangleBounds * clone() const override
Virtual constructor.
Trk::BoundaryCheck
Definition: BoundaryCheck.h:51
Trk::RectangleBounds::operator==
virtual bool operator==(const SurfaceBounds &sbo) const override final
Equality operator.
Definition: RectangleBounds.cxx:46
Trk::RectangleBounds::RectangleBounds
RectangleBounds()
Default Constructor - needed for persistency.
Definition: RectangleBounds.cxx:18
Trk::RectangleBounds::insideLoc2
virtual bool insideLoc2(const Amg::Vector2D &locpo, double tol2=0.) const override final
This method checks inside bounds in loc2.
TDD_real_t
double TDD_real_t
Definition: AnnulusBounds.h:20
Trk::RectangleBounds::operator=
RectangleBounds & operator=(const RectangleBounds &recbo)
Assignment Operator.
Definition: RectangleBounds.cxx:38