CLHEP/Vector/EulerAngles.h

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 "CLHEP/config/CLHEP.h"
00019 #include "CLHEP/config/iostream.h"
00020 
00021 // Declarations of classes and global methods
00022 class HepEulerAngles;
00023 HepStd::ostream & operator<<(HepStd::ostream & os, const HepEulerAngles & aa);
00024 HepStd::istream & operator>>(HepStd::istream & is,       HepEulerAngles & aa);
00025 
00030 class HepEulerAngles {
00031 
00032 protected:
00033   typedef HepEulerAngles EA;       // just an abbreviation
00034   static double tolerance;      // to determine relative nearness
00035 
00036 public:
00037 
00038   // ----------  Constructors:
00039   inline HepEulerAngles();
00040   inline HepEulerAngles( double phi, double theta, double psi );
00041 
00042   // ----------  Destructor, copy constructor, assignment:
00043   // use C++ defaults
00044 
00045   // ----------  Accessors:
00046 
00047 public:
00048   inline  double  getPhi() const;
00049   inline  double  phi()    const;
00050   inline  EA &       setPhi( double phi );
00051 
00052   inline  double  getTheta() const;
00053   inline  double  theta()    const;
00054   inline  EA &       setTheta( double theta );
00055 
00056   inline  double  getPsi() const;
00057   inline  double  psi()    const;
00058   inline  EA &       setPsi( double psi );
00059 
00060   inline EA & set( double phi, double theta, double psi );
00061 
00062   // ----------  Operations:
00063 
00064   //   comparisons:
00065   inline int  compare   ( const EA & ea ) const;
00066 
00067   inline bool operator==( const EA & ea ) const;
00068   inline bool operator!=( const EA & ea ) const;
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 
00074   //   relative comparison:
00075   inline static double getTolerance();
00076   inline static double setTolerance( double tol );
00077 
00078   bool isNear ( const EA & ea, double epsilon = tolerance ) const;
00079   double  howNear( const EA & ea ) const;
00080 
00081   // ----------  I/O:
00082 
00083   friend HepStd::ostream & operator<<( HepStd::ostream & os, const EA & ea );
00084   friend HepStd::istream & operator>>( HepStd::istream & is,       EA & ea );
00085 
00086   // ---------- Helper methods:
00087 
00088 protected:
00089     double distance( const HepEulerAngles & ex ) const;
00090 
00091   // ----------  Data members:
00092 protected:
00093   double phi_;
00094   double theta_;
00095   double psi_;
00096 
00097 };  // HepEulerAngles
00098 
00099 
00100 namespace zmpv {
00101 
00102 typedef HepEulerAngles EulerAngles;
00103 
00104 }  // end of namespace zmpv  
00105 
00106 #define EULERANGLES_ICC
00107 #include "CLHEP/Vector/EulerAngles.icc"
00108 #undef EULERANGLES_ICC
00109 
00110 
00111 #endif // EULERANGLES_H

Class Library for High Energy Physics (version 1.8)