11#include "CLHEP/Units/GlobalSystemOfUnits.h"
12#include "CLHEP/Units/GlobalPhysicalConstants.h"
13#include "CLHEP/Vector/ThreeVector.h"
14#include "CLHEP/Vector/TwoVector.h"
15#include "CLHEP/Vector/Rotation.h"
27bool approx(
double a,
double b,
double eps) {
28 return bool( std::abs(a-b) < eps );
62 std::cin >> d0;
if ( !
test(d0, 1.1, 2.2, 3.3,
DEPS) )
exit(1);
63 std::cin >> f0;
if ( !
test(f0, 3.0, 2.0, 1.0,
FEPS) )
exit(1);
64 std::cout << d0 << std::endl;
65 std::cout << f0 << std::endl;
76 d4 = d1 + d2;
if ( !
test(d4, 2.0, 1.0, 0.0,
DEPS) )
exit(3);
77 d4 = f1 + d2;
if ( !
test(d4, 2.0, 1.0, 0.0,
FEPS) )
exit(3);
78 d4 = d1 + f2;
if ( !
test(d4, 2.0, 1.0, 0.0,
FEPS) )
exit(3);
79 d4 = f1 + f2;
if ( !
test(d4, 2.0, 1.0, 0.0,
FEPS) )
exit(3);
82 f4 = d1 + d2;
if ( !
test(f4, 2.0, 1.0, 0.0,
FEPS) )
exit(3);
83 f4 = f1 + d2;
if ( !
test(f4, 2.0, 1.0, 0.0,
FEPS) )
exit(3);
84 f4 = d1 + f2;
if ( !
test(f4, 2.0, 1.0, 0.0,
FEPS) )
exit(3);
85 f4 = f1 + f2;
if ( !
test(f4, 2.0, 1.0, 0.0,
FEPS) )
exit(3);
95 d4 = d1 - d2;
if ( !
test(d4, 0.0, -1.0, 0.0,
DEPS) )
exit(4);
96 d4 = f1 - d2;
if ( !
test(d4, 0.0, -1.0, 0.0,
FEPS) )
exit(4);
97 d4 = d1 - f2;
if ( !
test(d4, 0.0, -1.0, 0.0,
FEPS) )
exit(4);
98 d4 = f1 - f2;
if ( !
test(d4, 0.0, -1.0, 0.0,
FEPS) )
exit(4);
99 f4 = d1 - d2;
if ( !
test(f4, 0.0, -1.0, 0.0,
FEPS) )
exit(4);
100 f4 = f1 - d2;
if ( !
test(f4, 0.0, -1.0, 0.0,
FEPS) )
exit(4);
101 f4 = d1 - f2;
if ( !
test(f4, 0.0, -1.0, 0.0,
FEPS) )
exit(4);
102 f4 = f1 - f2;
if ( !
test(f4, 0.0, -1.0, 0.0,
FEPS) )
exit(4);
170 if ( !
approx((-d2).phi(), -3.0*CLHEP::halfpi*0.5,
DEPS) )
exit(9);
179 if ( !
approx((-f2).phi(), -3.0*CLHEP::halfpi*0.5,
FEPS) )
exit(9);
183 if ( !
approx((-d4).theta(), 3.0*CLHEP::halfpi*0.5,
DEPS) )
exit(9);
190 if ( !
approx((-f4).theta(), 3.0*CLHEP::halfpi*0.5,
FEPS) )
exit(9);
209 if ( !
test(d4, std::sqrt(0.5), 0.0, std::sqrt(0.5),
DEPS) )
exit(10);
217 if ( !
test(f4, std::sqrt(0.5), 0.0, std::sqrt(0.5),
FEPS) )
exit(10);
Hep3Vector & rotateY(double)
Hep3Vector & rotateZ(double)
Hep3Vector cross(const Hep3Vector &) const
double angle(const Hep3Vector &) const
double dot(const Hep3Vector &) const
Hep3Vector & rotate(double, const Hep3Vector &)
HepRotation inverse() const
HepRotation & rotate(double delta, const Hep3Vector &axis)
HepRotation & rotateZ(double delta)
HepRotation & rotateY(double delta)
bool test(const Hep3Vector &p, double x, double y, double z, double eps)
bool approx(double a, double b, double eps)