From 51d77038fc623d94291a140984f18919abc7d8da Mon Sep 17 00:00:00 2001 From: Titus Mombaecher Date: Wed, 13 Aug 2025 21:34:45 +0200 Subject: [PATCH 1/4] a lumi line without BGI --- .../python/AllenSequences/odin_lumi_no_bgi.py | 138 ++++++++++++++++++ 1 file changed, 138 insertions(+) create mode 100644 configuration/python/AllenSequences/odin_lumi_no_bgi.py diff --git a/configuration/python/AllenSequences/odin_lumi_no_bgi.py b/configuration/python/AllenSequences/odin_lumi_no_bgi.py new file mode 100644 index 00000000000..f036062875e --- /dev/null +++ b/configuration/python/AllenSequences/odin_lumi_no_bgi.py @@ -0,0 +1,138 @@ +############################################################################### +# (c) Copyright 2022 CERN for the benefit of the LHCb Collaboration # +# # +# This software is distributed under the terms of the Apache License # +# version 2 (Apache-2.0), copied verbatim in the file "LICENSE". # +# # +# 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 AllenConf.hlt1_reconstruction import hlt1_reconstruction +from AllenConf.hlt1_calibration_lines import make_passthrough_line +from AllenCore.generator import generate +from AllenConf.persistency import make_persistency, make_gather_selections +from AllenConf.utils import line_maker +from AllenConf.filters import sd_error_filter +from PyConf.control_flow import NodeLogic, CompositeNode +from AllenConf.validators import rate_validation +from AllenConf.odin import odin_error_filter, make_event_type, make_odin_orbit, tae_filter +from AllenConf.HLT1 import odin_monitoring_lines, default_bgi_activity_lines +from AllenConf.lumi_reconstruction import lumi_reconstruction +from AllenConf.enum_types import TrackingType, includes_matching + + +def setup_hlt1_node(velo_open=False, enableBGI=True, enableBGI_full=False): + hlt1_config = {} + lines = [] + odin_err_filter = [odin_error_filter("odin_error_filter")] + + # Reconstruct objects needed as input for selection lines + reconstructed_objects = hlt1_reconstruction( + with_calo=True, + with_ut=True, + with_muon=True, + enableDownstream=False, + tracking_type=TrackingType.FORWARD_THEN_MATCHING, + velo_open=velo_open, + with_AC_split=False, + with_rich=False) + + lumiline_name = "Hlt1ODINLumi" + lumilinefull_name = "Hlt1ODIN1kHzLumi" + odin_lumi_event = make_event_type(event_type='Lumi') + with line_maker.bind(prefilter=odin_err_filter + [odin_lumi_event]): + lines += [ + line_maker( + make_passthrough_line(name=lumiline_name, pre_scaler=1.)) + ] + + odin_orbit = make_odin_orbit(odin_orbit_modulo=30, odin_orbit_remainder=1) + with line_maker.bind( + prefilter=odin_err_filter + [odin_lumi_event, odin_orbit]): + lines += [ + line_maker( + make_passthrough_line(name=lumilinefull_name, pre_scaler=1.)) + ] + if enableBGI: + lines += default_bgi_activity_lines( + reconstructed_objects["pvs"], + reconstructed_objects["velo_states"], + enableBGI_full=enableBGI_full, + prefilter=odin_err_filter) + + with line_maker.bind( + prefilter=odin_err_filter + [tae_filter(accept_sub_events=True)]): + lines += [ + line_maker( + make_passthrough_line(name="Hlt1TAEPassthrough", pre_scaler=1)) + ] + + with line_maker.bind(prefilter=[sd_error_filter()]): + lines += [ + line_maker( + make_passthrough_line(name="Hlt1ErrorBank", pre_scaler=0.0001)) + ] + + # list of line algorithms, required for the gather selection and DecReport algorithms + line_algorithms = [tup[0] for tup in lines] + # lost of line nodes, required to set up the CompositeNode + line_nodes = [tup[1] for tup in lines] + + gather_selections = make_gather_selections(lines=line_algorithms) + lumi_reco = lumi_reconstruction( + gather_selections=gather_selections, + lumiline_name=lumiline_name, + lumilinefull_name=lumilinefull_name, + with_muon=True, + velo_open=False) + + lumi_node = CompositeNode( + "AllenLumiNode", + lumi_reco["algorithms"], + NodeLogic.NONLAZY_AND, + force_order=False) + + velo_open_event = make_event_type(event_type="VeloOpen") + DisableLinesDuringVPClosing = False + velo_closed = [ + make_invert_event_list(velo_open_event, name="VeloClosedEvent") + ] if DisableLinesDuringVPClosing else [] + + lumi_with_prefilter = CompositeNode( + "LumiWithPrefilter", + odin_err_filter + velo_closed + [lumi_node], + NodeLogic.LAZY_AND, + force_order=True) + + hlt1_config['lumi_reconstruction'] = lumi_reco + hlt1_config['lumi_node'] = lumi_with_prefilter + + persistency_node, persistency_algorithms = make_persistency( + line_algorithms) + + lines = CompositeNode( + "SetupAllLines", line_nodes, NodeLogic.NONLAZY_OR, force_order=False) + + hlt1_node = CompositeNode( + "Allen", [lines, persistency_node, lumi_with_prefilter], + NodeLogic.NONLAZY_AND, + force_order=True) + + hlt1_node = CompositeNode( + "AllenRateValidation", [ + hlt1_node, + rate_validation(lines=line_algorithms), + ], + NodeLogic.NONLAZY_AND, + force_order=True) + + hlt1_config['line_nodes'] = line_nodes + hlt1_config['line_algorithms'] = line_algorithms + hlt1_config.update(persistency_algorithms) + hlt1_config['control_flow_node'] = hlt1_node + return hlt1_config + + +hlt1_node = setup_hlt1_node(enableBGI=False) +generate(hlt1_node) -- GitLab From 48cbc9df50be88f4daa58404c217d6a3d3b31f08 Mon Sep 17 00:00:00 2001 From: Titus Mombaecher Date: Fri, 15 Aug 2025 00:18:54 +0200 Subject: [PATCH 2/4] greatly simplifying odin-lumi no BGI --- .../python/AllenSequences/odin_lumi_no_bgi.py | 113 +----------------- 1 file changed, 1 insertion(+), 112 deletions(-) diff --git a/configuration/python/AllenSequences/odin_lumi_no_bgi.py b/configuration/python/AllenSequences/odin_lumi_no_bgi.py index f036062875e..e172816f173 100644 --- a/configuration/python/AllenSequences/odin_lumi_no_bgi.py +++ b/configuration/python/AllenSequences/odin_lumi_no_bgi.py @@ -21,118 +21,7 @@ from AllenConf.HLT1 import odin_monitoring_lines, default_bgi_activity_lines from AllenConf.lumi_reconstruction import lumi_reconstruction from AllenConf.enum_types import TrackingType, includes_matching - -def setup_hlt1_node(velo_open=False, enableBGI=True, enableBGI_full=False): - hlt1_config = {} - lines = [] - odin_err_filter = [odin_error_filter("odin_error_filter")] - - # Reconstruct objects needed as input for selection lines - reconstructed_objects = hlt1_reconstruction( - with_calo=True, - with_ut=True, - with_muon=True, - enableDownstream=False, - tracking_type=TrackingType.FORWARD_THEN_MATCHING, - velo_open=velo_open, - with_AC_split=False, - with_rich=False) - - lumiline_name = "Hlt1ODINLumi" - lumilinefull_name = "Hlt1ODIN1kHzLumi" - odin_lumi_event = make_event_type(event_type='Lumi') - with line_maker.bind(prefilter=odin_err_filter + [odin_lumi_event]): - lines += [ - line_maker( - make_passthrough_line(name=lumiline_name, pre_scaler=1.)) - ] - - odin_orbit = make_odin_orbit(odin_orbit_modulo=30, odin_orbit_remainder=1) - with line_maker.bind( - prefilter=odin_err_filter + [odin_lumi_event, odin_orbit]): - lines += [ - line_maker( - make_passthrough_line(name=lumilinefull_name, pre_scaler=1.)) - ] - if enableBGI: - lines += default_bgi_activity_lines( - reconstructed_objects["pvs"], - reconstructed_objects["velo_states"], - enableBGI_full=enableBGI_full, - prefilter=odin_err_filter) - - with line_maker.bind( - prefilter=odin_err_filter + [tae_filter(accept_sub_events=True)]): - lines += [ - line_maker( - make_passthrough_line(name="Hlt1TAEPassthrough", pre_scaler=1)) - ] - - with line_maker.bind(prefilter=[sd_error_filter()]): - lines += [ - line_maker( - make_passthrough_line(name="Hlt1ErrorBank", pre_scaler=0.0001)) - ] - - # list of line algorithms, required for the gather selection and DecReport algorithms - line_algorithms = [tup[0] for tup in lines] - # lost of line nodes, required to set up the CompositeNode - line_nodes = [tup[1] for tup in lines] - - gather_selections = make_gather_selections(lines=line_algorithms) - lumi_reco = lumi_reconstruction( - gather_selections=gather_selections, - lumiline_name=lumiline_name, - lumilinefull_name=lumilinefull_name, - with_muon=True, - velo_open=False) - - lumi_node = CompositeNode( - "AllenLumiNode", - lumi_reco["algorithms"], - NodeLogic.NONLAZY_AND, - force_order=False) - - velo_open_event = make_event_type(event_type="VeloOpen") - DisableLinesDuringVPClosing = False - velo_closed = [ - make_invert_event_list(velo_open_event, name="VeloClosedEvent") - ] if DisableLinesDuringVPClosing else [] - - lumi_with_prefilter = CompositeNode( - "LumiWithPrefilter", - odin_err_filter + velo_closed + [lumi_node], - NodeLogic.LAZY_AND, - force_order=True) - - hlt1_config['lumi_reconstruction'] = lumi_reco - hlt1_config['lumi_node'] = lumi_with_prefilter - - persistency_node, persistency_algorithms = make_persistency( - line_algorithms) - - lines = CompositeNode( - "SetupAllLines", line_nodes, NodeLogic.NONLAZY_OR, force_order=False) - - hlt1_node = CompositeNode( - "Allen", [lines, persistency_node, lumi_with_prefilter], - NodeLogic.NONLAZY_AND, - force_order=True) - - hlt1_node = CompositeNode( - "AllenRateValidation", [ - hlt1_node, - rate_validation(lines=line_algorithms), - ], - NodeLogic.NONLAZY_AND, - force_order=True) - - hlt1_config['line_nodes'] = line_nodes - hlt1_config['line_algorithms'] = line_algorithms - hlt1_config.update(persistency_algorithms) - hlt1_config['control_flow_node'] = hlt1_node - return hlt1_config - +from odin_lumi import setup_hlt1_node hlt1_node = setup_hlt1_node(enableBGI=False) generate(hlt1_node) -- GitLab From c2c271dff0ee08abf17aea60546c94350a233610 Mon Sep 17 00:00:00 2001 From: Titus Mombaecher Date: Fri, 15 Aug 2025 23:29:29 +0200 Subject: [PATCH 3/4] Revert "greatly simplifying odin-lumi no BGI" This reverts commit 48cbc9df50be88f4daa58404c217d6a3d3b31f08. --- .../python/AllenSequences/odin_lumi_no_bgi.py | 113 +++++++++++++++++- 1 file changed, 112 insertions(+), 1 deletion(-) diff --git a/configuration/python/AllenSequences/odin_lumi_no_bgi.py b/configuration/python/AllenSequences/odin_lumi_no_bgi.py index e172816f173..f036062875e 100644 --- a/configuration/python/AllenSequences/odin_lumi_no_bgi.py +++ b/configuration/python/AllenSequences/odin_lumi_no_bgi.py @@ -21,7 +21,118 @@ from AllenConf.HLT1 import odin_monitoring_lines, default_bgi_activity_lines from AllenConf.lumi_reconstruction import lumi_reconstruction from AllenConf.enum_types import TrackingType, includes_matching -from odin_lumi import setup_hlt1_node + +def setup_hlt1_node(velo_open=False, enableBGI=True, enableBGI_full=False): + hlt1_config = {} + lines = [] + odin_err_filter = [odin_error_filter("odin_error_filter")] + + # Reconstruct objects needed as input for selection lines + reconstructed_objects = hlt1_reconstruction( + with_calo=True, + with_ut=True, + with_muon=True, + enableDownstream=False, + tracking_type=TrackingType.FORWARD_THEN_MATCHING, + velo_open=velo_open, + with_AC_split=False, + with_rich=False) + + lumiline_name = "Hlt1ODINLumi" + lumilinefull_name = "Hlt1ODIN1kHzLumi" + odin_lumi_event = make_event_type(event_type='Lumi') + with line_maker.bind(prefilter=odin_err_filter + [odin_lumi_event]): + lines += [ + line_maker( + make_passthrough_line(name=lumiline_name, pre_scaler=1.)) + ] + + odin_orbit = make_odin_orbit(odin_orbit_modulo=30, odin_orbit_remainder=1) + with line_maker.bind( + prefilter=odin_err_filter + [odin_lumi_event, odin_orbit]): + lines += [ + line_maker( + make_passthrough_line(name=lumilinefull_name, pre_scaler=1.)) + ] + if enableBGI: + lines += default_bgi_activity_lines( + reconstructed_objects["pvs"], + reconstructed_objects["velo_states"], + enableBGI_full=enableBGI_full, + prefilter=odin_err_filter) + + with line_maker.bind( + prefilter=odin_err_filter + [tae_filter(accept_sub_events=True)]): + lines += [ + line_maker( + make_passthrough_line(name="Hlt1TAEPassthrough", pre_scaler=1)) + ] + + with line_maker.bind(prefilter=[sd_error_filter()]): + lines += [ + line_maker( + make_passthrough_line(name="Hlt1ErrorBank", pre_scaler=0.0001)) + ] + + # list of line algorithms, required for the gather selection and DecReport algorithms + line_algorithms = [tup[0] for tup in lines] + # lost of line nodes, required to set up the CompositeNode + line_nodes = [tup[1] for tup in lines] + + gather_selections = make_gather_selections(lines=line_algorithms) + lumi_reco = lumi_reconstruction( + gather_selections=gather_selections, + lumiline_name=lumiline_name, + lumilinefull_name=lumilinefull_name, + with_muon=True, + velo_open=False) + + lumi_node = CompositeNode( + "AllenLumiNode", + lumi_reco["algorithms"], + NodeLogic.NONLAZY_AND, + force_order=False) + + velo_open_event = make_event_type(event_type="VeloOpen") + DisableLinesDuringVPClosing = False + velo_closed = [ + make_invert_event_list(velo_open_event, name="VeloClosedEvent") + ] if DisableLinesDuringVPClosing else [] + + lumi_with_prefilter = CompositeNode( + "LumiWithPrefilter", + odin_err_filter + velo_closed + [lumi_node], + NodeLogic.LAZY_AND, + force_order=True) + + hlt1_config['lumi_reconstruction'] = lumi_reco + hlt1_config['lumi_node'] = lumi_with_prefilter + + persistency_node, persistency_algorithms = make_persistency( + line_algorithms) + + lines = CompositeNode( + "SetupAllLines", line_nodes, NodeLogic.NONLAZY_OR, force_order=False) + + hlt1_node = CompositeNode( + "Allen", [lines, persistency_node, lumi_with_prefilter], + NodeLogic.NONLAZY_AND, + force_order=True) + + hlt1_node = CompositeNode( + "AllenRateValidation", [ + hlt1_node, + rate_validation(lines=line_algorithms), + ], + NodeLogic.NONLAZY_AND, + force_order=True) + + hlt1_config['line_nodes'] = line_nodes + hlt1_config['line_algorithms'] = line_algorithms + hlt1_config.update(persistency_algorithms) + hlt1_config['control_flow_node'] = hlt1_node + return hlt1_config + hlt1_node = setup_hlt1_node(enableBGI=False) generate(hlt1_node) -- GitLab From 02b7c227c6f1ab374ca709e1fec5b0da7c247c68 Mon Sep 17 00:00:00 2001 From: Titus Mombaecher Date: Fri, 15 Aug 2025 23:33:34 +0200 Subject: [PATCH 4/4] remove all related to bgi in the no-bgi sequence for simplicity --- .../python/AllenSequences/odin_lumi_no_bgi.py | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/configuration/python/AllenSequences/odin_lumi_no_bgi.py b/configuration/python/AllenSequences/odin_lumi_no_bgi.py index f036062875e..72010833e12 100644 --- a/configuration/python/AllenSequences/odin_lumi_no_bgi.py +++ b/configuration/python/AllenSequences/odin_lumi_no_bgi.py @@ -17,12 +17,12 @@ from AllenConf.filters import sd_error_filter from PyConf.control_flow import NodeLogic, CompositeNode from AllenConf.validators import rate_validation from AllenConf.odin import odin_error_filter, make_event_type, make_odin_orbit, tae_filter -from AllenConf.HLT1 import odin_monitoring_lines, default_bgi_activity_lines +from AllenConf.HLT1 import odin_monitoring_lines from AllenConf.lumi_reconstruction import lumi_reconstruction from AllenConf.enum_types import TrackingType, includes_matching -def setup_hlt1_node(velo_open=False, enableBGI=True, enableBGI_full=False): +def setup_hlt1_node(velo_open=False): hlt1_config = {} lines = [] odin_err_filter = [odin_error_filter("odin_error_filter")] @@ -54,12 +54,6 @@ def setup_hlt1_node(velo_open=False, enableBGI=True, enableBGI_full=False): line_maker( make_passthrough_line(name=lumilinefull_name, pre_scaler=1.)) ] - if enableBGI: - lines += default_bgi_activity_lines( - reconstructed_objects["pvs"], - reconstructed_objects["velo_states"], - enableBGI_full=enableBGI_full, - prefilter=odin_err_filter) with line_maker.bind( prefilter=odin_err_filter + [tae_filter(accept_sub_events=True)]): @@ -134,5 +128,5 @@ def setup_hlt1_node(velo_open=False, enableBGI=True, enableBGI_full=False): return hlt1_config -hlt1_node = setup_hlt1_node(enableBGI=False) +hlt1_node = setup_hlt1_node() generate(hlt1_node) -- GitLab