Add Velo track index to v1 track
The 'PV unbiasing' needs a method to match a track in a particle to a track used in the PV. The tracks can be of different types. Furthermore, the matching also needs to work after tracks are read back from a dst.
Currently, the matching is essentially done by comparing LHCbIDs. To make this reasonably fast a unique number ('VeloSegmendID') is computed from Velo LHCbIDs. For the tracks in the PV this is computed once, either when the PVs are created or when they are read back from file. The ID for the track ins the particle is computed when it is needed.
The current solution is expensive:
- when making the PVs it takes time to compute the number from the LHCbIDs
- the number doesn't allow for random access, so to identify a track in the track list assigned to the PV, a search is required
An alternative solution is to assign a unique segment ID when the velo segments are created. The id could for instance be defined as:
- index in PrVeloForward container for forward segment
- index in PrBackwardContainer + size(PrVeloForward) for backward segments For backward segments the ID is less important since we will probably never unbias wrt backward tracks.
This ID could then be copied to ancestors. The advantages are:
- in terms of storage it is much cheaper than storing LHCbIDs
- since it is a consecutive index, the 'search' in the PV can just be done by looking up an index in a table
For the v3 track such an index, called trackVP
already exists.
If we stick to the v1 Track event model, there are two ways forward:
- we can add
trackVP
to the v1 track model. This is relatively easy to do. - we can add the number as an extrainfo field. This has the advantage that the track model class doesn't need to be changed. However, it is a little more expensive in term of persistence, in terms of creation and lookup, and it is more error prone.
In both cases some extra code is needed to copy the identifier from the Pr tracks to the v1 tracks.
Both solutions are not backward compatible: If tracks are saved without the identifier, it cannot be retrieved.