8def ByteStreamReadCfg(flags, type_names=[]):
9 '''
10 Returns ComponentAccumulator with all components required to read objects from ByteStream input
11
12 Params:
13 flags (AthConfigFlags): The configuration flags container
14 type_names (list): Types to register converters for reading from BS, format ["typeA/key1", "typeB/key2"]
15
16 This wrapper function registers the type_names with either the online (HLT), the offline or the EMon BS services
17 depending on the configuration flags.
18 '''
19
20 if flags.Common.isOnline and not any(flags.Input.Files) and not (flags.Trigger.doHLT or flags.Trigger.doLVL1):
21
22 from ByteStreamEmonSvc.EmonByteStreamConfig import EmonByteStreamCfg
23 servicesCfgFunction = EmonByteStreamCfg
24 elif flags.Trigger.Online.isPartition:
25
26 from TrigByteStreamCnvSvc.TrigByteStreamConfig import TrigByteStreamCfg
27 servicesCfgFunction = TrigByteStreamCfg
28 else:
29
30 from ByteStreamCnvSvc.ByteStreamConfig import ByteStreamReadCfg
31 servicesCfgFunction = ByteStreamReadCfg
32
33 acc = ComponentAccumulator()
34 acc.merge(servicesCfgFunction(flags, type_names=type_names))
35 return acc
36
37