aboutsummaryrefslogtreecommitdiff
path: root/src/dc.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/dc.c')
-rw-r--r--src/dc.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/dc.c b/src/dc.c
index 9c72f67..05a8010 100644
--- a/src/dc.c
+++ b/src/dc.c
@@ -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 {