CLHEP VERSION Reference Documentation
CLHEP Home Page CLHEP Documentation CLHEP Bug Reports |
00001 #ifndef HEP_EULERANGLES_H 00002 #define HEP_EULERANGLES_H 00003 00004 // ---------------------------------------------------------------------- 00005 // 00006 // EulerAngles.h EulerAngles class -- 00007 // Support class for PhysicsVectors classes 00008 // 00009 // History: 00010 // 09-Jan-1998 WEB FixedTypes is now found in ZMutility 00011 // 12-Jan-1998 WEB PI is now found in ZMutility 00012 // 15-Jun-1998 WEB Added namespace support 00013 // 02-May-2000 WEB No global using 00014 // 26-Jul-2000 MF CLHEP version 00015 // 00016 // ---------------------------------------------------------------------- 00017 00018 #include <iostream> 00019 #include "CLHEP/Vector/defs.h" 00020 00021 namespace CLHEP { 00022 00023 // Declarations of classes and global methods 00024 class HepEulerAngles; 00025 std::ostream & operator<<(std::ostream & os, const HepEulerAngles & aa); 00026 std::istream & operator>>(std::istream & is, HepEulerAngles & aa); 00027 00032 class HepEulerAngles { 00033 00034 protected: 00035 typedef HepEulerAngles EA; // just an abbreviation 00036 static double tolerance; // to determine relative nearness 00037 00038 public: 00039 00040 // ---------- Constructors: 00041 inline HepEulerAngles(); 00042 inline HepEulerAngles( double phi, double theta, double psi ); 00043 00044 // ---------- Destructor, copy constructor, assignment: 00045 // use C++ defaults 00046 00047 // ---------- Accessors: 00048 00049 public: 00050 inline double getPhi() const; 00051 inline double phi() const; 00052 inline EA & setPhi( double phi ); 00053 00054 inline double getTheta() const; 00055 inline double theta() const; 00056 inline EA & setTheta( double theta ); 00057 00058 inline double getPsi() const; 00059 inline double psi() const; 00060 inline EA & setPsi( double psi ); 00061 00062 inline EA & set( double phi, double theta, double psi ); 00063 00064 // ---------- Operations: 00065 00066 // comparisons: 00067 inline int compare ( const EA & ea ) const; 00068 00069 inline bool operator==( const EA & ea ) const; 00070 inline bool operator!=( const EA & ea ) const; 00071 inline bool operator< ( const EA & ea ) const; 00072 inline bool operator<=( const EA & ea ) const; 00073 inline bool operator> ( const EA & ea ) const; 00074 inline bool operator>=( const EA & ea ) const; 00075 00076 // relative comparison: 00077 inline static double getTolerance(); 00078 inline static double setTolerance( double tol ); 00079 00080 bool isNear ( const EA & ea, double epsilon = tolerance ) const; 00081 double howNear( const EA & ea ) const; 00082 00083 // ---------- I/O: 00084 00085 friend std::ostream & operator<<( std::ostream & os, const EA & ea ); 00086 friend std::istream & operator>>( std::istream & is, EA & ea ); 00087 00088 // ---------- Helper methods: 00089 00090 protected: 00091 double distance( const HepEulerAngles & ex ) const; 00092 00093 // ---------- Data members: 00094 protected: 00095 double phi_; 00096 double theta_; 00097 double psi_; 00098 00099 }; // HepEulerAngles 00100 00101 } // namespace CLHEP 00102 00103 00104 namespace zmpv { 00105 00106 typedef CLHEP::HepEulerAngles EulerAngles; 00107 00108 } // end of namespace zmpv 00109 00110 #define EULERANGLES_ICC 00111 #include "CLHEP/Vector/EulerAngles.icc" 00112 #undef EULERANGLES_ICC 00113 00114 #ifdef ENABLE_BACKWARDS_COMPATIBILITY 00115 // backwards compatibility will be enabled ONLY in CLHEP 1.9 00116 using namespace CLHEP; 00117 #endif 00118 00119 00120 #endif // EULERANGLES_H