 ROOT   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
32 void BoostY::SetComponents (Scalar by) {
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
49 DisplacementVector3D< Cartesian3D<BoostY::Scalar> >
50 BoostY::BetaVector() const {
51  // return beta vector
52  return DisplacementVector3D< Cartesian3D<Scalar> > ( 0.0, fBeta, 0.0 );
53 }
55 void BoostY::GetLorentzRotation (Scalar r[]) const {
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
63 void BoostY::Rectify() {
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
81 LorentzVector< PxPyPzE4D<double> >
82 BoostY::operator() (const LorentzVector< PxPyPzE4D<double> > & v) const {
83  // apply boost to a LV
84  Scalar y = v.Py();
85  Scalar t = v.E();
86  return LorentzVector< PxPyPzE4D<double> >
87  ( v.Px()
88  , fGamma*y + fGamma*fBeta*t
89  , v.Pz()
90  , fGamma*fBeta*y + fGamma*t );
91 }
93 void BoostY::Invert() {
94  // invert Boost
95  fBeta = -fBeta;
96 }
97
98 BoostY BoostY::Inverse() const {
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
ROOT::Math::BoostY::fBeta
Scalar fBeta
Definition: BoostY.h:206
ROOT::Math::BoostY::kLZZ
@ kLZZ
Definition: BoostY.h:61
ROOT::Math::BoostY
Class representing a Lorentz Boost along the Y axis, by beta.
Definition: BoostY.h:47
ROOT::Math::BoostY::kLZX
@ kLZX
Definition: BoostY.h:61
ROOT::Math::BoostY::kLXT
@ kLXT
Definition: BoostY.h:59
ROOT::Math::BoostY::BoostY
BoostY()
Default constructor (identity transformation)
Definition: BoostY.cxx:40
r
ROOT::R::TRInterface & r
Definition: Object.C:4
ROOT::Math::BoostY::Scalar
double Scalar
Definition: BoostY.h:56
ROOT::Math::BoostY::kLYX
@ kLYX
Definition: BoostY.h:60
ROOT::Math::operator<<
std::ostream & operator<<(std::ostream &os, const AxisAngle &a)
Stream Output and Input.
Definition: AxisAngle.cxx:101
ROOT::Math::BoostY::Inverse
BoostY Inverse() const
Return inverse of a rotation.
Definition: BoostY.cxx:108
ROOT::Math::beta
double beta(double x, double y)
Calculates the beta function.
Definition: SpecFuncMathCore.cxx:111
v
@ v
Definition: rootcling_impl.cxx:3635
b
#define b(i)
Definition: RSha256.hxx:118
ROOT::Math::BoostY::kLXZ
@ kLXZ
Definition: BoostY.h:59
ROOT::Math::BoostY::kLXX
@ kLXX
Definition: BoostY.h:59
ROOT::Math::BoostY::kLTZ
@ kLTZ
Definition: BoostY.h:62
Cartesian3D.h
ROOT::Math::GenVector::Throw
void Throw(const char *)
function throwing exception, by creating internally a GenVector_exception only when needed
Definition: GenVector_exception.h:80
ROOT::Math::BoostY::operator()
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:92
ROOT::Math::BoostY::kLYT
@ kLYT
Definition: BoostY.h:60
ROOT::Math::BoostY::kLTY
@ kLTY
Definition: BoostY.h:62
ROOT::Math::BoostY::kLYY
@ kLYY
Definition: BoostY.h:60
y
Double_t y[n]
Definition: legend1.C:17
sqrt
double sqrt(double)
PxPyPzE4D.h
ROOT::Math::BoostY::BetaVector
XYZVector BetaVector() const
Definition: BoostY.cxx:60
BoostY.h
ROOT::Math::BoostY::SetComponents
void SetComponents(Scalar beta_y)
Set components from a Scalar beta_y.
Definition: BoostY.cxx:42
ROOT::Math::BoostY::fGamma
Scalar fGamma
Definition: BoostY.h:207
DisplacementVector3D.h
ROOT::Math::BoostY::kLTX
@ kLTX
Definition: BoostY.h:62
ROOT::Math::BoostY::kLXY
@ kLXY
Definition: BoostY.h:59
GenVector_exception.h
ROOT::Math::BoostY::GetComponents
void GetComponents(Scalar &beta_y) const
Get components into a Scalar beta_y.
Definition: BoostY.cxx:54
ROOT::Math::Scalar
Rotation3D::Scalar Scalar
Definition: Rotation3DxAxial.cxx:69
ROOT::Math::BoostY::kLYZ
@ kLYZ
Definition: BoostY.h:60
ROOT::Math::BoostY::GetLorentzRotation
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:65
LorentzVector.h
ROOT::Math::BoostY::Invert
void Invert()
Invert a BoostY in place.
Definition: BoostY.cxx:103
ROOT::Math::BoostY::Rectify
void Rectify()
Re-adjust components to eliminate small deviations from a perfect orthosyplectic matrix.
Definition: BoostY.cxx:73
ROOT::Math::BoostY::kLZY
@ kLZY
Definition: BoostY.h:61
ROOT::Math::BoostY::kLZT
@ kLZT
Definition: BoostY.h:61
ROOT
VSD Structures.
Definition: StringConv.hxx:21
Math
ROOT::Math::BoostY::kLTT
@ kLTT
Definition: BoostY.h:62