12#include "CLHEP/Units/GlobalSystemOfUnits.h"
13#include "CLHEP/Vector/defs.h"
14#include "CLHEP/Vector/LorentzVector.h"
15#include "CLHEP/Vector/LorentzRotation.h"
16#include "CLHEP/Vector/Sqr.h"
28 return bool( std::abs(
a-
b) < eps );
36 if ( !t ) std::cerr << p << std::endl
37 << x <<
'\t' << y <<
'\t' << z <<
'\t' << e
44 assert (v3.
x() == v4.
x() && v3.
y() == v4.
y() && v3.
z() == v4.
z());
48 assert (v3.
x() == v4.
x() && v3.
y() == v4.
y() && v3.
z() == v4.
z());
53 bool t = bool(
approx(p.
x(), q.
x(), eps) &&
57 if ( !t ) std::cerr << p << std::endl
68 Hep3Vector f3x(1.0), f3y(0.0, 1.0), f3z(0.0, 0.0, 1.0);
69 Hep3Vector d30, d3x(1.0), d3y(0.0, 1.0), d3z(0.0, 0.0, 1.0);
78 if ( !
test(d2, 1.0, 1.0, 0.0, std::sqrt(2.0),
DEPS) )
exit(1);
80 if ( !
test(d3, 1.0, 1.0, 1.0, std::sqrt(3.0),
DEPS) )
exit(1);
121 std::cin >> d0;
if ( !
test(d0, 1.1, 2.2, 3.3, 4.4,
DEPS) )
exit(1);
122 std::cin >> f0;
if ( !
test(f0, 4.0, 3.0, 2.0, 1.0,
FEPS) )
exit(1);
123 std::cout << d0 << std::endl;
124 std::cout << f0 << std::endl;
136 if ( !
test(d11, 3.0, 3.0, 3.0, std::sqrt(27.0),
FEPS) )
exit(4);
138 if ( !
test(f11, 3.0, 3.0, 3.0, std::sqrt(27.0),
FEPS) )
exit(4);
140 if ( !
test(d11, 4.0, 4.0, 4.0, std::sqrt(48.0),
FEPS) )
exit(4);
142 if ( !
test(f11, 4.0, 4.0, 4.0, std::sqrt(48.0),
FEPS) )
exit(4);
144 if ( !
test(d11, 1.0, 1.0, 1.0, std::sqrt(3.0),
FEPS) )
exit(4);
145 if ( !
test(-d11, -1.0, -1.0, -1.0, -std::sqrt(3.0),
FEPS) )
exit(4);
147 if ( !
test(f11, 1.0, 1.0, 1.0, std::sqrt(3.0),
FEPS) )
exit(4);
148 if ( !
test(-f11, -1.0, -1.0, -1.0, -std::sqrt(3.0),
FEPS) )
exit(4);
190 double M = (d1 + d2).mag();
191 double dm1 = d1.
mag();
192 double dm2 = d2.
mag();
194 d30 = -(d1 + d2).boostVector();
196 double phi = d1.
phi();
197 double theta = d1.
theta();
206 if ( !
test(d1, 0.0, 0.0, std::sqrt(p2), std::sqrt(p2 +
sqr(dm1)),
DEPS) )
exit(7);
207 if ( !
test(d2, 0.0, 0.0, -std::sqrt(p2), std::sqrt(p2 +
sqr(dm2)),
DEPS) )
exit(7);
221 if ( !
test(d3, 0.0, 0.0, std::sqrt(p2), std::sqrt(p2 +
sqr(dm1)),
DEPS) )
exit(7);
222 if ( !
test(d4, 0.0, 0.0, -std::sqrt(p2), std::sqrt(p2 +
sqr(dm2)),
DEPS) )
exit(7);
237 if ( !
test(d3, 0.0, 0.0, std::sqrt(p2), std::sqrt(p2 +
sqr(dm1)),
DEPS) )
exit(7);
238 if ( !
test(d4, 0.0, 0.0, -std::sqrt(p2), std::sqrt(p2 +
sqr(dm2)),
DEPS) )
exit(7);
HepLorentzRotation & rotateY(double delta)
HepLorentzRotation & rotateZ(double delta)
HepLorentzRotation inverse() const
HepLorentzRotation & transform(const HepBoost &b)
HepLorentzRotation & invert()
HepLorentzVector & boost(double, double, double)
double dot(const HepLorentzVector &) const
HepLorentzVector & rotateZ(double)
HepLorentzVector & rotateY(double)
HepLorentzVector & transform(const HepRotation &)
HepRotation inverse() const
HepRotation & rotateZ(double delta)
bool test(const HepLorentzVector &p, double x, double y, double z, double e, double eps)
void conversion_test(Hep3Vector &v3, HepLorentzVector &v4)
bool approx(double a, double b, double eps)