143 G4double a_max_theta_o, max_theta_o = theta_i, a_max_phi_o, max_phi_o = 0.;
153 G4double ang_steptheta = 90. * degree / (AngNoTheta - 1);
154 G4double ang_stepphi = 360. * degree / (AngNoPhi - 1);
155 G4double costheta_i = std::cos(theta_i);
156 G4double costheta_i_squared = costheta_i * costheta_i;
160 neutron_mass_c2 / hbarc_squared * neutron_mass_c2 / hbarc_squared * fermipot * fermipot;
168 G4double k2 = 2 * neutron_mass_c2 * E / hbarc_squared;
174 for (theta_o = 0. * degree; theta_o <= 90. * degree + 1e-6; theta_o += ang_steptheta) {
175 costheta_o_squared = std::cos(theta_o) * std::cos(theta_o);
179 for (phi_o = -180. * degree; phi_o <= 180. * degree + 1e-6; phi_o += ang_stepphi) {
182 Intens = kl4d4 / costheta_i *
S2(costheta_i_squared, klk2) *
S2(costheta_o_squared, klk2) *
183 Fmu(k2, theta_i, theta_o, phi_o, b2, w2, AngCut) * std::sin(theta_o);
187 max_theta_o = theta_o;
193 wkeit += Intens * ang_steptheta * ang_stepphi;
200 if (E > 1e-10 * eV) {
204 while ((ang_stepphi >= AngCut * AngCut) || (ang_steptheta >= AngCut * AngCut)) {
205 a_max_theta_o = max_theta_o;
206 a_max_phi_o = max_phi_o;
210 for (theta_o = a_max_theta_o - ang_steptheta; theta_o <= a_max_theta_o - ang_steptheta + 1e-6;
211 theta_o += ang_steptheta)
214 costheta_o_squared = std::cos(theta_o) * std::cos(theta_o);
215 for (phi_o = a_max_phi_o - ang_stepphi; phi_o <= a_max_phi_o + ang_stepphi + 1e-6;
216 phi_o += ang_stepphi)
219 Intens = kl4d4 / costheta_i *
S2(costheta_i_squared, klk2) *
220 S2(costheta_o_squared, klk2) *
Fmu(k2, theta_i, theta_o, phi_o, b2, w2, AngCut) *
224 max_theta_o = theta_o;
239 G4double a_max_thetas_o, max_thetas_o = theta_i;
240 G4double a_max_phis_o, max_phis_o = 0.;
244 G4double ang_steptheta = 180. * degree / (AngNoTheta - 1);
245 G4double ang_stepphi = 180. * degree / (AngNoPhi - 1);
246 G4double costheta_i = std::cos(theta_i);
247 G4double costheta_i_squared = costheta_i * costheta_i;
258 neutron_mass_c2 / hbarc_squared * neutron_mass_c2 / hbarc_squared * fermipot * fermipot;
263 G4double klks2 = fermipot / (E - fermipot);
266 G4double ksdk = std::sqrt((E - fermipot) / E);
271 G4double k = std::sqrt(2 * neutron_mass_c2 * E / hbarc_squared);
276 for (thetas_o = 0. * degree; thetas_o <= 90. * degree + 1e-6; thetas_o += ang_steptheta) {
277 costhetas_o_squared = std::cos(thetas_o) * std::cos(thetas_o);
279 for (phis_o = -180. * degree; phis_o <= 180. * degree + 1e-6; phis_o += ang_stepphi) {
281 if (costhetas_o_squared >= -klks2) {
285 if (std::fabs(std::sin(theta_i) / ksdk) <= 1.) {
286 thetarefract = std::asin(std::sin(theta_i) / ksdk);
289 IntensS = kl4d4 / costheta_i * ksdk *
S2(costheta_i_squared, klk2) *
290 SS2(costhetas_o_squared, klks2) *
291 FmuS(k, kS, theta_i, thetas_o, phis_o, b2, w2, AngCut, thetarefract) *
299 if (IntensS > *max) {
302 wkeit += IntensS * ang_steptheta * ang_stepphi;
308 if (E > 1e-10 * eV) {
311 while (ang_stepphi >= AngCut * AngCut || ang_steptheta >= AngCut * AngCut) {
312 a_max_thetas_o = max_thetas_o;
313 a_max_phis_o = max_phis_o;
317 for (thetas_o = a_max_thetas_o - ang_steptheta;
318 thetas_o <= a_max_thetas_o - ang_steptheta + 1e-6; thetas_o += ang_steptheta)
320 costhetas_o_squared = std::cos(thetas_o) * std::cos(thetas_o);
321 for (phis_o = a_max_phis_o - ang_stepphi; phis_o <= a_max_phis_o + ang_stepphi + 1e-6;
322 phis_o += ang_stepphi)
325 if (std::fabs(std::sin(theta_i) / ksdk) <= 1.) {
326 thetarefract = std::asin(std::sin(theta_i) / ksdk);
329 IntensS = kl4d4 / costheta_i * ksdk *
S2(costheta_i_squared, klk2) *
330 SS2(costhetas_o_squared, klks2) *
331 FmuS(k, kS, theta_i, thetas_o, phis_o, b2, w2, AngCut, thetarefract) *
333 if (IntensS > *max) {
335 max_thetas_o = thetas_o;
352 neutron_mass_c2 / hbarc_squared * neutron_mass_c2 / hbarc_squared * fermipot * fermipot;
357 G4double costheta_i = std::cos(theta_i);
358 G4double costheta_o = std::cos(theta_o);
362 return kl4d4 / costheta_i *
S2(costheta_i * costheta_i, klk2) *
363 S2(costheta_o * costheta_o, klk2) *
365 2 * neutron_mass_c2 * E / hbarc_squared, theta_i, theta_o, phi_o, b * b, w * w, AngCut) *
376 neutron_mass_c2 / hbarc_squared * neutron_mass_c2 / hbarc_squared * fermipot * fermipot;
381 G4double klks2 = fermipot / (E - fermipot);
389 G4double ksdk = std::sqrt((E - fermipot) / E);
392 G4double k = std::sqrt(2 * neutron_mass_c2 * E / hbarc_squared);
397 G4double costheta_i = std::cos(theta_i);
398 G4double costhetas_o = std::cos(thetas_o);
403 if (std::fabs(std::sin(theta_i) / ksdk) <= 1.) {
404 thetarefract = std::asin(std::sin(theta_i) / ksdk);
407 return kl4d4 / costheta_i * ksdk *
S2(costheta_i * costheta_i, klk2) *
408 SS2(costhetas_o * costhetas_o, klks2) *
409 FmuS(k, kS, theta_i, thetas_o, phis_o, b * b, w * w, AngCut, thetarefract) *