ATLAS Offline Software
RotatedTrapezoidBounds.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 inline RotatedTrapezoidBounds*
7 RotatedTrapezoidBounds::clone() const
8 {
9  return new RotatedTrapezoidBounds(*this);
10 }
11 
12 inline double
13 RotatedTrapezoidBounds::halflengthX() const
14 {
15  return m_boundValues[RotatedTrapezoidBounds::bv_halfX];
16 }
17 
18 inline double
19 RotatedTrapezoidBounds::minHalflengthY() const
20 {
21  return m_boundValues[RotatedTrapezoidBounds::bv_minHalfY];
22 }
23 
24 inline double
25 RotatedTrapezoidBounds::maxHalflengthY() const
26 {
27  return m_boundValues[RotatedTrapezoidBounds::bv_maxHalfY];
28 }
29 
30 inline double
31 RotatedTrapezoidBounds::r() const
32 {
33  return sqrt(m_boundValues[RotatedTrapezoidBounds::bv_halfX] *
34  m_boundValues[RotatedTrapezoidBounds::bv_halfX] +
35  m_boundValues[RotatedTrapezoidBounds::bv_maxHalfY] *
36  m_boundValues[RotatedTrapezoidBounds::bv_maxHalfY]);
37 }
38 
39 inline bool
40 RotatedTrapezoidBounds::insideLoc1(const Amg::Vector2D& pos,
41  double tol1) const
42 {
43  const Amg::Vector2D locpo = m_rotMat * pos;
44  return (std::abs(locpo[locX]) <
45  m_boundValues[RotatedTrapezoidBounds::bv_halfX] + tol1);
46 }
47 
48 inline bool
49 RotatedTrapezoidBounds::insideLoc2(const Amg::Vector2D& pos,
50  double tol2) const
51 {
52  const Amg::Vector2D locpo = m_rotMat * pos;
53  return (std::abs(locpo[locY]) <
54  m_boundValues[RotatedTrapezoidBounds::bv_maxHalfY] + tol2);
55 }
56 } // end of namespace
57