Logo ROOT   6.14/05
Reference Guide
BoostY.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 BoostY, 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/BoostY.h"
22 
23 #include <cmath>
24 #include <algorithm>
25 
26 namespace ROOT {
27 
28 namespace Math {
29 
30 BoostY::BoostY() : fBeta(0.0), fGamma(1.0) {}
31 
33  // set component
34  Scalar bp2 = by*by;
35  if (bp2 >= 1) {
37  "Beta Vector supplied to set BoostY represents speed >= c");
38  return;
39  }
40  fBeta = by;
41  fGamma = 1.0 / std::sqrt(1.0-bp2);
42 }
43 
44 void BoostY::GetComponents (Scalar& by) const {
45  // get component
46  by = fBeta;
47 }
48 
51  // return beta vector
52  return DisplacementVector3D< Cartesian3D<Scalar> > ( 0.0, fBeta, 0.0 );
53 }
54 
56  // get corresponding LorentzRotation
57  r[kLXX] = 1.0; r[kLXY] = 0.0; r[kLXZ] = 0.0; r[kLXT] = 0.0;
58  r[kLYX] = 0.0; r[kLYY] = fGamma; r[kLYZ] = 0.0; r[kLYT] = fGamma*fBeta;
59  r[kLZX] = 0.0; r[kLZY] = 0.0; r[kLZZ] = 1.0; r[kLZT] = 0.0;
60  r[kLTX] = 0.0; r[kLTY] = fGamma*fBeta; r[kLTZ] = 0.0; r[kLTT] = fGamma;
61 }
62 
64  // Assuming the representation of this is close to a true Lorentz Rotation,
65  // but may have drifted due to round-off error from many operations,
66  // this forms an "exact" orthosymplectic matrix for the Lorentz Rotation
67  // again.
68 
69  if (fGamma <= 0) {
71  "Attempt to rectify a boost with non-positive gamma");
72  return;
73  }
74  Scalar beta = fBeta;
75  if ( beta >= 1 ) {
76  beta /= ( beta * ( 1.0 + 1.0e-16 ) );
77  }
78  SetComponents ( beta );
79 }
80 
83  // apply boost to a LV
84  Scalar y = v.Py();
85  Scalar t = v.E();
87  ( v.Px()
88  , fGamma*y + fGamma*fBeta*t
89  , v.Pz()
90  , fGamma*fBeta*y + fGamma*t );
91 }
92 
94  // invert Boost
95  fBeta = -fBeta;
96 }
97 
99  // return inverse
100  BoostY tmp(*this);
101  tmp.Invert();
102  return tmp;
103 }
104 
105 // ========== I/O =====================
106 
107 std::ostream & operator<< (std::ostream & os, const BoostY & b) {
108  os << " BoostY( beta: " << b.Beta() << ", gamma: " << b.Gamma() << " ) ";
109  return os;
110 }
111 
112 } //namespace Math
113 } //namespace ROOT
Class describing a generic LorentzVector in the 4D space-time, using the specified coordinate system ...
Definition: LorentzVector.h:48
void GetComponents(Scalar &beta_y) const
Get components into a Scalar beta_y.
Definition: BoostY.cxx:44
void SetComponents(Scalar beta_y)
Set components from a Scalar beta_y.
Definition: BoostY.cxx:32
Namespace for new ROOT classes and functions.
Definition: StringConv.hxx:21
BoostY()
Default constructor (identity transformation)
Definition: BoostY.cxx:30
double beta(double x, double y)
Calculates the beta function.
Scalar Gamma() const
Retrieve the gamma of the Boost.
Definition: BoostY.h:101
std::ostream & operator<<(std::ostream &os, const AxisAngle &a)
Stream Output and Input.
Definition: AxisAngle.cxx:91
Scalar Beta() const
Retrieve the beta of the Boost.
Definition: BoostY.h:96
double sqrt(double)
Class describing a 4D cartesian coordinate system (x, y, z, t coordinates) or momentum-energy vectors...
Definition: PxPyPzE4D.h:42
Class representing a Lorentz Boost along the Y axis, by beta.
Definition: BoostY.h:37
Class describing a generic displacement vector in 3 dimensions.
BoostY Inverse() const
Return inverse of a rotation.
Definition: BoostY.cxx:98
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 Rectify()
Re-adjust components to eliminate small deviations from a perfect orthosyplectic matrix.
Definition: BoostY.cxx:63
void Invert()
Invert a BoostY in place.
Definition: BoostY.cxx:93
double Scalar
Definition: BoostY.h:41
XYZVector BetaVector() const
Definition: BoostY.cxx:50
Double_t y[n]
Definition: legend1.C:17
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: BoostY.cxx:82
Namespace for new Math classes and functions.
void GetLorentzRotation(Scalar r[]) const
Get elements of internal 4x4 symmetric representation, into a data array suitable for direct use as t...
Definition: BoostY.cxx:55
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