key4hep / EDM4hep

Generic event data model for HEP collider experiments
https://cern.ch/edm4hep
Apache License 2.0
25 stars 35 forks source link

Make the `Vertex::primary` field a proper bit field #328

Closed tmadlener closed 3 months ago

tmadlener commented 3 months ago

(this issue is mainly intended to keep track of a discussion that already happened)

As brought up by @kjvbrt, the current primary field in the Vertex class is documented to be a boolean field, but is actually implemented via an int:

https://github.com/key4hep/EDM4hep/blob/4f72168fb5ec1abe49f8ff67d45d766c88048795/edm4hep.yaml#L551-L555

We decided today to make this member a proper bitfield, renaming it to type (in accordance with similar fields in other datatypes) and add a few reserved bits and ExtraCode similar to what is currently present in MCParticle. The reserved bit values that we add for now are primary, secondary and tertiary. More reserved bits can be added in the future without affecting the schema.