13 FourVector m( 0.5*RAND_MAX-std::rand(), 0.5*RAND_MAX-std::rand(), 0.5*RAND_MAX-std::rand(), 0.5*RAND_MAX-std::rand());
16 return m.e()/msave.e();
20 FourVector m( 0.5*RAND_MAX-std::rand(), 0.5*RAND_MAX-std::rand(), 0.5*RAND_MAX-std::rand(), 0.5*RAND_MAX-std::rand());
23 return m.e()/msave.e();
25bool neq(
const double a,
const double b)
27 if (std::abs(a-b)<0.001*(std::abs(a)+std::abs(b)))
return false;
40 cf = conversion_factor( Units::GEV, Units::GEV );
44 std::cerr <<
"wrong conversion factor " << cf
45 <<
" for GEV to GEV - should be 1 \n";
47 cf = conversion_factor( Units::MEV, Units::MEV );
51 std::cerr <<
"wrong conversion factor " << cf
52 <<
" for MEV to MEV - should be 1 \n";
54 cf = conversion_factor( Units::MEV, Units::GEV );
58 std::cerr <<
"wrong conversion factor " << cf
59 <<
" for MEV to GEV - should be 0.001 \n";
61 cf = conversion_factor( Units::GEV, Units::MEV );
65 std::cerr <<
"wrong conversion factor " << cf
66 <<
" for GEV to MEV - should be 1000 \n";
70 cf = conversion_factor( Units::MM, Units::MM );
74 std::cerr <<
"wrong conversion factor " << cf
75 <<
" for MM to MM - should be 1 \n";
77 cf = conversion_factor( Units::CM, Units::CM );
81 std::cerr <<
"wrong conversion factor " << cf
82 <<
" for CM to CM - should be 1 \n";
84 cf = conversion_factor( Units::CM, Units::MM );
88 std::cerr <<
"wrong conversion factor " << cf
89 <<
" for CM to MM - should be 10 \n";
91 cf = conversion_factor( Units::MM, Units::CM );
95 std::cerr <<
"wrong conversion factor " << cf
96 <<
" for MM to CM - should be 0.1 \n";
Definition of class GenEvent.
Definition of class Units.
Stores event-related information.
const Units::MomentumUnit & momentum_unit() const
Get momentum unit.
const Units::LengthUnit & length_unit() const
Get length unit.
static void convert(T &m, MomentumUnit from, MomentumUnit to)
Convert FourVector to different momentum unit.
LengthUnit
Position units.
static std::string name(MomentumUnit u)
Get name of momentum unit.
MomentumUnit
Momentum units.