12#include "GaudiKernel/MsgStream.h"
71 double fabsY = std::abs(locpo[
Trk::locY]);
72 double max_ell = bchk.lCovariance(0, 0) > bchk.lCovariance(1, 1)
73 ? bchk.lCovariance(0, 0)
74 : bchk.lCovariance(1, 1);
75 double limit = bchk.
nSigmas * sqrt(max_ell);
79 double fabsX = std::abs(locpo[
Trk::locX]);
83 double min_ell = bchk.lCovariance(0, 0) < bchk.lCovariance(1, 1)
84 ? bchk.lCovariance(0, 0)
85 : bchk.lCovariance(1, 1);
86 limit = bchk.
nSigmas * sqrt(min_ell);
92 std::vector<KDOP> elementKDOP(3);
93 std::vector<Amg::Vector2D> elementP(4);
95 (bchk.lCovariance(1, 0) != 0 &&
96 (bchk.lCovariance(1, 1) - bchk.lCovariance(0, 0)) != 0)
97 ? .5 * bchk.
FastArcTan(2 * bchk.lCovariance(1, 0) /
98 (bchk.lCovariance(1, 1) - bchk.lCovariance(0, 0)))
105 normal << 0, -1, 1, 0;
110 elementP[0] = (rotMatrix * (p - locpo));
113 elementP[1] = (rotMatrix * (p - locpo));
119 elementP[2] = (rotMatrix * (p - locpo));
125 elementP[3] = (rotMatrix * (p - locpo));
126 std::vector<Amg::Vector2D> axis = { normal * (elementP[1] - elementP[0]),
127 normal * (elementP[3] - elementP[1]),
128 normal * (elementP[2] - elementP[0]) };
131 std::vector<KDOP> errelipseKDOP(3);
151 double fabsX = std::abs(locpo[
Trk::locX]);
152 double fabsY = std::abs(locpo[
Trk::locY]);
171 return (
isAbove(locpo, tol1, tol2, k, d));
183 double sign = alphaBiggerBeta ? -1. : 1.;
187 return (
isAbove(locpo, tol1, tol2, ka, da) &&
isAbove(locpo, tol1, tol2, kb, db));
195 double sign = k > 0. ? -1. : +1.;
208 }
else if (
m_beta != 0.) {
221 for (
int i = 0; i != Np; ++i) {
223 int j = (i == Np-1 ? 0 : i+1);
225 double x = X[i] - pos[0];
226 double y = Y[i] - pos[1];
227 double dx = X[j] - X[i];
228 double dy = Y[j] - Y[i];
229 double A =
x * dy -
y * dx;
230 double S = -(
x * dx +
y * dy);
233 double d =
x *
x +
y *
y;
237 double a = dx * dx + dy * dy;
239 double d = (
A *
A) /
a;
244 if (i && in && Ao *
A < 0.)
259 sl << std::setiosflags(std::ios::fixed);
260 sl << std::setprecision(7);
261 sl <<
"Trk::TrapezoidBounds: (minHlenghtX, maxHlengthX, hlengthY) = "
264 sl << std::setprecision(-1);
271 sl << std::setiosflags(std::ios::fixed);
272 sl << std::setprecision(7);
273 sl <<
"Trk::TrapezoidBounds: (minHlenghtX, maxHlengthX, hlengthY) = "
276 sl << std::setprecision(-1);
#define AmgMatrix(rows, cols)
The BoundaryCheck class allows to steer the way surface boundaries are used for inside/outside checks...
int nSigmas
allowed sigmas for chi2 boundary check
std::vector< Amg::Vector2D > EllipseToPoly(int resolution=3) const
bool TestKDOPKDOP(const std::vector< KDOP > &a, const std::vector< KDOP > &b) const
void ComputeKDOP(const std::vector< Amg::Vector2D > &v, const std::vector< Amg::Vector2D > &KDOPAxes, std::vector< KDOP > &kdop) const
Each Bounds has a method inside, which checks if a LocalPosition is inside the bounds.
double toleranceLoc2
absolute tolerance in local 2 coordinate
double FastArcTan(double x) const
sincosCache FastSinCos(double x) const
double toleranceLoc1
absolute tolerance in local 1 coordinate
Abstract base class for surface bounds to be specified.
void swap(double &b1, double &b2)
Swap method to be called from DiscBounds or TrapezoidalBounds.
Bounds for a trapezoidal, planar Surface.
double beta() const
This method returns the opening angle beta in point B (positive local phi)
virtual bool operator==(const SurfaceBounds &trabo) const override
Equality operator.
static bool isAbove(const Amg::Vector2D &locpo, double tol1, double tol2, double k, double d)
isAbove() method for checking whether a point lies above or under a straight line
virtual MsgStream & dump(MsgStream &sl) const override
Output Method for MsgStream.
std::vector< TDD_real_t > m_boundValues
double alpha() const
This method returns the opening angle alpha in point A (negative local phi)
virtual bool inside(const Amg::Vector2D &locpo, double tol1=0., double tol2=0.) const override
The orientation of the Trapezoid is according to the figure above, in words: the shorter of the two p...
virtual double minDistance(const Amg::Vector2D &pos) const override
Minimal distance to boundary ( > 0 if outside and <=0 if inside)
TrapezoidBounds()
Default Constructor, needed for persistency.
bool insideFull(const Amg::Vector2D &locpo, double tol1=0., double tol2=0.) const
inside() method for a full symmetric trapezoid
bool insideExclude(const Amg::Vector2D &locpo, double tol1=0., double tol2=0.) const
inside() method for the triangular exclude area for an arbitrary trapezoid
Eigen::Matrix< double, 2, 1 > Vector2D
hold the test vectors and ease the comparison