File indexing completed on 2025-01-30 10:03:33
0001
0002
0003
0004
0005
0006 #ifndef HEP_ROTATION_INTERFACES_H
0007 #define HEP_ROTATION_INTERFACES_H
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034
0035
0036
0037
0038
0039
0040
0041
0042
0043
0044
0045
0046
0047
0048
0049
0050
0051
0052
0053
0054
0055
0056
0057
0058
0059
0060
0061
0062
0063
0064
0065
0066
0067
0068 #include "CLHEP/Vector/defs.h"
0069 #include "CLHEP/Vector/ThreeVector.h"
0070 #include "CLHEP/Vector/LorentzVector.h"
0071 #include "CLHEP/Vector/AxisAngle.h"
0072
0073 namespace CLHEP {
0074
0075 struct HepRep3x3;
0076 struct HepRep4x4;
0077 struct HepRep4x4Symmetric;
0078
0079 class HepRotation;
0080 class HepRotationX;
0081 class HepRotationY;
0082 class HepRotationZ;
0083 class HepLorentzRotation;
0084 class HepBoost;
0085 class HepBoostX;
0086 class HepBoostY;
0087 class HepBoostZ;
0088
0089
0090
0091
0092
0093
0094
0095
0096
0097
0098
0099 class Hep4RotationInterface {
0100
0101
0102
0103
0104
0105 friend class HepRotation;
0106 friend class HepRotationX;
0107 friend class HepRotationY;
0108 friend class HepRotationZ;
0109 friend class HepLorentzRotation;
0110 friend class HepBoost;
0111 friend class HepBoostX;
0112 friend class HepBoostY;
0113 friend class HepBoostZ;
0114
0115 public:
0116
0117 static double tolerance;
0118
0119
0120
0121 #ifdef ONLY_IN_CONCRETE_CLASSES
0122
0123 HepLorentzVector col1() const;
0124 HepLorentzVector col2() const;
0125 HepLorentzVector col3() const;
0126 HepLorentzVector col4() const;
0127 HepLorentzVector row1() const;
0128 HepLorentzVector row2() const;
0129 HepLorentzVector row3() const;
0130 HepLorentzVector row4() const;
0131
0132
0133 double xx() const ;
0134 double xy() const ;
0135 double xz() const ;
0136 double xt() const ;
0137 double yx() const ;
0138 double yy() const ;
0139 double yz() const ;
0140 double yt() const ;
0141 double zx() const ;
0142 double zy() const ;
0143 double zz() const ;
0144 double zt() const ;
0145 double tx() const ;
0146 double ty() const ;
0147 double tz() const ;
0148 double tt() const ;
0149
0150
0151
0152
0153
0154
0155
0156 inline int compare( const Hep4RotationInterface & lt ) const;
0157
0158
0159
0160
0161 void decompose (HepAxisAngle & rotation, Hep3Vector & boost)const;
0162
0163
0164 void decompose (Hep3Vector & boost, HepAxisAngle & rotation)const;
0165
0166
0167 bool operator == (const Hep4RotationInterface & r) const;
0168 bool operator != (const Hep4RotationInterface & r) const;
0169
0170
0171
0172 double norm2() const ;
0173 double distance2( const Hep4RotationInterface & lt ) const ;
0174 double howNear( const Hep4RotationInterface & lt ) const ;
0175 bool isNear (const Hep4RotationInterface & lt,
0176 double epsilon=tolerance) const ;
0177
0178 void rectify() ;
0179
0180
0181
0182
0183 HepLorentzVector operator* ( const HepLorentzVector & w ) const ;
0184 HepLorentzVector operator()( const HepLorentzVector & w ) const ;
0185
0186
0187
0188
0189 std::ostream & print( std::ostream & os ) const;
0190
0191 #endif
0192
0193 static double getTolerance();
0194 static double setTolerance( double tol );
0195
0196 static const int ToleranceTicks = 100;
0197
0198 protected:
0199
0200 ~Hep4RotationInterface() {}
0201
0202 };
0203
0204
0205
0206
0207
0208
0209
0210
0211
0212
0213
0214
0215 class Hep3RotationInterface : public Hep4RotationInterface {
0216
0217
0218
0219
0220 friend class HepRotation;
0221 friend class HepRotationX;
0222 friend class HepRotationY;
0223 friend class HepRotationZ;
0224
0225 public:
0226
0227 #ifdef ONLY_IN_CONCRETE_CLASSES
0228
0229
0230 double getPhi () const ;
0231 double getTheta() const ;
0232 double getPsi () const ;
0233 double phi () const ;
0234 double theta() const ;
0235 double psi () const ;
0236 HepEulerAngles eulerAngles() const ;
0237
0238
0239 double getDelta() const ;
0240 Hep3Vector getAxis () const ;
0241 double delta() const ;
0242 Hep3Vector axis () const ;
0243 HepAxisAngle axisAngle() const ;
0244
0245
0246 Hep3Vector rowX() const;
0247 Hep3Vector rowY() const;
0248 Hep3Vector rowZ() const;
0249
0250 Hep3Vector colX() const;
0251 Hep3Vector colY() const;
0252 Hep3Vector colZ() const;
0253
0254
0255
0256
0257
0258 HepLorentzVector col1() const;
0259 HepLorentzVector col2() const;
0260 HepLorentzVector col3() const;
0261 HepLorentzVector col4() const;
0262 HepLorentzVector row1() const;
0263 HepLorentzVector row2() const;
0264 HepLorentzVector row3() const;
0265 HepLorentzVector row4() const;
0266
0267
0268 double xt() const;
0269 double yt() const;
0270 double zt() const;
0271 double tx() const;
0272 double ty() const;
0273 double tz() const;
0274 double tt() const;
0275
0276
0277
0278 HepRotation operator * ( const Hep3RotationInterface & r ) const ;
0279
0280
0281
0282 HepLorentzVector operator* ( const HepLorentzVector & w ) const ;
0283 HepLorentzVector operator()( const HepLorentzVector & w ) const ;
0284
0285
0286 Hep3Vector operator* ( const Hep3Vector & v ) const ;
0287 Hep3Vector operator()( const Hep3Vector & v ) const ;
0288
0289
0290
0291
0292 std::ostream & print( std::ostream & os ) const;
0293
0294 #endif
0295
0296 private:
0297
0298 ~Hep3RotationInterface() {}
0299
0300 };
0301
0302
0303
0304
0305
0306 struct HepRep3x3 {
0307
0308
0309
0310 inline HepRep3x3();
0311
0312 inline HepRep3x3( double xx, double xy, double xz
0313 , double yx, double yy, double yz
0314 , double zx, double zy, double zz
0315 );
0316
0317 inline HepRep3x3( const double * array );
0318
0319
0320
0321 inline void setToIdentity();
0322
0323
0324 double xx_, xy_, xz_,
0325 yx_, yy_, yz_,
0326 zx_, zy_, zz_;
0327
0328 inline void getArray ( double * array ) const;
0329
0330
0331 };
0332
0333 struct HepRep4x4 {
0334
0335
0336 inline HepRep4x4();
0337
0338 inline HepRep4x4( double xx, double xy, double xz, double xt
0339 , double yx, double yy, double yz, double yt
0340 , double zx, double zy, double zz, double zt
0341 , double tx, double ty, double tz, double tt
0342 );
0343
0344 inline HepRep4x4( const HepRep4x4Symmetric & rep );
0345
0346 inline HepRep4x4( const double * array );
0347
0348
0349
0350 inline void setToIdentity();
0351
0352
0353 double xx_, xy_, xz_, xt_,
0354 yx_, yy_, yz_, yt_,
0355 zx_, zy_, zz_, zt_,
0356 tx_, ty_, tz_, tt_;
0357
0358 inline void getArray ( double * array ) const;
0359
0360
0361 inline bool operator==(HepRep4x4 const & r) const;
0362 inline bool operator!=(HepRep4x4 const & r) const;
0363
0364
0365 };
0366
0367 struct HepRep4x4Symmetric {
0368
0369
0370
0371 inline HepRep4x4Symmetric();
0372
0373 inline HepRep4x4Symmetric
0374 ( double xx, double xy, double xz, double xt
0375 , double yy, double yz, double yt
0376 , double zz, double zt
0377 , double tt );
0378
0379 inline HepRep4x4Symmetric( const double * array );
0380
0381
0382
0383 inline void setToIdentity();
0384
0385
0386 double xx_, xy_, xz_, xt_,
0387 yy_, yz_, yt_,
0388 zz_, zt_,
0389 tt_;
0390
0391 inline void getArray ( double * array ) const;
0392
0393
0394 };
0395
0396 }
0397
0398 #include "CLHEP/Vector/RotationInterfaces.icc"
0399
0400 #ifdef ENABLE_BACKWARDS_COMPATIBILITY
0401
0402 using namespace CLHEP;
0403 #endif
0404
0405 #endif