Geant4 Cross Reference |
1 // -*- C++ -*- 1 // -*- C++ -*- 2 // CLASSDOC OFF 2 // CLASSDOC OFF >> 3 // $Id:$ 3 // ------------------------------------------- 4 // --------------------------------------------------------------------------- 4 // CLASSDOC ON 5 // CLASSDOC ON 5 // 6 // 6 // This file is a part of the CLHEP - a Class 7 // This file is a part of the CLHEP - a Class Library for High Energy Physics. 7 // 8 // 8 // ------------------------------------------- 9 // ---------------------------------------------------------------------- 9 // 10 // 10 // EulerAngles.h EulerAngles class -- 11 // EulerAngles.h EulerAngles class -- 11 // Support class for PhysicsVectors cla 12 // Support class for PhysicsVectors classes 12 // 13 // 13 // History: 14 // History: 14 // 09-Jan-1998 WEB FixedTypes is now found 15 // 09-Jan-1998 WEB FixedTypes is now found in ZMutility 15 // 12-Jan-1998 WEB PI is now found in ZMut 16 // 12-Jan-1998 WEB PI is now found in ZMutility 16 // 15-Jun-1998 WEB Added namespace support 17 // 15-Jun-1998 WEB Added namespace support 17 // 02-May-2000 WEB No global using 18 // 02-May-2000 WEB No global using 18 // 26-Jul-2000 MF CLHEP version 19 // 26-Jul-2000 MF CLHEP version 19 // 20 // 20 // ------------------------------------------- 21 // ---------------------------------------------------------------------- 21 22 22 #ifndef HEP_EULERANGLES_H 23 #ifndef HEP_EULERANGLES_H 23 #define HEP_EULERANGLES_H 24 #define HEP_EULERANGLES_H 24 25 25 #include <iostream> 26 #include <iostream> 26 27 27 namespace CLHEP { 28 namespace CLHEP { 28 29 29 // Declarations of classes and global methods 30 // Declarations of classes and global methods 30 class HepEulerAngles; 31 class HepEulerAngles; 31 std::ostream & operator<<(std::ostream & os, c 32 std::ostream & operator<<(std::ostream & os, const HepEulerAngles & aa); 32 std::istream & operator>>(std::istream & is, 33 std::istream & operator>>(std::istream & is, HepEulerAngles & aa); 33 34 34 /** 35 /** 35 * @author 36 * @author 36 * @ingroup vector 37 * @ingroup vector 37 */ 38 */ 38 class HepEulerAngles { 39 class HepEulerAngles { 39 40 40 protected: 41 protected: 41 typedef HepEulerAngles EA; // just an 42 typedef HepEulerAngles EA; // just an abbreviation 42 static double tolerance; // to determin 43 static double tolerance; // to determine relative nearness 43 44 44 public: 45 public: 45 46 46 // ---------- Constructors: 47 // ---------- Constructors: 47 inline HepEulerAngles(); 48 inline HepEulerAngles(); 48 inline HepEulerAngles( double phi, double th 49 inline HepEulerAngles( double phi, double theta, double psi ); 49 50 50 // ---------- Destructor, copy constructor, 51 // ---------- Destructor, copy constructor, assignment: 51 // use C++ defaults 52 // use C++ defaults 52 53 53 // ---------- Accessors: 54 // ---------- Accessors: 54 55 55 public: 56 public: 56 inline double getPhi() const; 57 inline double getPhi() const; 57 inline double phi() const; 58 inline double phi() const; 58 inline EA & setPhi( double phi ); 59 inline EA & setPhi( double phi ); 59 60 60 inline double getTheta() const; 61 inline double getTheta() const; 61 inline double theta() const; 62 inline double theta() const; 62 inline EA & setTheta( double theta ); 63 inline EA & setTheta( double theta ); 63 64 64 inline double getPsi() const; 65 inline double getPsi() const; 65 inline double psi() const; 66 inline double psi() const; 66 inline EA & setPsi( double psi ); 67 inline EA & setPsi( double psi ); 67 68 68 inline EA & set( double phi, double theta, d 69 inline EA & set( double phi, double theta, double psi ); 69 70 70 // ---------- Operations: 71 // ---------- Operations: 71 72 72 // comparisons: 73 // comparisons: 73 inline int compare ( const EA & ea ) cons 74 inline int compare ( const EA & ea ) const; 74 75 75 inline bool operator==( const EA & ea ) cons 76 inline bool operator==( const EA & ea ) const; 76 inline bool operator!=( const EA & ea ) cons 77 inline bool operator!=( const EA & ea ) const; 77 inline bool operator< ( const EA & ea ) cons 78 inline bool operator< ( const EA & ea ) const; 78 inline bool operator<=( const EA & ea ) cons 79 inline bool operator<=( const EA & ea ) const; 79 inline bool operator> ( const EA & ea ) cons 80 inline bool operator> ( const EA & ea ) const; 80 inline bool operator>=( const EA & ea ) cons 81 inline bool operator>=( const EA & ea ) const; 81 82 82 // relative comparison: 83 // relative comparison: 83 inline static double getTolerance(); 84 inline static double getTolerance(); 84 inline static double setTolerance( double to 85 inline static double setTolerance( double tol ); 85 86 86 bool isNear ( const EA & ea, double epsilon 87 bool isNear ( const EA & ea, double epsilon = tolerance ) const; 87 double howNear( const EA & ea ) const; 88 double howNear( const EA & ea ) const; 88 89 89 // ---------- I/O: 90 // ---------- I/O: 90 91 91 friend std::ostream & operator<<( std::ostre 92 friend std::ostream & operator<<( std::ostream & os, const EA & ea ); 92 friend std::istream & operator>>( std::istre 93 friend std::istream & operator>>( std::istream & is, EA & ea ); 93 94 94 // ---------- Helper methods: 95 // ---------- Helper methods: 95 96 96 protected: 97 protected: 97 double distance( const HepEulerAngles & ex 98 double distance( const HepEulerAngles & ex ) const; 98 99 99 // ---------- Data members: 100 // ---------- Data members: 100 protected: 101 protected: 101 double phi_; 102 double phi_; 102 double theta_; 103 double theta_; 103 double psi_; 104 double psi_; 104 105 105 }; // HepEulerAngles 106 }; // HepEulerAngles 106 107 107 } // namespace CLHEP 108 } // namespace CLHEP 108 109 109 #include "CLHEP/Vector/EulerAngles.icc" 110 #include "CLHEP/Vector/EulerAngles.icc" 110 111 111 #endif // EULERANGLES_H 112 #endif // EULERANGLES_H 112 113