From 0d8b761087c3f8eb094e01a512e6251075fad927 Mon Sep 17 00:00:00 2001 From: tlatorre Date: Fri, 14 Jun 2019 14:27:40 -0500 Subject: add a function to compute a data cleaning word Also write out the data cleaning word to the YAML file. --- src/dc.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'src/dc.c') diff --git a/src/dc.c b/src/dc.c index bc8c017..230e373 100644 --- a/src/dc.c +++ b/src/dc.c @@ -26,6 +26,27 @@ #include "zebra.h" #include +/* Returns the data cleaning bitmask for the event `ev`. */ +uint32_t get_dc_word(event *ev, zebraFile *f, zebraBank *bmast, zebraBank *bev) +{ + uint32_t status = 0x0; + + if (is_muon(ev)) + status |= DC_MUON; + if (junk_cut(f, bmast, bev)) + status |= DC_JUNK; + if (crate_isotropy(ev)) + status |= DC_CRATE_ISOTROPY; + if (qvnhit(ev)) + status |= DC_QVNHIT; + if (is_neck_event(ev)) + status |= DC_NECK; + if (is_flasher(ev)) + status |= DC_FLASHER; + + return status; +} + /* Returns 1 if the event is tagged as an incoming muon. The goal of this cut * is to tag external muons *without* tagging muons which start within the PSUP * and then exit. In order to achieve that we use the ECA time of the OWL -- cgit