![]() |
HepPDT Reference DocumentationHepPDT |
00001 // ---------------------------------------------------------------------- 00002 // 00003 // SpinState.icc 00004 // 00005 // ---------------------------------------------------------------------- 00006 00007 #include <algorithm> // swap() 00008 00009 namespace HepPDT { 00010 00011 SpinState::SpinState( double ts, double spin, double oam ) 00012 : itsTotalSpin ( ts ), 00013 itsSpin ( spin ), 00014 itsOrbAngMom ( oam ) 00015 { ; } 00016 00017 SpinState::SpinState( const SpinState & orig ) 00018 : itsTotalSpin ( orig.itsTotalSpin ), 00019 itsSpin ( orig.itsSpin ), 00020 itsOrbAngMom ( orig.itsOrbAngMom ) 00021 { ; } 00022 00023 SpinState& SpinState::operator=( const SpinState & rhs ) 00024 { 00025 SpinState temp( rhs ); 00026 swap( temp ); 00027 return *this; 00028 } 00029 00030 void SpinState::swap( SpinState & other ) { 00031 std::swap( itsTotalSpin, other.itsTotalSpin ); 00032 std::swap( itsSpin , other.itsSpin ); 00033 std::swap( itsOrbAngMom, other.itsOrbAngMom ); 00034 } 00035 00036 bool SpinState::operator==( const SpinState & rhs ) const 00037 { 00038 if( (itsTotalSpin==rhs.itsTotalSpin) && (itsSpin==rhs.itsSpin) && 00039 (itsOrbAngMom==rhs.itsOrbAngMom) ) { 00040 return true; 00041 } else { 00042 return false; 00043 } 00044 } 00045 00046 } // HepPDT