src/IntRank2/IntG.cc
/* These functions will try and get all the parameters required to define an
   electron G interaction: { Iqn, g, gA, eta, alpha, beta, gamma }. We will
   also see if we can figure out the external magnetic field strength (which is
   akin to knowing the base EPR frequency). To support G 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 an
electron G interaction: { Iqn, g, gA, eta, alpha, beta, gamma }. We will
also see if we can figure out the external magnetic field strength (which is
akin to knowing the base EPR frequency). To support G 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 an electron G interaction : { Iqn g gA eta alpha beta gamma } . We will also see if we can figure out the external magnetic field strength ( which is akin to knowing the base EPR frequency ) . To support G 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 IntG::getGI(const ParameterSet& pset,
         double& Iqn, double& g, double& gA, double& eta, EAngles& EA,
                                         double& Bo, 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,true,warn)) return false;	
    TFI = true;                                 
    Iqn = ISI.qn();                             
    }
  else
    {
    if(getIqn(pset,pb,Iqn,idx,false))           
      { if(!SpinCheck(Iqn)) return false; }     
    else Iqn = 0.5;                             
    }
    getField(pset, Bo, idx, 0);
  coord GiGzGe;                                 
  if(getACart(pset,"G",GiGzGe,EA,idx,-1,0))     
    {
    g   = GiGzGe.x();				
    gA  = GiGzGe.y();				
    eta = GiGzGe.z();                           
    if(EA == EAzero)				
      getOrientation(pset,"g",EA,idx,-1,false); 
    return true;
    }
  if(getACart(pset,"g",GiGzGe,EA,idx,-1,0))     
    {
    g   = GiGzGe.x();				
    gA  = GiGzGe.y();				
    eta = GiGzGe.z();                           
    if(EA == EAzero)				
      getOrientation(pset,"G",EA,idx,-1,false); 
    return true;
    }
  string Pbase1("G");				
  string Pbase2("g");				
  if(getGIso(pset, g, idx, false)) 		
    {						
    getGA(pset, gA, idx, false);		
    if(!getAeta(pset,"g",eta,idx,-1,false))	
        getAeta(pset,"G",eta,idx,-1,false); 	
    if(!getOrientation(pset,"g",EA,idx,-1,false))
        getOrientation(pset,"G",EA,idx,-1,false);
    return true;				
    }						
/*
  if(getCSA(pset, csa, idx, false))             
    {                                           //   (when no PPM set)
    ppm = 0;                                    //   No isotropic shift
    getAeta(pset, Pbase, eta, idx,-1,false);    
    getOrientation(pset,Pbase,EA,idx,-1,false); //   Try for orientation
    return true;
    }
*/
 if(warn)                                      
   IGerror(60, 1);                             
 return false;
 }
bool IntG :: getGI ( const ParameterSet & pset , double & Iqn , double & g , double & gA , double & eta , EAngles & EA , double & Bo , 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 , true , warn ) ) return false ; TFI = true ; Iqn = ISI . qn ( ) ; } else { if ( getIqn ( pset , pb , Iqn , idx , false ) ) { if ( ! SpinCheck ( Iqn ) ) return false ; } else Iqn = 0.5 ; } getField ( pset , Bo , idx , 0 ) ; coord GiGzGe ; if ( getACart ( pset , " " , GiGzGe , EA , idx , -1 , 0 ) ) { g = GiGzGe . x ( ) ; gA = GiGzGe . y ( ) ; eta = GiGzGe . z ( ) ; if ( EA == EAzero ) getOrientation ( pset , " " , EA , idx , -1 , false ) ; return true ; } if ( getACart ( pset , " " , GiGzGe , EA , idx , -1 , 0 ) ) { g = GiGzGe . x ( ) ; gA = GiGzGe . y ( ) ; eta = GiGzGe . z ( ) ; if ( EA == EAzero ) getOrientation ( pset , " " , EA , idx , -1 , false ) ; return true ; } string Pbase1 ( " " ) ; string Pbase2 ( " " ) ; if ( getGIso ( pset , g , idx , false ) ) { getGA ( pset , gA , idx , false ) ; if ( ! getAeta ( pset , " " , eta , idx , -1 , false ) ) getAeta ( pset , " " , eta , idx , -1 , false ) ; if ( ! getOrientation ( pset , " " , EA , idx , -1 , false ) ) getOrientation ( pset , " " , EA , idx , -1 , false ) ; return true ; } if ( warn ) IGerror ( 60 , 1 ) ; return false ; }
These functions will try and get all the parameters required to define an
electron G interaction: { Iqn, g, gA, eta, alpha, beta, gamma }.
These functions will try and get all the parameters required to define an electron G interaction : { Iqn g gA 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 nuclear 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 External Field Strength //                               Not Mandatory! // Try To Directly Read Electron G Cartesian Spatial Tensor Components //        Interaction Via { Iqn, Gxx, Gxy, Gxz, Gyy, Gyz, Gzz } //  1.) Guv values set the g-factor, anisotropy & asymmetry: {GISO, DELZ, ETA} //  2.) If any Guv off-diagonals (u != v) set, G array sets orientation also //  3.) If no Guv off-diagonals, orientation set with specified Euler angles //  4.) The input Guv values are taken to be unitless //  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 //  7.) Cannot mix parameters with g and G for this read // For Giso, Gzz, Geta // Try & use Cart. components //  Set the g factor //  Set the delzz value //  Set the eta value //  Allow use of g with G //  in parameter names // Try & use Cart. components //  Set the g factor //  Set the delzz value //  Set the eta value //  Allow use of g with G //  in parameter names //    Try To Directly Read g-Factor , Anisotropy, Asymmetry, & Orientation //                Interaction Via { Iqn, g, gA, Geta, GEAngles } //  1.) If g or G has been specified, these parameters will be used //  2.) We don't mind that eta is not set, default will be zero //  3.) The spin quantum number Iqn was set earlier in this function //  4.) We don't mind that no orientation is set, default is PAS //  5.) Orientation set with either an Euler angle set or 3 individual angles //  6.) Can mix parameters with g and G for this read // Base for parameter names // Another base name // If g-factor specified // look for gA, eta, orient //   Try for anisotropy //   Try for asymmetry //   using Geta or geta //  Try for orientation //  using GEAngles or //   gEAngles or [G/g]alpha //   etc. etc. /*
  if(getCSA(pset, csa, idx, false))             //   Try for anisotropy
    {                                           //   (when no PPM set)
    ppm = 0;                                    //   No isotropic shift
    getAeta(pset, Pbase, eta, idx,-1,false);    //   Try for asymmetry
    getOrientation(pset,Pbase,EA,idx,-1,false); //   Try for orientation
    return true;
    }
*/ // Try as we might, cannot get // can't set from parameters