Skip to content

Commit

Permalink
Update gammapkt.cc
Browse files Browse the repository at this point in the history
  • Loading branch information
lukeshingles committed Sep 17, 2024
1 parent 2d1abe6 commit 7fc97cc
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions gammapkt.cc
Original file line number Diff line number Diff line change
Expand Up @@ -399,15 +399,10 @@ void compton_scatter(Packet &pkt) {
if (xx >= THOMSON_LIMIT) {
f = choose_f(xx, rng_uniform());

// Check that f lies between 1.0 and (2xx + 1)

if ((f < 1) || (f > (2 * xx + 1))) {
printout("Compton f out of bounds. Abort.\n");
std::abort();
}
assert_always(f >= 1.);
assert_always(f <= (2 * xx + 1.));

// Prob of keeping gamma ray is...

const double prob_gamma = 1. / f;

stay_gamma = (rng_uniform() < prob_gamma);
Expand Down

0 comments on commit 7fc97cc

Please sign in to comment.