From 4227f96cc9bd87b562b6cc94c253c1dc9c8df2a1 Mon Sep 17 00:00:00 2001 From: Seokju Chung Date: Fri, 30 Jan 2026 12:57:13 -0600 Subject: [PATCH 1/8] Filter was not working. Copied working RES structure and changed to DeltaRad filter --- ...tion_tpc_NCDeltaRadiative_filtered_sbnd.fcl | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/sbncode/SinglePhotonAnalysis/jobs/prodgenie_nu_singleinteraction_tpc_NCDeltaRadiative_filtered_sbnd.fcl b/sbncode/SinglePhotonAnalysis/jobs/prodgenie_nu_singleinteraction_tpc_NCDeltaRadiative_filtered_sbnd.fcl index 72716d7fd..9a5c117b4 100644 --- a/sbncode/SinglePhotonAnalysis/jobs/prodgenie_nu_singleinteraction_tpc_NCDeltaRadiative_filtered_sbnd.fcl +++ b/sbncode/SinglePhotonAnalysis/jobs/prodgenie_nu_singleinteraction_tpc_NCDeltaRadiative_filtered_sbnd.fcl @@ -1,26 +1,20 @@ # Simulates GENIE neutrino interactions from the BNB beam # forcing one interaction per event, inside the TPC volume # (with 10 cm padding on each side), -# selecting only NC events with photons coming out from the delta decay +# selecting only NC events with photons coming out from the Delta +#include "prodgenie_nu_singleinteraction_tpc_sbnd.fcl" + +#------ this could be a separated file # # services # -#include "services_sbnd.fcl" -#include "messages_sbnd.fcl" - # # modules # -#include "filters_sbnd.fcl" -#include "emptyevent_sbnd.fcl" -#include "genie_sbnd.fcl" - - - process_name: GenieGenFiltered @@ -108,5 +102,5 @@ outputs: # override # THIS DOES NOT WORK, CHECK! physics.producers.generator.TopVolume: "volTPCActive" -#physics.producers.generator.BeamName: "booster" -#physics.producers.generator.EventGeneratorList: "NCRES" +physics.producers.generator.BeamName: "booster" +physics.producers.generator.EventGeneratorList: "NCRES" From 78ed4004d01056f5655dd60057257e4045ac3977 Mon Sep 17 00:00:00 2001 From: Lynn Garren Date: Fri, 30 Jan 2026 14:04:39 -0600 Subject: [PATCH 2/8] building for geant4 4.11 --- sbncode/OpT0Finder/flashmatch/Algorithms/CMakeLists.txt | 2 +- sbncode/SBNEventWeight/Calculators/Geant4/CMakeLists.txt | 1 + ups/product_deps | 6 +++--- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/sbncode/OpT0Finder/flashmatch/Algorithms/CMakeLists.txt b/sbncode/OpT0Finder/flashmatch/Algorithms/CMakeLists.txt index c6ee1e2d3..eb08314d2 100644 --- a/sbncode/OpT0Finder/flashmatch/Algorithms/CMakeLists.txt +++ b/sbncode/OpT0Finder/flashmatch/Algorithms/CMakeLists.txt @@ -2,7 +2,7 @@ art_make_library( LIBRARIES larsim::PhotonPropagation larsim::PhotonPropagation_PhotonVisibilityService_service - larsim::LegacyLArG4 + #larsim::LegacyLArG4 #sbncode_OpT0Finder_flashmatch_GeoAlgo sbncode_OpT0Finder_flashmatch_Base larcorealg::GeoAlgo diff --git a/sbncode/SBNEventWeight/Calculators/Geant4/CMakeLists.txt b/sbncode/SBNEventWeight/Calculators/Geant4/CMakeLists.txt index 568ecc7f6..b064daff0 100644 --- a/sbncode/SBNEventWeight/Calculators/Geant4/CMakeLists.txt +++ b/sbncode/SBNEventWeight/Calculators/Geant4/CMakeLists.txt @@ -13,6 +13,7 @@ art_make_library( art_root_io::TFileService_service larcore::Geometry_Geometry_service cetlib_except::cetlib_except + Geant4::G4ptl ReweightBaseLib PropBaseLib ROOT::Tree diff --git a/ups/product_deps b/ups/product_deps index ef50b16bb..9247f5e20 100644 --- a/ups/product_deps +++ b/ups/product_deps @@ -254,13 +254,13 @@ libdir fq_dir lib product version qual flags genie_xsec v3_06_00 - larcv2 v2_2_6 - -larsoft v10_14_02_01 - +larsoft v10_17_00 - sbnalg v10_14_02 - sbndaq_artdaq_core v1_10_06 - sbndata v01_08 - systematicstools v01_04_04 - -nusystematics v1_05_10 - -geant4reweight v01_20_14 - +nusystematics v1_05_11 - +geant4reweight v01_21_02 - cetmodules v3_24_01 - only_for_build end_product_list #################################### From e8db3c570aa6e6d82f0eb5f47c6a18a07b63ed3a Mon Sep 17 00:00:00 2001 From: Henry Lay Date: Tue, 17 Feb 2026 04:54:40 -0600 Subject: [PATCH 3/8] Fill new fields for SBND CRT --- sbncode/CAFMaker/CAFMaker_module.cc | 39 +++++++++++++++++++++++++++-- sbncode/CAFMaker/FillReco.cxx | 9 ++++++- sbncode/CAFMaker/FillReco.h | 3 +++ 3 files changed, 48 insertions(+), 3 deletions(-) diff --git a/sbncode/CAFMaker/CAFMaker_module.cc b/sbncode/CAFMaker/CAFMaker_module.cc index 9f2c01590..b04dc631c 100644 --- a/sbncode/CAFMaker/CAFMaker_module.cc +++ b/sbncode/CAFMaker/CAFMaker_module.cc @@ -352,6 +352,10 @@ class CAFMaker : public art::EDProducer { art::FindOneP FindOnePStrict(const U& from, const art::Event& evt, const art::InputTag& label) const; + template + art::FindOneP FindOnePStrictSingle(const U& from, const art::Event& evt, + const art::InputTag& label) const; + template art::FindOneP FindOnePDStrict(const U& from, const art::Event& evt, @@ -1299,6 +1303,27 @@ art::FindOneP CAFMaker::FindOnePStrict(const U& from, return ret; } +//...................................................................... +template +art::FindOneP CAFMaker::FindOnePStrictSingle(const U& from, + const art::Event& evt, + const art::InputTag& tag) const { + std::vector vec = { from }; + + art::FindOneP ret(vec, evt, tag); + + if (!tag.label().empty() && !ret.isValid() && fParams.StrictMode()) { + std::cout << "CAFMaker: No Assn from '" + << cet::demangle_symbol(typeid(from).name()) << "' to '" + << cet::demangle_symbol(typeid(T).name()) + << "' found under label '" << tag << "'. " + << "Set 'StrictMode: false' to continue anyway." << std::endl; + abort(); + } + + return ret; +} + //...................................................................... template art::FindOneP CAFMaker::FindOnePDStrict(const U& from, @@ -1791,12 +1816,15 @@ void CAFMaker::produce(art::Event& evt) noexcept { { art::Handle> crtspacepoints_handle; GetByLabelStrict(evt, fParams.CRTSpacePointLabel(), crtspacepoints_handle); + art::FindOneP foCRTCluster = + FindOnePStrict(crtspacepoints_handle, evt, fParams.CRTSpacePointLabel()); if (crtspacepoints_handle.isValid()) { const std::vector &crtspacepoints = *crtspacepoints_handle; for (unsigned i = 0; i < crtspacepoints.size(); i++) { srcrtspacepoints.emplace_back(); - FillCRTSpacePoint(crtspacepoints[i], srcrtspacepoints.back()); + const art::Ptr crtcluster = foCRTCluster.at(i); + FillCRTSpacePoint(crtspacepoints[i], crtcluster, srcrtspacepoints.back()); } } @@ -2239,6 +2267,9 @@ void CAFMaker::produce(art::Event& evt) noexcept { FindOnePDStrict(slcTracks, evt, fParams.CRTSpacePointMatchLabel() + slice_tag_suff); + art::Handle> crtspacepoints_handle; + GetByLabelStrict(evt, fParams.CRTSpacePointLabel(), crtspacepoints_handle); + art::FindOneP foSBNDCRTTrackMatch = FindOnePDStrict(slcTracks, evt, fParams.SBNDCRTTrackMatchLabel() + slice_tag_suff); @@ -2515,8 +2546,12 @@ void CAFMaker::produce(art::Event& evt) noexcept { { const art::Ptr crtspacepoint = foCRTSpacePointMatch.at(iPart); + art::FindOneP foCRTCluster = + FindOnePStrictSingle(crtspacepoint, evt, fParams.CRTSpacePointLabel()); + const art::Ptr crtcluster = foCRTCluster.at(0); + if(crtspacepoint.isNonnull()) - FillTrackCRTSpacePoint(foCRTSpacePointMatch.data(iPart).ref(), crtspacepoint, trk); + FillTrackCRTSpacePoint(foCRTSpacePointMatch.data(iPart).ref(), crtspacepoint, crtcluster, trk); } if(foSBNDCRTTrackMatch.isValid() && fDet == kSBND) { diff --git a/sbncode/CAFMaker/FillReco.cxx b/sbncode/CAFMaker/FillReco.cxx index 46396a2c1..ba1b19b61 100644 --- a/sbncode/CAFMaker/FillReco.cxx +++ b/sbncode/CAFMaker/FillReco.cxx @@ -164,6 +164,7 @@ namespace caf } void FillCRTSpacePoint(const sbnd::crt::CRTSpacePoint &spacepoint, + const art::Ptr &cluster, caf::SRCRTSpacePoint &srspacepoint, bool allowEmpty) { @@ -173,6 +174,8 @@ namespace caf srspacepoint.time = spacepoint.Ts0(); srspacepoint.time_err = spacepoint.Ts0Err(); srspacepoint.complete = spacepoint.Complete(); + srspacepoint.nhits = cluster->NHits(); + srspacepoint.tagger = cluster->Tagger(); } void FillSBNDCRTTrack(const sbnd::crt::CRTTrack &track, @@ -186,6 +189,9 @@ namespace caf srsbndcrttrack.time_err = track.Ts0Err(); srsbndcrttrack.pe = track.PE(); srsbndcrttrack.tof = track.ToF(); + + for(auto const& tagger : track.Taggers()) + srsbndcrttrack.taggers.push_back(tagger); } void FillSBNDCRTVeto(const sbnd::crt::CRTVeto &veto, @@ -811,11 +817,12 @@ namespace caf void FillTrackCRTSpacePoint(const anab::T0 &t0match, const art::Ptr &spacepointmatch, + const art::Ptr &cluster, caf::SRTrack &srtrack, bool allowEmpty) { srtrack.crtspacepoint.score = t0match.fTriggerConfidence; - FillCRTSpacePoint(*spacepointmatch, srtrack.crtspacepoint.spacepoint); + FillCRTSpacePoint(*spacepointmatch, cluster, srtrack.crtspacepoint.spacepoint); } void FillTrackSBNDCRTTrack(const anab::T0 &t0match, diff --git a/sbncode/CAFMaker/FillReco.h b/sbncode/CAFMaker/FillReco.h index 46704181a..11cf7fcb8 100644 --- a/sbncode/CAFMaker/FillReco.h +++ b/sbncode/CAFMaker/FillReco.h @@ -41,6 +41,7 @@ #include "sbnobj/Common/CRT/CRTHit.hh" #include "sbnobj/Common/CRT/CRTTrack.hh" #include "sbnobj/SBND/CRT/CRTSpacePoint.hh" +#include "sbnobj/SBND/CRT/CRTCluster.hh" #include "sbnobj/SBND/CRT/CRTTrack.hh" #include "sbnobj/SBND/CRT/CRTVeto.hh" #include "sbnobj/Common/CRT/CRTPMTMatching.hh" @@ -206,6 +207,7 @@ namespace caf void FillTrackCRTSpacePoint(const anab::T0 &t0match, const art::Ptr &spacepointmatch, + const art::Ptr &cluster, caf::SRTrack &srtrack, bool allowEmpty = false); @@ -277,6 +279,7 @@ namespace caf bool allowEmpty = false); void FillCRTSpacePoint(const sbnd::crt::CRTSpacePoint &spacepoint, + const art::Ptr &cluster, caf::SRCRTSpacePoint &srspacepoint, bool allowEmpty = false); From 5530db9fc55f08bd6e22dba86563d4292cece98f Mon Sep 17 00:00:00 2001 From: Henry Lay Date: Wed, 18 Feb 2026 06:30:23 -0600 Subject: [PATCH 4/8] Fill new field for easily flagging CRT-matched tracks in SBND --- sbncode/CAFMaker/FillReco.cxx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/sbncode/CAFMaker/FillReco.cxx b/sbncode/CAFMaker/FillReco.cxx index ba1b19b61..5f07bda27 100644 --- a/sbncode/CAFMaker/FillReco.cxx +++ b/sbncode/CAFMaker/FillReco.cxx @@ -821,7 +821,9 @@ namespace caf caf::SRTrack &srtrack, bool allowEmpty) { - srtrack.crtspacepoint.score = t0match.fTriggerConfidence; + srtrack.crtspacepoint.matched = true; + srtrack.crtspacepoint.score = t0match.fTriggerConfidence; + FillCRTSpacePoint(*spacepointmatch, cluster, srtrack.crtspacepoint.spacepoint); } @@ -830,7 +832,9 @@ namespace caf caf::SRTrack &srtrack, bool allowEmpty) { - srtrack.crtsbndtrack.score = t0match.fTriggerConfidence; + srtrack.crtsbndtrack.matched = true; + srtrack.crtsbndtrack.score = t0match.fTriggerConfidence; + FillSBNDCRTTrack(*trackmatch, srtrack.crtsbndtrack.track); } From a64e6a4c442f40ddfd044aae488a495f43e3c060 Mon Sep 17 00:00:00 2001 From: Herbert Greenlee Date: Tue, 10 Mar 2026 16:40:20 -0500 Subject: [PATCH 5/8] For larsoft v10_20_02. --- ups/product_deps | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ups/product_deps b/ups/product_deps index f85c5cd4e..95cec9c87 100644 --- a/ups/product_deps +++ b/ups/product_deps @@ -254,7 +254,7 @@ libdir fq_dir lib product version qual flags genie_xsec v3_06_00 - larcv2 v2_2_6 - -larsoft v10_15_00 - +larsoft v10_20_02 - sbnalg v10_15_00 - sbndaq_artdaq_core v1_10_06 - sbndata v01_08 - From fa6d0fc37a5bdb6fe8f5f0bb148799fe3415687b Mon Sep 17 00:00:00 2001 From: Henry Lay Date: Fri, 13 Mar 2026 10:59:29 +0000 Subject: [PATCH 6/8] Apply good suggestions from Gianluca Co-authored-by: Gianluca Petrillo --- sbncode/CAFMaker/CAFMaker_module.cc | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/sbncode/CAFMaker/CAFMaker_module.cc b/sbncode/CAFMaker/CAFMaker_module.cc index b04dc631c..cc071d581 100644 --- a/sbncode/CAFMaker/CAFMaker_module.cc +++ b/sbncode/CAFMaker/CAFMaker_module.cc @@ -1308,20 +1308,7 @@ template art::FindOneP CAFMaker::FindOnePStrictSingle(const U& from, const art::Event& evt, const art::InputTag& tag) const { - std::vector vec = { from }; - - art::FindOneP ret(vec, evt, tag); - - if (!tag.label().empty() && !ret.isValid() && fParams.StrictMode()) { - std::cout << "CAFMaker: No Assn from '" - << cet::demangle_symbol(typeid(from).name()) << "' to '" - << cet::demangle_symbol(typeid(T).name()) - << "' found under label '" << tag << "'. " - << "Set 'StrictMode: false' to continue anyway." << std::endl; - abort(); - } - - return ret; + return FindOnePStrict(std::vector{ from }, evt, tag); } //...................................................................... @@ -2548,7 +2535,7 @@ void CAFMaker::produce(art::Event& evt) noexcept { art::FindOneP foCRTCluster = FindOnePStrictSingle(crtspacepoint, evt, fParams.CRTSpacePointLabel()); - const art::Ptr crtcluster = foCRTCluster.at(0); + const art::Ptr& crtcluster = foCRTCluster.at(0); if(crtspacepoint.isNonnull()) FillTrackCRTSpacePoint(foCRTSpacePointMatch.data(iPart).ref(), crtspacepoint, crtcluster, trk); From 3ab25146b43d1375452e533ab64f276bb4f7eff9 Mon Sep 17 00:00:00 2001 From: Henry Lay Date: Fri, 13 Mar 2026 06:19:52 -0500 Subject: [PATCH 7/8] Make dereferencing work --- sbncode/CAFMaker/CAFMaker_module.cc | 6 +++--- sbncode/CAFMaker/FillReco.cxx | 12 ++++++------ sbncode/CAFMaker/FillReco.h | 6 +++--- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/sbncode/CAFMaker/CAFMaker_module.cc b/sbncode/CAFMaker/CAFMaker_module.cc index cc071d581..d2d2a0f0c 100644 --- a/sbncode/CAFMaker/CAFMaker_module.cc +++ b/sbncode/CAFMaker/CAFMaker_module.cc @@ -1308,7 +1308,7 @@ template art::FindOneP CAFMaker::FindOnePStrictSingle(const U& from, const art::Event& evt, const art::InputTag& tag) const { - return FindOnePStrict(std::vector{ from }, evt, tag); + return FindOnePStrict(std::vector{ from }, evt, tag); } //...................................................................... @@ -1811,7 +1811,7 @@ void CAFMaker::produce(art::Event& evt) noexcept { for (unsigned i = 0; i < crtspacepoints.size(); i++) { srcrtspacepoints.emplace_back(); const art::Ptr crtcluster = foCRTCluster.at(i); - FillCRTSpacePoint(crtspacepoints[i], crtcluster, srcrtspacepoints.back()); + FillCRTSpacePoint(crtspacepoints[i], *crtcluster, srcrtspacepoints.back()); } } @@ -2538,7 +2538,7 @@ void CAFMaker::produce(art::Event& evt) noexcept { const art::Ptr& crtcluster = foCRTCluster.at(0); if(crtspacepoint.isNonnull()) - FillTrackCRTSpacePoint(foCRTSpacePointMatch.data(iPart).ref(), crtspacepoint, crtcluster, trk); + FillTrackCRTSpacePoint(foCRTSpacePointMatch.data(iPart).ref(), *crtspacepoint, *crtcluster, trk); } if(foSBNDCRTTrackMatch.isValid() && fDet == kSBND) { diff --git a/sbncode/CAFMaker/FillReco.cxx b/sbncode/CAFMaker/FillReco.cxx index 5f07bda27..86d56a6e2 100644 --- a/sbncode/CAFMaker/FillReco.cxx +++ b/sbncode/CAFMaker/FillReco.cxx @@ -164,7 +164,7 @@ namespace caf } void FillCRTSpacePoint(const sbnd::crt::CRTSpacePoint &spacepoint, - const art::Ptr &cluster, + const sbnd::crt::CRTCluster &cluster, caf::SRCRTSpacePoint &srspacepoint, bool allowEmpty) { @@ -174,8 +174,8 @@ namespace caf srspacepoint.time = spacepoint.Ts0(); srspacepoint.time_err = spacepoint.Ts0Err(); srspacepoint.complete = spacepoint.Complete(); - srspacepoint.nhits = cluster->NHits(); - srspacepoint.tagger = cluster->Tagger(); + srspacepoint.nhits = cluster.NHits(); + srspacepoint.tagger = cluster.Tagger(); } void FillSBNDCRTTrack(const sbnd::crt::CRTTrack &track, @@ -816,15 +816,15 @@ namespace caf } void FillTrackCRTSpacePoint(const anab::T0 &t0match, - const art::Ptr &spacepointmatch, - const art::Ptr &cluster, + const sbnd::crt::CRTSpacePoint &spacepointmatch, + const sbnd::crt::CRTCluster &cluster, caf::SRTrack &srtrack, bool allowEmpty) { srtrack.crtspacepoint.matched = true; srtrack.crtspacepoint.score = t0match.fTriggerConfidence; - FillCRTSpacePoint(*spacepointmatch, cluster, srtrack.crtspacepoint.spacepoint); + FillCRTSpacePoint(spacepointmatch, cluster, srtrack.crtspacepoint.spacepoint); } void FillTrackSBNDCRTTrack(const anab::T0 &t0match, diff --git a/sbncode/CAFMaker/FillReco.h b/sbncode/CAFMaker/FillReco.h index 11cf7fcb8..eafbd1842 100644 --- a/sbncode/CAFMaker/FillReco.h +++ b/sbncode/CAFMaker/FillReco.h @@ -206,8 +206,8 @@ namespace caf bool allowEmpty = false); void FillTrackCRTSpacePoint(const anab::T0 &t0match, - const art::Ptr &spacepointmatch, - const art::Ptr &cluster, + const sbnd::crt::CRTSpacePoint &spacepointmatch, + const sbnd::crt::CRTCluster &cluster, caf::SRTrack &srtrack, bool allowEmpty = false); @@ -279,7 +279,7 @@ namespace caf bool allowEmpty = false); void FillCRTSpacePoint(const sbnd::crt::CRTSpacePoint &spacepoint, - const art::Ptr &cluster, + const sbnd::crt::CRTCluster &cluster, caf::SRCRTSpacePoint &srspacepoint, bool allowEmpty = false); From 046b161a9787305f4adabf872f2485d0a49ed87e Mon Sep 17 00:00:00 2001 From: Herbert Greenlee Date: Fri, 13 Mar 2026 10:22:23 -0500 Subject: [PATCH 8/8] v10_20_03 --- CMakeLists.txt | 2 +- ups/product_deps | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index cb8c49e67..61bc982b7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -16,7 +16,7 @@ cmake_minimum_required(VERSION 3.20 FATAL_ERROR) find_package(cetmodules 3.20.00 REQUIRED) -project(sbncode VERSION 10.15.00 LANGUAGES CXX) +project(sbncode VERSION 10.20.03 LANGUAGES CXX) message(STATUS "\n\n ========================== ${PROJECT_NAME} ==========================") diff --git a/ups/product_deps b/ups/product_deps index 95cec9c87..50a46ba75 100644 --- a/ups/product_deps +++ b/ups/product_deps @@ -254,8 +254,8 @@ libdir fq_dir lib product version qual flags genie_xsec v3_06_00 - larcv2 v2_2_6 - -larsoft v10_20_02 - -sbnalg v10_15_00 - +larsoft v10_20_03 - +sbnalg v10_20_03 - sbndaq_artdaq_core v1_10_06 - sbndata v01_08 - systematicstools v01_04_04 -