66 if(fpInstance ==
nullptr)
83 return 4 * costheta2 /
84 (2 * costheta2 - klk2 +
85 2 * std::sqrt(costheta2 * (costheta2 - klk2)));
89 return std::norm(2 * std::sqrt(costheta2) /
90 (std::sqrt(costheta2) +
91 std::sqrt(std::complex<G4double>(costheta2 - klk2))));
103 (2*costhetas2+klks2+2*std::sqrt(costhetas2*(costhetas2+klks2)));
117 if((std::fabs(thetai - thetao) < AngCut) && (std::fabs(phio) < AngCut))
125 G4double sinthetai = std::sin(thetai);
126 G4double sinthetao = std::sin(thetao);
127 mu_squared = k2 * (sinthetai * sinthetai + sinthetao * sinthetao -
128 2. * sinthetai * sinthetao * std::cos(phio));
133 return b2*w2/twopi*std::exp(-mu_squared*w2/2);
150 if((std::fabs(thetarefract - thetaSo) < AngCut) &&
151 (std::fabs(phiSo) < AngCut))
157 G4double sinthetai = std::sin(thetai);
158 G4double sinthetaSo = std::sin(thetaSo);
161 mu_squared = k * k * sinthetai * sinthetai +
162 kS * kS * sinthetaSo * sinthetaSo -
163 2. * k * kS * sinthetai * sinthetaSo * std::cos(phiSo);
168 return b2*w2/twopi*std::exp(-mu_squared*w2/2);
185 G4double a_max_theta_o, max_theta_o=theta_i, a_max_phi_o, max_phi_o=0.;
195 G4double ang_steptheta=90.*degree/(AngNoTheta-1);
196 G4double ang_stepphi=360.*degree/(AngNoPhi-1);
197 G4double costheta_i=std::cos(theta_i);
198 G4double costheta_i_squared=costheta_i*costheta_i;
201 G4double kl4d4=neutron_mass_c2/hbarc_squared*neutron_mass_c2/
202 hbarc_squared*fermipot*fermipot;
210 G4double k2=2*neutron_mass_c2*E/hbarc_squared;
216 for (theta_o=0.*degree; theta_o<=90.*degree+1e-6; theta_o+=ang_steptheta)
218 costheta_o_squared=std::cos(theta_o)*std::cos(theta_o);
222 for (phi_o=-180.*degree; phi_o<=180.*degree+1e-6; phi_o+=ang_stepphi)
226 Intens=kl4d4/costheta_i*
S2(costheta_i_squared,klk2)*
227 S2(costheta_o_squared,klk2)*
228 Fmu(k2,theta_i,theta_o,phi_o,b2,w2,AngCut)*std::sin(theta_o);
245 wkeit+=Intens*ang_steptheta*ang_stepphi;
258 while ((ang_stepphi>=AngCut*AngCut) || (ang_steptheta>=AngCut*AngCut))
260 a_max_theta_o=max_theta_o;
261 a_max_phi_o=max_phi_o;
269 for (theta_o=a_max_theta_o-ang_steptheta;
270 theta_o<=a_max_theta_o-ang_steptheta+1e-6;
271 theta_o+=ang_steptheta)
274 costheta_o_squared=std::cos(theta_o)*std::cos(theta_o);
275 for (phi_o=a_max_phi_o-ang_stepphi;
276 phi_o<=a_max_phi_o+ang_stepphi+1e-6;
280 Intens=kl4d4/costheta_i*
S2(costheta_i_squared, klk2)*
281 S2(costheta_o_squared,klk2)*
282 Fmu(k2,theta_i,theta_o,phi_o,b2,w2,AngCut)*std::sin(theta_o);
305 G4double a_max_thetas_o, max_thetas_o = theta_i;
306 G4double a_max_phis_o, max_phis_o = 0.;
310 G4double ang_steptheta=180.*degree/(AngNoTheta-1);
311 G4double ang_stepphi=180.*degree/(AngNoPhi-1);
312 G4double costheta_i=std::cos(theta_i);
313 G4double costheta_i_squared=costheta_i*costheta_i;
324 G4double kl4d4=neutron_mass_c2/hbarc_squared*neutron_mass_c2/
325 hbarc_squared*fermipot*fermipot;
330 G4double klks2=fermipot/(E-fermipot);
333 G4double ksdk=std::sqrt((E-fermipot)/E);
338 G4double k=std::sqrt(2*neutron_mass_c2*E/hbarc_squared);
343 for (thetas_o=0.*degree; thetas_o<=90.*degree+1e-6; thetas_o+=ang_steptheta)
345 costhetas_o_squared=std::cos(thetas_o)*std::cos(thetas_o);
347 for (phis_o=-180.*degree; phis_o<=180.*degree+1e-6; phis_o+=ang_stepphi)
350 if (costhetas_o_squared>=-klks2) {
355 if(std::fabs(std::sin(theta_i) / ksdk) <= 1.)
357 thetarefract = std::asin(std::sin(theta_i) / ksdk);
360 IntensS = kl4d4/costheta_i*ksdk*
S2(costheta_i_squared, klk2)*
361 SS2(costhetas_o_squared,klks2)*
362 FmuS(k,kS,theta_i,thetas_o,phis_o,b2,w2,AngCut,thetarefract)*
373 wkeit+=IntensS*ang_steptheta*ang_stepphi;
384 while (ang_stepphi>=AngCut*AngCut || ang_steptheta>=AngCut*AngCut)
386 a_max_thetas_o=max_thetas_o;
387 a_max_phis_o=max_phis_o;
392 for (thetas_o=a_max_thetas_o-ang_steptheta;
393 thetas_o<=a_max_thetas_o-ang_steptheta+1e-6;
394 thetas_o+=ang_steptheta)
396 costhetas_o_squared=std::cos(thetas_o)*std::cos(thetas_o);
397 for (phis_o=a_max_phis_o-ang_stepphi;
398 phis_o<=a_max_phis_o+ang_stepphi+1e-6;
402 if(std::fabs(std::sin(theta_i) / ksdk) <= 1.)
404 thetarefract = std::asin(std::sin(theta_i) / ksdk);
407 IntensS=kl4d4/costheta_i*ksdk*
S2(costheta_i_squared, klk2)*
408 SS2(costhetas_o_squared,klks2)*
409 FmuS(k,kS,theta_i,thetas_o,phis_o,b2,w2,AngCut,thetarefract)*
414 max_thetas_o=thetas_o;
434 G4double kl4d4=neutron_mass_c2/hbarc_squared*neutron_mass_c2/
435 hbarc_squared*fermipot*fermipot;
440 G4double costheta_i=std::cos(theta_i);
441 G4double costheta_o=std::cos(theta_o);
445 return kl4d4/costheta_i*
S2(costheta_i*costheta_i, klk2)*
446 S2(costheta_o*costheta_o,klk2)*
447 Fmu(2*neutron_mass_c2*E/hbarc_squared,theta_i,theta_o,phi_o,b*b,w*w,AngCut)*
460 G4double kl4d4=neutron_mass_c2/hbarc_squared*neutron_mass_c2/
461 hbarc_squared*fermipot*fermipot;
466 G4double klks2=fermipot/(E-fermipot);
474 G4double ksdk=std::sqrt((E-fermipot)/E);
477 G4double k=std::sqrt(2*neutron_mass_c2*E/hbarc_squared);
482 G4double costheta_i=std::cos(theta_i);
483 G4double costhetas_o=std::cos(thetas_o);
488 if(std::fabs(std::sin(theta_i) / ksdk) <= 1.)
490 thetarefract = std::asin(std::sin(theta_i) / ksdk);
493 return kl4d4/costheta_i*ksdk*
S2(costheta_i*costheta_i, klk2)*
494 SS2(costhetas_o*costhetas_o,klks2)*
495 FmuS(k,kS,theta_i,thetas_o,phis_o,b*b,w*w,AngCut,thetarefract)*
G4GLOB_DLL std::ostream G4cout
G4UCNMicroRoughnessHelper()
G4double ProbIplus(G4double, G4double, G4double, G4double, G4double, G4double, G4double, G4double) const
G4double FmuS(G4double, G4double, G4double, G4double, G4double, G4double, G4double, G4double, G4double) const
G4double IntIminus(G4double, G4double, G4double, G4int, G4int, G4double, G4double, G4double *, G4double) const
G4double S2(G4double, G4double) const
G4double SS2(G4double, G4double) const
static G4UCNMicroRoughnessHelper * GetInstance()
~G4UCNMicroRoughnessHelper()
G4double Fmu(G4double, G4double, G4double, G4double, G4double, G4double, G4double) const
G4double ProbIminus(G4double, G4double, G4double, G4double, G4double, G4double, G4double, G4double) const
G4double IntIplus(G4double, G4double, G4double, G4int, G4int, G4double, G4double, G4double *, G4double) const