diff options
Diffstat (limited to 'src/dc.c')
-rw-r--r-- | src/dc.c | 15 |
1 files changed, 11 insertions, 4 deletions
@@ -788,16 +788,23 @@ int is_flasher(event *ev) if (qhs_pc[index_qhs[nhit-1]] > 4000) { channel = channel_pc[index_qhs[nhit-1]]; - t = t_pc[index_qhs[nhit-1]]; } else if (qhl_pc[index_qhl[nhit-1]] > 4000) { channel = channel_pc[index_qhl[nhit-1]]; - t = t_pc[index_qhl[nhit-1]]; - } else { + } else if (qlx_pc[index_qlx[nhit-1]] > 4000) { channel = channel_pc[index_qlx[nhit-1]]; - t = t_pc[index_qlx[nhit-1]]; } COPY(flasher_pos,pmts[crate*512 + card*32 + channel].pos); + /* Calculate the median time for PMT hits in the paddle card. + * + * Note: Initially this algorithm just used the time of the highest + * charge channel. However, in looking at events in run 10,000 I + * noticed two flashers which were not flagged by the cut because the + * flasher channel had a normal time. Therefore, we now use the median + * time for all channels in the paddle card. */ + gsl_sort(t_pc,1,nhit); + t = gsl_stats_median_from_sorted_data(t_pc,1,nhit); + /* Check that 70% of the regular PMTs in the event which are not in the * flasher slot fired more than 50 ns after the high charge channel and are * more than 12 meters away from the high charge channel. */ |