aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortlatorre <tlatorre@uchicago.edu>2019-08-05 14:05:26 -0500
committertlatorre <tlatorre@uchicago.edu>2019-08-05 14:05:26 -0500
commitedae55dac7b4167a33661075bdb9824b390a56da (patch)
tree1947aacb0695ee91d8afa11551e388f13cb984df
parentf90d4d6ba905d3247942442c4349a30378c3e614 (diff)
downloadsddm-edae55dac7b4167a33661075bdb9824b390a56da.tar.gz
sddm-edae55dac7b4167a33661075bdb9824b390a56da.tar.bz2
sddm-edae55dac7b4167a33661075bdb9824b390a56da.zip
update sno_charge to prevent nan when charge is negative
This commit updates the charge spectrum initialization to convolve the charge distribution over a wider range to make sure that we have a nonzero probability of observing charges all the way down to qlo. The reason for this is that previously for some negative charges the probability of observing that charge was zero, which was causing the likelihood to return nan.
-rw-r--r--src/sno_charge.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/sno_charge.c b/src/sno_charge.c
index f36bfb5..f0d38ec 100644
--- a/src/sno_charge.c
+++ b/src/sno_charge.c
@@ -431,7 +431,7 @@ void init_charge(void)
for (j = 0; j < nq; j++) {
params[0] = x[j];
params[1] = i;
- gsl_integration_cquad(&F, fmax(0.0,x[j]-QSMEAR_ADC*10/MEAN_HIPT), x[j]+QSMEAR_ADC*10/MEAN_HIPT, 0, 1e-4, w, &result, &error, &nevals);
+ gsl_integration_cquad(&F, fmax(0.0,x[j]-QSMEAR_ADC*100/MEAN_HIPT), x[j]+QSMEAR_ADC*100/MEAN_HIPT, 0, 1e-4, w, &result, &error, &nevals);
/* Store the smeared charge PDF in a temporary array since we need
* to keep the original PDF for the next iteration of the loop. */
y[j] = result;