12#include "GaudiKernel/MsgStream.h"
27 double maxhalex,
double haley1,
double haley2)
34 if (minhalex > maxhalex)
74 double max_ell = bchk.lCovariance(0, 0) > bchk.lCovariance(1, 1)
75 ? bchk.lCovariance(0, 0)
76 : bchk.lCovariance(1, 1);
77 double limit = bchk.
nSigmas * sqrt(max_ell);
83 double fabsX = std::abs(locpo[
Trk::locX]);
87 double min_ell = bchk.lCovariance(0, 0) < bchk.lCovariance(1, 1)
88 ? bchk.lCovariance(0, 0)
89 : bchk.lCovariance(1, 1);
90 limit = bchk.
nSigmas * sqrt(min_ell);
102 std::vector<KDOP> elementKDOP(5);
103 std::vector<Amg::Vector2D> elementP(6);
105 (bchk.lCovariance(1, 0) != 0 &&
106 (bchk.lCovariance(1, 1) - bchk.lCovariance(0, 0)) != 0)
107 ? .5 * bchk.
FastArcTan(2 * bchk.lCovariance(1, 0) /
108 (bchk.lCovariance(1, 1) - bchk.lCovariance(0, 0)))
115 normal << 0, -1, 1, 0;
121 elementP[0] = (rotMatrix * (p - locpo));
123 elementP[1] = (rotMatrix * (p - locpo));
126 elementP[2] = (rotMatrix * (p - locpo));
129 elementP[3] = (rotMatrix * (p - locpo));
131 elementP[4] = (rotMatrix * (p - locpo));
134 elementP[5] = (rotMatrix * (p - locpo));
135 std::vector<Amg::Vector2D> axis = { normal * (elementP[1] - elementP[0]),
136 normal * (elementP[2] - elementP[1]),
137 normal * (elementP[3] - elementP[2]),
138 normal * (elementP[4] - elementP[3]),
139 normal * (elementP[5] - elementP[4]) };
142 std::vector<KDOP> errelipseKDOP(5);
159 double absX = std::abs(locpo[
Trk::locX]);
171 double k = halfH ? 0.5*(halfBaseUp - halfBaseLo)/halfH : 0.;
172 double sign = (k < 0) ? -1. : 1.;
202 double Y[6] = { -y1, 0., y2, y2, 0., -y1 };
208 for (
int i = 0; i != Np; ++i) {
210 int j = (i == Np-1 ? 0 : i+1);
212 double x = X[i] - pos[0];
213 double y = Y[i] - pos[1];
214 double dx = X[j] - X[i];
215 double dy = Y[j] - Y[i];
216 double A =
x * dy -
y * dx;
217 double S = -(
x * dx +
y * dy);
220 double d =
x *
x +
y *
y;
224 double a = dx * dx + dy * dy;
226 double d = (
A *
A) /
a;
231 if (i && in && Ao *
A < 0.)
245 sl << std::setiosflags(std::ios::fixed);
246 sl << std::setprecision(7);
247 sl <<
"Trk::DiamondBounds: (minHlenghtX, medHlengthX, maxHlengthX, hlengthY1, hlengthY2 ) = ";
251 sl << std::setprecision(-1);
258 sl << std::setiosflags(std::ios::fixed);
259 sl << std::setprecision(7);
260 sl <<
"Trk::DiamondBounds: (minHlenghtX, medHlengthX, maxHlengthX, hlengthY1, hlengthY2 ) = ";
264 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
Bounds for a double trapezoidal ("diamond"), planar Surface.
virtual bool inside(const Amg::Vector2D &locpo, double tol1=0., double tol2=0.) const override final
The orientation of the Diamond is according to the figure.
virtual MsgStream & dump(MsgStream &sl) const override final
Output Method for MsgStream.
virtual bool operator==(const SurfaceBounds &diabo) const override
Equality operator.
double alpha1() const
This method returns the opening angle alpha in point A.
DiamondBounds()
Default Constructor, needed for persistency.
bool insideFull(const Amg::Vector2D &locpo, double tol1=0., double tol2=0.) const
inside() method for a full symmetric diamond
std::vector< TDD_real_t > m_boundValues
Internal parameters stored in the geometry.
virtual void initCache() override
initialize the alpha1/2 cache - needed also for object persistency
virtual double minDistance(const Amg::Vector2D &pos) const override final
Minimal distance to boundary ( > 0 if outside and <=0 if inside)
double alpha2() const
This method returns the opening angle alpha in point A'.
Abstract base class for surface bounds to be specified.
void swap(double &b1, double &b2)
Swap method to be called from DiscBounds or TrapezoidalBounds.
Eigen::Matrix< double, 2, 1 > Vector2D
hold the test vectors and ease the comparison