diff --git a/sbncode/CAFMaker/CAFMaker_module.cc b/sbncode/CAFMaker/CAFMaker_module.cc index 1fe60c20e..70cf030d4 100644 --- a/sbncode/CAFMaker/CAFMaker_module.cc +++ b/sbncode/CAFMaker/CAFMaker_module.cc @@ -1549,22 +1549,17 @@ void CAFMaker::produce(art::Event& evt) noexcept { } } - // Get all of the CRTPMT Matches .. + // Get all of the CRTPMT Matches std::vector srcrtpmtmatches; - std::cout << "srcrtpmtmatches.size = " << srcrtpmtmatches.size() << "\n"; art::Handle> crtpmtmatch_handle; GetByLabelStrict(evt, fParams.CRTPMTLabel(), crtpmtmatch_handle); if(crtpmtmatch_handle.isValid()){ - std::cout << "valid handle! label: " << fParams.CRTPMTLabel() << "\n"; const std::vector &crtpmtmatches = *crtpmtmatch_handle; for (unsigned i = 0; i < crtpmtmatches.size(); i++) { srcrtpmtmatches.emplace_back(); - FillCRTPMTMatch(crtpmtmatches[i],srcrtpmtmatches.back()); + FillCRTPMTMatch(crtpmtmatches[i], srcrtpmtmatches.back()); } } - else{ - std::cout << "crtpmtmatch_handle.isNOTValid!\n"; - } // Get all of the OpFlashes std::vector srflashes; diff --git a/sbncode/CAFMaker/FillReco.cxx b/sbncode/CAFMaker/FillReco.cxx index 0daa7d309..3a31de7ef 100644 --- a/sbncode/CAFMaker/FillReco.cxx +++ b/sbncode/CAFMaker/FillReco.cxx @@ -154,17 +154,25 @@ namespace caf srmatch.flashPosition = SRVector3D (match.flashPosition.X(), match.flashPosition.Y(), match.flashPosition.Z()); srmatch.flashYWidth = match.flashYWidth; srmatch.flashZWidth = match.flashZWidth; - srmatch.flashClassification = static_cast(match.flashClassification); + unsigned int topen = 0, topex = 0, sideen = 0, sideex = 0; for(const auto& matchedCRTHit : match.matchedCRTHits){ - std::cout << "CRTPMTTimeDiff = "<< matchedCRTHit.PMTTimeDiff << "\n"; caf::SRMatchedCRT matchedCRT; matchedCRT.PMTTimeDiff = matchedCRTHit.PMTTimeDiff; matchedCRT.time = matchedCRTHit.time; matchedCRT.sys = matchedCRTHit.sys; matchedCRT.region = matchedCRTHit.region; matchedCRT.position = SRVector3D(matchedCRTHit.position.X(), matchedCRTHit.position.Y(), matchedCRTHit.position.Z()); + if(matchedCRTHit.PMTTimeDiff < 0){ + if(matchedCRTHit.sys == 0) topen++; + else if(matchedCRTHit.sys == 1) sideen++; + } + else if(matchedCRTHit.PMTTimeDiff >= 0){ + if(matchedCRTHit.sys == 0) topex++; + else if(matchedCRTHit.sys == 1) sideex++; + } srmatch.matchedCRTHits.push_back(matchedCRT); } + srmatch.flashClassification = static_cast(sbn::crt::assignFlashClassification(topen, topex, sideen, sideex, 0, 0)); } diff --git a/sbncode/CAFMaker/FillReco.h b/sbncode/CAFMaker/FillReco.h index fb40df775..1271279fd 100644 --- a/sbncode/CAFMaker/FillReco.h +++ b/sbncode/CAFMaker/FillReco.h @@ -225,8 +225,8 @@ namespace caf caf::SROpFlash &srflash, bool allowEmpty = false); void FillCRTPMTMatch(const sbn::crt::CRTPMTMatching &match, - caf::SRCRTPMTMatch &srmatch, - bool allowEmpty = false); + caf::SRCRTPMTMatch &srmatch, + bool allowEmpty = false); void FillTPCPMTBarycenterMatch(const sbn::TPCPMTBarycenterMatch *matchInfo, caf::SRSlice& slice);