9 #include <vdt/vdtMath.h>
18 Stat(
const char *
in) :
name(in){};
20 std::cout <<
name <<
": atan0 calls tot/large/over1: " << natan <<
"/" << nlarge <<
"/" << over1 << std::endl;
26 if (at>0.40
f) ++nlarge;
41 inline double tan15(
double x) {
42 return x * (1 + (x*
x) * (0.33331906795501708984375 + (x*x) * 0.135160386562347412109375));
48 float atan0(
float t) {
54 ((( 8.05374449538e-2
f * z2
55 - 1.38776856032E-1
f) * z2
56 + 1.99777106478E-1
f) * z2
57 - 3.33329491539E-1
f) * z2 * z
64 float atanClip(
float t) {
65 constexpr float tanPi8 = 0.4142135623730950;
66 constexpr float pio8 = 3.141592653589793238/8;
68 return std::copysign( (at< tanPi8 ) ? atan0(at) : pio8, t );
74 theNumberOfStrips(ns), theAngularWidth(aw), theAWidthInverse(1.
f/aw),theTanAW(std::
tan(aw)),
75 theDetHeight(dh), theCentreToIntersection(r),
76 theYAxisOrientation(yAx), yCentre( yMid),
77 theRadialSigma(std::
pow(dh, 2.
f) * (1.
f/12.
f)) {
84 LogTrace(
"TkRadialStripTopology") <<
"TkRadialStripTopology: constructed with"
86 <<
" width = " << aw <<
" rad "
87 <<
" det_height = " << dh
91 <<
" y_det_centre = " <<
yCentre
129 auto t = (y2*x1 -y1*x2)/(y1*y2 + x1*x2);
161 const float phi = atanClip(t);
181 xy( t1*( rr -
tt ) );
198 yy(
s2*
tt - 2*
cs*tr + c2*rr ),
199 xy(
cs*( rr -
tt ) + tr*( c2 -
s2 ) );
213 uu( ( c2*e.
xx() - 2*cs*e.
xy() +
s2*e.
yy() ) * T2 ),
214 vv( (
s2*e.
xx() + 2*cs*e.
xy() + c2*e.
yy() ) * R2 ),
float stripAngle(float strip) const
float originToIntersection() const
float centreToIntersection() const
float strip(const LocalPoint &) const
auto_ptr< ClusterSequence > cs
float localStripLength(const LocalPoint &) const
TkRadialStripTopology(int ns, float aw, float dh, float r, int yAx=1, float yMid=0.)
Sin< T >::type sin(const T &t)
float yDistanceToIntersection(float y) const
void add(const std::vector< const T * > &source, std::vector< const T * > &dest)
int channel(const LocalPoint &) const
T x() const
Cartesian x coordinate.
Measurement2DPoint MeasurementPoint
Measurement points are two-dimensional by default.
Cos< T >::type cos(const T &t)
Tan< T >::type tan(const T &t)
Abs< T >::type abs(const T &t)
MeasurementPoint measurementPosition(const LocalPoint &) const
float xOfStrip(int strip, float y) const
int nearestStrip(const LocalPoint &) const
float angularWidth() const
float localPitch(const LocalPoint &) const
float phiOfOneEdge() const
LocalError localError(float strip, float stripErr2) const
LocalPoint localPosition(float strip) const
MeasurementError measurementError(const LocalPoint &, const LocalError &) const
float yCentreOfStripPlane() const
float theYAxisOrientation
float yAxisOrientation() const
Power< A, B >::type pow(const A &a, const B &b)
float coveredStrips(const LocalPoint &lp1, const LocalPoint &lp2) const