00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef HEP_LORENTZROTATION_H
00024 #define HEP_LORENTZROTATION_H
00025
00026 #ifdef GNUPRAGMA
00027 #pragma interface
00028 #endif
00029
00030 #ifdef HEP_NO_INLINE_IN_DECLARATION
00031 #define inline
00032 #endif
00033
00034 #include "CLHEP/Vector/RotationInterfaces.h"
00035 #include "CLHEP/Vector/Rotation.h"
00036 #include "CLHEP/Vector/Boost.h"
00037 #include "CLHEP/Vector/LorentzVector.h"
00038
00039
00040
00041 inline HepLorentzRotation inverseOf ( const HepLorentzRotation & lt );
00042 HepLorentzRotation operator * (const HepRotation & r,
00043 const HepLorentzRotation & lt);
00044 HepLorentzRotation operator * (const HepRotationX & r,
00045 const HepLorentzRotation & lt);
00046 HepLorentzRotation operator * (const HepRotationY & r,
00047 const HepLorentzRotation & lt);
00048 HepLorentzRotation operator * (const HepRotationZ & r,
00049 const HepLorentzRotation & lt);
00050
00055 class HepLorentzRotation {
00056
00057 public:
00058
00059
00060 static const HepLorentzRotation IDENTITY;
00061
00062
00063
00064 inline HepLorentzRotation();
00065
00066
00067 inline HepLorentzRotation (const HepLorentzRotation & r);
00068
00069
00070 inline HepLorentzRotation (const HepRotation & r);
00071 inline HepLorentzRotation (const HepBoost & b);
00072
00073
00074 inline HepLorentzRotation & operator = (const HepLorentzRotation & m);
00075 inline HepLorentzRotation & operator = (const HepRotation & m);
00076 inline HepLorentzRotation & operator = (const HepBoost & m);
00077
00078
00079 HepLorentzRotation & set (double bx, double by, double bz);
00080 inline HepLorentzRotation & set (const Hep3Vector & p);
00081 inline HepLorentzRotation & set (const HepBoost & boost);
00082 inline HepLorentzRotation (double bx, double by, double bz);
00083 inline HepLorentzRotation (const Hep3Vector & p);
00084
00085
00086 HepLorentzRotation & set( const HepBoost & B, const HepRotation & R );
00087 inline HepLorentzRotation ( const HepBoost & B, const HepRotation & R );
00088
00089
00090 HepLorentzRotation & set( const HepRotation & R, const HepBoost & B );
00091 inline HepLorentzRotation ( const HepRotation & R, const HepBoost & B );
00092
00093
00094 HepLorentzRotation ( const HepLorentzVector & col1,
00095 const HepLorentzVector & col2,
00096 const HepLorentzVector & col3,
00097 const HepLorentzVector & col4 );
00098
00099
00100
00101
00102
00103
00104
00105
00106
00107
00108 HepLorentzRotation & set( const HepLorentzVector & col1,
00109 const HepLorentzVector & col2,
00110 const HepLorentzVector & col3,
00111 const HepLorentzVector & col4 );
00112
00113
00114 HepLorentzRotation & setRows( const HepLorentzVector & row1,
00115 const HepLorentzVector & row2,
00116 const HepLorentzVector & row3,
00117 const HepLorentzVector & row4 );
00118
00119
00120 inline HepLorentzRotation & set( const HepRep4x4 & rep );
00121 inline HepLorentzRotation ( const HepRep4x4 & rep );
00122
00123
00124
00125
00126
00127
00128
00129
00130
00131
00132
00133 inline double xx() const;
00134 inline double xy() const;
00135 inline double xz() const;
00136 inline double xt() const;
00137 inline double yx() const;
00138 inline double yy() const;
00139 inline double yz() const;
00140 inline double yt() const;
00141 inline double zx() const;
00142 inline double zy() const;
00143 inline double zz() const;
00144 inline double zt() const;
00145 inline double tx() const;
00146 inline double ty() const;
00147 inline double tz() const;
00148 inline double tt() const;
00149
00150
00151 inline HepLorentzVector col1() const;
00152 inline HepLorentzVector col2() const;
00153 inline HepLorentzVector col3() const;
00154 inline HepLorentzVector col4() const;
00155
00156
00157 inline HepLorentzVector row1() const;
00158 inline HepLorentzVector row2() const;
00159 inline HepLorentzVector row3() const;
00160 inline HepLorentzVector row4() const;
00161
00162
00163 inline HepRep4x4 rep4x4() const;
00164
00165
00166
00167
00168 class HepLorentzRotation_row {
00169 public:
00170 inline HepLorentzRotation_row(const HepLorentzRotation &, int);
00171 inline double operator [] (int) const;
00172 private:
00173 const HepLorentzRotation & rr;
00174 int ii;
00175 };
00176
00177
00178 inline const HepLorentzRotation_row operator [] (int) const;
00179
00180
00181 double operator () (int, int) const;
00182
00183
00184
00185
00186 void decompose (Hep3Vector & boost, HepAxisAngle & rotation) const;
00187 void decompose (HepBoost & boost, HepRotation & rotation) const;
00188
00189
00190 void decompose (HepAxisAngle & rotation, Hep3Vector & boost) const;
00191 void decompose (HepRotation & rotation, HepBoost & boost) const;
00192
00193
00194
00195
00196 int compare( const HepLorentzRotation & m ) const;
00197
00198
00199
00200 inline bool operator == (const HepLorentzRotation &) const;
00201 inline bool operator != (const HepLorentzRotation &) const;
00202 inline bool operator <= (const HepLorentzRotation &) const;
00203 inline bool operator >= (const HepLorentzRotation &) const;
00204 inline bool operator < (const HepLorentzRotation &) const;
00205 inline bool operator > (const HepLorentzRotation &) const;
00206
00207 inline bool isIdentity() const;
00208
00209
00210 double distance2( const HepBoost & b ) const;
00211 double distance2( const HepRotation & r ) const;
00212 double distance2( const HepLorentzRotation & lt ) const;
00213
00214
00215 double howNear( const HepBoost & b ) const;
00216 double howNear( const HepRotation & r) const;
00217 double howNear( const HepLorentzRotation & lt ) const;
00218
00219 bool isNear(const HepBoost & b,
00220 double epsilon=Hep4RotationInterface::tolerance) const;
00221 bool isNear(const HepRotation & r,
00222 double epsilon=Hep4RotationInterface::tolerance) const;
00223 bool isNear(const HepLorentzRotation & lt,
00224 double epsilon=Hep4RotationInterface::tolerance) const;
00225
00226
00227
00228 double norm2() const;
00229
00230
00231
00232 void rectify();
00233
00234
00235
00236
00237
00238
00239
00240
00241
00242
00243
00244 inline HepLorentzVector vectorMultiplication(const HepLorentzVector&) const;
00245 inline HepLorentzVector operator()( const HepLorentzVector & w ) const;
00246 inline HepLorentzVector operator* ( const HepLorentzVector & p ) const;
00247
00248
00249
00250
00251 HepLorentzRotation matrixMultiplication(const HepRep4x4 & m) const;
00252
00253 inline HepLorentzRotation operator * (const HepBoost & b) const;
00254 inline HepLorentzRotation operator * (const HepRotation & r) const;
00255 inline HepLorentzRotation operator * (const HepLorentzRotation & lt) const;
00256
00257
00258 inline HepLorentzRotation & operator *= (const HepBoost & b);
00259 inline HepLorentzRotation & operator *= (const HepRotation & r);
00260 inline HepLorentzRotation & operator *= (const HepLorentzRotation & lt);
00261 inline HepLorentzRotation & transform (const HepBoost & b);
00262 inline HepLorentzRotation & transform (const HepRotation & r);
00263 inline HepLorentzRotation & transform (const HepLorentzRotation & lt);
00264
00265
00266
00267
00268
00269
00270
00271 HepLorentzRotation & rotateX(double delta);
00272
00273
00274 HepLorentzRotation & rotateY(double delta);
00275
00276
00277 HepLorentzRotation & rotateZ(double delta);
00278
00279
00280 inline HepLorentzRotation & rotate(double delta, const Hep3Vector& axis);
00281 inline HepLorentzRotation & rotate(double delta, const Hep3Vector *axis);
00282
00283
00284 HepLorentzRotation & boostX(double beta);
00285
00286
00287 HepLorentzRotation & boostY(double beta);
00288
00289
00290 HepLorentzRotation & boostZ(double beta);
00291
00292
00293 inline HepLorentzRotation & boost(double, double, double);
00294 inline HepLorentzRotation & boost(const Hep3Vector &);
00295
00296
00297 inline HepLorentzRotation inverse() const;
00298
00299
00300 inline friend HepLorentzRotation inverseOf
00301 ( const Hep4RotationInterface & lt );
00302
00303
00304 inline HepLorentzRotation & invert();
00305
00306
00307
00308
00309 HepStd::ostream & print( HepStd::ostream & os ) const;
00310
00311
00312
00313
00314 static inline double getTolerance();
00315 static inline double setTolerance(double tol);
00316
00317 friend HepLorentzRotation inverseOf ( const HepLorentzRotation & lt );
00318
00319 protected:
00320
00321 inline HepLorentzRotation
00322 (double mxx, double mxy, double mxz, double mxt,
00323 double myx, double myy, double myz, double myt,
00324 double mzx, double mzy, double mzz, double mzt,
00325 double mtx, double mty, double mtz, double mtt);
00326
00327
00328
00329 inline void setBoost(double, double, double);
00330
00331
00332 double mxx, mxy, mxz, mxt,
00333 myx, myy, myz, myt,
00334 mzx, mzy, mzz, mzt,
00335 mtx, mty, mtz, mtt;
00336
00337
00338 };
00339
00340 #ifdef HEP_NO_INLINE_IN_DECLARATION
00341 #undef inline
00342 #endif
00343
00344 #ifdef HEP_SHORT_NAMES
00345 typedef HepLorentzRotation LRotation;
00346 #endif
00347
00348 #ifndef HEP_DEBUG_INLINE
00349 #include "CLHEP/Vector/LorentzRotation.icc"
00350 #endif
00351
00352 #endif
00353