ATLAS Offline Software
Loading...
Searching...
No Matches
DistanceSolution.icc
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
3*/
4namespace Trk {
5inline 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
17inline int
18DistanceSolution::numberOfSolutions() const
19{
20 return m_num;
21}
22
23inline double
24DistanceSolution::first() const
25{
26 return m_first;
27}
28
29inline double
30DistanceSolution::second() const
31{
32 return m_second;
33}
34
35inline double
36DistanceSolution::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
46inline double
47DistanceSolution::toPointOfClosestApproach() const
48{
49 return m_first;
50}
51
52inline double
53DistanceSolution::currentDistance(bool signedDist) const
54{
55 if (signedDist) {
56 return m_current;
57 } else {
58 return std::abs(m_current);
59 }
60}
61
62inline bool
63DistanceSolution::signedDistance() const
64{
65 return m_signedDist;
66}
67
68} // end of namespace
69