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

Boost.h

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 //
00003 // This file is a part of the CLHEP - a Class Library for High Energy Physics.
00004 //
00005 // This is the definition of the HepBoost class for performing specialized
00006 // Lorentz transformations which are pure boosts on objects of the
00007 // HepLorentzVector class.
00008 //
00009 // HepBoost is a concrete implementation of Hep4RotationInterface.
00010 //
00011 // .SS See Also
00012 // RotationInterfaces.h
00013 // LorentzVector.h LorentzRotation.h 
00014 //  BoostX.h BoostY.h BoostZ.h 
00015 //
00016 // .SS Author
00017 // Mark Fischler
00018 
00019 #ifndef HEP_BOOST_H
00020 #define HEP_BOOST_H
00021 
00022 #ifdef GNUPRAGMA
00023 #pragma interface
00024 #endif
00025 
00026 #include "CLHEP/Vector/defs.h" 
00027 #include "CLHEP/Vector/RotationInterfaces.h"
00028 #include "CLHEP/Vector/BoostX.h"
00029 #include "CLHEP/Vector/BoostY.h"
00030 #include "CLHEP/Vector/BoostZ.h"
00031 #include "CLHEP/Vector/LorentzVector.h"
00032 
00033 namespace CLHEP {
00034 
00035 // Declarations of classes and global methods
00036 class HepBoost;
00037 inline HepBoost inverseOf ( const HepBoost & lt );
00038 
00043 class HepBoost {
00044 
00045 public:
00046 
00047   // ----------  Constructors and Assignment:
00048 
00049   inline HepBoost();
00050   // Default constructor. Gives a boost of 0.  
00051 
00052   inline HepBoost(const HepBoost & m);
00053   // Copy constructor.
00054 
00055   inline HepBoost & operator = (const HepBoost & m);
00056   // Assignment.
00057 
00058          HepBoost & set (double betaX, double betaY, double betaZ);
00059   inline HepBoost       (double betaX, double betaY, double betaZ);
00060   // Constructor from three components of beta vector
00061 
00062          HepBoost & set (const HepRep4x4Symmetric & m);
00063   inline HepBoost       (const HepRep4x4Symmetric & m);
00064   // Constructor from symmetric HepRep4x4
00065 
00066          HepBoost & set (Hep3Vector direction, double beta);
00067   inline HepBoost       (Hep3Vector direction, double beta);
00068   // Constructor from a three vector direction and the magnitude of beta
00069 
00070          HepBoost & set (const Hep3Vector & boost);
00071   inline HepBoost       (const Hep3Vector & boost);
00072   // Constructor from a 3-vector of less than unit length
00073 
00074   inline HepBoost & set (const HepBoostX & boost);
00075   inline HepBoost & set (const HepBoostY & boost);
00076   inline HepBoost & set (const HepBoostZ & boost);
00077   inline HepBoost       (const HepBoostX & boost);
00078   inline HepBoost       (const HepBoostY & boost);
00079   inline HepBoost       (const HepBoostZ & boost);
00080 
00081   // ----------  Accessors:
00082 
00083   inline double  beta()  const;
00084   inline double  gamma() const;
00085   inline Hep3Vector boostVector() const;
00086   inline Hep3Vector getDirection() const;
00087   inline Hep3Vector direction() const;
00088 
00089   inline double xx() const;
00090   inline double xy() const;
00091   inline double xz() const;
00092   inline double xt() const;
00093   inline double yx() const;
00094   inline double yy() const;
00095   inline double yz() const;
00096   inline double yt() const;
00097   inline double zx() const;
00098   inline double zy() const;
00099   inline double zz() const;
00100   inline double zt() const;
00101   inline double tx() const;
00102   inline double ty() const;
00103   inline double tz() const;
00104   inline double tt() const;
00105   // Elements of the matrix.
00106 
00107   inline HepLorentzVector col1() const;
00108   inline HepLorentzVector col2() const;
00109   inline HepLorentzVector col3() const;
00110   inline HepLorentzVector col4() const;
00111   // orthosymplectic column vectors
00112 
00113   inline HepLorentzVector row1() const;
00114   inline HepLorentzVector row2() const;
00115   inline HepLorentzVector row3() const;
00116   inline HepLorentzVector row4() const;
00117   // orthosymplectic row vectors
00118 
00119   inline HepRep4x4 rep4x4() const;
00120   //   4x4 representation.
00121 
00122   inline HepRep4x4Symmetric rep4x4Symmetric() const;
00123   //   Symmetric 4x4 representation.
00124 
00125   // ----------  Decomposition:
00126 
00127   void decompose (HepRotation  & rotation, HepBoost   & boost) const;
00128   void decompose (HepAxisAngle & rotation, Hep3Vector & boost) const;
00129   // Find R and B such that L = R*B -- trivial, since R is identity
00130 
00131   void decompose (HepBoost   & boost, HepRotation  & rotation) const;
00132   void decompose (Hep3Vector & boost, HepAxisAngle & rotation) const;
00133   // Find R and B such that L = B*R -- trivial, since R is identity
00134 
00135   // ----------  Comparisons:
00136 
00137   inline int compare( const HepBoost & b  ) const;
00138   // Dictionary-order comparison, in order tt,zt,zz,yt,yz,yy,xt,xz,xy,xx
00139   // Used in operator<, >, <=, >=
00140 
00141   inline bool operator == (const HepBoost & b) const;
00142   inline bool operator != (const HepBoost & b) const;
00143   inline bool operator <= (const HepBoost & b) const;
00144   inline bool operator >= (const HepBoost & b) const;
00145   inline bool operator <  (const HepBoost & b) const;
00146   inline bool operator >  (const HepBoost & b) const;
00147   // Comparisons.
00148 
00149   inline bool isIdentity() const;
00150   // Returns true if a null boost.
00151 
00152   inline  double distance2( const HepBoost  & b  ) const;
00153   inline  double distance2( const HepBoostX & bx ) const;
00154   inline  double distance2( const HepBoostY & by ) const;
00155   inline  double distance2( const HepBoostZ & bz ) const;
00156   // Defined as the distance2 between the vectors (gamma*betaVector)
00157 
00158   double distance2( const HepRotation & r  ) const;
00159   double distance2( const HepLorentzRotation & lt  ) const;
00160   // Distance between this and other sorts of transformations
00161 
00162   inline double howNear(   const HepBoost & b ) const;
00163   inline bool isNear(   const HepBoost & b,
00164              double epsilon=Hep4RotationInterface::tolerance) const;
00165 
00166   double howNear( const HepRotation & r  ) const;
00167   double howNear( const HepLorentzRotation & lt  ) const;
00168 
00169   bool isNear( const HepRotation & r, 
00170              double epsilon=Hep4RotationInterface::tolerance) const;
00171   bool isNear( const HepLorentzRotation & lt, 
00172              double epsilon=Hep4RotationInterface::tolerance) const;
00173 
00174   // ----------  Properties:
00175 
00176   double norm2() const;
00177   // (beta*gamma)^2
00178 
00179   void rectify();
00180   // set as an exact boost, based on the timelike part of the boost matrix.
00181 
00182   // ---------- Application:
00183 
00184   inline HepLorentzVector operator()( const HepLorentzVector & p ) const;
00185   // Transform a Lorentz Vector.             
00186 
00187   inline HepLorentzVector operator* ( const HepLorentzVector & p ) const;
00188   // Multiplication with a Lorentz Vector.
00189 
00190   // ---------- Operations in the group of 4-Rotations
00191 
00192   HepLorentzRotation operator * (const HepBoost & b) const;
00193   HepLorentzRotation operator * (const HepRotation & r) const;
00194   HepLorentzRotation operator * (const HepLorentzRotation & lt) const;
00195   // Product of two Lorentz Rotations (this) * lt - matrix multiplication  
00196   // Notice that the product of two pure boosts is no longer a pure boost
00197 
00198   inline HepBoost inverse() const;
00199   // Return the inverse.
00200 
00201   inline friend HepBoost inverseOf ( const HepBoost & lt );
00202   // global methods to invert.
00203 
00204   inline HepBoost & invert();
00205   // Inverts the Boost matrix.
00206 
00207   // ---------- I/O:
00208 
00209   std::ostream & print( std::ostream & os ) const;
00210   // Output form is (bx, by, bz) 
00211 
00212   // ---------- Tolerance              
00213 
00214   static inline double getTolerance();
00215   static inline double setTolerance(double tol);
00216 
00217 protected:
00218 
00219   inline HepLorentzVector vectorMultiplication 
00220                                         ( const HepLorentzVector & w ) const;
00221   // Multiplication with a Lorentz Vector.
00222 
00223   HepLorentzRotation matrixMultiplication (const HepRep4x4 & m) const;
00224   HepLorentzRotation matrixMultiplication (const HepRep4x4Symmetric & m) const;
00225 
00226   inline HepBoost
00227        (double xx, double xy, double xz, double xt,
00228                    double yy, double yz, double yt,
00229                               double zz, double zt,
00230                                          double tt);
00231   // Protected constructor.
00232   // DOES NOT CHECK FOR VALIDITY AS A LORENTZ BOOST.
00233 
00234   inline void setBoost(double bx, double by, double bz);
00235 
00236   HepRep4x4Symmetric rep_;
00237 
00238 };  // HepBoost
00239 
00240 inline   
00241 std::ostream & operator << 
00242         ( std::ostream & os, const HepBoost& b ) {return b.print(os);}
00243 
00244 }  // namespace CLHEP
00245 
00246 #include "CLHEP/Vector/Boost.icc"
00247 
00248 #ifdef ENABLE_BACKWARDS_COMPATIBILITY
00249 //  backwards compatibility will be enabled ONLY in CLHEP 1.9
00250 using namespace CLHEP;
00251 #endif
00252 
00253 #endif /* HEP_BOOST_H */

Generated on 15 Nov 2012 for CLHEP by  doxygen 1.4.7