diff options
author | tlatorre <tlatorre@uchicago.edu> | 2019-06-14 13:26:21 -0500 |
---|---|---|
committer | tlatorre <tlatorre@uchicago.edu> | 2019-06-14 13:26:21 -0500 |
commit | b633b9fc657abc6889d8966b28e8cf5325dfa3a3 (patch) | |
tree | 0abbdd28ac50e7d4ad2d573b113b0c846926b952 /src/zdab_utils.c | |
parent | b42be9b73cc2a9abf48727bb4269156ddcdb0c7d (diff) | |
download | sddm-b633b9fc657abc6889d8966b28e8cf5325dfa3a3.tar.gz sddm-b633b9fc657abc6889d8966b28e8cf5325dfa3a3.tar.bz2 sddm-b633b9fc657abc6889d8966b28e8cf5325dfa3a3.zip |
flag hits with bad or railed charge
This commit updates the get_event() function to flag any hits which have a
non-zero best charge status word. This essentially gets set when *both* QHS and
QLX are either bad or railed.
I also set this bit if *just* QHS is railed or below 300 since the current
charge model was only set up for QHS. In the future, it would be nice to
instead use the best charge (either QHS or QLX) in the likelihood function. To
do that I need to double check how QLX is normalized and if the current charge
model would work for QLX too.
Diffstat (limited to 'src/zdab_utils.c')
-rw-r--r-- | src/zdab_utils.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/zdab_utils.c b/src/zdab_utils.c index 6dffe0f..b46ca1f 100644 --- a/src/zdab_utils.c +++ b/src/zdab_utils.c @@ -105,6 +105,18 @@ int get_event(zebraFile *f, event *ev, zebraBank *bev) if (bpmt.pf & KPF_DIS) ev->pmt_hits[id].flags |= PMT_FLAG_DIS; + if (bpmt.qms) + ev->pmt_hits[id].flags |= PMT_FLAG_CHARGE; + + /* Currently, the charge model only deals with QHS, so we flag any hits which have a bad or railed QHS value. + * + * FIXME: In the future, it would be nice to use the best charge + * word (either QHS or QLX) depending on the if QHS is railed or + * not, but I need to do more work to see how the QLX values are + * normalized and if the existing charge model is good enough. */ + if (bpmt.pihs >= 4095 || bpmt.pihs < 300) + 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]); |