aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/dc.c21
-rw-r--r--src/dc.h10
-rw-r--r--src/fit.c7
3 files changed, 32 insertions, 6 deletions
diff --git a/src/dc.c b/src/dc.c
index bc8c017..230e373 100644
--- a/src/dc.c
+++ b/src/dc.c
@@ -26,6 +26,27 @@
#include "zebra.h"
#include <gsl/gsl_statistics_double.h>
+/* Returns the data cleaning bitmask for the event `ev`. */
+uint32_t get_dc_word(event *ev, zebraFile *f, zebraBank *bmast, zebraBank *bev)
+{
+ uint32_t status = 0x0;
+
+ if (is_muon(ev))
+ status |= DC_MUON;
+ if (junk_cut(f, bmast, bev))
+ status |= DC_JUNK;
+ if (crate_isotropy(ev))
+ status |= DC_CRATE_ISOTROPY;
+ if (qvnhit(ev))
+ status |= DC_QVNHIT;
+ if (is_neck_event(ev))
+ status |= DC_NECK;
+ if (is_flasher(ev))
+ status |= DC_FLASHER;
+
+ return status;
+}
+
/* Returns 1 if the event is tagged as an incoming muon. The goal of this cut
* is to tag external muons *without* tagging muons which start within the PSUP
* and then exit. In order to achieve that we use the ECA time of the OWL
diff --git a/src/dc.h b/src/dc.h
index 89a7670..4635806 100644
--- a/src/dc.h
+++ b/src/dc.h
@@ -19,6 +19,15 @@
#include "event.h"
#include "zebra.h"
+#include <stdint.h>
+
+/* Data cleaning bitmasks. */
+#define DC_MUON 0x1
+#define DC_JUNK 0x2
+#define DC_CRATE_ISOTROPY 0x4
+#define DC_QVNHIT 0x8
+#define DC_NECK 0x10
+#define DC_FLASHER 0x20
/* Minimum number of normal PMTs which must be hit to be tagged as an incoming
* muon. */
@@ -34,6 +43,7 @@
/* QvNHIT ratio threshold. */
#define QRATIO_THRESHOLD 0.25
+uint32_t get_dc_word(event *ev, zebraFile *f, zebraBank *bmast, zebraBank *bev);
int is_muon(event *ev);
int junk_cut(zebraFile *f, zebraBank *bmast, zebraBank *bev);
int crate_isotropy(event *ev);
diff --git a/src/fit.c b/src/fit.c
index cb8409b..84ebbdc 100644
--- a/src/fit.c
+++ b/src/fit.c
@@ -6184,12 +6184,7 @@ skip_mc:
fprintf(fout, " - run: %i\n", ev.run);
fprintf(fout, " gtid: %i\n", ev.gtid);
fprintf(fout, " nhit: %zu\n", nhit);
- fprintf(fout, " is_flasher: %i\n", is_flasher(&ev));
- fprintf(fout, " is_muon: %i\n", is_muon(&ev));
- fprintf(fout, " is_junk: %i\n", junk_cut(f, &bmast, &b));
- fprintf(fout, " is_crate_isotropy: %i\n", crate_isotropy(&ev));
- fprintf(fout, " is_qvnhit: %i\n", qvnhit(&ev));
- fprintf(fout, " is_neck_event: %i\n", is_neck_event(&ev));
+ fprintf(fout, " dc: 0x%08x\n", get_dc_word(&ev, f, &bmast, &b));
}
if (nhit < min_nhit) goto skip_event;