Geant4 10.7.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
Boost.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 HepBoost class for performing specialized
6// Lorentz transformations which are pure boosts on objects of the
7// HepLorentzVector class.
8//
9// HepBoost is a concrete implementation of Hep4RotationInterface.
10//
11// .SS See Also
12// RotationInterfaces.h
13// LorentzVector.h LorentzRotation.h
14// BoostX.h BoostY.h BoostZ.h
15//
16// .SS Author
17// Mark Fischler
18
19#ifndef HEP_BOOST_H
20#define HEP_BOOST_H
21
23#include "CLHEP/Vector/BoostX.h"
24#include "CLHEP/Vector/BoostY.h"
25#include "CLHEP/Vector/BoostZ.h"
27
28namespace CLHEP {
29
30// Declarations of classes and global methods
31class HepBoost;
32inline HepBoost inverseOf ( const HepBoost & lt );
33
34/**
35 * @author
36 * @ingroup vector
37 */
38class HepBoost {
39
40public:
41
42 // ---------- Constructors and Assignment:
43
44 inline HepBoost();
45 // Default constructor. Gives a boost of 0.
46
47 inline HepBoost(const HepBoost & m);
48 inline HepBoost(HepBoost && m) = default;
49 // Copy and move constructors.
50
51 inline HepBoost & operator = (const HepBoost & m);
52 inline HepBoost & operator = (HepBoost && m) = default;
53 // Copy and move assignment operators.
54
55 HepBoost & set (double betaX, double betaY, double betaZ);
56 inline HepBoost (double betaX, double betaY, double betaZ);
57 // Constructor from three components of beta vector
58
59 HepBoost & set (const HepRep4x4Symmetric & m);
60 inline HepBoost (const HepRep4x4Symmetric & m);
61 // Constructor from symmetric HepRep4x4
62
65 // Constructor from a three vector direction and the magnitude of beta
66
67 HepBoost & set (const Hep3Vector & boost);
68 inline HepBoost (const Hep3Vector & boost);
69 // Constructor from a 3-vector of less than unit length
70
71 inline HepBoost & set (const HepBoostX & boost);
72 inline HepBoost & set (const HepBoostY & boost);
73 inline HepBoost & set (const HepBoostZ & boost);
74 inline HepBoost (const HepBoostX & boost);
75 inline HepBoost (const HepBoostY & boost);
76 inline HepBoost (const HepBoostZ & boost);
77
78 // ---------- Accessors:
79
80 inline double beta() const;
81 inline double gamma() const;
82 inline Hep3Vector boostVector() const;
83 inline Hep3Vector getDirection() const;
84 inline Hep3Vector direction() const;
85
86 inline double xx() const;
87 inline double xy() const;
88 inline double xz() const;
89 inline double xt() const;
90 inline double yx() const;
91 inline double yy() const;
92 inline double yz() const;
93 inline double yt() const;
94 inline double zx() const;
95 inline double zy() const;
96 inline double zz() const;
97 inline double zt() const;
98 inline double tx() const;
99 inline double ty() const;
100 inline double tz() const;
101 inline double tt() const;
102 // Elements of the matrix.
103
104 inline HepLorentzVector col1() const;
105 inline HepLorentzVector col2() const;
106 inline HepLorentzVector col3() const;
107 inline HepLorentzVector col4() const;
108 // orthosymplectic column vectors
109
110 inline HepLorentzVector row1() const;
111 inline HepLorentzVector row2() const;
112 inline HepLorentzVector row3() const;
113 inline HepLorentzVector row4() const;
114 // orthosymplectic row vectors
115
116 inline HepRep4x4 rep4x4() const;
117 // 4x4 representation.
118
120 // Symmetric 4x4 representation.
121
122 // ---------- Decomposition:
123
124 void decompose (HepRotation & rotation, HepBoost & boost) const;
125 void decompose (HepAxisAngle & rotation, Hep3Vector & boost) const;
126 // Find R and B such that L = R*B -- trivial, since R is identity
127
128 void decompose (HepBoost & boost, HepRotation & rotation) const;
129 void decompose (Hep3Vector & boost, HepAxisAngle & rotation) const;
130 // Find R and B such that L = B*R -- trivial, since R is identity
131
132 // ---------- Comparisons:
133
134 inline int compare( const HepBoost & b ) const;
135 // Dictionary-order comparison, in order tt,zt,zz,yt,yz,yy,xt,xz,xy,xx
136 // Used in operator<, >, <=, >=
137
138 inline bool operator == (const HepBoost & b) const;
139 inline bool operator != (const HepBoost & b) const;
140 inline bool operator <= (const HepBoost & b) const;
141 inline bool operator >= (const HepBoost & b) const;
142 inline bool operator < (const HepBoost & b) const;
143 inline bool operator > (const HepBoost & b) const;
144 // Comparisons.
145
146 inline bool isIdentity() const;
147 // Returns true if a null boost.
148
149 inline double distance2( const HepBoost & b ) const;
150 inline double distance2( const HepBoostX & bx ) const;
151 inline double distance2( const HepBoostY & by ) const;
152 inline double distance2( const HepBoostZ & bz ) const;
153 // Defined as the distance2 between the vectors (gamma*betaVector)
154
155 double distance2( const HepRotation & r ) const;
156 double distance2( const HepLorentzRotation & lt ) const;
157 // Distance between this and other sorts of transformations
158
159 inline double howNear( const HepBoost & b ) const;
160 inline bool isNear( const HepBoost & b,
162
163 double howNear( const HepRotation & r ) const;
164 double howNear( const HepLorentzRotation & lt ) const;
165
166 bool isNear( const HepRotation & r,
168 bool isNear( const HepLorentzRotation & lt,
170
171 // ---------- Properties:
172
173 double norm2() const;
174 // (beta*gamma)^2
175
176 void rectify();
177 // set as an exact boost, based on the timelike part of the boost matrix.
178
179 // ---------- Application:
180
182 // Transform a Lorentz Vector.
183
185 // Multiplication with a Lorentz Vector.
186
187 // ---------- Operations in the group of 4-Rotations
188
189 HepLorentzRotation operator * (const HepBoost & b) const;
192 // Product of two Lorentz Rotations (this) * lt - matrix multiplication
193 // Notice that the product of two pure boosts is no longer a pure boost
194
195 inline HepBoost inverse() const;
196 // Return the inverse.
197
198 inline friend HepBoost inverseOf ( const HepBoost & lt );
199 // global methods to invert.
200
201 inline HepBoost & invert();
202 // Inverts the Boost matrix.
203
204 // ---------- I/O:
205
206 std::ostream & print( std::ostream & os ) const;
207 // Output form is (bx, by, bz)
208
209 // ---------- Tolerance
210
211 static inline double getTolerance();
212 static inline double setTolerance(double tol);
213
214protected:
215
217 ( const HepLorentzVector & w ) const;
218 // Multiplication with a Lorentz Vector.
219
222
223 inline HepBoost
224 (double xx, double xy, double xz, double xt,
225 double yy, double yz, double yt,
226 double zz, double zt,
227 double tt);
228 // Protected constructor.
229 // DOES NOT CHECK FOR VALIDITY AS A LORENTZ BOOST.
230
231 inline void setBoost(double bx, double by, double bz);
232
234
235}; // HepBoost
236
237inline
238std::ostream & operator <<
239 ( std::ostream & os, const HepBoost& b ) {return b.print(os);}
240
241} // namespace CLHEP
242
243#include "CLHEP/Vector/Boost.icc"
244
245#endif /* HEP_BOOST_H */
double epsilon(double density, double temperature)
static DLL_API double tolerance
double norm2() const
Definition: Boost.cc:137
Hep3Vector getDirection() const
HepBoost & set(double betaX, double betaY, double betaZ)
Definition: Boost.cc:20
HepBoost & operator=(const HepBoost &m)
HepRep4x4Symmetric rep4x4Symmetric() const
HepBoost(const HepBoostY &boost)
void decompose(HepRotation &rotation, HepBoost &boost) const
Definition: Boost.cc:68
HepLorentzVector col2() const
bool isIdentity() const
bool operator<(const HepBoost &b) const
HepLorentzVector row2() const
HepLorentzVector col3() const
HepLorentzVector row1() const
double beta() const
HepLorentzRotation matrixMultiplication(const HepRep4x4 &m) const
Definition: Boost.cc:179
HepLorentzVector col4() const
double tz() const
bool isNear(const HepBoost &b, double epsilon=Hep4RotationInterface::tolerance) const
void setBoost(double bx, double by, double bz)
int compare(const HepBoost &b) const
double distance2(const HepBoostY &by) const
void rectify()
Definition: Boost.cc:144
HepBoost(const HepRep4x4Symmetric &m)
HepLorentzVector operator*(const HepLorentzVector &p) const
HepBoost(double xx, double xy, double xz, double xt, double yy, double yz, double yt, double zz, double zt, double tt)
double yt() const
double xt() const
friend HepBoost inverseOf(const HepBoost &lt)
double distance2(const HepBoostZ &bz) const
double yx() const
double howNear(const HepBoost &b) const
HepBoost & set(const HepBoostZ &boost)
double xz() const
double distance2(const HepBoost &b) const
double tt() const
HepBoost & set(const HepBoostY &boost)
double zy() const
HepLorentzVector row3() const
HepBoost(const HepBoostZ &boost)
HepLorentzVector col1() const
double tx() const
Hep3Vector direction() const
HepRep4x4 rep4x4() const
HepBoost(const HepBoost &m)
Hep3Vector boostVector() const
bool operator==(const HepBoost &b) const
double zx() const
bool operator!=(const HepBoost &b) const
double gamma() const
bool operator>(const HepBoost &b) const
HepLorentzVector vectorMultiplication(const HepLorentzVector &w) const
HepBoost inverse() const
double yy() const
HepRep4x4Symmetric rep_
Definition: Boost.h:233
HepBoost & set(const HepBoostX &boost)
HepBoost(HepBoost &&m)=default
HepLorentzVector row4() const
double xx() const
HepBoost(const HepBoostX &boost)
bool operator>=(const HepBoost &b) const
std::ostream & print(std::ostream &os) const
Definition: Boost.cc:245
HepBoost(const Hep3Vector &boost)
HepBoost(Hep3Vector direction, double beta)
double ty() const
double distance2(const HepBoostX &bx) const
static double setTolerance(double tol)
double zt() const
HepBoost(double betaX, double betaY, double betaZ)
double zz() const
HepBoost & invert()
HepLorentzVector operator()(const HepLorentzVector &p) const
bool operator<=(const HepBoost &b) const
static double getTolerance()
double yz() const
double xy() const
Definition: DoubConv.h:17
HepBoost inverseOf(const HepBoost &lt)