aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authortlatorre <tlatorre@uchicago.edu>2019-09-24 14:10:45 -0500
committertlatorre <tlatorre@uchicago.edu>2019-09-24 14:10:45 -0500
commit9c422dff8e8c06c1d14583274822f665391284ae (patch)
tree07405e79896b4292bad520b2c36a1ee83bf8b3b0 /src
parent8fcc9a0b44ebde54a1ae3679c572833772823060 (diff)
downloadsddm-9c422dff8e8c06c1d14583274822f665391284ae.tar.gz
sddm-9c422dff8e8c06c1d14583274822f665391284ae.tar.bz2
sddm-9c422dff8e8c06c1d14583274822f665391284ae.zip
update breakdown cut to include a cut on the number of calibrated PMT hits
This commit updates the breakdown cut to flag any event in which less than 70% of the PMT hits have a good TAC value.
Diffstat (limited to 'src')
-rw-r--r--src/dc.c25
-rw-r--r--src/dc.h7
2 files changed, 26 insertions, 6 deletions
diff --git a/src/dc.c b/src/dc.c
index 6d538b4..e8a3183 100644
--- a/src/dc.c
+++ b/src/dc.c
@@ -623,25 +623,42 @@ int is_breakdown(event *ev)
int i;
double tac[20][512];
int nhit[20] = {0};
+ int nhit_cal[20] = {0};
+ int nhit_cal_sum;
double median_tac[20];
size_t index[20];
/* Breakdown event must have an nhit greater than 1000. */
if (ev->nhit < 1000) return 0;
+ nhit_cal_sum = 0;
for (i = 0; i < MAX_PMTS; i++) {
if (!ev->pmt_hits[i].hit || pmts[i].pmt_type != PMT_NORMAL) continue;
- tac[i/512][nhit[i/512]++] = ev->pmt_hits[i].tac;
+ nhit[i/512] += 1;
+
+ /* Sometimes during a breakdown, a lot of the channels have TAC values
+ * that are outside of the normal window. I'm not sure exactly what
+ * causes this, but we don't want to include these when calculating the
+ * median. */
+ if (ev->pmt_hits[i].tac < 400) continue;
+
+ tac[i/512][nhit_cal[i/512]++] = ev->pmt_hits[i].tac;
+
+ nhit_cal_sum += 1;
}
+ /* Tag any event in which less than 70% of the PMT hit times are calibrated
+ * correctly. */
+ if (nhit_cal_sum < ev->nhit*BREAKDOWN_CAL_FRAC) return 1;
+
for (i = 0; i < 19; i++) {
- if (nhit[i] <= MIN_NHIT_CRATE) {
+ if (nhit_cal[i] <= MIN_NHIT_CRATE) {
median_tac[i] = 0.0;
continue;
}
- gsl_sort(&tac[i][0],1,nhit[i]);
- median_tac[i] = gsl_stats_median_from_sorted_data(&tac[i][0],1,nhit[i]);
+ gsl_sort(&tac[i][0],1,nhit_cal[i]);
+ median_tac[i] = gsl_stats_median_from_sorted_data(&tac[i][0],1,nhit_cal[i]);
}
fargsort(median_tac,19,index);
diff --git a/src/dc.h b/src/dc.h
index e999235..248a6e0 100644
--- a/src/dc.h
+++ b/src/dc.h
@@ -38,9 +38,12 @@
/* Minimum number of hits required for a crate to be considered the source of a
* breakdown. */
#define MIN_NHIT_BREAKDOWN 256
-/* Minimum number of hits for a crate to calculate the median TAC in the
- * breakdown cut. */
+/* Minimum number of calibrated hits for a crate to calculate the median TAC in
+ * the breakdown cut. */
#define MIN_NHIT_CRATE 20
+/* Fraction of PMT hits which must have a good TAC value in order to pass the
+ * cut. */
+#define BREAKDOWN_CAL_FRAC 0.7
/* Length of the sliding window used in the ITC cut (ns). */
#define ITC_TIME_WINDOW 93.0