290 G4double a_max_thetas_o, max_thetas_o = theta_i;
291 G4double a_max_phis_o, max_phis_o = 0.;
297 G4double costheta_i=std::cos(theta_i);
298 G4double costheta_i_squared=costheta_i*costheta_i;
303 if (E < fermipot)
return wkeit;
312 G4double klks2=fermipot/(E-fermipot);
315 G4double ksdk=std::sqrt((E-fermipot)/E);
325 for (thetas_o=0.*
degree; thetas_o<=90.*
degree+1e-6; thetas_o+=ang_steptheta)
327 costhetas_o_squared=std::cos(thetas_o)*std::cos(thetas_o);
329 for (phis_o=-180.*
degree; phis_o<=180.*
degree+1e-6; phis_o+=ang_stepphi)
332 if (costhetas_o_squared>=-klks2) {
337 if (std::fabs(std::sin(theta_i)/ksdk) <= 1.)
338 thetarefract = std::asin(std::sin(theta_i)/ksdk);
340 IntensS = kl4d4/costheta_i*ksdk*
S2(costheta_i_squared, klk2)*
341 SS2(costhetas_o_squared,klks2)*
342 FmuS(k,kS,theta_i,thetas_o,phis_o,b2,w2,AngCut,thetarefract)*
353 wkeit+=IntensS*ang_steptheta*ang_stepphi;
364 while (ang_stepphi>=AngCut*AngCut || ang_steptheta>=AngCut*AngCut)
366 a_max_thetas_o=max_thetas_o;
367 a_max_phis_o=max_phis_o;
372 for (thetas_o=a_max_thetas_o-ang_steptheta;
373 thetas_o<=a_max_thetas_o-ang_steptheta+1e-6;
374 thetas_o+=ang_steptheta)
376 costhetas_o_squared=std::cos(thetas_o)*std::cos(thetas_o);
377 for (phis_o=a_max_phis_o-ang_stepphi;
378 phis_o<=a_max_phis_o+ang_stepphi+1e-6;
382 if (std::fabs(std::sin(theta_i)/ksdk) <= 1.)
383 thetarefract = std::asin(std::sin(theta_i)/ksdk);
385 IntensS=kl4d4/costheta_i*ksdk*
S2(costheta_i_squared, klk2)*
386 SS2(costhetas_o_squared,klks2)*
387 FmuS(k,kS,theta_i,thetas_o,phis_o,b2,w2,AngCut,thetarefract)*
392 max_thetas_o=thetas_o;
G4double S2(G4double, G4double) const
static constexpr double hbarc_squared
static constexpr double degree
static constexpr double neutron_mass_c2
static constexpr double eV
T max(const T t1, const T t2)
brief Return the largest of the two arguments
G4double SS2(G4double, G4double) const
G4double FmuS(G4double, G4double, G4double, G4double, G4double, G4double, G4double, G4double, G4double) const