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.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/zdab_utils.c b/src/zdab_utils.c
index ba76b63..6dffe0f 100644
--- a/src/zdab_utils.c
+++ b/src/zdab_utils.c
@@ -78,6 +78,11 @@ int get_event(zebraFile *f, event *ev, zebraBank *bev)
channel = bpmt.pin % 32;
id = crate*512 + card*32 + channel;
+ if (id >= MAX_PMTS) {
+ fprintf(stderr, "PMT hit from %i/%i/%i\n", crate, card, channel);
+ return -1;
+ }
+
if (ev->pmt_hits[id].hit) {
fprintf(stderr, "%i/%i/%i is in the PMT bank twice!\n", crate, card, channel);
}
@@ -105,6 +110,9 @@ int get_event(zebraFile *f, event *ev, zebraBank *bev)
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]);
}
+ /* For now we assume SNOMAN has it correct. */
+ pmts[id].pmt_type = pmt_types[i];
+
if (!b.next) break;
rv = zebra_get_bank(f,&b,b.next);