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

RandomObjects/CLHEP/Vector/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 
26 #include "CLHEP/Vector/defs.h"
27 #include "CLHEP/Vector/RotationInterfaces.h"
28 #include "CLHEP/Vector/BoostX.h"
29 #include "CLHEP/Vector/BoostY.h"
30 #include "CLHEP/Vector/BoostZ.h"
31 #include "CLHEP/Vector/LorentzVector.h"
32 
33 namespace CLHEP {
34 
35 // Declarations of classes and global methods
36 class HepBoost;
37 inline HepBoost inverseOf ( const HepBoost & lt );
38 
43 class HepBoost {
44 
45 public:
46 
47  // ---------- Constructors and Assignment:
48 
49  inline HepBoost();
50  // Default constructor. Gives a boost of 0.
51 
52  inline HepBoost(const HepBoost & m);
53  // Copy constructor.
54 
55  inline HepBoost & operator = (const HepBoost & m);
56  // Assignment.
57 
58  HepBoost & set (double betaX, double betaY, double betaZ);
59  inline HepBoost (double betaX, double betaY, double betaZ);
60  // Constructor from three components of beta vector
61 
62  HepBoost & set (const HepRep4x4Symmetric & m);
63  inline HepBoost (const HepRep4x4Symmetric & m);
64  // Constructor from symmetric HepRep4x4
65 
66  HepBoost & set (Hep3Vector direction, double beta);
67  inline HepBoost (Hep3Vector direction, double beta);
68  // Constructor from a three vector direction and the magnitude of beta
69 
70  HepBoost & set (const Hep3Vector & boost);
71  inline HepBoost (const Hep3Vector & boost);
72  // Constructor from a 3-vector of less than unit length
73 
74  inline HepBoost & set (const HepBoostX & boost);
75  inline HepBoost & set (const HepBoostY & boost);
76  inline HepBoost & set (const HepBoostZ & boost);
77  inline HepBoost (const HepBoostX & boost);
78  inline HepBoost (const HepBoostY & boost);
79  inline HepBoost (const HepBoostZ & boost);
80 
81  // ---------- Accessors:
82 
83  inline double beta() const;
84  inline double gamma() const;
85  inline Hep3Vector boostVector() const;
86  inline Hep3Vector getDirection() const;
87  inline Hep3Vector direction() const;
88 
89  inline double xx() const;
90  inline double xy() const;
91  inline double xz() const;
92  inline double xt() const;
93  inline double yx() const;
94  inline double yy() const;
95  inline double yz() const;
96  inline double yt() const;
97  inline double zx() const;
98  inline double zy() const;
99  inline double zz() const;
100  inline double zt() const;
101  inline double tx() const;
102  inline double ty() const;
103  inline double tz() const;
104  inline double tt() const;
105  // Elements of the matrix.
106 
107  inline HepLorentzVector col1() const;
108  inline HepLorentzVector col2() const;
109  inline HepLorentzVector col3() const;
110  inline HepLorentzVector col4() const;
111  // orthosymplectic column vectors
112 
113  inline HepLorentzVector row1() const;
114  inline HepLorentzVector row2() const;
115  inline HepLorentzVector row3() const;
116  inline HepLorentzVector row4() const;
117  // orthosymplectic row vectors
118 
119  inline HepRep4x4 rep4x4() const;
120  // 4x4 representation.
121 
122  inline HepRep4x4Symmetric rep4x4Symmetric() const;
123  // Symmetric 4x4 representation.
124 
125  // ---------- Decomposition:
126 
127  void decompose (HepRotation & rotation, HepBoost & boost) const;
128  void decompose (HepAxisAngle & rotation, Hep3Vector & boost) const;
129  // Find R and B such that L = R*B -- trivial, since R is identity
130 
131  void decompose (HepBoost & boost, HepRotation & rotation) const;
132  void decompose (Hep3Vector & boost, HepAxisAngle & rotation) const;
133  // Find R and B such that L = B*R -- trivial, since R is identity
134 
135  // ---------- Comparisons:
136 
137  inline int compare( const HepBoost & b ) const;
138  // Dictionary-order comparison, in order tt,zt,zz,yt,yz,yy,xt,xz,xy,xx
139  // Used in operator<, >, <=, >=
140 
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  inline bool operator > (const HepBoost & b) const;
147  // Comparisons.
148 
149  inline bool isIdentity() const;
150  // Returns true if a null boost.
151 
152  inline double distance2( const HepBoost & b ) const;
153  inline double distance2( const HepBoostX & bx ) const;
154  inline double distance2( const HepBoostY & by ) const;
155  inline double distance2( const HepBoostZ & bz ) const;
156  // Defined as the distance2 between the vectors (gamma*betaVector)
157 
158  double distance2( const HepRotation & r ) const;
159  double distance2( const HepLorentzRotation & lt ) const;
160  // Distance between this and other sorts of transformations
161 
162  inline double howNear( const HepBoost & b ) const;
163  inline bool isNear( const HepBoost & b,
164  double epsilon=Hep4RotationInterface::tolerance) const;
165 
166  double howNear( const HepRotation & r ) const;
167  double howNear( const HepLorentzRotation & lt ) const;
168 
169  bool isNear( const HepRotation & r,
170  double epsilon=Hep4RotationInterface::tolerance) const;
171  bool isNear( const HepLorentzRotation & lt,
172  double epsilon=Hep4RotationInterface::tolerance) const;
173 
174  // ---------- Properties:
175 
176  double norm2() const;
177  // (beta*gamma)^2
178 
179  void rectify();
180  // set as an exact boost, based on the timelike part of the boost matrix.
181 
182  // ---------- Application:
183 
184  inline HepLorentzVector operator()( const HepLorentzVector & p ) const;
185  // Transform a Lorentz Vector.
186 
187  inline HepLorentzVector operator* ( const HepLorentzVector & p ) const;
188  // Multiplication with a Lorentz Vector.
189 
190  // ---------- Operations in the group of 4-Rotations
191 
192  HepLorentzRotation operator * (const HepBoost & b) const;
193  HepLorentzRotation operator * (const HepRotation & r) const;
194  HepLorentzRotation operator * (const HepLorentzRotation & lt) const;
195  // Product of two Lorentz Rotations (this) * lt - matrix multiplication
196  // Notice that the product of two pure boosts is no longer a pure boost
197 
198  inline HepBoost inverse() const;
199  // Return the inverse.
200 
201  inline friend HepBoost inverseOf ( const HepBoost & lt );
202  // global methods to invert.
203 
204  inline HepBoost & invert();
205  // Inverts the Boost matrix.
206 
207  // ---------- I/O:
208 
209  std::ostream & print( std::ostream & os ) const;
210  // Output form is (bx, by, bz)
211 
212  // ---------- Tolerance
213 
214  static inline double getTolerance();
215  static inline double setTolerance(double tol);
216 
217 protected:
218 
219  inline HepLorentzVector vectorMultiplication
220  ( const HepLorentzVector & w ) const;
221  // Multiplication with a Lorentz Vector.
222 
223  HepLorentzRotation matrixMultiplication (const HepRep4x4 & m) const;
224  HepLorentzRotation matrixMultiplication (const HepRep4x4Symmetric & m) const;
225 
226  inline HepBoost
227  (double xx, double xy, double xz, double xt,
228  double yy, double yz, double yt,
229  double zz, double zt,
230  double tt);
231  // Protected constructor.
232  // DOES NOT CHECK FOR VALIDITY AS A LORENTZ BOOST.
233 
234  inline void setBoost(double bx, double by, double bz);
235 
236  HepRep4x4Symmetric rep_;
237 
238 }; // HepBoost
239 
240 inline
241 std::ostream & operator <<
242  ( std::ostream & os, const HepBoost& b ) {return b.print(os);}
243 
244 } // namespace CLHEP
245 
246 #include "CLHEP/Vector/Boost.icc"
247 
248 #ifdef ENABLE_BACKWARDS_COMPATIBILITY
249 // backwards compatibility will be enabled ONLY in CLHEP 1.9
250 using namespace CLHEP;
251 #endif
252 
253 #endif /* HEP_BOOST_H */
CLHEP::HepBoost::operator>=
bool operator>=(const HepBoost &b) const
CLHEP::HepBoost::col3
HepLorentzVector col3() const
CLHEP::HepBoost::operator!=
bool operator!=(const HepBoost &b) const
CLHEP::HepBoost::col2
HepLorentzVector col2() const
CLHEP::HepBoost::zt
double zt() const
CLHEP::HepBoost::HepBoost
HepBoost()
CLHEP::HepBoost::ty
double ty() 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
b
@ b
Definition: testCategories.cc:125
CLHEP::HepBoost::setTolerance
static double setTolerance(double tol)
CLHEP::HepBoost::set
HepBoost & set(double betaX, double betaY, double betaZ)
Definition: Boost.cc:23
CLHEP::HepBoost::decompose
void decompose(HepRotation &rotation, HepBoost &boost) const
Definition: Boost.cc:71
CLHEP::HepBoost::vectorMultiplication
HepLorentzVector vectorMultiplication(const HepLorentzVector &w) const
CLHEP::HepBoost::row1
HepLorentzVector row1() const
CLHEP::HepBoost::distance2
double distance2(const HepBoost &b) const
CLHEP::HepBoost::tx
double tx() const
CLHEP::Hep4RotationInterface::tolerance
static double tolerance
Definition: Geometry/CLHEP/Vector/RotationInterfaces.h:118
CLHEP::HepBoost::zy
double zy() const
CLHEP::HepBoost::col1
HepLorentzVector col1() const
CLHEP::HepBoost::inverseOf
friend HepBoost inverseOf(const HepBoost &lt)
CLHEP::HepBoost::row4
HepLorentzVector row4() const
CLHEP::HepBoost::operator<=
bool operator<=(const HepBoost &b) const
CLHEP::HepBoost::operator*
HepLorentzVector operator*(const HepLorentzVector &p) const
CLHEP::HepBoost::rep4x4Symmetric
HepRep4x4Symmetric rep4x4Symmetric() const
CLHEP::HepBoost::operator==
bool operator==(const HepBoost &b) const
CLHEP::HepBoost::xy
double xy() const
CLHEP::HepBoost::xt
double xt() const
CLHEP::HepBoost::getDirection
Hep3Vector getDirection() const
CLHEP::HepBoost::operator<
bool operator<(const HepBoost &b) const
CLHEP
Definition: ClhepVersion.h:13
CLHEP::HepBoost::rep_
HepRep4x4Symmetric rep_
Definition: Geometry/CLHEP/Vector/Boost.h:236
CLHEP::HepBoost::compare
int compare(const HepBoost &b) const
CLHEP::HepBoost::invert
HepBoost & invert()
CLHEP::HepBoost::yz
double yz() const
CLHEP::HepBoost::norm2
double norm2() const
Definition: Boost.cc:140
CLHEP::HepBoost::zx
double zx() const
CLHEP::HepBoost::inverse
HepBoost inverse() const
CLHEP::HepBoost::tz
double tz() const
Hep3Vector
Issues Concerning the PhysicsVectors CLHEP Vector Merge The merge of ZOOM PhysicsVdectors and the CLHEP Vector package is completed The purpose of this document is to list the major issues that affected the merge of these and where relevant describe the resolutions More detailed documents describe more minor issues General Approach As agreed at the June CLHEP the approach is to combine the features of each ZOOM class with the corresponding CLHEP class expanding the interface to create a single lingua franca of what a Hep3Vector(for example) means. We are not forming SpaceVector as an class derived from Hep3Vector and enhancing it in that way. Another rule imposed by the agreement is to avoid using the Exceptions package(even though that will later go into CLHEP for other uses). A desirable goal is to avoid cluttering the interface and enlarging the code linked in when ordinary CLHEP Vector functionallity is used. To this end
CLHEP::HepBoost::yt
double yt() const
CLHEP::HepBoost::row2
HepLorentzVector row2() const
CLHEP::inverseOf
HepBoost inverseOf(const HepBoost &lt)
CLHEP::HepBoost::rectify
void rectify()
Definition: Boost.cc:147
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::HepBoost::yy
double yy() const
CLHEP::HepBoost::print
std::ostream & print(std::ostream &os) const
Definition: Boost.cc:249
CLHEP::HepBoost::isIdentity
bool isIdentity() const
CLHEP::HepBoost::operator=
HepBoost & operator=(const HepBoost &m)
CLHEP::HepBoost::operator>
bool operator>(const HepBoost &b) const
CLHEP::HepBoost::rep4x4
HepRep4x4 rep4x4() const
CLHEP::HepBoost::col4
HepLorentzVector col4() const
CLHEP::HepBoost::setBoost
void setBoost(double bx, double by, double bz)
CLHEP::HepBoost::tt
double tt() const
CLHEP::HepBoost::gamma
double gamma() const
CLHEP::HepBoost::getTolerance
static double getTolerance()
CLHEP::HepBoost::matrixMultiplication
HepLorentzRotation matrixMultiplication(const HepRep4x4 &m) const
Definition: Boost.cc:183
CLHEP::HepBoost::operator()
HepLorentzVector operator()(const HepLorentzVector &p) const
CLHEP::HepBoost::howNear
double howNear(const HepBoost &b) const
CLHEP::HepBoost::zz
double zz() const
CLHEP::HepBoost::boostVector
Hep3Vector boostVector() const
CLHEP::HepBoost::yx
double yx() const
CLHEP::HepBoost::xz
double xz() const
CLHEP::HepBoost::row3
HepLorentzVector row3() const
CLHEP::HepBoost::xx
double xx() const
CLHEP::HepBoost::beta
double beta() const
CLHEP::HepBoost::isNear
bool isNear(const HepBoost &b, double epsilon=Hep4RotationInterface::tolerance) const
CLHEP::HepBoost::direction
Hep3Vector direction() const