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