aboutsummaryrefslogtreecommitdiff
path: root/src/zdab_utils.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/zdab_utils.c')
-rw-r--r--src/zdab_utils.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/zdab_utils.c b/src/zdab_utils.c
index a7669fa..d4e3215 100644
--- a/src/zdab_utils.c
+++ b/src/zdab_utils.c
@@ -23,6 +23,7 @@
#include "event.h"
#include "zebra.h"
#include "misc.h"
+#include "sno_charge.h"
char zdab_err[256];
@@ -196,6 +197,12 @@ int get_event(zebraFile *f, event *ev, zebraBank *bev)
ev->pmt_hits[id].flags |= PMT_FLAG_CHARGE;
}
+ /* Flag PMTs with charges below qlo, since otherwise the negative
+ * log likelihood will be nan. */
+ if (ev->pmt_hits[id].q < get_qlo()) {
+ ev->pmt_hits[id].flags |= PMT_FLAG_CHARGE;
+ }
+
if (pmts[id].pmt_type != pmt_types[i]) {
get_pmt_type_string(pmts[id].pmt_type,pmt_type_string);
fprintf(stderr, "%i/%i/%i has PMT type %s but expected %s based on bank\n", crate, card, channel, pmt_type_string, pmt_names[i]);