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