00001 #include "Math/BoostX.h"
00002 #include "Math/Boost.h"
00003 #include "Math/VectorUtil.h"
00004 #include "Math/Vector3D.h"
00005 #include "Math/Vector4D.h"
00006
00007 #include <iterator>
00008
00009 using namespace ROOT::Math;
00010
00011 int main() {
00012
00013 BoostX bx(0.8);
00014 std::cout << "BoostX - beta : " << bx.Beta() << " gamma : " << bx.Gamma() << std::endl;
00015
00016 XYZTVector v(1.,2.,3.,4.);
00017
00018 XYZTVector vb1 = bx(v);
00019 XYZTVector vb2 = VectorUtil::boostX(v,0.8);
00020
00021 if (vb1 != vb2) {
00022 std::cout << "BoostX test failed" << std::endl;
00023 int pr = std::cout.precision(18);
00024 std::cout << vb1 << std::endl;
00025 std::cout << vb2 << std::endl;
00026 std::cout.precision (pr);
00027 }
00028
00029
00030 Polar3DVector bv(0.99999,1.,2);
00031 std::cout << "BoostVector " << XYZVector(bv) << " beta boost = " << XYZVector(bv).R() << std::endl;
00032 Boost b(bv);
00033 std::cout << "Boost Components : ";
00034 std::ostream_iterator<double> oi(std::cout,"\t");
00035 b.GetComponents(oi);
00036 std::cout << std::endl;
00037
00038
00039
00040
00041 vb1 = b(v);
00042 vb2 = VectorUtil::boost(v,bv);
00043 if (vb1 != vb2) {
00044 std::cout << "Boost test failed" << std::endl;
00045 int pr = std::cout.precision(18);
00046 std::cout << vb1 << std::endl;
00047 std::cout << vb2 << std::endl;
00048 std::cout.precision (pr);
00049 }
00050
00051 }