ATLAS Offline Software
DistanceSolution.icc
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
3 */
4 namespace Trk {
5 inline DistanceSolution::DistanceSolution(int num,
6  double current,
7  bool signedDist,
8  double first,
9  double second)
10  : m_first(first)
11  , m_second(second)
12  , m_current(current)
13  , m_num(num)
14  , m_signedDist(signedDist)
15 {}
16 
17 inline int
18 DistanceSolution::numberOfSolutions() const
19 {
20  return m_num;
21 }
22 
23 inline double
24 DistanceSolution::first() const
25 {
26  return m_first;
27 }
28 
29 inline double
30 DistanceSolution::second() const
31 {
32  return m_second;
33 }
34 
35 inline double
36 DistanceSolution::absClosest() const
37 {
38  if (m_num > 1) {
39  return (m_first * m_first < m_second * m_second) ? std::abs(m_first)
40  : std::abs(m_second);
41  } else {
42  return std::abs(m_first);
43  }
44 }
45 
46 inline double
47 DistanceSolution::toPointOfClosestApproach() const
48 {
49  return m_first;
50 }
51 
52 inline double
53 DistanceSolution::currentDistance(bool signedDist) const
54 {
55  if (signedDist) {
56  return m_current;
57  } else {
58  return std::abs(m_current);
59  }
60 }
61 
62 inline bool
63 DistanceSolution::signedDistance() const
64 {
65  return m_signedDist;
66 }
67 
68 } // end of namespace
69