ATLAS Offline Software
Loading...
Searching...
No Matches
ConeBounds.icc
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3*/
4
5namespace Trk {
6inline bool ConeBounds::operator==(const ConeBounds& bo) const
7{
8 return *this == static_cast<const SurfaceBounds& >(bo);
9}
10
11inline ConeBounds*
12ConeBounds::clone() const
13{
14 return new ConeBounds(*this);
15}
16
17inline bool
18ConeBounds::inside(const Amg::Vector2D& locpo, double tol1, double tol2) const
19{
20 double z = locpo[locZ];
21 bool insideZ = z > (m_boundValues[ConeBounds::bv_minZ] - tol2) &&
22 z < (m_boundValues[ConeBounds::bv_maxZ] + tol2);
23 if (!insideZ)
24 return false;
25 // TODO: Do we need some sort of "R" tolerance also here (take
26 // it off the z tol2 in that case?) or does the rphi tol1 cover
27 // this? (Could argue either way)
28 double coneR = z * m_tanAlpha;
29 double minRPhi = coneR * minPhi() - tol1;
30 double maxRPhi = coneR * maxPhi() + tol1;
31 return minRPhi < locpo[locRPhi] && locpo[locRPhi] < maxRPhi;
32}
33
34inline bool
35ConeBounds::inside(const Amg::Vector3D& glopo, double tol1, double tol2) const
36{
37 // coords are (rphi,z)
38 return inside(
39 Amg::Vector2D(glopo.perp() * glopo.phi(), glopo.z()), tol1, tol2);
40}
41
42inline bool
43ConeBounds::inside(const Amg::Vector3D& glopo, const BoundaryCheck& bchk) const
44{
45 // coords are (rphi,z)
46 return inside(Amg::Vector2D(glopo.perp() * glopo.phi(), glopo.z()),
47 bchk.toleranceLoc1,
48 bchk.toleranceLoc2);
49}
50
51inline bool
52ConeBounds::inside(const Amg::Vector2D& locpo, const BoundaryCheck& bchk) const
53{
54 return ConeBounds::inside(locpo, bchk.toleranceLoc1, bchk.toleranceLoc2);
55}
56
57inline bool
58ConeBounds::insideLoc1(const Amg::Vector2D& locpo, double tol1) const
59{
60 double z = locpo[locZ];
61 double coneR = z * m_tanAlpha;
62 double minRPhi = coneR * minPhi() - tol1;
63 double maxRPhi = coneR * maxPhi() + tol1;
64 return minRPhi < locpo[locRPhi] && locpo[locRPhi] < maxRPhi;
65}
66
67inline bool
68ConeBounds::insideLoc2(const Amg::Vector2D& locpo, double tol2) const
69{
70 double z = locpo[locZ];
71 return (z > (m_boundValues[ConeBounds::bv_minZ] - tol2) &&
72 z < (m_boundValues[ConeBounds::bv_maxZ] + tol2));
73}
74
75inline double
76ConeBounds::r() const
77{
78 double z = fabs(m_boundValues[ConeBounds::bv_maxZ]);
79 double mz = fabs(m_boundValues[ConeBounds::bv_minZ]);
80 if (mz > z)
81 z = mz;
82 return fabs(z * m_tanAlpha);
83}
84
85inline double
86ConeBounds::r(double z) const
87{
88 return fabs(z * m_tanAlpha);
89}
90
91inline double
92ConeBounds::tanAlpha() const
93{
94 return m_tanAlpha;
95}
96
97inline double
98ConeBounds::sinAlpha() const
99{
100 return m_sinAlpha;
101}
102
103inline double
104ConeBounds::cosAlpha() const
105{
106 return m_cosAlpha;
107}
108
109inline double
110ConeBounds::alpha() const
111{
112 return m_boundValues[ConeBounds::bv_alpha];
113}
114
115inline double
116ConeBounds::minZ() const
117{
118 return m_boundValues[ConeBounds::bv_minZ];
119}
120
121inline double
122ConeBounds::maxZ() const
123{
124 return m_boundValues[ConeBounds::bv_maxZ];
125}
126
127inline double
128ConeBounds::averagePhi() const
129{
130 return m_boundValues[ConeBounds::bv_averagePhi];
131}
132
133inline double
134ConeBounds::halfPhiSector() const
135{
136 return m_boundValues[ConeBounds::bv_halfPhiSector];
137}
138
139}
140