diff --git a/Hlt/RecoConf/python/RecoConf/track_refitting.py b/Hlt/RecoConf/python/RecoConf/track_refitting.py index 071b1381e876c1ab7378f929f4187b28fd724af5..629256650602afc60e4fc9e6da903faca3c1ea51 100644 --- a/Hlt/RecoConf/python/RecoConf/track_refitting.py +++ b/Hlt/RecoConf/python/RecoConf/track_refitting.py @@ -14,6 +14,7 @@ import logging import Functors as F +## Algorithms for PV translations / rotations # Algorithms to get the Pr hits # Algorithms to take care of decay-tree refitting ## Algorithms for PV refitting @@ -31,6 +32,7 @@ from PyConf.Algorithms import ( SelectUTClustersFromTracks, SelectVPMicroClustersFromTracks, SharedTrackEventFitter, + UpdateVertexCoordinatesOffline, UTHitClustersToPrUTHitsConverter, UTHitClustersToUTHitHandlerConverter, V1V1PrKalmanFilter, @@ -40,6 +42,8 @@ from PyConf.Algorithms import ( from RecoConf.algorithms_thor import ParticleFilter +# Uncomment when Rec!587 is merged +# from PyConf.Algorithms import VeloKalmanTrackV1 # Algotihms to perform the fit from RecoConf.hlt2_tracking import ( get_global_measurement_provider, @@ -274,3 +278,23 @@ def refit_pvs( InputTrackRelations=relation_table_match_by_veloid_to_track, OnlyKeepConvergedFits=(not keep_unconverged_fits), ) + + +def update_vertex_positions(*, input_pvs): + """Takes as input the DataHandle of RecVertices, and applies + a coordinate transform as defined in the conditions (and + accessible via in `DeLHCb::offlineCoordinateTransformation`). + + These vertices are *not* fitted again, but merely shifted / rotated + around to account for a change in global coordinate transformation. + + This is safe to be used on all data types, including those without + the PV tracks persisted. + + The output contains the new vertices and a relation table between + the old particles and the new ones (2-way). + """ + + return UpdateVertexCoordinatesOffline( + name="UpdateVertexCoordinatesOffline_{hash}", InputVertices=input_pvs + )