ATLAS Offline Software
RectangleBounds.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 RectangleBounds*
7 RectangleBounds::clone() const
8 {
9  return new RectangleBounds(*this);
10 }
11 
12 inline bool
13 RectangleBounds::inside(const Amg::Vector2D& locpo,
14  double tol1,
15  double tol2) const
16 {
17  return (
18  (fabs(locpo[locX]) < m_boundValues[RectangleBounds::bv_halfX] + tol1) &&
19  (fabs(locpo[locY]) < m_boundValues[RectangleBounds::bv_halfY] + tol2));
20 }
21 
22 inline bool
23 RectangleBounds::insideLoc1(const Amg::Vector2D& locpo, double tol1) const
24 {
25  return (fabs(locpo[locX]) < m_boundValues[RectangleBounds::bv_halfX] + tol1);
26 }
27 
28 inline bool
29 RectangleBounds::insideLoc2(const Amg::Vector2D& locpo, double tol2) const
30 {
31  return (fabs(locpo[locY]) < m_boundValues[RectangleBounds::bv_halfY] + tol2);
32 }
33 
34 inline double
35 RectangleBounds::halflengthPhi() const
36 {
37  return this->halflengthX();
38 }
39 
40 inline double
41 RectangleBounds::halflengthEta() const
42 {
43  return this->halflengthY();
44 }
45 
46 inline double
47 RectangleBounds::halflengthX() const
48 {
49  return m_boundValues[RectangleBounds::bv_halfX];
50 }
51 
52 inline double
53 RectangleBounds::halflengthY() const
54 {
55  return m_boundValues[RectangleBounds::bv_halfY];
56 }
57 
58 inline double
59 RectangleBounds::r() const
60 {
61  return sqrt(m_boundValues[RectangleBounds::bv_halfX] *
62  m_boundValues[RectangleBounds::bv_halfX] +
63  m_boundValues[RectangleBounds::bv_halfY] *
64  m_boundValues[RectangleBounds::bv_halfY]);
65 }
66 
67 } // end of namespace
68