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"
27bool approx(
double a,
double b,
double eps) {
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 #if __GNUC__ > 3 && __GNUC_MINOR__ > 6
45 #pragma GCC diagnostic push
46 #pragma GCC diagnostic ignored "-Wunused-parameter"
50 #pragma clang diagnostic push
51 #pragma clang diagnostic ignored "-Wunused-parameter"
55 assert (v3.
x() == v4.
x() && v3.
y() == v4.
y() && v3.
z() == v4.
z());
59 assert (v3.
x() == v4.
x() && v3.
y() == v4.
y() && v3.
z() == v4.
z());
62 #if __GNUC__ > 3 && __GNUC_MINOR__ > 6
63 #pragma GCC diagnostic pop
67 #pragma clang diagnostic pop
72 bool t = bool(
approx(p.
x(), q.
x(), eps) &&
76 if ( !t ) std::cerr << p << std::endl
87 Hep3Vector f3x(1.0), f3y(0.0, 1.0), f3z(0.0, 0.0, 1.0);
88 Hep3Vector d30, d3x(1.0), d3y(0.0, 1.0), d3z(0.0, 0.0, 1.0);
97 if ( !
test(d2, 1.0, 1.0, 0.0, std::sqrt(2.0),
DEPS) )
exit(1);
99 if ( !
test(d3, 1.0, 1.0, 1.0, std::sqrt(3.0),
DEPS) )
exit(1);
112 if ( !
test(f2, 1.0, 1.0, 0.0, std::sqrt(2.0),
FEPS) )
exit(1);
114 if ( !
test(f3, 1.0, 1.0, 1.0, std::sqrt(3.0),
FEPS) )
exit(1);
140 std::cin >> d0;
if ( !
test(d0, 1.1, 2.2, 3.3, 4.4,
DEPS) )
exit(1);
141 std::cin >> f0;
if ( !
test(f0, 4.0, 3.0, 2.0, 1.0,
FEPS) )
exit(1);
142 std::cout << d0 << std::endl;
143 std::cout << f0 << std::endl;
155 if ( !
test(d11, 3.0, 3.0, 3.0, std::sqrt(27.0),
FEPS) )
exit(4);
157 if ( !
test(f11, 3.0, 3.0, 3.0, std::sqrt(27.0),
FEPS) )
exit(4);
159 if ( !
test(d11, 4.0, 4.0, 4.0, std::sqrt(48.0),
FEPS) )
exit(4);
161 if ( !
test(f11, 4.0, 4.0, 4.0, std::sqrt(48.0),
FEPS) )
exit(4);
163 if ( !
test(d11, 1.0, 1.0, 1.0, std::sqrt(3.0),
FEPS) )
exit(4);
164 if ( !
test(-d11, -1.0, -1.0, -1.0, -std::sqrt(3.0),
FEPS) )
exit(4);
166 if ( !
test(f11, 1.0, 1.0, 1.0, std::sqrt(3.0),
FEPS) )
exit(4);
167 if ( !
test(-f11, -1.0, -1.0, -1.0, -std::sqrt(3.0),
FEPS) )
exit(4);
209 double M = (d1 + d2).mag();
210 double dm1 = d1.
mag();
211 double dm2 = d2.
mag();
213 d30 = -(d1 + d2).boostVector();
215 double phi = d1.
phi();
216 double theta = d1.
theta();
225 if ( !
test(d1, 0.0, 0.0, std::sqrt(p2), std::sqrt(p2 +
sqr(dm1)),
DEPS) )
exit(7);
226 if ( !
test(d2, 0.0, 0.0, -std::sqrt(p2), std::sqrt(p2 +
sqr(dm2)),
DEPS) )
exit(7);
240 if ( !
test(d3, 0.0, 0.0, std::sqrt(p2), std::sqrt(p2 +
sqr(dm1)),
DEPS) )
exit(7);
241 if ( !
test(d4, 0.0, 0.0, -std::sqrt(p2), std::sqrt(p2 +
sqr(dm2)),
DEPS) )
exit(7);
256 if ( !
test(d3, 0.0, 0.0, std::sqrt(p2), std::sqrt(p2 +
sqr(dm1)),
DEPS) )
exit(7);
257 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)