Logo ROOT   6.14/05
Reference Guide
BoostX.cxx
Go to the documentation of this file.
1  // @(#)root/mathcore:$Id$
2 // Authors: M. Fischler 2005
3 
4  /**********************************************************************
5  * *
6  * Copyright (c) 2005 , LCG ROOT FNAL MathLib Team *
7  * *
8  * *
9  **********************************************************************/
10 
11 // Header file for class BoostX, a 4x4 symmetric matrix representation of
12 // an axial Lorentz transformation
13 //
14 // Created by: Mark Fischler Mon Nov 1 2005
15 //
16 #include "Math/GenVector/BoostX.h"
22 
23 #include <cmath>
24 #include <algorithm>
25 
26 namespace ROOT {
27 
28 namespace Math {
29 
30 
31 BoostX::BoostX() : fBeta(0.0), fGamma(1.0) {}
32 
34  // set component
35  Scalar bp2 = bx*bx;
36  if (bp2 >= 1) {
38  "Beta Vector supplied to set BoostX represents speed >= c");
39  return;
40  }
41  fBeta = bx;
42  fGamma = 1.0 / std::sqrt(1.0 - bp2);
43 }
44 
45 void BoostX::GetComponents (Scalar& bx) const {
46  // get component
47  bx = fBeta;
48 }
49 
52  // return beta vector
53  return DisplacementVector3D< Cartesian3D<Scalar> > ( fBeta, 0.0, 0.0 );
54 }
55 
57  // get corresponding LorentzRotation
58  r[kLXX] = fGamma; r[kLXY] = 0.0; r[kLXZ] = 0.0; r[kLXT] = fGamma*fBeta;
59  r[kLYX] = 0.0; r[kLYY] = 1.0; r[kLYZ] = 0.0; r[kLYT] = 0.0;
60  r[kLZX] = 0.0; r[kLZY] = 0.0; r[kLZZ] = 1.0; r[kLZT] = 0.0;
61  r[kLTX] = fGamma*fBeta; r[kLTY] = 0.0; r[kLTZ] = 0.0; r[kLTT] = fGamma;
62 }
63 
65  // Assuming the representation of this is close to a true Lorentz Rotation,
66  // but may have drifted due to round-off error from many operations,
67  // this forms an "exact" orthosymplectic matrix for the Lorentz Rotation
68  // again.
69 
70  if (fGamma <= 0) {
72  "Attempt to rectify a boost with non-positive gamma");
73  return;
74  }
75  Scalar beta = fBeta;
76  if ( beta >= 1 ) {
77  beta /= ( beta * ( 1.0 + 1.0e-16 ) );
78  }
79  SetComponents ( beta );
80 }
81 
84  // apply boost to a LV
85  Scalar x = v.Px();
86  Scalar t = v.E();
88  ( fGamma*x + fGamma*fBeta*t
89  , v.Py()
90  , v.Pz()
91  , fGamma*fBeta*x + fGamma*t );
92 }
93 
95  // invert
96  fBeta = -fBeta;
97 }
98 
100  // return an inverse boostX
101  BoostX tmp(*this);
102  tmp.Invert();
103  return tmp;
104 }
105 
106 // ========== I/O =====================
107 
108 std::ostream & operator<< (std::ostream & os, const BoostX & b) {
109  os << " BoostX( beta: " << b.Beta() << ", gamma: " << b.Gamma() << " ) ";
110  return os;
111 }
112 
113 } //namespace Math
114 } //namespace ROOT
void SetComponents(Scalar beta_x)
Set components from a Scalar beta_x.
Definition: BoostX.cxx:33
Class describing a generic LorentzVector in the 4D space-time, using the specified coordinate system ...
Definition: LorentzVector.h:48
XYZVector BetaVector() const
Definition: BoostX.cxx:51
Namespace for new ROOT classes and functions.
Definition: StringConv.hxx:21
double Scalar
Definition: BoostX.h:41
void GetComponents(Scalar &beta_x) const
Get components into a Scalar beta_x.
Definition: BoostX.cxx:45
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
double beta(double x, double y)
Calculates the beta function.
std::ostream & operator<<(std::ostream &os, const AxisAngle &a)
Stream Output and Input.
Definition: AxisAngle.cxx:91
double sqrt(double)
Class describing a 4D cartesian coordinate system (x, y, z, t coordinates) or momentum-energy vectors...
Definition: PxPyPzE4D.h:42
Double_t x[n]
Definition: legend1.C:17
BoostX Inverse() const
Return inverse of a boost.
Definition: BoostX.cxx:99
void GetLorentzRotation(Scalar r[]) const
Get elements of internal 4x4 symmetric representation, into a data array suitable for direct use as t...
Definition: BoostX.cxx:56
LorentzVector< ROOT::Math::PxPyPzE4D< double > > operator()(const LorentzVector< ROOT::Math::PxPyPzE4D< double > > &v) const
Lorentz transformation operation on a Minkowski (&#39;Cartesian&#39;) LorentzVector.
Definition: BoostX.cxx:83
Class describing a generic displacement vector in 3 dimensions.
ROOT::R::TRInterface & r
Definition: Object.C:4
void Throw(const char *)
function throwing exception, by creating internally a GenVector_exception only when needed ...
SVector< double, 2 > v
Definition: Dict.h:5
void Invert()
Invert a BoostX in place.
Definition: BoostX.cxx:94
void Rectify()
Re-adjust components to eliminate small deviations from a perfect orthosyplectic matrix.
Definition: BoostX.cxx:64
Namespace for new Math classes and functions.
BoostX()
Default constructor (identity transformation)
Definition: BoostX.cxx:31
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