File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed
Generators/include/Generators Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change 1919#include < vector>
2020#include < Generators/BoxGunParam.h>
2121#include " SimulationDataFormat/MCEventHeader.h"
22+ #include " SimulationDataFormat/ParticleStatus.h"
23+ #include < SimulationDataFormat/MCGenProperties.h>
2224
2325namespace o2 ::eventgen
2426{
@@ -90,6 +92,14 @@ class BoxGenerator : public Generator
9092 {
9193 mParticles .clear ();
9294 std::copy (mEvent .begin (), mEvent .end (), std::back_insert_iterator (mParticles ));
95+ for (auto & particle : mParticles ) {
96+ auto statusCode = particle.GetStatusCode ();
97+ if (!mcgenstatus::isEncoded (statusCode)) {
98+ particle.SetStatusCode (mcgenstatus::MCGenStatusEncoding (statusCode, 0 ).fullEncoding );
99+ }
100+ // Set the transport bit according to the HepMC status code
101+ particle.SetBit (ParticleStatus::kToBeDone , mcgenstatus::getHepMCStatusCode (particle.GetStatusCode ()) == 1 );
102+ }
93103 return true ;
94104 }
95105
You can’t perform that action at this time.
0 commit comments