3 """Define methods to construct configured Tile DCS tool and conditions algorithm"""
5 from AthenaConfiguration.ComponentAccumulator
import ComponentAccumulator
6 from AthenaConfiguration.ComponentFactory
import CompFactory
9 """Return component accumulator with configured Tile DCS conditions algorithm
12 flags -- Athena configuration flags
14 ReadHV -- Read Tile DCS HV folder from DB. Defaults True.
15 ReadHVSET -- Read Tile DCS HVSET folder from DB. Defaults to False.
16 ReadSTATES -- Read Tile DCS STATES folder from DB. Defaults to True.
17 TileDCS -- name of Tile DCS conditions object. Defaults to TileDCS.
20 isMC = flags.Input.isMC
21 isOnline = flags.Common.isOnline
24 raise(Exception(
'No Tile DCS information in online [%s] or MC [%s]' % (isOnline, isMC)))
28 dcs = kwargs.get(
'TileDCS',
'TileDCS')
29 readHV = kwargs.get(
'ReadHV',
True)
30 readHVSET = kwargs.get(
'ReadHVSET',
False)
31 readSTATES = kwargs.get(
'ReadSTATES',
True)
33 name = dcs +
'CondAlg'
35 from TileConditions.TileCablingSvcConfig
import TileCablingSvcCfg
39 from TileConditions.TileEMScaleConfig
import TileEMScaleCondAlgCfg
42 from TileConditions.TileFolders
import TileFolders
43 folders = TileFolders(isMC = flags.Input.isMC, isOnline = flags.Common.isOnline)
47 folders.add(
'/TILE/DCS/HV', db)
49 folders.add(
'/TILE/DCS/HVSET', db)
51 folders.add(
'/TILE/DCS/STATES', db)
53 from IOVDbSvc.IOVDbSvcConfig
import addFolderList
56 TileDCSCondAlg=CompFactory.TileDCSCondAlg
59 ReadHVSET = readHVSET,
60 ReadSTATES = readSTATES,
63 acc.addCondAlgo(dcsCondAlg)
69 """Return component accumulator with configured private Tile DCS tool
71 flags -- Athena configuration flags
73 ReadHV -- Read Tile DCS HV folder from DB. Defaults True.
74 ReadHVSET -- Read Tile DCS HVSET folder from DB. Defaults to False.
75 ReadSTATES -- Read Tile DCS STATES folder from DB. Defaults to True.
76 TileDCS -- name of Tile DCS conditions object. Defaults to TileDCS.
81 kwargs.setdefault(
'TileDCS',
'TileDCS')
82 kwargs.setdefault(
'ReadHV',
True)
83 kwargs.setdefault(
'ReadHVSET',
False)
84 kwargs.setdefault(
'ReadSTATUS',
True)
86 dcs = kwargs[
'TileDCS']
90 TileDCSTool=CompFactory.TileDCSTool
96 if __name__ ==
"__main__":
98 from AthenaConfiguration.AllConfigFlags
import initConfigFlags
99 from AthenaConfiguration.TestDefaults
import defaultTestFiles
100 from AthenaCommon.Logging
import log
107 flags.Input.Files = defaultTestFiles.RAW_RUN2
115 acc.printConfig(withDetails =
True, summariseProps =
True)
116 print(acc.getService(
'IOVDbSvc'))
117 acc.store(
open(
'TileDCS.pkl',
'wb') )