From 4414cbb02a0307b19216117284620c95a71bd60d Mon Sep 17 00:00:00 2001 From: Nicholas Kamp <43788191+nickkamp1@users.noreply.github.com> Date: Thu, 22 Aug 2024 16:18:45 -0400 Subject: [PATCH] Update Injector.cxx to fixes failed_tries bug --- projects/injection/private/Injector.cxx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/projects/injection/private/Injector.cxx b/projects/injection/private/Injector.cxx index 40069d4a..9bf04c1b 100644 --- a/projects/injection/private/Injector.cxx +++ b/projects/injection/private/Injector.cxx @@ -331,6 +331,7 @@ siren::dataclasses::InteractionRecord Injector::SampleSecondaryProcess(siren::da size_t tries = 0; size_t failed_tries = 0; while(true) { + tries += 1; // // std::cout << "gotcha" << std::endl; // for(auto & distribution : secondary_distributions) { // // std::cout << "sample distribution" << std::endl; @@ -364,7 +365,7 @@ siren::dataclasses::InteractionRecord Injector::SampleSecondaryProcess(siren::da } continue; } - if(failed_tries > max_tries) { + if(tries > max_tries) { throw(siren::utilities::InjectionFailure("Failed to generate secondary process!")); break; }