ATLAS Offline Software
DiscTrapezoidalBounds.icc
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 namespace Trk {
6 
7 inline DiscTrapezoidalBounds*
8 DiscTrapezoidalBounds::clone() const
9 {
10  return new DiscTrapezoidalBounds(*this);
11 }
12 
13 
14 inline bool
15 DiscTrapezoidalBounds::insideLoc1(const Amg::Vector2D& locpo, double tol1) const
16 {
17  double alpha =
18  fabs(locpo[locPhi] - m_boundValues[DiscTrapezoidalBounds::bv_averagePhi]);
19  if (alpha > M_PI)
20  alpha = 2 * M_PI - alpha;
21 
22  return (locpo[locR] >
23  (m_boundValues[DiscTrapezoidalBounds::bv_rMin] *
24  cos(m_boundValues[DiscTrapezoidalBounds::bv_halfPhiSector]) /
25  cos(alpha) -
26  tol1) &&
27  locpo[locR] <
28  (m_boundValues[DiscTrapezoidalBounds::bv_rMax] *
29  cos(m_boundValues[DiscTrapezoidalBounds::bv_halfPhiSector]) /
30  cos(alpha) +
31  tol1));
32 }
33 
34 inline bool
35 DiscTrapezoidalBounds::insideLoc2(const Amg::Vector2D& locpo, double tol2) const
36 {
37  double alpha =
38  fabs(locpo[locPhi] - m_boundValues[DiscTrapezoidalBounds::bv_averagePhi]);
39  if (alpha > M_PI)
40  alpha = 2. * M_PI - alpha;
41  return (alpha <=
42  (m_boundValues[DiscTrapezoidalBounds::bv_halfPhiSector] + tol2));
43 }
44 
45 inline double
46 DiscTrapezoidalBounds::rMin() const
47 {
48  return m_boundValues[DiscTrapezoidalBounds::bv_rMin];
49 }
50 
51 inline double
52 DiscTrapezoidalBounds::rMax() const
53 {
54  return m_boundValues[DiscTrapezoidalBounds::bv_rMax];
55 }
56 
57 inline double
58 DiscTrapezoidalBounds::r() const
59 {
60  return m_boundValues[DiscTrapezoidalBounds::bv_rMax];
61 }
62 
63 inline double
64 DiscTrapezoidalBounds::averagePhi() const
65 {
66  return m_boundValues[DiscTrapezoidalBounds::bv_averagePhi];
67 }
68 
69 inline double
70 DiscTrapezoidalBounds::rCenter() const
71 {
72  return m_boundValues[DiscTrapezoidalBounds::bv_rCenter];
73 }
74 
75 inline double
76 DiscTrapezoidalBounds::stereo() const
77 {
78  return m_boundValues[DiscTrapezoidalBounds::bv_stereo];
79 }
80 
81 inline double
82 DiscTrapezoidalBounds::halfPhiSector() const
83 {
84  return m_boundValues[DiscTrapezoidalBounds::bv_halfPhiSector];
85 }
86 
87 inline double
88 DiscTrapezoidalBounds::minHalflengthX() const
89 {
90  return m_boundValues[DiscTrapezoidalBounds::bv_minHalfX];
91 }
92 
93 inline double
94 DiscTrapezoidalBounds::maxHalflengthX() const
95 {
96  return m_boundValues[DiscTrapezoidalBounds::bv_maxHalfX];
97 }
98 
99 inline double
100 DiscTrapezoidalBounds::halflengthY() const
101 {
102  return m_boundValues[DiscTrapezoidalBounds::bv_halfY];
103 }
104 
105 } // end of namespace
106