Skip to content

Draft: The second attempt to use status() instead of barcode() in Simulation

Andrii Verbytskyi requested to merge averbyts/athena:use_status2 into main

The second attempt to use status instead of barcode for the simulation. The end goals are:

    1. to be able to identify the origin of the particles and vertices from their status and not barcodes
    1. to be able to use the HepMC3::GenParticle::id() and HepMC3::GenVertex::id() as unique identifiers of the particles, e.g. in HepMCParticleLink. In this way the usage of barcode() property of GenParticlea and GenVertex will be almost eliminated.

The 2) was already implemented by @jchapman as an option. See

The 1) requires a bit more changes and those are collected in this MR with the idea to split it later into small pieces. Namely:

  • a) Switching from the bare comparison of status property of particles to the classificators in TruthUtils ( e.g. isStable) See !64579 (closed), !64552 (merged) and similar. This is an ongoing work that touches a lot of code, but the changes are trivial.

  • b) Switching from the classificators that use the barcode() directly as int to functions that use the underlying objects. See !64571 (merged) This MR will also require the removal of the specification of templates HepMC::is_simulation_particle() for int.

  • c) Change the definition of isStable(), isPhysical(),isDecayed(), i.e. ( status=1,2 particles) to take into account that particles produced in the simulation will have status original_status + constant x times_particle_interacted. Implemented in !64713 (merged)

  • d) Drop the Barcode service from the TruthSvc and instead of increasing the barcode of each particle in the simulation increase the status of particle. Implemented in this MR.

  • e) Change the references where it is needed. To be done.

@jchapman @pclark

See also !64569 (closed)

Edited by Andrii Verbytskyi

Merge request reports