CLHEP VERSION Reference Documentation
   
CLHEP Home Page     CLHEP Documentation     CLHEP Bug Reports

Geometry/CLHEP/Vector/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 
26 #include "CLHEP/Vector/defs.h"
27 #include "CLHEP/Vector/RotationInterfaces.h"
28 #include "CLHEP/Vector/LorentzVector.h"
29 
30 namespace CLHEP {
31 
32 // Declarations of classes and global methods
33 class HepBoostX;
34 inline HepBoostX inverseOf ( const HepBoostX & b );
35 class HepBoost;
36 class HepRotation;
37 
42 class HepBoostX {
43 
44 public:
45 
46  // ---------- Constructors and Assignment:
47 
48  inline HepBoostX();
49  // Default constructor. Gives a boost of 0.
50 
51  inline HepBoostX(const HepBoostX & b);
52  // Copy constructor.
53 
54  inline HepBoostX & operator = (const HepBoostX & m);
55  // Assignment.
56 
57  HepBoostX & set (double beta);
58  inline HepBoostX (double beta);
59  // Constructor from beta
60 
61  // ---------- Accessors:
62 
63  inline double beta() const;
64  inline double gamma() const;
65  inline Hep3Vector boostVector() const;
66  inline Hep3Vector getDirection() const;
67 
68  inline double xx() const;
69  inline double xy() const;
70  inline double xz() const;
71  inline double xt() const;
72  inline double yx() const;
73  inline double yy() const;
74  inline double yz() const;
75  inline double yt() const;
76  inline double zx() const;
77  inline double zy() const;
78  inline double zz() const;
79  inline double zt() const;
80  inline double tx() const;
81  inline double ty() const;
82  inline double tz() const;
83  inline double tt() const;
84  // Elements of the matrix.
85 
86  inline HepLorentzVector col1() const;
87  inline HepLorentzVector col2() const;
88  inline HepLorentzVector col3() const;
89  inline HepLorentzVector col4() const;
90  // orthosymplectic column vectors
91 
92  inline HepLorentzVector row1() const;
93  inline HepLorentzVector row2() const;
94  inline HepLorentzVector row3() const;
95  inline HepLorentzVector row4() const;
96  // orthosymplectic row vectors
97 
98  HepRep4x4 rep4x4() const;
99  // 4x4 representation:
100 
102  // Symmetric 4x4 representation.
103 
104  // ---------- Decomposition:
105 
106  void decompose (HepRotation & rotation, HepBoost & boost) const;
107  void decompose (HepAxisAngle & rotation, Hep3Vector & boost) const;
108  // Find R and B such that L = R*B -- trivial, since R is identity
109 
110  void decompose ( HepBoost & boost, HepRotation & rotation) const;
111  void decompose (Hep3Vector & boost, HepAxisAngle & rotation) const;
112  // Find R and B such that L = B*R -- trivial, since R is identity
113 
114  // ---------- Comparisons:
115 
116  inline int compare( const HepBoostX & b ) const;
117  // Dictionary-order comparison, in order of beta.
118  // Used in operator<, >, <=, >=
119 
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  inline bool operator > (const HepBoostX & b) const;
126  // Comparisons.
127 
128  inline bool isIdentity() const;
129  // Returns true if a null boost.
130 
131  inline double distance2( const HepBoostX & b ) const;
132  double distance2( const HepBoost & b ) const;
133  // Defined as the distance2 between the vectors (gamma*betaVector)
134 
135  double distance2( const HepRotation & r ) const;
136  double distance2( const HepLorentzRotation & lt ) const;
137  // Decompose lt = B*R; add norm2 to distance2 to between boosts.
138 
139  inline double howNear( const HepBoostX & b ) const;
140  inline double howNear( const HepBoost & b ) const;
141  inline double howNear( const HepRotation & r ) const;
142  inline double howNear( const HepLorentzRotation & lt ) const;
143 
144  inline bool isNear( const HepBoostX & b,
145  double epsilon=Hep4RotationInterface::tolerance) const;
146  inline bool isNear( const HepBoost & b,
147  double epsilon=Hep4RotationInterface::tolerance) const;
148  bool isNear( const HepRotation & r,
149  double epsilon=Hep4RotationInterface::tolerance) const;
150  bool isNear( const HepLorentzRotation & lt,
151  double epsilon=Hep4RotationInterface::tolerance) const;
152 
153  // ---------- Properties:
154 
155  inline double norm2() const;
156  // distance2 (IDENTITY), which is beta^2 * gamma^2
157 
158  void rectify();
159  // sets according to the stored beta
160 
161  // ---------- Application:
162 
163  inline HepLorentzVector operator()( const HepLorentzVector & w ) const;
164  // Transform a Lorentz Vector.
165 
166  inline HepLorentzVector operator* ( const HepLorentzVector & w ) const;
167  // Multiplication with a Lorentz Vector.
168 
169  // ---------- Operations in the group of 4-Rotations
170 
171  HepBoostX operator * (const HepBoostX & b) const;
172  HepLorentzRotation operator * (const HepBoost & b) const;
173  HepLorentzRotation operator * (const HepRotation & r) const;
175  // Product of two Lorentz Rotations (this) * lt - matrix multiplication
176  // Notice that the product of two pure boosts in different directions
177  // is no longer a pure boost.
178 
179  inline HepBoostX inverse() const;
180  // Return the inverse.
181 
182  inline friend HepBoostX inverseOf ( const HepBoostX & b );
183  // global methods to invert.
184 
185  inline HepBoostX & invert();
186  // Inverts the Boost matrix.
187 
188  // ---------- I/O:
189 
190  std::ostream & print( std::ostream & os ) const;
191  // Output form is BOOSTX (beta=..., gamma=...);
192 
193  // ---------- Tolerance
194 
195  static inline double getTolerance();
196  static inline double setTolerance(double tol);
197 
198 protected:
199 
201  ( const HepLorentzVector & w ) const;
202  // Multiplication with a Lorentz Vector.
203 
206 
207  inline HepBoostX (double beta, double gamma);
208 
209  double beta_;
210  double gamma_;
211 
212 }; // HepBoostX
213 
214 inline
215 std::ostream & operator <<
216  ( std::ostream & os, const HepBoostX& b ) {return b.print(os);}
217 
218 } // namespace CLHEP
219 
220 #include "CLHEP/Vector/BoostX.icc"
221 
222 #ifdef ENABLE_BACKWARDS_COMPATIBILITY
223 // backwards compatibility will be enabled ONLY in CLHEP 1.9
224 using namespace CLHEP;
225 #endif
226 
227 #endif /* HEP_BOOSTX_H */
CLHEP::HepBoostX::operator<=
bool operator<=(const HepBoostX &b) const
CLHEP::HepBoostX::operator!=
bool operator!=(const HepBoostX &b) const
CLHEP::HepAxisAngle
Definition: Geometry/CLHEP/Vector/AxisAngle.h:37
CLHEP::HepBoostX::rep4x4
HepRep4x4 rep4x4() const
Definition: BoostX.cc:41
CLHEP::HepBoostX::howNear
double howNear(const HepBoostX &b) const
CLHEP::HepBoostX::col4
HepLorentzVector col4() const
CLHEP::HepBoostX::getDirection
Hep3Vector getDirection() const
CLHEP::HepBoostX::zz
double zz() const
HepBoost
namespace and inside the zmpv namespace it typedef s UnitVector to be HepUnit3Vector The conversion which provide those methods available for GETTING INFORMATION if an object might be either a Rotation or a since RI has methods a routine can be passed a RI &and take because anything you wish to ask about a LT you could equally well ask about a Rotation From one derives Rotation and its special cases RotationX etc We can t derive RotationX from from one derives HepLorentzRotation along with HepBoost
Definition: keyMergeIssues.doc:304
CLHEP::HepBoostX::operator>
bool operator>(const HepBoostX &b) const
CLHEP::HepBoostX::yy
double yy() const
CLHEP::HepBoostX::gamma_
double gamma_
Definition: Geometry/CLHEP/Vector/BoostX.h:210
CLHEP::HepBoostX::xt
double xt() const
b
@ b
Definition: testCategories.cc:125
CLHEP::HepBoostX::yz
double yz() const
CLHEP::HepBoostX::tt
double tt() const
CLHEP::HepBoostX::distance2
double distance2(const HepBoostX &b) const
CLHEP::HepBoostX::decompose
void decompose(HepRotation &rotation, HepBoost &boost) const
Definition: BoostX.cc:59
CLHEP::HepBoostX
Definition: Geometry/CLHEP/Vector/BoostX.h:42
CLHEP::HepBoostX::ty
double ty() const
CLHEP::HepBoostX::col3
HepLorentzVector col3() const
CLHEP::HepRep4x4Symmetric
Definition: Geometry/CLHEP/Vector/RotationInterfaces.h:370
CLHEP::Hep4RotationInterface::tolerance
static double tolerance
Definition: Geometry/CLHEP/Vector/RotationInterfaces.h:118
CLHEP::HepBoostX::beta_
double beta_
Definition: Geometry/CLHEP/Vector/BoostX.h:209
CLHEP::HepRotation
Definition: Geometry/CLHEP/Vector/Rotation.h:48
CLHEP::HepBoostX::row2
HepLorentzVector row2() const
CLHEP::HepBoostX::col1
HepLorentzVector col1() const
CLHEP::HepLorentzRotation
Definition: Geometry/CLHEP/Vector/LorentzRotation.h:54
CLHEP::HepBoostX::invert
HepBoostX & invert()
CLHEP::HepBoostX::col2
HepLorentzVector col2() const
CLHEP::HepBoostX::operator=
HepBoostX & operator=(const HepBoostX &m)
CLHEP::HepBoostX::yx
double yx() const
CLHEP::HepRep4x4
Definition: Geometry/CLHEP/Vector/RotationInterfaces.h:336
CLHEP::HepBoostX::inverseOf
friend HepBoostX inverseOf(const HepBoostX &b)
CLHEP::HepBoostX::row4
HepLorentzVector row4() const
CLHEP::HepBoostX::xx
double xx() const
CLHEP
Definition: ClhepVersion.h:13
CLHEP::HepBoost
Definition: Geometry/CLHEP/Vector/Boost.h:43
CLHEP::HepBoostX::boostVector
Hep3Vector boostVector() const
CLHEP::HepBoostX::inverse
HepBoostX inverse() const
CLHEP::HepBoostX::operator*
HepLorentzVector operator*(const HepLorentzVector &w) const
CLHEP::HepBoostX::isNear
bool isNear(const HepBoostX &b, double epsilon=Hep4RotationInterface::tolerance) const
CLHEP::HepBoostX::compare
int compare(const HepBoostX &b) const
CLHEP::HepBoostX::print
std::ostream & print(std::ostream &os) const
Definition: BoostX.cc:159
CLHEP::Hep3Vector
Definition: Geometry/CLHEP/Vector/ThreeVector.h:41
CLHEP::inverseOf
HepBoost inverseOf(const HepBoost &lt)
CLHEP::HepBoostX::operator<
bool operator<(const HepBoostX &b) const
CLHEP::HepBoostX::set
HepBoostX & set(double beta)
Definition: BoostX.cc:25
HepBoostX
namespace and inside the zmpv namespace it typedef s UnitVector to be HepUnit3Vector The conversion which provide those methods available for GETTING INFORMATION if an object might be either a Rotation or a since RI has methods a routine can be passed a RI &and take because anything you wish to ask about a LT you could equally well ask about a Rotation From one derives Rotation and its special cases RotationX etc We can t derive RotationX from from one derives HepLorentzRotation along with HepBoostX
Definition: keyMergeIssues.doc:304
CLHEP::HepBoostX::xy
double xy() const
CLHEP::HepBoostX::xz
double xz() const
CLHEP::HepBoostX::vectorMultiplication
HepLorentzVector vectorMultiplication(const HepLorentzVector &w) const
CLHEP::HepBoostX::norm2
double norm2() const
CLHEP::HepBoostX::zy
double zy() const
CLHEP::HepBoostX::rectify
void rectify()
Definition: BoostX.cc:124
CLHEP::HepBoostX::isIdentity
bool isIdentity() const
CLHEP::HepBoostX::operator>=
bool operator>=(const HepBoostX &b) const
CLHEP::HepBoostX::beta
double beta() const
CLHEP::HepBoostX::operator==
bool operator==(const HepBoostX &b) const
CLHEP::HepBoostX::tz
double tz() const
CLHEP::HepBoostX::matrixMultiplication
HepLorentzRotation matrixMultiplication(const HepRep4x4 &m) const
CLHEP::HepLorentzVector
Definition: Geometry/CLHEP/Vector/LorentzVector.h:72
CLHEP::HepBoostX::gamma
double gamma() const
CLHEP::HepBoostX::rep4x4Symmetric
HepRep4x4Symmetric rep4x4Symmetric() const
Definition: BoostX.cc:49
CLHEP::HepBoostX::row1
HepLorentzVector row1() const
CLHEP::HepBoostX::zx
double zx() const
CLHEP::HepBoostX::row3
HepLorentzVector row3() const
CLHEP::HepBoostX::operator()
HepLorentzVector operator()(const HepLorentzVector &w) const
CLHEP::HepBoostX::getTolerance
static double getTolerance()
CLHEP::HepBoostX::zt
double zt() const
CLHEP::HepBoostX::setTolerance
static double setTolerance(double tol)
CLHEP::HepBoostX::tx
double tx() const
CLHEP::HepBoostX::HepBoostX
HepBoostX()
CLHEP::HepBoostX::yt
double yt() const