From dadf6abbb080efba06c991bcaa94324dd6f5d2a0 Mon Sep 17 00:00:00 2001 From: tlatorre Date: Fri, 14 Jun 2019 17:08:20 -0500 Subject: add trigger word and trigger time in ns to the YAML file --- src/event.h | 8 +++++++- src/fit.c | 6 +++++- 2 files changed, 12 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/event.h b/src/event.h index 7c7f990..1c349e3 100644 --- a/src/event.h +++ b/src/event.h @@ -63,8 +63,14 @@ typedef struct pmt_hit { typedef struct event { int run; - uint32_t gtid; + /* Global trigger time in ns. */ + double trigger_time; + /* Number of hit PMTs without flags. */ int nhit; + /* Global trigger ID. */ + uint32_t gtid; + /* Trigger word. See trigger_mask_bits.inc. */ + uint32_t trigger_type; pmt_hit pmt_hits[MAX_PMTS]; } event; diff --git a/src/fit.c b/src/fit.c index fd62c45..29b5957 100644 --- a/src/fit.c +++ b/src/fit.c @@ -6157,6 +6157,8 @@ skip_mc: unpack_ev(b.data, &bev); ev.run = bev.run; ev.gtid = bev.gtr_id; + ev.trigger_type = bev.trg_type; + ev.trigger_time = bev.gtr; if (gtid > 0 && ev.gtid != gtid) goto skip_event; @@ -6183,8 +6185,10 @@ skip_mc: if (fout) { fprintf(fout, " - run: %i\n", ev.run); - fprintf(fout, " gtid: %i\n", ev.gtid); + fprintf(fout, " gtr: %.0f\n", ev.trigger_time); fprintf(fout, " nhit: %zu\n", nhit); + fprintf(fout, " gtid: %i\n", ev.gtid); + fprintf(fout, " trg_type: 0x%08x\n", ev.trigger_type); fprintf(fout, " dc: 0x%08x\n", get_dc_word(&ev, f, &bmast, &b)); } -- cgit