ATLAS Offline Software
RotatedDiamondBounds.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 // RotatedDiamondBounds.h, (c) ATLAS Detector software
8 
9 #ifndef TRKSURFACES_ROTATEDDIAMONDDBOUNDS_H
10 #define TRKSURFACES_ROTATEDDIAMONDDBOUNDS_H
11 
15 
16 #include <math.h>
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 {
43 
44 public:
47  {
51  bv_halfY1 = 3,
52  bv_halfY2 = 4,
53  bv_length = 5
54  };
55 
58 
60  RotatedDiamondBounds(const RotatedDiamondBounds& diabo) = default;
61 
64 
66  RotatedDiamondBounds(RotatedDiamondBounds&& diabo) noexcept = default;
67 
70 
72  virtual ~RotatedDiamondBounds() = default;
73 
75  RotatedDiamondBounds(double minhalex, double medhalex, double maxhalex, double haley1, double haley2);
76 
78  RotatedDiamondBounds* clone() const override;
79 
81  virtual bool operator==(const SurfaceBounds& diabo) const override;
82 
84  virtual BoundsType type() const override { return SurfaceBounds::Diamond; }
85 
87  double minHalflengthX() const;
88 
90  double medHalflengthX() const;
91 
93  double maxHalflengthX() const;
94 
96  double halflengthY1() const;
97  double halflengthY2() const;
98 
100  virtual double r() const override;
101 
103  double alpha1() const;
104 
106  double alpha2() const;
107 
109  virtual bool inside(const Amg::Vector2D& locpo, double tol1 = 0., double tol2 = 0.) const override;
110  virtual bool inside(const Amg::Vector2D& locpo, const BoundaryCheck& bchk) const override;
111 
117  virtual bool insideLoc1(const Amg::Vector2D& locpo, double tol1 = 0.) const override;
118 
124  virtual bool insideLoc2(const Amg::Vector2D& locpo, double tol2 = 0.) const override;
125 
127  virtual double minDistance(const Amg::Vector2D& pos) const override;
128 
130  virtual MsgStream& dump(MsgStream& sl) const override;
131 
133  virtual std::ostream& dump(std::ostream& sl) const override;
134 
135 private:
136  friend class ::RotatedDiamondBoundsCnv_p1;
137 
139  bool insideFull(const Amg::Vector2D& locpo, double tol1 = 0., double tol2 = 0.) const;
140 
142  virtual void initCache() override;
143 
145  std::vector<TDD_real_t> m_boundValues;
148 };
149 
150 } // end of namespace
151 
153 #endif // TRKSURFACES_DIAMONDBOUNDS_H
Trk::SurfaceBounds::BoundsType
BoundsType
Definition: SurfaceBounds.h:59
Amg::Vector2D
Eigen::Matrix< double, 2, 1 > Vector2D
Definition: GeoPrimitives.h:48
Trk::SurfaceBounds
Definition: SurfaceBounds.h:47
Trk::RotatedDiamondBounds::halflengthY1
double halflengthY1() const
This method returns the halflength in Y of trapezoid at negative/positive Y (second coordinate)
Trk::RotatedDiamondBounds::inside
virtual bool inside(const Amg::Vector2D &locpo, double tol1=0., double tol2=0.) const override
The orientation of the Diamond is according to the figure.
Definition: RotatedDiamondBounds.cxx:155
Trk::RotatedDiamondBounds::r
virtual double r() const override
This method returns the maximal extension on the local plane.
TDD_real_t
double TDD_real_t
Definition: RotatedDiamondBounds.h:19
Trk::RotatedDiamondBounds::medHalflengthX
double medHalflengthX() const
This method returns the (maximal) halflength in X (first coordinate of local surface frame)
Trk::RotatedDiamondBounds::initCache
virtual void initCache() override
initialize the alpha1/2 cache - needed also for object persistency
Definition: RotatedDiamondBounds.cxx:45
Trk::RotatedDiamondBounds::~RotatedDiamondBounds
virtual ~RotatedDiamondBounds()=default
Destructor.
Trk::SurfaceBounds::Diamond
@ Diamond
Definition: SurfaceBounds.h:62
Trk::RotatedDiamondBounds::alpha2
double alpha2() const
This method returns the opening angle alpha in point A'
Definition: RotatedDiamondBounds.cxx:197
ParamDefs.h
Trk::RotatedDiamondBounds::minDistance
virtual double minDistance(const Amg::Vector2D &pos) const override
Minimal distance to boundary ( > 0 if outside and <=0 if inside)
Definition: RotatedDiamondBounds.cxx:203
Trk::RotatedDiamondBounds::m_alpha1
TDD_real_t m_alpha1
Definition: RotatedDiamondBounds.h:146
Trk::RotatedDiamondBounds::m_alpha2
TDD_real_t m_alpha2
Definition: RotatedDiamondBounds.h:147
Trk::RotatedDiamondBounds::bv_maxHalfX
@ bv_maxHalfX
Definition: RotatedDiamondBounds.h:50
GeoPrimitives.h
SurfaceBounds.h
Trk::RotatedDiamondBounds::alpha1
double alpha1() const
This method returns the opening angle alpha in point A
Definition: RotatedDiamondBounds.cxx:190
Trk::RotatedDiamondBounds::maxHalflengthX
double maxHalflengthX() const
This method returns the halflength in X at maximal Y (first coordinate of local surface frame)
Trk::RotatedDiamondBounds::dump
virtual MsgStream & dump(MsgStream &sl) const override
Output Method for MsgStream.
Definition: RotatedDiamondBounds.cxx:255
Trk::RotatedDiamondBounds::bv_halfY1
@ bv_halfY1
Definition: RotatedDiamondBounds.h:51
Trk::RotatedDiamondBounds::insideLoc1
virtual bool insideLoc1(const Amg::Vector2D &locpo, double tol1=0.) const override
This method checks inside bounds in loc1.
Trk::RotatedDiamondBounds::bv_length
@ bv_length
Definition: RotatedDiamondBounds.h:53
Trk::RotatedDiamondBounds::clone
RotatedDiamondBounds * clone() const override
Virtual constructor.
Trk::RotatedDiamondBounds::m_boundValues
std::vector< TDD_real_t > m_boundValues
Internal parameters stored in the geometry.
Definition: RotatedDiamondBounds.h:145
Trk
Ensure that the ATLAS eigen extensions are properly loaded.
Definition: FakeTrackBuilder.h:9
Trk::RotatedDiamondBounds::halflengthY2
double halflengthY2() const
Trk::RotatedDiamondBounds::bv_minHalfX
@ bv_minHalfX
Definition: RotatedDiamondBounds.h:48
Trk::RotatedDiamondBounds::insideLoc2
virtual bool insideLoc2(const Amg::Vector2D &locpo, double tol2=0.) const override
This method checks inside bounds in loc2.
Trk::RotatedDiamondBounds::BoundValues
BoundValues
BoundValues for better readability.
Definition: RotatedDiamondBounds.h:47
python.LumiBlobConversion.pos
pos
Definition: LumiBlobConversion.py:18
Trk::RotatedDiamondBounds::bv_medHalfX
@ bv_medHalfX
Definition: RotatedDiamondBounds.h:49
Trk::RotatedDiamondBounds::RotatedDiamondBounds
RotatedDiamondBounds(RotatedDiamondBounds &&diabo) noexcept=default
Move constructor.
Trk::BoundaryCheck
Definition: BoundaryCheck.h:51
Trk::RotatedDiamondBounds::operator=
RotatedDiamondBounds & operator=(RotatedDiamondBounds &&sbo) noexcept=default
Assignment operator.
Trk::RotatedDiamondBounds::insideFull
bool insideFull(const Amg::Vector2D &locpo, double tol1=0., double tol2=0.) const
inside() method for a full symmetric diamond
Definition: RotatedDiamondBounds.cxx:162
Trk::RotatedDiamondBounds::minHalflengthX
double minHalflengthX() const
This method returns the halflength in X at minimal Y (first coordinate of local surface frame)
Trk::RotatedDiamondBounds::RotatedDiamondBounds
RotatedDiamondBounds()
Default Constructor, needed for persistency.
Definition: RotatedDiamondBounds.cxx:19
Trk::RotatedDiamondBounds::type
virtual BoundsType type() const override
Return the bounds type.
Definition: RotatedDiamondBounds.h:84
Trk::RotatedDiamondBounds::RotatedDiamondBounds
RotatedDiamondBounds(const RotatedDiamondBounds &diabo)=default
Copy constructor.
Trk::RotatedDiamondBounds::operator=
RotatedDiamondBounds & operator=(const RotatedDiamondBounds &sbo)=default
Assignment operator.
Trk::RotatedDiamondBounds
Definition: RotatedDiamondBounds.h:42
Trk::RotatedDiamondBounds::bv_halfY2
@ bv_halfY2
Definition: RotatedDiamondBounds.h:52
RotatedDiamondBoundsCnv_p1
Definition: RotatedDiamondBoundsCnv_p1.h:23
TDD_real_t
double TDD_real_t
Definition: AnnulusBounds.h:20
Trk::RotatedDiamondBounds::operator==
virtual bool operator==(const SurfaceBounds &diabo) const override
Equality operator.
Definition: RotatedDiamondBounds.cxx:55
RotatedDiamondBounds.icc