12#include "GaudiKernel/MsgStream.h"
40 if (minhalex > maxhalex)
73 double max_ell = bchk.lCovariance(0, 0) > bchk.lCovariance(1, 1)
74 ? bchk.lCovariance(0, 0)
75 : bchk.lCovariance(1, 1);
76 double limit = bchk.
nSigmas * sqrt(max_ell);
84 double fabsX = std::abs(locpo[
Trk::locY]);
88 double min_ell = bchk.lCovariance(0, 0) < bchk.lCovariance(1, 1)
89 ? bchk.lCovariance(0, 0)
90 : bchk.lCovariance(1, 1);
91 limit = bchk.
nSigmas * sqrt(min_ell);
104 std::vector<KDOP> elementKDOP(5);
105 std::vector<Amg::Vector2D> elementP(6);
107 (bchk.lCovariance(1, 0) != 0 &&
108 (bchk.lCovariance(1, 1) - bchk.lCovariance(0, 0)) != 0)
109 ? .5 * bchk.
FastArcTan(2 * bchk.lCovariance(1, 0) /
110 (bchk.lCovariance(1, 1) - bchk.lCovariance(0, 0)))
117 normal << 0, -1, 1, 0;
126 elementP[0] = (rotMatrix * (p - locpoF));
128 elementP[1] = (rotMatrix * (p - locpoF));
131 elementP[2] = (rotMatrix * (p - locpoF));
134 elementP[3] = (rotMatrix * (p - locpoF));
136 elementP[4] = (rotMatrix * (p - locpoF));
139 elementP[5] = (rotMatrix * (p - locpoF));
140 std::vector<Amg::Vector2D> axis = { normal * (elementP[1] - elementP[0]),
141 normal * (elementP[2] - elementP[1]),
142 normal * (elementP[3] - elementP[2]),
143 normal * (elementP[4] - elementP[3]),
144 normal * (elementP[5] - elementP[4]) };
147 std::vector<KDOP> errelipseKDOP(5);
171 double absY = std::abs(locpo[
Trk::locY]);
183 double k = halfH ? 0.5*(halfBaseUp - halfBaseLo)/halfH : 0.;
184 double sign = (k < 0) ? -1. : 1.;
213 double Y[6] = { -y1, 0., y2, y2, 0., -y1 };
219 for (
int i = 0; i != Np; ++i) {
221 int j = (i == Np-1 ? 0 : i+1);
224 double x = X[i] - pos[1];
225 double y = Y[i] - pos[0];
226 double dx = X[j] - X[i];
227 double dy = Y[j] - Y[i];
228 double A =
x * dy -
y * dx;
229 double S = -(
x * dx +
y * dy);
232 double d =
x *
x +
y *
y;
236 double a = dx * dx + dy * dy;
238 double d = (
A *
A) /
a;
243 if (i && in && Ao *
A < 0.)
257 sl << std::setiosflags(std::ios::fixed);
258 sl << std::setprecision(7);
259 sl <<
"Trk::RotatedDiamondBounds: (minHlenghtX, medHlengthX, maxHlengthX, hlengthY1, hlengthY2 ) = ";
264 sl << std::setprecision(-1);
271 sl << std::setiosflags(std::ios::fixed);
272 sl << std::setprecision(7);
273 sl <<
"Trk::RotatedDiamondBounds: (minHlenghtX, medHlengthX, maxHlengthX, hlengthY1, hlengthY2 ) = ";
278 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.
double alpha2() const
This method returns the opening angle alpha in point A'.
virtual void initCache() override
initialize the alpha1/2 cache - needed also for object persistency
virtual double minDistance(const Amg::Vector2D &pos) const override
Minimal distance to boundary ( > 0 if outside and <=0 if inside)
RotatedDiamondBounds()
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
virtual bool inside(const Amg::Vector2D &locpo, double tol1=0., double tol2=0.) const override
The orientation of the Diamond is according to the figure.
std::vector< TDD_real_t > m_boundValues
Internal parameters stored in the geometry.
virtual bool operator==(const SurfaceBounds &diabo) const override
Equality operator.
double alpha1() const
This method returns the opening angle alpha in point A.
virtual MsgStream & dump(MsgStream &sl) const override
Output Method for MsgStream.
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