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