src/IntRank2/IntRank2.cc
/* These may be required for setting up field dependent interactions such
   as shift anisotropy and electron G interactions. The field is returned in
   Gauss and the only two parameters are Field and FieldT. The Larmor frequency
   (NMR) is specified by the lone parameter Omega which will be in MHz. The
   base frequency (EPR) is specified by the lone parameter GOmega which will
   be in in GHz. 

   Allowance are made so that all of thesse parameters can take a single 
   index, but normally they should not have one.                            */
These may be required for setting up field dependent interactions such
as shift anisotropy and electron G interactions. The field is returned in
Gauss and the only two parameters are Field and FieldT. The Larmor frequency
(NMR) is specified by the lone parameter Omega which will be in MHz. The
base frequency (EPR) is specified by the lone parameter GOmega which will
be in in GHz.

Allowance are made so that all of thesse parameters can take a single
index, but normally they should not have one.
These may be required for setting up field dependent interactions such as shift anisotropy and electron G interactions . The field is returned in Gauss and the only two parameters are Field and FieldT . The Larmor frequency ( NMR ) is specified by the lone parameter Omega which will be in MHz . The base frequency ( EPR ) is specified by the lone parameter GOmega which will be in in GHz . Allowance are made so that all of thesse parameters can take a single index but normally they should not have one .
bool IntRank2::getField(const ParameterSet& pset, const string& A,
                                         double& Bo, int idx, bool warn) const
  {
  Bo = 0;					
  string pstate; 	                        
  ParameterSet::const_iterator item;         
  string Nidx = "";                             
  if(idx >= 0) Nidx                             
    += string("(") + Gdec(idx) + string(")");	
  string pname = A + "Field" + Nidx;		
  item = pset.seek(pname);                      
  if(item != pset.end())                        
    {                                           
    (*item).parse(pname,Bo,pstate);		
    Bo = fabs(Bo);				
    return true;                                
    }
  string pname2 = A + "FieldT" + Nidx; 		
  item = pset.seek(pname2);			T
  if(item != pset.end())                        
    {                                           
    (*item).parse(pname2,Bo,pstate);		
    Bo *= 1.e4;					
    Bo = fabs(Bo);				
    return true;                                
    }
  if(warn)                                      
    { 						
    IR2error(111, pname, 1);			
    IR2error(40, 1);				
    }
  return false;
  }
bool IntRank2 :: getField ( const ParameterSet & pset , const string & A , double & Bo , int idx , bool warn ) const { Bo = 0 ; string pstate ; ParameterSet :: const_iterator item ; string Nidx = " " ; if ( idx >= 0 ) Nidx += string ( " " ) + Gdec ( idx ) + string ( " " ) ; string pname = A + " " + Nidx ; item = pset . seek ( pname ) ; if ( item != pset . end ( ) ) { ( * item ) . parse ( pname , Bo , pstate ) ; Bo = fabs ( Bo ) ; return true ; } string pname2 = A + " " + Nidx ; item = pset . seek ( pname2 ) ; if ( item != pset . end ( ) ) { ( * item ) . parse ( pname2 , Bo , pstate ) ; Bo *= 1.e4 ; Bo = fabs ( Bo ) ; return true ; } if ( warn ) { IR2error ( 111 , pname , 1 ) ; IR2error ( 40 , 1 ) ; } return false ; }
These may be required for setting up field dependent interactions such
as shift anisotropy and electron G interactions.
These may be required for setting up field dependent interactions such as shift anisotropy and electron G interactions .
// Default field strength // Temp string for parsing // A pix into parameter list // Name addition per index // If index exists then set up // the parameter name to append // Try for field strength (G) // Pix in param. list for Field // If Field has been defined // we'll parse the info and // set field appropriately // (this is in Gauss) // Exit, we found Field // Maybe field set in Tesla? // Pix in param. list for FieldT // If Field has been defined // we'll parse the info and // set field appropriately // (stored in Gauss) // Must be positive // Exit, we found Field // If it hasn't been found // issue warnings if needed //   Can't parse "Field" //   Can't set external field