CLHEP 2.4.6.4
C++ Class Library for High Energy Physics
Loading...
Searching...
No Matches
BoostX.h
Go to the documentation of this file.
1// -*- C++ -*-
2//
3// This file is a part of the CLHEP - a Class Library for High Energy Physics.
4//
5// This is the definition of the HepBoostX class for performing specialized
6// Lorentz transformations which are pure boosts in the X direction, on
7// objects of the HepLorentzVector class.
8//
9// HepLorentzRotation is a concrete implementation of Hep4RotationInterface.
10//
11// .SS See Also
12// RotationInterfaces.h
13// LorentzVector.h LorentzRotation.h
14// Boost.h
15//
16// .SS Author
17// Mark Fischler
18
19#ifndef HEP_BOOSTX_H
20#define HEP_BOOSTX_H
21
22#include "CLHEP/Vector/defs.h"
23#include "CLHEP/Vector/RotationInterfaces.h"
24#include "CLHEP/Vector/LorentzVector.h"
25
26namespace CLHEP {
27
28// Declarations of classes and global methods
29class HepBoostX;
30inline HepBoostX inverseOf ( const HepBoostX & b );
31class HepBoost;
32class HepRotation;
33
34/**
35 * @author
36 * @ingroup vector
37 */
38class HepBoostX {
39
40public:
41
42 // ---------- Constructors and Assignment:
43
44 inline HepBoostX();
45 // Default constructor. Gives a boost of 0.
46
47 inline HepBoostX(const HepBoostX & b);
48 inline HepBoostX(HepBoostX && b) = default;
49 // Copy and move constructors.
50
51 inline HepBoostX & operator = (const HepBoostX & m);
52 inline HepBoostX & operator = (HepBoostX && m) = default;
53 // Copy and move assignment operators.
54
55 HepBoostX & set (double beta);
56 inline HepBoostX (double beta);
57 // Constructor from beta
58
59 // ---------- Accessors:
60
61 inline double beta() const;
62 inline double gamma() const;
63 inline Hep3Vector boostVector() const;
64 inline Hep3Vector getDirection() const;
65
66 inline double xx() const;
67 inline double xy() const;
68 inline double xz() const;
69 inline double xt() const;
70 inline double yx() const;
71 inline double yy() const;
72 inline double yz() const;
73 inline double yt() const;
74 inline double zx() const;
75 inline double zy() const;
76 inline double zz() const;
77 inline double zt() const;
78 inline double tx() const;
79 inline double ty() const;
80 inline double tz() const;
81 inline double tt() const;
82 // Elements of the matrix.
83
84 inline HepLorentzVector col1() const;
85 inline HepLorentzVector col2() const;
86 inline HepLorentzVector col3() const;
87 inline HepLorentzVector col4() const;
88 // orthosymplectic column vectors
89
90 inline HepLorentzVector row1() const;
91 inline HepLorentzVector row2() const;
92 inline HepLorentzVector row3() const;
93 inline HepLorentzVector row4() const;
94 // orthosymplectic row vectors
95
96 HepRep4x4 rep4x4() const;
97 // 4x4 representation:
98
100 // Symmetric 4x4 representation.
101
102 // ---------- Decomposition:
103
104 void decompose (HepRotation & rotation, HepBoost & boost) const;
105 void decompose (HepAxisAngle & rotation, Hep3Vector & boost) const;
106 // Find R and B such that L = R*B -- trivial, since R is identity
107
108 void decompose ( HepBoost & boost, HepRotation & rotation) const;
109 void decompose (Hep3Vector & boost, HepAxisAngle & rotation) const;
110 // Find R and B such that L = B*R -- trivial, since R is identity
111
112 // ---------- Comparisons:
113
114 inline int compare( const HepBoostX & b ) const;
115 // Dictionary-order comparison, in order of beta.
116 // Used in operator<, >, <=, >=
117
118 inline bool operator == (const HepBoostX & b) const;
119 inline bool operator != (const HepBoostX & b) const;
120 inline bool operator <= (const HepBoostX & b) const;
121 inline bool operator >= (const HepBoostX & b) const;
122 inline bool operator < (const HepBoostX & b) const;
123 inline bool operator > (const HepBoostX & b) const;
124 // Comparisons.
125
126 inline bool isIdentity() const;
127 // Returns true if a null boost.
128
129 inline double distance2( const HepBoostX & b ) const;
130 double distance2( const HepBoost & b ) const;
131 // Defined as the distance2 between the vectors (gamma*betaVector)
132
133 double distance2( const HepRotation & r ) const;
134 double distance2( const HepLorentzRotation & lt ) const;
135 // Decompose lt = B*R; add norm2 to distance2 to between boosts.
136
137 inline double howNear( const HepBoostX & b ) const;
138 inline double howNear( const HepBoost & b ) const;
139 inline double howNear( const HepRotation & r ) const;
140 inline double howNear( const HepLorentzRotation & lt ) const;
141
142 inline bool isNear( const HepBoostX & b,
143 double epsilon=Hep4RotationInterface::tolerance) const;
144 inline bool isNear( const HepBoost & b,
145 double epsilon=Hep4RotationInterface::tolerance) const;
146 bool isNear( const HepRotation & r,
147 double epsilon=Hep4RotationInterface::tolerance) const;
148 bool isNear( const HepLorentzRotation & lt,
149 double epsilon=Hep4RotationInterface::tolerance) const;
150
151 // ---------- Properties:
152
153 inline double norm2() const;
154 // distance2 (IDENTITY), which is beta^2 * gamma^2
155
156 void rectify();
157 // sets according to the stored beta
158
159 // ---------- Application:
160
162 // Transform a Lorentz Vector.
163
165 // Multiplication with a Lorentz Vector.
166
167 // ---------- Operations in the group of 4-Rotations
168
169 HepBoostX operator * (const HepBoostX & b) const;
170 HepLorentzRotation operator * (const HepBoost & b) const;
173 // Product of two Lorentz Rotations (this) * lt - matrix multiplication
174 // Notice that the product of two pure boosts in different directions
175 // is no longer a pure boost.
176
177 inline HepBoostX inverse() const;
178 // Return the inverse.
179
180 inline friend HepBoostX inverseOf ( const HepBoostX & b );
181 // global methods to invert.
182
183 inline HepBoostX & invert();
184 // Inverts the Boost matrix.
185
186 // ---------- I/O:
187
188 std::ostream & print( std::ostream & os ) const;
189 // Output form is BOOSTX (beta=..., gamma=...);
190
191 // ---------- Tolerance
192
193 static inline double getTolerance();
194 static inline double setTolerance(double tol);
195
196protected:
197
199 ( const HepLorentzVector & w ) const;
200 // Multiplication with a Lorentz Vector.
201
204
205 inline HepBoostX (double beta, double gamma);
206
207 double beta_;
208 double gamma_;
209
210}; // HepBoostX
211
212inline
213std::ostream & operator <<
214 ( std::ostream & os, const HepBoostX& b ) {return b.print(os);}
215
216} // namespace CLHEP
217
218#include "CLHEP/Vector/BoostX.icc"
219
220#ifdef ENABLE_BACKWARDS_COMPATIBILITY
221// backwards compatibility will be enabled ONLY in CLHEP 1.9
222using namespace CLHEP;
223#endif
224
225#endif /* HEP_BOOSTX_H */
double tz() const
double yt() const
double distance2(const HepBoostX &b) const
HepLorentzVector col3() const
double zt() const
bool operator!=(const HepBoostX &b) const
static double getTolerance()
double beta() const
bool isNear(const HepBoost &b, double epsilon=Hep4RotationInterface::tolerance) const
HepBoostX & invert()
HepBoostX(double beta)
HepLorentzVector operator*(const HepLorentzVector &w) const
bool operator>=(const HepBoostX &b) const
HepRep4x4 rep4x4() const
Definition: BoostX.cc:40
HepLorentzVector row3() const
double norm2() const
HepBoostX(double beta, double gamma)
HepLorentzRotation matrixMultiplication(const HepRep4x4 &m) const
double tt() const
double xt() const
HepLorentzVector row4() const
double beta_
Definition: BoostX.h:207
HepBoostX(const HepBoostX &b)
HepLorentzVector operator()(const HepLorentzVector &w) const
double zz() const
HepLorentzVector col2() const
HepLorentzVector row1() const
HepBoostX & set(double beta)
Definition: BoostX.cc:24
HepBoostX & operator=(const HepBoostX &m)
bool isNear(const HepBoostX &b, double epsilon=Hep4RotationInterface::tolerance) const
Hep3Vector boostVector() const
double zx() const
double xy() const
std::ostream & print(std::ostream &os) const
Definition: BoostX.cc:158
double howNear(const HepLorentzRotation &lt) const
void decompose(HepRotation &rotation, HepBoost &boost) const
Definition: BoostX.cc:58
Hep3Vector getDirection() const
double yy() const
double xx() const
double howNear(const HepRotation &r) const
int compare(const HepBoostX &b) const
double zy() const
bool operator<(const HepBoostX &b) const
bool operator>(const HepBoostX &b) const
HepLorentzRotation matrixMultiplication(const HepRep4x4Symmetric &m) const
HepRep4x4Symmetric rep4x4Symmetric() const
Definition: BoostX.cc:48
bool operator==(const HepBoostX &b) const
double gamma_
Definition: BoostX.h:208
double gamma() const
double yx() const
HepBoostX(HepBoostX &&b)=default
HepLorentzVector col1() const
HepLorentzVector row2() const
HepLorentzVector vectorMultiplication(const HepLorentzVector &w) const
double ty() const
friend HepBoostX inverseOf(const HepBoostX &b)
double howNear(const HepBoost &b) const
static double setTolerance(double tol)
double tx() const
double howNear(const HepBoostX &b) const
bool operator<=(const HepBoostX &b) const
HepLorentzVector col4() const
void rectify()
Definition: BoostX.cc:123
double xz() const
double yz() const
HepBoostX inverse() const
bool isIdentity() const
HepBoost inverseOf(const HepBoost &lt)