From c4f02f058e2cf0f08cd3a7e1aa1166a96298e6ef Mon Sep 17 00:00:00 2001 From: Patrick Spradlin Date: Wed, 3 Sep 2025 14:18:10 +0100 Subject: [PATCH 1/7] Updated test script for BeamSpotMonitor to exercise more of its functionality. --- .../hlt1_pvs_with_beamspotmoni_2023.py | 65 +++++++++++++++++-- 1 file changed, 60 insertions(+), 5 deletions(-) diff --git a/Hlt/RecoConf/options/hlt1_pvs_with_beamspotmoni_2023.py b/Hlt/RecoConf/options/hlt1_pvs_with_beamspotmoni_2023.py index 8ee14270e94..741b762f924 100644 --- a/Hlt/RecoConf/options/hlt1_pvs_with_beamspotmoni_2023.py +++ b/Hlt/RecoConf/options/hlt1_pvs_with_beamspotmoni_2023.py @@ -11,6 +11,7 @@ from GaudiKernel.SystemOfUnits import mm, mm2 from PyConf.Algorithms import BeamSpotMonitor from PyConf.application import make_odin +from PyConf.control_flow import CompositeNode, NodeLogic from RecoConf.config import Reconstruction, run_reconstruction from RecoConf.decoders import default_VeloCluster_source from RecoConf.legacy_rec_hlt1_tracking import ( @@ -45,24 +46,79 @@ def run_hlt1_pvs_with_beamspotmoni(): ).OutputLocation } - beam_spot_moni = BeamSpotMonitor( - name="BeamSpotMonitor", + # Test various modes and configurations for BeamSpotMonitor. + # 1. FromDBFile mode, update triggered by small changes in x + beam_spot_moni_dbfile = BeamSpotMonitor( + name="BeamSpotMonitor_FromDBFile", ODINLocation=make_odin(), PVContainer=selected_pvs["v1"], + IRCondInitStrategy="FromDBFile", + MinPVsForCalib=200, + LogConditions=True, + MakeDBRunFile=True, + conditionsDbPath=".", + MaxAbsDeltaMap={ + "x": 0.001 * mm, + }, + ) + + # 2. Autonomous mode, updates triggered by a change in any quantity + beam_spot_moni_auto = BeamSpotMonitor( + name="BeamSpotMonitor_Autonomous", + ODINLocation=make_odin(), + PVContainer=selected_pvs["v1"], + IRCondInitStrategy="Autonomous", MinPVsForCalib=200, LogConditions=True, MakeDBRunFile=True, conditionsDbPath=".", - VeloOpenUpdates=True, MaxAbsDeltaMap={ "x": 0.0 * mm, "y": 0.0 * mm, + "z": 0.0 * mm, "xx": 0.0 * mm2, "xy": 0.0 * mm2, + "yx": 0.0 * mm2, "yy": 0.0 * mm2, + "zx": 0.0 * mm2, + "xz": 0.0 * mm2, + "yz": 0.0 * mm2, + "zy": 0.0 * mm2, + "zz": 0.0 * mm2, + "rho": 0.0 * mm, + "rho_at_z1": 0.0 * mm, + "rho_at_z2": 0.0 * mm, }, ) - data = [pvs["v1"], selected_pvs["v1"], beam_spot_moni] + + # 3. FromCond mode, updates triggered by difference in x but suppressed + # if difference is 'inconceivably large' + beam_spot_moni_cond = BeamSpotMonitor( + name="BeamSpotMonitor_FromCond", + ODINLocation=make_odin(), + PVContainer=selected_pvs["v1"], + IRCondInitStrategy="FromCond", + MinPVsForCalib=200, + LogConditions=True, + MakeDBRunFile=True, + conditionsDbPath=".", + MaxAbsDeltaMap={ + "x": 0.0 * mm, + }, + InconceivableHandling="WarnSkip", + InconceivableAbsDeltaMap={ + "x": 0.032 * mm, + }, + ) + + bsm_modes = CompositeNode( + "bsm_modes", + [beam_spot_moni_dbfile, beam_spot_moni_auto, beam_spot_moni_cond], + combine_logic=NodeLogic.NONLAZY_AND, + force_order=True, + ) + + data = [pvs["v1"], selected_pvs["v1"], bsm_modes] return Reconstruction("pvs_reco", data, reco_prefilters(skipUT=True)) @@ -70,7 +126,6 @@ def run_hlt1_pvs_with_beamspotmoni(): options.histo_file = "hlt1_pvs_with_beamspotmoni_2023.root" with ( - default_VeloCluster_source.bind(bank_type="VPRetinaCluster"), make_VeloClusterTrackingSIMD.bind(SkipForward=4), make_PatPV3DFuture_pvs.bind( velo_open=True, use_3D_seeding=True, use_beam_spot_cut=False -- GitLab From fb24ee7546798c10f0208fef8bee0391833b826d Mon Sep 17 00:00:00 2001 From: Patrick Spradlin Date: Wed, 3 Sep 2025 14:24:18 +0100 Subject: [PATCH 2/7] Renamed components of BeamSpotMonitor test 2023 -> 2024 --- ...th_beamspotmoni_2023.py => hlt1_pvs_with_beamspotmoni_2024.py} | 0 ..._beamspotmoni_2023.qmt => hlt1_pvs_with_beamspotmoni_2024.qmt} | 0 ..._beamspotmoni_2023.ref => hlt1_pvs_with_beamspotmoni_2024.ref} | 0 ...ef.armv8.1_a => hlt1_pvs_with_beamspotmoni_2024.ref.armv8.1_a} | 0 4 files changed, 0 insertions(+), 0 deletions(-) rename Hlt/RecoConf/options/{hlt1_pvs_with_beamspotmoni_2023.py => hlt1_pvs_with_beamspotmoni_2024.py} (100%) rename Hlt/RecoConf/tests/qmtest/{hlt1_pvs_with_beamspotmoni_2023.qmt => hlt1_pvs_with_beamspotmoni_2024.qmt} (100%) rename Hlt/RecoConf/tests/refs/{hlt1_pvs_with_beamspotmoni_2023.ref => hlt1_pvs_with_beamspotmoni_2024.ref} (100%) rename Hlt/RecoConf/tests/refs/{hlt1_pvs_with_beamspotmoni_2023.ref.armv8.1_a => hlt1_pvs_with_beamspotmoni_2024.ref.armv8.1_a} (100%) diff --git a/Hlt/RecoConf/options/hlt1_pvs_with_beamspotmoni_2023.py b/Hlt/RecoConf/options/hlt1_pvs_with_beamspotmoni_2024.py similarity index 100% rename from Hlt/RecoConf/options/hlt1_pvs_with_beamspotmoni_2023.py rename to Hlt/RecoConf/options/hlt1_pvs_with_beamspotmoni_2024.py diff --git a/Hlt/RecoConf/tests/qmtest/hlt1_pvs_with_beamspotmoni_2023.qmt b/Hlt/RecoConf/tests/qmtest/hlt1_pvs_with_beamspotmoni_2024.qmt similarity index 100% rename from Hlt/RecoConf/tests/qmtest/hlt1_pvs_with_beamspotmoni_2023.qmt rename to Hlt/RecoConf/tests/qmtest/hlt1_pvs_with_beamspotmoni_2024.qmt diff --git a/Hlt/RecoConf/tests/refs/hlt1_pvs_with_beamspotmoni_2023.ref b/Hlt/RecoConf/tests/refs/hlt1_pvs_with_beamspotmoni_2024.ref similarity index 100% rename from Hlt/RecoConf/tests/refs/hlt1_pvs_with_beamspotmoni_2023.ref rename to Hlt/RecoConf/tests/refs/hlt1_pvs_with_beamspotmoni_2024.ref diff --git a/Hlt/RecoConf/tests/refs/hlt1_pvs_with_beamspotmoni_2023.ref.armv8.1_a b/Hlt/RecoConf/tests/refs/hlt1_pvs_with_beamspotmoni_2024.ref.armv8.1_a similarity index 100% rename from Hlt/RecoConf/tests/refs/hlt1_pvs_with_beamspotmoni_2023.ref.armv8.1_a rename to Hlt/RecoConf/tests/refs/hlt1_pvs_with_beamspotmoni_2024.ref.armv8.1_a -- GitLab From 1d83b2ec933ba674c5fbba6e52ef3426879be573 Mon Sep 17 00:00:00 2001 From: Patrick Spradlin Date: Wed, 3 Sep 2025 14:58:47 +0100 Subject: [PATCH 3/7] Update contents of BeamSpotMonitor test files to use 2024 input data and to validate new features --- .../options/hlt1_pvs_with_beamspotmoni_2024.py | 2 +- .../qmtest/hlt1_pvs_with_beamspotmoni_2024.qmt | 13 ++++++++----- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/Hlt/RecoConf/options/hlt1_pvs_with_beamspotmoni_2024.py b/Hlt/RecoConf/options/hlt1_pvs_with_beamspotmoni_2024.py index 741b762f924..24fec28c6e5 100644 --- a/Hlt/RecoConf/options/hlt1_pvs_with_beamspotmoni_2024.py +++ b/Hlt/RecoConf/options/hlt1_pvs_with_beamspotmoni_2024.py @@ -123,7 +123,7 @@ def run_hlt1_pvs_with_beamspotmoni(): return Reconstruction("pvs_reco", data, reco_prefilters(skipUT=True)) -options.histo_file = "hlt1_pvs_with_beamspotmoni_2023.root" +options.histo_file = "hlt1_pvs_with_beamspotmoni_2024.root" with ( make_VeloClusterTrackingSIMD.bind(SkipForward=4), diff --git a/Hlt/RecoConf/tests/qmtest/hlt1_pvs_with_beamspotmoni_2024.qmt b/Hlt/RecoConf/tests/qmtest/hlt1_pvs_with_beamspotmoni_2024.qmt index 5f020bf5760..2cf473aa2e7 100644 --- a/Hlt/RecoConf/tests/qmtest/hlt1_pvs_with_beamspotmoni_2024.qmt +++ b/Hlt/RecoConf/tests/qmtest/hlt1_pvs_with_beamspotmoni_2024.qmt @@ -12,11 +12,11 @@ gaudirun.py - $MOOREROOT/tests/options/mdf_input_and_conds_data_2023.py - $RECOCONFROOT/options/hlt1_pvs_with_beamspotmoni_2023.py + $MOOREROOT/tests/options/mdf_input_and_conds_data_2024.py + $RECOCONFROOT/options/hlt1_pvs_with_beamspotmoni_2024.py true -../refs/hlt1_pvs_with_beamspotmoni_2023.ref +../refs/hlt1_pvs_with_beamspotmoni_2024.ref ../refs/empty.ref from Moore.qmtest.exclusions import ref_preprocessor, counter_preprocessor, sensitivities @@ -25,11 +25,14 @@ validateWithReference( counter_preproc=counter_preprocessor, sensitivities=sensitivities) +# Expect 3 warnings, by design +# 1 instance of 'Attempt to initialize cached reference conditions from DB file failed' +# 2 instances of 'Provisional IR Conditions update beyond conceivable thresholds' from Moore.qmtest.exclusions import remove_known_warnings countErrorLines({ "FATAL": 0, "ERROR": 0, - "WARNING": 0 + "WARNING": 3 }, stdout=remove_known_warnings(stdout)) @@ -39,7 +42,7 @@ import re from os.path import isfile pattern = re.compile( - r'BeamSpotMonitor\s+INFO Writing new conditions file (.+)') + r'BeamSpotMonitor_Autonomous\s+INFO Writing new conditions file (.+)') written = 0 found = 0 for line in stdout.split('\n'): -- GitLab From c989b446ab705e4e6beab808a88eda0bb496d8cd Mon Sep 17 00:00:00 2001 From: Patrick Spradlin Date: Wed, 3 Sep 2025 18:23:45 +0100 Subject: [PATCH 4/7] Cleanup some things that i missed in the test name change. --- Hlt/RecoConf/CMakeLists.txt | 2 +- ...v3-opt => hlt1_pvs_with_beamspotmoni_2024.ref.x86_64_v3-opt} | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename Hlt/RecoConf/tests/refs/{hlt1_pvs_with_beamspotmoni_2023.ref.x86_64_v3-opt => hlt1_pvs_with_beamspotmoni_2024.ref.x86_64_v3-opt} (100%) diff --git a/Hlt/RecoConf/CMakeLists.txt b/Hlt/RecoConf/CMakeLists.txt index 9e79e74947a..7ca66c442bd 100644 --- a/Hlt/RecoConf/CMakeLists.txt +++ b/Hlt/RecoConf/CMakeLists.txt @@ -46,7 +46,7 @@ if(BUILD_TESTING AND NOT USE_DD4HEP) set_property( TEST RecoConf.phoenix_event_data_dump - RecoConf.hlt1_pvs_with_beamspotmoni_2023 + RecoConf.hlt1_pvs_with_beamspotmoni_2024 RecoConf.decoding.compare_hlt1_hlt2_muon_decoding_v3geometry_data_2023 PROPERTY DISABLED TRUE diff --git a/Hlt/RecoConf/tests/refs/hlt1_pvs_with_beamspotmoni_2023.ref.x86_64_v3-opt b/Hlt/RecoConf/tests/refs/hlt1_pvs_with_beamspotmoni_2024.ref.x86_64_v3-opt similarity index 100% rename from Hlt/RecoConf/tests/refs/hlt1_pvs_with_beamspotmoni_2023.ref.x86_64_v3-opt rename to Hlt/RecoConf/tests/refs/hlt1_pvs_with_beamspotmoni_2024.ref.x86_64_v3-opt -- GitLab From 36185a3689e707607eb994e8a991736e95b3034a Mon Sep 17 00:00:00 2001 From: Patrick Spradlin Date: Thu, 4 Sep 2025 15:18:59 +0100 Subject: [PATCH 5/7] Updated validator to better accommodate platform dependencies. --- .../hlt1_pvs_with_beamspotmoni_2024.qmt | 26 +++++++++++++++---- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/Hlt/RecoConf/tests/qmtest/hlt1_pvs_with_beamspotmoni_2024.qmt b/Hlt/RecoConf/tests/qmtest/hlt1_pvs_with_beamspotmoni_2024.qmt index 2cf473aa2e7..201d5b7563f 100644 --- a/Hlt/RecoConf/tests/qmtest/hlt1_pvs_with_beamspotmoni_2024.qmt +++ b/Hlt/RecoConf/tests/qmtest/hlt1_pvs_with_beamspotmoni_2024.qmt @@ -25,19 +25,24 @@ validateWithReference( counter_preproc=counter_preprocessor, sensitivities=sensitivities) -# Expect 3 warnings, by design -# 1 instance of 'Attempt to initialize cached reference conditions from DB file failed' -# 2 instances of 'Provisional IR Conditions update beyond conceivable thresholds' +# Expect two kinds of warnings, by design +warn_txt_dbinit = 'Attempt to initialize cached reference conditions from DB file failed' +warn_txt_incon = 'Provisional IR Conditions update beyond conceivable thresholds' + +from GaudiConf.QMTest.BaseTest import LineSkipper from Moore.qmtest.exclusions import remove_known_warnings +remove_my_known_warnings = (LineSkipper( + strings=[warn_txt_dbinit, warn_txt_incon]) + remove_known_warnings) countErrorLines({ "FATAL": 0, "ERROR": 0, - "WARNING": 3 + "WARNING": 0 }, - stdout=remove_known_warnings(stdout)) + stdout=remove_my_known_warnings(stdout)) # Parse pathname of YAML files from stdout # Verify that at least one YAML file has been written +# Also check for occurrences of expected warnings import re from os.path import isfile @@ -45,13 +50,24 @@ pattern = re.compile( r'BeamSpotMonitor_Autonomous\s+INFO Writing new conditions file (.+)') written = 0 found = 0 +warn_txt_dbinit_ctr = 0 +warn_txt_incon_ctr = 0 for line in stdout.split('\n'): + if line.find(warn_txt_dbinit) >= 0: warn_txt_dbinit_ctr += 1 + if line.find(warn_txt_incon) >= 0: warn_txt_incon_ctr += 1 m = re.match(pattern, line) if m: written += 1 yfile = m.group(1) if isfile(yfile): found += 1 +if warn_txt_dbinit_ctr != 1: + causes.append( + "Missing/too many DB init warnings (%d/1)" % (warn_txt_dbinit_ctr)) + +if warn_txt_incon_ctr == 0: + causes.append("Missing inconceivable warning") + if written == 0: causes.append('No output YAML file written') -- GitLab From eefce45cf6f67c43cb802aa549c2f8a2ca22e097 Mon Sep 17 00:00:00 2001 From: Patrick Spradlin Date: Fri, 5 Sep 2025 13:45:23 +0100 Subject: [PATCH 6/7] So long, 2024. You were too short. --- Hlt/RecoConf/CMakeLists.txt | 2 +- ..._beamspotmoni_2024.py => hlt1_pvs_with_beamspotmoni_2025.py} | 0 ...eamspotmoni_2024.qmt => hlt1_pvs_with_beamspotmoni_2025.qmt} | 0 ...eamspotmoni_2024.ref => hlt1_pvs_with_beamspotmoni_2025.ref} | 0 ....armv8.1_a => hlt1_pvs_with_beamspotmoni_2025.ref.armv8.1_a} | 0 ...v3-opt => hlt1_pvs_with_beamspotmoni_2025.ref.x86_64_v3-opt} | 0 6 files changed, 1 insertion(+), 1 deletion(-) rename Hlt/RecoConf/options/{hlt1_pvs_with_beamspotmoni_2024.py => hlt1_pvs_with_beamspotmoni_2025.py} (100%) rename Hlt/RecoConf/tests/qmtest/{hlt1_pvs_with_beamspotmoni_2024.qmt => hlt1_pvs_with_beamspotmoni_2025.qmt} (100%) rename Hlt/RecoConf/tests/refs/{hlt1_pvs_with_beamspotmoni_2024.ref => hlt1_pvs_with_beamspotmoni_2025.ref} (100%) rename Hlt/RecoConf/tests/refs/{hlt1_pvs_with_beamspotmoni_2024.ref.armv8.1_a => hlt1_pvs_with_beamspotmoni_2025.ref.armv8.1_a} (100%) rename Hlt/RecoConf/tests/refs/{hlt1_pvs_with_beamspotmoni_2024.ref.x86_64_v3-opt => hlt1_pvs_with_beamspotmoni_2025.ref.x86_64_v3-opt} (100%) diff --git a/Hlt/RecoConf/CMakeLists.txt b/Hlt/RecoConf/CMakeLists.txt index 7ca66c442bd..7b9b9ea90f0 100644 --- a/Hlt/RecoConf/CMakeLists.txt +++ b/Hlt/RecoConf/CMakeLists.txt @@ -46,7 +46,7 @@ if(BUILD_TESTING AND NOT USE_DD4HEP) set_property( TEST RecoConf.phoenix_event_data_dump - RecoConf.hlt1_pvs_with_beamspotmoni_2024 + RecoConf.hlt1_pvs_with_beamspotmoni_2025 RecoConf.decoding.compare_hlt1_hlt2_muon_decoding_v3geometry_data_2023 PROPERTY DISABLED TRUE diff --git a/Hlt/RecoConf/options/hlt1_pvs_with_beamspotmoni_2024.py b/Hlt/RecoConf/options/hlt1_pvs_with_beamspotmoni_2025.py similarity index 100% rename from Hlt/RecoConf/options/hlt1_pvs_with_beamspotmoni_2024.py rename to Hlt/RecoConf/options/hlt1_pvs_with_beamspotmoni_2025.py diff --git a/Hlt/RecoConf/tests/qmtest/hlt1_pvs_with_beamspotmoni_2024.qmt b/Hlt/RecoConf/tests/qmtest/hlt1_pvs_with_beamspotmoni_2025.qmt similarity index 100% rename from Hlt/RecoConf/tests/qmtest/hlt1_pvs_with_beamspotmoni_2024.qmt rename to Hlt/RecoConf/tests/qmtest/hlt1_pvs_with_beamspotmoni_2025.qmt diff --git a/Hlt/RecoConf/tests/refs/hlt1_pvs_with_beamspotmoni_2024.ref b/Hlt/RecoConf/tests/refs/hlt1_pvs_with_beamspotmoni_2025.ref similarity index 100% rename from Hlt/RecoConf/tests/refs/hlt1_pvs_with_beamspotmoni_2024.ref rename to Hlt/RecoConf/tests/refs/hlt1_pvs_with_beamspotmoni_2025.ref diff --git a/Hlt/RecoConf/tests/refs/hlt1_pvs_with_beamspotmoni_2024.ref.armv8.1_a b/Hlt/RecoConf/tests/refs/hlt1_pvs_with_beamspotmoni_2025.ref.armv8.1_a similarity index 100% rename from Hlt/RecoConf/tests/refs/hlt1_pvs_with_beamspotmoni_2024.ref.armv8.1_a rename to Hlt/RecoConf/tests/refs/hlt1_pvs_with_beamspotmoni_2025.ref.armv8.1_a diff --git a/Hlt/RecoConf/tests/refs/hlt1_pvs_with_beamspotmoni_2024.ref.x86_64_v3-opt b/Hlt/RecoConf/tests/refs/hlt1_pvs_with_beamspotmoni_2025.ref.x86_64_v3-opt similarity index 100% rename from Hlt/RecoConf/tests/refs/hlt1_pvs_with_beamspotmoni_2024.ref.x86_64_v3-opt rename to Hlt/RecoConf/tests/refs/hlt1_pvs_with_beamspotmoni_2025.ref.x86_64_v3-opt -- GitLab From e1f6da8c578a8d987e09a9871dae4e812e3fa891 Mon Sep 17 00:00:00 2001 From: Patrick Spradlin Date: Fri, 5 Sep 2025 16:44:05 +0100 Subject: [PATCH 7/7] Update input data to default_input_and_conds_hlt2_2025_data.py and retune test for it --- Hlt/RecoConf/options/hlt1_pvs_with_beamspotmoni_2025.py | 6 +++--- .../tests/qmtest/hlt1_pvs_with_beamspotmoni_2025.qmt | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Hlt/RecoConf/options/hlt1_pvs_with_beamspotmoni_2025.py b/Hlt/RecoConf/options/hlt1_pvs_with_beamspotmoni_2025.py index 24fec28c6e5..86e0d599134 100644 --- a/Hlt/RecoConf/options/hlt1_pvs_with_beamspotmoni_2025.py +++ b/Hlt/RecoConf/options/hlt1_pvs_with_beamspotmoni_2025.py @@ -58,7 +58,7 @@ def run_hlt1_pvs_with_beamspotmoni(): MakeDBRunFile=True, conditionsDbPath=".", MaxAbsDeltaMap={ - "x": 0.001 * mm, + "x": 0.002 * mm, }, ) @@ -107,7 +107,7 @@ def run_hlt1_pvs_with_beamspotmoni(): }, InconceivableHandling="WarnSkip", InconceivableAbsDeltaMap={ - "x": 0.032 * mm, + "x": 0.002 * mm, }, ) @@ -123,7 +123,7 @@ def run_hlt1_pvs_with_beamspotmoni(): return Reconstruction("pvs_reco", data, reco_prefilters(skipUT=True)) -options.histo_file = "hlt1_pvs_with_beamspotmoni_2024.root" +options.histo_file = "hlt1_pvs_with_beamspotmoni_2025.root" with ( make_VeloClusterTrackingSIMD.bind(SkipForward=4), diff --git a/Hlt/RecoConf/tests/qmtest/hlt1_pvs_with_beamspotmoni_2025.qmt b/Hlt/RecoConf/tests/qmtest/hlt1_pvs_with_beamspotmoni_2025.qmt index 201d5b7563f..2ac84301b84 100644 --- a/Hlt/RecoConf/tests/qmtest/hlt1_pvs_with_beamspotmoni_2025.qmt +++ b/Hlt/RecoConf/tests/qmtest/hlt1_pvs_with_beamspotmoni_2025.qmt @@ -12,11 +12,11 @@ gaudirun.py - $MOOREROOT/tests/options/mdf_input_and_conds_data_2024.py - $RECOCONFROOT/options/hlt1_pvs_with_beamspotmoni_2024.py + $MOOREROOT/tests/options/default_input_and_conds_hlt2_2025_data.py + $RECOCONFROOT/options/hlt1_pvs_with_beamspotmoni_2025.py true -../refs/hlt1_pvs_with_beamspotmoni_2024.ref +../refs/hlt1_pvs_with_beamspotmoni_2025.ref ../refs/empty.ref from Moore.qmtest.exclusions import ref_preprocessor, counter_preprocessor, sensitivities -- GitLab