00001
00002
00003
00004
00005
00006 #ifndef HEP_ROTATION_INTERFACES_H
00007 #define HEP_ROTATION_INTERFACES_H
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068 #include "CLHEP/config/CLHEP.h"
00069
00070 #ifdef HEP_NO_INLINE_IN_DECLARATION
00071 #define inline
00072 #endif
00073
00074 #include "CLHEP/Vector/ThreeVector.h"
00075 #include "CLHEP/Vector/LorentzVector.h"
00076 #include "CLHEP/Vector/AxisAngle.h"
00077
00078 struct HepRep3x3;
00079 struct HepRep4x4;
00080 struct HepRep4x4Symmetric;
00081
00082 class HepRotation;
00083 class HepRotationX;
00084 class HepRotationY;
00085 class HepRotationZ;
00086 class HepLorentzRotation;
00087 class HepBoost;
00088 class HepBoostX;
00089 class HepBoostY;
00090 class HepBoostZ;
00091
00092
00093
00094
00095
00096
00097
00098
00103 class Hep4RotationInterface {
00104
00105
00106
00107
00108
00109 friend class HepRotation;
00110 friend class HepRotationX;
00111 friend class HepRotationY;
00112 friend class HepRotationZ;
00113 friend class HepLorentzRotation;
00114 friend class HepBoost;
00115 friend class HepBoostX;
00116 friend class HepBoostY;
00117 friend class HepBoostZ;
00118
00119 public:
00120
00121 static double tolerance;
00122
00123
00124
00125 #ifdef ONLY_IN_CONCRETE_CLASSES
00126
00127 HepLorentzVector col1() const;
00128 HepLorentzVector col2() const;
00129 HepLorentzVector col3() const;
00130 HepLorentzVector col4() const;
00131 HepLorentzVector row1() const;
00132 HepLorentzVector row2() const;
00133 HepLorentzVector row3() const;
00134 HepLorentzVector row4() const;
00135
00136
00137 double xx() const ;
00138 double xy() const ;
00139 double xz() const ;
00140 double xt() const ;
00141 double yx() const ;
00142 double yy() const ;
00143 double yz() const ;
00144 double yt() const ;
00145 double zx() const ;
00146 double zy() const ;
00147 double zz() const ;
00148 double zt() const ;
00149 double tx() const ;
00150 double ty() const ;
00151 double tz() const ;
00152 double tt() const ;
00153
00154
00155
00156
00157
00158
00159
00160 inline int compare( const Hep4RotationInterface & lt ) const;
00161
00162
00163
00164
00165 void decompose (HepAxisAngle & rotation, Hep3Vector & boost)const;
00166
00167
00168 void decompose (Hep3Vector & boost, HepAxisAngle & rotation)const;
00169
00170
00171 bool operator == (const Hep4RotationInterface & r) const;
00172 bool operator != (const Hep4RotationInterface & r) const;
00173
00174
00175
00176 double norm2() const ;
00177 double distance2( const Hep4RotationInterface & lt ) const ;
00178 double howNear( const Hep4RotationInterface & lt ) const ;
00179 bool isNear (const Hep4RotationInterface & lt,
00180 double epsilon=tolerance) const ;
00181
00182 void rectify() ;
00183
00184
00185
00186
00187 HepLorentzVector operator* ( const HepLorentzVector & w ) const ;
00188 HepLorentzVector operator()( const HepLorentzVector & w ) const ;
00189
00190
00191
00192
00193 HepStd::ostream & print( HepStd::ostream & os ) const;
00194
00195 #endif
00196
00197 static double getTolerance();
00198 static double setTolerance( double tol );
00199
00200 enum { ToleranceTicks = 100 };
00201
00202 protected:
00203
00204 ~Hep4RotationInterface();
00205
00206 };
00207
00208
00209
00210
00211
00212
00213
00214
00215
00220 class Hep3RotationInterface : public Hep4RotationInterface {
00221
00222
00223
00224
00225 friend class HepRotation;
00226 friend class HepRotationX;
00227 friend class HepRotationY;
00228 friend class HepRotationZ;
00229
00230 public:
00231
00232 #ifdef ONLY_IN_CONCRETE_CLASSES
00233
00234
00235 double getPhi () const ;
00236 double getTheta() const ;
00237 double getPsi () const ;
00238 double phi () const ;
00239 double theta() const ;
00240 double psi () const ;
00241 HepEulerAngles eulerAngles() const ;
00242
00243
00244 double getDelta() const ;
00245 Hep3Vector getAxis () const ;
00246 double delta() const ;
00247 Hep3Vector axis () const ;
00248 HepAxisAngle axisAngle() const ;
00249
00250
00251 Hep3Vector rowX() const;
00252 Hep3Vector rowY() const;
00253 Hep3Vector rowZ() const;
00254
00255 Hep3Vector colX() const;
00256 Hep3Vector colY() const;
00257 Hep3Vector colZ() const;
00258
00259
00260
00261
00262
00263 HepLorentzVector col1() const;
00264 HepLorentzVector col2() const;
00265 HepLorentzVector col3() const;
00266 HepLorentzVector col4() const;
00267 HepLorentzVector row1() const;
00268 HepLorentzVector row2() const;
00269 HepLorentzVector row3() const;
00270 HepLorentzVector row4() const;
00271
00272
00273 double xt() const;
00274 double yt() const;
00275 double zt() const;
00276 double tx() const;
00277 double ty() const;
00278 double tz() const;
00279 double tt() const;
00280
00281
00282
00283 HepRotation operator * ( const Hep3RotationInterface & r ) const ;
00284
00285
00286
00287 HepLorentzVector operator* ( const HepLorentzVector & w ) const ;
00288 HepLorentzVector operator()( const HepLorentzVector & w ) const ;
00289
00290
00291 Hep3Vector operator* ( const Hep3Vector & v ) const ;
00292 Hep3Vector operator()( const Hep3Vector & v ) const ;
00293
00294
00295
00296
00297 HepStd::ostream & print( HepStd::ostream & os ) const;
00298
00299 #endif
00300
00301 private:
00302
00303 ~Hep3RotationInterface();
00304
00305 };
00306
00307
00308
00309
00310
00311
00312 struct HepRep3x3 {
00313
00314
00315
00316 inline HepRep3x3();
00317
00318 inline HepRep3x3( double xx, double xy, double xz
00319 , double yx, double yy, double yz
00320 , double zx, double zy, double zz
00321 );
00322
00323 inline HepRep3x3( const double * array );
00324
00325
00326
00327 inline void setToIdentity();
00328
00329
00330 double xx_, xy_, xz_,
00331 yx_, yy_, yz_,
00332 zx_, zy_, zz_;
00333
00334 inline void getArray ( double * array ) const;
00335
00336
00337 };
00338
00339 struct HepRep4x4 {
00340
00341
00342 inline HepRep4x4();
00343
00344 inline HepRep4x4( double xx, double xy, double xz, double xt
00345 , double yx, double yy, double yz, double yt
00346 , double zx, double zy, double zz, double zt
00347 , double tx, double ty, double tz, double tt
00348 );
00349
00350 inline HepRep4x4( const HepRep4x4Symmetric & rep );
00351
00352 inline HepRep4x4( const double * array );
00353
00354
00355
00356 inline void setToIdentity();
00357
00358
00359 double xx_, xy_, xz_, xt_,
00360 yx_, yy_, yz_, yt_,
00361 zx_, zy_, zz_, zt_,
00362 tx_, ty_, tz_, tt_;
00363
00364 inline void getArray ( double * array ) const;
00365
00366
00367 inline bool operator==(HepRep4x4 const & r) const;
00368 inline bool operator!=(HepRep4x4 const & r) const;
00369
00370
00371 };
00372
00373 struct HepRep4x4Symmetric {
00374
00375
00376
00377 inline HepRep4x4Symmetric();
00378
00379 inline HepRep4x4Symmetric
00380 ( double xx, double xy, double xz, double xt
00381 , double yy, double yz, double yt
00382 , double zz, double zt
00383 , double tt );
00384
00385 inline HepRep4x4Symmetric( const double * array );
00386
00387
00388
00389 inline void setToIdentity();
00390
00391
00392 double xx_, xy_, xz_, xt_,
00393 yy_, yz_, yt_,
00394 zz_, zt_,
00395 tt_;
00396
00397 inline void getArray ( double * array ) const;
00398
00399
00400 };
00401
00402 #ifndef HEP_DEBUG_INLINE
00403 #include "CLHEP/Vector/RotationInterfaces.icc"
00404 #endif
00405
00406 #endif // ROTATION_INTERFACES_H