Back to home page

EIC code displayed by LXR

 
 

    


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

0001 // ----------------------------------------------------------------------
0002 //
0003 // SpinState.hh
0004 // Author:  Lynn Garren
0005 //
0006 // ----------------------------------------------------------------------
0007 #ifndef SPINSTATE_HH
0008 #define SPINSTATE_HH
0009 
0010 namespace HepPDT {
0011 
0012 //! The SpinState class holds spin information
0013 
0014 ///
0015 /// \class SpinState
0016 /// \author Lynn Garren
0017 ///
0018 /// SpinState contains total spin, spin, and orbital angular momentum.
0019 ///
0020 class SpinState  {
0021 
0022 public:
0023 
0024   // ---  birth/death:
0025   //
0026   /// (default) constructor
0027   inline SpinState( double ts = 0., double spin = 0., double oam =0. );
0028 
0029   // ---  copying:
0030   //
0031   inline SpinState( const SpinState & orig );
0032   inline SpinState& operator = ( const SpinState & rhs );
0033   inline void swap( SpinState & other );
0034 
0035   // ---  booleans:
0036   //
0037   /// all three spins must match
0038   inline bool  operator == ( const SpinState & rhs ) const;
0039 
0040   // ---  accessors:
0041   //
0042   /// return the total spin
0043   double totalSpin()     const {  return itsTotalSpin; }
0044   /// return the spin
0045   double spin()          const {  return itsSpin; }
0046   /// return the orbital angular momentum
0047   double orbAngMom()     const {  return itsOrbAngMom; }
0048 
0049   // ---  mutators:
0050   //
0051   /// change the total spin
0052   void  setTotalSpin( double spin )  {  itsTotalSpin = spin; }
0053   /// change the spin
0054   void  setSpin( double spin )       {  itsSpin = spin; }
0055   /// change the orbital angular momentum
0056   void  setOrbAngMom( double ang )   {  itsOrbAngMom = ang; }
0057   
0058 private:
0059 
0060   // ---  class-specific data:
0061   //
0062   double  itsTotalSpin;
0063   double  itsSpin;
0064   double  itsOrbAngMom;
0065 
0066 };  // SpinState
0067 
0068 inline
0069 void swap( SpinState & first,SpinState & second )  { first.swap( second ); }
0070 
0071 }   // HepPDT
0072 
0073 #include "HepPDT/SpinState.icc"
0074 
0075 #endif // SPINSTATE_HH