From 7fc97cc812e1c0790051061a7c1d10f417f03060 Mon Sep 17 00:00:00 2001 From: Luke Shingles Date: Tue, 17 Sep 2024 12:36:00 +0100 Subject: [PATCH] Update gammapkt.cc --- gammapkt.cc | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/gammapkt.cc b/gammapkt.cc index 3c48f0c2f..4f34a9106 100644 --- a/gammapkt.cc +++ b/gammapkt.cc @@ -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);