diff options
| -rw-r--r-- | src/dc.c | 21 | ||||
| -rw-r--r-- | src/dc.h | 10 | ||||
| -rw-r--r-- | src/fit.c | 7 | 
3 files changed, 32 insertions, 6 deletions
| @@ -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 @@ -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); @@ -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; | 
