1 #define BOOST_TEST_MODULE ( SurfXYZTest ) 2 #include "boost/test/unit_test.hpp" 13 #include "cetlib_except/exception.h" 22 surf2(0., 0., 0., 0., 0.),
23 surf3(1., 1., 1., 0., 0.),
24 surf4(1., 2., 2., 1., 0.1) {}
58 double xyz1[3] = {1., 2., 3.};
63 for(
int i=0; i<3; ++i)
64 BOOST_TEST(xyz1[i] == xyz2[i],
tol);
81 return
e.category() ==
"SurfXYZPlane"; \
103 BOOST_TEST(xyz[0] == 0.1,
tol);
104 BOOST_TEST(xyz[1] == 0.2,
tol);
105 BOOST_TEST(xyz[2] == 0.0,
tol);
107 BOOST_TEST(xyz[0] == 1.1,
tol);
108 BOOST_TEST(xyz[1] == 1.2,
tol);
109 BOOST_TEST(xyz[2] == 1.0,
tol);
111 BOOST_TEST(mom[0] == 4./std::sqrt(14.),
tol);
112 BOOST_TEST(mom[1] == 6./std::sqrt(14.),
tol);
113 BOOST_TEST(mom[2] == 2./std::sqrt(14.),
tol);
115 BOOST_TEST(mom[0] == -4./std::sqrt(14.),
tol);
116 BOOST_TEST(mom[1] == -6./std::sqrt(14.),
tol);
117 BOOST_TEST(mom[2] == -2./std::sqrt(14.),
tol);
119 BOOST_TEST(mom[0] == (4.*std::cos(0.1) + 2.*std::sin(0.1))/std::sqrt(14.),
tol);
120 BOOST_TEST(mom[1] == (4.*std::sin(0.1)*std::sin(1.) + 6.*std::cos(1.) - 2.*std::cos(0.1)*std::sin(1.))/std::sqrt(14.),
tol);
121 BOOST_TEST(mom[2] == (-4.*std::sin(0.1)*std::cos(1.) + 6.*std::sin(1.) + 2.*std::cos(0.1)*std::cos(1.))/std::sqrt(14.),
tol);
128 return
e.category() ==
"SurfXYZPlane"; \
132 BOOST_AUTO_TEST_SUITE_END()
virtual void getPosition(const TrackVector &vec, double xyz[3]) const
Get position of track.
virtual bool isEqual(const Surface &surf) const
Test two surfaces for equality, within tolerance.
virtual bool isParallel(const Surface &surf) const
Test whether two surfaces are parallel, within tolerance.
virtual double distanceTo(const Surface &surf) const
Find perpendicular forward distance to a parallel surface.
virtual void toLocal(const double xyz[3], double uvw[3]) const
Transform global to local coordinates.
KVector< 5 >::type TrackVector
Track state vector, dimension 5.
Kalman filter linear algebra typedefs.
virtual void toGlobal(const double uvw[3], double xyz[3]) const
Transform local to global coordinates.
BOOST_AUTO_TEST_CASE(Equality)
virtual void getMomentum(const TrackVector &vec, double mom[3], TrackDirection dir=UNKNOWN) const
Get momentum vector of track.
cet::coded_exception< error, detail::translate > exception