12#include "GaudiKernel/MsgStream.h"
18constexpr double closeToZero = std::numeric_limits<float>::min();
100 const double pi2 = 2. *
M_PI;
102 double r = sqrt(pos[0] * pos[0] + pos[1] * pos[1]);
109 const double inv_r = 1. /
r;
110 double sn = pos[1] * inv_r;
111 double cs = pos[0] * inv_r;
117 dF += (dF >
M_PI) ? -pi2 : (dF < -
M_PI) ? pi2 : 0;
131 double sr0 =
r - 1. / std::sqrt(
a *
a + b * b);
136 double sr1 = 1. / std::sqrt(
a *
a + b * b) -
r;
156 double sr0 =
r - 1. / std::sqrt(
a *
a + b * b);
158 return std::sqrt(sr0 * sr0 + sf * sf);
162 double sr1 = 1. / sqrt(
a *
a + b * b) -
r;
164 return std::sqrt(sr1 * sr1 + sf * sf);
174 sl << std::setiosflags(std::ios::fixed);
175 sl << std::setprecision(7);
176 sl <<
"Trk::EllipseBounds: (innerRadiusX, innerRadiusY, outerRadiusX, outerRadiusY, averagePhi, hPhiSector) = ";
177 sl <<
"(" << this->
rMinX() <<
", " << this->
rMinY() <<
", " << this->
rMaxX() <<
", " << this->
rMaxY() <<
", "
179 sl << std::setprecision(-1);
186 sl << std::setiosflags(std::ios::fixed);
187 sl << std::setprecision(7);
188 sl <<
"Trk::EllipseBounds: (innerRadiusX, innerRadiusY, outerRadiusX, outerRadiusY, hPhiSector) = ";
189 sl <<
"(" << this->
rMinX() <<
", " << this->
rMinY() <<
", " << this->
rMaxX() <<
", " << this->
rMaxY() <<
", "
191 sl << std::setprecision(-1);
Class to describe the bounds for a planar EllipseSurface, i.e.
double rMinX() const
This method returns first inner radius.
double rMinY() const
This method returns second inner radius.
virtual double minDistance(const Amg::Vector2D &pos) const override final
Minimal distance to boundary ( > 0 if outside and <=0 if inside)
EllipseBounds()
Default Constructor.
double averagePhi() const
This method returns the average phi.
std::vector< TDD_real_t > m_boundValues
The internal storage of the bounds can be float/double.
double rMaxY() const
This method returns second outer radius.
virtual bool operator==(const SurfaceBounds &sbo) const override
Equality operator.
double halfPhiSector() const
This method returns the halfPhiSector which is covered by the disc.
virtual MsgStream & dump(MsgStream &sl) const override
Output Method for MsgStream.
double rMaxX() const
This method returns first outer radius.
virtual double r() const override final
This method returns the maximum expansion on the plane (=max(rMaxX,rMaxY))
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