From 9ed57fe48baf71091e107a6bc33446bc44f1d20c Mon Sep 17 00:00:00 2001 From: nathanielerowe <70993723+nathanielerowe@users.noreply.github.com> Date: Wed, 14 Jan 2026 11:04:46 -0600 Subject: [PATCH 1/3] Fix some loop bonuds --- sbncode/CAFMaker/FillTrue.cxx | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/sbncode/CAFMaker/FillTrue.cxx b/sbncode/CAFMaker/FillTrue.cxx index ef1b4cc0c..41fff543e 100644 --- a/sbncode/CAFMaker/FillTrue.cxx +++ b/sbncode/CAFMaker/FillTrue.cxx @@ -465,7 +465,7 @@ namespace caf { srneutrino.index = i; - for (int c = 0; c < 2; c++) { + for (int c = 0; c < (int)active_volumes.size(); c++) { SRTrueInteractionPlaneInfo init; init.visE = 0.; init.nhit = 0; @@ -483,7 +483,7 @@ namespace caf { // total up the deposited energy for(int p = 0; p < 3; ++p) { - for (int i_cryo = 0; i_cryo < 2; i_cryo++) { + for (int i_cryo = 0; i_cryo < (int)active_volumes.size(); i_cryo++) { srneutrino.plane[i_cryo][p].visE += part.plane[i_cryo][p].visE; } } @@ -493,7 +493,7 @@ namespace caf { // Set of hits per-plane: primary particles { - std::vector, 3>> planehitIDs(2); + std::vector, 3>> planehitIDs(active_volumes.size()); for (unsigned i_part = 0; i_part < srparticles.size(); i_part++) { if (srparticles[i_part].start_process == caf::kG4primary && srparticles[i_part].interaction_id == (int)i) { int track_id = srparticles[i_part].G4ID; @@ -507,7 +507,7 @@ namespace caf { } for(int p = 0; p < 3; ++p) { - for (int i_cryo = 0; i_cryo < 2; i_cryo++) { + for (int i_cryo = 0; i_cryo < (int)active_volumes.size(); i_cryo++) { srneutrino.plane[i_cryo][p].nhitprim = planehitIDs[i_cryo][p].size(); } } @@ -515,7 +515,7 @@ namespace caf { // Set of hits per-plane: all particles { - std::vector, 3>> planehitIDs(2); + std::vector, 3>> planehitIDs(active_volumes.size()); for (unsigned i_part = 0; i_part < srparticles.size(); i_part++) { if (srparticles[i_part].interaction_id == (int)i) { int track_id = srparticles[i_part].G4ID; @@ -529,7 +529,7 @@ namespace caf { } for(int p = 0; p < 3; ++p) { - for (int i_cryo = 0; i_cryo < 2; i_cryo++) { + for (int i_cryo = 0; i_cryo < (int)active_volumes.size(); i_cryo++) { srneutrino.plane[i_cryo][p].nhit = planehitIDs[i_cryo][p].size(); } } @@ -599,7 +599,7 @@ namespace caf { } // Set the cryostat of the position - for (int icryo = 0; icryo < 2; icryo++) { + for (int icryo = 0; icryo < (int)active_volumes.size(); icryo++) { if (active_volumes[icryo].ContainsPosition(nu.Nu().Position().Vect())) { srneutrino.cryostat = icryo; break; From a21662e49bbb4588a2f832341422c7176b690d41 Mon Sep 17 00:00:00 2001 From: nathanielerowe <70993723+nathanielerowe@users.noreply.github.com> Date: Wed, 14 Jan 2026 12:45:21 -0600 Subject: [PATCH 2/3] revert change to 2x3 arrays --- sbncode/CAFMaker/FillTrue.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sbncode/CAFMaker/FillTrue.cxx b/sbncode/CAFMaker/FillTrue.cxx index 41fff543e..8b433628b 100644 --- a/sbncode/CAFMaker/FillTrue.cxx +++ b/sbncode/CAFMaker/FillTrue.cxx @@ -493,7 +493,7 @@ namespace caf { // Set of hits per-plane: primary particles { - std::vector, 3>> planehitIDs(active_volumes.size()); + std::vector, 3>> planehitIDs(2); for (unsigned i_part = 0; i_part < srparticles.size(); i_part++) { if (srparticles[i_part].start_process == caf::kG4primary && srparticles[i_part].interaction_id == (int)i) { int track_id = srparticles[i_part].G4ID; @@ -515,7 +515,7 @@ namespace caf { // Set of hits per-plane: all particles { - std::vector, 3>> planehitIDs(active_volumes.size()); + std::vector, 3>> planehitIDs(2); for (unsigned i_part = 0; i_part < srparticles.size(); i_part++) { if (srparticles[i_part].interaction_id == (int)i) { int track_id = srparticles[i_part].G4ID; From df2423866e4618fe3394149012bde1bad420f396 Mon Sep 17 00:00:00 2001 From: nathanielerowe <70993723+nathanielerowe@users.noreply.github.com> Date: Wed, 14 Jan 2026 13:58:32 -0600 Subject: [PATCH 3/3] make sure all planes filled --- sbncode/CAFMaker/FillTrue.cxx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sbncode/CAFMaker/FillTrue.cxx b/sbncode/CAFMaker/FillTrue.cxx index 8b433628b..4d1d794d0 100644 --- a/sbncode/CAFMaker/FillTrue.cxx +++ b/sbncode/CAFMaker/FillTrue.cxx @@ -465,7 +465,7 @@ namespace caf { srneutrino.index = i; - for (int c = 0; c < (int)active_volumes.size(); c++) { + for (int c = 0; c < 2; c++) { SRTrueInteractionPlaneInfo init; init.visE = 0.; init.nhit = 0; @@ -483,7 +483,7 @@ namespace caf { // total up the deposited energy for(int p = 0; p < 3; ++p) { - for (int i_cryo = 0; i_cryo < (int)active_volumes.size(); i_cryo++) { + for (int i_cryo = 0; i_cryo < 2; i_cryo++) { srneutrino.plane[i_cryo][p].visE += part.plane[i_cryo][p].visE; } } @@ -507,7 +507,7 @@ namespace caf { } for(int p = 0; p < 3; ++p) { - for (int i_cryo = 0; i_cryo < (int)active_volumes.size(); i_cryo++) { + for (int i_cryo = 0; i_cryo < 2; i_cryo++) { srneutrino.plane[i_cryo][p].nhitprim = planehitIDs[i_cryo][p].size(); } } @@ -529,7 +529,7 @@ namespace caf { } for(int p = 0; p < 3; ++p) { - for (int i_cryo = 0; i_cryo < (int)active_volumes.size(); i_cryo++) { + for (int i_cryo = 0; i_cryo < 2; i_cryo++) { srneutrino.plane[i_cryo][p].nhit = planehitIDs[i_cryo][p].size(); } }