9def TileDSP_ThresholdCondAlgCfg(flags, **kwargs):
10 """Return component accumulator with configured Tile DSP threshold conditions algorithm
11
12 Arguments:
13 flags -- Athena configuration flags
14 Keyword arguments:
15 Source -- source of Tile auto correlation conditions (COOL, FILE). Defaults to COOL.
16 TileDSP_Threshold -- name of Tile auto correlation conditions object. Defaults to TileDSP_Threshold.
17 """
18
19 acc = ComponentAccumulator()
20
21 source = kwargs.get('Source', 'COOL')
22 dspThreshold = kwargs.get('TileDSP_Threshold', 'TileDSP_Threshold')
23
24 name = dspThreshold + 'CondAlg'
25
26 if source == 'COOL':
27
28
29 from TileConditions.TileFolders import TileFolders
30 folders = TileFolders(isMC = flags.Input.isMC, isOnline = flags.Common.isOnline)
31
32 if flags.IOVDb.DatabaseInstance == 'CONDBR2':
33 dspThresholdFolder = folders.addSplitOnline('/TILE/ONL01/DSP/THRESHOLD', '/TILE/OFL02/DSP/THRESHOLD')
34 else:
35 raise(Exception("No Tile DSP threshold folder in %s" % flags.IOVDb.DatabaseInstancea))
36
37 TileCondProxyCoolFlt=CompFactory.getComp("TileCondProxyCool<TileCalibDrawerFlt>")
38 dspThresholdProxy =
TileCondProxyCoolFlt(
'TileCondProxyCool_DspThreshold', Source = dspThresholdFolder)
39
40 from IOVDbSvc.IOVDbSvcConfig import addFolderList
41 acc.merge( addFolderList(flags, folders.get()) )
42
43 elif source == 'FILE':
44
45 TileCondProxyFileFlt=CompFactory.getComp("TileCondProxyFile<TileCalibDrawerFlt>")
46 dspThresholdProxy =
TileCondProxyFileFlt(
'TileCondProxyFile_DspThreshold', Source =
'TileDefault.dspThreshold')
47 else:
48 raise(Exception("Invalid source: %s" % source))
49
50 TileCalibFltCondAlg=CompFactory.getComp("TileCalibCondAlg<TileCalibDrawerFlt>")
52 ConditionsProxy = dspThresholdProxy,
53 TileCalibData = dspThreshold)
54
55 acc.addCondAlgo(dspThresholdCondAlg)
56
57 return acc
58
59