diff options
Diffstat (limited to 'src/fit.c')
-rw-r--r-- | src/fit.c | 43 |
1 files changed, 24 insertions, 19 deletions
@@ -5776,6 +5776,25 @@ void sigint_handler(int dummy) stop = 1; } +size_t get_nhit(event *ev) +{ + /* Returns the number of PMT hits in event `ev`. + * + * Note: Only hits on normal PMTs which aren't flagged are counted. */ + size_t i, nhit; + + nhit = 0; + for (i = 0; i < MAX_PMTS; i++) { + if (ev->pmt_hits[i].flags || pmts[i].pmt_type != PMT_NORMAL) continue; + + if (!ev->pmt_hits[i].hit) continue; + + nhit++; + } + + return nhit; +} + int get_event(zebraFile *f, event *ev, zebraBank *bev) { /* Read all the PMT banks from the zebra file and update `ev`. @@ -5810,6 +5829,9 @@ int get_event(zebraFile *f, event *ev, zebraBank *bev) id = crate*512 + card*32 + channel; ev->pmt_hits[id].hit = 1; ev->pmt_hits[id].t = bpmt.pt; + ev->pmt_hits[id].qihl = bpmt.pihl; + ev->pmt_hits[id].qihs = bpmt.pihs; + ev->pmt_hits[id].qilx = bpmt.pilx; ev->pmt_hits[id].qhl = bpmt.phl; ev->pmt_hits[id].qhs = bpmt.phs; ev->pmt_hits[id].qlx = bpmt.plx; @@ -5825,26 +5847,9 @@ int get_event(zebraFile *f, event *ev, zebraBank *bev) } } - return 0; -} - -size_t get_nhit(event *ev) -{ - /* Returns the number of PMT hits in event `ev`. - * - * Note: Only hits on normal PMTs which aren't flagged are counted. */ - size_t i, nhit; + ev->nhit = get_nhit(ev); - nhit = 0; - for (i = 0; i < MAX_PMTS; i++) { - if (ev->pmt_hits[i].flags || pmts[i].pmt_type != PMT_NORMAL) continue; - - if (!ev->pmt_hits[i].hit) continue; - - nhit++; - } - - return nhit; + return 0; } void sprintf_particle_string(int *id, size_t n, char *str) |