8#include <tracking/vxdCaTracking/ThreeHitFilters.h>
9#include <gtest/gtest.h>
27 B2Vector3D innerHit(1., 1., 0.), centerHit(3., 3., 0.), outerHitEvil(6., 3., 0.), outerHitSimple(6., 4., 0.);
35 aFilter.
resetValues(outerHitEvil, centerHit, innerHit);
42 aFilter.
resetValues(outerHitSimple, centerHit, innerHit);
47 aFilter.
resetValues(outerHitEvil, centerHit, innerHit);
57 B2Vector3D innerHit(1., 1., 0.), centerHit(3., 3., 0.), outerHitEvil(6., 3., 0.), outerHitSimple(6., 4., 0.);
66 EXPECT_DOUBLE_EQ(26.5650511770779893515721937204532946712042, aFilter.
fullAngle3D());
79 EXPECT_DOUBLE_EQ(31.4821541052938556040832384555411729852856, aFilter.
fullAngle3D());
80 EXPECT_DOUBLE_EQ(0.090909090909090909091, aFilter.
calcAngle3D());
82 EXPECT_DOUBLE_EQ(26.5650511770779893515721937204532946712042, aFilter.
fullAngleXY());
85 EXPECT_FLOAT_EQ(17.54840061379229806435203716652846677620, aFilter.
fullAngleRZ());
86 EXPECT_FLOAT_EQ(cos(17.54840061379229806435203716652846677620 * M_PI / 180.), aFilter.
calcAngleRZ());
88 EXPECT_DOUBLE_EQ(0.4636476090008061162142562314612144020285, aFilter.
fullAngle2D(outer_center, cent_inner));
89 EXPECT_DOUBLE_EQ(0.89442719099991586, aFilter.
calcAngle2D(outer_center, cent_inner));
96 B2Vector3D innerHit(1., 1., 0.), centerHit(3., 3., 0.),
outerHit(6., 4., 1.), sigma(.01, .01, .01), unrealsigma(2, 2, 2),
97 outerhighHit(4., 6., 1.);
105 EXPECT_DOUBLE_EQ(1., aFilter.
calcSign(
outerHit, centerHit, innerHit, sigma, sigma, sigma));
106 EXPECT_DOUBLE_EQ(-1., aFilter.
calcSign(outerhighHit, centerHit, innerHit, sigma, sigma, sigma));
107 EXPECT_DOUBLE_EQ(-1., aFilter.
calcSign(innerHit, centerHit,
outerHit, sigma, sigma, sigma));
108 EXPECT_DOUBLE_EQ(0., aFilter.
calcSign(
outerHit, centerHit, innerHit, unrealsigma, unrealsigma,
112 EXPECT_GT(0., aFilter.
calcSign(outerhighHit, centerHit, innerHit));
117 EXPECT_DOUBLE_EQ(-1., aFilter.
calcSign(outerhighHit, centerHit, innerHit));
132 centerHit.RotateZ(.4);
133 innerHit.RotateZ(.4);
147 B2Vector3D innerHit2(1., 1., 0.), centerHit2(3., 3., 0.), outerHitEvil(6., 3., 0.);
149 double pt = 0, ptTrue = 0;
152 ptTrue = aFilter.
calcPt(1.414213562373095048801688724209698078570);
155 EXPECT_DOUBLE_EQ(ptTrue, pt);
157 ptTrue = 0.017118925181688543;
158 aFilter.
resetValues(outerHitEvil, centerHit2, innerHit2);
160 EXPECT_DOUBLE_EQ(ptTrue, pt);
164 ptTrue = aFilter.
calcPt(1.414213562373095048801688724209698078570);
166 EXPECT_ANY_THROW(aFilter.
calcPt());
void RotateZ(DataType angle)
Rotates the B2Vector3 around the z-axis.
Set up a few arrays and objects in the datastore.
The class 'ThreeHitFilters' bundles filter methods using 3 hits which are stored in B2Vector3Ds.
double calcAngle3D()
calculates the angle between the hits/vectors (3D), returning unit: none (calculation for degrees is ...
double fullAngle3D()
calculates the angle between the hits/vectors (3D), returning unit: angle in degrees
void resetValues(const B2Vector3D &outerHit, const B2Vector3D ¢erHit, const B2Vector3D &innerHit)
Overrides Constructor-Setup.
double calcPt()
calculates the estimation of the transverse momentum of the 3-hit-tracklet, returning unit: GeV/c
double calcHelixFit()
reverse compatibility, calls calcHelixParameterFit
double fullAngleRZ()
calculates the angle between the hits/vectors (RZ), returning unit: angle in degrees
double calcDeltaSlopeRZ()
calculates deviations in the slope of the inner segment and the outer segment, returning unit: none
double getMagneticField()
returns the set value of the magnetic field in Tesla
double calcAngleRZ()
calculates the angle between the hits/vectors (RZ), returning unit: none (calculation for degrees is ...
double fullAngleXY()
calculates the angle between the hits/vectors (XY), returning unit: angle in degrees
double calcDeltaSlopeZOverS()
compares the "slopes" z over arc length.
double calcCircleDist2IP()
calculates the distance of the point of closest approach of circle to the IP, returning unit: cm
double fullAngle2D(const B2Vector3D &vecA, const B2Vector3D &vecB)
calculates the angle between the hits/vectors (2D), generalized, returning unit: angle in radians WAR...
void resetMagneticField(const double magneticFieldStrength=1.5)
Overrides Constructor-Setup for magnetic field.
double calcAngle2D(const B2Vector3D &vecA, const B2Vector3D &vecB)
calculates the angle between the hits/vectors (2D), generalized, returning unit: none.
double calcAngleXY()
calculates the angle between the hits/vectors (XY), returning unit: none (calculation for degrees is ...
int calcSign(const B2Vector3D &a, const B2Vector3D &b, const B2Vector3D &c)
calculates calculates the sign of the curvature of given 3-hit-tracklet.
B2Vector3D outerHit(0, 0, 0)
testing out of range behavior
Abstract base class for different kinds of events.