From d1000a92c891904199784f0d157208e0e9fe2d28 Mon Sep 17 00:00:00 2001 From: tlatorre Date: Mon, 9 Sep 2019 11:21:38 -0500 Subject: update get_event() to use the PMT types from the snoman.ratdb file This commit updates get_event() to assume the PMT type is correct in the pmt.txt file instead of assuming the SNOMAN bank is correct. The reason for this is that according to the email from Stan 3/15/9 should be a neck PMT (at least in the NCD phase) and that is what the pmt.txt file says it should be. In addition, the changes that Stan said were needed in ccc_type.for never got made. --- src/zdab_utils.c | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) (limited to 'src') diff --git a/src/zdab_utils.c b/src/zdab_utils.c index 7c3d2ae..27ea086 100644 --- a/src/zdab_utils.c +++ b/src/zdab_utils.c @@ -80,6 +80,7 @@ int get_event(zebraFile *f, event *ev, zebraBank *bev) static char *pmt_names[] = {"PMT","OWL","LG","FECD","BUTT","NECK"}; char pmt_type_string[256]; EVBank ev_bank; + static int warned[MAX_PMTS]; for (i = 0; i < MAX_PMTS; i++) { ev->pmt_hits[i].hit = 0; @@ -235,12 +236,7 @@ int get_event(zebraFile *f, event *ev, zebraBank *bev) ev->pmt_hits[id].flags |= PMT_FLAG_CHARGE; } - if (pmts[id].pmt_type != pmt_types[i]) { - get_pmt_type_string(pmts[id].pmt_type,pmt_type_string); - fprintf(stderr, "%i/%i/%i has PMT type %s but expected %s based on bank\n", crate, card, channel, pmt_type_string, pmt_names[i]); - } - - /* The above check prints out a warning on a handful of channels: + /* The following check prints out a warning on a handful of channels: * * 3/15/9 has PMT type NECK but expected OWL based on bank * 18/0/14 has PMT type INVALID but expected BUTT based on bank @@ -297,14 +293,15 @@ int get_event(zebraFile *f, event *ev, zebraBank *bev) * > > > --- * > > > Stan Seibert * - * I also looked at the run in XSNOED and it looks like 3/15/9 - * should be an OWL PMT and not a neck PMT. - * - * Based on the email and the fact that 3/15/9 *should* be an OWL - * PMT, I am going to assume that the database that SNOMAN uses to - * figure out the PMT types is correct and so reassign the PMT type - * based on that. */ - pmts[id].pmt_type = pmt_types[i]; + * Based on the email and the fact that ccc_type.for was never + * updated, we'll assume that the PMT type in snoman.ratdb is + * correct. */ + + if (pmts[id].pmt_type != pmt_types[i] && !warned[id]) { + get_pmt_type_string(pmts[id].pmt_type,pmt_type_string); + fprintf(stderr, "%i/%i/%i has PMT type %s but expected %s based on bank\n", crate, card, channel, pmt_type_string, pmt_names[i]); + warned[id] = 1; + } if (!b.next) break; -- cgit