From 1c8051e72f3c00384cb3e5b07d22b325ddcd2273 Mon Sep 17 00:00:00 2001 From: tlatorre Date: Mon, 29 Jul 2019 12:33:59 -0500 Subject: 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. --- src/zdab_utils.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/zdab_utils.c') 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]); -- cgit