#include <TVacuumPol.h>
Public Member Functions | |
TVacuumPol () | |
~TVacuumPol () | |
void | Init (std::string, std::string) |
void | SetZeroVP () |
void | SetDefaultVP () |
bool | GetVacuumPolarization () |
std::complex< double > | Evals (const double &s) |
std::complex< double > | Evalt (const double &t) |
Protected Member Functions | |
void | ReadVacuumPolData (std::string) |
Protected Attributes | |
TRadSpline * | fsvtr |
TRadSpline * | fsvsr |
TRadSpline * | fsvsi |
bool | fNoVP |
bool | fReadSuccessfullyVP |
Definition at line 8 of file TVacuumPol.h.
TVacuumPol::TVacuumPol | ( | ) |
TVacuumPol::~TVacuumPol | ( | ) |
std::complex<double> TVacuumPol::Evals | ( | const double & | s | ) | [inline] |
Definition at line 23 of file TVacuumPol.h.
References TRadSpline::Eval(), fNoVP, fsvsi, and fsvsr.
Referenced by TMuCrossPart::BornShift(), TEPCrossPart::BornShift(), TMuCrossPart::R_e_Gamma(), TMuCrossPart::R_e_Gamma_t(), TMuCrossPart::R_e_mu_Gamma_t(), TMuCrossPart::R_f_Gamma(), and TEPCrossPart::RGamma().
00023 { 00024 if(fNoVP) return std::complex<double>(1,0); 00025 return std::complex<double>(fsvsr->Eval(s),fsvsi->Eval(s)); 00026 }
std::complex<double> TVacuumPol::Evalt | ( | const double & | t | ) | [inline] |
Definition at line 27 of file TVacuumPol.h.
References TRadSpline::Eval(), fNoVP, and fsvtr.
Referenced by TEPCrossPart::BornShift(), and TEPCrossPart::RGamma().
00027 { 00028 if(fNoVP) return std::complex<double>(1,0); 00029 return std::complex<double>(fsvtr->Eval(fabs(t)),0.); 00030 }
bool TVacuumPol::GetVacuumPolarization | ( | ) | [inline] |
void TVacuumPol::Init | ( | std::string | , | |
std::string | ||||
) |
Definition at line 17 of file TVacuumPol.C.
References ReadVacuumPolData(), and deljobs::string.
Referenced by TEPCrossPart::TEPCrossPart(), and TMuCrossPart::TMuCrossPart().
00017 { 00018 /* char *vpd = getenv("VACUUM_POL_DIR"); 00019 char *vpf = getenv("VACUUM_POL_FNAME"); 00020 string vpolfname; 00021 if(vpf == NULL){ 00022 if(vpd == NULL){ 00023 vpolfname = "vpol.dat"; 00024 }else{ 00025 ostringstream temp; 00026 temp<<vpd<<"/"<<"vpol.dat"; 00027 vpolfname = temp.str(); 00028 } 00029 } else { 00030 vpolfname = vpf; 00031 } 00032 */ 00033 string vpolfname; 00034 if(vpolf.empty()) vpolfname = "vpol.dat"; 00035 else vpolfname = vpolf; 00036 00037 if(! vpold.empty()) { 00038 cout<<"Directory is \""<<vpold<<"\"."<<endl<<flush; 00039 vpolfname = vpold + "/" + vpolfname; 00040 } 00041 00042 // if(vpd != NULL) cout<<"Directory is \""<<vpd<<"\"."<<endl<<flush; 00043 cout<<"File name is \""<<vpolfname<<"\"."<<endl<<flush; 00044 00045 ReadVacuumPolData(vpolfname); 00046 }
void TVacuumPol::ReadVacuumPolData | ( | std::string | ) | [protected] |
Definition at line 54 of file TVacuumPol.C.
References false, fReadSuccessfullyVP, fsvsi, fsvsr, fsvtr, genRecEmupikp::i, imag(), s, and deljobs::string.
Referenced by Init().
00054 { 00055 ifstream IN(fname.c_str()); 00056 if(IN.is_open() == false ){ 00057 std::cout<<"Can't read \""<<fname<<"\". Vacuum polarization will be zero." 00058 <<std::endl; 00059 std::cout<<"Probably you should tune VACUUM_POL_DIR or VACUUM_POL_FNAME variables."<<std::endl; 00060 fReadSuccessfullyVP = false; 00061 return; 00062 } 00063 00064 const int MAX_NP = 20000; 00065 double *s = new double[MAX_NP]; 00066 double *vtr = new double[MAX_NP]; 00067 double *vsr = new double[MAX_NP]; 00068 double *vsi = new double[MAX_NP]; 00069 double *vp = new double[MAX_NP]; 00070 00071 int np = 0; 00072 while(!IN.eof()){ 00073 IN>>s[np]>>vtr[np]>>vsr[np]>>vsi[np]>>vp[np]; 00074 string str; 00075 getline(IN,str); 00076 s[np] *= 1e6; 00077 np++; 00078 } 00079 np--; 00080 00081 double *re_vs = new double[np]; 00082 double *im_vs = new double[np]; 00083 double *re_vt = new double[np]; 00084 00085 for(int i=0;i<np;i++){ 00086 std::complex<double> Pi_s(vsr[i],vsi[i]); 00087 std::complex<double> vs = 1./(1.-Pi_s); 00088 re_vs[i] = std::real(vs); 00089 im_vs[i] = std::imag(vs); 00090 00091 std::complex<double> Pi_t(vtr[i],0.); 00092 std::complex<double> vt = 1./(1.-Pi_t); 00093 re_vt[i] = std::real(vt); 00094 } 00095 00096 if(fsvsr) delete fsvsr; 00097 fsvsr = new TRadSpline3("vsr",s,re_vs,np); 00098 00099 if(fsvsi) delete fsvsi; 00100 fsvsi = new TRadSpline3("vsi",s,im_vs,np); 00101 00102 if(fsvtr) delete fsvtr; 00103 fsvtr = new TRadSpline3("vtr",s,re_vt,np); 00104 00105 delete [] re_vs; 00106 delete [] im_vs; 00107 delete [] re_vt; 00108 00109 delete [] s; 00110 delete [] vtr; 00111 delete [] vsr; 00112 delete [] vsi; 00113 delete [] vp; 00114 00115 fReadSuccessfullyVP = true; 00116 }
void TVacuumPol::SetDefaultVP | ( | ) | [inline] |
Definition at line 21 of file TVacuumPol.h.
References fNoVP, and fReadSuccessfullyVP.
Referenced by TMuCrossPart::Init(), and TEPCrossPart::Init().
00021 {fNoVP = !fReadSuccessfullyVP;}
void TVacuumPol::SetZeroVP | ( | ) | [inline] |
Definition at line 20 of file TVacuumPol.h.
References fNoVP.
Referenced by TMuCrossPart::Init(), and TEPCrossPart::Init().
00020 {fNoVP = true;}
bool TVacuumPol::fNoVP [protected] |
Definition at line 13 of file TVacuumPol.h.
Referenced by Evals(), Evalt(), GetVacuumPolarization(), SetDefaultVP(), SetZeroVP(), and TVacuumPol().
bool TVacuumPol::fReadSuccessfullyVP [protected] |
TRadSpline* TVacuumPol::fsvsi [protected] |
Definition at line 12 of file TVacuumPol.h.
Referenced by Evals(), ReadVacuumPolData(), TVacuumPol(), and ~TVacuumPol().
TRadSpline* TVacuumPol::fsvsr [protected] |
Definition at line 11 of file TVacuumPol.h.
Referenced by Evals(), ReadVacuumPolData(), TVacuumPol(), and ~TVacuumPol().
TRadSpline* TVacuumPol::fsvtr [protected] |
Definition at line 10 of file TVacuumPol.h.
Referenced by Evalt(), ReadVacuumPolData(), TVacuumPol(), and ~TVacuumPol().