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) {
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
44void BoostY::GetComponents (Scalar& by) const {
45 // get component
46 by = fBeta;
47}
48
51 // return beta vector
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 }
75 if ( beta >= 1 ) {
76 beta /= ( beta * ( 1.0 + 1.0e-16 ) );
77 }
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
107std::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
ROOT::R::TRInterface & r
Definition Object.C:4
#define b(i)
Definition RSha256.hxx:100
Class representing a Lorentz Boost along the Y axis, by beta.
Definition BoostY.h:37
BoostY Inverse() const
Return inverse of a rotation.
Definition BoostY.cxx:98
XYZVector BetaVector() const
Definition BoostY.cxx:50
void Invert()
Invert a BoostY in place.
Definition BoostY.cxx:93
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:82
void GetComponents(Scalar &beta_y) const
Get components into a Scalar beta_y.
Definition BoostY.cxx:44
Scalar Beta() const
Retrieve the beta of the Boost.
Definition BoostY.h:96
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
void Rectify()
Re-adjust components to eliminate small deviations from a perfect orthosyplectic matrix.
Definition BoostY.cxx:63
Class describing a generic displacement vector in 3 dimensions.
Class describing a generic LorentzVector in the 4D space-time, using the specified coordinate system ...
Scalar Py() const
spatial Y component
Class describing a 4D cartesian coordinate system (x, y, z, t coordinates) or momentum-energy vectors...
Definition PxPyPzE4D.h:42
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.
void Throw(const char *)
function throwing exception, by creating internally a GenVector_exception only when needed
tbb::task_arena is an alias of tbb::interface7::task_arena, which doesn't allow to forward declare tb...