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.5 ] [ 10.5.p1 ] [ 10.6 ] [ 10.6.p1 ] [ 10.6.p2 ] [ 10.6.p3 ] [ 10.7 ] [ 10.7.p1 ] [ 10.7.p2 ] [ 10.7.p3 ] [ 10.7.p4 ] [ 11.0 ] [ 11.0.p1 ] [ 11.0.p2 ] [ 11.0.p3, ] [ 11.0.p4 ] [ 11.1 ] [ 11.1.1 ] [ 11.1.2 ] [ 11.1.3 ] [ 11.2 ] [ 11.2.1 ] [ 11.2.2 ] [ 11.3.0 ]

  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 HepBoostY class for performing specialized
  6 // Lorentz transformations which are pure boosts in the Y 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_BOOSTY_H
 20 #define HEP_BOOSTY_H
 21 
 22 #include "CLHEP/Vector/RotationInterfaces.h"
 23 #include "CLHEP/Vector/LorentzVector.h"
 24 
 25 namespace CLHEP  {
 26 
 27 // Declarations of classes and global methods
 28 class HepBoostY;               
 29 inline HepBoostY inverseOf ( const HepBoostY & b ); 
 30 class HepBoost;
 31 class HepRotation;
 32 
 33 /**
 34  * @author
 35  * @ingroup vector
 36  */
 37 class HepBoostY {
 38 
 39 public:
 40 
 41   // ----------  Constructors and Assignment:
 42 
 43   inline HepBoostY();
 44   // Default constructor. Gives a boost of 0.  
 45 
 46   inline HepBoostY(const HepBoostY & b);
 47   inline HepBoostY(HepBoostY && b) = default;
 48   // Copy and move constructors.
 49 
 50   inline HepBoostY & operator = (const HepBoostY & m);
 51   inline HepBoostY & operator = (HepBoostY && m) = default;
 52   // Copy and move assignment operators.
 53 
 54          HepBoostY & set (double beta);
 55   inline HepBoostY       (double beta);
 56   // Constructor from beta 
 57 
 58   // ----------  Accessors:
 59 
 60   inline double  beta()  const;
 61   inline double  gamma() const;
 62   inline Hep3Vector boostVector() const;
 63   inline Hep3Vector getDirection() const;
 64 
 65   inline double xx() const;
 66   inline double xy() const;
 67   inline double xz() const;
 68   inline double xt() const;
 69   inline double yx() const;
 70   inline double yy() const;
 71   inline double yz() const;
 72   inline double yt() const;
 73   inline double zx() const;
 74   inline double zy() const;
 75   inline double zz() const;
 76   inline double zt() const;
 77   inline double tx() const;
 78   inline double ty() const;
 79   inline double tz() const;
 80   inline double tt() const;
 81   // Elements of the matrix.
 82 
 83   inline HepLorentzVector col1() const;
 84   inline HepLorentzVector col2() const;
 85   inline HepLorentzVector col3() const;
 86   inline HepLorentzVector col4() const;
 87   // orthosymplectic column vectors
 88 
 89   inline HepLorentzVector row1() const;
 90   inline HepLorentzVector row2() const;
 91   inline HepLorentzVector row3() const;
 92   inline HepLorentzVector row4() const;
 93   // orthosymplectic row vectors
 94 
 95   HepRep4x4 rep4x4() const;
 96   //   4x4 representation:
 97 
 98   HepRep4x4Symmetric rep4x4Symmetric() const;
 99   //   Symmetric 4x4 representation.
100 
101 
102   // ----------  Decomposition:
103 
104   void decompose (HepRotation  & rotation, HepBoost   & boost) const;
105   void decompose (HepAxisAngle & rotation, Hep3Vector & boost) const;
106   // Find R and B such that L = R*B -- trivial, since R is identity
107 
108   void decompose (HepBoost  & boost, HepRotation   & rotation) const;
109   void decompose (Hep3Vector & boost, HepAxisAngle & rotation) const;
110   // Find R and B such that L = B*R -- trivial, since R is identity
111 
112   // ----------  Comparisons:
113 
114   inline int compare( const HepBoostY & b  ) const;
115   // Dictionary-order comparison, in order of beta. 
116   // Used in operator<, >, <=, >=
117 
118   inline bool operator == (const HepBoostY & b) const;
119   inline bool operator != (const HepBoostY & b) const;
120   inline bool operator <= (const HepBoostY & b) const;
121   inline bool operator >= (const HepBoostY & b) const;
122   inline bool operator <  (const HepBoostY & b) const;
123   inline bool operator >  (const HepBoostY & b) const;
124   // Comparisons.
125 
126   inline bool isIdentity() const;
127   // Returns true if a null boost.
128 
129   inline  double distance2( const HepBoostY & b ) const;
130       double distance2( const HepBoost & b ) const;
131   // Defined as the distance2 between the vectors (gamma*betaVector)
132 
133   double distance2( const HepRotation & r  ) const;
134   double distance2( const HepLorentzRotation & lt  ) const;
135   // Decompose lt = B*R; add norm2 to distance2 to between boosts.
136 
137   inline double howNear(   const HepBoostY & b ) const;
138   inline double howNear(   const HepBoost  & b ) const;
139   inline double howNear(   const HepRotation & r ) const;
140   inline double howNear(   const HepLorentzRotation & lt ) const;
141 
142   inline bool isNear(   const HepBoostY & b,
143              double epsilon=Hep4RotationInterface::tolerance) const;
144   inline bool isNear(   const HepBoost & b,
145              double epsilon=Hep4RotationInterface::tolerance) const;
146   bool isNear(   const HepRotation & r,
147              double epsilon=Hep4RotationInterface::tolerance) const;
148   bool isNear(   const HepLorentzRotation & lt,
149              double epsilon=Hep4RotationInterface::tolerance) const;
150 
151   // ----------  Properties:
152 
153   inline double norm2() const;
154   // distance2 (IDENTITY), which is beta^2 * gamma^2
155 
156   void rectify();
157   // sets according to the stored beta
158 
159   // ---------- Application:
160 
161   inline HepLorentzVector operator()( const HepLorentzVector & w ) const;
162   // Transform a Lorentz Vector.             
163 
164   inline HepLorentzVector operator* ( const HepLorentzVector & w ) const;
165   // Multiplication with a Lorentz Vector.
166 
167   // ---------- Operations in the group of 4-Rotations
168 
169   HepBoostY   operator * (const HepBoostY & b) const;
170   HepLorentzRotation operator * (const HepBoost & b) const;
171   HepLorentzRotation operator * (const HepRotation & r) const;
172   HepLorentzRotation operator * (const HepLorentzRotation & lt) const;
173   // Product of two Lorentz Rotations (this) * lt - matrix multiplication
174   // Notice that the product of two pure boosts in different directions
175   // is no longer a pure boost.
176 
177   inline HepBoostY inverse() const;
178   // Return the inverse.
179 
180   inline friend HepBoostY inverseOf ( const HepBoostY & b );
181   // global methods to invert.
182 
183   inline HepBoostY & invert();
184   // Inverts the Boost matrix.
185 
186   // ---------- I/O:
187 
188   std::ostream & print( std::ostream & os ) const;
189   // Output form is BOOSTY (beta=..., gamma=...);  
190 
191   // ---------- Tolerance
192 
193   static inline double getTolerance();
194   static inline double setTolerance(double tol);
195 
196 protected:
197 
198   inline HepLorentzVector vectorMultiplication
199                                         ( const HepLorentzVector & w ) const;
200   // Multiplication with a Lorentz Vector.
201 
202   HepLorentzRotation matrixMultiplication (const HepRep4x4 & m) const;
203   HepLorentzRotation matrixMultiplication (const HepRep4x4Symmetric & m) const;
204                    
205   inline HepBoostY (double beta, double gamma);
206 
207   double  beta_;
208   double  gamma_;
209 
210 };  // HepBoostY
211 
212 inline   
213 std::ostream & operator << 
214   ( std::ostream & os, const HepBoostY& b ) {return b.print(os);}
215 
216 }  // namespace CLHEP
217 
218 #include "CLHEP/Vector/BoostY.icc"
219 
220 #endif /* HEP_BOOSTY_H */
221