8#include <tracking/vxdCaTracking/TwoHitFilters.h>
9#include <gtest/gtest.h>
35 EXPECT_DOUBLE_EQ(0., aFilter.
calcDistZ());
41 EXPECT_DOUBLE_EQ(42., aFilter.
filterNan(42.));
43 EXPECT_DOUBLE_EQ(42, aFilter.
filterNan(42));
45 EXPECT_DOUBLE_EQ(42., aFilter.
filterNan(42));
47 EXPECT_DOUBLE_EQ(0., aFilter.
filterNan(1. / 0.));
67 EXPECT_DOUBLE_EQ(1., aFilter.
calcDistZ());
107 EXPECT_DOUBLE_EQ(1e300, aFilter.
calcDist3D());
117 TEST_F(TwoHitFiltersTest, testOutOfRangeFilter)
126 EXPECT_DOUBLE_EQ(innerHit * innerHit, aFilter.
calcDist3D());
133 TestOutOfRangeNormedDistFilter)
137 double correctResult = 1. / 2.;
138 double wrongResult = 0.;
Set up a few arrays and objects in the datastore.
The class 'TwoHitFilters' bundles filter methods using 2 hits which are stored in B2Vector3Ds.
double calcNormedDist3D() const
calculates the normed distance between the hits (3D), return unit: none
double calcDist3D() const
calculates the distance between the hits (3D), returning unit: cm^2 for speed optimization
double calcDistXY() const
calculates the distance between the hits (XY), returning unit: cm^2 for speed optimization
double fullDistXY() const
calculates the real distance between the hits (XY), returning unit: cm
double filterNan(double value) const
nice little nanChecker returns 0 if value was nan or inf, else returns value itself
double calcSlopeRZ() const
calculates the angle of the slope of the hits in RZ, returnValue = theta = atan(r/z)
double fullDist3D() const
calculates the real distance between the hits (3D), returning unit: cm
double calcDistZ() const
calculates the distance between the hits (Z only), returning unit: cm
void resetValues(const B2Vector3D &outerHit, const B2Vector3D &innerHit)
Overrides Constructor-Setup.
B2Vector3< double > B2Vector3D
typedef for common usage with double
double atan(double a)
atan for double
double sqrt(double a)
sqrt for double
B2Vector3D outerHit(0, 0, 0)
testing out of range behavior
Abstract base class for different kinds of events.