ATLAS Offline Software
DiamondBounds.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 // DiamondBounds.h, (c) ATLAS Detector software
8 
9 #ifndef TRKSURFACES_DIAMONDDBOUNDS_H
10 #define TRKSURFACES_DIAMONDDBOUNDS_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 
36 class DiamondBounds final: public SurfaceBounds
37 {
38 
39 public:
42  {
46  bv_halfY1 = 3,
47  bv_halfY2 = 4,
48  bv_length = 5
49  };
50 
52  DiamondBounds();
53 
55  DiamondBounds(const DiamondBounds& diabo) = default;
56 
58  DiamondBounds& operator=(const DiamondBounds& sbo) = default;
59 
61  DiamondBounds(DiamondBounds&& diabo) noexcept = default;
62 
64  DiamondBounds& operator=(DiamondBounds&& sbo) noexcept = default;
65 
67  virtual ~DiamondBounds() = default;
68 
70  DiamondBounds(double minhalex, double medhalex, double maxhalex, double haley1, double haley2);
71 
73  DiamondBounds* clone() const override;
74 
76  virtual bool operator==(const SurfaceBounds& diabo) const override;
77 
79  virtual BoundsType type() const override final { return SurfaceBounds::Diamond; }
80 
82  double minHalflengthX() const;
83 
85  double medHalflengthX() const;
86 
88  double maxHalflengthX() const;
89 
91  double halflengthY1() const;
92  double halflengthY2() const;
93 
95  virtual double r() const override final;
96 
98  double alpha1() const;
99 
101  double alpha2() const;
102 
104  virtual bool inside(const Amg::Vector2D& locpo, double tol1 = 0., double tol2 = 0.) const override final;
105  virtual bool inside(const Amg::Vector2D& locpo, const BoundaryCheck& bchk) const override final;
106 
112  virtual bool insideLoc1(const Amg::Vector2D& locpo, double tol1 = 0.) const override final;
113 
119  virtual bool insideLoc2(const Amg::Vector2D& locpo, double tol2 = 0.) const override final;
120 
122  virtual double minDistance(const Amg::Vector2D& pos) const override final;
123 
125  virtual MsgStream& dump(MsgStream& sl) const override final;
126 
128  virtual std::ostream& dump(std::ostream& sl) const override final;
129 
130 private:
131  friend class ::DiamondBoundsCnv_p1;
132 
134  bool insideFull(const Amg::Vector2D& locpo, double tol1 = 0., double tol2 = 0.) const;
135 
137  virtual void initCache() override;
138 
143 };
144 
145 } // end of namespace
146 
147 #include "TrkSurfaces/DiamondBounds.icc"
148 #endif // TRKSURFACES_DIAMONDBOUNDS_H
Trk::DiamondBounds::r
virtual double r() const override final
This method returns the maximal extension on the local plane.
Trk::SurfaceBounds::BoundsType
BoundsType
Definition: SurfaceBounds.h:59
Trk::DiamondBounds::halflengthY2
double halflengthY2() const
Trk::DiamondBounds::insideFull
bool insideFull(const Amg::Vector2D &locpo, double tol1=0., double tol2=0.) const
inside() method for a full symmetric diamond
Definition: DiamondBounds.cxx:150
Trk::DiamondBounds::minDistance
virtual double minDistance(const Amg::Vector2D &pos) const override final
Minimal distance to boundary ( > 0 if outside and <=0 if inside)
Definition: DiamondBounds.cxx:192
Trk::DiamondBounds::insideLoc1
virtual bool insideLoc1(const Amg::Vector2D &locpo, double tol1=0.) const override final
This method checks inside bounds in loc1.
Trk::DiamondBounds::alpha2
double alpha2() const
This method returns the opening angle alpha in point A'
Definition: DiamondBounds.cxx:186
Trk::DiamondBounds::DiamondBounds
DiamondBounds(const DiamondBounds &diabo)=default
Copy constructor.
Amg::Vector2D
Eigen::Matrix< double, 2, 1 > Vector2D
Definition: GeoPrimitives.h:48
Trk::SurfaceBounds
Definition: SurfaceBounds.h:47
Trk::DiamondBounds::minHalflengthX
double minHalflengthX() const
This method returns the halflength in X at minimal Y (first coordinate of local surface frame)
Trk::DiamondBounds::operator==
virtual bool operator==(const SurfaceBounds &diabo) const override
Equality operator.
Definition: DiamondBounds.cxx:50
Trk::DiamondBounds::initCache
virtual void initCache() override
initialize the alpha1/2 cache - needed also for object persistency
Definition: DiamondBounds.cxx:40
Trk::SurfaceBounds::Diamond
@ Diamond
Definition: SurfaceBounds.h:62
const
bool const RAWDATA *ch2 const
Definition: LArRodBlockPhysicsV0.cxx:560
Trk::DiamondBounds::inside
virtual bool inside(const Amg::Vector2D &locpo, double tol1=0., double tol2=0.) const override final
The orientation of the Diamond is according to the figure.
Definition: DiamondBounds.cxx:61
ParamDefs.h
Trk::DiamondBounds::operator=
DiamondBounds & operator=(const DiamondBounds &sbo)=default
Assignment operator.
Trk::DiamondBounds::medHalflengthX
double medHalflengthX() const
This method returns the (maximal) halflength in X (first coordinate of local surface frame)
GeoPrimitives.h
Trk::DiamondBounds::m_alpha1
TDD_real_t m_alpha1
Definition: DiamondBounds.h:141
SurfaceBounds.h
Trk::DiamondBounds::m_boundValues
std::vector< TDD_real_t > m_boundValues
Internal parameters stored in the geometry.
Definition: DiamondBounds.h:140
Trk::DiamondBounds::bv_medHalfX
@ bv_medHalfX
Definition: DiamondBounds.h:44
Trk::DiamondBounds
Definition: DiamondBounds.h:37
Trk::DiamondBounds::~DiamondBounds
virtual ~DiamondBounds()=default
Destructor.
DiamondBoundsCnv_p1
Definition: DiamondBoundsCnv_p1.h:23
vector
Definition: MultiHisto.h:13
Trk::DiamondBounds::bv_halfY1
@ bv_halfY1
Definition: DiamondBounds.h:46
Trk::DiamondBounds::clone
DiamondBounds * clone() const override
Virtual constructor.
Trk::DiamondBounds::operator=
DiamondBounds & operator=(DiamondBounds &&sbo) noexcept=default
Assignment operator.
Trk::DiamondBounds::DiamondBounds
DiamondBounds()
Default Constructor, needed for persistency.
Definition: DiamondBounds.cxx:19
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
private
#define private
Definition: DetDescrConditionsDict_dict_fixes.cxx:13
TDD_real_t
double TDD_real_t
Definition: DiamondBounds.h:19
Trk::DiamondBounds::bv_maxHalfX
@ bv_maxHalfX
Definition: DiamondBounds.h:45
Trk::DiamondBounds::type
virtual BoundsType type() const override final
Return the bounds type.
Definition: DiamondBounds.h:79
Trk::DiamondBounds::maxHalflengthX
double maxHalflengthX() const
This method returns the halflength in X at maximal Y (first coordinate of local surface frame)
python.LumiBlobConversion.pos
pos
Definition: LumiBlobConversion.py:18
Trk::DiamondBounds::BoundValues
BoundValues
BoundValues for better readability.
Definition: DiamondBounds.h:42
Trk::DiamondBounds::dump
virtual MsgStream & dump(MsgStream &sl) const override final
Output Method for MsgStream.
Definition: DiamondBounds.cxx:243
Trk::DiamondBounds::halflengthY1
double halflengthY1() const
This method returns the halflength in Y of trapezoid at negative/positive Y (second coordinate)
Trk::BoundaryCheck
Definition: BoundaryCheck.h:51
Trk::DiamondBounds::bv_minHalfX
@ bv_minHalfX
Definition: DiamondBounds.h:43
Trk::DiamondBounds::m_alpha2
TDD_real_t m_alpha2
Definition: DiamondBounds.h:142
Trk::DiamondBounds::bv_length
@ bv_length
Definition: DiamondBounds.h:48
Trk::DiamondBounds::DiamondBounds
DiamondBounds(DiamondBounds &&diabo) noexcept=default
Copy constructor.
Trk::DiamondBounds::alpha1
double alpha1() const
This method returns the opening angle alpha in point A
Definition: DiamondBounds.cxx:179
Trk::DiamondBounds::bv_halfY2
@ bv_halfY2
Definition: DiamondBounds.h:47
TDD_real_t
double TDD_real_t
Definition: AnnulusBounds.h:20
Trk::DiamondBounds::insideLoc2
virtual bool insideLoc2(const Amg::Vector2D &locpo, double tol2=0.) const override final
This method checks inside bounds in loc2.