diff options
author | tlatorre <tlatorre@uchicago.edu> | 2019-09-09 11:21:38 -0500 |
---|---|---|
committer | tlatorre <tlatorre@uchicago.edu> | 2019-09-09 11:21:38 -0500 |
commit | d1000a92c891904199784f0d157208e0e9fe2d28 (patch) | |
tree | d3c1eaa0d6074ef4737e69f02e50edc674017ab2 /src/zdab_utils.c | |
parent | da14d3f2362af2d8f49dd805c0c762cb3276409f (diff) | |
download | sddm-d1000a92c891904199784f0d157208e0e9fe2d28.tar.gz sddm-d1000a92c891904199784f0d157208e0e9fe2d28.tar.bz2 sddm-d1000a92c891904199784f0d157208e0e9fe2d28.zip |
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.
Diffstat (limited to 'src/zdab_utils.c')
-rw-r--r-- | src/zdab_utils.c | 25 |
1 files changed, 11 insertions, 14 deletions
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; |