Fix bug in VSI track selection function to remove GSF tracks associated to PV
The VSI track selection implements a primary track veto using the isAssociatedToVertices
function. This PV veto cut is designed to remove tracks that are associated to primary vertices so that they are not included in the displaced vertex reconstruction. However, when running leptons-only vertexing, tracks are selected by matching inner detector tracks to muon and electron objects. When selecting tracks from electrons (using the doSelectTracksFromElectrons
option) the corresponding GSF track particles are added to the selected track collection. This means that the check in isAssociatedToVertices
that compares track pointers is not correct when selecting tracks from electrons. As a result, for lepton-only vertex configuration, prompt electrons are reconstructed in displaced vertices.
This changes in the merge request implements a bug fix to correctly check if the selected track is associated to primary vertex for both inner detector tracks and GSF tracks. With this bug fix, the isAssociatedToVertices
will now properly veto primary tracks, as it was designed to do, for both lepton-only and all-track displaced vertex configurations.