00001
00002 #ifndef HEPMC_POLARIZATION_H
00003 #define HEPMC_POLARIZATION_H
00004
00006
00007
00008
00009
00010
00012
00013 #include "CLHEP/Geometry/Normal3D.h"
00014 #include "CLHEP/Units/PhysicalConstants.h"
00015 #include "CLHEP/config/CLHEP.h"
00016 #include "CLHEP/config/iostream.h"
00017
00018 namespace HepMC {
00019
00020 static const double HepMC_pi = pi;
00021
00026 class Polarization {
00027
00028 friend std::ostream& operator<<( std::ostream&, const Polarization& );
00029
00030 public:
00031 Polarization( double theta = 0, double phi = 0 );
00032 Polarization( const Polarization& inpolar );
00033 Polarization( const HepNormal3D& vec3in );
00034 virtual ~Polarization() {}
00035
00036 Polarization& operator=( const Polarization& inpolar );
00037 bool operator==( const Polarization& ) const;
00038 bool operator!=( const Polarization& ) const;
00039
00040 void print( std::ostream& ostr = std::cout ) const;
00041
00043
00045
00046 double phi() const;
00047 HepNormal3D normal3d() const;
00048
00049 double set_theta( double theta );
00050 double set_phi( double phi );
00051 void set_theta_phi( double theta, double phi );
00052
00053 HepNormal3D set_normal3d( const HepNormal3D& vec3in );
00054
00055 private:
00056 double m_theta;
00057 double m_phi;
00058 };
00059
00061
00063
00064 inline double Polarization::theta() const { return m_theta; }
00065 inline double Polarization::phi() const { return m_phi; }
00066
00068
00070
00071 inline bool Polarization::operator==( const Polarization& a ) const
00072 {
00073 return ( a.theta() == this->theta() && a.phi() == this->phi() );
00074 }
00075
00076 inline bool Polarization::operator!=(const Polarization& a ) const
00077 {
00078 return !( a == *this );
00079 }
00080
00081 }
00082
00083 #endif // HEPMC_POLARIZATION_H
00084