aboutsummaryrefslogtreecommitdiff
path: root/src/dc.c
diff options
context:
space:
mode:
authortlatorre <tlatorre@uchicago.edu>2019-07-16 11:19:34 -0500
committertlatorre <tlatorre@uchicago.edu>2019-07-16 11:19:34 -0500
commitebe279926c5c03ee054d520900715f0315dc5d0a (patch)
tree4cb051b07cc2dc07bce81aa736f6bc517e034341 /src/dc.c
parentceb609472547935b056911643564860190a0a165 (diff)
downloadsddm-ebe279926c5c03ee054d520900715f0315dc5d0a.tar.gz
sddm-ebe279926c5c03ee054d520900715f0315dc5d0a.tar.bz2
sddm-ebe279926c5c03ee054d520900715f0315dc5d0a.zip
update neck tube cut to include time difference changes due to cable changes
Diffstat (limited to 'src/dc.c')
-rw-r--r--src/dc.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/src/dc.c b/src/dc.c
index ff99f3f..7242617 100644
--- a/src/dc.c
+++ b/src/dc.c
@@ -453,6 +453,20 @@ int qvnhit(event *ev)
return qhl_ratio < QRATIO_THRESHOLD;
}
+/* Returns the time difference between the neck PMT hit and the average ECA
+ * time of the PSUP PMTs required to tag an event as a neck event.
+ *
+ * These values come from the neck tube cut table in prod/filter_flth.dat. */
+double get_neck_tube_cut_time_diff(event *ev)
+{
+ if (ev->dte < 19991216 || (ev->dte == 19991216 && ev->hmsc < 20370000))
+ return 70.0;
+ else if (ev->dte < 20040923 || (ev->dte < 20040923 && ev->hmsc < 100222))
+ return 15.0;
+ else
+ return -85.0;
+}
+
/* Returns 1 if the event is classified as a neck event. The definition of
* a neck event is a combination of the neck flag in the DAMN word:
*
@@ -480,6 +494,7 @@ int is_neck_event(event *ev)
int high_charge;
double avg_ept_psup;
int nhit, nhit_bottom;
+ double time_diff;
/* First, we compute the average ECA time for all the PSUP PMTs with z <= 0. */
@@ -501,6 +516,8 @@ int is_neck_event(event *ev)
avg_ept_psup /= nhit;
+ time_diff = get_neck_tube_cut_time_diff(ev);
+
/* Now, we check if two or more neck tubes fired *or* a single neck tube
* fired with a high charge and 70 ns before the average time of the normal
* PMTs. */
@@ -523,7 +540,7 @@ int is_neck_event(event *ev)
* of the PSUP PMTS with z les than 0." When does this change take
* place? */
if ((ev->pmt_hits[i].ehs > 70 || ev->pmt_hits[i].ehs < -110) &&
- (ev->pmt_hits[i].ept < avg_ept_psup - 70.0)) high_charge = 1;
+ (ev->pmt_hits[i].ept < avg_ept_psup - time_diff)) high_charge = 1;
break;
case PMT_NORMAL:
nhit += 1;