Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-30 10:11:34

0001 // ----------------------------------------------------------------------
0002 //
0003 // SpinState.icc
0004 //
0005 // ----------------------------------------------------------------------
0006 
0007 #include <algorithm>  // swap()
0008 
0009 namespace HepPDT {
0010 
0011 SpinState::SpinState( double ts, double spin, double oam )
0012 : itsTotalSpin ( ts ), 
0013   itsSpin      ( spin ),
0014   itsOrbAngMom ( oam )
0015 { ; }
0016 
0017 SpinState::SpinState( const SpinState & orig )
0018 : itsTotalSpin  ( orig.itsTotalSpin ), 
0019   itsSpin       ( orig.itsSpin ),
0020   itsOrbAngMom  ( orig.itsOrbAngMom )
0021 { ; }
0022 
0023 SpinState& SpinState::operator=( const SpinState & rhs )
0024 { 
0025   SpinState temp( rhs );
0026   swap( temp );
0027   return *this;
0028 }
0029 
0030 void SpinState::swap( SpinState & other )  {
0031   std::swap( itsTotalSpin, other.itsTotalSpin );
0032   std::swap( itsSpin     , other.itsSpin );
0033   std::swap( itsOrbAngMom, other.itsOrbAngMom );
0034 }
0035 
0036 bool SpinState::operator==( const SpinState & rhs ) const
0037 { 
0038   if( (itsTotalSpin==rhs.itsTotalSpin) && (itsSpin==rhs.itsSpin) &&
0039       (itsOrbAngMom==rhs.itsOrbAngMom) ) {
0040      return true;
0041   } else {
0042      return false;
0043   }
0044 }
0045 
0046 }   // HepPDT