diff --git a/sbncode/CAFMaker/FillTrue.cxx b/sbncode/CAFMaker/FillTrue.cxx index ef1b4cc0c..4d1d794d0 100644 --- a/sbncode/CAFMaker/FillTrue.cxx +++ b/sbncode/CAFMaker/FillTrue.cxx @@ -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;