Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:54:39

0001 #ifndef HEP_AXISANGLE_H
0002 #define HEP_AXISANGLE_H
0003 
0004 // ----------------------------------------------------------------------
0005 //
0006 // AxisAngle.h - provide HepAxisAngle class
0007 //
0008 // History:
0009 //   23-Jan-1998  WEB  Initial draft
0010 //   15-Jun-1998  WEB  Added namespace support
0011 //   02-May-2000  WEB  No global using
0012 //   27-Jul-2000  MF   CLHEP version
0013 //
0014 // ----------------------------------------------------------------------
0015 
0016 
0017 #ifndef HEP_THREEVECTOR_H
0018   #include "CLHEP/Vector/ThreeVector.h"
0019 #endif
0020 
0021 #include <iostream>
0022 #include "CLHEP/Vector/defs.h" 
0023 
0024 
0025 namespace CLHEP {
0026 
0027 
0028 // Declarations of classes and global methods
0029 class HepAxisAngle;
0030 std::ostream & operator<<( std::ostream & os, const HepAxisAngle & aa );
0031 std::istream & operator>>( std::istream & is,       HepAxisAngle & aa );
0032 
0033 /**
0034  * @author
0035  * @ingroup vector
0036  */
0037 class HepAxisAngle {
0038 
0039 public:
0040   typedef double Scalar;
0041 
0042 protected:
0043   typedef HepAxisAngle AA;         // just an abbreviation
0044   static Scalar tolerance;      // to determine relative nearness
0045 
0046 public:
0047 
0048   // ----------  Constructors:
0049   inline HepAxisAngle();
0050   inline HepAxisAngle( const Hep3Vector axis, Scalar delta );
0051 
0052   // ----------  Destructor, copy constructor, assignment:
0053   // use C++ defaults
0054 
0055   // ----------  Accessors:
0056 
0057 public:
0058   inline Hep3Vector            getAxis() const;
0059   inline Hep3Vector            axis() const;
0060   inline AA &                  setAxis( const Hep3Vector axis );
0061 
0062   inline double             getDelta() const;
0063   inline double             delta() const ;
0064   inline AA &                  setDelta( Scalar delta );
0065 
0066   inline AA & set( const Hep3Vector axis, Scalar delta );
0067 
0068   // ----------  Operations:
0069 
0070   //   comparisons:
0071   inline int  compare   ( const AA & aa ) const;
0072 
0073   inline bool operator==( const AA & aa ) const;
0074   inline bool operator!=( const AA & aa ) const;
0075   inline bool operator< ( const AA & aa ) const;
0076   inline bool operator<=( const AA & aa ) const;
0077   inline bool operator> ( const AA & aa ) const;
0078   inline bool operator>=( const AA & aa ) const;
0079 
0080   //   relative comparison:
0081   inline static double getTolerance();
0082   inline static double setTolerance( Scalar tol );
0083 
0084 protected:
0085     double distance( const HepAxisAngle & aa ) const;
0086 public:
0087 
0088   bool isNear ( const AA & aa, Scalar epsilon = tolerance ) const;
0089   double  howNear( const AA & aa ) const;
0090 
0091   // ----------  I/O:
0092 
0093   friend std::ostream & operator<<( std::ostream & os, const AA & aa );
0094   friend std::istream & operator>>( std::istream & is,       AA & aa );
0095 
0096 private:
0097   Hep3Vector axis_;  // Note:  After construction, this is always of mag 1
0098   double  delta_;
0099 
0100 };  // HepAxisAngle
0101 
0102 
0103 }  // namespace CLHEP
0104 
0105 
0106 namespace zmpv  {
0107 
0108   typedef CLHEP::HepAxisAngle AxisAngle;
0109 
0110 }  // namespace zmpv
0111 
0112 
0113 #define AXISANGLE_ICC
0114 #include "CLHEP/Vector/AxisAngle.icc"
0115 #undef AXISANGLE_ICC
0116 
0117 #ifdef ENABLE_BACKWARDS_COMPATIBILITY
0118 //  backwards compatibility will be enabled ONLY in CLHEP 1.9
0119 using namespace CLHEP;
0120 #endif
0121 
0122 #endif  // HEP_AXISANGLE_H