26 """Set up to read from a bytestream file
28 The function adds the components required to read events and metadata from
29 bytestream input. May be used to read events from a secondary input as well
33 flags: Job configuration flags
34 type_names: (optional) specific type names for address provider to find
37 A component accumulator fragment containing the components required to
38 read from bytestream. Should be merged into main job configuration.
42 bytestream_conversion = CompFactory.ByteStreamCnvSvc()
43 result.addService(bytestream_conversion)
45 if flags.Common.isOnline
and not any(flags.Input.Files)
and not (flags.Trigger.doHLT
or flags.Trigger.doLVL1):
46 bytestream_input = CompFactory.ByteStreamEmonInputSvc(
"ByteStreamInputSvc")
48 bytestream_input = CompFactory.ByteStreamEventStorageInputSvc(
49 name=
"ByteStreamInputSvc",
50 EventInfoKey=
"{}EventInfo".
format(
51 flags.Overlay.BkgPrefix
if flags.Overlay.DataOverlay
else ""
54 result.addService(bytestream_input)
56 if flags.Input.SecondaryFiles:
57 event_selector = CompFactory.EventSelectorByteStream(
58 name=
"SecondaryEventSelector",
60 Input=flags.Input.SecondaryFiles,
61 SkipEvents=flags.Exec.SkipEvents
if flags.Overlay.SkipSecondaryEvents >= 0
else flags.Exec.SkipEvents,
62 ByteStreamInputSvc=bytestream_input.name,
64 result.addService(event_selector)
66 event_selector = CompFactory.EventSelectorByteStream(
68 Input=flags.Input.Files,
69 SkipEvents=flags.Exec.SkipEvents,
70 ByteStreamInputSvc=bytestream_input.name,
71 HelperTools = [CompFactory.xAODMaker.EventInfoSelectorTool()]
73 result.addService(event_selector)
74 result.setAppProperty(
"EvtSel", event_selector.name)
76 event_persistency = CompFactory.EvtPersistencySvc(
77 name=
"EventPersistencySvc", CnvServices=[bytestream_conversion.name]
79 result.addService(event_persistency)
81 result.addService(CompFactory.ROBDataProviderSvc())
83 address_provider = CompFactory.ByteStreamAddressProviderSvc(
84 TypeNames=type_names
if type_names
else list(),
86 result.addService(address_provider)
89 MetaDataSvcCfg(flags, [
"IOVDbMetaDataTool",
"ByteStreamMetadataTool"])
92 proxy = CompFactory.ProxyProviderSvc(ProviderNames = [address_provider.name])
93 result.addService(proxy)