Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
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//
22
23#include <cmath>
24#include <algorithm>
25
26namespace ROOT {
27
28namespace Math {
29
30
31BoostX::BoostX() : fBeta(0.0), fGamma(1.0) {}
32
34 // set component
35 Scalar bp2 = bx*bx;
36 if (bp2 >= 1) {
37 GenVector_Throw("Beta Vector supplied to set BoostX represents speed >= c");
38 return;
39 }
40 fBeta = bx;
41 fGamma = 1.0 / std::sqrt(1.0 - bp2);
42}
43
45 // get component
46 bx = fBeta;
47}
48
51 // return beta vector
53}
54
56 // get corresponding LorentzRotation
57 r[kLXX] = fGamma; r[kLXY] = 0.0; r[kLXZ] = 0.0; r[kLXT] = fGamma*fBeta;
58 r[kLYX] = 0.0; r[kLYY] = 1.0; r[kLYZ] = 0.0; r[kLYT] = 0.0;
59 r[kLZX] = 0.0; r[kLZY] = 0.0; r[kLZZ] = 1.0; r[kLZT] = 0.0;
60 r[kLTX] = fGamma*fBeta; r[kLTY] = 0.0; 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) {
70 GenVector_Throw("Attempt to rectify a boost with non-positive gamma");
71 return;
72 }
74 if ( beta >= 1 ) {
75 beta /= ( beta * ( 1.0 + 1.0e-16 ) );
76 }
78}
79
82 // apply boost to a LV
83 Scalar x = v.Px();
84 Scalar t = v.E();
86 ( fGamma*x + fGamma*fBeta*t
87 , v.Py()
88 , v.Pz()
89 , fGamma*fBeta*x + fGamma*t );
90}
91
93 // invert
94 fBeta = -fBeta;
95}
96
98 // return an inverse boostX
99 BoostX tmp(*this);
100 tmp.Invert();
101 return tmp;
102}
103
104// ========== I/O =====================
105
106std::ostream & operator<< (std::ostream & os, const BoostX & b) {
107 os << " BoostX( beta: " << b.Beta() << ", gamma: " << b.Gamma() << " ) ";
108 return os;
109}
110
111} //namespace Math
112} //namespace ROOT
#define b(i)
Definition RSha256.hxx:100
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t r
Class representing a Lorentz Boost along the X axis, by beta.
Definition BoostX.h:39
void SetComponents(Scalar beta_x)
Set components from a Scalar beta_x.
Definition BoostX.cxx:33
void Invert()
Invert a BoostX in place.
Definition BoostX.cxx:92
void GetComponents(Scalar &beta_x) const
Get components into a Scalar beta_x.
Definition BoostX.cxx:44
BoostX Inverse() const
Return inverse of a boost.
Definition BoostX.cxx:97
LorentzVector< ROOT::Math::PxPyPzE4D< double > > operator()(const LorentzVector< ROOT::Math::PxPyPzE4D< double > > &v) const
Lorentz transformation operation on a Minkowski ('Cartesian') LorentzVector.
Definition BoostX.cxx:81
BoostX()
Default constructor (identity transformation)
Definition BoostX.cxx:31
XYZVector BetaVector() const
Definition BoostX.cxx:50
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:55
void Rectify()
Re-adjust components to eliminate small deviations from a perfect orthosyplectic matrix.
Definition BoostX.cxx:63
Class describing a generic LorentzVector in the 4D space-time, using the specified coordinate system ...
double beta(double x, double y)
Calculates the beta function.
Double_t x[n]
Definition legend1.C:17
Namespace for new Math classes and functions.
std::ostream & operator<<(std::ostream &os, const AxisAngle &a)
Stream Output and Input.
Definition AxisAngle.cxx:91
void GenVector_Throw(const char *)
function throwing exception, by creating internally a GenVector_exception only when needed
Namespace for new ROOT classes and functions.