Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-30 10:03:32

0001 #ifndef HEP_EULERANGLES_H
0002 #define HEP_EULERANGLES_H
0003 
0004 // ----------------------------------------------------------------------
0005 //
0006 //  EulerAngles.h   EulerAngles class --
0007 //              Support class for PhysicsVectors classes
0008 //
0009 // History:
0010 //   09-Jan-1998  WEB  FixedTypes is now found in ZMutility
0011 //   12-Jan-1998  WEB  PI is now found in ZMutility
0012 //   15-Jun-1998  WEB  Added namespace support
0013 //   02-May-2000  WEB  No global using
0014 //   26-Jul-2000  MF   CLHEP version
0015 //
0016 // ----------------------------------------------------------------------
0017 
0018 #include <iostream>
0019 #include "CLHEP/Vector/defs.h" 
0020 
0021 namespace CLHEP {
0022 
0023 // Declarations of classes and global methods
0024 class HepEulerAngles;
0025 std::ostream & operator<<(std::ostream & os, const HepEulerAngles & aa);
0026 std::istream & operator>>(std::istream & is,       HepEulerAngles & aa);
0027 
0028 /**
0029  * @author
0030  * @ingroup vector
0031  */
0032 class HepEulerAngles {
0033 
0034 protected:
0035   typedef HepEulerAngles EA;       // just an abbreviation
0036   static double tolerance;      // to determine relative nearness
0037 
0038 public:
0039 
0040   // ----------  Constructors:
0041   inline HepEulerAngles();
0042   inline HepEulerAngles( double phi, double theta, double psi );
0043 
0044   // ----------  Destructor, copy constructor, assignment:
0045   // use C++ defaults
0046 
0047   // ----------  Accessors:
0048 
0049 public:
0050   inline  double  getPhi() const;
0051   inline  double  phi()    const;
0052   inline  EA &       setPhi( double phi );
0053 
0054   inline  double  getTheta() const;
0055   inline  double  theta()    const;
0056   inline  EA &       setTheta( double theta );
0057 
0058   inline  double  getPsi() const;
0059   inline  double  psi()    const;
0060   inline  EA &       setPsi( double psi );
0061 
0062   inline EA & set( double phi, double theta, double psi );
0063 
0064   // ----------  Operations:
0065 
0066   //   comparisons:
0067   inline int  compare   ( const EA & ea ) const;
0068 
0069   inline bool operator==( const EA & ea ) const;
0070   inline bool operator!=( const EA & ea ) const;
0071   inline bool operator< ( const EA & ea ) const;
0072   inline bool operator<=( const EA & ea ) const;
0073   inline bool operator> ( const EA & ea ) const;
0074   inline bool operator>=( const EA & ea ) const;
0075 
0076   //   relative comparison:
0077   inline static double getTolerance();
0078   inline static double setTolerance( double tol );
0079 
0080   bool isNear ( const EA & ea, double epsilon = tolerance ) const;
0081   double  howNear( const EA & ea ) const;
0082 
0083   // ----------  I/O:
0084 
0085   friend std::ostream & operator<<( std::ostream & os, const EA & ea );
0086   friend std::istream & operator>>( std::istream & is,       EA & ea );
0087 
0088   // ---------- Helper methods:
0089 
0090 protected:
0091     double distance( const HepEulerAngles & ex ) const;
0092 
0093   // ----------  Data members:
0094 protected:
0095   double phi_;
0096   double theta_;
0097   double psi_;
0098 
0099 };  // HepEulerAngles
0100 
0101 }  // namespace CLHEP
0102 
0103 
0104 namespace zmpv {
0105 
0106 typedef CLHEP::HepEulerAngles EulerAngles;
0107 
0108 }  // end of namespace zmpv
0109 
0110 #define EULERANGLES_ICC
0111 #include "CLHEP/Vector/EulerAngles.icc"
0112 #undef EULERANGLES_ICC
0113 
0114 #ifdef ENABLE_BACKWARDS_COMPATIBILITY
0115 //  backwards compatibility will be enabled ONLY in CLHEP 1.9
0116 using namespace CLHEP;
0117 #endif
0118 
0119 
0120 #endif // EULERANGLES_H