Geant4-11
BoostZ.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 HepBoostZ class for performing specialized
6// Lorentz transformations which are pure boosts in the Z 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_BOOSTZ_H
20#define HEP_BOOSTZ_H
21
24
25namespace CLHEP {
26
27// Declarations of classes and global methods
28class HepBoostZ;
29inline HepBoostZ inverseOf ( const HepBoostZ & b );
30class HepBoost;
31class HepRotation;
32
37class HepBoostZ {
38
39public:
40
41 // ---------- Constructors and Assignment:
42
43 inline HepBoostZ();
44 // Default constructor. Gives a boost of 0.
45
46 inline HepBoostZ(const HepBoostZ & b);
47 inline HepBoostZ(HepBoostZ && b) = default;
48 // Copy and move constructors.
49
50 inline HepBoostZ & operator = (const HepBoostZ & m);
51 inline HepBoostZ & operator = (HepBoostZ && m) = default;
52 // Copy and move assignment operators.
53
54 HepBoostZ & set (double beta);
55 inline HepBoostZ (double beta);
56 // Constructor from beta
57
58 // ---------- Accessors:
59
60 inline double beta() const;
61 inline double gamma() const;
62 inline Hep3Vector boostVector() const;
63 inline Hep3Vector getDirection() const;
64
65 inline double xx() const;
66 inline double xy() const;
67 inline double xz() const;
68 inline double xt() const;
69 inline double yx() const;
70 inline double yy() const;
71 inline double yz() const;
72 inline double yt() const;
73 inline double zx() const;
74 inline double zy() const;
75 inline double zz() const;
76 inline double zt() const;
77 inline double tx() const;
78 inline double ty() const;
79 inline double tz() const;
80 inline double tt() const;
81 // Elements of the matrix.
82
83 inline HepLorentzVector col1() const;
84 inline HepLorentzVector col2() const;
85 inline HepLorentzVector col3() const;
86 inline HepLorentzVector col4() const;
87 // orthosymplectic column vectors
88
89 inline HepLorentzVector row1() const;
90 inline HepLorentzVector row2() const;
91 inline HepLorentzVector row3() const;
92 inline HepLorentzVector row4() const;
93 // orthosymplectic row vectors
94
95 HepRep4x4 rep4x4() const;
96 // 4x4 representation:
97
99 // Symmetric 4x4 representation.
100
101 // ---------- Decomposition:
102
103 void decompose (HepRotation & rotation, HepBoost & boost) const;
104 void decompose (HepAxisAngle & rotation, Hep3Vector & boost) const;
105 // Find R and B such that L = R*B -- trivial, since R is identity
106
107 void decompose (HepBoost & boost, HepRotation & rotation) const;
108 void decompose (Hep3Vector & boost, HepAxisAngle & rotation) const;
109 // Find R and B such that L = B*R -- trivial, since R is identity
110
111 // ---------- Comparisons:
112
113 inline int compare( const HepBoostZ & b ) const;
114 // Dictionary-order comparison, in order of beta.
115 // Used in operator<, >, <=, >=
116
117 inline bool operator == (const HepBoostZ & b) const;
118 inline bool operator != (const HepBoostZ & b) const;
119 inline bool operator <= (const HepBoostZ & b) const;
120 inline bool operator >= (const HepBoostZ & b) const;
121 inline bool operator < (const HepBoostZ & b) const;
122 inline bool operator > (const HepBoostZ & b) const;
123 // Comparisons.
124
125 inline bool isIdentity() const;
126 // Returns true if a null boost.
127
128 inline double distance2( const HepBoostZ & b ) const;
129 double distance2( const HepBoost & b ) const;
130 // Defined as the distance2 between the vectors (gamma*betaVector)
131
132 double distance2( const HepRotation & r ) const;
133 double distance2( const HepLorentzRotation & lt ) const;
134 // Decompose lt = B*R; add norm2 to distance2 to between boosts.
135
136 inline double howNear( const HepBoostZ & b ) const;
137 inline double howNear( const HepBoost & b ) const;
138 inline double howNear( const HepRotation & r ) const;
139 inline double howNear( const HepLorentzRotation & lt ) const;
140
141 inline bool isNear( const HepBoostZ & b,
143 inline bool isNear( const HepBoost & b,
145 bool isNear( const HepRotation & r,
147 bool isNear( const HepLorentzRotation & lt,
149
150 // ---------- Properties:
151
152 inline double norm2() const;
153 // distance2 (IDENTITY), which is beta^2 * gamma^2
154
155 void rectify();
156 // sets according to the stored beta
157
158 // ---------- Application:
159
161 // Transform a Lorentz Vector.
162
164 // Multiplication with a Lorentz Vector.
165
166 // ---------- Operations in the group of 4-Rotations
167
168 HepBoostZ operator * (const HepBoostZ & b) const;
169 HepLorentzRotation operator * (const HepBoost & b) const;
172 // Product of two Lorentz Rotations (this) * lt - matrix multiplication
173 // Notice that the product of two pure boosts in different directions
174 // is no longer a pure boost.
175
176 inline HepBoostZ inverse() const;
177 // Return the inverse.
178
179 inline friend HepBoostZ inverseOf ( const HepBoostZ & b );
180 // global methods to invert.
181
182 inline HepBoostZ & invert();
183 // Inverts the Boost matrix.
184
185 // ---------- I/O:
186
187 std::ostream & print( std::ostream & os ) const;
188 // Output form is BOOSTZ (beta=..., gamma=...);
189
190 // ---------- Tolerance
191
192 static inline double getTolerance();
193 static inline double setTolerance(double tol);
194
195protected:
196
198 ( const HepLorentzVector & w ) const;
199 // Multiplication with a Lorentz Vector.
200
203
204 inline HepBoostZ (double beta, double gamma);
205
206 double beta_;
207 double gamma_;
208
209}; // HepBoostZ
210
211inline
212std::ostream & operator <<
213 ( std::ostream & os, const HepBoostZ& b ) {return b.print(os);}
214
215} // namespace CLHEP
216
218
219#endif /* HEP_BOOSTZ_H */
G4double epsilon(G4double density, G4double temperature)
static DLL_API double tolerance
double howNear(const HepRotation &r) const
double zz() const
HepLorentzVector col2() const
HepLorentzVector col3() const
HepBoostZ & set(double beta)
Definition: BoostZ.cc:21
bool operator<=(const HepBoostZ &b) const
HepBoostZ & operator=(const HepBoostZ &m)
HepLorentzVector row2() const
double xz() const
HepLorentzRotation matrixMultiplication(const HepRep4x4 &m) const
bool operator>=(const HepBoostZ &b) const
double norm2() const
HepLorentzVector vectorMultiplication(const HepLorentzVector &w) const
bool isIdentity() const
double beta() const
double xy() const
HepLorentzVector col4() const
bool operator>(const HepBoostZ &b) const
double howNear(const HepBoostZ &b) const
bool isNear(const HepBoostZ &b, double epsilon=Hep4RotationInterface::tolerance) const
double xt() const
double xx() const
HepBoostZ(double beta, double gamma)
HepBoostZ(HepBoostZ &&b)=default
HepLorentzVector operator()(const HepLorentzVector &w) const
HepLorentzVector col1() const
double howNear(const HepBoost &b) const
HepLorentzRotation matrixMultiplication(const HepRep4x4Symmetric &m) const
double howNear(const HepLorentzRotation &lt) const
bool isNear(const HepBoost &b, double epsilon=Hep4RotationInterface::tolerance) const
double zt() const
Hep3Vector boostVector() const
HepBoostZ inverse() const
double zx() const
friend HepBoostZ inverseOf(const HepBoostZ &b)
bool operator==(const HepBoostZ &b) const
std::ostream & print(std::ostream &os) const
Definition: BoostZ.cc:155
Hep3Vector getDirection() const
static double getTolerance()
double tz() const
double ty() const
HepRep4x4 rep4x4() const
Definition: BoostZ.cc:37
HepRep4x4Symmetric rep4x4Symmetric() const
Definition: BoostZ.cc:45
double distance2(const HepBoostZ &b) const
double tt() const
double yt() const
double tx() const
HepLorentzVector row3() const
static double setTolerance(double tol)
double gamma() const
double beta_
Definition: BoostZ.h:206
HepLorentzVector row1() const
HepBoostZ(const HepBoostZ &b)
double gamma_
Definition: BoostZ.h:207
HepLorentzVector row4() const
int compare(const HepBoostZ &b) const
HepBoostZ(double beta)
void rectify()
Definition: BoostZ.cc:120
bool operator!=(const HepBoostZ &b) const
void decompose(HepRotation &rotation, HepBoost &boost) const
Definition: BoostZ.cc:55
double yz() const
double yy() const
HepLorentzVector operator*(const HepLorentzVector &w) const
double zy() const
double yx() const
HepBoostZ & invert()
bool operator<(const HepBoostZ &b) const
Definition: DoubConv.h:17
HepBoost inverseOf(const HepBoost &lt)
static constexpr double m