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)
46 if flags.Common.isOnline
and not any(flags.Input.Files)
and not (flags.Trigger.doHLT
or flags.Trigger.doLVL1):
47 bytestream_input = CompFactory.ByteStreamEmonInputSvc(
"ByteStreamInputSvc")
49 eiName =
"{}EventInfo".
format(flags.Overlay.BkgPrefix
if flags.Overlay.ByteStream
else "")
50 bytestream_input = CompFactory.ByteStreamEventStorageInputSvc(
51 name=
"ByteStreamInputSvc",
53 result.addService(bytestream_input)
55 if flags.Input.SecondaryFiles:
56 event_selector = CompFactory.EventSelectorByteStream(
57 name=
"SecondaryEventSelector",
59 Input=flags.Input.SecondaryFiles,
60 SkipEvents=flags.Exec.SkipEvents
if flags.Overlay.SkipSecondaryEvents >= 0
else flags.Exec.SkipEvents,
61 ByteStreamInputSvc=bytestream_input.name,
63 result.addService(event_selector)
65 event_selector = CompFactory.EventSelectorByteStream(
67 Input=flags.Input.Files,
68 SkipEvents=flags.Exec.SkipEvents,
69 ByteStreamInputSvc=bytestream_input.name,
71 result.addService(event_selector)
72 result.setAppProperty(
"EvtSel", event_selector.name)
74 event_persistency = CompFactory.EvtPersistencySvc(
75 name=
"EventPersistencySvc", CnvServices=[bytestream_conversion.name]
77 result.addService(event_persistency)
79 result.addService(CompFactory.ROBDataProviderSvc())
81 address_provider = CompFactory.ByteStreamAddressProviderSvc(
82 TypeNames=type_names
if type_names
else list(),
84 result.addService(address_provider)
87 MetaDataSvcCfg(flags, [
"IOVDbMetaDataTool",
"ByteStreamMetadataTool"])
90 proxy = CompFactory.ProxyProviderSvc(ProviderNames = [address_provider.name])
91 result.addService(proxy)
94 ExtraOutputs=[(
"xAOD::EventInfo",f
"StoreGateSvc+{eiName}"),
95 (
"xAOD::EventAuxInfo",f
"StoreGateSvc+{eiName}Aux.")]))