Skip to content

Commit 4bd54a7

Browse files
authored
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
1 parent a11d739 commit 4bd54a7

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Generators/src/GeneratorHepMC.cxx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ Bool_t GeneratorHepMC::generateEvent()
159159
tries++;
160160
} while (tries < max_tries);
161161

162-
LOG(fatal) << "HepMC event gen failed (Does the file/stream have enough events)?";
162+
LOG(error) << "HepMC event gen failed (Does the file/stream have enough events)?";
163163

164164
/** failure **/
165165
return false;
@@ -286,6 +286,7 @@ Bool_t GeneratorHepMC::importParticles()
286286
}
287287

288288
/** loop over particles **/
289+
mParticles.clear();
289290
auto particles = mEvent->particles();
290291
for (int i = 0; i < particles.size(); ++i) {
291292

0 commit comments

Comments
 (0)