From 52cd52676666628f332240e0db5ad57a09d52635 Mon Sep 17 00:00:00 2001 From: Laurent Dufour Date: Wed, 29 Jan 2025 13:13:02 +0100 Subject: [PATCH] Include user configuration --- .../python/RecoConf/track_refitting.py | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/Hlt/RecoConf/python/RecoConf/track_refitting.py b/Hlt/RecoConf/python/RecoConf/track_refitting.py index 071b1381e87..62925665060 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 + ) -- GitLab