diff --git a/Generators/include/Generators/BoxGenerator.h b/Generators/include/Generators/BoxGenerator.h index e24694296a70f..e109bcf90ebf8 100644 --- a/Generators/include/Generators/BoxGenerator.h +++ b/Generators/include/Generators/BoxGenerator.h @@ -19,6 +19,8 @@ #include #include #include "SimulationDataFormat/MCEventHeader.h" +#include "SimulationDataFormat/ParticleStatus.h" +#include namespace o2::eventgen { @@ -90,6 +92,14 @@ class BoxGenerator : public Generator { mParticles.clear(); std::copy(mEvent.begin(), mEvent.end(), std::back_insert_iterator(mParticles)); + for (auto& particle : mParticles) { + auto statusCode = particle.GetStatusCode(); + if (!mcgenstatus::isEncoded(statusCode)) { + particle.SetStatusCode(mcgenstatus::MCGenStatusEncoding(statusCode, 0).fullEncoding); + } + // Set the transport bit according to the HepMC status code + particle.SetBit(ParticleStatus::kToBeDone, mcgenstatus::getHepMCStatusCode(particle.GetStatusCode()) == 1); + } return true; }