Handle reading in old TrackRecord persistent formats after the barcode migration.
The idea here is to use an optional HepMcParticleLink
member variable of the transient TrackRecord
as a means to derive the correct id value from the provided barcode value in cases where the id value is not initially available from the persistent version (TrackRecord_p1
).
NB This only works if the McEventCollection
is present in the input file in addition to the TrackRecordCollection
. This should be the case for all current use-cases though.
In the case that the id value is available from the persistent version (TrackRecord_p2
) then no HepMcParticleLink
is created.
In the case that the transient TrackRecord
instance is copied then the HepMcParticleLink
is used to correctly set the m_id
variable in the new object, if necessary.
Edited by John Derek Chapman