aboutsummaryrefslogtreecommitdiff
path: root/src/zdab_utils.c
diff options
context:
space:
mode:
authortlatorre <tlatorre@uchicago.edu>2019-07-29 12:33:59 -0500
committertlatorre <tlatorre@uchicago.edu>2019-07-29 12:33:59 -0500
commit1c8051e72f3c00384cb3e5b07d22b325ddcd2273 (patch)
treefd74797ad46e7741841138f0d63921a222a419d9 /src/zdab_utils.c
parentc00d326e4951e0384fa7b26861e1b89535c1e288 (diff)
downloadsddm-1c8051e72f3c00384cb3e5b07d22b325ddcd2273.tar.gz
sddm-1c8051e72f3c00384cb3e5b07d22b325ddcd2273.tar.bz2
sddm-1c8051e72f3c00384cb3e5b07d22b325ddcd2273.zip
flag PMT charges below qlo
This commit updates get_event() to flag PMT charges below qlo, which is the minimum charge value that we compute the charge PDFs for. This is to prevent the likelihood from returning nan.
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]);