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
27
29
30namespace ROOT {
31
32namespace ROOT_MATH_ARCH {
33
34BoostX::BoostX() : fBeta(0.0), fGamma(1.0) {}
35
37{
38 // set component
39 Scalar bp2 = bx * bx;
40 if (bp2 >= 1) {
41#if !defined(ROOT_MATH_SYCL) && !defined(ROOT_MATH_CUDA)
42 GenVector_Throw("Beta Vector supplied to set BoostX represents speed >= c");
43#endif
44 return;
45 }
46 fBeta = bx;
47 fGamma = 1.0 / math_sqrt(1.0 - bp2);
48}
49
51{
52 // get component
53 bx = fBeta;
54}
55
61
63{
64 // get corresponding LorentzRotation
65 r[kLXX] = fGamma;
66 r[kLXY] = 0.0;
67 r[kLXZ] = 0.0;
68 r[kLXT] = fGamma * fBeta;
69 r[kLYX] = 0.0;
70 r[kLYY] = 1.0;
71 r[kLYZ] = 0.0;
72 r[kLYT] = 0.0;
73 r[kLZX] = 0.0;
74 r[kLZY] = 0.0;
75 r[kLZZ] = 1.0;
76 r[kLZT] = 0.0;
77 r[kLTX] = fGamma * fBeta;
78 r[kLTY] = 0.0;
79 r[kLTZ] = 0.0;
80 r[kLTT] = fGamma;
81}
82
84{
85 // Assuming the representation of this is close to a true Lorentz Rotation,
86 // but may have drifted due to round-off error from many operations,
87 // this forms an "exact" orthosymplectic matrix for the Lorentz Rotation
88 // again.
89
90 if (fGamma <= 0) {
91#if !defined(ROOT_MATH_SYCL) && !defined(ROOT_MATH_CUDA)
92 GenVector_Throw("Attempt to rectify a boost with non-positive gamma");
93#endif
94 return;
95 }
96 Scalar beta = fBeta;
97 if (beta >= 1) {
98 beta /= (beta * (1.0 + 1.0e-16));
99 }
100 SetComponents(beta);
101}
102
104{
105 // apply boost to a LV
106 Scalar x = v.Px();
107 Scalar t = v.E();
108 return LorentzVector<PxPyPzE4D<double>>(fGamma * x + fGamma * fBeta * t, v.Py(), v.Pz(),
109 fGamma * fBeta * x + fGamma * t);
110}
111
113{
114 // invert
115 fBeta = -fBeta;
116}
117
119{
120 // return an inverse boostX
121 BoostX tmp(*this);
122 tmp.Invert();
123 return tmp;
124}
125
126#if !defined(ROOT_MATH_SYCL) && !defined(ROOT_MATH_CUDA)
127// ========== I/O =====================
128
129std::ostream &operator<<(std::ostream &os, const BoostX &b)
130{
131 os << " BoostX( beta: " << b.Beta() << ", gamma: " << b.Gamma() << " ) ";
132 return os;
133}
134#endif
135
136} // namespace ROOT_MATH_ARCH
137} // 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:43
LorentzVector< PxPyPzE4D< double > > operator()(const LorentzVector< PxPyPzE4D< double > > &v) const
Lorentz transformation operation on a Minkowski ('Cartesian') LorentzVector.
Definition BoostX.cxx:103
BoostX Inverse() const
Return inverse of a boost.
Definition BoostX.cxx:118
void Invert()
Invert a BoostX in place.
Definition BoostX.cxx:112
void Rectify()
Re-adjust components to eliminate small deviations from a perfect orthosyplectic matrix.
Definition BoostX.cxx:83
void GetComponents(Scalar &beta_x) const
Get components into a Scalar beta_x.
Definition BoostX.cxx:50
BoostX()
Default constructor (identity transformation)
Definition BoostX.cxx:34
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:62
void SetComponents(Scalar beta_x)
Set components from a Scalar beta_x.
Definition BoostX.cxx:36
XYZVector BetaVector() const
Definition BoostX.cxx:56
Class describing a generic LorentzVector in the 4D space-time, using the specified coordinate system ...
Double_t x[n]
Definition legend1.C:17
void GenVector_Throw(const char *)
function throwing exception, by creating internally a GenVector_exception only when needed
Scalar math_sqrt(Scalar x)
std::ostream & operator<<(std::ostream &os, const AxisAngle &a)
Stream Output and Input.
Definition AxisAngle.cxx:98