Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:54:39

0001 // -*- C++ -*-
0002 //
0003 // This file is a part of the CLHEP - a Class Library for High Energy Physics.
0004 //
0005 // This is the definition of the HepBoostY class for performing specialized
0006 // Lorentz transformations which are pure boosts in the Y direction, on 
0007 // objects of the HepLorentzVector class.
0008 //
0009 // HepLorentzRotation is a concrete implementation of Hep4RotationInterface.
0010 //
0011 // .SS See Also
0012 // RotationInterfaces.h
0013 // LorentzVector.h LorentzRotation.h 
0014 // Boost.h 
0015 //
0016 // .SS Author
0017 // Mark Fischler
0018 
0019 #ifndef HEP_BOOSTY_H
0020 #define HEP_BOOSTY_H
0021 
0022 #include "CLHEP/Vector/defs.h" 
0023 #include "CLHEP/Vector/RotationInterfaces.h"
0024 #include "CLHEP/Vector/LorentzVector.h"
0025 
0026 namespace CLHEP  {
0027 
0028 // Declarations of classes and global methods
0029 class HepBoostY;               
0030 inline HepBoostY inverseOf ( const HepBoostY & b ); 
0031 class HepBoost;
0032 class HepRotation;
0033 
0034 /**
0035  * @author
0036  * @ingroup vector
0037  */
0038 class HepBoostY {
0039 
0040 public:
0041 
0042   // ----------  Constructors and Assignment:
0043 
0044   inline HepBoostY();
0045   // Default constructor. Gives a boost of 0.  
0046 
0047   inline HepBoostY(const HepBoostY & b);
0048   inline HepBoostY(HepBoostY && b) = default;
0049   // Copy and move constructors.
0050 
0051   inline HepBoostY & operator = (const HepBoostY & m);
0052   inline HepBoostY & operator = (HepBoostY && m) = default;
0053   // Copy and move assignment operators.
0054 
0055          HepBoostY & set (double beta);
0056   inline HepBoostY       (double beta);
0057   // Constructor from beta 
0058 
0059   // ----------  Accessors:
0060 
0061   inline double  beta()  const;
0062   inline double  gamma() const;
0063   inline Hep3Vector boostVector() const;
0064   inline Hep3Vector getDirection() const;
0065 
0066   inline double xx() const;
0067   inline double xy() const;
0068   inline double xz() const;
0069   inline double xt() const;
0070   inline double yx() const;
0071   inline double yy() const;
0072   inline double yz() const;
0073   inline double yt() const;
0074   inline double zx() const;
0075   inline double zy() const;
0076   inline double zz() const;
0077   inline double zt() const;
0078   inline double tx() const;
0079   inline double ty() const;
0080   inline double tz() const;
0081   inline double tt() const;
0082   // Elements of the matrix.
0083 
0084   inline HepLorentzVector col1() const;
0085   inline HepLorentzVector col2() const;
0086   inline HepLorentzVector col3() const;
0087   inline HepLorentzVector col4() const;
0088   // orthosymplectic column vectors
0089 
0090   inline HepLorentzVector row1() const;
0091   inline HepLorentzVector row2() const;
0092   inline HepLorentzVector row3() const;
0093   inline HepLorentzVector row4() const;
0094   // orthosymplectic row vectors
0095 
0096   HepRep4x4 rep4x4() const;
0097   //   4x4 representation:
0098 
0099   HepRep4x4Symmetric rep4x4Symmetric() const;
0100   //   Symmetric 4x4 representation.
0101 
0102 
0103   // ----------  Decomposition:
0104 
0105   void decompose (HepRotation  & rotation, HepBoost   & boost) const;
0106   void decompose (HepAxisAngle & rotation, Hep3Vector & boost) const;
0107   // Find R and B such that L = R*B -- trivial, since R is identity
0108 
0109   void decompose (HepBoost  & boost, HepRotation   & rotation) const;
0110   void decompose (Hep3Vector & boost, HepAxisAngle & rotation) const;
0111   // Find R and B such that L = B*R -- trivial, since R is identity
0112 
0113   // ----------  Comparisons:
0114 
0115   inline int compare( const HepBoostY & b  ) const;
0116   // Dictionary-order comparison, in order of beta. 
0117   // Used in operator<, >, <=, >=
0118 
0119   inline bool operator == (const HepBoostY & b) const;
0120   inline bool operator != (const HepBoostY & b) const;
0121   inline bool operator <= (const HepBoostY & b) const;
0122   inline bool operator >= (const HepBoostY & b) const;
0123   inline bool operator <  (const HepBoostY & b) const;
0124   inline bool operator >  (const HepBoostY & b) const;
0125   // Comparisons.
0126 
0127   inline bool isIdentity() const;
0128   // Returns true if a null boost.
0129 
0130   inline  double distance2( const HepBoostY & b ) const;
0131       double distance2( const HepBoost & b ) const;
0132   // Defined as the distance2 between the vectors (gamma*betaVector)
0133 
0134   double distance2( const HepRotation & r  ) const;
0135   double distance2( const HepLorentzRotation & lt  ) const;
0136   // Decompose lt = B*R; add norm2 to distance2 to between boosts.
0137 
0138   inline double howNear(   const HepBoostY & b ) const;
0139   inline double howNear(   const HepBoost  & b ) const;
0140   inline double howNear(   const HepRotation & r ) const;
0141   inline double howNear(   const HepLorentzRotation & lt ) const;
0142 
0143   inline bool isNear(   const HepBoostY & b,
0144              double epsilon=Hep4RotationInterface::tolerance) const;
0145   inline bool isNear(   const HepBoost & b,
0146              double epsilon=Hep4RotationInterface::tolerance) const;
0147   bool isNear(   const HepRotation & r,
0148              double epsilon=Hep4RotationInterface::tolerance) const;
0149   bool isNear(   const HepLorentzRotation & lt,
0150              double epsilon=Hep4RotationInterface::tolerance) const;
0151 
0152   // ----------  Properties:
0153 
0154   inline double norm2() const;
0155   // distance2 (IDENTITY), which is beta^2 * gamma^2
0156 
0157   void rectify();
0158   // sets according to the stored beta
0159 
0160   // ---------- Application:
0161 
0162   inline HepLorentzVector operator()( const HepLorentzVector & w ) const;
0163   // Transform a Lorentz Vector.             
0164 
0165   inline HepLorentzVector operator* ( const HepLorentzVector & w ) const;
0166   // Multiplication with a Lorentz Vector.
0167 
0168   // ---------- Operations in the group of 4-Rotations
0169 
0170   HepBoostY   operator * (const HepBoostY & b) const;
0171   HepLorentzRotation operator * (const HepBoost & b) const;
0172   HepLorentzRotation operator * (const HepRotation & r) const;
0173   HepLorentzRotation operator * (const HepLorentzRotation & lt) const;
0174   // Product of two Lorentz Rotations (this) * lt - matrix multiplication
0175   // Notice that the product of two pure boosts in different directions
0176   // is no longer a pure boost.
0177 
0178   inline HepBoostY inverse() const;
0179   // Return the inverse.
0180 
0181   inline friend HepBoostY inverseOf ( const HepBoostY & b );
0182   // global methods to invert.
0183 
0184   inline HepBoostY & invert();
0185   // Inverts the Boost matrix.
0186 
0187   // ---------- I/O:
0188 
0189   std::ostream & print( std::ostream & os ) const;
0190   // Output form is BOOSTY (beta=..., gamma=...);  
0191 
0192   // ---------- Tolerance
0193 
0194   static inline double getTolerance();
0195   static inline double setTolerance(double tol);
0196 
0197 protected:
0198 
0199   inline HepLorentzVector vectorMultiplication
0200                                         ( const HepLorentzVector & w ) const;
0201   // Multiplication with a Lorentz Vector.
0202 
0203   HepLorentzRotation matrixMultiplication (const HepRep4x4 & m) const;
0204   HepLorentzRotation matrixMultiplication (const HepRep4x4Symmetric & m) const;
0205                    
0206   inline HepBoostY (double beta, double gamma);
0207 
0208   double  beta_;
0209   double  gamma_;
0210 
0211 };  // HepBoostY
0212 
0213 inline   
0214 std::ostream & operator << 
0215     ( std::ostream & os, const HepBoostY& b ) {return b.print(os);}
0216 
0217 }  // namespace CLHEP
0218 
0219 #include "CLHEP/Vector/BoostY.icc"
0220 
0221 #ifdef ENABLE_BACKWARDS_COMPATIBILITY
0222 //  backwards compatibility will be enabled ONLY in CLHEP 1.9
0223 using namespace CLHEP;
0224 #endif
0225 
0226 #endif /* HEP_BOOSTY_H */