src/Level1/Lorentzian.cc
// Switching the order of wst & wfi switches the sign on the imaginary
// component! Units on R, wo, wst, and wfi must all match up, normally 1/sec.
// Mathematical details of this are give at the end of the header file.
Switching the order of wst & wfi switches the sign on the imaginary
component. Units on R, wo, wst, and wfi must all match up, normally 1/sec.
Mathematical details of this are give at the end of the header file.
Switching the order of wst & wfi switches the sign on the imaginary component . Units on R wo wst and wfi must all match up normally 1 / sec . Mathematical details of this are give at the end of the header file .
void Lorentz_cut(int& ilo, int& ihi, double R, double W,
                        double w0, double winc, int npts, double cutoff)
 {
 if(cutoff>1.0 || cutoff<1.e-10)		
   cutoff = 1.e-4;				
 double mod = R*sqrt(1.0/(cutoff*cutoff)-1.0);	
 double delw = W-w0;				
 double w1 = (1/winc)*(delw + mod);		
 double w2 = (1/winc)*(delw - mod);		
 if(w1 > w2)					
   {
   if(w2 <= 0) w2 = 0;				
   else if(w2>npts) w2=npts+1;			
   else w2 -= 1;				
   if(w1 <= 0) w1 = 0;				
   else if(w1>npts) w1=npts+1;			
   else w1 += 1;				
   ilo = int(w2);				
   ihi = int(w1);				
   }
 else
   {
   if(w1 <= 0) w1 = 0;				
   else if(w1>npts) w1=npts+1;			
   else w1 -= 1;				
   if(w2 <= 0) w2 = 0;				
   else if(w2>npts) w2=npts+1;			
   else w2 += 1;				
   ilo = int(w1);				
   ihi = int(w2);				
   }
 return;
 }
void Lorentz_cut ( int & ilo , int & ihi , double R , double W , double w0 , double winc , int npts , double cutoff ) { if ( cutoff > 1.0 || cutoff < 1.e-10 ) cutoff = 1.e-4 ; double mod = R * sqrt ( 1.0 / ( cutoff * cutoff ) - 1.0 ) ; double delw = W - w0 ; double w1 = ( 1 / winc ) * ( delw + mod ) ; double w2 = ( 1 / winc ) * ( delw - mod ) ; if ( w1 > w2 ) { if ( w2 <= 0 ) w2 = 0 ; else if ( w2 > npts ) w2 = npts + 1 ; else w2 -= 1 ; if ( w1 <= 0 ) w1 = 0 ; else if ( w1 > npts ) w1 = npts + 1 ; else w1 += 1 ; ilo = int ( w2 ) ; ihi = int ( w1 ) ; } else { if ( w1 <= 0 ) w1 = 0 ; else if ( w1 > npts ) w1 = npts + 1 ; else w1 -= 1 ; if ( w2 <= 0 ) w2 = 0 ; else if ( w2 > npts ) w2 = npts + 1 ; else w2 += 1 ; ilo = int ( w1 ) ; ihi = int ( w2 ) ; } return ; }
Switching the order of wst & wfi switches the sign on the imaginary
component!
Switching the order of wst & wfi switches the sign on the imaginary component!
// Set a decent cutoff // if none is specified // Modification from middle // Between 1st point & middle   // One extrema, (double)pts // Other extrema, (double)pts //cout << "\nCutoff Level = " << cutoff; //cout << "\nFrequency of First Point = " << w0/(2.0*PI); //cout << "\nFrequency of Lorentzian Offset = " << W/(2.0*PI); //cout << "\nFrequency Difference = " << delw/(2.0*PI); //cout << "\nThe Linewidth is = " << 2*R/(2.0*PI); //cout << "\nThe Point Modifier = " << mod << "(" << int(mod) << ")"; //cout << "\nw1 (Points as double) = " << w1; //cout << "\nw2 (Points as double) = " << w2; // Here if w2 is low frequency end // 	Insure low end !< 0 //	Insure low end !> npts //	Drop a point for safety // 	Insure high end !<0 //	Insure hign end !> npts //	Add a point for safety // 	Set low point as integer //	Set high point as integer // 	Insure low end !<0 //	Insure low end !> npts //	Drop a point for safety // 	Insure high end !<0 //	Insure high end !> npts //	Add a point for safety //	Set low point as integer //	Set high point a integer