From 4bd54a7c4d376ca4cc991c88bc63ed9f6b598bad Mon Sep 17 00:00:00 2001 From: Paul Buehler Date: Fri, 6 Dec 2024 13:34:51 +0100 Subject: [PATCH] Fix particle accumulation bug in HepMC + error handling (#13768) * Reset mParticles before filled with new set of particles * Return with false instead of stopping execution in case of problems --- Generators/src/GeneratorHepMC.cxx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Generators/src/GeneratorHepMC.cxx b/Generators/src/GeneratorHepMC.cxx index 4f38b01811f98..2076910b2bf5f 100644 --- a/Generators/src/GeneratorHepMC.cxx +++ b/Generators/src/GeneratorHepMC.cxx @@ -159,7 +159,7 @@ Bool_t GeneratorHepMC::generateEvent() tries++; } while (tries < max_tries); - LOG(fatal) << "HepMC event gen failed (Does the file/stream have enough events)?"; + LOG(error) << "HepMC event gen failed (Does the file/stream have enough events)?"; /** failure **/ return false; @@ -286,6 +286,7 @@ Bool_t GeneratorHepMC::importParticles() } /** loop over particles **/ + mParticles.clear(); auto particles = mEvent->particles(); for (int i = 0; i < particles.size(); ++i) {