Logo ROOT   6.10/09
Reference Guide
testBoost.cxx
Go to the documentation of this file.
1 #include "Math/BoostX.h"
2 #include "Math/Boost.h"
3 #include "Math/VectorUtil.h"
4 #include "Math/Vector3D.h"
5 #include "Math/Vector4D.h"
6 
7 #include <iterator>
8 
9 using namespace ROOT::Math;
10 
11 int main() {
12 
13  BoostX bx(0.8);
14  std::cout << "BoostX - beta : " << bx.Beta() << " gamma : " << bx.Gamma() << std::endl;
15 
16  XYZTVector v(1.,2.,3.,4.);
17 
18  XYZTVector vb1 = bx(v);
19  XYZTVector vb2 = VectorUtil::boostX(v,0.8);
20 
21  if (vb1 != vb2) {
22  std::cout << "BoostX test failed" << std::endl;
23  int pr = std::cout.precision(18);
24  std::cout << vb1 << std::endl;
25  std::cout << vb2 << std::endl;
26  std::cout.precision (pr);
27  }
28 
29  //Polar3DVector bv(1.,2.,0.8);
30  Polar3DVector bv(0.99999,1.,2);
31  std::cout << "BoostVector " << XYZVector(bv) << " beta boost = " << XYZVector(bv).R() << std::endl;
32  Boost b(bv);
33  std::cout << "Boost Components : ";
34  std::ostream_iterator<double> oi(std::cout,"\t");
35  b.GetComponents(oi);
36  std::cout << std::endl;
37 
38 
39 
40 
41  vb1 = b(v);
42  vb2 = VectorUtil::boost(v,bv);
43  if (vb1 != vb2) {
44  std::cout << "Boost test failed" << std::endl;
45  int pr = std::cout.precision(18);
46  std::cout << vb1 << std::endl;
47  std::cout << vb2 << std::endl;
48  std::cout.precision (pr);
49  }
50 
51 }
Class describing a generic LorentzVector in the 4D space-time, using the specified coordinate system ...
Definition: LorentzVector.h:48
LVector boostX(const LVector &v, T beta)
Boost a generic Lorentz Vector class along the X direction with a factor beta The only requirement on...
Definition: VectorUtil.h:356
DisplacementVector3D< Cartesian3D< double >, DefaultCoordinateSystemTag > XYZVector
3D Vector based on the cartesian coordinates x,y,z in double precision
Definition: Vector3Dfwd.h:34
Scalar Beta() const
Retrieve the beta of the Boost.
Definition: BoostX.h:96
Class representing a Lorentz Boost along the X axis, by beta.
Definition: BoostX.h:37
Lorentz boost class with the (4D) transformation represented internally by a 4x4 orthosymplectic matr...
Definition: Boost.h:46
void GetComponents(Scalar &beta_x, Scalar &beta_y, Scalar &beta_z) const
Get components into beta_x, beta_y, and beta_z.
Definition: Boost.cxx:99
Class describing a generic displacement vector in 3 dimensions.
SVector< double, 2 > v
Definition: Dict.h:5
LVector boost(const LVector &v, const BoostVector &b)
Boost a generic Lorentz Vector class using a generic 3D Vector class describing the boost The only re...
Definition: VectorUtil.h:327
int main()
Definition: testBoost.cxx:11
you should not use this method at all Int_t Int_t Double_t Double_t Double_t Int_t Double_t Double_t Double_t Double_t b
Definition: TRolke.cxx:630
Scalar Gamma() const
Retrieve the gamma of the Boost.
Definition: BoostX.h:101