aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortlatorre <tlatorre@uchicago.edu>2019-06-16 13:54:39 -0500
committertlatorre <tlatorre@uchicago.edu>2019-06-16 13:54:39 -0500
commit96ac7faf825f94791042da139b65e91ea4bf2c4e (patch)
tree9c9ac6cdb8969860b2ced3c31acf7a6ffa48a58f
parente9c763e3227f69d4b7d35d6afce3abf3a747823c (diff)
downloadsddm-96ac7faf825f94791042da139b65e91ea4bf2c4e.tar.gz
sddm-96ac7faf825f94791042da139b65e91ea4bf2c4e.tar.bz2
sddm-96ac7faf825f94791042da139b65e91ea4bf2c4e.zip
check the KPF_NO_CAL and KPF_BAD_CAL bits in get_event()
-rw-r--r--src/zdab_utils.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/zdab_utils.c b/src/zdab_utils.c
index 5c1ef9f..df1cef8 100644
--- a/src/zdab_utils.c
+++ b/src/zdab_utils.c
@@ -105,7 +105,20 @@ int get_event(zebraFile *f, event *ev, zebraBank *bev)
/* Clear the PMT_FLAG_DIS bit. */
ev->pmt_hits[id].flags &= ~PMT_FLAG_DIS;
- if (bpmt.pf & KPF_DIS)
+ /* Make sure we have good calibrations. Technically, we should only
+ * have to check the KPF_DIS bit since according to the SNOMAN
+ * docs:
+ *
+ * The discard bit KPF_DIS of the 1-bit flags KPMT_PF is also
+ * set if any other failure bit, such as KPF_NO_CAL or
+ * KPF_BAD_CAL is set. So only this bit need be tested for PMT
+ * rejection.
+ *
+ * But this isn't true! In run 10,000 GTID 140730 channel 11/6/17
+ * has the KPF_BAD_CAL bit set but not the KPF_DIS bit set. I also
+ * looked at the SNOMAN code and confirmed that this isn't the
+ * case. */
+ if (bpmt.pf & (KPF_DIS | KPF_NO_CAL | KPF_BAD_CAL))
ev->pmt_hits[id].flags |= PMT_FLAG_DIS;
if (bpmt.qms)