diff --git a/Hlt/Hlt1Conf/options/allen_hlt1_pp_2024_production_options.yaml b/Hlt/Hlt1Conf/options/allen_hlt1_pp_2024_production_options.yaml index fe60659fa257a73f4695484c975f32fb1918d278..2660813a990c56ffa0cb3e8a804022a244a17c85 100644 --- a/Hlt/Hlt1Conf/options/allen_hlt1_pp_2024_production_options.yaml +++ b/Hlt/Hlt1Conf/options/allen_hlt1_pp_2024_production_options.yaml @@ -8,10 +8,10 @@ geometry_version: run3/trunk conditions_version: jonrob/all-pmts-active input_files: - - root://eoslhcb.cern.ch//eos/lhcb/grid/prod/lhcb/MC/Dev/XDIGI/00212962/0000/00212962_00000010_1.xdigi + - root://eoslhcb.cern.ch//eos/lhcb/cern-swtest/lhcb/swtest/expected_2024_BdToKstgamma_xdigi/00212962_00000010_1.xdigi input_type: "ROOT" input_raw_format: 0.5 evt_max: 20 -output_type: 'ROOT' \ No newline at end of file +output_type: 'ROOT' diff --git a/Hlt/Hlt2Conf/options/hlt2_pp_2024_flagging_mc.yaml b/Hlt/Hlt2Conf/options/hlt2_pp_2024_flagging_mc.yaml new file mode 100644 index 0000000000000000000000000000000000000000..3eb359d28574b63daa82411677e27c5e4ed775fa --- /dev/null +++ b/Hlt/Hlt2Conf/options/hlt2_pp_2024_flagging_mc.yaml @@ -0,0 +1,25 @@ +data_type: Upgrade +simulation: True +# As dddb_tag a branch with a newer particle table version is used here, +# as some new hlt2 lines rely on new/renamed particles only introduced in dddb-20240427. +# This workaround is temporary and can be removed, once newer simulation samples, +# based on dddb-20240427 directly, are available for these tests. +dddb_tag: 'upgrade/dddb-20221004-new-particle-table' +conddb_tag: 'sim-20220929-vc-md100' + +# from the test Hlt/Moore/tests/qmtest/test_lbexec_allen_hlt1_pp_mc_2024.qmt +input_files: + - LFN:allen_hlt1_pp_2024_production.dst +input_type: "ROOT" +input_raw_format: 0.5 +evt_max: -1 + +xml_summary_file: hlt2_pp_2024_summary.xml +xml_file_catalog: hlt1_pool_xml_catalog.xml + +scheduler_legacy_mode: False + +output_file: hlt2_pp_2024_flagging_mc.dst +output_type: 'ROOT' +geometry_version: run3/trunk +conditions_version: jonrob/all-pmts-active diff --git a/Hlt/Hlt2Conf/options/hlt2_pp_2024_flagging_persistreco_mc.yaml b/Hlt/Hlt2Conf/options/hlt2_pp_2024_flagging_persistreco_mc.yaml new file mode 100644 index 0000000000000000000000000000000000000000..a561b96ab28bfd7e7691544703565df8344e0806 --- /dev/null +++ b/Hlt/Hlt2Conf/options/hlt2_pp_2024_flagging_persistreco_mc.yaml @@ -0,0 +1,21 @@ +data_type: Upgrade +simulation: True +# As dddb_tag a branch with a newer particle table version is used here, +# as some new hlt2 lines rely on new/renamed particles only introduced in dddb-20240427. +# This workaround is temporary and can be removed, once newer simulation samples, +# based on dddb-20240427 directly, are available for these tests. +dddb_tag: 'upgrade/dddb-20221004-new-particle-table' +conddb_tag: 'sim-20220929-vc-md100' + + +# from the test Hlt/Moore/tests/qmtest/test_lbexec_allen_hlt1_pp_mc_2024.qmt +input_files: + - allen_hlt1_pp_2024_production.dst +input_type: "ROOT" +input_raw_format: 0.5 +evt_max: -1 + +output_file: hlt2_pp_2024_flagging_persistreco_mc.dst +output_type: 'ROOT' +geometry_version: run3/trunk +conditions_version: jonrob/all-pmts-active diff --git a/Hlt/Hlt2Conf/options/hlt2_pp_2024_flagging_reco_only_mc.yaml b/Hlt/Hlt2Conf/options/hlt2_pp_2024_flagging_reco_only_mc.yaml new file mode 100644 index 0000000000000000000000000000000000000000..aa6fde41d1e64a7523b74977ec0c9b36397bf01d --- /dev/null +++ b/Hlt/Hlt2Conf/options/hlt2_pp_2024_flagging_reco_only_mc.yaml @@ -0,0 +1,20 @@ +data_type: Upgrade +simulation: True +# As dddb_tag a branch with a newer particle table version is used here, +# as some new hlt2 lines rely on new/renamed particles only introduced in dddb-20240427. +# This workaround is temporary and can be removed, once newer simulation samples, +# based on dddb-20240427 directly, are available for these tests. +dddb_tag: 'upgrade/dddb-20221004-new-particle-table' +conddb_tag: 'sim-20220929-vc-md100' + +# from the test Hlt/Moore/tests/qmtest/test_lbexec_allen_hlt1_pp_mc_2024.qmt +input_files: + - allen_hlt1_pp_2024_production.dst +input_type: "ROOT" +input_raw_format: 0.5 +evt_max: -1 + +output_file: hlt2_pp_2024_flagging_reco_only_mc.dst +output_type: 'ROOT' +geometry_version: run3/trunk +conditions_version: jonrob/all-pmts-active diff --git a/Hlt/Hlt2Conf/options/hlt2_pp_2024_noflagging_mc.yaml b/Hlt/Hlt2Conf/options/hlt2_pp_2024_noflagging_mc.yaml new file mode 100644 index 0000000000000000000000000000000000000000..c77bafea806fb582b0439e5b5d18152d58a49b59 --- /dev/null +++ b/Hlt/Hlt2Conf/options/hlt2_pp_2024_noflagging_mc.yaml @@ -0,0 +1,20 @@ +data_type: Upgrade +simulation: True +# As dddb_tag a branch with a newer particle table version is used here, +# as some new hlt2 lines rely on new/renamed particles only introduced in dddb-20240427. +# This workaround is temporary and can be removed, once newer simulation samples, +# based on dddb-20240427 directly, are available for these tests. +dddb_tag: 'upgrade/dddb-20221004-new-particle-table' +conddb_tag: 'sim-20220929-vc-md100' + +# from the test Hlt/Moore/tests/qmtest/test_lbexec_allen_hlt1_pp_mc_2024.qmt +input_files: + - allen_hlt1_pp_2024_production.dst +input_type: "ROOT" +input_raw_format: 0.5 +evt_max: -1 + +output_file: hlt2_pp_2024_noflagging_mc.dst +output_type: 'ROOT' +geometry_version: run3/trunk +conditions_version: jonrob/all-pmts-active diff --git a/Hlt/Hlt2Conf/options/hlt2_pp_2024_production_options.yaml b/Hlt/Hlt2Conf/options/hlt2_pp_2024_production_options.yaml index 19fb4a3037c70d1bce22cf18147397d57e07a3a8..94dc605c948424094d1fd17fd178f20323b5e97b 100644 --- a/Hlt/Hlt2Conf/options/hlt2_pp_2024_production_options.yaml +++ b/Hlt/Hlt2Conf/options/hlt2_pp_2024_production_options.yaml @@ -3,6 +3,7 @@ simulation: True dddb_tag: 'dddb-20221004' conddb_tag: 'sim-20220929-vc-md100' + # from the test Hlt/Moore/tests/qmtest/test_lbexec_allen_hlt1_pp_mc_2024.qmt input_files: - LFN:allen_hlt1_pp_2024_production.dst diff --git a/Hlt/Hlt2Conf/options/hlt2_production_options_2024_hlt1_filtered.yaml b/Hlt/Hlt2Conf/options/hlt2_production_options_2024_hlt1_filtered.yaml index 03e08a3f2ff7a3777025087c970e490620c73603..ed64191ff13e0347940097e8a0e8bb6fdc7894fe 100644 --- a/Hlt/Hlt2Conf/options/hlt2_production_options_2024_hlt1_filtered.yaml +++ b/Hlt/Hlt2Conf/options/hlt2_production_options_2024_hlt1_filtered.yaml @@ -1,16 +1,14 @@ -data_type: Upgrade -simulation: True -dddb_tag: 'dddb-20231017' -conddb_tag: 'sim-20231017-vc-md100' +# As dddb_tag a branch with a newer particle table version is used here, +# as some new hlt2 lines rely on new/renamed particles only introduced in dddb-20240427. +# This workaround is temporary and can be removed, once newer simulation samples, +# based on dddb-20240427 directly, are available for these tests. +dddb_tag: 'upgrade/dddb-20231017-new-particle-table' -#testfiledb_key: expected_2024_min_bias_hlt1_filtered_v2 -input_files: - - mdf:root://eoslhcb.cern.ch//eos/lhcb/wg/rta/WP3/bandwidth_division/Beam6800GeV-expected-2024-MagDown-Nu7.6/hlt1_filtered/v2/30000000/input_0.mdf - -input_type: "RAW" +testfiledb_key: 'expected_2024_min_bias_hlt1_filtered_v2' input_raw_format: 0.0 evt_max: 20 + xml_summary_file: "hlt2_summary_2024.xml" xml_file_catalog: "hlt2_pool_xml_catalog_2024.xml" @@ -18,6 +16,3 @@ scheduler_legacy_mode: False output_file: 'hlt2_output_2024.dst' output_type: 'ROOT' - -geometry_version: run3/trunk -conditions_version: jonrob/all-pmts-active \ No newline at end of file diff --git a/Hlt/Hlt2Conf/options/hlt2_test_flagging.py b/Hlt/Hlt2Conf/options/hlt2_test_flagging.py index 582b8b8a090a9d57eb8163018b49d7bbac493dcc..8ac79950fc13c0606e9d4ff779cdb5262919130d 100644 --- a/Hlt/Hlt2Conf/options/hlt2_test_flagging.py +++ b/Hlt/Hlt2Conf/options/hlt2_test_flagging.py @@ -17,7 +17,7 @@ Run like any other options file: from Moore import options from Moore.production import hlt2 from RecoConf.reconstruction_objects import reconstruction -from RecoConf.hlt2_global_reco import reconstruction as hlt2_reconstruction, make_light_reco_pr_kf_without_UT +from RecoConf.hlt2_global_reco import reconstruction as hlt2_reconstruction, make_light_reco_pr_kf from Hlt2Conf.lines.test.hlt2_test import hlt2_test_lines options.evt_max = 200 @@ -35,8 +35,8 @@ def make_lines(make_lines=None): options.lines_maker = make_lines #find all arguments in Moore.production module -hlt2_mc_args = ("--flagging", "--without-ut") +hlt2_mc_args = ("--flagging", "--velo-source=VPRetinaCluster") with reconstruction.bind(from_file=False), hlt2_reconstruction.bind( - make_reconstruction=make_light_reco_pr_kf_without_UT): + make_reconstruction=make_light_reco_pr_kf): config = hlt2(options, *hlt2_mc_args) diff --git a/Hlt/Hlt2Conf/options/spruce_pp_2024_flagging_mc.yaml b/Hlt/Hlt2Conf/options/spruce_pp_2024_flagging_mc.yaml new file mode 100644 index 0000000000000000000000000000000000000000..437f6ce39670324c07f25a983e986741ce5a2c64 --- /dev/null +++ b/Hlt/Hlt2Conf/options/spruce_pp_2024_flagging_mc.yaml @@ -0,0 +1,23 @@ +data_type: Upgrade +simulation: True +dddb_tag: 'dddb-20221004' +conddb_tag: 'sim-20220929-vc-md100' + +input_files: ["hlt2_pp_2024_flagging_mc.dst"] +input_type: "ROOT" +input_raw_format: 0.5 +evt_max: -1 + + +xml_summary_file: spruce_pp_2024_summary.xml +xml_file_catalog: hlt2_pool_xml_catalog.xml + +scheduler_legacy_mode: False + +output_file: spruce_pp_2024_flagging_mc.dst +output_type: 'ROOT' +geometry_version: run3/trunk +conditions_version: jonrob/all-pmts-active + +input_process: Hlt2 +process: Spruce diff --git a/Hlt/Hlt2Conf/options/spruce_pp_2024_flagging_persistreco_mc.yaml b/Hlt/Hlt2Conf/options/spruce_pp_2024_flagging_persistreco_mc.yaml new file mode 100644 index 0000000000000000000000000000000000000000..37fde7ba825eb8deb16523525cc0c526bc778d89 --- /dev/null +++ b/Hlt/Hlt2Conf/options/spruce_pp_2024_flagging_persistreco_mc.yaml @@ -0,0 +1,19 @@ +data_type: Upgrade +simulation: True +dddb_tag: 'dddb-20221004' +conddb_tag: 'sim-20220929-vc-md100' + +input_files: ["hlt2_pp_2024_flagging_persistreco_mc.dst"] +input_type: "ROOT" +input_raw_format: 0.5 +evt_max: -1 + +scheduler_legacy_mode: False + +output_file: spruce_pp_2024_flagging_persistreco_mc.dst +output_type: 'ROOT' +geometry_version: run3/trunk +conditions_version: jonrob/all-pmts-active + +input_process: Hlt2 +process: Spruce diff --git a/Hlt/Hlt2Conf/options/spruce_pp_2024_noflagging_mc.yaml b/Hlt/Hlt2Conf/options/spruce_pp_2024_noflagging_mc.yaml new file mode 100644 index 0000000000000000000000000000000000000000..8ecd091f2e76ecdb50b705b8e5870a9bcff31be4 --- /dev/null +++ b/Hlt/Hlt2Conf/options/spruce_pp_2024_noflagging_mc.yaml @@ -0,0 +1,20 @@ +data_type: Upgrade +simulation: True +dddb_tag: 'dddb-20221004' +conddb_tag: 'sim-20220929-vc-md100' + +input_files: ["hlt2_pp_2024_noflagging_mc.dst"] +input_type: "ROOT" +input_raw_format: 0.5 +evt_max: -1 + + +scheduler_legacy_mode: False + +output_file: spruce_pp_2024_noflagging_mc.dst +output_type: 'ROOT' +geometry_version: run3/trunk +conditions_version: jonrob/all-pmts-active + +input_process: Hlt2 +process: Spruce diff --git a/Hlt/Hlt2Conf/options/spruce_pp_2024_production_options.yaml b/Hlt/Hlt2Conf/options/spruce_pp_2024_production_options.yaml index 88d350f4a3a535d22dbdfbfdc2b4f2c282d42afa..f30cfc8dffce34a347840a9bd8d270db08b0f9b3 100644 --- a/Hlt/Hlt2Conf/options/spruce_pp_2024_production_options.yaml +++ b/Hlt/Hlt2Conf/options/spruce_pp_2024_production_options.yaml @@ -3,17 +3,11 @@ simulation: True dddb_tag: 'dddb-20221004' conddb_tag: 'sim-20220929-vc-md100' -# from the test Hlt/Moore/tests/qmtest/test_lbexec_hlt2_pp_2024_mc.qmt input_files: ["hlt2_pp_2024_output.dst"] input_type: "ROOT" input_raw_format: 0.5 evt_max: -1 -xml_summary_file: spruce_pp_2024_summary.xml -xml_file_catalog: hlt2_pool_xml_catalog.xml - -scheduler_legacy_mode: False - output_file: spruce_pp_2024_output.dst output_type: 'ROOT' geometry_version: run3/trunk diff --git a/Hlt/Hlt2Conf/python/Hlt2Conf/lines/mc/mc_lines.py b/Hlt/Hlt2Conf/python/Hlt2Conf/lines/mc/mc_lines.py index 1afc918d187ddac1140845682e3efae53dba8b40..c82646c7c868f8c105f8ca0fd78f5e802bee296e 100644 --- a/Hlt/Hlt2Conf/python/Hlt2Conf/lines/mc/mc_lines.py +++ b/Hlt/Hlt2Conf/python/Hlt2Conf/lines/mc/mc_lines.py @@ -9,34 +9,91 @@ # or submit itself to any jurisdiction. # ############################################################################### from Moore.lines import Hlt2Line, SpruceLine +from Moore.streams import DETECTORS MC_HLT2_PASSTHROUGH_LINE_NAME = "Hlt2MCPassThrough" +MC_HLT2_PASSTHROUGH_PERSISTRECO_LINE_NAME = "Hlt2MCPassThroughPersistReco" +MC_HLT2_PASSTHROUGH_RAWBANKS_LINE_NAME = "Hlt2MCPassThroughRawBanks" +MC_HLT2_PASSTHROUGH_PERSISTRECO_RAWBANKS_LINE_NAME = "Hlt2MCPassThroughPersistRecoRawBanks" + MC_SPRUCE_PASSTHROUGH_LINE_NAME = "SpruceMCPassThrough" +MC_SPRUCE_PASSTHROUGH_PERSISTRECO_LINE_NAME = "SpruceMCPassThroughPersistReco" +MC_SPRUCE_PASSTHROUGH_RAWBANKS_LINE_NAME = "SpruceMCPassThroughRawBanks" +MC_SPRUCE_PASSTHROUGH_PERSISTRECO_RAWBANKS_LINE_NAME = "SpruceMCPassThroughPersistRecoRawBanks" def make_hlt2_passthrough_line(name=MC_HLT2_PASSTHROUGH_LINE_NAME): + """Line to select all events in flagging mode. + """ + print(f"Adding {name} for simulation") + return Hlt2Line(name=name, algs=[], prescale=1) + + +def make_hlt2_passthrough_persistreco_line( + name=MC_HLT2_PASSTHROUGH_PERSISTRECO_LINE_NAME): + """Line to select all events in flagging mode. + + persistreco=True emulates Brunel. + + """ + print(f"Adding {name} for simulation") + return Hlt2Line(name=name, algs=[], prescale=1, persistreco=True) + + +def make_hlt2_passthrough_rawbanks_line( + name=MC_HLT2_PASSTHROUGH_RAWBANKS_LINE_NAME): + """Line to select all events in flagging mode. + + persistreco=True emulates Brunel. + + """ + print(f"Adding {name} for simulation") + return Hlt2Line(name=name, algs=[], prescale=1, raw_banks=DETECTORS) + + +def make_hlt2_passthrough_persistreco_rawbanks_line( + name=MC_HLT2_PASSTHROUGH_PERSISTRECO_RAWBANKS_LINE_NAME): """Line to select all events in flagging mode. persistreco=True emulates Brunel. """ - print(f"Adding {MC_HLT2_PASSTHROUGH_LINE_NAME} for simulation") + print(f"Adding {name} for simulation") return Hlt2Line( - name=MC_HLT2_PASSTHROUGH_LINE_NAME, - algs=[], - prescale=1, - persistreco=True) + name=name, algs=[], prescale=1, persistreco=True, raw_banks=DETECTORS) def make_spruce_passthrough_line(name=MC_SPRUCE_PASSTHROUGH_LINE_NAME): """Line to select all events in flagging mode. - persistreco=True emulates Brunel. + """ + print(f"Adding {name} for simulation") + return SpruceLine(name=name, algs=[], prescale=1) + + +def make_spruce_passthrough_persistreco_line( + name=MC_SPRUCE_PASSTHROUGH_PERSISTRECO_LINE_NAME): + """Line to select all events in flagging mode. + + """ + print(f"Adding {name} for simulation") + return SpruceLine(name=name, algs=[], prescale=1, persistreco=True) + + +def make_spruce_passthrough_rawbanks_line( + name=MC_SPRUCE_PASSTHROUGH_RAWBANKS_LINE_NAME): + """Line to select all events in flagging mode. + + """ + print(f"Adding {name} for simulation") + return SpruceLine(name=name, algs=[], prescale=1, raw_banks=DETECTORS) + + +def make_spruce_passthrough_persistreco_rawbanks_line( + name=MC_SPRUCE_PASSTHROUGH_PERSISTRECO_RAWBANKS_LINE_NAME): + """Line to select all events in flagging mode. """ - print(f"Adding {MC_SPRUCE_PASSTHROUGH_LINE_NAME} for simulation") + print(f"Adding {name} for simulation") return SpruceLine( - name=MC_SPRUCE_PASSTHROUGH_LINE_NAME, - algs=[], - prescale=1, - persistreco=True) + name=name, algs=[], prescale=1, persistreco=True, raw_banks=DETECTORS) diff --git a/Hlt/Moore/CMakeLists.txt b/Hlt/Moore/CMakeLists.txt index d1a9eae5d8e62d588c6c642b173d8d8f66450f12..4c168c40456b464aa32acada7d985a292f0917ae 100644 --- a/Hlt/Moore/CMakeLists.txt +++ b/Hlt/Moore/CMakeLists.txt @@ -27,6 +27,7 @@ if(NOT USE_DD4HEP) Moore.test_lbexec_hlt2_pp_2022_reprocessing_data Moore.test_lbexec_hlt2_pp_2022_reprocessing_data_check Moore.test_lbexec_hlt2_pp_2022_reprocessing_data_check_output + Moore.test_lbexec_spruce_pp_2024_noflagging_mc PROPERTY DISABLED TRUE ) diff --git a/Hlt/Moore/python/Moore/LbExec.py b/Hlt/Moore/python/Moore/LbExec.py index 24c76c3a0428c49e98744742e7b3d7d0bdf46bb9..398902584d317ed97e0490cd94292ecfc827c41d 100644 --- a/Hlt/Moore/python/Moore/LbExec.py +++ b/Hlt/Moore/python/Moore/LbExec.py @@ -12,7 +12,7 @@ from typing import Optional from contextlib import contextmanager from enum import Enum -from GaudiConf.LbExec import Options as DefaultOptions +from GaudiConf.LbExec import Options as DefaultOptions, TestOptionsBase from PyConf.application import ROOT_KEY from PyConf.packing import persistreco_version @@ -68,3 +68,8 @@ class Options(DefaultOptions): with super().apply_binds(): yield + + +class TestOptions(Options, TestOptionsBase): + """Specialized Options class for Moore Tests""" + pass diff --git a/Hlt/Moore/python/Moore/production.py b/Hlt/Moore/python/Moore/production.py index 073e5b30fcb22ffe0deb1736233a3e288b3ed9e0..3945a9059ae97d2bf9f8ccb1dbec86e43b2eeffb 100644 --- a/Hlt/Moore/python/Moore/production.py +++ b/Hlt/Moore/python/Moore/production.py @@ -44,6 +44,10 @@ def hlt2(options: Options, *raw_args): settings(default=None, will run all lines in one stream): to set the streams and reconstruction options flagging(default=False): to run MC in flagging mode require_deployed_trigger_key(default=False) + flagging(default=False): to run MC in flagging mode + persistreco(default=False): to run MC in persistreco mode (with flaggging only) + rawbanks(default=None): to run MC persisting rawbanks (with flaggging only) + reco_only(default=False): to run MC in reconstruction only mode (with flaggging only) line_regex(default=None): to select lines based on regex match velo_source(default="VPRetinaCluster"): Velo bank type, either VPRetinaCluster or VeloSP """ @@ -61,9 +65,18 @@ def hlt2(options: Options, *raw_args): from Hlt2Conf.settings.defaults import make_all_lines make_streams = make_all_lines - return _hlt2(options, make_streams, args.lines_regex, - args.require_deployed_trigger_key, args.flagging, - args.velo_source, args.without_ut) + return _hlt2( + options, + make_streams, + args.lines_regex, + args.require_deployed_trigger_key, + args.flagging, + args.persistreco, + args.rawbanks, + args.reco_only, + args.velo_source, + args.without_ut, + ) def _parse_args(raw_args): @@ -90,9 +103,28 @@ def _parse_args(raw_args): help="AllenSequence to import") parser.add_argument( - "--flagging", + "--flagging", action="store_true", help="Run MC in flagging mode") + + parser.add_argument( + "--persistreco", + action="store_true", + help= + "To save reconstruction of all events. Only to be used with --flagging" + ) + + parser.add_argument( + "--rawbanks", + action="store_true", + help= + "To keep all detector banks of all events. Only to be used with --flagging" + ) + + parser.add_argument( + "--reco-only", action="store_true", - help="Run MC is flagging mode or not") + help= + "To run only the reconstruction for all events. Only to be used with --flagging" + ) parser.add_argument( "--velo-source", default=None, help="Velo cluster type") @@ -110,6 +142,9 @@ def _hlt2(options, lines_regex, require_deployed_trigger_key=False, flagging=False, + persistreco=False, + rawbanks=False, + reco_only=False, velo_source=None, without_ut=False): from Moore import run_moore @@ -143,7 +178,14 @@ def _hlt2(options, def _my_line_maker(): return _line_maker( - options, make_lines, lines_regex, flagging, process="Hlt2") + options, + make_lines, + lines_regex, + flagging, + persistreco, + rawbanks, + reco_only, + process="Hlt2") with reconstruction.bind(from_file=False), _apply_track_binds(): config = run_moore(options, _my_line_maker, public_tools) @@ -181,6 +223,9 @@ def _line_maker(options, make_lines, lines_regex, flagging=False, + persistreco=False, + rawbanks=None, + reco_only=False, process="Hlt2"): streams = make_lines() @@ -202,15 +247,37 @@ def _line_maker(options, if options.simulation: streams = _flatten_and_deduplicate_lines(streams) if flagging: - from Hlt2Conf.lines.mc.mc_lines import ( - make_hlt2_passthrough_line as make_passthrough_line, - make_spruce_passthrough_line as make_spruce_passthrough_line, - ) - if process == "Hlt2": - streams += [make_lines(make_passthrough_line)] + if persistreco and rawbanks: + from Hlt2Conf.lines.mc.mc_lines import make_hlt2_passthrough_persistreco_rawbanks_line as hlt2passline + from Hlt2Conf.lines.mc.mc_lines import make_spruce_passthrough_persistreco_rawbanks_line as sprucepassline + elif persistreco: + from Hlt2Conf.lines.mc.mc_lines import make_hlt2_passthrough_persistreco_line as hlt2passline + from Hlt2Conf.lines.mc.mc_lines import make_spruce_passthrough_persistreco_line as sprucepassline + elif rawbanks: + from Hlt2Conf.lines.mc.mc_lines import make_hlt2_passthrough_rawbanks_line as hlt2passline + from Hlt2Conf.lines.mc.mc_lines import make_spruce_passthrough_rawbanks_line as sprucepassline + else: + from Hlt2Conf.lines.mc.mc_lines import make_hlt2_passthrough_line as hlt2passline + from Hlt2Conf.lines.mc.mc_lines import make_spruce_passthrough_line as sprucepassline + + if process == "Spruce": + streams += [sprucepassline()] else: - streams += [make_spruce_passthrough_line()] + if not reco_only: + streams += [make_lines(hlt2passline)] + else: + if reco_only and not persistreco: + raise ConfigurationError( + "You have requested reco_only but not persistreco. This will not give you what you want" + ) + + streams = [make_lines(hlt2passline)] + + if (persistreco or rawbanks or reco_only) and not flagging: + raise ConfigurationError( + "You have requested to use persistreco and/or rawbanks and/or reco_only but you are not running in flagging mode" + ) if isinstance(streams, list): streams = make_default_streams(streams) @@ -238,6 +305,9 @@ def spruce(options: Options, *raw_args): flagging(default=False): to run MC in flagging mode require_deployed_trigger_key(default=False) line_regex(default=None): to select lines based on regex match + persistreco(default=False): to run MC in persistreco mode (with flaggging only) + rawbanks(default=None): to run MC persisting rawbanks (with flaggging only) + reco_only(default=False): to run MC in reconstruction only mode (with flaggging onl """ args = _parse_args(raw_args) @@ -282,7 +352,8 @@ def spruce(options: Options, *raw_args): return _spruce(options, make_streams, full_lines_for_TISTOS, args.lines_regex, args.require_deployed_trigger_key, - args.flagging) + args.flagging, args.persistreco, args.rawbanks, + args.reco_only) def _spruce(options, @@ -290,7 +361,10 @@ def _spruce(options, full_hlt2_lines, lines_regex, require_deployed_trigger_key=False, - flagging=False): + flagging=False, + persistreco=False, + rawbanks=None, + reco_only=False): from Moore import run_moore, moore_control_flow from PyConf.application import metainfo_repos, retrieve_encoding_dictionary @@ -311,13 +385,18 @@ def _spruce(options, def _my_line_maker(): return _line_maker( - options, make_lines, lines_regex, flagging, process="Spruce") + options, + make_lines, + lines_regex, + flagging, + persistreco, + rawbanks, + reco_only, + process="Spruce") if options.simulation: - config = configure_input(options) ## Implement a filter such that exclusive Sprucing only runs on FULL stream HLT2 lines - ## Add this filter before `moore_control_node` using `LAZY_AND` logic line_regex = "|".join( line for line in [line + "Decision" for line in full_hlt2_lines]) @@ -337,12 +416,15 @@ def _spruce(options, moore_control_node = moore_control_flow( options, _my_line_maker(), process="spruce") - moore_control_node = CompositeNode( + ## Add this filter before `moore_control_node` using `LAZY_AND` logic IF flagging + moore_withfilter_node = CompositeNode( 'MC_spruce_control_node', combine_logic=NodeLogic.LAZY_AND, children=[full_stream_filter] + [moore_control_node], force_order=True) + if not flagging: + moore_control_node = moore_withfilter_node config.update( configure( options, moore_control_node, public_tools=public_tools)) diff --git a/Hlt/Moore/tests/qmtest/test_lbexec_hlt2.qmt b/Hlt/Moore/tests/qmtest/test_lbexec_hlt2.qmt index d9d65caa4508dd3f34aea8f84715fe43309bf994..a48e07de241e7c17354ff3b33c70819467997d1e 100644 --- a/Hlt/Moore/tests/qmtest/test_lbexec_hlt2.qmt +++ b/Hlt/Moore/tests/qmtest/test_lbexec_hlt2.qmt @@ -19,6 +19,7 @@ Test that HLT2 can run from LHCbDirac and that it produces the expected outputs <argument name="program"><text>lbexec</text></argument> <argument name="timeout"><integer>1800</integer></argument> <argument name="args"><set> + <text>--override-option-class=Moore.LbExec:TestOptions</text> <text>Moore.production:hlt2</text> <text>$HLT2CONFROOT/options/hlt2_production_options_2024_hlt1_filtered.yaml</text> <text>--</text> diff --git a/Hlt/Moore/tests/qmtest/test_lbexec_hlt2_pp_2024_mc.qmt b/Hlt/Moore/tests/qmtest/test_lbexec_hlt2_pp_2024_flagging_mc.qmt similarity index 83% rename from Hlt/Moore/tests/qmtest/test_lbexec_hlt2_pp_2024_mc.qmt rename to Hlt/Moore/tests/qmtest/test_lbexec_hlt2_pp_2024_flagging_mc.qmt index ebce02b04ae70e8ac669b8158668397e797902af..332dec0344afb4947ff0e27cf57b3599aa3577a8 100644 --- a/Hlt/Moore/tests/qmtest/test_lbexec_hlt2_pp_2024_mc.qmt +++ b/Hlt/Moore/tests/qmtest/test_lbexec_hlt2_pp_2024_flagging_mc.qmt @@ -10,7 +10,7 @@ or submit itself to any jurisdiction. --> <!-- -Test that HLT2 can run from LHCbDirac and that it produces the expected outputs +Test that HLT2 can run from LHCbDirac and that it produces the expected outputs for flagging mode --> <extension class="GaudiTest.GaudiExeTest" kind="test"> <argument name="prerequisites"><set> @@ -20,18 +20,20 @@ Test that HLT2 can run from LHCbDirac and that it produces the expected outputs <argument name="timeout"><integer>1000</integer></argument> <argument name="args"><set> <text>Moore.production:hlt2</text> - <text>$HLT2CONFROOT/options/hlt2_pp_2024_production_options.yaml</text> + <text>$HLT2CONFROOT/options/hlt2_pp_2024_flagging_mc.yaml</text> <text>--</text> <text>--settings=hlt2_pp_2024</text> <text>--flagging</text> </set></argument> <argument name="use_temp_dir"><enumeral>true</enumeral></argument> <argument name="validator"><text> +findReferenceBlock("""Adding Hlt2MCPassThrough for simulation""") from Moore.qmtest.exclusions import remove_known_warnings countErrorLines({"FATAL": 0, "ERROR": 0, "WARNING": 0}, stdout=remove_known_warnings(stdout)) + import xml.etree.ElementTree as ET from pathlib import Path @@ -40,13 +42,13 @@ tree = ET.parse(Path.cwd() / "hlt2_pp_2024_summary.xml") out_files = tree.findall("./output/file") assert len(out_files) == 1, out_files out_file = out_files[0] -assert int(out_file.text) > 0, "at least one event should be selected" -assert int(out_file.text) < 30, "at least one event should be rejected" -assert out_file.attrib["name"] == "PFN:hlt2_pp_2024_output.dst" +print(f"sizes : {int(out_file.text)}") +assert int(out_file.text) == 20, "flagged jobs should keep all events" +assert out_file.attrib["name"] == "PFN:hlt2_pp_2024_flagging_mc.dst" # Ensure the pool XML was updated to contain the new output file tree = ET.parse(Path.cwd() / "hlt1_pool_xml_catalog.xml") -catalog_output = tree.findall(f'./File/physical/pfn[@name="hlt2_pp_2024_output.dst"]') +catalog_output = tree.findall(f'./File/physical/pfn[@name="hlt2_pp_2024_flagging_mc.dst"]') assert len(catalog_output) == 1, catalog_output </text></argument> diff --git a/Hlt/Moore/tests/qmtest/test_lbexec_hlt2_pp_2024_noflagging_mc.qmt b/Hlt/Moore/tests/qmtest/test_lbexec_hlt2_pp_2024_noflagging_mc.qmt new file mode 100644 index 0000000000000000000000000000000000000000..910697dda0d8e0896db55283a5896ccdf14a7ac9 --- /dev/null +++ b/Hlt/Moore/tests/qmtest/test_lbexec_hlt2_pp_2024_noflagging_mc.qmt @@ -0,0 +1,39 @@ +<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE extension PUBLIC '-//QM/2.3/Extension//EN' 'http://www.codesourcery.com/qm/dtds/2.3/-//qm/2.3/extension//en.dtd'> +<!-- + (c) Copyright 2024 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. +--> +<!-- +Test that HLT2 can run from LHCbDirac and that it produces the expected outputs for non flagging mode +--> + +<extension class="GaudiTest.GaudiExeTest" kind="test"> +<argument name="prerequisites"><set> + <tuple><text>test_lbexec_allen_hlt1_pp_mc_2024</text><enumeral>PASS</enumeral></tuple> +</set></argument> +<argument name="program"><text>lbexec</text></argument> +<argument name="timeout"><integer>1000</integer></argument> +<argument name="args"><set> + <text>Moore.production:hlt2</text> + <text>$HLT2CONFROOT/options/hlt2_pp_2024_noflagging_mc.yaml</text> + <text>--</text> + <text>--settings=hlt2_pp_2024</text> +</set></argument> +<argument name="use_temp_dir"><enumeral>true</enumeral></argument> +<argument name="validator"><text> + +findReferenceBlock("""# WARNING: Unsupported type <class 'PrFilters.PrFiltersConf.PrFilter__PV'> for line output PrFilter__PV/PrFilter__PV_6a9ee3b3 for line ('Hlt2IFTFull_SMOG2Passthrough_PV_in_SMOG2',); this will not be persisted. Only Particles are persisted as line outputs. +ApplicationMgr SUCCESS""") + +from Moore.qmtest.exclusions import remove_known_warnings +countErrorLines({"FATAL": 0, "ERROR": 0, "WARNING": 0}, + stdout=remove_known_warnings(stdout)) + +</text></argument> +</extension> diff --git a/Hlt/Moore/tests/qmtest/test_lbexec_hlt2_pp_flagging_persistreco_mc.qmt b/Hlt/Moore/tests/qmtest/test_lbexec_hlt2_pp_flagging_persistreco_mc.qmt new file mode 100644 index 0000000000000000000000000000000000000000..f420c0a41c340b67245560f999cbb93e26d9e428 --- /dev/null +++ b/Hlt/Moore/tests/qmtest/test_lbexec_hlt2_pp_flagging_persistreco_mc.qmt @@ -0,0 +1,44 @@ +<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE extension PUBLIC '-//QM/2.3/Extension//EN' 'http://www.codesourcery.com/qm/dtds/2.3/-//qm/2.3/extension//en.dtd'> +<!-- + (c) Copyright 2024 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. +--> +<!-- +Test that HLT2 can run from LHCbDirac and that it produces the expected outputs for flagging and persistreco mode +--> +<extension class="GaudiTest.GaudiExeTest" kind="test"> +<argument name="prerequisites"><set> + <tuple><text>test_prepare_lbexec_hlt</text><enumeral>PASS</enumeral></tuple> +</set></argument> +<argument name="program"><text>lbexec</text></argument> +<argument name="timeout"><integer>1800</integer></argument> +<argument name="args"><set> + <text>Moore.production:hlt2</text> + <text>--export</text> + <text>job_opts</text> + <text>$HLT2CONFROOT/options/hlt2_pp_2024_flagging_persistreco_mc.yaml</text> + <text>--</text> + <text>--flagging</text> + <text>--persistreco</text> +</set></argument> +<argument name="use_temp_dir"><enumeral>true</enumeral></argument> +<argument name="validator"><text> + +findReferenceBlock(""" + LAZY_AND: Hlt2MCPassThroughPersistRecoDecisionWithOutput #=20 Sum=20 Eff=|( 100.0000 +- 0.00000 )%| + LAZY_AND: Hlt2MCPassThroughPersistReco #=20 Sum=20 Eff=|( 100.0000 +- 0.00000 )%| + DeterministicPrescaler/Hlt2MCPassThroughPersistReco_Prescaler #=20 Sum=20 Eff=|( 100.0000 +- 0.00000 )%| +""") + +from Moore.qmtest.exclusions import remove_known_warnings +countErrorLines({"FATAL": 0, "ERROR": 0, "WARNING": 0}, + stdout=remove_known_warnings(stdout)) + +</text></argument> +</extension> diff --git a/Hlt/Moore/tests/qmtest/test_lbexec_hlt2_pp_flagging_reco_only_mc.qmt b/Hlt/Moore/tests/qmtest/test_lbexec_hlt2_pp_flagging_reco_only_mc.qmt new file mode 100644 index 0000000000000000000000000000000000000000..b10ae616eff4b396673a917d9fa7a95d8e4bbf4f --- /dev/null +++ b/Hlt/Moore/tests/qmtest/test_lbexec_hlt2_pp_flagging_reco_only_mc.qmt @@ -0,0 +1,52 @@ +<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE extension PUBLIC '-//QM/2.3/Extension//EN' 'http://www.codesourcery.com/qm/dtds/2.3/-//qm/2.3/extension//en.dtd'> +<!-- + (c) Copyright 2024 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. + + if '.ModifyLocations = ' in result['job_opts_dump']: + causes.append("Found configured DVCommonBase algorithm in job_opts_dump") + https://gitlab.cern.ch/lhcb/LHCb/-/blob/master/Kernel/LHCbAlgs/tests/qmtest/lhcbalgs.qms/error_stream.qmt#L23 + +--> +<!-- +Test that HLT2 can run from LHCbDirac and that it produces the expected outputs for flagging, persistreco and reco_only mode +--> +<extension class="GaudiTest.GaudiExeTest" kind="test"> +<argument name="prerequisites"><set> + <tuple><text>test_prepare_lbexec_hlt</text><enumeral>PASS</enumeral></tuple> +</set></argument> +<argument name="program"><text>lbexec</text></argument> +<argument name="timeout"><integer>1800</integer></argument> +<argument name="args"><set> + <text>Moore.production:hlt2</text> + <text>$HLT2CONFROOT/options/hlt2_pp_2024_flagging_reco_only_mc.yaml</text> + <text>--</text> + <text>--flagging</text> + <text>--reco-only</text> + <text>--persistreco</text> +</set></argument> +<argument name="use_temp_dir"><enumeral>true</enumeral></argument> +<argument name="validator"><text> + +findReferenceBlock(""" +HLTControlFlowMgr INFO StateTree: CFNode #executed #passed +LAZY_AND: moore #=20 Sum=20 Eff=|( 100.0000 +- 0.00000 )%| + NONLAZY_OR: lines #=20 Sum=20 Eff=|( 100.0000 +- 0.00000 )%| + NONLAZY_OR: hlt_decision #=20 Sum=20 Eff=|( 100.0000 +- 0.00000 )%| + LAZY_AND: Hlt2MCPassThroughPersistRecoDecisionWithOutput #=20 Sum=20 Eff=|( 100.0000 +- 0.00000 )%| + LAZY_AND: Hlt2MCPassThroughPersistReco #=20 Sum=20 Eff=|( 100.0000 +- 0.00000 )%| +""") + +from Moore.qmtest.exclusions import remove_known_warnings +countErrorLines({"FATAL": 0, "ERROR": 0, "WARNING": 0}, + stdout=remove_known_warnings(stdout)) + + +</text></argument> +</extension> diff --git a/Hlt/Moore/tests/qmtest/test_lbexec_hlt2_pp_flagging_reco_only_rawbanks_mc.qmt b/Hlt/Moore/tests/qmtest/test_lbexec_hlt2_pp_flagging_reco_only_rawbanks_mc.qmt new file mode 100644 index 0000000000000000000000000000000000000000..f0d21a3dd51599b55f34e7436c9f831aec6507c6 --- /dev/null +++ b/Hlt/Moore/tests/qmtest/test_lbexec_hlt2_pp_flagging_reco_only_rawbanks_mc.qmt @@ -0,0 +1,45 @@ +<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE extension PUBLIC '-//QM/2.3/Extension//EN' 'http://www.codesourcery.com/qm/dtds/2.3/-//qm/2.3/extension//en.dtd'> +<!-- + (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. + + if '.ModifyLocations = ' in result['job_opts_dump']: + causes.append("Found configured DVCommonBase algorithm in job_opts_dump") + https://gitlab.cern.ch/lhcb/LHCb/-/blob/master/Kernel/LHCbAlgs/tests/qmtest/lhcbalgs.qms/error_stream.qmt#L23 + +--> +<!-- +Test that HLT2 can run from LHCbDirac and that it produces the expected outputs for flagging, persistreco, reco_only and rawbanks mode +--> +<extension class="GaudiTest.GaudiExeTest" kind="test"> +<argument name="prerequisites"><set> + <tuple><text>test_prepare_lbexec_hlt</text><enumeral>PASS</enumeral></tuple> +</set></argument> +<argument name="program"><text>lbexec</text></argument> +<argument name="timeout"><integer>1800</integer></argument> +<argument name="args"><set> + <text>Moore.production:hlt2</text> + <text>--dry-run</text> + <text>$HLT2CONFROOT/options/hlt2_pp_2024_flagging_reco_only_mc.yaml</text> + <text>--</text> + <text>--flagging</text> + <text>--reco-only</text> + <text>--persistreco</text> + <text>--rawbanks</text> +</set></argument> +<argument name="use_temp_dir"><enumeral>true</enumeral></argument> +<argument name="validator"><text> + + +from Moore.qmtest.exclusions import remove_known_warnings +countErrorLines({"FATAL": 0, "ERROR": 0, "WARNING": 0}, + stdout=remove_known_warnings(stdout)) + +</text></argument> +</extension> diff --git a/Hlt/Moore/tests/qmtest/test_lbexec_spruce_pp_default_mc.qmt b/Hlt/Moore/tests/qmtest/test_lbexec_hlt2_pp_mc.qmt similarity index 67% rename from Hlt/Moore/tests/qmtest/test_lbexec_spruce_pp_default_mc.qmt rename to Hlt/Moore/tests/qmtest/test_lbexec_hlt2_pp_mc.qmt index 4294578beb7df3da460b89fae65954a6ab3af2ce..826e399ac095d4fbd65c3c38460737a549f135f8 100644 --- a/Hlt/Moore/tests/qmtest/test_lbexec_spruce_pp_default_mc.qmt +++ b/Hlt/Moore/tests/qmtest/test_lbexec_hlt2_pp_mc.qmt @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?><!DOCTYPE extension PUBLIC '-//QM/2.3/Extension//EN' 'http://www.codesourcery.com/qm/dtds/2.3/-//qm/2.3/extension//en.dtd'> <!-- - (c) Copyright 2024 CERN for the benefit of the LHCb Collaboration + (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". @@ -8,23 +8,21 @@ 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. - - Test that Spruce can run from LHCbDirac and that it produces the expected outputs. Dry-run only! --> - - +<!-- +Test that HLT2 can run from LHCbDirac and that it produces the expected outputs for default (mDST) +--> <extension class="GaudiTest.GaudiExeTest" kind="test"> <argument name="prerequisites"><set> - <tuple><text>test_lbexec_hlt2_pp_2024_mc</text><enumeral>PASS</enumeral></tuple> + <tuple><text>test_prepare_lbexec_hlt</text><enumeral>PASS</enumeral></tuple> </set></argument> <argument name="program"><text>lbexec</text></argument> -<argument name="timeout"><integer>1000</integer></argument> +<argument name="timeout"><integer>1800</integer></argument> <argument name="args"><set> - <text>Moore.production:spruce</text> - <text>--dry-run</text> - <text>$HLT2CONFROOT/options/spruce_pp_2024_production_options.yaml</text> - <text>--</text> - <text>--flagging</text> + <text>--override-option-class=Moore.LbExec:TestOptions</text> + <text>Moore.production:hlt2</text> + <text>$HLT2CONFROOT/options/hlt2_production_options_2024_hlt1_filtered.yaml</text> + <text>--</text> </set></argument> <argument name="use_temp_dir"><enumeral>true</enumeral></argument> <argument name="validator"><text> diff --git a/Hlt/Moore/tests/qmtest/test_lbexec_hlt2_pp_no_ut_2024_mc.qmt b/Hlt/Moore/tests/qmtest/test_lbexec_hlt2_pp_no_ut_2024_flagging_mc.qmt similarity index 100% rename from Hlt/Moore/tests/qmtest/test_lbexec_hlt2_pp_no_ut_2024_mc.qmt rename to Hlt/Moore/tests/qmtest/test_lbexec_hlt2_pp_no_ut_2024_flagging_mc.qmt diff --git a/Hlt/Moore/tests/qmtest/test_lbexec_spruce_pp_2024_mc.qmt b/Hlt/Moore/tests/qmtest/test_lbexec_spruce_pp_2024_flagging_mc.qmt similarity index 60% rename from Hlt/Moore/tests/qmtest/test_lbexec_spruce_pp_2024_mc.qmt rename to Hlt/Moore/tests/qmtest/test_lbexec_spruce_pp_2024_flagging_mc.qmt index 7c7ead5c60c19750c06f84e9c77639c830d87bba..ca0672517af96b9731cdb6adf5008ffbf6d169e9 100644 --- a/Hlt/Moore/tests/qmtest/test_lbexec_spruce_pp_2024_mc.qmt +++ b/Hlt/Moore/tests/qmtest/test_lbexec_spruce_pp_2024_flagging_mc.qmt @@ -10,17 +10,17 @@ or submit itself to any jurisdiction. --> <!-- -Test that Spruce can run from LHCbDirac and that it produces the expected outputs +Test that Spruce can run from LHCbDirac and that it produces the expected outputs in flagging mode --> <extension class="GaudiTest.GaudiExeTest" kind="test"> <argument name="prerequisites"><set> - <tuple><text>test_lbexec_hlt2_pp_2024_mc</text><enumeral>PASS</enumeral></tuple> + <tuple><text>test_lbexec_hlt2_pp_2024_flagging_mc</text><enumeral>PASS</enumeral></tuple> </set></argument> <argument name="program"><text>lbexec</text></argument> <argument name="timeout"><integer>1000</integer></argument> <argument name="args"><set> <text>Moore.production:spruce</text> - <text>$HLT2CONFROOT/options/spruce_pp_2024_production_options.yaml</text> + <text>$HLT2CONFROOT/options/spruce_pp_2024_flagging_mc.yaml</text> <text>--</text> <text>--settings=Sprucing_production_physics_pp_Collision24c2</text> <text>--flagging</text> @@ -32,6 +32,17 @@ from Moore.qmtest.exclusions import remove_known_warnings countErrorLines({"FATAL": 0, "ERROR": 0, "WARNING": 0}, stdout=remove_known_warnings(stdout)) + +findReferenceBlock(""" +HLTControlFlowMgr INFO StateTree: CFNode #executed #passed +LAZY_AND: moore #=20 Sum=20 Eff=|( 100.0000 +- 0.00000 )%| + NONLAZY_OR: lines #=20 Sum=20 Eff=|( 100.0000 +- 0.00000 )%| + NONLAZY_OR: hlt_decision #=20 Sum=20 Eff=|( 100.0000 +- 0.00000 )%| + LAZY_AND: SpruceB2CC_BsToJpsiKstarWideDecisionWithOutput #=20 Sum=0 Eff=|( 0.000000 +- 0.00000 )%| + LAZY_AND: SpruceB2CC_BsToJpsiKstarWide #=20 Sum=0 Eff=|( 0.000000 +- 0.00000 )%| + """) + + import xml.etree.ElementTree as ET from pathlib import Path @@ -44,12 +55,12 @@ assert len(out_files) == 1, out_files in_file = in_files[0] out_file = out_files[0] print(f"sizes : {int(in_file.text)}, {int(out_file.text)}") -assert 0.5*int(in_file.text) <= int(out_file.text), "Would expect at least half events retained from HLT2 step (given total event share of FULL stream lines)" -assert out_file.attrib["name"] == "PFN:spruce_pp_2024_output.dst" +assert int(in_file.text) == int(out_file.text), "Should retain all events" +assert out_file.attrib["name"] == "PFN:spruce_pp_2024_flagging_mc.dst" # Ensure the pool XML was updated to contain the new output file tree = ET.parse(Path.cwd() / "hlt2_pool_xml_catalog.xml") -catalog_output = tree.findall(f'./File/physical/pfn[@name="spruce_pp_2024_output.dst"]') +catalog_output = tree.findall(f'./File/physical/pfn[@name="spruce_pp_2024_flagging_mc.dst"]') assert len(catalog_output) == 1, catalog_output </text></argument> diff --git a/Hlt/Moore/tests/qmtest/test_lbexec_spruce_pp_2024_noflagging_mc.qmt b/Hlt/Moore/tests/qmtest/test_lbexec_spruce_pp_2024_noflagging_mc.qmt new file mode 100644 index 0000000000000000000000000000000000000000..190aa6bfe4dafe6153e94d50cd824da4019f5aac --- /dev/null +++ b/Hlt/Moore/tests/qmtest/test_lbexec_spruce_pp_2024_noflagging_mc.qmt @@ -0,0 +1,46 @@ +<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE extension PUBLIC '-//QM/2.3/Extension//EN' 'http://www.codesourcery.com/qm/dtds/2.3/-//qm/2.3/extension//en.dtd'> +<!-- + (c) Copyright 2024 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. +--> +<!-- +Test that Spruce can run from LHCbDirac and that it produces the expected outputs in non flagging mode +--> +<extension class="GaudiTest.GaudiExeTest" kind="test"> +<argument name="prerequisites"><set> + <tuple><text>test_lbexec_hlt2_pp_2024_noflagging_mc</text><enumeral>PASS</enumeral></tuple> +</set></argument> +<argument name="program"><text>lbexec</text></argument> +<argument name="timeout"><integer>1000</integer></argument> +<argument name="args"><set> + <text>Moore.production:spruce</text> + <text>$HLT2CONFROOT/options/spruce_pp_2024_noflagging_mc.yaml</text> + <text>--</text> + <text>--settings=Sprucing_production_physics_pp_Collision24c2</text> +</set></argument> +<argument name="use_temp_dir"><enumeral>true</enumeral></argument> +<argument name="validator"><text> + +findReferenceBlock(""" +HLTControlFlowMgr INFO StateTree: CFNode #executed #passed +LAZY_AND: MC_spruce_control_node #=20 Sum=1 Eff=|( 5.000000 +- 4.87340 )%| + VoidFilter/full_stream_filter #=20 Sum=10 Eff=|( 50.00000 +- 11.1803 )%| + LAZY_AND: moore #=10 Sum=1 Eff=|( 10.00000 +- 9.48683 )%| + NONLAZY_OR: lines #=10 Sum=1 Eff=|( 10.00000 +- 9.48683 )%| + NONLAZY_OR: hlt_decision #=10 Sum=1 Eff=|( 10.00000 +- 9.48683 )%| +""") + +from Moore.qmtest.exclusions import remove_known_warnings +countErrorLines({"FATAL": 0, "ERROR": 0, "WARNING": 0}, + stdout=remove_known_warnings(stdout)) + + + +</text></argument> +</extension> diff --git a/Hlt/Moore/tests/qmtest/test_lbexec_spruce_pp_default_flagging_persistreco_mc.qmt b/Hlt/Moore/tests/qmtest/test_lbexec_spruce_pp_default_flagging_persistreco_mc.qmt new file mode 100644 index 0000000000000000000000000000000000000000..a433bc5fafc29c6d03946f467416c85c731c2c80 --- /dev/null +++ b/Hlt/Moore/tests/qmtest/test_lbexec_spruce_pp_default_flagging_persistreco_mc.qmt @@ -0,0 +1,45 @@ +<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE extension PUBLIC '-//QM/2.3/Extension//EN' 'http://www.codesourcery.com/qm/dtds/2.3/-//qm/2.3/extension//en.dtd'> +<!-- + (c) Copyright 2024 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. + + Test that Spruce can run from LHCbDirac and that it produces the expected outputs in flagging and persistreco modes +--> + + + +<extension class="GaudiTest.GaudiExeTest" kind="test"> +<argument name="prerequisites"><set> + <tuple><text>test_lbexec_hlt2_pp_flagging_persistreco_mc</text><enumeral>PASS</enumeral></tuple> +</set></argument> +<argument name="program"><text>lbexec</text></argument> +<argument name="timeout"><integer>1000</integer></argument> +<argument name="args"><set> + <text>Moore.production:spruce</text> + <text>$HLT2CONFROOT/options/spruce_pp_2024_flagging_persistreco_mc.yaml</text> + <text>--</text> + <text>--flagging</text> + <text>--persistreco</text> +</set></argument> +<argument name="use_temp_dir"><enumeral>true</enumeral></argument> +<argument name="validator"><text> + +findReferenceBlock(""" LAZY_AND: SpruceMCPassThroughPersistRecoDecisionWithOutput #=20 Sum=20 Eff=|( 100.0000 +- 0.00000 )%| + LAZY_AND: SpruceMCPassThroughPersistReco #=20 Sum=20 Eff=|( 100.0000 +- 0.00000 )%| + DeterministicPrescaler/SpruceMCPassThroughPersistReco_Prescaler #=20 Sum=20 Eff=|( 100.0000 +- 0.00000 )%| +""") + +from Moore.qmtest.exclusions import remove_known_warnings +countErrorLines({"FATAL": 0, "ERROR": 0, "WARNING": 0}, + stdout=remove_known_warnings(stdout)) + + + +</text></argument> +</extension>