3 """Define methods to construct configured Tile TMDB conditions tool and algorithm"""
5 from AthenaConfiguration.ComponentAccumulator
import ComponentAccumulator
6 from AthenaConfiguration.ComponentFactory
import CompFactory
7 from TileConfiguration.TileConfigFlags
import TileRunType
10 """Return component accumulator with configured Tile TMDB conditions algorithms
13 flags -- Athena configuration flags
15 Source -- source of Tile TMDB conditions (COOL, FILE). Defaults to COOL.
16 TileTMDBThreshold -- name of Tile TMDB threshold conditions object. Defaults to TileTMDBThreshold.
17 TileTMDBDelay -- name of Tile TMDB dealy conditions object. Defaults to TileTMDBDelay.
18 TileTMDBTMF -- name of Tile TMDB TMF conditions object. Defaults to TileTMDBTMF.
19 TileTMDBCalib -- name of Tile TMDB calibration conditions object. Defaults to TileTMDBCalib.
24 source = kwargs.get(
'Source',
'COOL')
25 threshod = kwargs.get(
'TileTMDBThreshold',
'TileTMDBThreshold')
26 delay = kwargs.get(
'TileTMDBDelay',
'TileTMDBDelay')
27 tmf = kwargs.get(
'TileTMDBTMF',
'TileTMDBTMF')
28 calib = kwargs.get(
'TileTMDBCalib',
'TileTMDBCalib')
30 TileCalibFltCondAlg=CompFactory.getComp(
"TileCalibCondAlg<TileCalibDrawerFlt>")
31 def __addCondAlg(calibData, proxy):
33 ConditionsProxy = proxy,
34 TileCalibData = calibData)
35 acc.addCondAlgo(condAlg)
40 from TileConditions.TileFolders
import TileFolders
41 folders = TileFolders(isMC = flags.Input.isMC, isOnline = flags.Common.isOnline)
43 runType = flags.Tile.RunType
44 run = runType.getCommonType().value
46 if flags.IOVDb.DatabaseInstance ==
'CONDBR2':
47 thrFolder = folders.addSplitMC(
'/TILE/ONL01/TMDB/THRESHOLD/' + run,
'/TILE/ONL01/TMDB/THRESHOLD/' + run)
48 delayFolder = folders.addSplitMC(
'/TILE/ONL01/TMDB/DELAY/' + run,
'/TILE/ONL01/TMDB/DELAY/' + run)
49 tmfFolder = folders.addSplitMC(
'/TILE/ONL01/TMDB/TMF/' + run,
'/TILE/ONL01/TMDB/TMF/' + run)
50 calibFolder = folders.addSplitMC(
'/TILE/ONL01/TMDB/CALIB/' + run,
'/TILE/ONL01/TMDB/CALIB/' + run)
52 raise(Exception(
"No Tile TMDB folders in %s" % flags.IOVDb.DatabaseInstancea))
54 TileCondProxyCoolFlt=CompFactory.getComp(
"TileCondProxyCool<TileCalibDrawerFlt>")
60 from IOVDbSvc.IOVDbSvcConfig
import addFolderList
65 raise(Exception(
"Not implemented source %s" % source))
68 __addCondAlg(threshod, thrProxy)
69 __addCondAlg(delay, delayProxy)
70 __addCondAlg(tmf, tmfProxy)
71 __addCondAlg(calib, calibProxy)
77 """Return component accumulator with configured private Tile TMDB conditions tool
80 flags -- Athena configuration flags
82 Source -- source of Tile TMDB conditions (COOL, FILE). Defaults to COOL.
83 TileTMDBThreshold -- name of Tile TMDB threshold conditions object. Defaults to TileTMDBThreshold.
84 TileTMDBDelay -- name of Tile TMDB dealy conditions object. Defaults to TileTMDBDelay.
85 TileTMDBTMF -- name of Tile TMDB TMF conditions object. Defaults to TileTMDBTMF.
86 TileTMDBCalib -- name of Tile TMDB calibration conditions object. Defaults to TileTMDBCalib.
91 kwargs.setdefault(
'Source',
'COOL')
92 kwargs.setdefault(
'TileTMDBThreshold',
'TileTMDBThreshold')
93 kwargs.setdefault(
'TileTMDBDelay',
'TileTMDBDelay')
94 kwargs.setdefault(
'TileTMDBTMF',
'TileTMDBTMF')
95 kwargs.setdefault(
'TileTMDBCalib',
'TileTMDBCalib')
97 threshod = kwargs[
'TileTMDBThreshold']
98 delay = kwargs[
'TileTMDBDelay']
99 tmf = kwargs[
'TileTMDBTMF']
100 calib = kwargs[
'TileTMDBCalib']
104 TileCondToolTMDB=CompFactory.TileCondToolTMDB
106 TileTMDBDelay = delay,
108 TileTMDBCalib = calib) )
113 if __name__ ==
"__main__":
115 from AthenaConfiguration.AllConfigFlags
import initConfigFlags
116 from AthenaConfiguration.TestDefaults
import defaultTestFiles
117 from AthenaCommon.Logging
import log
124 flags.Input.Files = defaultTestFiles.RAW_RUN2
125 flags.Tile.RunType = TileRunType.PHY
133 acc.printConfig(withDetails =
True, summariseProps =
True)
134 print(acc.getService(
'IOVDbSvc'))
135 acc.store(
open(
'TileTMDB.pkl',
'wb') )