diff options
author | tlatorre <tlatorre@uchicago.edu> | 2019-09-30 15:12:13 -0500 |
---|---|---|
committer | tlatorre <tlatorre@uchicago.edu> | 2019-09-30 15:12:13 -0500 |
commit | 33bea0e6a0c3b585b6feefc8465465fb0fc819e5 (patch) | |
tree | 2db83cda0d3db6c6a55924ac07fddad479791d0b | |
parent | 5105265f749a73c719d9d5d9728a36cb9e33f5c6 (diff) | |
download | sddm-33bea0e6a0c3b585b6feefc8465465fb0fc819e5.tar.gz sddm-33bea0e6a0c3b585b6feefc8465465fb0fc819e5.tar.bz2 sddm-33bea0e6a0c3b585b6feefc8465465fb0fc819e5.zip |
update flasher cut to only check for normal PMTs
-rw-r--r-- | src/dc.c | 15 |
1 files changed, 11 insertions, 4 deletions
@@ -807,6 +807,11 @@ static int is_flasher_channel(event *ev, int flasher_pmt_id, double *t_pc, int n COPY(flasher_pos,pmts[flasher_pmt_id].pos); + if (NORM(flasher_pos) > 10000.0) { + fprintf(stderr, "is_flasher_channel: potential flasher PMT pos = %.2f, %.2f %.2f! Skipping...\n", flasher_pos[0], flasher_pos[1], flasher_pos[2]); + return 0; + } + /* Calculate the median time for PMT hits in the paddle card. * * Note: Initially this algorithm just used the time of the highest @@ -1110,10 +1115,12 @@ int is_flasher(event *ev) } else if (qlx_pc[index_qlx[nhit-1]] < 800) { /* Check to see if the missing channel in the PC is the flasher. */ for (i = 0; i < 8; i++) { - channel = (id % 4)*8 + i; - if (!ev->pmt_hits[crate*512 + card*32 + channel].hit && \ - is_slot_early(ev, crate*512 + card*32 + channel) && \ - is_flasher_channel(ev,crate*512 + card*32 + channel,t_pc,nhit)) return 1; + id = crate*512 + card*32 + (id % 4)*8 + i; + + /* Skip channels which were hit or are not a normal PMT. */ + if (ev->pmt_hits[id].hit || pmts[id].pmt_type != PMT_NORMAL) continue; + + if (is_slot_early(ev, id) && is_flasher_channel(ev,id,t_pc,nhit)) return 1; } continue; } else { |