ATLAS Offline Software
DiscBounds.icc
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3 */
4 namespace Trk {
5 inline DiscBounds*
6 DiscBounds::clone() const
7 {
8  return new DiscBounds(*this);
9 }
10 
11 
12 inline bool
13 DiscBounds::insideLoc1(const Amg::Vector2D& locpo, double tol1) const
14 {
15  return (locpo[locR] > (m_boundValues[DiscBounds::bv_rMin] - tol1) &&
16  locpo[locR] < (m_boundValues[DiscBounds::bv_rMax] + tol1));
17 }
18 
19 inline bool
20 DiscBounds::insideLoc2(const Amg::Vector2D& locpo, double tol2) const
21 {
22  double alpha = fabs(locpo[locPhi] - m_boundValues[DiscBounds::bv_averagePhi]);
23  if (alpha > M_PI)
24  alpha = 2. * M_PI - alpha;
25  // alpha -= alpha > M_PI ? 2.*M_PI : 0.;
26  // alpha += alpha < -M_PI ? 2.*M_PI : 0.;
27  bool insidePhi =
28  (alpha <= (m_boundValues[DiscBounds::bv_halfPhiSector] + tol2));
29  return insidePhi;
30 }
31 
32 inline double
33 DiscBounds::rMin() const
34 {
35  return m_boundValues[DiscBounds::bv_rMin];
36 }
37 
38 inline double
39 DiscBounds::rMax() const
40 {
41  return m_boundValues[DiscBounds::bv_rMax];
42 }
43 
44 inline double
45 DiscBounds::r() const
46 {
47  return m_boundValues[DiscBounds::bv_rMax];
48 }
49 
50 inline double
51 DiscBounds::averagePhi() const
52 {
53  return m_boundValues[DiscBounds::bv_averagePhi];
54 }
55 
56 inline double
57 DiscBounds::halfPhiSector() const
58 {
59  return m_boundValues[DiscBounds::bv_halfPhiSector];
60 }
61 
62 } // end of namespace
63