From f8c99fdd302b6d2190ae619681fb1cea5f74f391 Mon Sep 17 00:00:00 2001 From: tlatorre Date: Thu, 13 Jun 2019 11:08:04 -0500 Subject: add a data cleaning cut to tag incoming muons This commit adds a data cleaning cut to tag incoming muons by looking for early OWL hits. It also significantly updates the flasher cut to catch more flashers. In particular, the flasher cut now does the following: - loops over *all* paddle cards with at least 4 hits instead of just the paddle cards with the most hits - uses QLX to look for charge outliers in the paddle card - fixes a few bugs (for example, uninitialized values in the charge array) - adds a check to to see if the given slot is early with respect to all PMTs within 4 meters to catch the case where the flashing channel is missing from the event --- src/zdab_utils.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/zdab_utils.c') 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); -- cgit