Manual sweep of athenaprivate1!16317 from 21.0 to master: workaround for the issues seen when passing zero lifetime particles to Geant4 (ATLASSIM-3313)
The ZeroLifetimePositioner
works around the case where a neutral
particle oscillates into its anti-particle in one GenVertex
then
immediately decays in a second GenVertex
at the same position and
time. This is currently a problem seen when B0/B0bar (511/-511) particles
with pre-defined oscillations and decays are fed into Geant4, which cannot
currently handle the concept of a zero-lifetime particle.
As Geant4 does not implement any processes for these particles other than
the pre-defined decays currently and the particles are neutral, it is safe
to shift the point at which the particle oscillates into its anti-particle
back along the (straight-line) trajectory a bit. For simplicity halfway
between the production point and the oscillation/decay point has been used.
The decay position is left unchanged.
With this change Geant4 then successfully simulates the decay in the required position.
In QS sim jobs only, after the TruthEvent
is created from
BeamTruthEvent
, but before it is passed to the InputConverter
,
ZeroLifetimePositioner
is used to apply the work-around
for zero lifetime B0/B0bar particles.
After simulation is complete ZeroLifetimePositioner
is used to remove
the work-around by moving the oscillation vertex back to the decay vertex
position.