From 24c8bcfe7f76b20124e2862ea050f815c0f768e7 Mon Sep 17 00:00:00 2001 From: tlatorre Date: Tue, 14 Aug 2018 10:08:27 -0500 Subject: move everything to src directory --- dqxx.c | 67 ------------------------------------------------------------------ 1 file changed, 67 deletions(-) delete mode 100644 dqxx.c (limited to 'dqxx.c') diff --git a/dqxx.c b/dqxx.c deleted file mode 100644 index 07b6037..0000000 --- a/dqxx.c +++ /dev/null @@ -1,67 +0,0 @@ -#include "dqxx.h" -#include "db.h" -#include /* for uint32_t */ -#include "event.h" -#include /* for sprintf() */ - -char dqxx_err[256]; - -/* Flag PMTs which are not operational based on the DQCH and DQCR banks. - * - * Returns 0 on success or -1 on error. */ -int dqxx_init(dict *db, event *ev) -{ - int i, j, k, id; - uint32_t *dqch, *dqcr, dqch_word, dqcr_word; - - for (i = 0; i < 19; i++) { - dqch = (uint32_t *) get_bank(db, "DQCH", i); - dqcr = (uint32_t *) get_bank(db, "DQCR", i); - - if (!dqch) { - sprintf(dqxx_err, "failed to load DQCH for crate %i\n", i); - return -1; - } - - if (!dqcr) { - sprintf(dqxx_err, "failed to load DQCR for crate %i\n", i); - return -1; - } - - for (j = 0; j < 16; j++) { - dqcr_word = dqcr[30+KDQCR_TABLE+j]; - - for (k = 0; k < 32; k++) { - id = i*512 + j*32 + k; - dqch_word = dqch[30+KDQCH_TABLE+32*j+k]; - - - if (dqch_word & KDQCH_B_PMT_CABLE) - ev->pmt_hits[id].flags |= 0x2; - else if (dqch_word & KDQCH_B_PMTIC_RESISTOR) - ev->pmt_hits[id].flags |= 0x2; - else if (dqch_word & KDQCH_B_SEQUENCER) - ev->pmt_hits[id].flags |= 0x2; - else if (dqch_word & KDQCH_B_750OHM) - ev->pmt_hits[id].flags |= 0x2; - else if (dqch_word & KDQCH_B_NOT_OP) - ev->pmt_hits[id].flags |= 0x2; - - if (dqcr_word & KDQCR_B_CRATE) - ev->pmt_hits[id].flags |= 0x2; - else if (dqcr_word & KDQCR_B_MB) - ev->pmt_hits[id].flags |= 0x2; - else if (dqcr_word & KDQCR_B_PMTIC) - ev->pmt_hits[id].flags |= 0x2; - else if (dqcr_word & KDQCR_B_DAQ) - ev->pmt_hits[id].flags |= 0x2; - else if (dqcr_word & KDQCR_B_GT) - ev->pmt_hits[id].flags |= 0x2; - else if (dqcr_word & (1 << (12 + k/8))) - ev->pmt_hits[id].flags |= 0x2; - } - } - } - - return 0; -} -- cgit