aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-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)