src/IntRank2/IntCSA.cc
/* These functions will try and get all the parameters required to define a
   shift anisotropy interaction: { Iqn,PPM,CSA,eta,alpha,beta,gamma }. We 
   also see if we can figure out the spin Larmor frequency (which is akin
   to knowing the static magnetic field). To support CSA interactions in spin
   systems, which typically know spin isotope types and their spin quantum
   numbers, there is a separation between determining the spin quantum 
   number and the rest of the interaction.                                   */
These functions will try and get all the parameters required to define a
shift anisotropy interaction: { Iqn,PPM,CSA,eta,alpha,beta,gamma }. We
also see if we can figure out the spin Larmor frequency (which is akin
to knowing the static magnetic field). To support CSA interactions in spin
systems, which typically know spin isotope types and their spin quantum
numbers, there is a separation between determining the spin quantum
number and the rest of the interaction.
These functions will try and get all the parameters required to define a shift anisotropy interaction : { Iqn PPM CSA eta alpha beta gamma } . We also see if we can figure out the spin Larmor frequency ( which is akin to knowing the static magnetic field ) . To support CSA interactions in spin systems which typically know spin isotope types and their spin quantum numbers there is a separation between determining the spin quantum number and the rest of the interaction .
bool IntCSA::getCI(const ParameterSet& pset,
         double& Iqn, double& ppm, double& csa, double& eta, EAngles& EA,
                                         double& Om, int idx, bool warn) const
  {
  string pb("Iqn");				
  string II; 					
  Isotope ISI; 					
  bool TFI = false;                             
  if(getIso(pset,II,idx,0))			
    {                                           
    if(!SpinCheck(II)) return false;		
    ISI = Isotope(II);                          
    if(!SpinCheck(ISI,false,0)) return false;	
    TFI = true;                                 
    Iqn = ISI.qn();                             
    }
  else
    {
    if(getIqn(pset,pb,Iqn,idx,false))		
      { if(!SpinCheck(Iqn)) return false; }	
    else Iqn = 0.5;  				
    }
  if(TFI) getOm(pset,Om,II,idx,0);		
  else    getOmega(pset,"S",Om,idx,0);		
  coord SiSzSe;                                 
  if(getACart(pset,"S",SiSzSe,EA,idx,-1,0))	
    {
    ppm = SiSzSe.x();				
    csa = 1.5*SiSzSe.y();			
    eta = SiSzSe.z();                           
    return true;
    }
  string Pbase("S");				
  if(getPPM(pset, ppm, idx, Om, false))		
    {                                           
    getCSA(pset, csa, idx, false);		
    getAeta(pset, Pbase, eta, idx, -1, false);	
    getOrientation(pset,Pbase,EA,idx,-1,false);	
    return true;
    }
  if(getCSA(pset, csa, idx, false))		
    {						
    ppm = 0;					
    getAeta(pset, Pbase, eta, idx,-1,false);	
    getOrientation(pset,Pbase,EA,idx,-1,false);	
    return true;
    }
  if(warn)					
    {						
    ICerror(50, 1);				
    ICerror(51, 1);				
    }
  return false;
  }
bool IntCSA :: getCI ( const ParameterSet & pset , double & Iqn , double & ppm , double & csa , double & eta , EAngles & EA , double & Om , int idx , bool warn ) const { string pb ( " " ) ; string II ; Isotope ISI ; bool TFI = false ; if ( getIso ( pset , II , idx , 0 ) ) { if ( ! SpinCheck ( II ) ) return false ; ISI = Isotope ( II ) ; if ( ! SpinCheck ( ISI , false , 0 ) ) return false ; TFI = true ; Iqn = ISI . qn ( ) ; } else { if ( getIqn ( pset , pb , Iqn , idx , false ) ) { if ( ! SpinCheck ( Iqn ) ) return false ; } else Iqn = 0.5 ; } if ( TFI ) getOm ( pset , Om , II , idx , 0 ) ; else getOmega ( pset , " " , Om , idx , 0 ) ; coord SiSzSe ; if ( getACart ( pset , " " , SiSzSe , EA , idx , -1 , 0 ) ) { ppm = SiSzSe . x ( ) ; csa = 1.5 * SiSzSe . y ( ) ; eta = SiSzSe . z ( ) ; return true ; } string Pbase ( " " ) ; if ( getPPM ( pset , ppm , idx , Om , false ) ) { getCSA ( pset , csa , idx , false ) ; getAeta ( pset , Pbase , eta , idx , -1 , false ) ; getOrientation ( pset , Pbase , EA , idx , -1 , false ) ; return true ; } if ( getCSA ( pset , csa , idx , false ) ) { ppm = 0 ; getAeta ( pset , Pbase , eta , idx , -1 , false ) ; getOrientation ( pset , Pbase , EA , idx , -1 , false ) ; return true ; } if ( warn ) { ICerror ( 50 , 1 ) ; ICerror ( 51 , 1 ) ; } return false ; }
These functions will try and get all the parameters required to define a
shift anisotropy interaction: { Iqn,PPM,CSA,eta,alpha,beta,gamma }.
These functions will try and get all the parameters required to define a shift anisotropy interaction : { Iqn PPM CSA eta alpha beta gamma } .
//                      Get The Spin Quantum Number //                    (And Perhaps The Isotope Type) // Parameter base name // String for isotope name // Isotope for spin // Flag if we know isotope // 1. Try for isotope name //    If successful, check it //    Insure valid isotope //    An isotope of type II //    Disallow electron spin //    We know the isotope //    Know spin I quantum # // 2. Try for spin quant. # //    Insure valid  qn // 3. Use default qn of 1/2 //                      Get The Spin Larmor Frequency //     Not Mandatory! If Shift Specified In Hz We Will Need It Though // If we know isotope type // If we dont know isotope // Try To Directly Read Shift Anisotropy Cartesian Spatial Tensor Components //        Interaction Via { Iqn, Sxx, Sxy, Sxz, Syy, Syz, Szz } //  1.) Suv values set the shift, anisotropy & asymmetry: {SISO, SCSA, ETA}  //  2.) If any Suv off-diagonals (u != v) set, S array sets orientation also //  3.) If no Suv off-diagonals, orientation set with specified Euler angles //  4.) The input Suv values are taken to be in PPM //  5.) We don't mind that no orientation is set, default is PAS //  6.) If used, Euler angles by either a set or 3 individual angles // For Siso, Szz, Seta // Try & use Cart. components //  Set the shift value  //  Set the anisotropy value //  Set the eta value //      Try To Directly Read Shift, Anisotropy, Asymmetry, & Orientation //             Interaction Via { Iqn, PPM, CSA, Seta, SEAngles } //  1.) If PPM has been specified, these parameters will be used //  2.) If we know the Larmor frequency (field strength) v can also be used //  3.) We don't mind that eta is not set, default will be zero //  4.) Iqn & Sqn were set in the 1st section of this function //  5.) We don't mind that no orientation is set, default is PAS //  6.) Orientation set with either an Euler angle set or 3 individual angles // Base for parameter names // If PPM has been specified // look for CSA, eta, orient //   Try for anisotropy //   Try for asymmetry //   Try for orientation //   Try for anisotropy //   (when no PPM set) //   No isotropic shift //   Try for asymmetry //   Try for orientation // Try as we might, cannot get // interaction from parameters  // Can't set from parameters // Parameter set insufficient