Skip to content

Commit

Permalink
Apply encoding to boxgen particles
Browse files Browse the repository at this point in the history
  • Loading branch information
jackal1-66 authored and sawenzel committed Jan 6, 2025
1 parent 8b7ba4e commit c68ddc8
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions Generators/include/Generators/BoxGenerator.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
#include <vector>
#include <Generators/BoxGunParam.h>
#include "SimulationDataFormat/MCEventHeader.h"
#include "SimulationDataFormat/ParticleStatus.h"
#include <SimulationDataFormat/MCGenProperties.h>

namespace o2::eventgen
{
Expand Down Expand Up @@ -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;
}

Expand Down

0 comments on commit c68ddc8

Please sign in to comment.