diff options
author | tlatorre <tlatorre@uchicago.edu> | 2019-11-18 11:03:06 -0600 |
---|---|---|
committer | tlatorre <tlatorre@uchicago.edu> | 2019-11-18 11:03:06 -0600 |
commit | bcf57e127f17b715cdf3ce39f44a45f82c2473fd (patch) | |
tree | 475d61cd0fc682febf845db019db49f3705549f2 | |
parent | fcd203f8c97d4858f6a23f233a501dad0d3b97da (diff) | |
download | sddm-bcf57e127f17b715cdf3ce39f44a45f82c2473fd.tar.gz sddm-bcf57e127f17b715cdf3ce39f44a45f82c2473fd.tar.bz2 sddm-bcf57e127f17b715cdf3ce39f44a45f82c2473fd.zip |
clear any flags except for PMT_FLAG_DQXX in get_event()
This commit updates get_event() to clear any PMT flags except for PMT_FLAG_DQXX
from all PMT hits before loading the event. Although I *was* previously
clearing the other flags for hit PMTs, I was not clearing flags for PMTs which
were *not* hit. This was causing non deterministic behaviour, i.e. I was
getting different results depending on if I ran the fitter over a whole file or
just a single event.
-rw-r--r-- | src/zdab_utils.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/zdab_utils.c b/src/zdab_utils.c index b26dd78..12514ef 100644 --- a/src/zdab_utils.c +++ b/src/zdab_utils.c @@ -98,6 +98,9 @@ int get_event(zebraFile *f, event *ev, zebraBank *bev) for (i = 0; i < MAX_PMTS; i++) { ev->pmt_hits[i].hit = 0; + + /* Clear any flags except for PMT_DQXX. */ + ev->pmt_hits[i].flags &= PMT_FLAG_DQXX; } unpack_ev(bev->data, &ev_bank); @@ -169,12 +172,6 @@ int get_event(zebraFile *f, event *ev, zebraBank *bev) ev->pmt_hits[id].pt1 = bpmt.pt; } - /* Clear the PMT_FLAG_DIS bit. */ - ev->pmt_hits[id].flags &= ~PMT_FLAG_DIS; - - /* Clear the PMT_FLAG_CHARGE bit. */ - ev->pmt_hits[id].flags &= ~PMT_FLAG_CHARGE; - /* Make sure we have good calibrations. Technically, we should only * have to check the KPF_DIS bit since according to the SNOMAN * docs: |