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