src/IntRank2/IntCSA.cc
/* Shift anisotropy interactions are field dependent. That is, their strength
   directly results from an externally applied magnetic field. The stronger
   the field the stronger the interaction. However, our interaction does NOT
   store the magnetic field strength. Rather, it stores a spin Larmor frequency
   because the Larmor frequency combines the field strength with the spin
   gyromagnetic ratio. Such a combination is needed because both the field and
   gyromagnetic ratio are needed to properly scale the interaction. Because we
   only know the interaction spin quantum number we have no intrinsic knowledge
   of any gyromagnetic ratio. We cannot convert between field and frequency
   without it. So, we track the Larmor frequency and spin quantum number rather
   than the field and the gyromagnetic ratio (and the spin quantum number).

   We can use the field strength and gyromagnetic ratio to set our Larmor
   frequency. That is done from the parameters "Iso" and "Field". Alternatively
   we can just set the Larmor frequency directly with the parameter "Omega".
   If we know the isotope type we will allow useage of "Field" to set the
   Larmor frequency. Else, we will look for "Omega" directly.

  	   Input		SA	: CSA interaction (this)
                                pset    : A parameter set
                                idx     : Index value
                                warn    : Warning output flag
           Output               Om 	: Spin Larmor frequency (MHz)
                                          from parameters in pset
           Note                         : Does NOT alter the interaction
	   Note				: Parameters are CSA, CSA(#)         */
Shift anisotropy interactions are field dependent. That is, their strength
directly results from an externally applied magnetic field. The stronger
the field the stronger the interaction. However, our interaction does NOT
store the magnetic field strength. Rather, it stores a spin Larmor frequency
because the Larmor frequency combines the field strength with the spin
gyromagnetic ratio. Such a combination is needed because both the field and
gyromagnetic ratio are needed to properly scale the interaction. Because we
only know the interaction spin quantum number we have no intrinsic knowledge
of any gyromagnetic ratio. We cannot convert between field and frequency
without it. So, we track the Larmor frequency and spin quantum number rather
than the field and the gyromagnetic ratio (and the spin quantum number).

We can use the field strength and gyromagnetic ratio to set our Larmor
frequency. That is done from the parameters "Iso" and "Field". Alternatively
we can just set the Larmor frequency directly with the parameter "Omega".
If we know the isotope type we will allow useage of "Field" to set the
Larmor frequency. Else, we will look for "Omega" directly.


Shift anisotropy interactions are field dependent . That is their strength directly results from an externally applied magnetic field . The stronger the field the stronger the interaction . However our interaction does NOT store the magnetic field strength . Rather it stores a spin Larmor frequency because the Larmor frequency combines the field strength with the spin gyromagnetic ratio . Such a combination is needed because both the field and gyromagnetic ratio are needed to properly scale the interaction . Because we only know the interaction spin quantum number we have no intrinsic knowledge of any gyromagnetic ratio . We cannot convert between field and frequency without it . So we track the Larmor frequency and spin quantum number rather than the field and the gyromagnetic ratio ( and the spin quantum number ) . We can use the field strength and gyromagnetic ratio to set our Larmor frequency . That is done from the parameters " Iso " and " Field " . Alternatively we can just set the Larmor frequency directly with the parameter " Omega " . If we know the isotope type we will allow useage of " Field " to set the Larmor frequency . Else we will look for " Omega " directly .
bool IntCSA::getOm(const ParameterSet& pset,
                       double& Om, const string& II, int idx, bool warn) const
  {
  double Bo;					
  string pnb("S");				
  if(getField(pset,pnb,Bo,idx,false))		
    {						
    Om = Bo*GAMMA1H*1.e-6/HZ2RAD;		
    return true;
    }
  else if(getField(pset,"",Bo,-1,false))	
    {						
    Om = Bo*GAMMA1H*1.e-6/HZ2RAD;		
    return true;
    }
  else if(getOmega(pset,pnb,Om,idx,false))	
    { 						
    return true;
    }
  else if(getOmega(pset,"",Om,-1,false))	
    {						
    Om *= Isotope(II).gamma()/GAMMA1H;		
    return true;
    }
  else if(getGOmega(pset,"",Om,-1,false))	
    {						
    Isotope E("e-"); 				
    Om = Isotope(II).gamma()/fabs(E.gamma());
    Om *= 1.e3;
    return true;
    }
  Om = 0.0;
  return false;					
  }
bool IntCSA :: getOm ( const ParameterSet & pset , double & Om , const string & II , int idx , bool warn ) const { double Bo ; string pnb ( " " ) ; if ( getField ( pset , pnb , Bo , idx , false ) ) { Om = Bo * GAMMA1H * 1.e-6 / HZ2RAD ; return true ; } else if ( getField ( pset , " " , Bo , -1 , false ) ) { Om = Bo * GAMMA1H * 1.e-6 / HZ2RAD ; return true ; } else if ( getOmega ( pset , pnb , Om , idx , false ) ) { return true ; } else if ( getOmega ( pset , " " , Om , -1 , false ) ) { Om *= Isotope ( II ) . gamma ( ) / GAMMA1H ; return true ; } else if ( getGOmega ( pset , " " , Om , -1 , false ) ) { Isotope E ( " " ) ; Om = Isotope ( II ) . gamma ( ) / fabs ( E . gamma ( ) ) ; Om *= 1.e3 ; return true ; } Om = 0.0 ; return false ; }
Shift anisotropy interactions are field dependent.
Shift anisotropy interactions are field dependent .
// For field strength // Parameter base name // If field (SField, SFieldT) // we convert to our Larmor // frequency (Gauss -> MHz) // If field (Field, FieldT) // we convert to our Larmor // frequency (Gauss -> MHz) // If freq. (SOmega) specified // it is our Larmor frequency // If freq. (Omega) specified // it is for 1H, our Larmor is // scaled from proton Larmor // If freq. (GOmega) specified // it is for e-, our Larmor is // scaled from electron freq. // We cannot find any Larmor