3"""Define methods to construct configured TileHid2ReSrcIDCondAlg conditions algorithm"""
5from AthenaConfiguration.ComponentAccumulator
import ComponentAccumulator
6from AthenaConfiguration.ComponentFactory
import CompFactory
7from IOVDbSvc.IOVDbSvcConfig
import addFolders
10 """Configure TileHid2ReSrcIDCondAlg conditions algorithm"""
12 hid2RESrcID =
'TileHid2RESrcIDHLT' if ForHLT
else 'TileHid2RESrcID'
13 hid2RESrcIDCondAlg = f
'{hid2RESrcID}CondAlg'
14 from AthenaCommon.AlgSequence
import AthSequencer
16 if hasattr(condSequence, hid2RESrcIDCondAlg):
19 from TileByteStream.TileByteStreamConf
import TileHid2RESrcIDCondAlg
20 condSequence +=
TileHid2RESrcIDCondAlg(name=hid2RESrcIDCondAlg, ForHLT=ForHLT, TileHid2RESrcID=hid2RESrcID, **kwargs)
25 """Return component accumulator with configured TileHid2ReSrcIDCondAlg conditions algorithm"""
27 forHLT = kwargs.get(
'ForHLT',
False)
28 hid2RESrcID =
'TileHid2RESrcIDHLT' if forHLT
else 'TileHid2RESrcID'
29 kwargs.setdefault(
'TileHid2RESrcID', hid2RESrcID)
30 kwargs.setdefault(
'name', f
'{hid2RESrcID}CondAlg')
32 acc = ComponentAccumulator()
34 from TileGeoModel.TileGMConfig
import TileGMCfg
35 acc.merge( TileGMCfg(flags) )
40 if flags.IOVDb.DatabaseInstance ==
'COMP200':
42 kwargs[
'FullTileMode'] = 1
43 elif flags.Input.isMC:
44 rodFolder =
'/TILE/OFL02/STATUS/ROD'
46 acc.merge(addFolders(flags, rodFolder,
'TILE_OFL', tag=
'TileOfl02StatusRod-RUN3-00', className=
'CondAttrListCollection'))
48 rodFolder =
'/TILE/ONL01/STATUS/ROD'
49 acc.merge(addFolders(flags, rodFolder,
'TILE', className=
'CondAttrListCollection'))
52 TileCondProxyCoolInt = CompFactory.getComp(
"TileCondProxyCool<TileCalibDrawerInt>")
54 kwargs[
'RODStatusProxy'] = rodStatusProxy
56 elif source ==
'FILE':
57 TileCondProxyFileInt = CompFactory.getComp(
"TileCondProxyFile<TileCalibDrawerInt>")
59 kwargs[
'RODStatusProxy'] = rodStatusProxy
61 TileHid2ReSrcIDCondAlg = CompFactory.TileHid2RESrcIDCondAlg
62 acc.addCondAlgo( TileHid2ReSrcIDCondAlg(**kwargs) )
68if __name__ ==
"__main__":
70 from AthenaConfiguration.AllConfigFlags
import initConfigFlags
71 from AthenaConfiguration.TestDefaults
import defaultGeometryTags, defaultTestFiles
72 from AthenaCommon.Logging
import log
78 flags = initConfigFlags()
79 flags.Input.Files = defaultTestFiles.RAW_RUN2
80 flags.GeoModel.AtlasVersion = defaultGeometryTags.RUN2
84 from AthenaConfiguration.MainServicesConfig
import MainServicesCfg
85 cfg = MainServicesCfg(flags)
87 from ByteStreamCnvSvc.ByteStreamConfig
import ByteStreamReadCfg
88 cfg.merge( ByteStreamReadCfg(flags) )
92 cfg.printConfig(withDetails =
True, summariseProps =
True)
93 cfg.store( open(
'TileHid2ReSrcIDCondAlg.pkl',
'wb') )
99 sys.exit(
not sc.isSuccess())
Condition algorithm to prepare TileHid2RESrcID conditions object and put it into conditions store.
TileHid2RESrcIDCondAlgCfg(flags, source='COOL', **kwargs)
TileHid2RESrcIDCondAlg(ForHLT=False, **kwargs)