double EW_ABC::Mw(const bool bAlternative) const { if (!bAlternative) return NPE.Mw_eps(eps1(), eps2(), eps3()); else { double delta_alpha = (NPE.alphaMz() - 1.0 / 128.90) / NPE.getAle(); double cW2_Born = 0.768905 * (1.0 - 0.40 * delta_alpha); double cW2 = cW2_Born * (1.0 + 1.43 * eps1() - 1.00 * eps2() - 0.86 * eps3()); return ( sqrt(cW2) * NPE.getMz()); } }
void HeedMatterDef::replace_epsi12(const String& file_name) { mfunnamep("void HeedMatterDef::replace_epsi12(const String& file_name)"); #ifdef USE_STLSTRING std::ifstream file(file_name.c_str()); #else std::ifstream file(hist_file_name); #endif if (!file) { funnw.ehdr(mcerr); mcerr << "cannot open file " << file_name << std::endl; spexit(mcerr); } else { mcout << "file " << file_name << " is opened" << std::endl; } long qe = 0; // number of points in input mesh file >> qe; check_econd11(qe, <= 2, mcerr); DynLinArr<double> ener(qe); DynLinArr<double> eps1(qe); DynLinArr<double> eps2(qe); for (long ne = 0; ne < qe; ++ne) { file >> ener[ne] >> eps1[ne] >> eps2[ne]; check_econd11(eps2[ne], < 0.0, mcerr); if (ne > 0) { check_econd12(ener[ne], <, ener[ne - 1], mcerr); } }
double EW_ABC::R_b(const bool bAlternative) const { if (!bAlternative) return ( Gamma_b() / Gamma_had()); else { double R_b0 = 0.2182355; return ( R_b0 * (1.0 - 0.06 * eps1() + 0.07 * eps3() + 1.79 * epsb())); } }
int main() { /* Machine epsilon se prej (podle wiki) meri od jednicky */ printf("Moje : %g\n", eps1(1)); printf("Wiki : %g\n", eps2(1)); printf("Konstanta : %g\n", FLT_EPSILON); printf("Yay!\n"); return 0; }
double EW_ABC::R_l(const bool bAlternative) const { if (!bAlternative) return ( Gamma_had() / Gamma_l(NPE.ELECTRON)); else { double delta_als = (NPE.Als(NPE.getMz(), FULLNNLO) - 0.119) / M_PI; double delta_alpha = (NPE.alphaMz() - 1.0 / 128.90) / NPE.getAle(); double R_0 = 20.8228 * (1.0 + 1.05 * delta_als - 0.28 * delta_alpha); return ( R_0 * (1.0 + 0.28 * eps1() - 0.36 * eps3() + 0.50 * epsb())); } }
double EW_ABC::AFB_l(StandardModel::lepton l, const bool bAlternative) const { if (!bAlternative) { double x = gVl_over_gAl(l).real(); return ( 3.0 * x * x / (1.0 + x * x) / (1.0 + x * x)); } else { double delta_als = (NPE.Als(NPE.getMz(), FULLNNLO) - 0.119) / M_PI; double AFB_l_Born = 0.01696 * (1.0 - 34.0 * delta_als); return ( AFB_l_Born * (1.0 + 34.72 * eps1() - 45.15 * eps3())); } }
double EW_ABC::sin2thetaEff(const bool bAlternative) const { if (!bAlternative) { double x = gVl_over_gAl(NPE.ELECTRON).real(); return ( (1.0 - x) / 4.0); } else { double delta_als = (NPE.Als(NPE.getMz(), FULLNNLO) - 0.119) / M_PI; double x0 = 0.075619 - 1.32 * delta_als; double x = x0 * (1.0 + 17.6 * eps1() - 22.9 * eps3()); return ( (1.0 - x) / 4.0); } }
double EW_ABC::A_l(StandardModel::lepton l, const bool bAlternative) const { if (!bAlternative) { double x = gVl_over_gAl(l).real(); return ( 2.0 * x / (1.0 + x * x)); } else { double delta_alpha = (NPE.alphaMz() - 1.0 / 128.90) / NPE.getAle(); double x0 = 0.075619 - 1.32 * delta_alpha; double x = x0 * (1.0 + 17.6 * eps1() - 22.9 * eps3()); return ( 2.0 * x / (1.0 + x * x)); } }
double EW_ABC::sigma0_had(const bool bAlternative) const { if (!bAlternative) return ( 12.0 * M_PI / NPE.getMz() / NPE.getMz() * Gamma_l(NPE.ELECTRON) * Gamma_had() / GammaZ(false) / GammaZ(false)); else { double delta_als = (NPE.Als(NPE.getMz(), FULLNNLO) - 0.119) / M_PI; double delta_alpha = (NPE.alphaMz() - 1.0 / 128.90) / NPE.getAle(); double sigma_h0 = 41.420 * (1.0 - 0.41 * delta_als + 0.03 * delta_alpha); return ( sigma_h0 * (1.0 - 0.03 * eps1() + 0.04 * eps3() - 0.20 * epsb())); } }
double EW_ABC::GammaZ(const bool bAlternative) const { if (!bAlternative) return ( Gamma_l(NPE.NEUTRINO_1) + Gamma_l(NPE.NEUTRINO_2) + Gamma_l(NPE.NEUTRINO_3) + Gamma_l(NPE.ELECTRON) + Gamma_l(NPE.MU) + Gamma_l(NPE.TAU) + Gamma_had()); else { double delta_als = (NPE.Als(NPE.getMz(), FULLNNLO) - 0.119) / M_PI; double delta_alpha = (NPE.alphaMz() - 1.0 / 128.90) / NPE.getAle(); double Gamma_T0 = 2.48946 * (1.0 + 0.73 * delta_als - 0.35 * delta_alpha); return ( Gamma_T0 * (1.0 + 1.35 * eps1() - 0.46 * eps3() + 0.35 * epsb())); } }
gslpp::complex EW_ABC::gAb() const { return NPE.gA_f_eps(NPE.getQuarks(NPE.BOTTOM), eps1(), epsb()); }
gslpp::complex EW_ABC::gAq(QCD::quark q) const { if (q == QCD::BOTTOM || q == QCD::TOP) throw std::runtime_error("Error in EW_ABC::gAq()"); return NPE.gA_f_eps(NPE.getQuarks(q), eps1()); }
gslpp::complex EW_ABC::gAl(StandardModel::lepton l) const { return NPE.gA_f_eps(NPE.getLeptons(l), eps1()); }
void pbsolver(Mat<>& eps, Mat<>& phi, Mat<>& bgf, double dcel, double tol, int iter){ size_t nx = eps.nx(), ny = eps.ny(), nz = eps.nz(); double dx = comdata.deltax, dy = comdata.deltay, dz = comdata.deltaz; Mat<> eps1(nx,ny,nz), eps2(nx,ny,nz), eps3(nx,ny,nz); for(size_t i=1; i<nx; ++i){ for(size_t j=1; j<ny; ++j){ for(size_t k=1; k<nz; ++k){ eps1(i,j,k) = (eps(i+1,j,k) + eps(i,j,k))/2.0; eps2(i,j,k) = (eps(i,j+1,k) + eps(i,j,k))/2.0; eps3(i,j,k) = (eps(i,j,k+1) + eps(i,j,k))/2.0; }}} std::vector< Eigen::Triplet<double> > tripletList; tripletList.reserve(nx*ny*nz); Eigen::VectorXd phi_flat(nx*ny*nz); size_t n = nx*ny*nz; for(size_t i=1; i<=nx; ++i){ for(size_t j=1; j<=ny; ++j){ for(size_t k=1; k<=nz; ++k){ size_t ijk = (i-1)*nz*ny + (j-1)*nz + k-1; if(i==1 || i==nx || j==1 || j==ny || k==1 || k==nz){ tripletList.push_back( Eigen::Triplet<double>(ijk, ijk, 1.0) ); }else{ double f = -( (eps1(i,j,k) + eps1(i-1,j,k))/dx/dx + (eps2(i,j,k) + eps2(i,j-1,k))/dy/dy + (eps3(i,j,k) + eps3(i,j,k-1))/dz/dz ); tripletList.push_back( Eigen::Triplet<double>(ijk, ijk, f) ); double weit[6]; weit[0] = eps1(i-1,j,k)/dx/dx; weit[1] = eps2(i,j-1,k)/dy/dy; weit[2] = eps3(i,j,k-1)/dz/dz; weit[3] = eps3(i,j,k)/dz/dz; weit[4] = eps2(i,j,k)/dy/dy; weit[5] = eps1(i,j,k)/dx/dx; size_t jj = ijk - nz*ny; if(jj>=0){ tripletList.push_back( Eigen::Triplet<double>(ijk, jj, weit[0]) ); } jj = ijk - nz; if(jj>=0){ tripletList.push_back( Eigen::Triplet<double>(ijk, jj, weit[1]) ); } jj = ijk - 1; if(jj>=0){ tripletList.push_back( Eigen::Triplet<double>(ijk, jj, weit[2]) ); } jj = ijk + 1; if(jj<n){ tripletList.push_back( Eigen::Triplet<double>(ijk, jj, weit[3]) ); } jj = ijk + nz; if(jj<n){ tripletList.push_back( Eigen::Triplet<double>(ijk, jj, weit[4]) ); } jj = ijk + nz*ny; if(jj<n){ tripletList.push_back( Eigen::Triplet<double>(ijk, jj, weit[5]) ); } } phi_flat(ijk) = phi(i,j,k); }}} Eigen::SparseMatrix<double> A(n, n); A.setFromTriplets(tripletList.begin(), tripletList.end()); A.makeCompressed(); Eigen::BiCGSTAB<Eigen::SparseMatrix<double>, Eigen::IdentityPreconditioner > solver(A); solver.setMaxIterations(iter); solver.setTolerance(tol); phi_flat = solver.solveWithGuess(bgf.baseInterface(), phi_flat); for(size_t i=1; i<=nx; ++i){ for(size_t j=1; j<=ny; ++j){ for(size_t k=1; k<=nz; ++k){ size_t ijk = (i-1)*nz*ny + (j-1)*nz + k-1; phi(i,j,k) = phi_flat(ijk); }}} }