From f332b293430d5641575917686d7dc128c309acf5 Mon Sep 17 00:00:00 2001 From: tlatorre Date: Thu, 23 May 2019 11:22:15 -0400 Subject: add zdab-cat This commit adds a new program called zdab-cat which is kind of like fit, but just produces the YAML output without actually fitting anything. --- src/test-find-peaks.c | 47 ----------------------------------------------- 1 file changed, 47 deletions(-) (limited to 'src/test-find-peaks.c') diff --git a/src/test-find-peaks.c b/src/test-find-peaks.c index bf623b2..a825f4b 100644 --- a/src/test-find-peaks.c +++ b/src/test-find-peaks.c @@ -171,53 +171,6 @@ void plot_find_peaks(event *ev, double *pos, double *peak_theta, double *peak_ph } } -int get_event(zebraFile *f, event *ev, zebraBank *bev) -{ - /* Read all the PMT banks from the zebra file and update `ev`. - * - * Returns 0 on success, -1 on error. */ - int i, rv; - PMTBank bpmt; - zebraBank b; - int id, crate, card, channel; - - for (i = 0; i < MAX_PMTS; i++) { - ev->pmt_hits[i].hit = 0; - } - - rv = zebra_get_bank(f,&b,bev->links[KEV_PMT-1]); - - if (rv) { - fprintf(stderr, "error getting PMT bank: %s\n", zebra_err); - return -1; - } - - while (1) { - unpack_pmt(b.data, &bpmt); - card = bpmt.pin/1024; - crate = (bpmt.pin % 1024)/32; - channel = bpmt.pin % 32; - id = crate*512 + card*32 + channel; - ev->pmt_hits[id].hit = 1; - ev->pmt_hits[id].t = bpmt.pt; - ev->pmt_hits[id].qhl = bpmt.phl; - ev->pmt_hits[id].qhs = bpmt.phs; - ev->pmt_hits[id].qlx = bpmt.plx; - ev->pmt_hits[id].flags |= bpmt.pf & KPF_DIS; - - if (!b.next) break; - - rv = zebra_get_bank(f,&b,b.next); - - if (rv) { - fprintf(stderr, "error getting PMT bank: %s\n", zebra_err); - return -1; - } - } - - return 0; -} - void usage(void) { fprintf(stderr,"Usage: ./test-find-peaks [options] FILENAME\n"); -- cgit