16 std::vector<FourVector> vectors_to_test{
30 std::vector<double> correct_eta{
35 std::numeric_limits<double>::infinity(),
36 -std::numeric_limits<double>::infinity(),
41 std::log((std::sqrt(1.0*1.0 + 2.0*2.0 + 3.0*3.0) + 3.0) / (std::sqrt(1.0*1.0 + 2.0*2.0 + 3.0*3.0) - 3.0))*0.5,
42 std::log((std::sqrt(1.0*1.0 + 2.0*2.0 + 3.0*3.0) + 3.0) / (std::sqrt(1.0*1.0 + 2.0*2.0 + 3.0*3.0) - 3.0))*0.5,
43 std::log((std::sqrt(1.0*1.0 + 2.0*2.0 + 3.0*3.0) - 3.0) / (std::sqrt(1.0*1.0 + 2.0*2.0 + 3.0*3.0) + 3.0))*0.5,
44 std::log((std::sqrt(1.0*1.0 + 2.0*2.0 + 3.0*3.0) - 3.0) / (std::sqrt(1.0*1.0 + 2.0*2.0 + 3.0*3.0) + 3.0))*0.5,
45 std::log((std::sqrt(1.0*1.0 + 2.0*2.0 + 3.0*3.0) - 3.0) / (std::sqrt(1.0*1.0 + 2.0*2.0 + 3.0*3.0) + 3.0))*0.5,
46 std::log((std::sqrt(1.0*1.0 + 2.0*2.0 + 3.0*3.0) - 3.0) / (std::sqrt(1.0*1.0 + 2.0*2.0 + 3.0*3.0) + 3.0))*0.5
49 std::vector<double> correct_rap{
56 std::log((4.0 + 3.0) / (4.0 - 3.0))*0.5,
57 std::log((-4.0 + 3.0) / (-4.0 - 3.0))*0.5,
58 std::log((4.0 - 3.0) / (4.0 + 3.0))*0.5,
59 std::log((-4.0 - 3.0) / (-4.0 + 3.0))*0.5,
60 std::log((40.0 - 3.0) / (40.0 + 3.0))*0.5,
61 std::log((-40.0 - 3.0) / (-40.0 + 3.0))*0.5
64 cout.setf(ios_base::scientific);
67 cout.setf(std::ios_base::showpos);
68 for (
size_t i = 0; i < vectors_to_test.size(); i++) {
69 std::cout <<
" eta() = " << vectors_to_test.at(i).
eta() <<
" rap()=" << vectors_to_test.at(i).rap() <<
" for " << vectors_to_test.at(i) << std::endl;
70 std::cout <<
" Correct eta() = " << correct_eta.at(i) <<
" Correct rap()=" << correct_rap.at(i) << std::endl << std::endl;
72 for (
size_t i=0; i<vectors_to_test.size(); i++)
74 std::cout <<
"Testing " << vectors_to_test.at(i) << std::endl;
75 assert(vectors_to_test.at(i).eta() == correct_eta.at(i) );
76 assert(vectors_to_test.at(i).rap() == correct_rap.at(i) );
Definition of class FourVector.
Implementation of ostreams for the objects.
double eta() const
Pseudorapidity.