CLHEP 2.0.4.7 Reference Documentation
   
CLHEP Home Page     CLHEP Documentation     CLHEP Bug Reports

BoostZ.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 HepBoostZ class for performing specialized
00006 // Lorentz transformations which are pure boosts in the Z direction, on 
00007 // objects of the HepLorentzVector class.
00008 //
00009 // HepLorentzRotation is a concrete implementation of Hep4RotationInterface.
00010 //
00011 // .SS See Also
00012 // RotationInterfaces.h
00013 // LorentzVector.h LorentzRotation.h 
00014 // Boost.h 
00015 //
00016 // .SS Author
00017 // Mark Fischler
00018 
00019 #ifndef HEP_BOOSTZ_H
00020 #define HEP_BOOSTZ_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/LorentzVector.h"
00029 
00030 namespace CLHEP  {
00031 
00032 // Declarations of classes and global methods
00033 class HepBoostZ;               
00034 inline HepBoostZ inverseOf ( const HepBoostZ & b ); 
00035 class HepBoost;
00036 class HepRotation;
00037 
00042 class HepBoostZ {
00043 
00044 public:
00045 
00046   // ----------  Constructors and Assignment:
00047 
00048   inline HepBoostZ();
00049   // Default constructor. Gives a boost of 0.  
00050 
00051   inline HepBoostZ(const HepBoostZ & b);
00052   // Copy constructor.
00053 
00054   inline HepBoostZ & operator = (const HepBoostZ & m);
00055   // Assignment.
00056 
00057          HepBoostZ & set (double beta);
00058   inline HepBoostZ       (double beta);
00059   // Constructor from beta 
00060 
00061   // ----------  Accessors:
00062 
00063   inline double  beta()  const;
00064   inline double  gamma() const;
00065   inline Hep3Vector boostVector() const;
00066   inline Hep3Vector getDirection() const;
00067 
00068   inline double xx() const;
00069   inline double xy() const;
00070   inline double xz() const;
00071   inline double xt() const;
00072   inline double yx() const;
00073   inline double yy() const;
00074   inline double yz() const;
00075   inline double yt() const;
00076   inline double zx() const;
00077   inline double zy() const;
00078   inline double zz() const;
00079   inline double zt() const;
00080   inline double tx() const;
00081   inline double ty() const;
00082   inline double tz() const;
00083   inline double tt() const;
00084   // Elements of the matrix.
00085 
00086   inline HepLorentzVector col1() const;
00087   inline HepLorentzVector col2() const;
00088   inline HepLorentzVector col3() const;
00089   inline HepLorentzVector col4() const;
00090   // orthosymplectic column vectors
00091 
00092   inline HepLorentzVector row1() const;
00093   inline HepLorentzVector row2() const;
00094   inline HepLorentzVector row3() const;
00095   inline HepLorentzVector row4() const;
00096   // orthosymplectic row vectors
00097 
00098   HepRep4x4 rep4x4() const;
00099   //   4x4 representation:
00100 
00101   HepRep4x4Symmetric rep4x4Symmetric() const;
00102   //   Symmetric 4x4 representation.
00103 
00104   // ----------  Decomposition:
00105 
00106   void decompose (HepRotation  & rotation, HepBoost   & boost) const;
00107   void decompose (HepAxisAngle & rotation, Hep3Vector & boost) const;
00108   // Find R and B such that L = R*B -- trivial, since R is identity
00109 
00110   void decompose (HepBoost   & boost, HepRotation  & rotation) const;
00111   void decompose (Hep3Vector & boost, HepAxisAngle & rotation) const;
00112   // Find R and B such that L = B*R -- trivial, since R is identity
00113 
00114   // ----------  Comparisons:
00115 
00116   inline int compare( const HepBoostZ & b  ) const;
00117   // Dictionary-order comparison, in order of beta. 
00118   // Used in operator<, >, <=, >=
00119 
00120   inline bool operator == (const HepBoostZ & b) const;
00121   inline bool operator != (const HepBoostZ & b) const;
00122   inline bool operator <= (const HepBoostZ & b) const;
00123   inline bool operator >= (const HepBoostZ & b) const;
00124   inline bool operator <  (const HepBoostZ & b) const;
00125   inline bool operator >  (const HepBoostZ & b) const;
00126   // Comparisons.
00127 
00128   inline bool isIdentity() const;
00129   // Returns true if a null boost.
00130 
00131   inline  double distance2( const HepBoostZ & b ) const;
00132           double distance2( const HepBoost & b ) const;
00133   // Defined as the distance2 between the vectors (gamma*betaVector)
00134 
00135   double distance2( const HepRotation & r  ) const;
00136   double distance2( const HepLorentzRotation & lt  ) const;
00137   // Decompose lt = B*R; add norm2 to distance2 to between boosts.
00138 
00139   inline double howNear(   const HepBoostZ & b ) const;
00140   inline double howNear(   const HepBoost  & b ) const;
00141   inline double howNear(   const HepRotation & r ) const;
00142   inline double howNear(   const HepLorentzRotation & lt ) const;
00143 
00144   inline bool isNear(   const HepBoostZ & b,
00145              double epsilon=Hep4RotationInterface::tolerance) const;
00146   inline bool isNear(   const HepBoost & b,
00147              double epsilon=Hep4RotationInterface::tolerance) const;
00148   bool isNear(   const HepRotation & r,
00149              double epsilon=Hep4RotationInterface::tolerance) const;
00150   bool isNear(   const HepLorentzRotation & lt,
00151              double epsilon=Hep4RotationInterface::tolerance) const;
00152 
00153   // ----------  Properties:
00154 
00155   inline double norm2() const;
00156   // distance2 (IDENTITY), which is beta^2 * gamma^2
00157 
00158   void rectify();
00159   // sets according to the stored beta
00160 
00161   // ---------- Application:
00162 
00163   inline HepLorentzVector operator()( const HepLorentzVector & w ) const;
00164   // Transform a Lorentz Vector.             
00165 
00166   inline HepLorentzVector operator* ( const HepLorentzVector & w ) const;
00167   // Multiplication with a Lorentz Vector.
00168 
00169   // ---------- Operations in the group of 4-Rotations
00170 
00171   HepBoostZ   operator * (const HepBoostZ & b) const;
00172   HepLorentzRotation operator * (const HepBoost & b) const;
00173   HepLorentzRotation operator * (const HepRotation & r) const;
00174   HepLorentzRotation operator * (const HepLorentzRotation & lt) const;
00175   // Product of two Lorentz Rotations (this) * lt - matrix multiplication
00176   // Notice that the product of two pure boosts in different directions
00177   // is no longer a pure boost.
00178 
00179   inline HepBoostZ inverse() const;
00180   // Return the inverse.
00181 
00182   inline friend HepBoostZ inverseOf ( const HepBoostZ & b );
00183   // global methods to invert.
00184 
00185   inline HepBoostZ & invert();
00186   // Inverts the Boost matrix.
00187 
00188   // ---------- I/O:
00189 
00190   std::ostream & print( std::ostream & os ) const;
00191   // Output form is BOOSTZ (beta=..., gamma=...);  
00192 
00193   // ---------- Tolerance
00194 
00195   static inline double getTolerance();
00196   static inline double setTolerance(double tol);
00197 
00198 protected:
00199 
00200   inline HepLorentzVector vectorMultiplication
00201                                         ( const HepLorentzVector & w ) const;
00202   // Multiplication with a Lorentz Vector.
00203 
00204   HepLorentzRotation matrixMultiplication (const HepRep4x4 & m) const;
00205   HepLorentzRotation matrixMultiplication (const HepRep4x4Symmetric & m) const;
00206                    
00207   inline HepBoostZ (double beta, double gamma);
00208 
00209   double  beta_;
00210   double  gamma_;
00211 
00212 };  // HepBoostZ
00213 
00214 inline   
00215 std::ostream & operator << 
00216         ( std::ostream & os, const HepBoostZ& b ) {return b.print(os);}
00217 
00218 }  // namespace CLHEP
00219 
00220 #include "CLHEP/Vector/BoostZ.icc"
00221 
00222 #ifdef ENABLE_BACKWARDS_COMPATIBILITY
00223 //  backwards compatibility will be enabled ONLY in CLHEP 1.9
00224 using namespace CLHEP;
00225 #endif
00226 
00227 #endif /* HEP_BOOSTZ_H */

Generated on Thu Jul 1 22:02:30 2010 for CLHEP by  doxygen 1.4.7