Skip to content

Commit

Permalink
Fix particle accumulation bug in HepMC + error handling (#13768)
Browse files Browse the repository at this point in the history
* Reset mParticles before filled with new set of particles

* Return with false instead of stopping execution in case of problems
  • Loading branch information
pbuehler authored Dec 6, 2024
1 parent a11d739 commit 4bd54a7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Generators/src/GeneratorHepMC.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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) {

Expand Down

0 comments on commit 4bd54a7

Please sign in to comment.