Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
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//
22
23#include <cmath>
24#include <algorithm>
25
26namespace ROOT {
27
28namespace Math {
29
30BoostY::BoostY() : fBeta(0.0), fGamma(1.0) {}
31
33 // set component
34 Scalar bp2 = by*by;
35 if (bp2 >= 1) {
36 GenVector_Throw("Beta Vector supplied to set BoostY represents speed >= c");
37 return;
38 }
39 fBeta = by;
40 fGamma = 1.0 / std::sqrt(1.0-bp2);
41}
42
44 // get component
45 by = fBeta;
46}
47
50 // return beta vector
52}
53
55 // get corresponding LorentzRotation
56 r[kLXX] = 1.0; r[kLXY] = 0.0; r[kLXZ] = 0.0; r[kLXT] = 0.0;
57 r[kLYX] = 0.0; r[kLYY] = fGamma; r[kLYZ] = 0.0; r[kLYT] = fGamma*fBeta;
58 r[kLZX] = 0.0; r[kLZY] = 0.0; r[kLZZ] = 1.0; r[kLZT] = 0.0;
59 r[kLTX] = 0.0; r[kLTY] = fGamma*fBeta; r[kLTZ] = 0.0; r[kLTT] = fGamma;
60}
61
63 // Assuming the representation of this is close to a true Lorentz Rotation,
64 // but may have drifted due to round-off error from many operations,
65 // this forms an "exact" orthosymplectic matrix for the Lorentz Rotation
66 // again.
67
68 if (fGamma <= 0) {
69 GenVector_Throw("Attempt to rectify a boost with non-positive gamma");
70 return;
71 }
73 if ( beta >= 1 ) {
74 beta /= ( beta * ( 1.0 + 1.0e-16 ) );
75 }
77}
78
81 // apply boost to a LV
82 Scalar y = v.Py();
83 Scalar t = v.E();
85 ( v.Px()
86 , fGamma*y + fGamma*fBeta*t
87 , v.Pz()
88 , fGamma*fBeta*y + fGamma*t );
89}
90
92 // invert Boost
93 fBeta = -fBeta;
94}
95
97 // return inverse
98 BoostY tmp(*this);
99 tmp.Invert();
100 return tmp;
101}
102
103// ========== I/O =====================
104
105std::ostream & operator<< (std::ostream & os, const BoostY & b) {
106 os << " BoostY( beta: " << b.Beta() << ", gamma: " << b.Gamma() << " ) ";
107 return os;
108}
109
110} //namespace Math
111} //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 Y axis, by beta.
Definition BoostY.h:39
BoostY Inverse() const
Return inverse of a rotation.
Definition BoostY.cxx:96
XYZVector BetaVector() const
Definition BoostY.cxx:49
void Invert()
Invert a BoostY in place.
Definition BoostY.cxx:91
BoostY()
Default constructor (identity transformation)
Definition BoostY.cxx:30
void SetComponents(Scalar beta_y)
Set components from a Scalar beta_y.
Definition BoostY.cxx:32
LorentzVector< ROOT::Math::PxPyPzE4D< double > > operator()(const LorentzVector< ROOT::Math::PxPyPzE4D< double > > &v) const
Lorentz transformation operation on a Minkowski ('Cartesian') LorentzVector.
Definition BoostY.cxx:80
void GetComponents(Scalar &beta_y) const
Get components into a Scalar beta_y.
Definition BoostY.cxx:43
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:54
void Rectify()
Re-adjust components to eliminate small deviations from a perfect orthosyplectic matrix.
Definition BoostY.cxx:62
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 y[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.