3"""Define methods to construct configured Tile DCS tool and conditions algorithm"""
5from AthenaConfiguration.ComponentAccumulator
import ComponentAccumulator
6from 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)))
26 acc = ComponentAccumulator()
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
36 acc.merge( TileCablingSvcCfg(flags) )
39 from TileConditions.TileEMScaleConfig
import TileEMScaleCondAlgCfg
40 acc.merge( TileEMScaleCondAlgCfg(flags) )
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
54 acc.merge( addFolderList(flags, folders.get()) )
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.
79 acc = ComponentAccumulator()
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
96if __name__ ==
"__main__":
98 from AthenaConfiguration.AllConfigFlags
import initConfigFlags
99 from AthenaConfiguration.TestDefaults
import defaultTestFiles
100 from AthenaCommon.Logging
import log
106 flags = initConfigFlags()
107 flags.Input.Files = defaultTestFiles.RAW_RUN2
110 acc = ComponentAccumulator()
115 acc.printConfig(withDetails =
True, summariseProps =
True)
116 print(acc.getService(
'IOVDbSvc'))
117 acc.store( open(
'TileDCS.pkl',
'wb') )
void print(char *figname, TCanvas *c1)
Condition algorithm to prepare TileDCSState object and put it into condition store.
TileDCSCondAlgCfg(flags, **kwargs)
TileDCSToolCfg(flags, **kwargs)