aboutsummaryrefslogtreecommitdiff
path: root/src/dc.c
diff options
context:
space:
mode:
authortlatorre <tlatorre@uchicago.edu>2019-06-23 16:08:37 -0500
committertlatorre <tlatorre@uchicago.edu>2019-06-23 16:08:37 -0500
commitf3336bbeed4258d4b6e009d361329d4518aadc86 (patch)
treeb701f90a68f8fb4ad560e995e2057fab6b3ecef1 /src/dc.c
parentd997c4d8e0b429f7fab846a13e7c0d9725a58231 (diff)
downloadsddm-f3336bbeed4258d4b6e009d361329d4518aadc86.tar.gz
sddm-f3336bbeed4258d4b6e009d361329d4518aadc86.tar.bz2
sddm-f3336bbeed4258d4b6e009d361329d4518aadc86.zip
update flasher cut
This commit updates the flasher cut to use the median hit time for all hits in the paddle card instead of just the time of the channel with the highest charge.
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 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. */