CLHEP 2.4.6.4
C++ Class Library for High Energy Physics
Loading...
Searching...
No Matches
CLHEP::HepLorentzRotation Class Reference

#include <LorentzRotation.h>

+ Inheritance diagram for CLHEP::HepLorentzRotation:

Classes

class  HepLorentzRotation_row
 

Public Member Functions

 HepLorentzRotation ()
 
 HepLorentzRotation (const HepLorentzRotation &r)
 
 HepLorentzRotation (HepLorentzRotation &&r)=default
 
 HepLorentzRotation (const HepRotation &r)
 
 HepLorentzRotation (const HepRotationX &r)
 
 HepLorentzRotation (const HepRotationY &r)
 
 HepLorentzRotation (const HepRotationZ &r)
 
 HepLorentzRotation (const HepBoost &b)
 
 HepLorentzRotation (const HepBoostX &b)
 
 HepLorentzRotation (const HepBoostY &b)
 
 HepLorentzRotation (const HepBoostZ &b)
 
HepLorentzRotationoperator= (HepLorentzRotation &&m)=default
 
HepLorentzRotationoperator= (const HepLorentzRotation &m)
 
HepLorentzRotationoperator= (const HepRotation &m)
 
HepLorentzRotationoperator= (const HepBoost &m)
 
HepLorentzRotationset (double bx, double by, double bz)
 
HepLorentzRotationset (const Hep3Vector &p)
 
HepLorentzRotationset (const HepRotation &r)
 
HepLorentzRotationset (const HepRotationX &r)
 
HepLorentzRotationset (const HepRotationY &r)
 
HepLorentzRotationset (const HepRotationZ &r)
 
HepLorentzRotationset (const HepBoost &boost)
 
HepLorentzRotationset (const HepBoostX &boost)
 
HepLorentzRotationset (const HepBoostY &boost)
 
HepLorentzRotationset (const HepBoostZ &boost)
 
 HepLorentzRotation (double bx, double by, double bz)
 
 HepLorentzRotation (const Hep3Vector &p)
 
HepLorentzRotationset (const HepBoost &B, const HepRotation &R)
 
 HepLorentzRotation (const HepBoost &B, const HepRotation &R)
 
HepLorentzRotationset (const HepRotation &R, const HepBoost &B)
 
 HepLorentzRotation (const HepRotation &R, const HepBoost &B)
 
 HepLorentzRotation (const HepLorentzVector &col1, const HepLorentzVector &col2, const HepLorentzVector &col3, const HepLorentzVector &col4)
 
HepLorentzRotationset (const HepLorentzVector &col1, const HepLorentzVector &col2, const HepLorentzVector &col3, const HepLorentzVector &col4)
 
HepLorentzRotationsetRows (const HepLorentzVector &row1, const HepLorentzVector &row2, const HepLorentzVector &row3, const HepLorentzVector &row4)
 
HepLorentzRotationset (const HepRep4x4 &rep)
 
 HepLorentzRotation (const HepRep4x4 &rep)
 
double xx () const
 
double xy () const
 
double xz () const
 
double xt () const
 
double yx () const
 
double yy () const
 
double yz () const
 
double yt () const
 
double zx () const
 
double zy () const
 
double zz () const
 
double zt () const
 
double tx () const
 
double ty () const
 
double tz () const
 
double tt () const
 
HepLorentzVector col1 () const
 
HepLorentzVector col2 () const
 
HepLorentzVector col3 () const
 
HepLorentzVector col4 () const
 
HepLorentzVector row1 () const
 
HepLorentzVector row2 () const
 
HepLorentzVector row3 () const
 
HepLorentzVector row4 () const
 
HepRep4x4 rep4x4 () const
 
const HepLorentzRotation_row operator[] (int) const
 
double operator() (int, int) const
 
void decompose (Hep3Vector &boost, HepAxisAngle &rotation) const
 
void decompose (HepBoost &boost, HepRotation &rotation) const
 
void decompose (HepAxisAngle &rotation, Hep3Vector &boost) const
 
void decompose (HepRotation &rotation, HepBoost &boost) const
 
int compare (const HepLorentzRotation &m) const
 
bool operator== (const HepLorentzRotation &) const
 
bool operator!= (const HepLorentzRotation &) const
 
bool operator<= (const HepLorentzRotation &) const
 
bool operator>= (const HepLorentzRotation &) const
 
bool operator< (const HepLorentzRotation &) const
 
bool operator> (const HepLorentzRotation &) const
 
bool isIdentity () const
 
double distance2 (const HepBoost &b) const
 
double distance2 (const HepRotation &r) const
 
double distance2 (const HepLorentzRotation &lt) const
 
double howNear (const HepBoost &b) const
 
double howNear (const HepRotation &r) const
 
double howNear (const HepLorentzRotation &lt) const
 
bool isNear (const HepBoost &b, double epsilon=Hep4RotationInterface::tolerance) const
 
bool isNear (const HepRotation &r, double epsilon=Hep4RotationInterface::tolerance) const
 
bool isNear (const HepLorentzRotation &lt, double epsilon=Hep4RotationInterface::tolerance) const
 
double norm2 () const
 
void rectify ()
 
HepLorentzVector vectorMultiplication (const HepLorentzVector &) const
 
HepLorentzVector operator() (const HepLorentzVector &w) const
 
HepLorentzVector operator* (const HepLorentzVector &p) const
 
HepLorentzRotation matrixMultiplication (const HepRep4x4 &m) const
 
HepLorentzRotation operator* (const HepBoost &b) const
 
HepLorentzRotation operator* (const HepRotation &r) const
 
HepLorentzRotation operator* (const HepLorentzRotation &lt) const
 
HepLorentzRotationoperator*= (const HepBoost &b)
 
HepLorentzRotationoperator*= (const HepRotation &r)
 
HepLorentzRotationoperator*= (const HepLorentzRotation &lt)
 
HepLorentzRotationtransform (const HepBoost &b)
 
HepLorentzRotationtransform (const HepRotation &r)
 
HepLorentzRotationtransform (const HepLorentzRotation &lt)
 
HepLorentzRotationrotateX (double delta)
 
HepLorentzRotationrotateY (double delta)
 
HepLorentzRotationrotateZ (double delta)
 
HepLorentzRotationrotate (double delta, const Hep3Vector &axis)
 
HepLorentzRotationrotate (double delta, const Hep3Vector *axis)
 
HepLorentzRotationboostX (double beta)
 
HepLorentzRotationboostY (double beta)
 
HepLorentzRotationboostZ (double beta)
 
HepLorentzRotationboost (double, double, double)
 
HepLorentzRotationboost (const Hep3Vector &)
 
HepLorentzRotation inverse () const
 
HepLorentzRotationinvert ()
 
std::ostream & print (std::ostream &os) const
 

Static Public Member Functions

static double getTolerance ()
 
static double setTolerance (double tol)
 

Static Public Attributes

static const HepLorentzRotation IDENTITY
 

Protected Member Functions

 HepLorentzRotation (double mxx, double mxy, double mxz, double mxt, double myx, double myy, double myz, double myt, double mzx, double mzy, double mzz, double mzt, double mtx, double mty, double mtz, double mtt)
 
void setBoost (double, double, double)
 

Protected Attributes

double mxx
 
double mxy
 
double mxz
 
double mxt
 
double myx
 
double myy
 
double myz
 
double myt
 
double mzx
 
double mzy
 
double mzz
 
double mzt
 
double mtx
 
double mty
 
double mtz
 
double mtt
 

Friends

HepLorentzRotation inverseOf (const HepLorentzRotation &lt)
 

Detailed Description

Author

Definition at line 49 of file LorentzRotation.h.

Constructor & Destructor Documentation

◆ HepLorentzRotation() [1/18]

CLHEP::HepLorentzRotation::HepLorentzRotation ( )
inline

Referenced by matrixMultiplication(), and set().

◆ HepLorentzRotation() [2/18]

CLHEP::HepLorentzRotation::HepLorentzRotation ( const HepLorentzRotation r)
inline

◆ HepLorentzRotation() [3/18]

CLHEP::HepLorentzRotation::HepLorentzRotation ( HepLorentzRotation &&  r)
inlinedefault

◆ HepLorentzRotation() [4/18]

CLHEP::HepLorentzRotation::HepLorentzRotation ( const HepRotation r)
inline

◆ HepLorentzRotation() [5/18]

CLHEP::HepLorentzRotation::HepLorentzRotation ( const HepRotationX r)
inlineexplicit

◆ HepLorentzRotation() [6/18]

CLHEP::HepLorentzRotation::HepLorentzRotation ( const HepRotationY r)
inlineexplicit

◆ HepLorentzRotation() [7/18]

CLHEP::HepLorentzRotation::HepLorentzRotation ( const HepRotationZ r)
inlineexplicit

◆ HepLorentzRotation() [8/18]

CLHEP::HepLorentzRotation::HepLorentzRotation ( const HepBoost b)
inline

◆ HepLorentzRotation() [9/18]

CLHEP::HepLorentzRotation::HepLorentzRotation ( const HepBoostX b)
inlineexplicit

◆ HepLorentzRotation() [10/18]

CLHEP::HepLorentzRotation::HepLorentzRotation ( const HepBoostY b)
inlineexplicit

◆ HepLorentzRotation() [11/18]

CLHEP::HepLorentzRotation::HepLorentzRotation ( const HepBoostZ b)
inlineexplicit

◆ HepLorentzRotation() [12/18]

CLHEP::HepLorentzRotation::HepLorentzRotation ( double  bx,
double  by,
double  bz 
)
inline

◆ HepLorentzRotation() [13/18]

CLHEP::HepLorentzRotation::HepLorentzRotation ( const Hep3Vector p)
inline

◆ HepLorentzRotation() [14/18]

CLHEP::HepLorentzRotation::HepLorentzRotation ( const HepBoost B,
const HepRotation R 
)
inline

◆ HepLorentzRotation() [15/18]

CLHEP::HepLorentzRotation::HepLorentzRotation ( const HepRotation R,
const HepBoost B 
)
inline

◆ HepLorentzRotation() [16/18]

CLHEP::HepLorentzRotation::HepLorentzRotation ( const HepLorentzVector col1,
const HepLorentzVector col2,
const HepLorentzVector col3,
const HepLorentzVector col4 
)

Definition at line 198 of file LorentzRotationC.cc.

202{
203 set ( ccol1, ccol2, ccol3, ccol4 );
204}
HepLorentzRotation & set(double bx, double by, double bz)

◆ HepLorentzRotation() [17/18]

CLHEP::HepLorentzRotation::HepLorentzRotation ( const HepRep4x4 rep)
inline

◆ HepLorentzRotation() [18/18]

CLHEP::HepLorentzRotation::HepLorentzRotation ( double  mxx,
double  mxy,
double  mxz,
double  mxt,
double  myx,
double  myy,
double  myz,
double  myt,
double  mzx,
double  mzy,
double  mzz,
double  mzt,
double  mtx,
double  mty,
double  mtz,
double  mtt 
)
inlineprotected

Member Function Documentation

◆ boost() [1/2]

HepLorentzRotation & CLHEP::HepLorentzRotation::boost ( const Hep3Vector )
inline

◆ boost() [2/2]

HepLorentzRotation & CLHEP::HepLorentzRotation::boost ( double  ,
double  ,
double   
)
inline

◆ boostX()

HepLorentzRotation & CLHEP::HepLorentzRotation::boostX ( double  beta)

Definition at line 184 of file LorentzRotation.cc.

184 {
185 double b2 = beta*beta;
186 if (b2 >= 1) {
187 ZMthrowA (ZMxpvTachyonic(
188 "Beta supplied to HepLorentzRotation::boostX represents speed >= c."));
189 }
190 double g1 = 1.0/std::sqrt(1.0-b2);
191 double bg = beta*g1;
192 HepLorentzVector rowx = row1();
193 HepLorentzVector rowt = row4();
194 HepLorentzVector r1 = g1 * rowx + bg * rowt;
195 HepLorentzVector r4 = bg * rowx + g1 * rowt;
196 mxx = r1.x(); mxy = r1.y(); mxz = r1.z(); mxt = r1.t();
197 mtx = r4.x(); mty = r4.y(); mtz = r4.z(); mtt = r4.t();
198 return *this;
199}
#define ZMthrowA(A)
Definition: ZMxpv.h:128
HepLorentzVector row1() const
HepLorentzVector row4() const

◆ boostY()

HepLorentzRotation & CLHEP::HepLorentzRotation::boostY ( double  beta)

Definition at line 201 of file LorentzRotation.cc.

201 {
202 double b2 = beta*beta;
203 if (b2 >= 1) {
204 ZMthrowA (ZMxpvTachyonic(
205 "Beta supplied to HepLorentzRotation::boostY represents speed >= c."));
206 }
207 double g1 = 1.0/std::sqrt(1.0-b2);
208 double bg = beta*g1;
209 HepLorentzVector rowy = row2();
210 HepLorentzVector rowt = row4();
211 HepLorentzVector r2 = g1 * rowy + bg * rowt;
212 HepLorentzVector r4 = bg * rowy + g1 * rowt;
213 myx = r2.x(); myy = r2.y(); myz = r2.z(); myt = r2.t();
214 mtx = r4.x(); mty = r4.y(); mtz = r4.z(); mtt = r4.t();
215 return *this;
216}
HepLorentzVector row2() const

◆ boostZ()

HepLorentzRotation & CLHEP::HepLorentzRotation::boostZ ( double  beta)

Definition at line 218 of file LorentzRotation.cc.

218 {
219 double b2 = beta*beta;
220 if (b2 >= 1) {
221 ZMthrowA (ZMxpvTachyonic(
222 "Beta supplied to HepLorentzRotation::boostZ represents speed >= c."));
223 }
224 double g1 = 1.0/std::sqrt(1.0-b2);
225 double bg = beta*g1;
226 HepLorentzVector rowz = row3();
227 HepLorentzVector rowt = row4();
228 HepLorentzVector r3 = g1 * rowz + bg * rowt;
229 HepLorentzVector r4 = bg * rowz + g1 * rowt;
230 mtx = r4.x(); mty = r4.y(); mtz = r4.z(); mtt = r4.t();
231 mzx = r3.x(); mzy = r3.y(); mzz = r3.z(); mzt = r3.t();
232 return *this;
233}
HepLorentzVector row3() const

◆ col1()

HepLorentzVector CLHEP::HepLorentzRotation::col1 ( ) const
inline

◆ col2()

HepLorentzVector CLHEP::HepLorentzRotation::col2 ( ) const
inline

◆ col3()

HepLorentzVector CLHEP::HepLorentzRotation::col3 ( ) const
inline

◆ col4()

HepLorentzVector CLHEP::HepLorentzRotation::col4 ( ) const
inline

◆ compare()

int CLHEP::HepLorentzRotation::compare ( const HepLorentzRotation m) const

Definition at line 97 of file LorentzRotation.cc.

97 {
98 if (mtt<m1.mtt) return -1; else if (mtt>m1.mtt) return 1;
99 else if (mtz<m1.mtz) return -1; else if (mtz>m1.mtz) return 1;
100 else if (mty<m1.mty) return -1; else if (mty>m1.mty) return 1;
101 else if (mtx<m1.mtx) return -1; else if (mtx>m1.mtx) return 1;
102
103 else if (mzt<m1.mzt) return -1; else if (mzt>m1.mzt) return 1;
104 else if (mzz<m1.mzz) return -1; else if (mzz>m1.mzz) return 1;
105 else if (mzy<m1.mzy) return -1; else if (mzy>m1.mzy) return 1;
106 else if (mzx<m1.mzx) return -1; else if (mzx>m1.mzx) return 1;
107
108 else if (myt<m1.myt) return -1; else if (myt>m1.myt) return 1;
109 else if (myz<m1.myz) return -1; else if (myz>m1.myz) return 1;
110 else if (myy<m1.myy) return -1; else if (myy>m1.myy) return 1;
111 else if (myx<m1.myx) return -1; else if (myx>m1.myx) return 1;
112
113 else if (mxt<m1.mxt) return -1; else if (mxt>m1.mxt) return 1;
114 else if (mxz<m1.mxz) return -1; else if (mxz>m1.mxz) return 1;
115 else if (mxy<m1.mxy) return -1; else if (mxy>m1.mxy) return 1;
116 else if (mxx<m1.mxx) return -1; else if (mxx>m1.mxx) return 1;
117
118 else return 0;
119}

◆ decompose() [1/4]

void CLHEP::HepLorentzRotation::decompose ( Hep3Vector boost,
HepAxisAngle rotation 
) const

◆ decompose() [2/4]

void CLHEP::HepLorentzRotation::decompose ( HepAxisAngle rotation,
Hep3Vector boost 
) const

Definition at line 79 of file LorentzRotationD.cc.

80 {
81 HepRotation r;
82 HepBoost b;
83 decompose(r,b);
84 rotation = r.axisAngle();
85 bboost = b.boostVector();
86 return;
87}

◆ decompose() [3/4]

void CLHEP::HepLorentzRotation::decompose ( HepBoost boost,
HepRotation rotation 
) const

Definition at line 19 of file LorentzRotationD.cc.

20 {
21
22 // The boost will be the pure boost based on column 4 of the transformation
23 // matrix. Since the constructor takes the beta vector, and not beta*gamma,
24 // we first divide through by gamma = the tt element. This of course can
25 // never be zero since the last row has t**2 - v**2 = +1.
26
27 Hep3Vector betaVec ( xt(), yt(), zt() );
28 betaVec *= 1.0 / tt();
29 bboost.set( betaVec );
30
31 // The rotation will be inverse of B times T.
32
33 HepBoost B( -betaVec );
34 HepLorentzRotation R( B * *this );
35
36 HepRep3x3 m1 ( R.xx(), R.xy(), R.xz(),
37 R.yx(), R.yy(), R.yz(),
38 R.zx(), R.zy(), R.zz() );
39 rotation.set( m1 );
40 rotation.rectify();
41
42 return;
43
44}
Definition: excDblThrow.cc:8

◆ decompose() [4/4]

void CLHEP::HepLorentzRotation::decompose ( HepRotation rotation,
HepBoost boost 
) const

Definition at line 56 of file LorentzRotationD.cc.

57 {
58
59 // In this case the pure boost is based on row 4 of the matrix.
60
61 Hep3Vector betaVec( tx(), ty(), tz() );
62 betaVec *= 1.0 / tt();
63 bboost.set( betaVec );
64
65 // The rotation will be T times the inverse of B.
66
67 HepBoost B( -betaVec );
68 HepLorentzRotation R( *this * B );
69
70 HepRep3x3 m1 ( R.xx(), R.xy(), R.xz(),
71 R.yx(), R.yy(), R.yz(),
72 R.zx(), R.zy(), R.zz() );
73 rotation.set( m1 );
74 rotation.rectify();
75 return;
76
77}

◆ distance2() [1/3]

double CLHEP::HepLorentzRotation::distance2 ( const HepBoost b) const

Definition at line 89 of file LorentzRotationD.cc.

89 {
90 HepBoost b1;
91 HepRotation r1;
92 decompose( b1, r1 );
93 double db2 = b1.distance2( b );
94 double dr2 = r1.norm2();
95 return ( db2 + dr2 );
96}

Referenced by howNear().

◆ distance2() [2/3]

double CLHEP::HepLorentzRotation::distance2 ( const HepLorentzRotation lt) const

Definition at line 107 of file LorentzRotationD.cc.

108 {
109 HepBoost b1;
110 HepRotation r1;
111 decompose( b1, r1 );
112 HepBoost b2;
113 HepRotation r2;
114 lt.decompose (b2, r2);
115 double db2 = b1.distance2( b2 );
116 double dr2 = r1.distance2( r2 );
117 return ( db2 + dr2 );
118}

◆ distance2() [3/3]

double CLHEP::HepLorentzRotation::distance2 ( const HepRotation r) const

Definition at line 98 of file LorentzRotationD.cc.

98 {
99 HepBoost b1;
100 HepRotation r1;
101 decompose( b1, r1 );
102 double db2 = b1.norm2( );
103 double dr2 = r1.distance2( r );
104 return ( db2 + dr2 );
105}

◆ getTolerance()

static double CLHEP::HepLorentzRotation::getTolerance ( )
inlinestatic

◆ howNear() [1/3]

double CLHEP::HepLorentzRotation::howNear ( const HepBoost b) const

Definition at line 120 of file LorentzRotationD.cc.

120 {
121 return std::sqrt( distance2( b ) );
122}
double distance2(const HepBoost &b) const

◆ howNear() [2/3]

double CLHEP::HepLorentzRotation::howNear ( const HepLorentzRotation lt) const

Definition at line 126 of file LorentzRotationD.cc.

126 {
127 return std::sqrt( distance2( lt ) );
128}

◆ howNear() [3/3]

double CLHEP::HepLorentzRotation::howNear ( const HepRotation r) const

Definition at line 123 of file LorentzRotationD.cc.

123 {
124 return std::sqrt( distance2( r ) );
125}

◆ inverse()

HepLorentzRotation CLHEP::HepLorentzRotation::inverse ( ) const
inline

Referenced by main().

◆ invert()

HepLorentzRotation & CLHEP::HepLorentzRotation::invert ( )
inline

Referenced by main().

◆ isIdentity()

bool CLHEP::HepLorentzRotation::isIdentity ( ) const
inline

◆ isNear() [1/3]

bool CLHEP::HepLorentzRotation::isNear ( const HepBoost b,
double  epsilon = Hep4RotationInterface::tolerance 
) const

Definition at line 130 of file LorentzRotationD.cc.

131 {
132 HepBoost b1;
133 HepRotation r1;
134 decompose( b1, r1 );
135 double db2 = b1.distance2(b);
136 if ( db2 > epsilon*epsilon ) {
137 return false; // Saves the time-consuming Rotation::norm2
138 }
139 double dr2 = r1.norm2();
140 return ( (db2 + dr2) <= epsilon*epsilon );
141}

◆ isNear() [2/3]

bool CLHEP::HepLorentzRotation::isNear ( const HepLorentzRotation lt,
double  epsilon = Hep4RotationInterface::tolerance 
) const

Definition at line 156 of file LorentzRotationD.cc.

157 {
158 HepBoost b1;
159 HepRotation r1;
160 decompose( b1, r1 );
161 HepBoost b2;
162 HepRotation r2;
163 lt.decompose (b2, r2);
164 double db2 = b1.distance2(b2);
165 if ( db2 > epsilon*epsilon ) {
166 return false; // Saves the time-consuming Rotation::distance2
167 }
168 double dr2 = r1.distance2(r2);
169 return ( (db2 + dr2) <= epsilon*epsilon );
170}

◆ isNear() [3/3]

bool CLHEP::HepLorentzRotation::isNear ( const HepRotation r,
double  epsilon = Hep4RotationInterface::tolerance 
) const

Definition at line 143 of file LorentzRotationD.cc.

144 {
145 HepBoost b1;
146 HepRotation r1;
147 decompose( b1, r1 );
148 double db2 = b1.norm2();
149 if ( db2 > epsilon*epsilon ) {
150 return false; // Saves the time-consuming Rotation::distance2
151 }
152 double dr2 = r1.distance2(r);
153 return ( (db2 + dr2) <= epsilon*epsilon );
154}

◆ matrixMultiplication()

HepLorentzRotation CLHEP::HepLorentzRotation::matrixMultiplication ( const HepRep4x4 m) const

Definition at line 125 of file LorentzRotation.cc.

125 {
126 return HepLorentzRotation(
127 mxx*m1.xx_ + mxy*m1.yx_ + mxz*m1.zx_ + mxt*m1.tx_,
128 mxx*m1.xy_ + mxy*m1.yy_ + mxz*m1.zy_ + mxt*m1.ty_,
129 mxx*m1.xz_ + mxy*m1.yz_ + mxz*m1.zz_ + mxt*m1.tz_,
130 mxx*m1.xt_ + mxy*m1.yt_ + mxz*m1.zt_ + mxt*m1.tt_,
131
132 myx*m1.xx_ + myy*m1.yx_ + myz*m1.zx_ + myt*m1.tx_,
133 myx*m1.xy_ + myy*m1.yy_ + myz*m1.zy_ + myt*m1.ty_,
134 myx*m1.xz_ + myy*m1.yz_ + myz*m1.zz_ + myt*m1.tz_,
135 myx*m1.xt_ + myy*m1.yt_ + myz*m1.zt_ + myt*m1.tt_,
136
137 mzx*m1.xx_ + mzy*m1.yx_ + mzz*m1.zx_ + mzt*m1.tx_,
138 mzx*m1.xy_ + mzy*m1.yy_ + mzz*m1.zy_ + mzt*m1.ty_,
139 mzx*m1.xz_ + mzy*m1.yz_ + mzz*m1.zz_ + mzt*m1.tz_,
140 mzx*m1.xt_ + mzy*m1.yt_ + mzz*m1.zt_ + mzt*m1.tt_,
141
142 mtx*m1.xx_ + mty*m1.yx_ + mtz*m1.zx_ + mtt*m1.tx_,
143 mtx*m1.xy_ + mty*m1.yy_ + mtz*m1.zy_ + mtt*m1.ty_,
144 mtx*m1.xz_ + mty*m1.yz_ + mtz*m1.zz_ + mtt*m1.tz_,
145 mtx*m1.xt_ + mty*m1.yt_ + mtz*m1.zt_ + mtt*m1.tt_ );
146}

Referenced by set().

◆ norm2()

double CLHEP::HepLorentzRotation::norm2 ( ) const

Definition at line 172 of file LorentzRotationD.cc.

172 {
173 HepBoost b;
174 HepRotation r;
175 decompose( b, r );
176 return b.norm2() + r.norm2();
177}

◆ operator!=()

bool CLHEP::HepLorentzRotation::operator!= ( const HepLorentzRotation ) const
inline

◆ operator()() [1/2]

HepLorentzVector CLHEP::HepLorentzRotation::operator() ( const HepLorentzVector w) const
inline

◆ operator()() [2/2]

double CLHEP::HepLorentzRotation::operator() ( int  i,
int  j 
) const

Definition at line 65 of file LorentzRotation.cc.

65 {
66 if (i == 0) {
67 if (j == 0) { return xx(); }
68 if (j == 1) { return xy(); }
69 if (j == 2) { return xz(); }
70 if (j == 3) { return xt(); }
71 } else if (i == 1) {
72 if (j == 0) { return yx(); }
73 if (j == 1) { return yy(); }
74 if (j == 2) { return yz(); }
75 if (j == 3) { return yt(); }
76 } else if (i == 2) {
77 if (j == 0) { return zx(); }
78 if (j == 1) { return zy(); }
79 if (j == 2) { return zz(); }
80 if (j == 3) { return zt(); }
81 } else if (i == 3) {
82 if (j == 0) { return tx(); }
83 if (j == 1) { return ty(); }
84 if (j == 2) { return tz(); }
85 if (j == 3) { return tt(); }
86 }
87 std::cerr << "HepLorentzRotation subscripting: bad indeces "
88 << "(" << i << "," << j << ")\n";
89 return 0.0;
90}

◆ operator*() [1/4]

HepLorentzRotation CLHEP::HepLorentzRotation::operator* ( const HepBoost b) const
inline

◆ operator*() [2/4]

HepLorentzRotation CLHEP::HepLorentzRotation::operator* ( const HepLorentzRotation lt) const
inline

◆ operator*() [3/4]

HepLorentzVector CLHEP::HepLorentzRotation::operator* ( const HepLorentzVector p) const
inline

◆ operator*() [4/4]

HepLorentzRotation CLHEP::HepLorentzRotation::operator* ( const HepRotation r) const
inline

◆ operator*=() [1/3]

HepLorentzRotation & CLHEP::HepLorentzRotation::operator*= ( const HepBoost b)
inline

◆ operator*=() [2/3]

HepLorentzRotation & CLHEP::HepLorentzRotation::operator*= ( const HepLorentzRotation lt)
inline

◆ operator*=() [3/3]

HepLorentzRotation & CLHEP::HepLorentzRotation::operator*= ( const HepRotation r)
inline

◆ operator<()

bool CLHEP::HepLorentzRotation::operator< ( const HepLorentzRotation ) const
inline

◆ operator<=()

bool CLHEP::HepLorentzRotation::operator<= ( const HepLorentzRotation ) const
inline

◆ operator=() [1/4]

HepLorentzRotation & CLHEP::HepLorentzRotation::operator= ( const HepBoost m)
inline

◆ operator=() [2/4]

HepLorentzRotation & CLHEP::HepLorentzRotation::operator= ( const HepLorentzRotation m)
inline

◆ operator=() [3/4]

HepLorentzRotation & CLHEP::HepLorentzRotation::operator= ( const HepRotation m)
inline

◆ operator=() [4/4]

HepLorentzRotation & CLHEP::HepLorentzRotation::operator= ( HepLorentzRotation &&  m)
inlinedefault

◆ operator==()

bool CLHEP::HepLorentzRotation::operator== ( const HepLorentzRotation ) const
inline

◆ operator>()

bool CLHEP::HepLorentzRotation::operator> ( const HepLorentzRotation ) const
inline

◆ operator>=()

bool CLHEP::HepLorentzRotation::operator>= ( const HepLorentzRotation ) const
inline

◆ operator[]()

const HepLorentzRotation_row CLHEP::HepLorentzRotation::operator[] ( int  ) const
inline

◆ print()

std::ostream & CLHEP::HepLorentzRotation::print ( std::ostream &  os) const

Definition at line 235 of file LorentzRotation.cc.

235 {
236 os << "\n [ ( " <<
237 std::setw(11) << std::setprecision(6) << xx() << " " <<
238 std::setw(11) << std::setprecision(6) << xy() << " " <<
239 std::setw(11) << std::setprecision(6) << xz() << " " <<
240 std::setw(11) << std::setprecision(6) << xt() << ")\n"
241 << " ( " <<
242 std::setw(11) << std::setprecision(6) << yx() << " " <<
243 std::setw(11) << std::setprecision(6) << yy() << " " <<
244 std::setw(11) << std::setprecision(6) << yz() << " " <<
245 std::setw(11) << std::setprecision(6) << yt() << ")\n"
246 << " ( " <<
247 std::setw(11) << std::setprecision(6) << zx() << " " <<
248 std::setw(11) << std::setprecision(6) << zy() << " " <<
249 std::setw(11) << std::setprecision(6) << zz() << " " <<
250 std::setw(11) << std::setprecision(6) << zt() << ")\n"
251 << " ( " <<
252 std::setw(11) << std::setprecision(6) << tx() << " " <<
253 std::setw(11) << std::setprecision(6) << ty() << " " <<
254 std::setw(11) << std::setprecision(6) << tz() << " " <<
255 std::setw(11) << std::setprecision(6) << tt() << ") ]\n";
256 return os;
257}

◆ rectify()

void CLHEP::HepLorentzRotation::rectify ( )

Definition at line 179 of file LorentzRotationD.cc.

179 {
180
181 // Assuming the representation of this is close to a true LT,
182 // but may have drifted due to round-off error from many operations,
183 // this forms an "exact" orthosymplectic matrix for the LT again.
184
185 // There are several ways to do this, all equivalent to lowest order in
186 // the corrected error. We choose to form an LT based on the inverse boost
187 // extracted from row 4, and left-multiply by LT to form what would be
188 // a rotation if the LT were kosher. We drop the possibly non-zero t
189 // components of that, rectify that rotation and multiply back by the boost.
190
191 Hep3Vector beta (tx(), ty(), tz());
192 double gam = tt(); // NaN-proofing
193 if ( gam <= 0 ) {
194 ZMthrowA ( ZMxpvImproperTransformation (
195 "rectify() on a transformation with tt() <= 0 - will not help!" ));
196 gam = 1;
197 }
198 beta *= 1.0/gam;
199 HepLorentzRotation R = (*this) * HepBoost(-beta);
200
201 HepRep3x3 m1 ( R.xx(), R.xy(), R.xz(),
202 R.yx(), R.yy(), R.yz(),
203 R.zx(), R.zy(), R.zz() );
204
205 HepRotation Rgood (m1);
206 Rgood.rectify();
207
208 set ( Rgood, HepBoost(beta) );
209}

◆ rep4x4()

HepRep4x4 CLHEP::HepLorentzRotation::rep4x4 ( ) const
inline

◆ rotate() [1/2]

HepLorentzRotation & CLHEP::HepLorentzRotation::rotate ( double  delta,
const Hep3Vector axis 
)
inline

◆ rotate() [2/2]

HepLorentzRotation & CLHEP::HepLorentzRotation::rotate ( double  delta,
const Hep3Vector axis 
)
inline

◆ rotateX()

HepLorentzRotation & CLHEP::HepLorentzRotation::rotateX ( double  delta)

Definition at line 148 of file LorentzRotation.cc.

148 {
149 double c1 = std::cos (delta);
150 double s1 = std::sin (delta);
151 HepLorentzVector rowy = row2();
152 HepLorentzVector rowz = row3();
153 HepLorentzVector r2 = c1 * rowy - s1 * rowz;
154 HepLorentzVector r3 = s1 * rowy + c1 * rowz;
155 myx = r2.x(); myy = r2.y(); myz = r2.z(); myt = r2.t();
156 mzx = r3.x(); mzy = r3.y(); mzz = r3.z(); mzt = r3.t();
157 return *this;
158}

◆ rotateY()

HepLorentzRotation & CLHEP::HepLorentzRotation::rotateY ( double  delta)

Definition at line 160 of file LorentzRotation.cc.

160 {
161 double c1 = std::cos (delta);
162 double s1 = std::sin (delta);
163 HepLorentzVector rowx = row1();
164 HepLorentzVector rowz = row3();
165 HepLorentzVector r1 = c1 * rowx + s1 * rowz;
166 HepLorentzVector r3 = -s1 * rowx + c1 * rowz;
167 mxx = r1.x(); mxy = r1.y(); mxz = r1.z(); mxt = r1.t();
168 mzx = r3.x(); mzy = r3.y(); mzz = r3.z(); mzt = r3.t();
169 return *this;
170}

Referenced by main().

◆ rotateZ()

HepLorentzRotation & CLHEP::HepLorentzRotation::rotateZ ( double  delta)

Definition at line 172 of file LorentzRotation.cc.

172 {
173 double c1 = std::cos (delta);
174 double s1 = std::sin (delta);
175 HepLorentzVector rowx = row1();
176 HepLorentzVector rowy = row2();
177 HepLorentzVector r1 = c1 * rowx - s1 * rowy;
178 HepLorentzVector r2 = s1 * rowx + c1 * rowy;
179 mxx = r1.x(); mxy = r1.y(); mxz = r1.z(); mxt = r1.t();
180 myx = r2.x(); myy = r2.y(); myz = r2.z(); myt = r2.t();
181 return *this;
182}

Referenced by main().

◆ row1()

HepLorentzVector CLHEP::HepLorentzRotation::row1 ( ) const
inline

Referenced by boostX(), rotateY(), and rotateZ().

◆ row2()

HepLorentzVector CLHEP::HepLorentzRotation::row2 ( ) const
inline

Referenced by boostY(), rotateX(), and rotateZ().

◆ row3()

HepLorentzVector CLHEP::HepLorentzRotation::row3 ( ) const
inline

Referenced by boostZ(), rotateX(), and rotateY().

◆ row4()

HepLorentzVector CLHEP::HepLorentzRotation::row4 ( ) const
inline

Referenced by boostX(), boostY(), and boostZ().

◆ set() [1/14]

HepLorentzRotation & CLHEP::HepLorentzRotation::set ( const Hep3Vector p)
inline

◆ set() [2/14]

HepLorentzRotation & CLHEP::HepLorentzRotation::set ( const HepBoost B,
const HepRotation R 
)

Definition at line 47 of file LorentzRotation.cc.

48 {
49 set (B.rep4x4());
50 *this = matrixMultiplication ( R.rep4x4() );
51 return *this;
52}
HepLorentzRotation matrixMultiplication(const HepRep4x4 &m) const

◆ set() [3/14]

HepLorentzRotation & CLHEP::HepLorentzRotation::set ( const HepBoost boost)
inline

◆ set() [4/14]

HepLorentzRotation & CLHEP::HepLorentzRotation::set ( const HepBoostX boost)
inline

◆ set() [5/14]

HepLorentzRotation & CLHEP::HepLorentzRotation::set ( const HepBoostY boost)
inline

◆ set() [6/14]

HepLorentzRotation & CLHEP::HepLorentzRotation::set ( const HepBoostZ boost)
inline

◆ set() [7/14]

HepLorentzRotation & CLHEP::HepLorentzRotation::set ( const HepLorentzVector col1,
const HepLorentzVector col2,
const HepLorentzVector col3,
const HepLorentzVector col4 
)

Definition at line 22 of file LorentzRotationC.cc.

25 {
26 // First, test that the four cols do represent something close to a
27 // true LT:
28
30
31 if ( ccol4.getT() < 0 ) {
32 ZMthrowC (ZMxpvImproperTransformation(
33 "column 4 supplied to define transformation has negative T component"));
34 *this = HepLorentzRotation();
35 return *this;
36 }
37
38 double u1u1 = ccol1.dot(ccol1);
39 double f11 = std::fabs(u1u1 + 1.0);
41 ZMthrowC (ZMxpvNotSymplectic(
42 "column 1 supplied for HepLorentzRotation has w*w != -1"));
43 }
44 double u2u2 = ccol2.dot(ccol2);
45 double f22 = std::fabs(u2u2 + 1.0);
47 ZMthrowC (ZMxpvNotSymplectic(
48 "column 2 supplied for HepLorentzRotation has w*w != -1"));
49 }
50 double u3u3 = ccol3.dot(ccol3);
51 double f33 = std::fabs(u3u3 + 1.0);
53 ZMthrowC (ZMxpvNotSymplectic(
54 "column 3 supplied for HepLorentzRotation has w*w != -1"));
55 }
56 double u4u4 = ccol4.dot(ccol4);
57 double f44 = std::fabs(u4u4 - 1.0);
59 ZMthrowC (ZMxpvNotSymplectic(
60 "column 4 supplied for HepLorentzRotation has w*w != +1"));
61 }
62
63 double u1u2 = ccol1.dot(ccol2);
64 double f12 = std::fabs(u1u2);
66 ZMthrowC (ZMxpvNotOrthogonal(
67 "columns 1 and 2 supplied for HepLorentzRotation have non-zero dot"));
68 }
69 double u1u3 = ccol1.dot(ccol3);
70 double f13 = std::fabs(u1u3);
71
73 ZMthrowC (ZMxpvNotOrthogonal(
74 "columns 1 and 3 supplied for HepLorentzRotation have non-zero dot"));
75 }
76 double u1u4 = ccol1.dot(ccol4);
77 double f14 = std::fabs(u1u4);
79 ZMthrowC (ZMxpvNotOrthogonal(
80 "columns 1 and 4 supplied for HepLorentzRotation have non-zero dot"));
81 }
82 double u2u3 = ccol2.dot(ccol3);
83 double f23 = std::fabs(u2u3);
85 ZMthrowC (ZMxpvNotOrthogonal(
86 "columns 2 and 3 supplied for HepLorentzRotation have non-zero dot"));
87 }
88 double u2u4 = ccol2.dot(ccol4);
89 double f24 = std::fabs(u2u4);
91 ZMthrowC (ZMxpvNotOrthogonal(
92 "columns 2 and 4 supplied for HepLorentzRotation have non-zero dot"));
93 }
94 double u3u4 = ccol3.dot(ccol4);
95 double f34 = std::fabs(u3u4);
97 ZMthrowC (ZMxpvNotOrthogonal(
98 "columns 3 and 4 supplied for HepLorentzRotation have non-zero dot"));
99 }
100
101 // Our strategy will be to order the cols, then do gram-schmidt on them
102 // (that is, remove the components of col d that make it non-orthogonal to
103 // col c, normalize that, then remove the components of b that make it
104 // non-orthogonal to d and to c, normalize that, etc.
105
106 // Because col4, the time col, is most likely to be computed directly, we
107 // will start from there and work left-ward.
108
109 HepLorentzVector a, b, c, d;
110 bool isLorentzTransformation = true;
111 double norm;
112
113 d = ccol4;
114 norm = d.dot(d);
115 if (norm <= 0.0) {
116 isLorentzTransformation = false;
117 if (norm == 0.0) {
118 d = T_HAT4; // Moot, but let's keep going...
119
120 norm = 1.0;
121 }
122 }
123 d /= norm;
124
125 c = ccol3 - ccol3.dot(d) * d;
126 norm = -c.dot(c);
127 if (norm <= 0.0) {
128 isLorentzTransformation = false;
129 if (norm == 0.0) {
130 c = Z_HAT4; // Moot
131 norm = 1.0;
132 }
133 }
134 c /= norm;
135
136 b = ccol2 + ccol2.dot(c) * c - ccol2.dot(d) * d;
137 norm = -b.dot(b);
138 if (norm <= 0.0) {
139 isLorentzTransformation = false;
140 if (norm == 0.0) {
141 b = Y_HAT4; // Moot
142 norm = 1.0;
143 }
144 }
145 b /= norm;
146
147 a = ccol1 + ccol1.dot(b) * b + ccol1.dot(c) * c - ccol1.dot(d) * d;
148 norm = -a.dot(a);
149 if (norm <= 0.0) {
150 isLorentzTransformation = false;
151 if (norm == 0.0) {
152 a = X_HAT4; // Moot
153 norm = 1.0;
154 }
155 }
156 a /= norm;
157
158 if ( !isLorentzTransformation ) {
159 ZMthrowC (ZMxpvImproperTransformation(
160 "cols 1-4 supplied to define transformation form either \n"
161 " a boosted reflection or a tachyonic transformation -- \n"
162 " transformation will be set to Identity "));
163
164
165 *this = HepLorentzRotation();
166 }
167
168 if ( isLorentzTransformation ) {
169 mxx = a.x(); myx = a.y(); mzx = a.z(); mtx = a.t();
170 mxy = b.x(); myy = b.y(); mzy = b.z(); mty = b.t();
171 mxz = c.x(); myz = c.y(); mzz = c.z(); mtz = c.t();
172 mxt = d.x(); myt = d.y(); mzt = d.z(); mtt = d.t();
173 }
174
175 HepLorentzVector::setMetric (savedMetric);
176 return *this;
177
178} // set ( col1, col2, col3, col4 )
#define ZMthrowC(A)
Definition: ZMxpv.h:133
static ZMpvMetric_t setMetric(ZMpvMetric_t a1)
double norm(const HepGenMatrix &m)
Definition: GenMatrix.cc:54
@ TimePositive
Definition: LorentzVector.h:61

◆ set() [8/14]

HepLorentzRotation & CLHEP::HepLorentzRotation::set ( const HepRep4x4 rep)
inline

◆ set() [9/14]

HepLorentzRotation & CLHEP::HepLorentzRotation::set ( const HepRotation r)
inline

◆ set() [10/14]

HepLorentzRotation & CLHEP::HepLorentzRotation::set ( const HepRotation R,
const HepBoost B 
)

Definition at line 54 of file LorentzRotation.cc.

55 {
56 set (R.rep4x4());
57 *this = matrixMultiplication ( B.rep4x4() );
58 return *this;
59}

◆ set() [11/14]

HepLorentzRotation & CLHEP::HepLorentzRotation::set ( const HepRotationX r)
inline

◆ set() [12/14]

HepLorentzRotation & CLHEP::HepLorentzRotation::set ( const HepRotationY r)
inline

◆ set() [13/14]

HepLorentzRotation & CLHEP::HepLorentzRotation::set ( const HepRotationZ r)
inline

◆ set() [14/14]

HepLorentzRotation & CLHEP::HepLorentzRotation::set ( double  bx,
double  by,
double  bz 
)

Definition at line 25 of file LorentzRotation.cc.

26 {
27 double bp2 = bx*bx + by*by + bz*bz;
28 if (bp2 >= 1) {
29 ZMthrowA (ZMxpvTachyonic(
30 "Boost Vector supplied to set HepLorentzRotation represents speed >= c."));
31 }
32 double gamma = 1.0 / std::sqrt(1.0 - bp2);
33 double bgamma = gamma * gamma / (1.0 + gamma);
34 mxx = 1.0 + bgamma * bx * bx;
35 myy = 1.0 + bgamma * by * by;
36 mzz = 1.0 + bgamma * bz * bz;
37 mxy = myx = bgamma * bx * by;
38 mxz = mzx = bgamma * bx * bz;
39 myz = mzy = bgamma * by * bz;
40 mxt = mtx = gamma * bx;
41 myt = mty = gamma * by;
42 mzt = mtz = gamma * bz;
43 mtt = gamma;
44 return *this;
45}

Referenced by HepLorentzRotation(), rectify(), set(), and setRows().

◆ setBoost()

void CLHEP::HepLorentzRotation::setBoost ( double  ,
double  ,
double   
)
inlineprotected

◆ setRows()

HepLorentzRotation & CLHEP::HepLorentzRotation::setRows ( const HepLorentzVector row1,
const HepLorentzVector row2,
const HepLorentzVector row3,
const HepLorentzVector row4 
)

Definition at line 180 of file LorentzRotationC.cc.

184 {
185 // Set based on using those rows as columns:
186 set (rrow1, rrow2, rrow3, rrow4);
187 // Now transpose in place:
188 double q1, q2, q3;
189 q1 = mxy; q2 = mxz; q3 = mxt;
190 mxy = myx; mxz = mzx; mxt = mtx;
191 myx = q1; mzx = q2; mtx = q3;
192 q1 = myz; q2 = myt; q3 = mzt;
193 myz = mzy; myt = mty; mzt = mtz;
194 mzy = q1; mty = q2; mtz = q3;
195 return *this;
196} // LorentzTransformation::setRows(row1 ... row4)

◆ setTolerance()

static double CLHEP::HepLorentzRotation::setTolerance ( double  tol)
inlinestatic

◆ transform() [1/3]

HepLorentzRotation & CLHEP::HepLorentzRotation::transform ( const HepBoost b)
inline

Referenced by main().

◆ transform() [2/3]

HepLorentzRotation & CLHEP::HepLorentzRotation::transform ( const HepLorentzRotation lt)
inline

◆ transform() [3/3]

HepLorentzRotation & CLHEP::HepLorentzRotation::transform ( const HepRotation r)
inline

◆ tt()

double CLHEP::HepLorentzRotation::tt ( ) const
inline

◆ tx()

double CLHEP::HepLorentzRotation::tx ( ) const
inline

◆ ty()

double CLHEP::HepLorentzRotation::ty ( ) const
inline

◆ tz()

double CLHEP::HepLorentzRotation::tz ( ) const
inline

◆ vectorMultiplication()

HepLorentzVector CLHEP::HepLorentzRotation::vectorMultiplication ( const HepLorentzVector ) const
inline

◆ xt()

double CLHEP::HepLorentzRotation::xt ( ) const
inline

◆ xx()

double CLHEP::HepLorentzRotation::xx ( ) const
inline

◆ xy()

double CLHEP::HepLorentzRotation::xy ( ) const
inline

◆ xz()

double CLHEP::HepLorentzRotation::xz ( ) const
inline

◆ yt()

double CLHEP::HepLorentzRotation::yt ( ) const
inline

◆ yx()

double CLHEP::HepLorentzRotation::yx ( ) const
inline

◆ yy()

double CLHEP::HepLorentzRotation::yy ( ) const
inline

◆ yz()

double CLHEP::HepLorentzRotation::yz ( ) const
inline

◆ zt()

double CLHEP::HepLorentzRotation::zt ( ) const
inline

◆ zx()

double CLHEP::HepLorentzRotation::zx ( ) const
inline

◆ zy()

double CLHEP::HepLorentzRotation::zy ( ) const
inline

◆ zz()

double CLHEP::HepLorentzRotation::zz ( ) const
inline

Friends And Related Function Documentation

◆ inverseOf

HepLorentzRotation inverseOf ( const HepLorentzRotation lt)
friend

Member Data Documentation

◆ IDENTITY

const HepLorentzRotation CLHEP::HepLorentzRotation::IDENTITY
static

Definition at line 54 of file LorentzRotation.h.

◆ mtt

double CLHEP::HepLorentzRotation::mtt
protected

◆ mtx

double CLHEP::HepLorentzRotation::mtx
protected

◆ mty

double CLHEP::HepLorentzRotation::mty
protected

◆ mtz

double CLHEP::HepLorentzRotation::mtz
protected

◆ mxt

double CLHEP::HepLorentzRotation::mxt
protected

◆ mxx

double CLHEP::HepLorentzRotation::mxx
protected

◆ mxy

double CLHEP::HepLorentzRotation::mxy
protected

◆ mxz

double CLHEP::HepLorentzRotation::mxz
protected

◆ myt

double CLHEP::HepLorentzRotation::myt
protected

◆ myx

double CLHEP::HepLorentzRotation::myx
protected

◆ myy

double CLHEP::HepLorentzRotation::myy
protected

◆ myz

double CLHEP::HepLorentzRotation::myz
protected

◆ mzt

double CLHEP::HepLorentzRotation::mzt
protected

◆ mzx

double CLHEP::HepLorentzRotation::mzx
protected

◆ mzy

double CLHEP::HepLorentzRotation::mzy
protected

◆ mzz

double CLHEP::HepLorentzRotation::mzz
protected

The documentation for this class was generated from the following files: