8def TileAutoCorrelationCondAlgCfg(flags, **kwargs):
9 """Return component accumulator with configured Tile auto correlation conditions algorithm
10
11 Arguments:
12 flags -- Athena configuration flags
13 Keyword arguments:
14 Source -- source of Tile auto correlation conditions (COOL, FILE). Defaults to COOL.
15 TileAutoCorrelation -- name of Tile auto correlation conditions object. Defaults to TileAutoCorrelaton.
16 """
17
18 acc = ComponentAccumulator()
19
20 source = kwargs.get('Source', 'COOL')
21 autoCorrelation = kwargs.get('TileAutoCorrelation', 'TileAutoCorrelation')
22
23 name = autoCorrelation + 'CondAlg'
24
25 if source == 'COOL':
26
27
28 from TileConditions.TileFolders import TileFolders
29 folders = TileFolders(isMC = flags.Input.isMC, isOnline = flags.Common.isOnline)
30
31 if flags.IOVDb.DatabaseInstance == 'CONDBR2':
32 if not flags.Common.isOnline:
33 autoCorrelationFolder = folders.add('/TILE/OFL02/NOISE/AUTOCR', 'TILE_OFL')
34 else:
35 raise(Exception("No online auto correlation folder in CONDBR2 DB"))
36 else:
37 autoCorrelationFolder = folders.addSplitOnline('/TILE/OFL01/NOISE/AUTOCR', '/TILE/OFL02/NOISE/AUTOCR')
38
39 TileCondProxyCoolFlt=CompFactory.getComp("TileCondProxyCool<TileCalibDrawerFlt>")
40 autoCorrelationProxy =
TileCondProxyCoolFlt(
'TileCondProxyCool_NoiseAutoCr', Source = autoCorrelationFolder)
41
42 from IOVDbSvc.IOVDbSvcConfig import addFolderList
43 acc.merge( addFolderList(flags, folders.get()) )
44
45 elif source == 'FILE':
46
47 TileCondProxyFileFlt=CompFactory.getComp("TileCondProxyFile<TileCalibDrawerFlt>")
48 autoCorrelationProxy =
TileCondProxyFileFlt(
'TileCondProxyFile_NoiseAutoCr', Source =
'TileDefault.acr')
49
50 else:
51 raise(Exception("Invalid source: %s" % source))
52
53 TileCalibFltCondAlg=CompFactory.getComp("TileCalibCondAlg<TileCalibDrawerFlt>")
55 ConditionsProxy = autoCorrelationProxy,
56 TileCalibData = autoCorrelation)
57
58 acc.addCondAlgo(autoCorrelationCondAlg)
59
60 return acc
61
62