Skip to content

Commit 7a7d412

Browse files
committed
fix2
1 parent d943dca commit 7a7d412

1 file changed

Lines changed: 1 addition & 11 deletions

File tree

src/photon.cpp

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -420,12 +420,6 @@ void PhotonInteraction::compton_scatter(double alpha, bool doppler,
420420
double* alpha_out, double* mu, int* i_shell, uint64_t* seed) const
421421
{
422422
double form_factor_xmax = 0.0;
423-
int last_shell = binding_energy_.shape()[0] - 1;
424-
double E_b = binding_energy_(last_shell);
425-
double E = alpha * MASS_ELECTRON_EV;
426-
if (E < E_b)
427-
fatal_error("Cannot eject any electron");
428-
429423
while (true) {
430424
// Sample Klein-Nishina distribution for trial energy and angle
431425
std::tie(*alpha_out, *mu) = klein_nishina(alpha, seed);
@@ -487,7 +481,6 @@ void PhotonInteraction::compton_doppler(
487481
// Determine profile cdf value corresponding to p_z,max
488482
double c_max;
489483
if (std::abs(pz_max) > data::compton_profile_pz(n - 1)) {
490-
// TODO: handle linear extrapolation in lin-log scales
491484
c_max = profile_cdf_(shell, n - 1);
492485
} else {
493486
int i = lower_bound_index(data::compton_profile_pz.cbegin(),
@@ -538,10 +531,7 @@ void PhotonInteraction::compton_doppler(
538531
double b = 2.0 * E * (f - momentum_sq * mu);
539532
c = E * E * (momentum_sq - 1.0);
540533

541-
double quad = b * b - 4.0 * a * c;
542-
if (quad < 0)
543-
fatal_error("Cannot doppler broaden.");
544-
quad = std::sqrt(quad);
534+
double quad = std::sqrt(b * b - 4.0 * a * c);
545535
double E_out1 = -(b + quad) / (2.0 * a);
546536
double E_out2 = -(b - quad) / (2.0 * a);
547537

0 commit comments

Comments
 (0)