8def TileDCSCondAlgCfg(flags, **kwargs):
9 """Return component accumulator with configured Tile DCS conditions algorithm
10
11 Arguments:
12 flags -- Athena configuration flags
13 Keyword arguments:
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.
18 """
19
20 isMC = flags.Input.isMC
21 isOnline = flags.Common.isOnline
22
23 if isOnline or isMC:
24 raise(Exception('No Tile DCS information in online [%s] or MC [%s]' % (isOnline, isMC)))
25
26 acc = ComponentAccumulator()
27
28 dcs = kwargs.get('TileDCS', 'TileDCS')
29 readHV = kwargs.get('ReadHV', True)
30 readHVSET = kwargs.get('ReadHVSET', False)
31 readSTATES = kwargs.get('ReadSTATES', True)
32
33 name = dcs + 'CondAlg'
34
35 from TileConditions.TileCablingSvcConfig import TileCablingSvcCfg
36 acc.merge( TileCablingSvcCfg(flags) )
37
38 if not readHVSET:
39 from TileConditions.TileEMScaleConfig import TileEMScaleCondAlgCfg
40 acc.merge( TileEMScaleCondAlgCfg(flags) )
41
42 from TileConditions.TileFolders import TileFolders
43 folders = TileFolders(isMC = flags.Input.isMC, isOnline = flags.Common.isOnline)
44
45 db = 'DCS_OFL'
46 if readHV:
47 folders.add('/TILE/DCS/HV', db)
48 if readHVSET:
49 folders.add('/TILE/DCS/HVSET', db)
50 if readSTATES:
51 folders.add('/TILE/DCS/STATES', db)
52
53 from IOVDbSvc.IOVDbSvcConfig import addFolderList
54 acc.merge( addFolderList(flags, folders.get()) )
55
56 TileDCSCondAlg=CompFactory.TileDCSCondAlg
58 ReadHV = readHV,
59 ReadHVSET = readHVSET,
60 ReadSTATES = readSTATES,
61 TileDCS = dcs)
62
63 acc.addCondAlgo(dcsCondAlg)
64
65 return acc
66
67
Condition algorithm to prepare TileDCSState object and put it into condition store.