From 4071746f554ef83933e48712f5ec8ef7072c242b Mon Sep 17 00:00:00 2001 From: Zhijie Wang Date: Thu, 20 Feb 2025 14:50:08 +0100 Subject: [PATCH 1/2] update --- Hlt/RecoConf/options/UT_hit_efficiency.py | 78 +++++++++++++++++++ .../performance.qms/UT_hit_efficiency.qmt | 32 ++++++++ Hlt/RecoConf/tests/refs/UT_hit_efficiency.ref | 0 3 files changed, 110 insertions(+) create mode 100644 Hlt/RecoConf/options/UT_hit_efficiency.py create mode 100644 Hlt/RecoConf/tests/qmtest/performance.qms/UT_hit_efficiency.qmt create mode 100644 Hlt/RecoConf/tests/refs/UT_hit_efficiency.ref diff --git a/Hlt/RecoConf/options/UT_hit_efficiency.py b/Hlt/RecoConf/options/UT_hit_efficiency.py new file mode 100644 index 00000000000..ca7f6532a3f --- /dev/null +++ b/Hlt/RecoConf/options/UT_hit_efficiency.py @@ -0,0 +1,78 @@ +############################################################################### +# (c) Copyright 2022 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.Algorithms import ( + PrKalmanFilter, + PrKalmanFilter_Downstream, + PrKalmanFilter_Seed, + PrKalmanFilter_Upstream, + PrKalmanFilter_Velo, + UTHitEfficiencyMonitor, +) +from PyConf.application import make_odin +from RecoConf.config import Reconstruction, run_reconstruction +from RecoConf.hlt2_tracking import make_hlt2_tracks +from RecoConf.legacy_rec_hlt1_tracking import ( + get_default_ut_clusters, + make_PrStorePrUTHits_hits, +) +from RecoConf.options import options + +# save output file with histograms +options.histo_file = options.getProp("histo_file") or "hlt2_UT_hit_efficiency.root" + + +def hit_efficiency_sequence(): + odin = make_odin() + data = [odin] + + for layer_under_study in range(4): # histograms for the first station + biased = True + + if biased: + with ( + PrKalmanFilter.bind(FillFitResult=True), + PrKalmanFilter_Downstream.bind(FillFitResult=True), + PrKalmanFilter_Upstream.bind(FillFitResult=True), + PrKalmanFilter_Velo.bind(FillFitResult=True), + PrKalmanFilter_Seed.bind(FillFitResult=True), + get_default_ut_clusters.bind(), + ): + hlt2_tracks = make_hlt2_tracks( + light_reco=True, fast_reco=False, use_pr_kf=True + ) + else: + with ( + PrKalmanFilter.bind(FillFitResult=True), + PrKalmanFilter_Downstream.bind(FillFitResult=True), + PrKalmanFilter_Upstream.bind(FillFitResult=True), + PrKalmanFilter_Velo.bind(FillFitResult=True), + PrKalmanFilter_Seed.bind(FillFitResult=True), + get_default_ut_clusters.bind(UseUTBanks=False, UseUTErrorBanks=False), + ): + hlt2_tracks = make_hlt2_tracks( + light_reco=True, fast_reco=False, use_pr_kf=True + ) + + all_UT_pr_hits = make_PrStorePrUTHits_hits() + + my_ft_efficiency_alg = UTHitEfficiencyMonitor( + name="UTHitEfficiencyLayer{}".format(layer_under_study), + TrackLocation=hlt2_tracks["BestLong"]["v1"], + PrUTHitsLocation=all_UT_pr_hits, + LayerUnderStudy=layer_under_study, + ) + + data += [my_ft_efficiency_alg] + + return Reconstruction("hlt2_hit_eff_reco", data, []) + + +run_reconstruction(options, hit_efficiency_sequence) diff --git a/Hlt/RecoConf/tests/qmtest/performance.qms/UT_hit_efficiency.qmt b/Hlt/RecoConf/tests/qmtest/performance.qms/UT_hit_efficiency.qmt new file mode 100644 index 00000000000..634f57c4f6c --- /dev/null +++ b/Hlt/RecoConf/tests/qmtest/performance.qms/UT_hit_efficiency.qmt @@ -0,0 +1,32 @@ + + + +gaudirun.py +true +1200 + +$MOOREROOT/tests/options/default_input_and_conds_hlt2.py +$RECOCONFROOT/options/UT_hit_efficiency.py + +../refs/UT_hit_efficiency.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)) + + + diff --git a/Hlt/RecoConf/tests/refs/UT_hit_efficiency.ref b/Hlt/RecoConf/tests/refs/UT_hit_efficiency.ref new file mode 100644 index 00000000000..e69de29bb2d -- GitLab From b7b7a05211c763fc52ba99caa1ed5771fbf49b93 Mon Sep 17 00:00:00 2001 From: Miroslav Saur Date: Tue, 25 Mar 2025 04:28:30 +0000 Subject: [PATCH 2/2] Apply 2 suggestion(s) to 2 file(s) --- Hlt/RecoConf/options/UT_hit_efficiency.py | 2 +- Hlt/RecoConf/tests/qmtest/performance.qms/UT_hit_efficiency.qmt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Hlt/RecoConf/options/UT_hit_efficiency.py b/Hlt/RecoConf/options/UT_hit_efficiency.py index ca7f6532a3f..886159829f6 100644 --- a/Hlt/RecoConf/options/UT_hit_efficiency.py +++ b/Hlt/RecoConf/options/UT_hit_efficiency.py @@ -1,5 +1,5 @@ ############################################################################### -# (c) Copyright 2022 CERN for the benefit of the LHCb Collaboration # +# (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". # diff --git a/Hlt/RecoConf/tests/qmtest/performance.qms/UT_hit_efficiency.qmt b/Hlt/RecoConf/tests/qmtest/performance.qms/UT_hit_efficiency.qmt index 634f57c4f6c..1c1113af814 100644 --- a/Hlt/RecoConf/tests/qmtest/performance.qms/UT_hit_efficiency.qmt +++ b/Hlt/RecoConf/tests/qmtest/performance.qms/UT_hit_efficiency.qmt @@ -1,6 +1,6 @@