diff --git a/DaVinciExamples/python/DaVinciExamples/debugging.py b/DaVinciExamples/python/DaVinciExamples/debugging.py index e447b810c06b3db01f340d2ad6b6250e99f04203..0046b3a7259f049b24fe7fc6a33ab3cf0ba0b9bd 100644 --- a/DaVinciExamples/python/DaVinciExamples/debugging.py +++ b/DaVinciExamples/python/DaVinciExamples/debugging.py @@ -45,7 +45,7 @@ def print_decay_tree(options: Options): def print_header(options: Options): - ph = PrintHeader(ODINLocation=make_odin()) + ph = PrintHeader(name='PrintHeader', ODINLocation=make_odin()) node = CompositeNode("PHNode", children=[ph]) diff --git a/DaVinciExamples/tests/qmtest/debugging.qms/test_example-PrintHeader.qmt b/DaVinciExamples/tests/qmtest/debugging.qms/test_example-PrintHeader.qmt index 4b504fb36a70d94babb87c1864cc1ed6e81f1d68..0559c8fec27c701e127c7af00b37bccea6557637 100755 --- a/DaVinciExamples/tests/qmtest/debugging.qms/test_example-PrintHeader.qmt +++ b/DaVinciExamples/tests/qmtest/debugging.qms/test_example-PrintHeader.qmt @@ -24,7 +24,7 @@ </set></argument> <argument name="validator"><text> findReferenceBlock(""" -PrintHeader_14578b4c INFO Number of counters : 1 +PrintHeader INFO Number of counters : 1 | Counter | # | sum | mean/eff^* | rms/err^* | min | max | | "EventCount" | 7 | ApplicationMgr INFO Application Manager Stopped successfully diff --git a/Phys/DaVinci/python/DaVinci/LbExec.py b/Phys/DaVinci/python/DaVinci/LbExec.py index d4e27a82a65cb764a08b9d6fb8c4450f682e2c01..1f74ed93c404de51a8ad0d135a08322ddaddcbf1 100644 --- a/Phys/DaVinci/python/DaVinci/LbExec.py +++ b/Phys/DaVinci/python/DaVinci/LbExec.py @@ -14,6 +14,7 @@ from GaudiConf.LbExec import Options as DefaultOptions, InputProcessTypes from pydantic import root_validator from PyConf.reading import (upfront_decoder, reconstruction, get_tes_root) from PyConf.application import default_raw_event +import logging class Options(DefaultOptions): @@ -56,9 +57,13 @@ class Options(DefaultOptions): dict: Modified attributes of the Options object. """ input_process = values.get("input_process") + input_stream = values.get("input_stream") if input_process not in { InputProcessTypes.Spruce, InputProcessTypes.TurboPass - }: + } and input_stream != '': + logging.getLogger(__name__).warning( + f'input_stream is set to \'{input_stream}\', but will be reset to \'\' because current input_process = {input_process}' + ) values['input_stream'] = '' return values diff --git a/Phys/DaVinci/tests/config/test_algorithms.py b/Phys/DaVinci/tests/config/test_algorithms.py index 8494e78f20d7e70bd5dd0b12b25e4c99e28f71b8..87fce71326678696f6526071a83e3015b97eabb3 100644 --- a/Phys/DaVinci/tests/config/test_algorithms.py +++ b/Phys/DaVinci/tests/config/test_algorithms.py @@ -9,6 +9,8 @@ # or submit itself to any jurisdiction. # ############################################################################### from PyConf.Algorithms import Gaudi__Examples__VoidConsumer as VoidConsumer +from PyConf.components import Algorithm +from PyConf import components from DaVinci import Options from DaVinci.algorithms import (make_fsr_algs, create_lines_filter, add_filter, @@ -17,10 +19,16 @@ from PyConf.reading import get_odin, get_decreports, get_hlt_reports, upfront_de from PyConf.application import default_raw_event from GaudiConf.LbExec import InputProcessTypes -import re + +def reset_global_store(algorithm_store={}): + old_algorithm_store = Algorithm._algorithm_store + Algorithm._algorithm_store = algorithm_store + components._IDENTITY_TABLE.clear() + return old_algorithm_store def test_define_write_fsr(): + reset_global_store() """ Check if DaVinci imports correctly the algorithm to merge and write FSRs. """ @@ -37,6 +45,7 @@ def test_define_write_fsr(): def test_add_hlt2_filter(): + reset_global_store() """ Check if DaVinci is able to implement correctly a filter on an HLT2 line. """ @@ -46,7 +55,7 @@ def test_add_hlt2_filter(): evt_max=1, simulation=True, input_process="Hlt2", - input_stream="default", + input_stream='', ) #Note here that we need to manually apply a bind to the PyConf functions # as they are not automatically configured in the pytests. @@ -60,6 +69,7 @@ def test_add_hlt2_filter(): def test_add_spruce_filter(): + reset_global_store() """ Check if DaVinci is able to implement correctly a filter on a Sprucing line. """ @@ -79,6 +89,7 @@ def test_add_spruce_filter(): def test_add_void_filter(): + reset_global_store() """ Check if DaVinci is able to implement correcty a Void filter if 'HLT_PASS' string is not found in the filter code." @@ -94,6 +105,7 @@ def test_add_void_filter(): def test_apply_filters(): + reset_global_store() """ Check if DaVinci applies correctly a filter in front of a given algorithm """ @@ -115,6 +127,7 @@ def test_apply_filters(): def test_configured_funtuple(): + reset_global_store() """ Check if the configured_FunTuple provides a correct instance of FunTuple. """ @@ -148,6 +161,7 @@ def test_configured_funtuple(): def test_get_odin(): + reset_global_store() """ Check if get_odin provides a correct instance of ODIN. """ @@ -162,11 +176,11 @@ def test_get_odin(): raw_event_format=options.input_raw_format, stream=options.input_stream): odin = get_odin() - assert re.fullmatch("/Event/createODIN_[0-9a-f]*/ODIN", - odin.location) is not None + assert "/Event/Decode_ODIN/ODIN" == odin.location def test_get_decreports(): + reset_global_store() """ Check if get_decreports provide a correct instance of HltDecReportsDecoder. """