1 #define BOOST_TEST_MODULE ( SurfYZTest )
2 #include "boost/test/unit_test.hpp"
13 #include "cetlib_except/exception.h"
22 surf2(0., 0., 0., 0.),
23 surf3(1., 1., 1., 0.),
24 surf4(2., 3., 4., 1.) {}
36 BOOST_TEST(surf1.isEqual(surf2));
37 BOOST_TEST(!surf1.isEqual(surf3));
38 BOOST_TEST(!surf1.isEqual(surf4));
39 BOOST_TEST(!surf2.isEqual(surf3));
40 BOOST_TEST(!surf2.isEqual(surf4));
41 BOOST_TEST(!surf3.isEqual(surf4));
47 BOOST_TEST(surf1.isParallel(surf2));
48 BOOST_TEST(surf1.isParallel(surf3));
49 BOOST_TEST(!surf1.isParallel(surf4));
50 BOOST_TEST(surf2.isParallel(surf3));
51 BOOST_TEST(!surf2.isParallel(surf4));
52 BOOST_TEST(!surf3.isParallel(surf4));
58 double xyz1[3] = {1., 2., 3.};
61 surf4.toLocal(xyz1, uvw);
62 surf4.toGlobal(uvw, xyz2);
63 for(
int i=0; i<3; ++i)
64 BOOST_TEST(xyz1[i] == xyz2[i],
tol);
70 BOOST_TEST(surf1.distanceTo(surf2) == 0.);
71 BOOST_TEST(surf1.distanceTo(surf3) == 1.);
72 BOOST_TEST(surf3.distanceTo(surf1) == -1.);
78 BOOST_CHECK_EXCEPTION( surf1.distanceTo(surf4), cet::exception,
79 [](cet::exception
const &
e)
81 return e.category() ==
"SurfYZPlane";
102 surf1.getPosition(v, xyz);
103 BOOST_TEST(xyz[0] == 0.1,
tol);
104 BOOST_TEST(xyz[1] == 0.2,
tol);
105 BOOST_TEST(xyz[2] == 0.0,
tol);
106 surf3.getPosition(v, xyz);
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::sqrt(14.),
tol);
120 BOOST_TEST(mom[1] == (6.*std::cos(1.) - 2.*std::sin(1.))/std::sqrt(14.),
tol);
121 BOOST_TEST(mom[2] == (6.*std::sin(1.) + 2.*std::cos(1.))/std::sqrt(14.),
tol);
125 BOOST_CHECK_EXCEPTION( surf1.getMomentum(v, mom), cet::exception,
126 [](cet::exception
const &
e)
128 return e.category() ==
"SurfYZPlane";
132 BOOST_AUTO_TEST_SUITE_END()
Planar surface parallel to x-axis.
BOOST_FIXTURE_TEST_SUITE(GeometryIteratorsIcarus, IcarusGeometryIteratorTestFixture) BOOST_AUTO_TEST_CASE(AllTests)
KVector< 5 >::type TrackVector
Track state vector, dimension 5.
Kalman filter linear algebra typedefs.