Skip to content

AtlasHepMC: Fixes for barcode_to_* functions.

For the HepMC::barcode_to_particle function, if it did not find a barcode bc, it would just return the particle at index bc-1, if it is in range. But if the barcode doesn't actually exist, this may be a completely different particle --- and some callers use this method to test if a barcode exists. We can't just get rid of the logic, as there are some cases where there are no barcodes at all. So instead, if we are trying to return a particle by index, check first that it doesn't have a barcode set, and fail if so.

barcode_to_vertex has similar issues.

Fixes problems seen with the TruthEvent->GEN_AOD filtering garbling the event with HepMC3.

See ATLASRECTS-6859.

Merge request reports