Update status values for particles with pre-defined decays in simulation
Update the setting of status values for particles with pre-defined decays which interact during simulation.
When quasi-stable particle simulation is activated (MC20 -> MC23) all particles produced by the generator with status 1 (stable) are passed to the simulation (as with all previous campaigns), particles with status 2 (unstable) are also passed to the simulation if part of their trajectory exits the beam-pipe.
This allows particles considered unstable by the generator to potentially deposit energy in sensitive detector regions, improving data MC agreement.
Particles with pre-defined decays may also interact during simulation, if
this happens then in the barcode-based EDM used currently. The barcode
of the particle after the interaction is set to the highest unused barcode
value below HepMC::SIM_BARCODE_OFFSET
. In contrast, if a particle without a
pre-defined decay (status=1) survives an interaction during the simulation
then the barcode of the particle after the interaction is set to
parentBarcode+HepMC::SIM_REGENERATION_INCREMENT
.
In the new barcode-less EDM (used, but not persistified, in MC23 Sim/Digi/Reco)
the status values of all particle which survive an interaction in the
simulation is set to parentBarcode+HepMC::SIM_STATUS_INCREMENT
.
This has the side-effect of meaning that particles with pre-defined decays
which survive interactions in the simulation are classified differently
by the BarcodeBased
and StatusBased
versions of the is_simulation_particle
function, which could potentially affect the behaviour of downstream code once
the xAOD::TruthParticle
EDM is migrated to be barcode-less (!76135).
For consistency with the barcode-based EDM, this MR removes the HepMC::SIM_STATUS_INCREMENT
from the status values of particles with pre-defined decays and survive an
iteration.
In the future we may want to revert this and instead revise the definition of
HepMC::StatusBased::is_simulation_particle
.
As the persistent EDM is still barcode-based, this change should have no effect on the CI output.