00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef HEP_BOOST_H
00020 #define HEP_BOOST_H
00021
00022 #ifdef GNUPRAGMA
00023 #pragma interface
00024 #endif
00025
00026 #ifdef HEP_NO_INLINE_IN_DECLARATION
00027 #define inline
00028 #endif
00029
00030 #include "CLHEP/Vector/RotationInterfaces.h"
00031 #include "CLHEP/Vector/BoostX.h"
00032 #include "CLHEP/Vector/BoostY.h"
00033 #include "CLHEP/Vector/BoostZ.h"
00034 #include "CLHEP/Vector/LorentzVector.h"
00035
00036
00037 class HepBoost;
00038 inline HepBoost inverseOf ( const HepBoost & lt );
00039
00044 class HepBoost {
00045
00046 public:
00047
00048
00049
00050 inline HepBoost();
00051
00052
00053 inline HepBoost(const HepBoost & m);
00054
00055
00056 inline HepBoost & operator = (const HepBoost & m);
00057
00058
00059 HepBoost & set (double betaX, double betaY, double betaZ);
00060 inline HepBoost (double betaX, double betaY, double betaZ);
00061
00062
00063 HepBoost & set (const HepRep4x4Symmetric & m);
00064 inline HepBoost (const HepRep4x4Symmetric & m);
00065
00066
00067 HepBoost & set (Hep3Vector direction, double beta);
00068 inline HepBoost (Hep3Vector direction, double beta);
00069
00070
00071 HepBoost & set (const Hep3Vector & boost);
00072 inline HepBoost (const Hep3Vector & boost);
00073
00074
00075 inline HepBoost & set (const HepBoostX & boost);
00076 inline HepBoost & set (const HepBoostY & boost);
00077 inline HepBoost & set (const HepBoostZ & boost);
00078 inline HepBoost (const HepBoostX & boost);
00079 inline HepBoost (const HepBoostY & boost);
00080 inline HepBoost (const HepBoostZ & boost);
00081
00082
00083
00084 inline double beta() const;
00085 inline double gamma() const;
00086 inline Hep3Vector boostVector() const;
00087 inline Hep3Vector getDirection() const;
00088 inline Hep3Vector direction() const;
00089
00090 inline double xx() const;
00091 inline double xy() const;
00092 inline double xz() const;
00093 inline double xt() const;
00094 inline double yx() const;
00095 inline double yy() const;
00096 inline double yz() const;
00097 inline double yt() const;
00098 inline double zx() const;
00099 inline double zy() const;
00100 inline double zz() const;
00101 inline double zt() const;
00102 inline double tx() const;
00103 inline double ty() const;
00104 inline double tz() const;
00105 inline double tt() const;
00106
00107
00108 inline HepLorentzVector col1() const;
00109 inline HepLorentzVector col2() const;
00110 inline HepLorentzVector col3() const;
00111 inline HepLorentzVector col4() const;
00112
00113
00114 inline HepLorentzVector row1() const;
00115 inline HepLorentzVector row2() const;
00116 inline HepLorentzVector row3() const;
00117 inline HepLorentzVector row4() const;
00118
00119
00120 inline HepRep4x4 rep4x4() const;
00121
00122
00123 inline HepRep4x4Symmetric rep4x4Symmetric() const;
00124
00125
00126
00127
00128 void decompose (HepRotation & rotation, HepBoost & boost) const;
00129 void decompose (HepAxisAngle & rotation, Hep3Vector & boost) const;
00130
00131
00132 void decompose (HepBoost & boost, HepRotation & rotation) const;
00133 void decompose (Hep3Vector & boost, HepAxisAngle & rotation) const;
00134
00135
00136
00137
00138 inline int compare( const HepBoost & b ) const;
00139
00140
00141
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 inline bool operator > (const HepBoost & b) const;
00148
00149
00150 inline bool isIdentity() const;
00151
00152
00153 inline double distance2( const HepBoost & b ) const;
00154 inline double distance2( const HepBoostX & bx ) const;
00155 inline double distance2( const HepBoostY & by ) const;
00156 inline double distance2( const HepBoostZ & bz ) const;
00157
00158
00159 double distance2( const HepRotation & r ) const;
00160 double distance2( const HepLorentzRotation & lt ) const;
00161
00162
00163 inline double howNear( const HepBoost & b ) const;
00164 inline bool isNear( const HepBoost & b,
00165 double epsilon=Hep4RotationInterface::tolerance) const;
00166
00167 double howNear( const HepRotation & r ) const;
00168 double howNear( const HepLorentzRotation & lt ) const;
00169
00170 bool isNear( const HepRotation & r,
00171 double epsilon=Hep4RotationInterface::tolerance) const;
00172 bool isNear( const HepLorentzRotation & lt,
00173 double epsilon=Hep4RotationInterface::tolerance) const;
00174
00175
00176
00177 double norm2() const;
00178
00179
00180 void rectify();
00181
00182
00183
00184
00185 inline HepLorentzVector operator()( const HepLorentzVector & p ) const;
00186
00187
00188 inline HepLorentzVector operator* ( const HepLorentzVector & p ) const;
00189
00190
00191
00192
00193 HepLorentzRotation operator * (const HepBoost & b) const;
00194 HepLorentzRotation operator * (const HepRotation & r) const;
00195 HepLorentzRotation operator * (const HepLorentzRotation & lt) const;
00196
00197
00198
00199 inline HepBoost inverse() const;
00200
00201
00202 inline friend HepBoost inverseOf ( const HepBoost & lt );
00203
00204
00205 inline HepBoost & invert();
00206
00207
00208
00209
00210 HepStd::ostream & print( HepStd::ostream & os ) const;
00211
00212
00213
00214
00215 static inline double getTolerance();
00216 static inline double setTolerance(double tol);
00217
00218 protected:
00219
00220 inline HepLorentzVector vectorMultiplication
00221 ( const HepLorentzVector & w ) const;
00222
00223
00224 HepLorentzRotation matrixMultiplication (const HepRep4x4 & m) const;
00225 HepLorentzRotation matrixMultiplication (const HepRep4x4Symmetric & m) const;
00226
00227 inline HepBoost
00228 (double xx, double xy, double xz, double xt,
00229 double yy, double yz, double yt,
00230 double zz, double zt,
00231 double tt);
00232
00233
00234
00235 inline void setBoost(double bx, double by, double bz);
00236
00237 HepRep4x4Symmetric rep_;
00238
00239 };
00240
00241 inline
00242 HepStd::ostream & operator <<
00243 ( HepStd::ostream & os, const HepBoost& b ) {return b.print(os);}
00244
00245 #ifdef HEP_NO_INLINE_IN_DECLARATION
00246 #undef inline
00247 #endif
00248
00249 #ifdef HEP_SHORT_NAMES
00250 typedef HepBoost LBoost;
00251 #endif
00252
00253 #ifndef HEP_DEBUG_INLINE
00254 #include "CLHEP/Vector/Boost.icc"
00255 #endif
00256
00257 #endif