12 #include "GaudiKernel/MsgStream.h"
27 for (
const std::pair<float, float>&
p :
vertices) {
41 for (
const std::pair<double, double>&
p :
vertices) {
81 std::pair<double, double> locT(
84 std::pair<double, double> locV(
89 if (locT.first * locT.first + locT.second * locT.second < tol1 * tol1)
93 double db = locB.first * locV.second - locB.second * locV.first;
94 if (std::abs(
db) < tol1) {
96 (locB.first != 0) ? -locV.first / locB.first : -locV.second / locB.second;
97 return a > -tol2 &&
a - 1. < tol2;
100 double dn = locB.first * locT.second - locB.second * locT.first;
102 if (std::abs(
dn) > std::abs(tol1)) {
103 double t = (locB.first * locV.second - locB.second * locV.first) /
dn;
107 double a = (locB.first != 0.)
108 ? (
t * locT.first - locV.first) / locB.first
109 : (
t * locT.second - locV.second) / locB.second;
110 if (a < -tol2 || a - 1. > tol2)
129 double max_ell = bchk.lCovariance(0, 0) > bchk.lCovariance(1, 1)
130 ? bchk.lCovariance(0, 0)
131 : bchk.lCovariance(1, 1);
134 if (fabsR > (r_max +
limit))
138 std::vector<KDOP> elementKDOP(3);
139 std::vector<Amg::Vector2D> elementP(3);
141 (bchk.lCovariance(1, 0) != 0 &&
142 (bchk.lCovariance(1, 1) - bchk.lCovariance(0, 0)) != 0)
143 ? .5 * bchk.
FastArcTan(2 * bchk.lCovariance(1, 0) /
144 (bchk.lCovariance(1, 1) - bchk.lCovariance(0, 0)))
151 normal << 0, -1, 1, 0;
157 elementP[0] = (rotMatrix * (
p - locpo));
160 elementP[1] = (rotMatrix * (
p - locpo));
163 elementP[2] = (rotMatrix * (
p - locpo));
164 std::vector<Amg::Vector2D>
axis = { normal * (elementP[1] - elementP[0]),
165 normal * (elementP[2] - elementP[1]),
166 normal * (elementP[2] - elementP[0]) };
169 std::vector<KDOP> errelipseKDOP(3);
191 for (
int i = 0;
i != Np; ++
i) {
193 int j = (
i == Np-1 ? 0 :
i+1);
197 double dx =
X[j] -
X[
i];
198 double dy =
Y[j] -
Y[
i];
203 double d =
x *
x +
y *
y;
209 double d = (
A *
A) /
a;
214 if (
i && in && Ao *
A < 0.)
228 sl << std::setiosflags(std::ios::fixed);
229 sl << std::setprecision(7);
230 sl <<
"Trk::TriangleBounds: generating vertices (X, Y) " <<
'\n';
234 sl << std::setprecision(-1);
241 sl << std::setiosflags(std::ios::fixed);
242 sl << std::setprecision(7);
243 sl <<
"Trk::TriangleBounds: generating vertices (X, Y)";
247 sl << std::setprecision(-1);