diff --git a/DaVinciExamples/example_data/Gauss_12143001_xgen.yaml b/DaVinciExamples/example_data/Gauss_12143001_xgen.yaml index 629b52d6835dec01e1642ebf90a258600715f0f9..f96920c6a94eec9bc6d95dad85a9f0a4712b65c6 100644 --- a/DaVinciExamples/example_data/Gauss_12143001_xgen.yaml +++ b/DaVinciExamples/example_data/Gauss_12143001_xgen.yaml @@ -10,4 +10,4 @@ geometry_version: trunk histo_file: DV_histo_xgen.root ntuple_file: DV_tuple_xgen.root input_raw_format: 0.5 -input_process: Hlt2 +input_process: Gen diff --git a/DaVinciExamples/example_data/Upgrade_Bd2KstarMuMu_ldst.yaml b/DaVinciExamples/example_data/Upgrade_Bd2KstarMuMu_ldst.yaml index bea19fa54f7ab89b5dcbaced7a7de6110e6168a0..f4038399e6739b288f86175ec4a9370e16d9ac33 100644 --- a/DaVinciExamples/example_data/Upgrade_Bd2KstarMuMu_ldst.yaml +++ b/DaVinciExamples/example_data/Upgrade_Bd2KstarMuMu_ldst.yaml @@ -7,4 +7,4 @@ conddb_tag: sim-20171127-vc-md100 dddb_tag: dddb-20171126 conditions_version: master geometry_version: trunk -input_process: Hlt2 +input_process: Brunel diff --git a/DaVinciExamples/example_data/Upgrade_genFSR_ldst.yaml b/DaVinciExamples/example_data/Upgrade_genFSR_ldst.yaml index d97993e91e06e4f18f53aef0e90af43b1e064239..c42b4cb1cff18d8579af99c0a9e85dc2fdda5634 100644 --- a/DaVinciExamples/example_data/Upgrade_genFSR_ldst.yaml +++ b/DaVinciExamples/example_data/Upgrade_genFSR_ldst.yaml @@ -4,4 +4,4 @@ input_type: ROOT simulation: true conddb_tag: sim-20171127-vc-md100 dddb_tag: dddb-20171126 -input_process: Turbo +input_process: Brunel diff --git a/DaVinciExamples/example_data/test_read_xgen.yaml b/DaVinciExamples/example_data/test_read_xgen.yaml index e11bf706103ade82c4f9421999c307bb73d1c462..5394492d1a0782073d9f49a7155f1c9983b24b1f 100644 --- a/DaVinciExamples/example_data/test_read_xgen.yaml +++ b/DaVinciExamples/example_data/test_read_xgen.yaml @@ -5,4 +5,4 @@ input_type: ROOT simulation: true conddb_tag: sim-20171127-vc-md100 dddb_tag: dddb-20171126 -input_process: Turbo +input_process: Gen diff --git a/DaVinciExamples/tests/qmtest/tupling.qms/test_example-tupling-basic-run-mc.qmt b/DaVinciExamples/tests/qmtest/tupling.qms/test_example-tupling-basic-run-mc.qmt index 22b15a94f0cb3bfb8aa17455732f81681ae129e0..cfc4f6507d73711fde89cb018450739051759535 100755 --- a/DaVinciExamples/tests/qmtest/tupling.qms/test_example-tupling-basic-run-mc.qmt +++ b/DaVinciExamples/tests/qmtest/tupling.qms/test_example-tupling-basic-run-mc.qmt @@ -23,7 +23,7 @@ histo_file: DV-example-tupling-basic-his-run-mc.root input_raw_format: 4.3 ntuple_file: DV-example-tupling-basic-ntp-run-mc.root - input_process: Hlt2 + input_process: Brunel </text></argument> <argument name="reference"><text>../refs/test_davinci_tupling-basic-run-mc.ref</text></argument> <argument name="error_reference"><text>../refs/empty.ref</text></argument> diff --git a/DaVinciExamples/tests/qmtest/tupling.qms/test_example-tupling-basic.qmt b/DaVinciExamples/tests/qmtest/tupling.qms/test_example-tupling-basic.qmt index 29a0a30feb08efdc61b77941ba39fdeb815700a5..798ce182213f38db2544a6c798b38dadfd5f506e 100644 --- a/DaVinciExamples/tests/qmtest/tupling.qms/test_example-tupling-basic.qmt +++ b/DaVinciExamples/tests/qmtest/tupling.qms/test_example-tupling-basic.qmt @@ -23,7 +23,7 @@ histo_file: DV-example-tupling-basic-his.root evt_max: 10 input_raw_format: 4.3 - input_process: Hlt2 + input_process: Brunel </text></argument> <argument name="timeout"><integer>3600</integer></argument> <argument name="validator"><text> diff --git a/DaVinciTests/tests/qmtest/davinci.qms/configure_dst_py-opts.qmt b/DaVinciTests/tests/qmtest/davinci.qms/configure_dst_py-opts.qmt index a3eb39287813f3c38ac751fb1d060065a0ca5918..c1d471bf5655aba2a632f632058d6588a2a34283 100644 --- a/DaVinciTests/tests/qmtest/davinci.qms/configure_dst_py-opts.qmt +++ b/DaVinciTests/tests/qmtest/davinci.qms/configure_dst_py-opts.qmt @@ -21,7 +21,7 @@ ntuple_file: DV-Ntuple.root histo_file: DV-Histos.root lumi: False - input_process: Turbo + input_process: Brunel </text></argument> <argument name="use_temp_dir"><enumeral>true</enumeral></argument> <argument name="validator"><text> diff --git a/DaVinciTests/tests/qmtest/davinci.qms/configure_dst_yaml-opts.qmt b/DaVinciTests/tests/qmtest/davinci.qms/configure_dst_yaml-opts.qmt index 343f5061af976da136683054db9a4dbc185fc687..5d82a8adc40739e8cafe1f51de853408822e90db 100644 --- a/DaVinciTests/tests/qmtest/davinci.qms/configure_dst_yaml-opts.qmt +++ b/DaVinciTests/tests/qmtest/davinci.qms/configure_dst_yaml-opts.qmt @@ -21,7 +21,7 @@ ntuple_file: DV-Ntuple.root histo_file: DV-Histos.root lumi: False - input_process: Turbo + input_process: Brunel evt_max: 10 </text></argument> <argument name="use_temp_dir"><enumeral>true</enumeral></argument> diff --git a/DaVinciTests/tests/qmtest/davinci.qms/test_DTF.qmt b/DaVinciTests/tests/qmtest/davinci.qms/test_DTF.qmt index af1c59196005fcab12637440826b8e9e2b8fc141..a4015837999661b1f68215cb0072f5bfe31edfe9 100755 --- a/DaVinciTests/tests/qmtest/davinci.qms/test_DTF.qmt +++ b/DaVinciTests/tests/qmtest/davinci.qms/test_DTF.qmt @@ -29,7 +29,7 @@ See https://gitlab.cern.ch/lhcb/Rec/-/issues/408 histo_file: DV-example-tupling-DTF-his.root input_raw_format: 4.3 ntuple_file: DV-example-tupling-DTF-ntp.root - input_process: Hlt2 + input_process: Brunel </text></argument> <argument name="exit_code"><integer>3</integer></argument> <argument name="exit_value"><text>Failed</text></argument> diff --git a/DaVinciTests/tests/qmtest/io.qms/test_read_mc_digi.qmt b/DaVinciTests/tests/qmtest/io.qms/test_read_mc_digi.qmt index 0d366cc936b5cd40731c8f0eba427b79f6fa70a9..4388ed66f1948ff7b8c1b3e472f3bd812bafd1f6 100644 --- a/DaVinciTests/tests/qmtest/io.qms/test_read_mc_digi.qmt +++ b/DaVinciTests/tests/qmtest/io.qms/test_read_mc_digi.qmt @@ -19,7 +19,7 @@ <argument name="test_file_db_options_yaml"><text>upgrade-magdown-sim09c-up02-34112100-digi</text></argument> <argument name="extra_options_yaml"><text> evt_max: 200 - input_process: Turbo + input_process: Boole </text></argument> <argument name="reference"><text>../refs/test_davinci_read_mc_digi.ref</text></argument> <argument name="error_reference"><text>../refs/empty.ref</text></argument> diff --git a/DaVinciTests/tests/qmtest/io.qms/test_read_mc_ldst.qmt b/DaVinciTests/tests/qmtest/io.qms/test_read_mc_ldst.qmt index 1156c08f743fe6e47995b1c45be8bbdd41c5f06b..d8a2e494c5df47aa2c3836ee171b044495492bb0 100644 --- a/DaVinciTests/tests/qmtest/io.qms/test_read_mc_ldst.qmt +++ b/DaVinciTests/tests/qmtest/io.qms/test_read_mc_ldst.qmt @@ -19,7 +19,7 @@ <argument name="test_file_db_options_yaml"><text>upgrade-magdown-sim09c-up02-reco-up01-minbias-ldst</text></argument> <argument name="extra_options_yaml"><text> evt_max: 200 - input_process: Turbo + input_process: Brunel </text></argument> <argument name="reference"><text>../refs/test_davinci_read_mc_ldst.ref</text></argument> <argument name="error_reference"><text>../refs/empty.ref</text></argument> diff --git a/DaVinciTests/tests/qmtest/io.qms/test_read_mc_mdf.qmt b/DaVinciTests/tests/qmtest/io.qms/test_read_mc_mdf.qmt index e3cb78586ddb7d4521c27f8a37ff57be8502269c..9ff4e55a0dd6ffa89ad9caf45e422379f746cbb9 100644 --- a/DaVinciTests/tests/qmtest/io.qms/test_read_mc_mdf.qmt +++ b/DaVinciTests/tests/qmtest/io.qms/test_read_mc_mdf.qmt @@ -20,7 +20,7 @@ <argument name="extra_options_yaml"><text> input_type: RAW evt_max: 200 - input_process: Turbo + input_process: Hlt1 </text></argument> <argument name="reference"><text>../refs/test_davinci_read_mc_mdf.ref</text></argument> <argument name="error_reference"><text>../refs/empty.ref</text></argument> diff --git a/DaVinciTests/tests/qmtest/io.qms/test_read_mc_xdigi.qmt b/DaVinciTests/tests/qmtest/io.qms/test_read_mc_xdigi.qmt index 57e0c400a41829733d1ae78738f501ee44d80eb1..e9e51114fd2cc4a07bfc859ad87d8a83af80a8db 100644 --- a/DaVinciTests/tests/qmtest/io.qms/test_read_mc_xdigi.qmt +++ b/DaVinciTests/tests/qmtest/io.qms/test_read_mc_xdigi.qmt @@ -19,7 +19,7 @@ <argument name="test_file_db_options_yaml"><text>upgrade_DC19_01_Bs2JPsiPhi_MD</text></argument> <argument name="extra_options_yaml"><text> evt_max: 200 - input_process: Turbo + input_process: Boole </text></argument> <argument name="reference"><text>../refs/test_davinci_read_mc_xdigi.ref</text></argument> <argument name="error_reference"><text>../refs/empty.ref</text></argument> diff --git a/DaVinciTests/tests/qmtest/io.qms/test_read_moore_dst.qmt b/DaVinciTests/tests/qmtest/io.qms/test_read_moore_dst.qmt index 27078945d1d1bd45c064820c9860b4f85ed1f16d..3cb9c12cdefaa1807c64438bc2f541e71a56cec3 100755 --- a/DaVinciTests/tests/qmtest/io.qms/test_read_moore_dst.qmt +++ b/DaVinciTests/tests/qmtest/io.qms/test_read_moore_dst.qmt @@ -23,7 +23,7 @@ evt_max: -1 print_freq: 1 msg_svc_format: "% F%60W%S%7W%R%T %0W%M" - input_process: Turbo + input_process: Brunel </text></argument> <argument name="validator"><text> findReferenceBlock("""StdLooseD02KK INFO Number of counters : 6 diff --git a/Phys/DaVinci/python/DaVinci/LbExec.py b/Phys/DaVinci/python/DaVinci/LbExec.py index 473273db8b7ce695d4cae9f3da58783b7464d3b3..3ae34e4aba5516de7132d2915815503446e7b53d 100644 --- a/Phys/DaVinci/python/DaVinci/LbExec.py +++ b/Phys/DaVinci/python/DaVinci/LbExec.py @@ -61,7 +61,9 @@ class Options(DefaultOptions): dict: Modified attributes of the Options object. """ input_process = values.get("input_process") - if input_process == InputProcessTypes.Hlt2: + if input_process not in { + InputProcessTypes.Spruce, InputProcessTypes.Turbo + }: values['stream'] = '' return values diff --git a/Phys/DaVinci/python/DaVinci/algorithms.py b/Phys/DaVinci/python/DaVinci/algorithms.py index 9c08f800dd5a8bf899577bc95c3241959f675a54..6380b8954cfa8d5a841565cb394d1ea6b1fc7cab 100644 --- a/Phys/DaVinci/python/DaVinci/algorithms.py +++ b/Phys/DaVinci/python/DaVinci/algorithms.py @@ -11,11 +11,9 @@ import re import logging -from PyConf.Algorithms import ( - LoKi__HDRFilter as HDRFilter, - LoKi__VoidFilter as VoidFilter, -) -from PyConf.reading import get_particles, get_hlt_reports +from PyConf.Algorithms import (LoKi__HDRFilter as HDRFilter, LoKi__VoidFilter + as VoidFilter) +from PyConf.reading import get_particles, get_hlt_reports, dstdata_filter log = logging.getLogger(__name__) @@ -86,23 +84,27 @@ def add_filter(name, code): return algFilter -def apply_filters_and_unpacking(options, algs_dict): +def apply_filters(options, algs_dict): """ - Adding filter and unpacking algorithms. + Adding filter algorithms. Args: options (DaVinci.Options): lbexec provided options object algs_dict (dict): dict of the user algorithms. - (TO BE REMOVED WHEN THE UNPACKING WILL BECOME FUNCTIONAL) - (UNPACKING IS FUNCTIONAL, time to remove maybe?) Returns: - Dict where at each node filters and unpacking algorithms are prepended to the initial list of user algorithms. + Dict where at each node filters are prepended to the initial list of user algorithms. """ alg_filterd_dict = {} for name, algs in algs_dict.items(): algs_list = [] + + # This filter will skip events with empty DstData but a positive line decision. + # It will only be applied to the input_process where DstData bank is produced (Hlt2, Turbo, Spruce). + if options.input_process in {"Turbo", "Spruce", "Hlt2"}: + algs_list += [dstdata_filter(options.stream)] + if options.evt_pre_filters: evt_pre_filters = [] for title, code in options.evt_pre_filters.items(): diff --git a/Phys/DaVinci/python/DaVinci/config.py b/Phys/DaVinci/python/DaVinci/config.py index 97854509fdf681506617168772a71a8bfbb75feb..8684ebfc24cec796caf6db0e2fefd674c8e2d891 100644 --- a/Phys/DaVinci/python/DaVinci/config.py +++ b/Phys/DaVinci/python/DaVinci/config.py @@ -1,5 +1,5 @@ ############################################################################### -# (c) Copyright 2021-2022 CERN for the benefit of the LHCb Collaboration # +# (c) Copyright 2021-2023 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". # @@ -19,7 +19,7 @@ from PyConf.application import configure, configure_input, configured_ann_svc from PyConf.application import metainfo_repos from PyConf.control_flow import CompositeNode, NodeLogic from PyConf.Algorithms import EventAccounting -from DaVinci.algorithms import (define_fsr_writer, apply_filters_and_unpacking) +from DaVinci.algorithms import (define_fsr_writer, apply_filters) log = logging.getLogger(__name__) @@ -170,14 +170,11 @@ def add_davinci_configurables(options, user_algorithms, public_tools): ] elif options.annsvc_config: # this should be renamed to input_manifest_file - # distinguish between configuring the ANNSvc for decoding, and getting - # the manifest to configure the unpacking (the latter has _NOTHING_ to - # do with the ANNSvc) - # Here we only do the decoding part. The unpacking manifest part we - # do in apply_filters_and_unpacking... + # distinguish between configuring the ANNSvc for decoding and unpacking + # manifest file is not needed for unpacking anymore config.add(configured_ann_svc(json_file=options.annsvc_config)) - dvMainFlow = apply_filters_and_unpacking(options, user_algorithms) + dvMainFlow = apply_filters(options, user_algorithms) fsrAlgs = {} if options.write_fsr: diff --git a/Phys/DaVinci/tests/config/test_algorithms.py b/Phys/DaVinci/tests/config/test_algorithms.py index 74f27e3cc731b2aa447f41766463b540b862d3f1..cad62cf1cfe0446ffb9542ff4c134bb8899f5758 100644 --- a/Phys/DaVinci/tests/config/test_algorithms.py +++ b/Phys/DaVinci/tests/config/test_algorithms.py @@ -11,8 +11,7 @@ from PyConf.Algorithms import Gaudi__Examples__VoidConsumer as VoidConsumer from DaVinci import Options -from DaVinci.algorithms import (define_fsr_writer, add_filter, - apply_filters_and_unpacking, +from DaVinci.algorithms import (define_fsr_writer, add_filter, apply_filters, configured_FunTuple) from PyConf.reading import get_odin, get_decreports, get_hlt_reports, upfront_decoder from PyConf.application import default_raw_event @@ -24,7 +23,7 @@ def test_define_write_fsr(): """ options = Options( data_type="Upgrade", - input_process="Turbo", + input_process="Gen", evt_max=1, output_level=3, merge_genfsr=True, @@ -83,7 +82,7 @@ def test_add_void_filter(): """ options = Options( data_type="Upgrade", - input_process="Turbo", + input_process="Gen", evt_max=1, simulation=True, ) @@ -93,20 +92,20 @@ def test_add_void_filter(): assert "VoidFilter" in test_filter.fullname -def test_apply_filters_and_unpack(): +def test_apply_filters(): """ Check if DaVinci applies correctly a filter in front of a given algorithm """ options = Options( data_type="Upgrade", input_raw_format=0.5, - input_process="Turbo", + input_process="Gen", evt_max=1, evt_pre_filters={"test_filter": "EVT_PREFILTER"}, simulation=True, ) alg_dict = {"test_alg": [VoidConsumer()]} - test_alg_dict = apply_filters_and_unpacking(options, alg_dict) + test_alg_dict = apply_filters(options, alg_dict) list_of_main_expected_algs = ["LoKi__VoidFilter"] for exp_alg in list_of_main_expected_algs: @@ -155,7 +154,7 @@ def test_get_odin(): """ options = Options( data_type="Upgrade", - input_process="Turbo", + input_process="Gen", evt_max=1, input_raw_format=0.5, simulation=True, @@ -163,7 +162,7 @@ def test_get_odin(): with default_raw_event.bind(raw_event_format=options.input_raw_format): odin = get_odin( input_process=options.input_process, stream=options.stream) - assert odin.location == "/Event/createODIN#1/ODIN" + assert odin.location == "/Event/createODIN/ODIN" def test_get_decreports():