Skip to content
Snippets Groups Projects
Commit 13403667 authored by Nicole Skidmore's avatar Nicole Skidmore Committed by Patrick Koppenburg
Browse files

Config changes: options.stream -> options.input_stream, Turbo -> TurboPass

parent 9fa73f21
No related branches found
No related tags found
2 merge requests!1103Draft: Add AnalysisHelpers to DaVinci Stack,!886Config changes: options.stream -> options.input_stream, Turbo -> TurboPass
Showing
with 47 additions and 52 deletions
...@@ -11,6 +11,6 @@ geometry_version: trunk ...@@ -11,6 +11,6 @@ geometry_version: trunk
histo_file: v2_example_histos.root histo_file: v2_example_histos.root
ntuple_file: v2_example_ntuples.root ntuple_file: v2_example_ntuples.root
input_process: Hlt2 input_process: Hlt2
stream: default input_stream: default
print_freq: 1000 print_freq: 1000
input_raw_format: 0.5 input_raw_format: 0.5
...@@ -11,7 +11,7 @@ evt_max : 10000 ...@@ -11,7 +11,7 @@ evt_max : 10000
ntuple_file: "Raw_DV_Ks_example.root" ntuple_file: "Raw_DV_Ks_example.root"
input_raw_format: 0.5 input_raw_format: 0.5
input_process: 'Hlt2' input_process: Hlt2
conditions_version: AlignmentV9_2023_03_16_VPSciFiRich conditions_version: AlignmentV9_2023_03_16_VPSciFiRich
geometry_version: trunk geometry_version: trunk
python_logging_level: 3 python_logging_level: 3
......
...@@ -12,6 +12,6 @@ input_raw_format: 0.5 ...@@ -12,6 +12,6 @@ input_raw_format: 0.5
lumi: false lumi: false
ntuple_file: 'mytuple.root' ntuple_file: 'mytuple.root'
print_freq: 1 print_freq: 1
input_process: 'Hlt2' input_process: Hlt2
stream: 'default' input_stream: default
evt_max: -1 evt_max: -1
...@@ -11,5 +11,5 @@ conddb_tag: sim-20201218-vc-md100 ...@@ -11,5 +11,5 @@ conddb_tag: sim-20201218-vc-md100
dddb_tag: dddb-20201211 dddb_tag: dddb-20201211
conditions_version: master conditions_version: master
geometry_version: trunk geometry_version: trunk
input_process: Turbo input_process: TurboPass
...@@ -10,5 +10,5 @@ conditions_version: master ...@@ -10,5 +10,5 @@ conditions_version: master
geometry_version: trunk geometry_version: trunk
histo_file: passthrough_histos.root histo_file: passthrough_histos.root
ntuple_file: passthrough_tuple.root ntuple_file: passthrough_tuple.root
input_process: Turbo input_process: TurboPass
print_freq: 1000 print_freq: 1000
...@@ -12,5 +12,5 @@ ntuple_file: tuple_tistos.root ...@@ -12,5 +12,5 @@ ntuple_file: tuple_tistos.root
evt_max: -1 evt_max: -1
write_fsr: False write_fsr: False
print_freq: 1000 print_freq: 1000
input_process: 'Hlt2' input_process: Hlt2
...@@ -12,5 +12,5 @@ ...@@ -12,5 +12,5 @@
lumi: false lumi: false
ntuple_file: 'DV_example_allFunctors_ntp.root' ntuple_file: 'DV_example_allFunctors_ntp.root'
print_freq: 1 print_freq: 1
input_process: 'Spruce' input_process: Spruce
stream: 'default' input_stream: default
\ No newline at end of file \ No newline at end of file
evt_pre_filters: Hlt2TopoLineFilter: "HLT_PASS('Hlt2Topo2BodyLineDecision')"
Hlt2TopoLineFilter: "HLT_PASS('Hlt2Topo2BodyLineDecision')"
ntuple_file: "DV_example_sprucing_ntp.root" ntuple_file: "DV_example_sprucing_ntp.root"
histo_file: "DV_example_sprucing_his.root" histo_file: "DV_example_sprucing_his.root"
print_freq: 1 print_freq: 1
\ No newline at end of file
...@@ -4,4 +4,4 @@ ntuple_file: davinci_ntuple_ft.root ...@@ -4,4 +4,4 @@ ntuple_file: davinci_ntuple_ft.root
print_freq: 1 print_freq: 1
data_type: Upgrade data_type: Upgrade
simulation: true simulation: true
input_process: Turbo input_process: TurboPass
\ No newline at end of file \ No newline at end of file
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
<argument name="extra_options_yaml"><text> <argument name="extra_options_yaml"><text>
evt_max: 100 evt_max: 100
print_freq: 1 print_freq: 1
input_process: Turbo input_process: TurboPass
msg_svc_format: "% F%40W%S%7W%R%T %0W%M" msg_svc_format: "% F%40W%S%7W%R%T %0W%M"
</text></argument> </text></argument>
<argument name="timeout"><integer>3600</integer></argument> <argument name="timeout"><integer>3600</integer></argument>
......
...@@ -39,8 +39,8 @@ ...@@ -39,8 +39,8 @@
lumi: false lumi: false
ntuple_file: 'DV_example_allFunctors_ntp.root' ntuple_file: 'DV_example_allFunctors_ntp.root'
print_freq: 1 print_freq: 1
input_process: 'Spruce' input_process: Spruce
stream: 'default' input_stream: default
</text></argument> </text></argument>
<argument name="timeout"><integer>1000</integer></argument> <argument name="timeout"><integer>1000</integer></argument>
<argument name="args"><set> <argument name="args"><set>
......
...@@ -39,8 +39,8 @@ ...@@ -39,8 +39,8 @@
lumi: false lumi: false
ntuple_file: 'DV_example_allFunctors_ntp_old.root' ntuple_file: 'DV_example_allFunctors_ntp_old.root'
print_freq: 1 print_freq: 1
input_process: 'Spruce' input_process: Spruce
stream: 'default' input_stream: default
</text></argument> </text></argument>
<argument name="timeout"><integer>1000</integer></argument> <argument name="timeout"><integer>1000</integer></argument>
<argument name="args"><set> <argument name="args"><set>
......
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
print_freq: 1 print_freq: 1
data_type: Upgrade data_type: Upgrade
simulation: true simulation: true
input_process: Turbo input_process: TurboPass
</text></argument> </text></argument>
<argument name="timeout"><integer>3600</integer></argument> <argument name="timeout"><integer>3600</integer></argument>
<argument name="reference"><text>$DAVINCIEXAMPLESROOT/tests/refs/test_davinci_tupling_relation_isovariables.ref</text></argument> <argument name="reference"><text>$DAVINCIEXAMPLESROOT/tests/refs/test_davinci_tupling_relation_isovariables.ref</text></argument>
......
...@@ -5,8 +5,8 @@ annsvc_config: 'root://eoslhcb.cern.ch//eos/lhcb/wg/dpa/wp3/tests/test_davinci-i ...@@ -5,8 +5,8 @@ annsvc_config: 'root://eoslhcb.cern.ch//eos/lhcb/wg/dpa/wp3/tests/test_davinci-i
data_type: Upgrade data_type: Upgrade
input_type: ROOT input_type: ROOT
simulation: true simulation: true
input_process: 'Hlt2' input_process: Hlt2
stream: 'default' input_stream: default
conddb_tag: sim-20210617-vc-mu100 conddb_tag: sim-20210617-vc-mu100
dddb_tag: dddb-20210617 dddb_tag: dddb-20210617
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
evt_max: -1 evt_max: -1
print_freq: 1 print_freq: 1
msg_svc_format: "% F%60W%S%7W%R%T %0W%M" msg_svc_format: "% F%60W%S%7W%R%T %0W%M"
input_process: Turbo input_process: TurboPass
</text></argument> </text></argument>
<argument name="timeout"><integer>3600</integer></argument> <argument name="timeout"><integer>3600</integer></argument>
<argument name="args"><set> <argument name="args"><set>
......
...@@ -4,7 +4,7 @@ annsvc_config: 'root://eoslhcb.cern.ch//eos/lhcb/wg/dpa/wp3/tests/hlt2_passthrou ...@@ -4,7 +4,7 @@ annsvc_config: 'root://eoslhcb.cern.ch//eos/lhcb/wg/dpa/wp3/tests/hlt2_passthrou
input_type: ROOT input_type: ROOT
evt_max: 100 evt_max: 100
ntuple_file: davinci_ntuple.root ntuple_file: davinci_ntuple.root
input_process: 'Turbo' input_process: TurboPass
print_freq: 1 print_freq: 1
data_type: Upgrade data_type: Upgrade
simulation: true simulation: true
......
...@@ -28,11 +28,8 @@ class Options(DefaultOptions): ...@@ -28,11 +28,8 @@ class Options(DefaultOptions):
where their keyword arguments are globally bound to the user-specified values. where their keyword arguments are globally bound to the user-specified values.
This way, users do not have to manually configure these functions themselves. This way, users do not have to manually configure these functions themselves.
The following user-required parameters need to be set in this class:
- input_process (str): Input process type, see `GaudiConf.LbExec.options.InputProcessTypes` values.
The optional parameters that need to be set are : The optional parameters that need to be set are :
- stream (str): Stream name. Default is "default" (Note: for `input_process=Hlt2` the stream must be strictly empty. The default value is overwritten in this case.) - input_stream (str): Stream name. Default is "default" (Note: for `input_process=Hlt2` the stream must be strictly empty. The default value is overwritten in this case.)
- lumi (bool): Flag to store luminosity information. Default is False. - lumi (bool): Flag to store luminosity information. Default is False.
- evt_pre_filters (dict[str,str]): Event pre-filter code. Default is None. - evt_pre_filters (dict[str,str]): Event pre-filter code. Default is None.
- annsvc_config (str): Path to the configuration file from sprucing or Hlt2. Default is None. - annsvc_config (str): Path to the configuration file from sprucing or Hlt2. Default is None.
...@@ -40,8 +37,7 @@ class Options(DefaultOptions): ...@@ -40,8 +37,7 @@ class Options(DefaultOptions):
- merge_genfsr (bool): Flag to merge the full stream record. Default is False. - merge_genfsr (bool): Flag to merge the full stream record. Default is False.
- metainfo_additional_tags: (list): Additional central tags for `PyConf.filecontent_metadata.metainfo_repos`. Default is []. - metainfo_additional_tags: (list): Additional central tags for `PyConf.filecontent_metadata.metainfo_repos`. Default is [].
""" """
input_process: InputProcessTypes input_stream: Optional[str] = 'default'
stream: Optional[str] = 'default'
lumi: bool = False lumi: bool = False
evt_pre_filters: Optional[dict[str, str]] = None evt_pre_filters: Optional[dict[str, str]] = None
annsvc_config: Optional[str] = None annsvc_config: Optional[str] = None
...@@ -62,9 +58,9 @@ class Options(DefaultOptions): ...@@ -62,9 +58,9 @@ class Options(DefaultOptions):
""" """
input_process = values.get("input_process") input_process = values.get("input_process")
if input_process not in { if input_process not in {
InputProcessTypes.Spruce, InputProcessTypes.Turbo InputProcessTypes.Spruce, InputProcessTypes.TurboPass
}: }:
values['stream'] = '' values['input_stream'] = ''
return values return values
...@@ -84,17 +80,17 @@ class Options(DefaultOptions): ...@@ -84,17 +80,17 @@ class Options(DefaultOptions):
This way users do not have to manually configure these functions themselves. This way users do not have to manually configure these functions themselves.
""" """
default_raw_event.global_bind(raw_event_format=self.input_raw_format) default_raw_event.global_bind(raw_event_format=self.input_raw_format)
default_raw_banks.global_bind(stream=self.stream) default_raw_banks.global_bind(stream=self.input_stream)
upfront_decoder.global_bind( upfront_decoder.global_bind(
input_process=self.input_process, stream=self.stream) input_process=self.input_process, stream=self.input_stream)
reconstruction.global_bind(input_process=self.input_process) reconstruction.global_bind(input_process=self.input_process)
get_tes_root.global_bind(input_process=self.input_process) get_tes_root.global_bind(input_process=self.input_process)
get_odin.global_bind( get_odin.global_bind(
input_process=self.input_process, stream=self.stream) input_process=self.input_process, stream=self.input_stream)
make_odin.global_bind(stream=self.stream) make_odin.global_bind(stream=self.input_stream)
get_hlt_reports.global_bind( get_hlt_reports.global_bind(
input_process=self.input_process, stream=self.stream) input_process=self.input_process, stream=self.input_stream)
get_mc_track_info.global_bind(input_process=self.input_process) get_mc_track_info.global_bind(input_process=self.input_process)
with super().apply_binds(): with super().apply_binds():
yield yield
...@@ -138,8 +138,8 @@ def apply_filters(options, algs_dict): ...@@ -138,8 +138,8 @@ def apply_filters(options, algs_dict):
# This filter will skip events with empty DstData but a positive line decision. # 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). # 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"}: if options.input_process in {"TurboPass", "Spruce", "Hlt2"}:
algs_list += [dstdata_filter(options.stream)] algs_list += [dstdata_filter(options.input_stream)]
if options.evt_pre_filters: if options.evt_pre_filters:
evt_pre_filters = [] evt_pre_filters = []
......
...@@ -45,14 +45,14 @@ def test_add_hlt2_filter(): ...@@ -45,14 +45,14 @@ def test_add_hlt2_filter():
evt_max=1, evt_max=1,
simulation=True, simulation=True,
input_process="Hlt2", input_process="Hlt2",
stream="default", input_stream="default",
) )
#Note here that we need to manually apply a bind to the PyConf functions #Note here that we need to manually apply a bind to the PyConf functions
# as they are not automatically configured in the pytests. # as they are not automatically configured in the pytests.
# When running DV, the PyConf functions are globally configured and one must avoid # When running DV, the PyConf functions are globally configured and one must avoid
# "binding" as much as possible. # "binding" as much as possible.
with default_raw_event.bind(raw_event_format=options.input_raw_format),\ with default_raw_event.bind(raw_event_format=options.input_raw_format),\
get_hlt_reports.bind(input_process=options.input_process, stream=options.stream): get_hlt_reports.bind(input_process=options.input_process, stream=options.input_stream):
test_filter = create_lines_filter( test_filter = create_lines_filter(
"test_filter_{hash}", lines=['Hlt2TESTLine']) "test_filter_{hash}", lines=['Hlt2TESTLine'])
assert test_filter.fullname.startswith("VoidFilter/test_filter") assert test_filter.fullname.startswith("VoidFilter/test_filter")
...@@ -68,10 +68,10 @@ def test_add_spruce_filter(): ...@@ -68,10 +68,10 @@ def test_add_spruce_filter():
evt_max=1, evt_max=1,
simulation=True, simulation=True,
input_process="Spruce", input_process="Spruce",
stream="default", input_stream="default",
) )
with default_raw_event.bind(raw_event_format=options.input_raw_format),\ with default_raw_event.bind(raw_event_format=options.input_raw_format),\
get_hlt_reports.bind(input_process=options.input_process, stream=options.stream): get_hlt_reports.bind(input_process=options.input_process, stream=options.input_stream):
test_filter = create_lines_filter( test_filter = create_lines_filter(
"test_filter_{hash}", lines=["SpruceTESTLine"]) "test_filter_{hash}", lines=["SpruceTESTLine"])
assert test_filter.fullname.startswith("VoidFilter/test_filter") assert test_filter.fullname.startswith("VoidFilter/test_filter")
...@@ -89,7 +89,7 @@ def test_add_void_filter(): ...@@ -89,7 +89,7 @@ def test_add_void_filter():
simulation=True, simulation=True,
) )
with get_hlt_reports.bind( with get_hlt_reports.bind(
input_process=options.input_process, stream=options.stream): input_process=options.input_process, stream=options.input_stream):
test_filter = add_filter("test_filter_{hash}", "VOIDTEST_Filter") test_filter = add_filter("test_filter_{hash}", "VOIDTEST_Filter")
assert "VoidFilter" in test_filter.fullname assert "VoidFilter" in test_filter.fullname
...@@ -135,16 +135,16 @@ def test_configured_funtuple(): ...@@ -135,16 +135,16 @@ def test_configured_funtuple():
} }
options = Options( options = Options(
data_type="Upgrade", data_type="Upgrade",
input_process="Turbo", input_process="TurboPass",
evt_max=1, evt_max=1,
input_raw_format=0.5, input_raw_format=0.5,
simulation=True, simulation=True,
) )
with default_raw_event.bind(raw_event_format=options.input_raw_format),\ with default_raw_event.bind(raw_event_format=options.input_raw_format),\
upfront_decoder.bind(input_process=options.input_process, stream=options.stream),\ upfront_decoder.bind(input_process=options.input_process, stream=options.input_stream),\
get_hlt_reports.bind(input_process=options.input_process, stream=options.stream),\ get_hlt_reports.bind(input_process=options.input_process, stream=options.input_stream),\
get_odin.bind(input_process=options.input_process, get_odin.bind(input_process=options.input_process,
stream=options.stream): stream=options.input_stream):
test_dict = configured_FunTuple(config) test_dict = configured_FunTuple(config)
assert any("FunTupleBase_Particles/Tuple_TestTuple" in alg.fullname assert any("FunTupleBase_Particles/Tuple_TestTuple" in alg.fullname
for alg in test_dict["TestTuple"]) for alg in test_dict["TestTuple"])
...@@ -163,7 +163,7 @@ def test_get_odin(): ...@@ -163,7 +163,7 @@ def test_get_odin():
) )
with default_raw_event.bind(raw_event_format=options.input_raw_format): with default_raw_event.bind(raw_event_format=options.input_raw_format):
odin = get_odin( odin = get_odin(
input_process=options.input_process, stream=options.stream) input_process=options.input_process, stream=options.input_stream)
assert re.fullmatch("/Event/createODIN_[0-9a-f]*/ODIN", assert re.fullmatch("/Event/createODIN_[0-9a-f]*/ODIN",
odin.location) is not None odin.location) is not None
...@@ -177,10 +177,10 @@ def test_get_decreports(): ...@@ -177,10 +177,10 @@ def test_get_decreports():
input_raw_format=0.5, input_raw_format=0.5,
evt_max=1, evt_max=1,
simulation=True, simulation=True,
input_process="Turbo", input_process="TurboPass",
stream="TurboSP", input_stream="TurboSP",
) )
with default_raw_event.bind(raw_event_format=options.input_raw_format),\ with default_raw_event.bind(raw_event_format=options.input_raw_format),\
get_hlt_reports.bind(input_process=options.input_process, stream=options.stream): get_hlt_reports.bind(input_process=options.input_process, stream=options.input_stream):
decreports = get_decreports("Hlt2") decreports = get_decreports("Hlt2")
assert decreports.location == "/Event/Hlt2/DecReports" assert decreports.location == "/Event/Hlt2/DecReports"
...@@ -50,14 +50,14 @@ Also make a file named ``options.yaml`` containing: ...@@ -50,14 +50,14 @@ Also make a file named ``options.yaml`` containing:
.. code-block:: yaml .. code-block:: yaml
input_files: input_files:
- root://eoslhcb.cern.ch//eos/lhcb/wg/dpa/wp3/tests/hlt2_passthrough_thor_lines.dst - root://eoslhcb.cern.ch//eos/lhcb/wg/dpa/wp3/tests/hlt2_passthrough_thor_lines.dst
annsvc_config: root://eoslhcb.cern.ch//eos/lhcb/wg/dpa/wp3/tests/hlt2_passthrough_thor_lines.tck.json annsvc_config: root://eoslhcb.cern.ch//eos/lhcb/wg/dpa/wp3/tests/hlt2_passthrough_thor_lines.tck.json
input_type: ROOT input_type: ROOT
evt_max: 100 evt_max: 100
ntuple_file: davinci_ntuple.root ntuple_file: davinci_ntuple.root
input_process: Turbo input_process: TurboPass
print_freq: 1 print_freq: 1
data_type: Upgrade data_type: Upgrade
simulation: true simulation: true
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment