From 4742e006a0605f64ddb99cdf14de4480e18bb029 Mon Sep 17 00:00:00 2001 From: Anna Heggestuen Date: Tue, 3 Dec 2024 13:42:20 -0600 Subject: [PATCH 1/2] replace uint with unsigned int in FillCRTPMTMatch --- sbncode/CAFMaker/CAFMaker_module.cc | 2 +- sbncode/CAFMaker/FillReco.cxx | 5 +++-- sbncode/CAFMaker/FillReco.h | 5 +++-- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/sbncode/CAFMaker/CAFMaker_module.cc b/sbncode/CAFMaker/CAFMaker_module.cc index f3b51bcb3..f46b99844 100644 --- a/sbncode/CAFMaker/CAFMaker_module.cc +++ b/sbncode/CAFMaker/CAFMaker_module.cc @@ -1559,7 +1559,7 @@ void CAFMaker::produce(art::Event& evt) noexcept { if(crtpmtmatch_handle.isValid()){ const std::vector &crtpmtmatches = *crtpmtmatch_handle; for (unsigned i = 0; i < crtpmtmatches.size(); i++) { - int topen = 0, topex = 0, sideen = 0, sideex = 0; // bottomen = 0, bottomex = 0; + unsigned int topen = 0, topex = 0, sideen = 0, sideex = 0; // bottomen = 0, bottomex = 0; srcrtpmtmatches.emplace_back(); FillCRTPMTMatch(crtpmtmatches[i], topen, topex, sideen, sideex, diff --git a/sbncode/CAFMaker/FillReco.cxx b/sbncode/CAFMaker/FillReco.cxx index a5b64d457..f34a82a9c 100644 --- a/sbncode/CAFMaker/FillReco.cxx +++ b/sbncode/CAFMaker/FillReco.cxx @@ -141,8 +141,9 @@ namespace caf } void FillCRTPMTMatch(const sbn::crt::CRTPMTMatching &match, - int &topen, int &topex, int &sideen, int &sideex, - //int &bottomen, int &bottomex, + unsigned int topen, unsigned int topex, + unsigned int sideen, unsigned int sideex, + //unsigned int &bottomen, unsigned int &bottomex, caf::SRCRTPMTMatch &srmatch, bool allowEmpty){ // allowEmpty does not (yet) matter here diff --git a/sbncode/CAFMaker/FillReco.h b/sbncode/CAFMaker/FillReco.h index 50b5f5748..1fb53b843 100644 --- a/sbncode/CAFMaker/FillReco.h +++ b/sbncode/CAFMaker/FillReco.h @@ -222,8 +222,9 @@ namespace caf caf::SROpFlash &srflash, bool allowEmpty = false); void FillCRTPMTMatch(const sbn::crt::CRTPMTMatching &match, - int &topen, int &topex, int &sideen, int &sidex, - //int &bottomen, int &bottomex, + unsigned int topen, unsigned int topex, + unsigned int sideen, unsigned int sidex, + //unsigned int &bottomen, unsigned int &bottomex, caf::SRCRTPMTMatch &srmatch, bool allowEmpty = false); From 08169af69a2317ba0c8c9869d705ae5fcce0f1f2 Mon Sep 17 00:00:00 2001 From: Anna Heggestuen Date: Tue, 3 Dec 2024 16:28:13 -0600 Subject: [PATCH 2/2] remove unused counters from FillCRTPMTMatch function --- sbncode/CAFMaker/CAFMaker_module.cc | 6 +----- sbncode/CAFMaker/FillReco.cxx | 4 +--- sbncode/CAFMaker/FillReco.h | 3 --- 3 files changed, 2 insertions(+), 11 deletions(-) diff --git a/sbncode/CAFMaker/CAFMaker_module.cc b/sbncode/CAFMaker/CAFMaker_module.cc index f46b99844..aaa4c1fa7 100644 --- a/sbncode/CAFMaker/CAFMaker_module.cc +++ b/sbncode/CAFMaker/CAFMaker_module.cc @@ -1559,12 +1559,8 @@ void CAFMaker::produce(art::Event& evt) noexcept { if(crtpmtmatch_handle.isValid()){ const std::vector &crtpmtmatches = *crtpmtmatch_handle; for (unsigned i = 0; i < crtpmtmatches.size(); i++) { - unsigned int topen = 0, topex = 0, sideen = 0, sideex = 0; // bottomen = 0, bottomex = 0; srcrtpmtmatches.emplace_back(); - FillCRTPMTMatch(crtpmtmatches[i], - topen, topex, sideen, sideex, - //bottomen, bottomex, - srcrtpmtmatches.back()); + FillCRTPMTMatch(crtpmtmatches[i], srcrtpmtmatches.back()); } } diff --git a/sbncode/CAFMaker/FillReco.cxx b/sbncode/CAFMaker/FillReco.cxx index f34a82a9c..358be7d94 100644 --- a/sbncode/CAFMaker/FillReco.cxx +++ b/sbncode/CAFMaker/FillReco.cxx @@ -141,9 +141,6 @@ namespace caf } void FillCRTPMTMatch(const sbn::crt::CRTPMTMatching &match, - unsigned int topen, unsigned int topex, - unsigned int sideen, unsigned int sideex, - //unsigned int &bottomen, unsigned int &bottomex, caf::SRCRTPMTMatch &srmatch, bool allowEmpty){ // allowEmpty does not (yet) matter here @@ -160,6 +157,7 @@ namespace caf srmatch.flashPosition = SRVector3D (match.flashPosition.X(), match.flashPosition.Y(), match.flashPosition.Z()); srmatch.flashYWidth = match.flashYWidth; srmatch.flashZWidth = match.flashZWidth; + unsigned int topen = 0, topex = 0, sideen = 0, sideex = 0; for(const auto& matchedCRTHit : match.matchedCRTHits){ caf::SRMatchedCRT matchedCRT; matchedCRT.PMTTimeDiff = matchedCRTHit.PMTTimeDiff; diff --git a/sbncode/CAFMaker/FillReco.h b/sbncode/CAFMaker/FillReco.h index 1fb53b843..449a03ee7 100644 --- a/sbncode/CAFMaker/FillReco.h +++ b/sbncode/CAFMaker/FillReco.h @@ -222,9 +222,6 @@ namespace caf caf::SROpFlash &srflash, bool allowEmpty = false); void FillCRTPMTMatch(const sbn::crt::CRTPMTMatching &match, - unsigned int topen, unsigned int topex, - unsigned int sideen, unsigned int sidex, - //unsigned int &bottomen, unsigned int &bottomex, caf::SRCRTPMTMatch &srmatch, bool allowEmpty = false);