src/HSLib/SpinSystem.cc
// Input                ssys    : A spin system (this)
//                      pset    : A parameter set
// Output               none    : Spin system isotropic g-factors
//                                are set from parameters in pset
//				: A field strength must have been
//				  specified before this function
Input                ssys    : A spin system (this)
pset    : A parameter set
Output               none    : Spin system isotropic g-factors
are set from parameters in pset
: A field strength must have been
specified before this function
Input ssys : A spin system ( this ) pset : A parameter set Output none : Spin system isotropic g - factors are set from parameters in pset : A field strength must have been specified before this function
void spin_system::setGs(const ParameterSet& pset)
  {
  int ns = spins();			
  int notfound = 0;			
  std::string* NoGSet;
  NoGSet = new std::string[ns];			
  std::string pname, pstate;			
  double dval;
  std::string Gst = "g(", Gfi = ")";		
  SinglePar par;			
  ParameterSet::const_iterator item;	
  int i,j;
  for(i=0; i<ns; i++)			
    { 					
    if(electron(i))			
      {
      pname = Gst + Gdec(i) + Gfi; 	
      item = pset.seek(pname);		
      if(item != pset.end())		
        {
        (*item).parse(pname,dval,pstate);
        gfacts[i] = dval;		
        }
      else
        {
        NoGSet[i] = pname;		
        notfound++;			
        gfacts[i] = GFREE;		
        }
      }
    else gfacts[i] = 0;			
    }
  if(notfound)
    {
    for(i=0,j=0; i<notfound; i++,j++)	
      {					
      if(!j) SYSTerror(107,NoGSet[i],1);
      else
        {
        std::cout << "; " << NoGSet[i];
        if(j>=4) j=0;
        }
      }
    SYSTerror(21);			
    }
  delete [] NoGSet;
  }
void spin_system :: setGs ( const ParameterSet & pset ) { int ns = spins ( ) ; int notfound = 0 ; std :: string * NoGSet ; NoGSet = new std :: string [ ns ] ; std :: string pname , pstate ; double dval ; std :: string Gst = " " , Gfi = " " ; SinglePar par ; ParameterSet :: const_iterator item ; int i , j ; for ( i = 0 ; i < ns ; i ++ ) { if ( electron ( i ) ) { pname = Gst + Gdec ( i ) + Gfi ; item = pset . seek ( pname ) ; if ( item != pset . end ( ) ) { ( * item ) . parse ( pname , dval , pstate ) ; gfacts [ i ] = dval ; } else { NoGSet [ i ] = pname ; notfound ++ ; gfacts [ i ] = GFREE ; } } else gfacts [ i ] = 0 ; } if ( notfound ) { for ( i = 0 , j = 0 ; i < notfound ; i ++ , j ++ ) { if ( ! j ) SYSTerror ( 107 , NoGSet [ i ] , 1 ) ; else { std :: cout << " " << NoGSet [ i ] ; if ( j >= 4 ) j = 0 ; } } SYSTerror ( 21 ) ; } delete [ ] NoGSet ; }
Input                ssys    : A spin system (this)
pset    : A parameter set
Output               none    : Spin system isotropic g-factors
are set from parameters in pset
: A field strength must have been
specified before this function
Input ssys : A spin system ( this ) pset : A parameter set Output none : Spin system isotropic g - factors are set from parameters in pset : A field strength must have been specified before this function
// Number of spins // Number of g-factors not found // string of g factors not found // For parameter name and statement // Start/finish g-factor param. names // Working single parameter // A pix into parameter list // Attempt to retrieve the // g-factors (unitless) // Look for g only if e- // Parameter name for g of spin i // Pix in parameter list for g(i) // Retrieve the number of spins // Set g-factor (unitless) // Store parameter not found // Count parameter not found // Set default g value // Set nuclear g-factors 0 // Loop over g factors not set // and issue warnings // (five G labels per line) // Warning, Unspecified Gs set