From e3bbf4aab47f7defee0e31d25eb21294a21a2ff9 Mon Sep 17 00:00:00 2001 From: Tommaso Fulghesu Date: Tue, 18 Mar 2025 14:50:13 +0100 Subject: [PATCH 01/19] Add qmt test and option to run HLT1 PV finding during HLT2 reconstruction --- .../allen_gaudi_pv_with_prvelotracks.py | 57 ++++++++++++++ ...convertedtracks_hlt2_pvs_vertex_compare.py | 68 +++++++++++++++++ .../python/RecoConf/gaudi_allen_tracking.py | 76 +++++++++++++++++++ .../python/RecoConf/hlt2_global_reco.py | 24 ++++-- ...i_pv_with_prvelotracks_with_mcchecking.qmt | 39 ++++++++++ ...prvelotracks_with_mcchecking_beamshift.qmt | 39 ++++++++++ ...onvertedtracks_hlt2_pvs_vertex_compare.qmt | 34 +++++++++ 7 files changed, 329 insertions(+), 8 deletions(-) create mode 100644 Hlt/RecoConf/options/allen_gaudi_pv_with_prvelotracks.py create mode 100644 Hlt/RecoConf/options/hlt1_convertedtracks_hlt2_pvs_vertex_compare.py create mode 100644 Hlt/RecoConf/python/RecoConf/gaudi_allen_tracking.py create mode 100644 Hlt/RecoConf/tests/qmtest/allen_gaudi_pv_with_prvelotracks_with_mcchecking.qmt create mode 100644 Hlt/RecoConf/tests/qmtest/allen_gaudi_pv_with_prvelotracks_with_mcchecking_beamshift.qmt create mode 100644 Hlt/RecoConf/tests/qmtest/hlt1_convertedtracks_hlt2_pvs_vertex_compare.qmt diff --git a/Hlt/RecoConf/options/allen_gaudi_pv_with_prvelotracks.py b/Hlt/RecoConf/options/allen_gaudi_pv_with_prvelotracks.py new file mode 100644 index 00000000000..35f93b9187c --- /dev/null +++ b/Hlt/RecoConf/options/allen_gaudi_pv_with_prvelotracks.py @@ -0,0 +1,57 @@ +############################################################################### +# (c) Copyright 2021 CERN for the benefit of the LHCb Collaboration # +# # +# This software is distributed under the terms of the GNU General Public # +# Licence version 3 (GPL Version 3), copied verbatim in the file "COPYING". # +# # +# In applying this licence, CERN does not waive the privileges and immunities # +# granted to it by virtue of its status as an Intergovernmental Organization # +# or submit itself to any jurisdiction. # +############################################################################### +from Allen.config import run_allen_reconstruction +from AllenConf.primary_vertex_reconstruction import make_pvs +from PyConf.Algorithms import ( + GaudiAllenPVsToPrimaryVertexContainer, + GaudiAllenVeloToV3Tracks, + TrackContainersMerger, + fromV3TrackV1Track, +) +from RecoConf.config import Reconstruction +from RecoConf.core_algorithms import make_unique_id_generator +from RecoConf.decoders import default_VeloCluster_source + +# from AllenConf.velo_reconstruction import decode_velo, make_velo_tracks, run_velo_kalman_filter +from RecoConf.legacy_rec_hlt1_tracking import all_velo_track_types +from RecoConf.gaudi_allen_tracking import allen_velo_tracks +from RecoConf.mc_checking import get_pv_checkers +from RecoConf.options import options + + +def make_reconstruction(): + # convert PrVelo tracks to Gaudi Allen velo tracks + converted_velo_tracks = allen_velo_tracks() + + # get all velo tracks + rec_tracks = all_velo_track_types() + + # reconstruct Allen PVs + pvs = make_pvs(converted_velo_tracks, use_converted_tracks=True) + + # convert Allen PVs to PrimaryVertexContainer object + pv_container = GaudiAllenPVsToPrimaryVertexContainer( + number_of_multivertex=pvs["dev_number_of_multi_final_vertices"], + reconstructed_multi_pvs=pvs["dev_multi_final_vertices"], + ).OutputPVs + + # call PV checker + pv_checker = get_pv_checkers( + pv_container, + rec_tracks, + produce_ntuple=True, + nTracksToBeRecble=pvs["pp_minNumTracksPerVertex"] + ) + + return Reconstruction("pv_checker", pv_checker) + +with default_VeloCluster_source.bind(bank_type="VPRetinaCluster"): + run_allen_reconstruction(options, make_reconstruction) \ No newline at end of file diff --git a/Hlt/RecoConf/options/hlt1_convertedtracks_hlt2_pvs_vertex_compare.py b/Hlt/RecoConf/options/hlt1_convertedtracks_hlt2_pvs_vertex_compare.py new file mode 100644 index 00000000000..423405907d6 --- /dev/null +++ b/Hlt/RecoConf/options/hlt1_convertedtracks_hlt2_pvs_vertex_compare.py @@ -0,0 +1,68 @@ +############################################################################### +# (c) Copyright 2025 CERN for the benefit of the LHCb Collaboration # +# # +# This software is distributed under the terms of the GNU General Public # +# Licence version 3 (GPL Version 3), copied verbatim in the file "COPYING". # +# # +# In applying this licence, CERN does not waive the privileges and immunities # +# granted to it by virtue of its status as an Intergovernmental Organization # +# or submit itself to any jurisdiction. # +############################################################################### +from Allen.config import run_allen_reconstruction +from AllenConf.primary_vertex_reconstruction import make_pvs +from AllenConf.velo_reconstruction import decode_velo, make_velo_tracks +from PyConf.Algorithms import GaudiAllenPVsToPrimaryVertexContainer, VertexCompare +from PyConf.packing import persistable_location +from RecoConf.config import Reconstruction +from RecoConf.legacy_rec_hlt1_tracking import ( + all_velo_track_types, + make_TrackBeamLineVertexFinderSoA_pvs +) +from RecoConf.gaudi_allen_tracking import allen_velo_tracks +from RecoConf.options import options + + +def run_VertexCompare(): + # reconstruct Allen velo tracks + converted_velo_tracks = allen_velo_tracks() + + # reconstruct Allen PVs + pvs_converted_tracks = make_pvs(converted_velo_tracks, pv_name="converted_tracks", use_converted_tracks=True) + + # reconstruct Allen velo tracks + decoded_velo = decode_velo() + velo_tracks = make_velo_tracks(decoded_velo) + + # reconstruct Allen PVs + pvs = make_pvs(velo_tracks, pv_name="nominal") + + # convert Allen PVs to PrimaryVertexContainer object + pv_container_allen = GaudiAllenPVsToPrimaryVertexContainer( + number_of_multivertex=pvs["dev_number_of_multi_final_vertices"], + reconstructed_multi_pvs=pvs["dev_multi_final_vertices"], + ).OutputPVs + + pv_container_allen_converted_tracks = GaudiAllenPVsToPrimaryVertexContainer( + number_of_multivertex=pvs_converted_tracks["dev_number_of_multi_final_vertices"], + reconstructed_multi_pvs=pvs_converted_tracks["dev_multi_final_vertices"], + ).OutputPVs + + hlt1_tracks = all_velo_track_types() + pvs_tblv = make_TrackBeamLineVertexFinderSoA_pvs( + hlt1_tracks, location=persistable_location("PVs") + ) + + with VertexCompare.bind(produceNtuple=True): + vertex_compare = [ + VertexCompare( + inputVerticesName1=pv_container_allen_converted_tracks, + inputVerticesName2=pvs_tblv["v3"] + ), + VertexCompare( + inputVerticesName1=pv_container_allen_converted_tracks, + inputVerticesName2=pv_container_allen, + ), + ] + return Reconstruction("vertex_compare", vertex_compare) + +run_allen_reconstruction(options, run_VertexCompare) diff --git a/Hlt/RecoConf/python/RecoConf/gaudi_allen_tracking.py b/Hlt/RecoConf/python/RecoConf/gaudi_allen_tracking.py new file mode 100644 index 00000000000..2d9aae31fe8 --- /dev/null +++ b/Hlt/RecoConf/python/RecoConf/gaudi_allen_tracking.py @@ -0,0 +1,76 @@ +############################################################################### +# (c) Copyright 2019 CERN for the benefit of the LHCb Collaboration # +# # +# This software is distributed under the terms of the GNU General Public # +# Licence version 3 (GPL Version 3), copied verbatim in the file "COPYING". # +# # +# In applying this licence, CERN does not waive the privileges and immunities # +# granted to it by virtue of its status as an Intergovernmental Organization # +# or submit itself to any jurisdiction. # +############################################################################### +from PyConf import configurable +from PyConf.Algorithms import ( + PrVeloToGaudiAllenVeloTracks, + GaudiAllenPVsToPrimaryVertexContainer, + PVToRecConverterV1, +) +from RecoConf.legacy_rec_hlt1_tracking import all_velo_track_types +from AllenConf.primary_vertex_reconstruction import make_pvs + + +@configurable +def allen_velo_tracks(make_velo_tracks=all_velo_track_types): + """Helper function to get velo tracks converted to Allen type. + + Args: + make_velo_tracks (DataHandle): velo tracking algorithm, defaults to `make_VeloClusterTrackingSIMD_tracks`. + + Returns: + DataHandle: Allen velo tracks + """ + velo_tracks = make_velo_tracks() + + allen_velo_tracks_alg = PrVeloToGaudiAllenVeloTracks( + PrVeloTracksForward=velo_tracks["Pr"], + PrVeloTracksBackward=velo_tracks["Pr::backward"], + ) + + return { + "v1": velo_tracks["v1"], + "Pr": velo_tracks["Pr"], + "Pr::backward": velo_tracks["Pr::backward"], + "dev_velo_tracks_mec": allen_velo_tracks_alg.AllenVeloTracksMEC, + "dev_velo_tracks_view": allen_velo_tracks_alg.AllenVeloTracksView, + "dev_velo_kalman_beamline_states_view": allen_velo_tracks_alg.AllenBeamlineStatesView, + "host_number_of_reconstructed_velo_tracks": allen_velo_tracks_alg.NumberOfReconstructedVeloTracks, + } + +@configurable +def make_hlt1_pvs( + location=None, + make_pvs=make_pvs): + """Makes PVs from velo tracks using HLT1 PV finding algorithm + + Args: + velo_tracks (dict): allen velo tracks + make_pvs_from_velo_tracks (DataHandle): HLT1 PV finding algorithm + + Returns: + DataHandle: Allen TBLV PVs + """ + converted_velo_tracks = allen_velo_tracks() + pvs = make_pvs(converted_velo_tracks, use_converted_tracks=True) + + pvs = { "v3": + GaudiAllenPVsToPrimaryVertexContainer( + number_of_multivertex=pvs["dev_number_of_multi_final_vertices"], + reconstructed_multi_pvs=pvs["dev_multi_final_vertices"] + ).OutputPVs + } + + pvs["v1"] = PVToRecConverterV1( + InputVertices=pvs["v3"], + InputTracks=converted_velo_tracks["v1"], + outputs={"OutputVertices": location}).OutputVertices + + return pvs \ No newline at end of file diff --git a/Hlt/RecoConf/python/RecoConf/hlt2_global_reco.py b/Hlt/RecoConf/python/RecoConf/hlt2_global_reco.py index 0779940edfe..48af88e9171 100644 --- a/Hlt/RecoConf/python/RecoConf/hlt2_global_reco.py +++ b/Hlt/RecoConf/python/RecoConf/hlt2_global_reco.py @@ -44,6 +44,9 @@ from .legacy_rec_hlt1_tracking import ( make_reco_pvs, make_VeloClusterTrackingSIMD_hits, ) +from .gaudi_allen_tracking import ( + make_hlt1_pvs +) from .muon_reconstruction import make_all_muon_pids, make_conv_muon_pids from .muonid import make_muon_hits from .protoparticles import ( @@ -69,6 +72,7 @@ def make_reconstruction( skipCalo=False, skipMuon=False, fastReco=False, + useHLT1PVs=False, ): """Return reconstruction objects of the legacy, fastest or the light reconstruction, with possibility to skip the UT""" rich_and_charged_proto_track_types = ( @@ -85,14 +89,18 @@ def make_reconstruction( tracks_v3, tracks_rels = convert_tracks_to_v3_from_v1(persisted_tracks) # PVs - pvs = make_reco_pvs( - { - "Pr": hlt2_tracks["Velo"]["Pr"], - "Pr::backward": hlt2_tracks["Velo"]["Pr::backward"], - "v1": persisted_tracks["Velo"], - }, - persistable_location("PVs"), - ) + if useHLT1PVs: + pvs = make_hlt1_pvs() + else: + pvs = make_reco_pvs( + { + "Pr": hlt2_tracks["Velo"]["Pr"], + "Pr::backward": hlt2_tracks["Velo"]["Pr::backward"], + "v1": persisted_tracks["Velo"], + }, + persistable_location("PVs"), + ) + # calorimeter calo_pids = ( diff --git a/Hlt/RecoConf/tests/qmtest/allen_gaudi_pv_with_prvelotracks_with_mcchecking.qmt b/Hlt/RecoConf/tests/qmtest/allen_gaudi_pv_with_prvelotracks_with_mcchecking.qmt new file mode 100644 index 00000000000..6b8b0b5e8d9 --- /dev/null +++ b/Hlt/RecoConf/tests/qmtest/allen_gaudi_pv_with_prvelotracks_with_mcchecking.qmt @@ -0,0 +1,39 @@ + + + + +gaudirun.py + + $MOOREROOT/tests/options/default_input_and_conds_hlt1.py + $RECOCONFROOT/options/allen_gaudi_pv_with_prvelotracks.py + +true +../refs/allen_gaudi_pv_with_prvelotracks_with_mcchecking.ref +../refs/empty.ref + + +from Moore.qmtest.exclusions import ref_preprocessor +validateWithReference(preproc = ref_preprocessor) + +from Allen.qmtest.validators import check_PV_efficiency + +efficiency, fake_pv = check_PV_efficiency("$RECOCONFROOT/tests/refs/allen_gaudi_pv_with_prvelotracks_with_mcchecking_beamshift.ref", causes, "all") + +from Moore.qmtest.exclusions import remove_known_warnings +countErrorLines({"FATAL": 0, "ERROR": 0, "WARNING": 0}, + stdout=remove_known_warnings(stdout)) + + + diff --git a/Hlt/RecoConf/tests/qmtest/allen_gaudi_pv_with_prvelotracks_with_mcchecking_beamshift.qmt b/Hlt/RecoConf/tests/qmtest/allen_gaudi_pv_with_prvelotracks_with_mcchecking_beamshift.qmt new file mode 100644 index 00000000000..3ee319807ef --- /dev/null +++ b/Hlt/RecoConf/tests/qmtest/allen_gaudi_pv_with_prvelotracks_with_mcchecking_beamshift.qmt @@ -0,0 +1,39 @@ + + + + +gaudirun.py + + $MOOREROOT/tests/options/mdf_input_and_conds_nominal_beamline_mc_expected_2024.py + $RECOCONFROOT/options/allen_gaudi_pv_with_prvelotracks.py + +true +../refs/allen_gaudi_pv_with_prvelotracks_with_mcchecking_beamshift.ref +../refs/empty.ref + + +from Moore.qmtest.exclusions import ref_preprocessor +validateWithReference(preproc = ref_preprocessor) + +from Allen.qmtest.validators import check_PV_efficiency + +efficiency, fake_pv = check_PV_efficiency("$RECOCONFROOT/tests/refs/allen_gaudi_pv_with_prvelotracks_with_mcchecking_beamshift.ref", causes, "all") + +from Moore.qmtest.exclusions import remove_known_warnings +countErrorLines({"FATAL": 0, "ERROR": 0, "WARNING": 0}, + stdout=remove_known_warnings(stdout)) + + + diff --git a/Hlt/RecoConf/tests/qmtest/hlt1_convertedtracks_hlt2_pvs_vertex_compare.qmt b/Hlt/RecoConf/tests/qmtest/hlt1_convertedtracks_hlt2_pvs_vertex_compare.qmt new file mode 100644 index 00000000000..d970b2bb00e --- /dev/null +++ b/Hlt/RecoConf/tests/qmtest/hlt1_convertedtracks_hlt2_pvs_vertex_compare.qmt @@ -0,0 +1,34 @@ + + + + +gaudirun.py + + $MOOREROOT/tests/options/default_input_and_conds_hlt1.py + $RECOCONFROOT/options/hlt1_convertedtracks_hlt2_pvs_vertex_compare.py + +true +../refs/hlt1_convertedtracks_hlt2_pvs_vertex_compare.ref +../refs/empty.ref + + +from Moore.qmtest.exclusions import ref_preprocessor +validateWithReference(preproc = ref_preprocessor) + +from Moore.qmtest.exclusions import remove_known_warnings +countErrorLines({"FATAL": 0, "ERROR": 0, "WARNING": 0}, + stdout=remove_known_warnings(stdout)) + + + -- GitLab From 92b9413183cfe573721de37f9414dceb97f46feb Mon Sep 17 00:00:00 2001 From: Gitlab CI Date: Tue, 18 Mar 2025 13:51:06 +0000 Subject: [PATCH 02/19] pre-commit fixes patch generated by https://gitlab.cern.ch/lhcb/Moore/-/jobs/52909910 --- .../allen_gaudi_pv_with_prvelotracks.py | 7 +++--- ...convertedtracks_hlt2_pvs_vertex_compare.py | 17 ++++++++----- .../python/RecoConf/gaudi_allen_tracking.py | 25 ++++++++++--------- .../python/RecoConf/hlt2_global_reco.py | 5 +--- 4 files changed, 29 insertions(+), 25 deletions(-) diff --git a/Hlt/RecoConf/options/allen_gaudi_pv_with_prvelotracks.py b/Hlt/RecoConf/options/allen_gaudi_pv_with_prvelotracks.py index 35f93b9187c..c3257a681f1 100644 --- a/Hlt/RecoConf/options/allen_gaudi_pv_with_prvelotracks.py +++ b/Hlt/RecoConf/options/allen_gaudi_pv_with_prvelotracks.py @@ -19,10 +19,10 @@ from PyConf.Algorithms import ( from RecoConf.config import Reconstruction from RecoConf.core_algorithms import make_unique_id_generator from RecoConf.decoders import default_VeloCluster_source +from RecoConf.gaudi_allen_tracking import allen_velo_tracks # from AllenConf.velo_reconstruction import decode_velo, make_velo_tracks, run_velo_kalman_filter from RecoConf.legacy_rec_hlt1_tracking import all_velo_track_types -from RecoConf.gaudi_allen_tracking import allen_velo_tracks from RecoConf.mc_checking import get_pv_checkers from RecoConf.options import options @@ -48,10 +48,11 @@ def make_reconstruction(): pv_container, rec_tracks, produce_ntuple=True, - nTracksToBeRecble=pvs["pp_minNumTracksPerVertex"] + nTracksToBeRecble=pvs["pp_minNumTracksPerVertex"], ) return Reconstruction("pv_checker", pv_checker) + with default_VeloCluster_source.bind(bank_type="VPRetinaCluster"): - run_allen_reconstruction(options, make_reconstruction) \ No newline at end of file + run_allen_reconstruction(options, make_reconstruction) diff --git a/Hlt/RecoConf/options/hlt1_convertedtracks_hlt2_pvs_vertex_compare.py b/Hlt/RecoConf/options/hlt1_convertedtracks_hlt2_pvs_vertex_compare.py index 423405907d6..432f373f37b 100644 --- a/Hlt/RecoConf/options/hlt1_convertedtracks_hlt2_pvs_vertex_compare.py +++ b/Hlt/RecoConf/options/hlt1_convertedtracks_hlt2_pvs_vertex_compare.py @@ -14,11 +14,11 @@ from AllenConf.velo_reconstruction import decode_velo, make_velo_tracks from PyConf.Algorithms import GaudiAllenPVsToPrimaryVertexContainer, VertexCompare from PyConf.packing import persistable_location from RecoConf.config import Reconstruction +from RecoConf.gaudi_allen_tracking import allen_velo_tracks from RecoConf.legacy_rec_hlt1_tracking import ( all_velo_track_types, - make_TrackBeamLineVertexFinderSoA_pvs + make_TrackBeamLineVertexFinderSoA_pvs, ) -from RecoConf.gaudi_allen_tracking import allen_velo_tracks from RecoConf.options import options @@ -27,7 +27,9 @@ def run_VertexCompare(): converted_velo_tracks = allen_velo_tracks() # reconstruct Allen PVs - pvs_converted_tracks = make_pvs(converted_velo_tracks, pv_name="converted_tracks", use_converted_tracks=True) + pvs_converted_tracks = make_pvs( + converted_velo_tracks, pv_name="converted_tracks", use_converted_tracks=True + ) # reconstruct Allen velo tracks decoded_velo = decode_velo() @@ -43,7 +45,9 @@ def run_VertexCompare(): ).OutputPVs pv_container_allen_converted_tracks = GaudiAllenPVsToPrimaryVertexContainer( - number_of_multivertex=pvs_converted_tracks["dev_number_of_multi_final_vertices"], + number_of_multivertex=pvs_converted_tracks[ + "dev_number_of_multi_final_vertices" + ], reconstructed_multi_pvs=pvs_converted_tracks["dev_multi_final_vertices"], ).OutputPVs @@ -55,8 +59,8 @@ def run_VertexCompare(): with VertexCompare.bind(produceNtuple=True): vertex_compare = [ VertexCompare( - inputVerticesName1=pv_container_allen_converted_tracks, - inputVerticesName2=pvs_tblv["v3"] + inputVerticesName1=pv_container_allen_converted_tracks, + inputVerticesName2=pvs_tblv["v3"], ), VertexCompare( inputVerticesName1=pv_container_allen_converted_tracks, @@ -65,4 +69,5 @@ def run_VertexCompare(): ] return Reconstruction("vertex_compare", vertex_compare) + run_allen_reconstruction(options, run_VertexCompare) diff --git a/Hlt/RecoConf/python/RecoConf/gaudi_allen_tracking.py b/Hlt/RecoConf/python/RecoConf/gaudi_allen_tracking.py index 2d9aae31fe8..67e49b33dc6 100644 --- a/Hlt/RecoConf/python/RecoConf/gaudi_allen_tracking.py +++ b/Hlt/RecoConf/python/RecoConf/gaudi_allen_tracking.py @@ -8,14 +8,15 @@ # granted to it by virtue of its status as an Intergovernmental Organization # # or submit itself to any jurisdiction. # ############################################################################### +from AllenConf.primary_vertex_reconstruction import make_pvs from PyConf import configurable from PyConf.Algorithms import ( - PrVeloToGaudiAllenVeloTracks, GaudiAllenPVsToPrimaryVertexContainer, + PrVeloToGaudiAllenVeloTracks, PVToRecConverterV1, ) + from RecoConf.legacy_rec_hlt1_tracking import all_velo_track_types -from AllenConf.primary_vertex_reconstruction import make_pvs @configurable @@ -45,10 +46,9 @@ def allen_velo_tracks(make_velo_tracks=all_velo_track_types): "host_number_of_reconstructed_velo_tracks": allen_velo_tracks_alg.NumberOfReconstructedVeloTracks, } + @configurable -def make_hlt1_pvs( - location=None, - make_pvs=make_pvs): +def make_hlt1_pvs(location=None, make_pvs=make_pvs): """Makes PVs from velo tracks using HLT1 PV finding algorithm Args: @@ -61,16 +61,17 @@ def make_hlt1_pvs( converted_velo_tracks = allen_velo_tracks() pvs = make_pvs(converted_velo_tracks, use_converted_tracks=True) - pvs = { "v3": - GaudiAllenPVsToPrimaryVertexContainer( + pvs = { + "v3": GaudiAllenPVsToPrimaryVertexContainer( number_of_multivertex=pvs["dev_number_of_multi_final_vertices"], - reconstructed_multi_pvs=pvs["dev_multi_final_vertices"] + reconstructed_multi_pvs=pvs["dev_multi_final_vertices"], ).OutputPVs } - + pvs["v1"] = PVToRecConverterV1( InputVertices=pvs["v3"], InputTracks=converted_velo_tracks["v1"], - outputs={"OutputVertices": location}).OutputVertices - - return pvs \ No newline at end of file + outputs={"OutputVertices": location}, + ).OutputVertices + + return pvs diff --git a/Hlt/RecoConf/python/RecoConf/hlt2_global_reco.py b/Hlt/RecoConf/python/RecoConf/hlt2_global_reco.py index 48af88e9171..065d9be9836 100644 --- a/Hlt/RecoConf/python/RecoConf/hlt2_global_reco.py +++ b/Hlt/RecoConf/python/RecoConf/hlt2_global_reco.py @@ -31,6 +31,7 @@ from PyConf.Algorithms import ( from PyConf.packing import persistable_location from .calorimeter_reconstruction import make_calo +from .gaudi_allen_tracking import make_hlt1_pvs from .hlt2_tracking import ( convert_tracks_to_v3_from_v1, get_persistable_tracks_per_type, @@ -44,9 +45,6 @@ from .legacy_rec_hlt1_tracking import ( make_reco_pvs, make_VeloClusterTrackingSIMD_hits, ) -from .gaudi_allen_tracking import ( - make_hlt1_pvs -) from .muon_reconstruction import make_all_muon_pids, make_conv_muon_pids from .muonid import make_muon_hits from .protoparticles import ( @@ -101,7 +99,6 @@ def make_reconstruction( persistable_location("PVs"), ) - # calorimeter calo_pids = ( make_calo(tracks_v3, pvs["v3"], trackrels=tracks_rels) if not skipCalo else None -- GitLab From e119d86f78af9af042506fd05f1bb0e1726e0b60 Mon Sep 17 00:00:00 2001 From: Tommaso Fulghesu Date: Tue, 18 Mar 2025 16:39:02 +0100 Subject: [PATCH 03/19] Pass location --- Hlt/RecoConf/python/RecoConf/hlt2_global_reco.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Hlt/RecoConf/python/RecoConf/hlt2_global_reco.py b/Hlt/RecoConf/python/RecoConf/hlt2_global_reco.py index 065d9be9836..a19efbb29c3 100644 --- a/Hlt/RecoConf/python/RecoConf/hlt2_global_reco.py +++ b/Hlt/RecoConf/python/RecoConf/hlt2_global_reco.py @@ -88,7 +88,7 @@ def make_reconstruction( # PVs if useHLT1PVs: - pvs = make_hlt1_pvs() + pvs = make_hlt1_pvs(location=persistable_location("PVs")) else: pvs = make_reco_pvs( { -- GitLab From 4b45dd4536e6349025f61a61790cc377d964e94d Mon Sep 17 00:00:00 2001 From: Tommaso Fulghesu Date: Tue, 18 Mar 2025 21:43:44 +0100 Subject: [PATCH 04/19] Cleanup --- Hlt/RecoConf/python/RecoConf/gaudi_allen_tracking.py | 1 - 1 file changed, 1 deletion(-) diff --git a/Hlt/RecoConf/python/RecoConf/gaudi_allen_tracking.py b/Hlt/RecoConf/python/RecoConf/gaudi_allen_tracking.py index 67e49b33dc6..4aef932ca02 100644 --- a/Hlt/RecoConf/python/RecoConf/gaudi_allen_tracking.py +++ b/Hlt/RecoConf/python/RecoConf/gaudi_allen_tracking.py @@ -40,7 +40,6 @@ def allen_velo_tracks(make_velo_tracks=all_velo_track_types): "v1": velo_tracks["v1"], "Pr": velo_tracks["Pr"], "Pr::backward": velo_tracks["Pr::backward"], - "dev_velo_tracks_mec": allen_velo_tracks_alg.AllenVeloTracksMEC, "dev_velo_tracks_view": allen_velo_tracks_alg.AllenVeloTracksView, "dev_velo_kalman_beamline_states_view": allen_velo_tracks_alg.AllenBeamlineStatesView, "host_number_of_reconstructed_velo_tracks": allen_velo_tracks_alg.NumberOfReconstructedVeloTracks, -- GitLab From 097d69ce4be5533bdf1d1ba8279e7b382d726044 Mon Sep 17 00:00:00 2001 From: Tommaso Fulghesu Date: Tue, 22 Jul 2025 17:23:45 +0200 Subject: [PATCH 05/19] Update conversion of tracks in Moore --- .../allen_gaudi_pv_with_prvelotracks.py | 5 +- ...convertedtracks_hlt2_pvs_vertex_compare.py | 6 +- .../python/RecoConf/gaudi_allen_tracking.py | 64 ++++++++++++------- .../python/RecoConf/hlt2_global_reco.py | 4 +- 4 files changed, 49 insertions(+), 30 deletions(-) diff --git a/Hlt/RecoConf/options/allen_gaudi_pv_with_prvelotracks.py b/Hlt/RecoConf/options/allen_gaudi_pv_with_prvelotracks.py index c3257a681f1..8dcf69a403c 100644 --- a/Hlt/RecoConf/options/allen_gaudi_pv_with_prvelotracks.py +++ b/Hlt/RecoConf/options/allen_gaudi_pv_with_prvelotracks.py @@ -28,11 +28,10 @@ from RecoConf.options import options def make_reconstruction(): - # convert PrVelo tracks to Gaudi Allen velo tracks - converted_velo_tracks = allen_velo_tracks() - # get all velo tracks rec_tracks = all_velo_track_types() + # convert PrVelo tracks to Gaudi Allen velo tracks + converted_velo_tracks = allen_velo_tracks(input_tracks=rec_tracks) # reconstruct Allen PVs pvs = make_pvs(converted_velo_tracks, use_converted_tracks=True) diff --git a/Hlt/RecoConf/options/hlt1_convertedtracks_hlt2_pvs_vertex_compare.py b/Hlt/RecoConf/options/hlt1_convertedtracks_hlt2_pvs_vertex_compare.py index 432f373f37b..e371d7fa89e 100644 --- a/Hlt/RecoConf/options/hlt1_convertedtracks_hlt2_pvs_vertex_compare.py +++ b/Hlt/RecoConf/options/hlt1_convertedtracks_hlt2_pvs_vertex_compare.py @@ -23,8 +23,9 @@ from RecoConf.options import options def run_VertexCompare(): + velo_tracks = all_velo_track_types() # reconstruct Allen velo tracks - converted_velo_tracks = allen_velo_tracks() + converted_velo_tracks = allen_velo_tracks(input_tracks=velo_tracks) # reconstruct Allen PVs pvs_converted_tracks = make_pvs( @@ -51,9 +52,8 @@ def run_VertexCompare(): reconstructed_multi_pvs=pvs_converted_tracks["dev_multi_final_vertices"], ).OutputPVs - hlt1_tracks = all_velo_track_types() pvs_tblv = make_TrackBeamLineVertexFinderSoA_pvs( - hlt1_tracks, location=persistable_location("PVs") + velo_tracks, location=persistable_location("PVs") ) with VertexCompare.bind(produceNtuple=True): diff --git a/Hlt/RecoConf/python/RecoConf/gaudi_allen_tracking.py b/Hlt/RecoConf/python/RecoConf/gaudi_allen_tracking.py index 4aef932ca02..7fca2255426 100644 --- a/Hlt/RecoConf/python/RecoConf/gaudi_allen_tracking.py +++ b/Hlt/RecoConf/python/RecoConf/gaudi_allen_tracking.py @@ -13,33 +13,28 @@ from PyConf import configurable from PyConf.Algorithms import ( GaudiAllenPVsToPrimaryVertexContainer, PrVeloToGaudiAllenVeloTracks, - PVToRecConverterV1, ) - -from RecoConf.legacy_rec_hlt1_tracking import all_velo_track_types - +from PyConf import ConfigurationError @configurable -def allen_velo_tracks(make_velo_tracks=all_velo_track_types): +def allen_velo_tracks(input_tracks): """Helper function to get velo tracks converted to Allen type. Args: - make_velo_tracks (DataHandle): velo tracking algorithm, defaults to `make_VeloClusterTrackingSIMD_tracks`. + input_tracks (DataHandle): Input tracks to be converted. Returns: DataHandle: Allen velo tracks """ - velo_tracks = make_velo_tracks() - allen_velo_tracks_alg = PrVeloToGaudiAllenVeloTracks( - PrVeloTracksForward=velo_tracks["Pr"], - PrVeloTracksBackward=velo_tracks["Pr::backward"], + PrVeloTracksForward=input_tracks["Pr"], + PrVeloTracksBackward=input_tracks["Pr::backward"], ) return { - "v1": velo_tracks["v1"], - "Pr": velo_tracks["Pr"], - "Pr::backward": velo_tracks["Pr::backward"], + "v1": input_tracks["v1"], + "Pr": input_tracks["Pr"], + "Pr::backward": input_tracks["Pr::backward"], "dev_velo_tracks_view": allen_velo_tracks_alg.AllenVeloTracksView, "dev_velo_kalman_beamline_states_view": allen_velo_tracks_alg.AllenBeamlineStatesView, "host_number_of_reconstructed_velo_tracks": allen_velo_tracks_alg.NumberOfReconstructedVeloTracks, @@ -47,17 +42,23 @@ def allen_velo_tracks(make_velo_tracks=all_velo_track_types): @configurable -def make_hlt1_pvs(location=None, make_pvs=make_pvs): +def make_hlt1_pvs(hlt2_tracks, location=None, make_pvs=make_pvs): """Makes PVs from velo tracks using HLT1 PV finding algorithm Args: - velo_tracks (dict): allen velo tracks - make_pvs_from_velo_tracks (DataHandle): HLT1 PV finding algorithm + hlt2_tracks (DataHandle): HLT2 tracks to be converted for PV finding + location (str, optional): Location to store the output PVs. Defaults to None. + make_pvs (function, optional): Function to create PVs. Defaults to `make_pvs`. Returns: DataHandle: Allen TBLV PVs """ - converted_velo_tracks = allen_velo_tracks() + velo_tracks = { + "v1": hlt2_tracks["Velo"]["v1"], + "Pr": hlt2_tracks["Velo"]["Pr"], + "Pr::backward": hlt2_tracks["Velo"]["Pr::backward"], + } + converted_velo_tracks = allen_velo_tracks(input_tracks=velo_tracks) pvs = make_pvs(converted_velo_tracks, use_converted_tracks=True) pvs = { @@ -67,10 +68,29 @@ def make_hlt1_pvs(location=None, make_pvs=make_pvs): ).OutputPVs } - pvs["v1"] = PVToRecConverterV1( - InputVertices=pvs["v3"], - InputTracks=converted_velo_tracks["v1"], - outputs={"OutputVertices": location}, - ).OutputVertices + if "v1" in converted_velo_tracks: + if (location is not None) and ( + "SharedObjectsContainer" in converted_velo_tracks["v1"].type + ): + raise ConfigurationError( + "For use in PVs (and linking to tracks), Velo v1 tracks (persistable) relies on being a direct copy of Pr Velo tracks." + "Is that still the case with a Track::Selection? Should use the original KeyedContainer (probably)" + ) + from PyConf.Algorithms import PVToRecConverterV1 + + pvs["v1"] = PVToRecConverterV1( + InputVertices=pvs["v3"], + InputTracks=converted_velo_tracks["v1"], + outputs={"OutputVertices": location}, + ).OutputVertices + + else: + from PyConf.Algorithms import PVToRecConverterV1WithoutTracks + + pvs["v1"] = PVToRecConverterV1WithoutTracks( + InputVertices=pvs["v3"], + AddTrackWeights=False, + outputs={"OutputVertices": location}, + ).OutputVertices return pvs diff --git a/Hlt/RecoConf/python/RecoConf/hlt2_global_reco.py b/Hlt/RecoConf/python/RecoConf/hlt2_global_reco.py index a19efbb29c3..14b54331646 100644 --- a/Hlt/RecoConf/python/RecoConf/hlt2_global_reco.py +++ b/Hlt/RecoConf/python/RecoConf/hlt2_global_reco.py @@ -70,7 +70,7 @@ def make_reconstruction( skipCalo=False, skipMuon=False, fastReco=False, - useHLT1PVs=False, + useHLT1PVs=True, ): """Return reconstruction objects of the legacy, fastest or the light reconstruction, with possibility to skip the UT""" rich_and_charged_proto_track_types = ( @@ -88,7 +88,7 @@ def make_reconstruction( # PVs if useHLT1PVs: - pvs = make_hlt1_pvs(location=persistable_location("PVs")) + pvs = make_hlt1_pvs(hlt2_tracks=hlt2_tracks, location=persistable_location("PVs")) else: pvs = make_reco_pvs( { -- GitLab From 054693a83b18e5968d5ead5435250c6a481f3f54 Mon Sep 17 00:00:00 2001 From: Tommaso Fulghesu Date: Wed, 23 Jul 2025 09:09:25 +0200 Subject: [PATCH 06/19] Add fix to VertexCompare --- .../hlt1_convertedtracks_hlt2_pvs_vertex_compare.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Hlt/RecoConf/options/hlt1_convertedtracks_hlt2_pvs_vertex_compare.py b/Hlt/RecoConf/options/hlt1_convertedtracks_hlt2_pvs_vertex_compare.py index e371d7fa89e..19e7c243d22 100644 --- a/Hlt/RecoConf/options/hlt1_convertedtracks_hlt2_pvs_vertex_compare.py +++ b/Hlt/RecoConf/options/hlt1_convertedtracks_hlt2_pvs_vertex_compare.py @@ -23,9 +23,9 @@ from RecoConf.options import options def run_VertexCompare(): - velo_tracks = all_velo_track_types() + hlt2_velo_tracks = all_velo_track_types() # reconstruct Allen velo tracks - converted_velo_tracks = allen_velo_tracks(input_tracks=velo_tracks) + converted_velo_tracks = allen_velo_tracks(input_tracks=hlt2_velo_tracks) # reconstruct Allen PVs pvs_converted_tracks = make_pvs( @@ -34,10 +34,10 @@ def run_VertexCompare(): # reconstruct Allen velo tracks decoded_velo = decode_velo() - velo_tracks = make_velo_tracks(decoded_velo) + hlt1_velo_tracks = make_velo_tracks(decoded_velo) # reconstruct Allen PVs - pvs = make_pvs(velo_tracks, pv_name="nominal") + pvs = make_pvs(hlt1_velo_tracks, pv_name="nominal") # convert Allen PVs to PrimaryVertexContainer object pv_container_allen = GaudiAllenPVsToPrimaryVertexContainer( @@ -53,7 +53,7 @@ def run_VertexCompare(): ).OutputPVs pvs_tblv = make_TrackBeamLineVertexFinderSoA_pvs( - velo_tracks, location=persistable_location("PVs") + hlt2_velo_tracks, location=persistable_location("PVs") ) with VertexCompare.bind(produceNtuple=True): -- GitLab From b143b553df72e43c44809e1f322cdaf9f5674b43 Mon Sep 17 00:00:00 2001 From: Tommaso Fulghesu Date: Mon, 28 Jul 2025 10:26:08 +0200 Subject: [PATCH 07/19] Update gaudi allen tracking --- Hlt/RecoConf/python/RecoConf/gaudi_allen_tracking.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Hlt/RecoConf/python/RecoConf/gaudi_allen_tracking.py b/Hlt/RecoConf/python/RecoConf/gaudi_allen_tracking.py index 7fca2255426..75cd580c897 100644 --- a/Hlt/RecoConf/python/RecoConf/gaudi_allen_tracking.py +++ b/Hlt/RecoConf/python/RecoConf/gaudi_allen_tracking.py @@ -51,7 +51,7 @@ def make_hlt1_pvs(hlt2_tracks, location=None, make_pvs=make_pvs): make_pvs (function, optional): Function to create PVs. Defaults to `make_pvs`. Returns: - DataHandle: Allen TBLV PVs + DataHandle: Converted HLT1 reconstructed PVs """ velo_tracks = { "v1": hlt2_tracks["Velo"]["v1"], @@ -59,12 +59,12 @@ def make_hlt1_pvs(hlt2_tracks, location=None, make_pvs=make_pvs): "Pr::backward": hlt2_tracks["Velo"]["Pr::backward"], } converted_velo_tracks = allen_velo_tracks(input_tracks=velo_tracks) - pvs = make_pvs(converted_velo_tracks, use_converted_tracks=True) + hlt1_pvs = make_pvs(converted_velo_tracks, use_converted_tracks=True) pvs = { "v3": GaudiAllenPVsToPrimaryVertexContainer( - number_of_multivertex=pvs["dev_number_of_multi_final_vertices"], - reconstructed_multi_pvs=pvs["dev_multi_final_vertices"], + number_of_multivertex=hlt1_pvs["dev_number_of_multi_final_vertices"], + reconstructed_multi_pvs=hlt1_pvs["dev_multi_final_vertices"], ).OutputPVs } -- GitLab From 291243614e71df5e51b9e0d1828ac9743c084825 Mon Sep 17 00:00:00 2001 From: Tommaso Fulghesu Date: Tue, 29 Jul 2025 14:28:01 +0200 Subject: [PATCH 08/19] Ensure that the beamline position is dumped when running HLT2 --- Hlt/Moore/python/Moore/config.py | 30 +++++++++++++++++-- ...convertedtracks_hlt2_pvs_vertex_compare.py | 22 +++++++------- .../python/RecoConf/gaudi_allen_tracking.py | 2 +- 3 files changed, 40 insertions(+), 14 deletions(-) diff --git a/Hlt/Moore/python/Moore/config.py b/Hlt/Moore/python/Moore/config.py index 95bd9fe3983..09a453c1f09 100644 --- a/Hlt/Moore/python/Moore/config.py +++ b/Hlt/Moore/python/Moore/config.py @@ -56,7 +56,7 @@ from .streams import Stream, make_default_streams log = logging.getLogger(__name__) -def moore_control_flow(options, streams, process, analytics=False): +def moore_control_flow(options, streams, process, use_hlt1_reconstruction, analytics=False): """Return the Moore application control flow node. Combines the lines with `NONLAZY_OR` logic in a global decision @@ -68,6 +68,7 @@ def moore_control_flow(options, streams, process, analytics=False): options (ApplicationOptions): holder of application options streams (list of stream objects): control flow nodes of lines process (str): "hlt1", "hlt2", "spruce" or "pass". + use_hlt1_reconstruction (bool): whether to use Hlt1 reconstruction analytics (bool, optional): For use only in rate/event size analysis. Defaults to False. Returns: @@ -274,10 +275,32 @@ def moore_control_flow(options, streams, process, analytics=False): else: stream_writers_nodes = [] + if use_hlt1_reconstruction: + # If Hlt1 reconstruction is used, we need to add the non-event data service + # to the control flow to ensure that the Hlt1 reconstruction can access the + # necessary non-event data. + from RecoConf.hlt1_allen import allen_gaudi_config + from Allen.config import setup_allen_non_event_data_service + + hlt1_config = allen_gaudi_config() + allen_cf = hlt1_config["control_flow_node"] + non_event_data_node = setup_allen_non_event_data_service() + allen_algs = [non_event_data_node, allen_cf] + + allen_node = CompositeNode( + "allen_algorithms", + combine_logic=NodeLogic.NONLAZY_AND, + children=allen_algs, + force_order=True, + ) + + children = [allen_node] + [lines_node] + [rw_nodes] + stream_writers_nodes + + return CompositeNode( "moore", combine_logic=NodeLogic.LAZY_AND, - children=([lines_node] + [rw_nodes] + stream_writers_nodes), + children=(children), force_order=True, ) @@ -289,6 +312,7 @@ def run_moore( analytics=False, exclude_incompatible=True, add_required_tools_automatically=True, + use_hlt1_reconstruction=False, ): """Configure Moore's entire control and data flow. @@ -381,7 +405,7 @@ def run_moore( process = "pass" # Combine all lines and output in a global control flow. - moore_control_node = moore_control_flow(options, streams, process, analytics) + moore_control_node = moore_control_flow(options, streams, process, use_hlt1_reconstruction, analytics) # Filter to return true if physics bit 95 is "on" for this event rb_bank = default_raw_banks("HltRoutingBits") diff --git a/Hlt/RecoConf/options/hlt1_convertedtracks_hlt2_pvs_vertex_compare.py b/Hlt/RecoConf/options/hlt1_convertedtracks_hlt2_pvs_vertex_compare.py index 19e7c243d22..8b9e2d3f9d1 100644 --- a/Hlt/RecoConf/options/hlt1_convertedtracks_hlt2_pvs_vertex_compare.py +++ b/Hlt/RecoConf/options/hlt1_convertedtracks_hlt2_pvs_vertex_compare.py @@ -37,37 +37,39 @@ def run_VertexCompare(): hlt1_velo_tracks = make_velo_tracks(decoded_velo) # reconstruct Allen PVs - pvs = make_pvs(hlt1_velo_tracks, pv_name="nominal") + hlt1_pvs = make_pvs(hlt1_velo_tracks, pv_name="nominal") # convert Allen PVs to PrimaryVertexContainer object - pv_container_allen = GaudiAllenPVsToPrimaryVertexContainer( - number_of_multivertex=pvs["dev_number_of_multi_final_vertices"], - reconstructed_multi_pvs=pvs["dev_multi_final_vertices"], + pv_container_hlt1 = GaudiAllenPVsToPrimaryVertexContainer( + number_of_multivertex=hlt1_pvs["dev_number_of_multi_final_vertices"], + reconstructed_multi_pvs=hlt1_pvs["dev_multi_final_vertices"], ).OutputPVs - pv_container_allen_converted_tracks = GaudiAllenPVsToPrimaryVertexContainer( + pv_container_converted_tracks = GaudiAllenPVsToPrimaryVertexContainer( number_of_multivertex=pvs_converted_tracks[ "dev_number_of_multi_final_vertices" ], reconstructed_multi_pvs=pvs_converted_tracks["dev_multi_final_vertices"], ).OutputPVs - pvs_tblv = make_TrackBeamLineVertexFinderSoA_pvs( + hlt2_pvs = make_TrackBeamLineVertexFinderSoA_pvs( hlt2_velo_tracks, location=persistable_location("PVs") ) with VertexCompare.bind(produceNtuple=True): vertex_compare = [ VertexCompare( - inputVerticesName1=pv_container_allen_converted_tracks, - inputVerticesName2=pvs_tblv["v3"], + inputVerticesName1=pv_container_converted_tracks, + inputVerticesName2=hlt2_pvs["v3"], ), VertexCompare( - inputVerticesName1=pv_container_allen_converted_tracks, - inputVerticesName2=pv_container_allen, + inputVerticesName1=pv_container_converted_tracks, + inputVerticesName2=pv_container_hlt1, ), ] return Reconstruction("vertex_compare", vertex_compare) +options.ntuple_file = "hlt2_pvs_vertex_compare.root" + run_allen_reconstruction(options, run_VertexCompare) diff --git a/Hlt/RecoConf/python/RecoConf/gaudi_allen_tracking.py b/Hlt/RecoConf/python/RecoConf/gaudi_allen_tracking.py index 75cd580c897..e6fb8bbc740 100644 --- a/Hlt/RecoConf/python/RecoConf/gaudi_allen_tracking.py +++ b/Hlt/RecoConf/python/RecoConf/gaudi_allen_tracking.py @@ -59,7 +59,7 @@ def make_hlt1_pvs(hlt2_tracks, location=None, make_pvs=make_pvs): "Pr::backward": hlt2_tracks["Velo"]["Pr::backward"], } converted_velo_tracks = allen_velo_tracks(input_tracks=velo_tracks) - hlt1_pvs = make_pvs(converted_velo_tracks, use_converted_tracks=True) + hlt1_pvs = make_pvs(converted_velo_tracks, pv_name="converted_tracks", use_converted_tracks=True) pvs = { "v3": GaudiAllenPVsToPrimaryVertexContainer( -- GitLab From 731d2b04989fb61ee89523d9e6fb95815e111a1a Mon Sep 17 00:00:00 2001 From: Gitlab CI Date: Tue, 29 Jul 2025 12:28:51 +0000 Subject: [PATCH 09/19] pre-commit fixes patch generated by https://gitlab.cern.ch/lhcb/Moore/-/jobs/59466115 --- Hlt/Moore/python/Moore/config.py | 17 ++++++++++------- ...1_convertedtracks_hlt2_pvs_vertex_compare.py | 1 + .../python/RecoConf/gaudi_allen_tracking.py | 8 +++++--- .../python/RecoConf/hlt2_global_reco.py | 4 +++- 4 files changed, 19 insertions(+), 11 deletions(-) diff --git a/Hlt/Moore/python/Moore/config.py b/Hlt/Moore/python/Moore/config.py index 09a453c1f09..93d6031606e 100644 --- a/Hlt/Moore/python/Moore/config.py +++ b/Hlt/Moore/python/Moore/config.py @@ -56,7 +56,9 @@ from .streams import Stream, make_default_streams log = logging.getLogger(__name__) -def moore_control_flow(options, streams, process, use_hlt1_reconstruction, analytics=False): +def moore_control_flow( + options, streams, process, use_hlt1_reconstruction, analytics=False +): """Return the Moore application control flow node. Combines the lines with `NONLAZY_OR` logic in a global decision @@ -279,14 +281,14 @@ def moore_control_flow(options, streams, process, use_hlt1_reconstruction, analy # If Hlt1 reconstruction is used, we need to add the non-event data service # to the control flow to ensure that the Hlt1 reconstruction can access the # necessary non-event data. - from RecoConf.hlt1_allen import allen_gaudi_config from Allen.config import setup_allen_non_event_data_service - + from RecoConf.hlt1_allen import allen_gaudi_config + hlt1_config = allen_gaudi_config() allen_cf = hlt1_config["control_flow_node"] non_event_data_node = setup_allen_non_event_data_service() allen_algs = [non_event_data_node, allen_cf] - + allen_node = CompositeNode( "allen_algorithms", combine_logic=NodeLogic.NONLAZY_AND, @@ -296,7 +298,6 @@ def moore_control_flow(options, streams, process, use_hlt1_reconstruction, analy children = [allen_node] + [lines_node] + [rw_nodes] + stream_writers_nodes - return CompositeNode( "moore", combine_logic=NodeLogic.LAZY_AND, @@ -310,9 +311,9 @@ def run_moore( make_streams=None, public_tools=[], analytics=False, + use_hlt1_reconstruction=False, exclude_incompatible=True, add_required_tools_automatically=True, - use_hlt1_reconstruction=False, ): """Configure Moore's entire control and data flow. @@ -405,7 +406,9 @@ def run_moore( process = "pass" # Combine all lines and output in a global control flow. - moore_control_node = moore_control_flow(options, streams, process, use_hlt1_reconstruction, analytics) + moore_control_node = moore_control_flow( + options, streams, process, use_hlt1_reconstruction, analytics + ) # Filter to return true if physics bit 95 is "on" for this event rb_bank = default_raw_banks("HltRoutingBits") diff --git a/Hlt/RecoConf/options/hlt1_convertedtracks_hlt2_pvs_vertex_compare.py b/Hlt/RecoConf/options/hlt1_convertedtracks_hlt2_pvs_vertex_compare.py index 8b9e2d3f9d1..7a7f3945ab6 100644 --- a/Hlt/RecoConf/options/hlt1_convertedtracks_hlt2_pvs_vertex_compare.py +++ b/Hlt/RecoConf/options/hlt1_convertedtracks_hlt2_pvs_vertex_compare.py @@ -69,6 +69,7 @@ def run_VertexCompare(): ] return Reconstruction("vertex_compare", vertex_compare) + options.ntuple_file = "hlt2_pvs_vertex_compare.root" diff --git a/Hlt/RecoConf/python/RecoConf/gaudi_allen_tracking.py b/Hlt/RecoConf/python/RecoConf/gaudi_allen_tracking.py index e6fb8bbc740..5fbd5dae398 100644 --- a/Hlt/RecoConf/python/RecoConf/gaudi_allen_tracking.py +++ b/Hlt/RecoConf/python/RecoConf/gaudi_allen_tracking.py @@ -9,12 +9,12 @@ # or submit itself to any jurisdiction. # ############################################################################### from AllenConf.primary_vertex_reconstruction import make_pvs -from PyConf import configurable +from PyConf import ConfigurationError, configurable from PyConf.Algorithms import ( GaudiAllenPVsToPrimaryVertexContainer, PrVeloToGaudiAllenVeloTracks, ) -from PyConf import ConfigurationError + @configurable def allen_velo_tracks(input_tracks): @@ -59,7 +59,9 @@ def make_hlt1_pvs(hlt2_tracks, location=None, make_pvs=make_pvs): "Pr::backward": hlt2_tracks["Velo"]["Pr::backward"], } converted_velo_tracks = allen_velo_tracks(input_tracks=velo_tracks) - hlt1_pvs = make_pvs(converted_velo_tracks, pv_name="converted_tracks", use_converted_tracks=True) + hlt1_pvs = make_pvs( + converted_velo_tracks, pv_name="converted_tracks", use_converted_tracks=True + ) pvs = { "v3": GaudiAllenPVsToPrimaryVertexContainer( diff --git a/Hlt/RecoConf/python/RecoConf/hlt2_global_reco.py b/Hlt/RecoConf/python/RecoConf/hlt2_global_reco.py index 14b54331646..19c8acc58a9 100644 --- a/Hlt/RecoConf/python/RecoConf/hlt2_global_reco.py +++ b/Hlt/RecoConf/python/RecoConf/hlt2_global_reco.py @@ -88,7 +88,9 @@ def make_reconstruction( # PVs if useHLT1PVs: - pvs = make_hlt1_pvs(hlt2_tracks=hlt2_tracks, location=persistable_location("PVs")) + pvs = make_hlt1_pvs( + hlt2_tracks=hlt2_tracks, location=persistable_location("PVs") + ) else: pvs = make_reco_pvs( { -- GitLab From e074f9bce3a3475e59109d1c95a5212cd638f896 Mon Sep 17 00:00:00 2001 From: Tommaso Fulghesu Date: Tue, 29 Jul 2025 14:35:26 +0200 Subject: [PATCH 10/19] Set flag to run HLT1 PV reconstruction to False --- Hlt/RecoConf/python/RecoConf/hlt2_global_reco.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Hlt/RecoConf/python/RecoConf/hlt2_global_reco.py b/Hlt/RecoConf/python/RecoConf/hlt2_global_reco.py index 19c8acc58a9..910288847f1 100644 --- a/Hlt/RecoConf/python/RecoConf/hlt2_global_reco.py +++ b/Hlt/RecoConf/python/RecoConf/hlt2_global_reco.py @@ -70,7 +70,7 @@ def make_reconstruction( skipCalo=False, skipMuon=False, fastReco=False, - useHLT1PVs=True, + useHLT1PVs=False, ): """Return reconstruction objects of the legacy, fastest or the light reconstruction, with possibility to skip the UT""" rich_and_charged_proto_track_types = ( -- GitLab From dbf50665816954c54c1564918a7a78f7843e79e9 Mon Sep 17 00:00:00 2001 From: Tommaso Fulghesu Date: Wed, 30 Jul 2025 10:04:03 +0200 Subject: [PATCH 11/19] Prevent failing when not using HLT1 reconstruction --- Hlt/Moore/python/Moore/config.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Hlt/Moore/python/Moore/config.py b/Hlt/Moore/python/Moore/config.py index 93d6031606e..16641f2f946 100644 --- a/Hlt/Moore/python/Moore/config.py +++ b/Hlt/Moore/python/Moore/config.py @@ -277,6 +277,8 @@ def moore_control_flow( else: stream_writers_nodes = [] + children = [] + if use_hlt1_reconstruction: # If Hlt1 reconstruction is used, we need to add the non-event data service # to the control flow to ensure that the Hlt1 reconstruction can access the @@ -296,7 +298,9 @@ def moore_control_flow( force_order=True, ) - children = [allen_node] + [lines_node] + [rw_nodes] + stream_writers_nodes + children += [allen_node] + + children += [lines_node] + [rw_nodes] + stream_writers_nodes return CompositeNode( "moore", -- GitLab From 48cdbf0436b4c82f4816968c0514aeb19cdc1930 Mon Sep 17 00:00:00 2001 From: Tommaso Fulghesu Date: Wed, 30 Jul 2025 14:16:46 +0200 Subject: [PATCH 12/19] Dump only non event data --- Hlt/Moore/python/Moore/config.py | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/Hlt/Moore/python/Moore/config.py b/Hlt/Moore/python/Moore/config.py index 16641f2f946..12f851180b8 100644 --- a/Hlt/Moore/python/Moore/config.py +++ b/Hlt/Moore/python/Moore/config.py @@ -284,21 +284,10 @@ def moore_control_flow( # to the control flow to ensure that the Hlt1 reconstruction can access the # necessary non-event data. from Allen.config import setup_allen_non_event_data_service - from RecoConf.hlt1_allen import allen_gaudi_config - hlt1_config = allen_gaudi_config() - allen_cf = hlt1_config["control_flow_node"] non_event_data_node = setup_allen_non_event_data_service() - allen_algs = [non_event_data_node, allen_cf] - allen_node = CompositeNode( - "allen_algorithms", - combine_logic=NodeLogic.NONLAZY_AND, - children=allen_algs, - force_order=True, - ) - - children += [allen_node] + children += [non_event_data_node] children += [lines_node] + [rw_nodes] + stream_writers_nodes -- GitLab From a05368424a5368f1230d53708bf2c3f8574ad85a Mon Sep 17 00:00:00 2001 From: Tommaso Fulghesu Date: Tue, 5 Aug 2025 09:54:23 +0200 Subject: [PATCH 13/19] Apply @dovombru suggestions --- Hlt/Moore/python/Moore/config.py | 14 ++++++-------- Hlt/Moore/python/Moore/production.py | 2 +- .../options/allen_gaudi_pv_with_prvelotracks.py | 7 ++++--- ...hlt1_convertedtracks_hlt2_pvs_vertex_compare.py | 11 +++++++++-- .../python/RecoConf/gaudi_allen_tracking.py | 2 +- Hlt/RecoConf/python/RecoConf/hlt2_global_reco.py | 8 ++++---- .../qmtest/allen_gaudi_pv_with_mcchecking.qmt | 3 +-- .../qmtest/allen_gaudi_pv_with_mcchecking_SMOG.qmt | 3 +-- .../allen_gaudi_pv_with_mcchecking_beamshift.qmt | 3 +-- ..._gaudi_pv_with_prvelotracks_with_mcchecking.qmt | 4 ++-- ...with_prvelotracks_with_mcchecking_beamshift.qmt | 4 ++-- ...lt1_convertedtracks_hlt2_pvs_vertex_compare.qmt | 3 ++- 12 files changed, 34 insertions(+), 30 deletions(-) diff --git a/Hlt/Moore/python/Moore/config.py b/Hlt/Moore/python/Moore/config.py index 12f851180b8..a9e1cffa96c 100644 --- a/Hlt/Moore/python/Moore/config.py +++ b/Hlt/Moore/python/Moore/config.py @@ -57,7 +57,7 @@ log = logging.getLogger(__name__) def moore_control_flow( - options, streams, process, use_hlt1_reconstruction, analytics=False + options, streams, process, use_allen_reconstruction, analytics=False ): """Return the Moore application control flow node. @@ -70,7 +70,7 @@ def moore_control_flow( options (ApplicationOptions): holder of application options streams (list of stream objects): control flow nodes of lines process (str): "hlt1", "hlt2", "spruce" or "pass". - use_hlt1_reconstruction (bool): whether to use Hlt1 reconstruction + use_allen_reconstruction (bool): whether to use Hlt1 reconstruction analytics (bool, optional): For use only in rate/event size analysis. Defaults to False. Returns: @@ -279,16 +279,13 @@ def moore_control_flow( children = [] - if use_hlt1_reconstruction: + if use_allen_reconstruction: # If Hlt1 reconstruction is used, we need to add the non-event data service # to the control flow to ensure that the Hlt1 reconstruction can access the # necessary non-event data. from Allen.config import setup_allen_non_event_data_service - non_event_data_node = setup_allen_non_event_data_service() - children += [non_event_data_node] - children += [lines_node] + [rw_nodes] + stream_writers_nodes return CompositeNode( @@ -304,7 +301,7 @@ def run_moore( make_streams=None, public_tools=[], analytics=False, - use_hlt1_reconstruction=False, + use_allen_reconstruction=False, exclude_incompatible=True, add_required_tools_automatically=True, ): @@ -326,6 +323,7 @@ def run_moore( make_streams: function returning dict of {stream : `DecisionLine` objects}) OR a list of `DecisionLine` objects public_tools (list): list of public `Tool` instances to configure analytics (bool, optional): For use only in rate/event size analysis. Defaults to False. + use_allen_reconstruction (bool, optional): Whether to use Hlt1 reconstruction. Defaults to False. exclude_incompatible (bool, optional): Exclude the lines that are incompatible with multithreaded mode. Defaults to True. add_required_tools_automatically (bool, optional): Attach required tools to the public_tools automatically. Defaults to True. """ @@ -400,7 +398,7 @@ def run_moore( # Combine all lines and output in a global control flow. moore_control_node = moore_control_flow( - options, streams, process, use_hlt1_reconstruction, analytics + options, streams, process, use_allen_reconstruction, analytics ) # Filter to return true if physics bit 95 is "on" for this event diff --git a/Hlt/Moore/python/Moore/production.py b/Hlt/Moore/python/Moore/production.py index cb87f440ae1..bb724b2b191 100644 --- a/Hlt/Moore/python/Moore/production.py +++ b/Hlt/Moore/python/Moore/production.py @@ -512,7 +512,7 @@ def _spruce( ] moore_control_node = moore_control_flow( - options, _my_line_maker(), process="spruce" + options, _my_line_maker(), process="spruce", use_allen_reconstruction=False ) ## Add this filter before `moore_control_node` using `LAZY_AND` logic IF flagging diff --git a/Hlt/RecoConf/options/allen_gaudi_pv_with_prvelotracks.py b/Hlt/RecoConf/options/allen_gaudi_pv_with_prvelotracks.py index 8dcf69a403c..f8e972452f6 100644 --- a/Hlt/RecoConf/options/allen_gaudi_pv_with_prvelotracks.py +++ b/Hlt/RecoConf/options/allen_gaudi_pv_with_prvelotracks.py @@ -20,17 +20,18 @@ from RecoConf.config import Reconstruction from RecoConf.core_algorithms import make_unique_id_generator from RecoConf.decoders import default_VeloCluster_source from RecoConf.gaudi_allen_tracking import allen_velo_tracks - -# from AllenConf.velo_reconstruction import decode_velo, make_velo_tracks, run_velo_kalman_filter from RecoConf.legacy_rec_hlt1_tracking import all_velo_track_types from RecoConf.mc_checking import get_pv_checkers from RecoConf.options import options def make_reconstruction(): + """ + PV checker for the Allen PV finding algorithm using converted Moore VELO tracks as input + """ # get all velo tracks rec_tracks = all_velo_track_types() - # convert PrVelo tracks to Gaudi Allen velo tracks + # convert PrVelo tracks to Gaudi Allen VELO tracks converted_velo_tracks = allen_velo_tracks(input_tracks=rec_tracks) # reconstruct Allen PVs diff --git a/Hlt/RecoConf/options/hlt1_convertedtracks_hlt2_pvs_vertex_compare.py b/Hlt/RecoConf/options/hlt1_convertedtracks_hlt2_pvs_vertex_compare.py index 7a7f3945ab6..a8acba66585 100644 --- a/Hlt/RecoConf/options/hlt1_convertedtracks_hlt2_pvs_vertex_compare.py +++ b/Hlt/RecoConf/options/hlt1_convertedtracks_hlt2_pvs_vertex_compare.py @@ -23,8 +23,14 @@ from RecoConf.options import options def run_VertexCompare(): + """ + Compares between: + - Allen PV finding algorithm using as input Moore VELO tracks converted vs the nominal Moore PV finding algorithm (with Moore VELO tracks) + - Allen PV finding algorithm using as input Moore VELO tracks converted vs the nominal Allen PV finding algorithm (with Allen VELO tracks) + """ + # reconstruct Moore VELO tracks hlt2_velo_tracks = all_velo_track_types() - # reconstruct Allen velo tracks + # Convert to Allen VELO tracks converted_velo_tracks = allen_velo_tracks(input_tracks=hlt2_velo_tracks) # reconstruct Allen PVs @@ -32,7 +38,7 @@ def run_VertexCompare(): converted_velo_tracks, pv_name="converted_tracks", use_converted_tracks=True ) - # reconstruct Allen velo tracks + # reconstruct Allen VELO tracks decoded_velo = decode_velo() hlt1_velo_tracks = make_velo_tracks(decoded_velo) @@ -52,6 +58,7 @@ def run_VertexCompare(): reconstructed_multi_pvs=pvs_converted_tracks["dev_multi_final_vertices"], ).OutputPVs + # reconstruct Moore PVs hlt2_pvs = make_TrackBeamLineVertexFinderSoA_pvs( hlt2_velo_tracks, location=persistable_location("PVs") ) diff --git a/Hlt/RecoConf/python/RecoConf/gaudi_allen_tracking.py b/Hlt/RecoConf/python/RecoConf/gaudi_allen_tracking.py index 5fbd5dae398..b61c6653db1 100644 --- a/Hlt/RecoConf/python/RecoConf/gaudi_allen_tracking.py +++ b/Hlt/RecoConf/python/RecoConf/gaudi_allen_tracking.py @@ -42,7 +42,7 @@ def allen_velo_tracks(input_tracks): @configurable -def make_hlt1_pvs(hlt2_tracks, location=None, make_pvs=make_pvs): +def make_allen_pvs(hlt2_tracks, location=None, make_pvs=make_pvs): """Makes PVs from velo tracks using HLT1 PV finding algorithm Args: diff --git a/Hlt/RecoConf/python/RecoConf/hlt2_global_reco.py b/Hlt/RecoConf/python/RecoConf/hlt2_global_reco.py index 910288847f1..6938b179386 100644 --- a/Hlt/RecoConf/python/RecoConf/hlt2_global_reco.py +++ b/Hlt/RecoConf/python/RecoConf/hlt2_global_reco.py @@ -31,7 +31,7 @@ from PyConf.Algorithms import ( from PyConf.packing import persistable_location from .calorimeter_reconstruction import make_calo -from .gaudi_allen_tracking import make_hlt1_pvs +from .gaudi_allen_tracking import make_allen_pvs from .hlt2_tracking import ( convert_tracks_to_v3_from_v1, get_persistable_tracks_per_type, @@ -70,7 +70,7 @@ def make_reconstruction( skipCalo=False, skipMuon=False, fastReco=False, - useHLT1PVs=False, + useAllenPVs=False, ): """Return reconstruction objects of the legacy, fastest or the light reconstruction, with possibility to skip the UT""" rich_and_charged_proto_track_types = ( @@ -87,8 +87,8 @@ def make_reconstruction( tracks_v3, tracks_rels = convert_tracks_to_v3_from_v1(persisted_tracks) # PVs - if useHLT1PVs: - pvs = make_hlt1_pvs( + if useAllenPVs: + pvs = make_allen_pvs( hlt2_tracks=hlt2_tracks, location=persistable_location("PVs") ) else: diff --git a/Hlt/RecoConf/tests/qmtest/allen_gaudi_pv_with_mcchecking.qmt b/Hlt/RecoConf/tests/qmtest/allen_gaudi_pv_with_mcchecking.qmt index d446b1b54f5..da74955e65b 100644 --- a/Hlt/RecoConf/tests/qmtest/allen_gaudi_pv_with_mcchecking.qmt +++ b/Hlt/RecoConf/tests/qmtest/allen_gaudi_pv_with_mcchecking.qmt @@ -10,8 +10,7 @@ or submit itself to any jurisdiction. --> gaudirun.py diff --git a/Hlt/RecoConf/tests/qmtest/allen_gaudi_pv_with_mcchecking_SMOG.qmt b/Hlt/RecoConf/tests/qmtest/allen_gaudi_pv_with_mcchecking_SMOG.qmt index 862ab39c514..1af418a108f 100644 --- a/Hlt/RecoConf/tests/qmtest/allen_gaudi_pv_with_mcchecking_SMOG.qmt +++ b/Hlt/RecoConf/tests/qmtest/allen_gaudi_pv_with_mcchecking_SMOG.qmt @@ -10,8 +10,7 @@ or submit itself to any jurisdiction. --> gaudirun.py diff --git a/Hlt/RecoConf/tests/qmtest/allen_gaudi_pv_with_mcchecking_beamshift.qmt b/Hlt/RecoConf/tests/qmtest/allen_gaudi_pv_with_mcchecking_beamshift.qmt index e555e2a6c0f..d4b57899a42 100644 --- a/Hlt/RecoConf/tests/qmtest/allen_gaudi_pv_with_mcchecking_beamshift.qmt +++ b/Hlt/RecoConf/tests/qmtest/allen_gaudi_pv_with_mcchecking_beamshift.qmt @@ -10,8 +10,7 @@ or submit itself to any jurisdiction. --> gaudirun.py diff --git a/Hlt/RecoConf/tests/qmtest/allen_gaudi_pv_with_prvelotracks_with_mcchecking.qmt b/Hlt/RecoConf/tests/qmtest/allen_gaudi_pv_with_prvelotracks_with_mcchecking.qmt index 6b8b0b5e8d9..c661dd96234 100644 --- a/Hlt/RecoConf/tests/qmtest/allen_gaudi_pv_with_prvelotracks_with_mcchecking.qmt +++ b/Hlt/RecoConf/tests/qmtest/allen_gaudi_pv_with_prvelotracks_with_mcchecking.qmt @@ -10,8 +10,8 @@ or submit itself to any jurisdiction. --> gaudirun.py diff --git a/Hlt/RecoConf/tests/qmtest/allen_gaudi_pv_with_prvelotracks_with_mcchecking_beamshift.qmt b/Hlt/RecoConf/tests/qmtest/allen_gaudi_pv_with_prvelotracks_with_mcchecking_beamshift.qmt index 3ee319807ef..2058840fcd5 100644 --- a/Hlt/RecoConf/tests/qmtest/allen_gaudi_pv_with_prvelotracks_with_mcchecking_beamshift.qmt +++ b/Hlt/RecoConf/tests/qmtest/allen_gaudi_pv_with_prvelotracks_with_mcchecking_beamshift.qmt @@ -10,8 +10,8 @@ or submit itself to any jurisdiction. --> gaudirun.py diff --git a/Hlt/RecoConf/tests/qmtest/hlt1_convertedtracks_hlt2_pvs_vertex_compare.qmt b/Hlt/RecoConf/tests/qmtest/hlt1_convertedtracks_hlt2_pvs_vertex_compare.qmt index d970b2bb00e..c2aea44b218 100644 --- a/Hlt/RecoConf/tests/qmtest/hlt1_convertedtracks_hlt2_pvs_vertex_compare.qmt +++ b/Hlt/RecoConf/tests/qmtest/hlt1_convertedtracks_hlt2_pvs_vertex_compare.qmt @@ -10,7 +10,8 @@ or submit itself to any jurisdiction. --> gaudirun.py -- GitLab From 7008bb04277b5f04295cf8d56c85ae006a890bd8 Mon Sep 17 00:00:00 2001 From: Gitlab CI Date: Tue, 5 Aug 2025 07:55:08 +0000 Subject: [PATCH 14/19] pre-commit fixes patch generated by https://gitlab.cern.ch/lhcb/Moore/-/jobs/59789676 --- Hlt/Moore/python/Moore/config.py | 1 + Hlt/Moore/python/Moore/production.py | 5 ++++- Hlt/RecoConf/options/allen_gaudi_pv_with_prvelotracks.py | 2 +- .../options/hlt1_convertedtracks_hlt2_pvs_vertex_compare.py | 2 +- Hlt/RecoConf/tests/qmtest/allen_gaudi_pv_with_mcchecking.qmt | 2 +- 5 files changed, 8 insertions(+), 4 deletions(-) diff --git a/Hlt/Moore/python/Moore/config.py b/Hlt/Moore/python/Moore/config.py index a9e1cffa96c..c1a7be46b7e 100644 --- a/Hlt/Moore/python/Moore/config.py +++ b/Hlt/Moore/python/Moore/config.py @@ -284,6 +284,7 @@ def moore_control_flow( # to the control flow to ensure that the Hlt1 reconstruction can access the # necessary non-event data. from Allen.config import setup_allen_non_event_data_service + non_event_data_node = setup_allen_non_event_data_service() children += [non_event_data_node] children += [lines_node] + [rw_nodes] + stream_writers_nodes diff --git a/Hlt/Moore/python/Moore/production.py b/Hlt/Moore/python/Moore/production.py index bb724b2b191..66b2fe41c59 100644 --- a/Hlt/Moore/python/Moore/production.py +++ b/Hlt/Moore/python/Moore/production.py @@ -512,7 +512,10 @@ def _spruce( ] moore_control_node = moore_control_flow( - options, _my_line_maker(), process="spruce", use_allen_reconstruction=False + options, + _my_line_maker(), + process="spruce", + use_allen_reconstruction=False, ) ## Add this filter before `moore_control_node` using `LAZY_AND` logic IF flagging diff --git a/Hlt/RecoConf/options/allen_gaudi_pv_with_prvelotracks.py b/Hlt/RecoConf/options/allen_gaudi_pv_with_prvelotracks.py index f8e972452f6..b46f657db66 100644 --- a/Hlt/RecoConf/options/allen_gaudi_pv_with_prvelotracks.py +++ b/Hlt/RecoConf/options/allen_gaudi_pv_with_prvelotracks.py @@ -27,7 +27,7 @@ from RecoConf.options import options def make_reconstruction(): """ - PV checker for the Allen PV finding algorithm using converted Moore VELO tracks as input + PV checker for the Allen PV finding algorithm using converted Moore VELO tracks as input """ # get all velo tracks rec_tracks = all_velo_track_types() diff --git a/Hlt/RecoConf/options/hlt1_convertedtracks_hlt2_pvs_vertex_compare.py b/Hlt/RecoConf/options/hlt1_convertedtracks_hlt2_pvs_vertex_compare.py index a8acba66585..063a8e8a3f2 100644 --- a/Hlt/RecoConf/options/hlt1_convertedtracks_hlt2_pvs_vertex_compare.py +++ b/Hlt/RecoConf/options/hlt1_convertedtracks_hlt2_pvs_vertex_compare.py @@ -24,7 +24,7 @@ from RecoConf.options import options def run_VertexCompare(): """ - Compares between: + Compares between: - Allen PV finding algorithm using as input Moore VELO tracks converted vs the nominal Moore PV finding algorithm (with Moore VELO tracks) - Allen PV finding algorithm using as input Moore VELO tracks converted vs the nominal Allen PV finding algorithm (with Allen VELO tracks) """ diff --git a/Hlt/RecoConf/tests/qmtest/allen_gaudi_pv_with_mcchecking.qmt b/Hlt/RecoConf/tests/qmtest/allen_gaudi_pv_with_mcchecking.qmt index da74955e65b..4f3a7aecab3 100644 --- a/Hlt/RecoConf/tests/qmtest/allen_gaudi_pv_with_mcchecking.qmt +++ b/Hlt/RecoConf/tests/qmtest/allen_gaudi_pv_with_mcchecking.qmt @@ -10,7 +10,7 @@ or submit itself to any jurisdiction. --> gaudirun.py -- GitLab From b01b7b1d9909b19207425eac9fe42aad853eb2a4 Mon Sep 17 00:00:00 2001 From: Tommaso Fulghesu Date: Thu, 28 Aug 2025 15:04:47 +0200 Subject: [PATCH 15/19] Setting defaults to False --- Hlt/Moore/python/Moore/config.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Hlt/Moore/python/Moore/config.py b/Hlt/Moore/python/Moore/config.py index c1a7be46b7e..087b3731e27 100644 --- a/Hlt/Moore/python/Moore/config.py +++ b/Hlt/Moore/python/Moore/config.py @@ -57,7 +57,7 @@ log = logging.getLogger(__name__) def moore_control_flow( - options, streams, process, use_allen_reconstruction, analytics=False + options, streams, process, use_allen_reconstruction=False, analytics=False ): """Return the Moore application control flow node. @@ -70,7 +70,7 @@ def moore_control_flow( options (ApplicationOptions): holder of application options streams (list of stream objects): control flow nodes of lines process (str): "hlt1", "hlt2", "spruce" or "pass". - use_allen_reconstruction (bool): whether to use Hlt1 reconstruction + use_allen_reconstruction (bool): whether to use Hlt1 reconstruction. Defaults to False. analytics (bool, optional): For use only in rate/event size analysis. Defaults to False. Returns: -- GitLab From d6c2b9c2ac1fc7bb8c6e32ed3490d89c7e730aa7 Mon Sep 17 00:00:00 2001 From: Tommaso Fulghesu Date: Wed, 5 Nov 2025 16:39:21 +0100 Subject: [PATCH 16/19] Move import from top-level inside functions --- Hlt/RecoConf/options/allen_gaudi_pv_with_prvelotracks.py | 3 ++- .../options/hlt1_convertedtracks_hlt2_pvs_vertex_compare.py | 3 ++- Hlt/RecoConf/python/RecoConf/gaudi_allen_tracking.py | 6 ++---- Hlt/RecoConf/python/RecoConf/hlt2_global_reco.py | 3 ++- 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/Hlt/RecoConf/options/allen_gaudi_pv_with_prvelotracks.py b/Hlt/RecoConf/options/allen_gaudi_pv_with_prvelotracks.py index b46f657db66..1bc635227d1 100644 --- a/Hlt/RecoConf/options/allen_gaudi_pv_with_prvelotracks.py +++ b/Hlt/RecoConf/options/allen_gaudi_pv_with_prvelotracks.py @@ -9,7 +9,6 @@ # or submit itself to any jurisdiction. # ############################################################################### from Allen.config import run_allen_reconstruction -from AllenConf.primary_vertex_reconstruction import make_pvs from PyConf.Algorithms import ( GaudiAllenPVsToPrimaryVertexContainer, GaudiAllenVeloToV3Tracks, @@ -29,6 +28,8 @@ def make_reconstruction(): """ PV checker for the Allen PV finding algorithm using converted Moore VELO tracks as input """ + from AllenConf.primary_vertex_reconstruction import make_pvs + # get all velo tracks rec_tracks = all_velo_track_types() # convert PrVelo tracks to Gaudi Allen VELO tracks diff --git a/Hlt/RecoConf/options/hlt1_convertedtracks_hlt2_pvs_vertex_compare.py b/Hlt/RecoConf/options/hlt1_convertedtracks_hlt2_pvs_vertex_compare.py index 063a8e8a3f2..e844896bf16 100644 --- a/Hlt/RecoConf/options/hlt1_convertedtracks_hlt2_pvs_vertex_compare.py +++ b/Hlt/RecoConf/options/hlt1_convertedtracks_hlt2_pvs_vertex_compare.py @@ -9,7 +9,6 @@ # or submit itself to any jurisdiction. # ############################################################################### from Allen.config import run_allen_reconstruction -from AllenConf.primary_vertex_reconstruction import make_pvs from AllenConf.velo_reconstruction import decode_velo, make_velo_tracks from PyConf.Algorithms import GaudiAllenPVsToPrimaryVertexContainer, VertexCompare from PyConf.packing import persistable_location @@ -28,6 +27,8 @@ def run_VertexCompare(): - Allen PV finding algorithm using as input Moore VELO tracks converted vs the nominal Moore PV finding algorithm (with Moore VELO tracks) - Allen PV finding algorithm using as input Moore VELO tracks converted vs the nominal Allen PV finding algorithm (with Allen VELO tracks) """ + from AllenConf.primary_vertex_reconstruction import make_pvs + # reconstruct Moore VELO tracks hlt2_velo_tracks = all_velo_track_types() # Convert to Allen VELO tracks diff --git a/Hlt/RecoConf/python/RecoConf/gaudi_allen_tracking.py b/Hlt/RecoConf/python/RecoConf/gaudi_allen_tracking.py index b61c6653db1..1614678dd65 100644 --- a/Hlt/RecoConf/python/RecoConf/gaudi_allen_tracking.py +++ b/Hlt/RecoConf/python/RecoConf/gaudi_allen_tracking.py @@ -8,7 +8,6 @@ # granted to it by virtue of its status as an Intergovernmental Organization # # or submit itself to any jurisdiction. # ############################################################################### -from AllenConf.primary_vertex_reconstruction import make_pvs from PyConf import ConfigurationError, configurable from PyConf.Algorithms import ( GaudiAllenPVsToPrimaryVertexContainer, @@ -42,17 +41,16 @@ def allen_velo_tracks(input_tracks): @configurable -def make_allen_pvs(hlt2_tracks, location=None, make_pvs=make_pvs): +def make_allen_pvs(hlt2_tracks, location=None): """Makes PVs from velo tracks using HLT1 PV finding algorithm Args: hlt2_tracks (DataHandle): HLT2 tracks to be converted for PV finding location (str, optional): Location to store the output PVs. Defaults to None. - make_pvs (function, optional): Function to create PVs. Defaults to `make_pvs`. - Returns: DataHandle: Converted HLT1 reconstructed PVs """ + from AllenConf.primary_vertex_reconstruction import make_pvs velo_tracks = { "v1": hlt2_tracks["Velo"]["v1"], "Pr": hlt2_tracks["Velo"]["Pr"], diff --git a/Hlt/RecoConf/python/RecoConf/hlt2_global_reco.py b/Hlt/RecoConf/python/RecoConf/hlt2_global_reco.py index 6938b179386..5dad9ebb1e3 100644 --- a/Hlt/RecoConf/python/RecoConf/hlt2_global_reco.py +++ b/Hlt/RecoConf/python/RecoConf/hlt2_global_reco.py @@ -31,7 +31,6 @@ from PyConf.Algorithms import ( from PyConf.packing import persistable_location from .calorimeter_reconstruction import make_calo -from .gaudi_allen_tracking import make_allen_pvs from .hlt2_tracking import ( convert_tracks_to_v3_from_v1, get_persistable_tracks_per_type, @@ -88,6 +87,8 @@ def make_reconstruction( # PVs if useAllenPVs: + from .gaudi_allen_tracking import make_allen_pvs + pvs = make_allen_pvs( hlt2_tracks=hlt2_tracks, location=persistable_location("PVs") ) -- GitLab From fe1738a197f94dd9edc926efb35d980765498f90 Mon Sep 17 00:00:00 2001 From: Gitlab CI Date: Wed, 5 Nov 2025 15:40:27 +0000 Subject: [PATCH 17/19] pre-commit fixes patch generated by https://gitlab.cern.ch/lhcb/Moore/-/jobs/64128269 --- Hlt/RecoConf/python/RecoConf/gaudi_allen_tracking.py | 1 + 1 file changed, 1 insertion(+) diff --git a/Hlt/RecoConf/python/RecoConf/gaudi_allen_tracking.py b/Hlt/RecoConf/python/RecoConf/gaudi_allen_tracking.py index 1614678dd65..e8aea509209 100644 --- a/Hlt/RecoConf/python/RecoConf/gaudi_allen_tracking.py +++ b/Hlt/RecoConf/python/RecoConf/gaudi_allen_tracking.py @@ -51,6 +51,7 @@ def make_allen_pvs(hlt2_tracks, location=None): DataHandle: Converted HLT1 reconstructed PVs """ from AllenConf.primary_vertex_reconstruction import make_pvs + velo_tracks = { "v1": hlt2_tracks["Velo"]["v1"], "Pr": hlt2_tracks["Velo"]["Pr"], -- GitLab From 02842a79a92af02c9f03d7ae3d0ce4625db28c65 Mon Sep 17 00:00:00 2001 From: Tommaso Fulghesu Date: Fri, 12 Dec 2025 16:01:23 +0100 Subject: [PATCH 18/19] Update plotting scripts to correct handle input argument --- .../scripts/PrimaryVertexCheckerBasic.py | 13 ++++++----- .../scripts/PrimaryVertexCheckerEfficiency.py | 7 ++++-- .../scripts/PrimaryVertexCheckerPull.py | 22 ++++++++++++++----- .../scripts/PrimaryVertexCheckerResolution.py | 22 ++++++++++++++----- Hlt/RecoConf/scripts/utils/pvutils.py | 17 ++++++++++---- 5 files changed, 60 insertions(+), 21 deletions(-) diff --git a/Hlt/RecoConf/scripts/PrimaryVertexCheckerBasic.py b/Hlt/RecoConf/scripts/PrimaryVertexCheckerBasic.py index b165e0bef10..206c06261c2 100644 --- a/Hlt/RecoConf/scripts/PrimaryVertexCheckerBasic.py +++ b/Hlt/RecoConf/scripts/PrimaryVertexCheckerBasic.py @@ -80,7 +80,7 @@ parser.add_argument( "--dir", dest="directory", default=os.getcwd(), - help="tree name to plot", + help="directory to save plots", ) parser.add_argument( @@ -100,7 +100,7 @@ def get_labels(number_of_files): if __name__ == "__main__": args = parser.parse_args() - path = args.directory + "/utils/" + path = os.getcwd() + "/utils/" sys.path.append(os.path.abspath(path)) offset = int(args.offset) gROOT.SetBatch() @@ -227,6 +227,7 @@ if __name__ == "__main__": offset, True, legend, + dir=args.directory, ) plot_comparison( hist_visMCPVs, @@ -239,16 +240,17 @@ if __name__ == "__main__": offset, True, legend, + dir=args.directory, ) plot_comparison( - hist_zMC, args.prefix, "zMC", cat, label, style, norm, offset, True, legend + hist_zMC, args.prefix, "zMC", cat, label, style, norm, offset, True, legend, dir=args.directory ) plot_comparison( - hist_xMC, args.prefix, "xMC", cat, label, style, norm, offset, True, legend + hist_xMC, args.prefix, "xMC", cat, label, style, norm, offset, True, legend, dir=args.directory ) plot_comparison( - hist_yMC, args.prefix, "yMC", cat, label, style, norm, offset, True, legend + hist_yMC, args.prefix, "yMC", cat, label, style, norm, offset, True, legend, dir=args.directory ) plot_comparison( @@ -262,4 +264,5 @@ if __name__ == "__main__": offset, True, legend, + dir=args.directory, ) diff --git a/Hlt/RecoConf/scripts/PrimaryVertexCheckerEfficiency.py b/Hlt/RecoConf/scripts/PrimaryVertexCheckerEfficiency.py index 39f27e385c6..af366ae9bcb 100644 --- a/Hlt/RecoConf/scripts/PrimaryVertexCheckerEfficiency.py +++ b/Hlt/RecoConf/scripts/PrimaryVertexCheckerEfficiency.py @@ -80,7 +80,7 @@ parser.add_argument( "--dir", dest="directory", default=os.getcwd(), - help="tree name to plot", + help="directory to save plots", ) parser.add_argument( @@ -100,7 +100,7 @@ def get_labels(number_of_files): if __name__ == "__main__": args = parser.parse_args() - path = args.directory + "/utils/" + path = os.getcwd() + "/utils/" sys.path.append(os.path.abspath(path)) offset = int(args.offset) @@ -156,6 +156,7 @@ if __name__ == "__main__": "ntracks", cat, label, + args.directory, legend, hist["tracks"], args.dist, @@ -168,6 +169,7 @@ if __name__ == "__main__": "z", cat, label, + args.directory, legend, hist["z"], args.dist, @@ -180,6 +182,7 @@ if __name__ == "__main__": "r", cat, label, + args.directory, legend, hist["r"], args.dist, diff --git a/Hlt/RecoConf/scripts/PrimaryVertexCheckerPull.py b/Hlt/RecoConf/scripts/PrimaryVertexCheckerPull.py index 4fd4cb19b07..f9397fba2dd 100644 --- a/Hlt/RecoConf/scripts/PrimaryVertexCheckerPull.py +++ b/Hlt/RecoConf/scripts/PrimaryVertexCheckerPull.py @@ -80,7 +80,7 @@ parser.add_argument( "--dir", dest="directory", default=os.getcwd(), - help="tree name to plot", + help="directory to save plots", ) parser.add_argument( @@ -100,7 +100,7 @@ def get_labels(number_of_files): if __name__ == "__main__": args = parser.parse_args() - path = args.directory + "/utils/" + path = os.getcwd() + "/utils/" sys.path.append(os.path.abspath(path)) offset = int(args.offset) gROOT.SetBatch() @@ -169,9 +169,9 @@ if __name__ == "__main__": offset, ) - plot_comparison(hist_x, args.prefix, "pullx", cat, label, style, norm, offset) - plot_comparison(hist_y, args.prefix, "pully", cat, label, style, norm, offset) - plot_comparison(hist_z, args.prefix, "pullz", cat, label, style, norm, offset) + plot_comparison(hist_x, args.prefix, "pullx", cat, label, style, norm, offset, dir=args.directory) + plot_comparison(hist_y, args.prefix, "pully", cat, label, style, norm, offset, dir=args.directory) + plot_comparison(hist_z, args.prefix, "pullz", cat, label, style, norm, offset, dir=args.directory) from ROOT import gEnv @@ -228,6 +228,7 @@ if __name__ == "__main__": "pullx", cat, label, + args.directory, legend, lhcbtextpos=lhcbtextpos, ) @@ -238,6 +239,7 @@ if __name__ == "__main__": "pullx", cat, label, + args.directory, legend, lhcbtextpos=lhcbtextposdown, ) @@ -249,6 +251,7 @@ if __name__ == "__main__": "pully", cat, label, + args.directory, legend, lhcbtextpos=lhcbtextpos, ) @@ -259,6 +262,7 @@ if __name__ == "__main__": "pully", cat, label, + args.directory, legend, lhcbtextpos=lhcbtextposdown, ) @@ -270,6 +274,7 @@ if __name__ == "__main__": "pullz", cat, label, + args.directory, legend, lhcbtextpos=lhcbtextpos, ) @@ -280,6 +285,7 @@ if __name__ == "__main__": "pullz", cat, label, + args.directory, legend, lhcbtextpos=lhcbtextposdown, ) @@ -305,6 +311,7 @@ if __name__ == "__main__": "pullx", cat, label, + args.directory, legend, lhcbtextpos=lhcbtextpos, ) @@ -315,6 +322,7 @@ if __name__ == "__main__": "pullx", cat, label, + args.directory, legend, lhcbtextpos=lhcbtextposdown, ) @@ -326,6 +334,7 @@ if __name__ == "__main__": "pully", cat, label, + args.directory, legend, lhcbtextpos=lhcbtextpos, ) @@ -336,6 +345,7 @@ if __name__ == "__main__": "pully", cat, label, + args.directory, legend, lhcbtextpos=lhcbtextposdown, ) @@ -347,6 +357,7 @@ if __name__ == "__main__": "pullz", cat, label, + args.directory, legend, lhcbtextpos=lhcbtextpos, ) @@ -357,6 +368,7 @@ if __name__ == "__main__": "pullz", cat, label, + args.directory, legend, lhcbtextpos=lhcbtextposdown, ) diff --git a/Hlt/RecoConf/scripts/PrimaryVertexCheckerResolution.py b/Hlt/RecoConf/scripts/PrimaryVertexCheckerResolution.py index a13f75921a7..e93bc3615dc 100644 --- a/Hlt/RecoConf/scripts/PrimaryVertexCheckerResolution.py +++ b/Hlt/RecoConf/scripts/PrimaryVertexCheckerResolution.py @@ -80,7 +80,7 @@ parser.add_argument( "--dir", dest="directory", default=os.getcwd(), - help="tree name to plot", + help="directory to save plots", ) parser.add_argument( @@ -100,7 +100,7 @@ def get_labels(number_of_files): if __name__ == "__main__": args = parser.parse_args() - path = args.directory + "/utils/" + path = os.getcwd() + "/utils/" sys.path.append(os.path.abspath(path)) offset = int(args.offset) @@ -171,9 +171,9 @@ if __name__ == "__main__": offset, ) - plot_comparison(hist_x, args.prefix, "dx", cat, label, style, norm, offset) - plot_comparison(hist_y, args.prefix, "dy", cat, label, style, norm, offset) - plot_comparison(hist_z, args.prefix, "dz", cat, label, style, norm, offset) + plot_comparison(hist_x, args.prefix, "dx", cat, label, style, norm, offset, dir=args.directory) + plot_comparison(hist_y, args.prefix, "dy", cat, label, style, norm, offset, dir=args.directory) + plot_comparison(hist_z, args.prefix, "dz", cat, label, style, norm, offset, dir=args.directory) from ROOT import gEnv @@ -205,6 +205,7 @@ if __name__ == "__main__": "dx", cat, label, + args.directory, legend, lhcbtextpos=lhcbtextpos, ) @@ -215,6 +216,7 @@ if __name__ == "__main__": "dx", cat, label, + args.directory, legend, lhcbtextpos=lhcbtextpos, ) @@ -226,6 +228,7 @@ if __name__ == "__main__": "dy", cat, label, + args.directory, legend, lhcbtextpos=lhcbtextpos, ) @@ -236,6 +239,7 @@ if __name__ == "__main__": "dy", cat, label, + args.directory, legend, lhcbtextpos=lhcbtextpos, ) @@ -247,6 +251,7 @@ if __name__ == "__main__": "dz", cat, label, + args.directory, legend, lhcbtextpos=lhcbtextpos, ) @@ -257,6 +262,7 @@ if __name__ == "__main__": "dz", cat, label, + args.directory, legend, lhcbtextpos=lhcbtextpos, ) @@ -282,6 +288,7 @@ if __name__ == "__main__": "dx", cat, label, + args.directory, legend, lhcbtextpos=lhcbtextpos, ) @@ -292,6 +299,7 @@ if __name__ == "__main__": "dx", cat, label, + args.directory, legend, lhcbtextpos=lhcbtextpos, ) @@ -303,6 +311,7 @@ if __name__ == "__main__": "dy", cat, label, + args.directory, legend, lhcbtextpos=lhcbtextpos, ) @@ -313,6 +322,7 @@ if __name__ == "__main__": "dy", cat, label, + args.directory, legend, lhcbtextpos=lhcbtextpos, ) @@ -324,6 +334,7 @@ if __name__ == "__main__": "dz", cat, label, + args.directory, legend, lhcbtextpos=lhcbtextpos, ) @@ -334,6 +345,7 @@ if __name__ == "__main__": "dz", cat, label, + args.directory, legend, lhcbtextpos=lhcbtextpos, ) diff --git a/Hlt/RecoConf/scripts/utils/pvutils.py b/Hlt/RecoConf/scripts/utils/pvutils.py index a644b226d3f..7b25a641862 100644 --- a/Hlt/RecoConf/scripts/utils/pvutils.py +++ b/Hlt/RecoConf/scripts/utils/pvutils.py @@ -16,6 +16,7 @@ # from array import array +import os from pvconfig import ( basic_cut, @@ -168,6 +169,7 @@ def plot( dependence, categories, label, + dir, legend=None, hist=None, dist=False, @@ -228,8 +230,11 @@ def plot( lhcbtext.DrawTextNDC(lhcbtextpos[0], lhcbtextpos[1], "LHCb simulation") - saveName = "{prefix}_{dependence}_{cat}.pdf".format( - prefix=prefix, dependence=dependence, cat=cat + # ensure that dir exists + if not os.path.exists(dir): + os.makedirs(dir) + saveName = "{dir}/{prefix}_{dependence}_{cat}.pdf".format( + dir=dir, prefix=prefix, dependence=dependence, cat=cat ) can.SaveAs(saveName) @@ -331,6 +336,7 @@ def plot_comparison( style, norm, offset, + dir, simple=False, legend=None, ): @@ -400,8 +406,11 @@ def plot_comparison( pavetext.Draw() can.Update() - saveName = "{prefix}_{dependence}_{cat}.pdf".format( - prefix=prefix, dependence=dependence, cat=cat + # ensure that dir exists + if not os.path.exists(dir): + os.makedirs(dir) + saveName = "{dir}/{prefix}_{dependence}_{cat}.pdf".format( + dir=dir, prefix=prefix, dependence=dependence, cat=cat ) can.SaveAs(saveName) -- GitLab From 3faae2ce6ab7dbe9d36cfd46000ab7391cd63ef5 Mon Sep 17 00:00:00 2001 From: Gitlab CI Date: Fri, 12 Dec 2025 15:02:28 +0000 Subject: [PATCH 19/19] pre-commit fixes patch generated by https://gitlab.cern.ch/lhcb/Moore/-/jobs/66503253 --- .../scripts/PrimaryVertexCheckerBasic.py | 36 +++++++++++++++++-- .../scripts/PrimaryVertexCheckerPull.py | 36 +++++++++++++++++-- .../scripts/PrimaryVertexCheckerResolution.py | 12 +++++-- Hlt/RecoConf/scripts/utils/pvutils.py | 2 +- 4 files changed, 76 insertions(+), 10 deletions(-) diff --git a/Hlt/RecoConf/scripts/PrimaryVertexCheckerBasic.py b/Hlt/RecoConf/scripts/PrimaryVertexCheckerBasic.py index 206c06261c2..c7f024f9ab7 100644 --- a/Hlt/RecoConf/scripts/PrimaryVertexCheckerBasic.py +++ b/Hlt/RecoConf/scripts/PrimaryVertexCheckerBasic.py @@ -244,13 +244,43 @@ if __name__ == "__main__": ) plot_comparison( - hist_zMC, args.prefix, "zMC", cat, label, style, norm, offset, True, legend, dir=args.directory + hist_zMC, + args.prefix, + "zMC", + cat, + label, + style, + norm, + offset, + True, + legend, + dir=args.directory, ) plot_comparison( - hist_xMC, args.prefix, "xMC", cat, label, style, norm, offset, True, legend, dir=args.directory + hist_xMC, + args.prefix, + "xMC", + cat, + label, + style, + norm, + offset, + True, + legend, + dir=args.directory, ) plot_comparison( - hist_yMC, args.prefix, "yMC", cat, label, style, norm, offset, True, legend, dir=args.directory + hist_yMC, + args.prefix, + "yMC", + cat, + label, + style, + norm, + offset, + True, + legend, + dir=args.directory, ) plot_comparison( diff --git a/Hlt/RecoConf/scripts/PrimaryVertexCheckerPull.py b/Hlt/RecoConf/scripts/PrimaryVertexCheckerPull.py index f9397fba2dd..f07fa6b1b01 100644 --- a/Hlt/RecoConf/scripts/PrimaryVertexCheckerPull.py +++ b/Hlt/RecoConf/scripts/PrimaryVertexCheckerPull.py @@ -169,9 +169,39 @@ if __name__ == "__main__": offset, ) - plot_comparison(hist_x, args.prefix, "pullx", cat, label, style, norm, offset, dir=args.directory) - plot_comparison(hist_y, args.prefix, "pully", cat, label, style, norm, offset, dir=args.directory) - plot_comparison(hist_z, args.prefix, "pullz", cat, label, style, norm, offset, dir=args.directory) + plot_comparison( + hist_x, + args.prefix, + "pullx", + cat, + label, + style, + norm, + offset, + dir=args.directory, + ) + plot_comparison( + hist_y, + args.prefix, + "pully", + cat, + label, + style, + norm, + offset, + dir=args.directory, + ) + plot_comparison( + hist_z, + args.prefix, + "pullz", + cat, + label, + style, + norm, + offset, + dir=args.directory, + ) from ROOT import gEnv diff --git a/Hlt/RecoConf/scripts/PrimaryVertexCheckerResolution.py b/Hlt/RecoConf/scripts/PrimaryVertexCheckerResolution.py index e93bc3615dc..b67248b0463 100644 --- a/Hlt/RecoConf/scripts/PrimaryVertexCheckerResolution.py +++ b/Hlt/RecoConf/scripts/PrimaryVertexCheckerResolution.py @@ -171,9 +171,15 @@ if __name__ == "__main__": offset, ) - plot_comparison(hist_x, args.prefix, "dx", cat, label, style, norm, offset, dir=args.directory) - plot_comparison(hist_y, args.prefix, "dy", cat, label, style, norm, offset, dir=args.directory) - plot_comparison(hist_z, args.prefix, "dz", cat, label, style, norm, offset, dir=args.directory) + plot_comparison( + hist_x, args.prefix, "dx", cat, label, style, norm, offset, dir=args.directory + ) + plot_comparison( + hist_y, args.prefix, "dy", cat, label, style, norm, offset, dir=args.directory + ) + plot_comparison( + hist_z, args.prefix, "dz", cat, label, style, norm, offset, dir=args.directory + ) from ROOT import gEnv diff --git a/Hlt/RecoConf/scripts/utils/pvutils.py b/Hlt/RecoConf/scripts/utils/pvutils.py index 7b25a641862..1bcce8c09e2 100644 --- a/Hlt/RecoConf/scripts/utils/pvutils.py +++ b/Hlt/RecoConf/scripts/utils/pvutils.py @@ -15,8 +15,8 @@ # date: 02/2020 # -from array import array import os +from array import array from pvconfig import ( basic_cut, -- GitLab