Skip to content
Snippets Groups Projects
Commit afa11aa8 authored by Sebastien Ponce's avatar Sebastien Ponce
Browse files

Merge branch 'sevda-rawbank' into 'master'

Follow LHCb!3822

See merge request !776
parents f12bc19d 1c64f6d2
No related branches found
No related tags found
2 merge requests!1103Draft: Add AnalysisHelpers to DaVinci Stack,!776Follow LHCb!3822
Pipeline #4757004 passed
......@@ -12,7 +12,7 @@
Example of a DaVinci job printing decay trees via `PrintDecayTree`.
"""
from PyConf.application import configure, configure_input
from PyConf.application import default_raw_event, make_odin
from PyConf.application import make_odin
from PyConf.control_flow import CompositeNode, NodeLogic
from PyConf.Algorithms import PrintDecayTree, PrintHeader
......@@ -40,8 +40,7 @@ def print_decay_tree(options: Options):
def print_header(options: Options):
with default_raw_event.bind(raw_event_format=options.input_raw_format):
ph = PrintHeader(ODINLocation=make_odin())
ph = PrintHeader(ODINLocation=make_odin())
node = CompositeNode("PHNode", children=[ph])
......
......@@ -14,6 +14,7 @@ from GaudiConf.LbExec import Options as DefaultOptions, ProcessTypes
from pydantic import root_validator
from PyConf.reading import (upfront_decoder, reconstruction, get_tes_root,
get_odin, get_hlt_reports, get_mc_track_info)
from PyConf.application import default_raw_event
class Options(DefaultOptions):
......@@ -85,14 +86,12 @@ class Options(DefaultOptions):
- get_hlt_reports
- get_mc_track_info
"""
upfront_decoder.global_bind(process=self.process)
default_raw_event.global_bind(raw_event_format=self.input_raw_format)
upfront_decoder.global_bind(process=self.process, stream=self.stream)
reconstruction.global_bind(process=self.process)
get_mc_track_info.global_bind(process=self.process)
get_tes_root.global_bind(process=self.process)
get_odin.global_bind(
process=self.process,
stream=self.stream,
input_raw_format=self.input_raw_format)
get_odin.global_bind(process=self.process, stream=self.stream)
get_hlt_reports.global_bind(process=self.process, stream=self.stream)
with super().apply_binds():
yield
......@@ -17,6 +17,7 @@ from DaVinci.algorithms import (
apply_filters_and_unpacking,
configured_FunTuple)
from PyConf.reading import get_odin, get_decreports, get_hlt_reports, upfront_decoder
from PyConf.application import default_raw_event
def test_define_write_fsr():
......@@ -41,6 +42,7 @@ def test_add_hlt2_filter():
"""
options = Options(
data_type="Upgrade",
input_raw_format=0.5,
evt_max=1,
simulation=True,
process="Hlt2",
......@@ -50,7 +52,8 @@ def test_add_hlt2_filter():
# as they are not automatically configured in the pytests.
# When running DV, the PyConf functions are globally configured and one must avoid
# "binding" as much as possible.
with get_hlt_reports.bind(process=options.process, stream=options.stream):
with default_raw_event.bind(raw_event_format=options.input_raw_format),\
get_hlt_reports.bind(process=options.process, stream=options.stream):
test_filter = add_filter("test_filter",
"HLT_PASS('Hlt2TESTLineDecision')")
assert "HDRFilter" in test_filter.fullname
......@@ -62,12 +65,14 @@ def test_add_spruce_filter():
"""
options = Options(
data_type="Upgrade",
input_raw_format=0.5,
evt_max=1,
simulation=True,
process="Spruce",
stream="default",
)
with get_hlt_reports.bind(process=options.process, stream=options.stream):
with default_raw_event.bind(raw_event_format=options.input_raw_format),\
get_hlt_reports.bind(process=options.process, stream=options.stream):
test_filter = add_filter("test_filter",
"HLT_PASS('SpruceTESTLineDecision')")
assert "HDRFilter" in test_filter.fullname
......@@ -95,6 +100,7 @@ def test_apply_filters_and_unpack():
"""
options = Options(
data_type="Upgrade",
input_raw_format=0.5,
process="Turbo",
evt_max=1,
evt_pre_filters={"test_filter": "EVT_PREFILTER"},
......@@ -134,8 +140,9 @@ def test_configured_funtuple():
input_raw_format=0.5,
simulation=True,
)
with upfront_decoder.bind(process=options.process), get_hlt_reports.bind(
process=options.process, stream=options.stream):
with default_raw_event.bind(raw_event_format=options.input_raw_format),\
upfront_decoder.bind(process=options.process, stream=options.stream),\
get_hlt_reports.bind(process=options.process, stream=options.stream):
test_dict = configured_FunTuple(config)
assert any("FunTupleBase_Particles/Tuple_TestTuple" in alg.fullname
for alg in test_dict["TestTuple"])
......@@ -152,10 +159,8 @@ def test_get_odin():
input_raw_format=0.5,
simulation=True,
)
odin = get_odin(
process=options.process,
stream=options.stream,
input_raw_format=options.input_raw_format)
with default_raw_event.bind(raw_event_format=options.input_raw_format):
odin = get_odin(process=options.process, stream=options.stream)
assert odin.location == "/Event/createODIN#1/ODIN"
......@@ -165,12 +170,14 @@ def test_get_decreports():
"""
options = Options(
data_type="Upgrade",
input_raw_format=0.5,
evt_max=1,
simulation=True,
process="Turbo",
stream="TurboSP",
)
with get_hlt_reports.bind(process=options.process, stream=options.stream):
with default_raw_event.bind(raw_event_format=options.input_raw_format),\
get_hlt_reports.bind(process=options.process, stream=options.stream):
decreports = get_decreports("Hlt2")
assert decreports.location == "/Event/Hlt2/DecReports"
......
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