Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-02-23 09:23:18

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