ATLAS Offline Software
Loading...
Searching...
No Matches
TriangleBounds.icc
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3*/
4
5namespace Trk {
6
7inline TriangleBounds*
8TriangleBounds::clone() const
9{
10 return new TriangleBounds(*this);
11}
12
13
14inline bool
15TriangleBounds::insideLoc1(const Amg::Vector2D& locpo, double tol1) const
16{
17 return inside(locpo, tol1, tol1);
18}
19
20inline bool
21TriangleBounds::insideLoc2(const Amg::Vector2D& locpo, double tol2) const
22{
23 return inside(locpo, tol2, tol2);
24}
25
26inline std::vector<std::pair<TDD_real_t, TDD_real_t>>
27TriangleBounds::vertices() const
28{
29 std::vector<std::pair<TDD_real_t, TDD_real_t>> vertices;
30 vertices.resize(3);
31 for (size_t iv = 0; iv < 3; iv++)
32 vertices.emplace_back(m_boundValues[2 * iv], m_boundValues[2 * iv + 1]);
33 return vertices;
34}
35
36inline double
37TriangleBounds::r() const
38{
39 double rmax = 0.;
40 for (size_t iv = 0; iv < 3; iv++)
41 rmax = fmax(rmax,
42 m_boundValues[2 * iv] * m_boundValues[2 * iv] +
43 m_boundValues[2 * iv + 1] * m_boundValues[2 * iv + 1]);
44 return std::sqrt(rmax);
45}
46
47} // end of namespace
48