3 """Define methods to construct configured Tile EM scale"""
5 from AthenaConfiguration.ComponentAccumulator
import ComponentAccumulator
6 from AthenaConfiguration.ComponentFactory
import CompFactory
8 _validSources = [
'COOL',
'FILE']
11 """Return component accumulator with configured Tile EM scale conditions algorithm
14 flags -- Athena configuration flags
16 Source -- source of EM scale conditions (COOL, FILE). Defaults to COOL.
17 TileEMScale -- name of Tile EM scale conditions object. Defaults to TileEMScale.
21 from TileConditions.TileCablingSvcConfig
import TileCablingSvcCfg
25 source = kwargs.get(
'Source',
'COOL')
26 emScale = kwargs.get(
'TileEMScale',
'TileEMScale')
28 if source
not in _validSources:
29 raise(Exception(
"Invalid source: %s" % source))
31 name = emScale +
'CondAlg'
32 onlCacheUnit =
"Invalid"
36 from TileConditions.TileFolders
import TileFolders
37 folders = TileFolders(isMC = flags.Input.isMC, isOnline = flags.Common.isOnline)
39 if not flags.Input.isMC:
40 onlCacheUnit =
'OnlineMegaElectronVolts'
42 oflLasLinFolder = folders.addSplitOnline(
'/TILE/ONL01/CALIB/LAS/LIN',
'/TILE/OFL02/CALIB/LAS/LIN')
43 oflCesFolder = folders.addSplitOnline(
'/TILE/ONL01/CALIB/CES',
'/TILE/OFL02/CALIB/CES')
44 oflEmsFolder = folders.addSplitOnline(
'/TILE/ONL01/CALIB/EMS',
'/TILE/OFL02/CALIB/EMS')
46 onlCisLinFolder = folders.addSplitMC(
'/TILE/ONL01/CALIB/CIS/LIN',
'/TILE/OFL02/CALIB/CIS/FIT/LIN')
47 onlLasLinFolder = folders.addSplitMC(
'/TILE/ONL01/CALIB/LAS/LIN',
'/TILE/OFL02/CALIB/LAS/LIN')
48 onlCesFolder = folders.addSplitMC(
'/TILE/ONL01/CALIB/CES',
'/TILE/OFL02/CALIB/CES')
49 onlEmsFolder = folders.addSplitMC(
'/TILE/ONL01/CALIB/EMS',
'/TILE/OFL02/CALIB/EMS')
52 if flags.IOVDb.DatabaseInstance ==
'CONDBR2':
53 oflCisLinFolder = folders.addSplitOnline(
'/TILE/ONL01/CALIB/CIS/LIN',
'/TILE/OFL02/CALIB/CIS/LIN')
54 oflCisNlnFolder = folders.addSplitOnline(
'/TILE/ONL01/CALIB/CIS/NLN',
'/TILE/OFL02/CALIB/CIS/NLN')
55 oflLasNlnFolder = folders.addSplitOnline(
'/TILE/ONL01/CALIB/LAS/NLN',
'/TILE/OFL02/CALIB/LAS/NLN')
56 if not flags.Common.isOnline:
57 oflLasFibFolder = folders.add(
'/TILE/OFL02/CALIB/LAS/FIBER',
'TILE_OFL')
59 oflLasFibFolder =
None
61 oflCisLinFolder = folders.addSplitOnline(
'/TILE/ONL01/CALIB/CIS/LIN',
'/TILE/OFL02/CALIB/CIS/FIT/LIN')
62 oflCisNlnFolder = folders.addSplitOnline(
'/TILE/OFL01/CALIB/CIS/FIT/NLN',
'/TILE/OFL02/CALIB/CIS/FIT/NLN')
63 oflLasNlnFolder = folders.addSplitOnline(
'/TILE/OFL01/CALIB/LAS/NLN',
'/TILE/OFL02/CALIB/LAS/NLN')
64 oflLasFibFolder = folders.addSplitOnline(
'/TILE/OFL01/CALIB/LAS/FIBER',
'/TILE/OFL02/CALIB/LAS/FIBER')
66 from IOVDbSvc.IOVDbSvcConfig
import addFolderList
69 TileCondProxyCoolFlt = CompFactory.getComp(
"TileCondProxyCool<TileCalibDrawerFlt>")
70 if not oflLasFibFolder:
88 TileCondProxyFileFlt = CompFactory.getComp(
"TileCondProxyFile<TileCalibDrawerFlt>")
89 oflCisLinProxy =
TileCondProxyFileFlt(
'TileCondProxyFile_OflCisLin', Source =
'TileDefault.cisFitLin')
90 oflCisNlnProxy =
TileCondProxyFileFlt(
'TileCondProxyFile_OflCisNln', Source =
'TileDefault.cisFitNln')
91 oflLasLinProxy =
TileCondProxyFileFlt(
'TileCondProxyFile_OflLasLin', Source =
'TileDefault.lasLin')
92 oflLasNlnProxy =
TileCondProxyFileFlt(
'TileCondProxyFile_OflLasNln', Source =
'TileDefault.lasNln')
93 oflLasFibProxy =
TileCondProxyFileFlt(
'TileCondProxyFile_OflLasFib', Source =
'TileDefault.lasFib')
96 onlCisProxy =
TileCondProxyFileFlt(
'TileCondProxyFile_OflCisLin', Source =
'TileDefault.cisFitLin')
102 TileEMScaleCondAlg=CompFactory.TileEMScaleCondAlg
104 OnlCacheUnit = onlCacheUnit,
105 OflCisLinProxy = oflCisLinProxy,
106 OflCisNlnProxy = oflCisNlnProxy,
107 OflLasLinProxy = oflLasLinProxy,
108 OflLasNlnProxy = oflLasNlnProxy,
109 OflLasFibProxy = oflLasFibProxy,
110 OflCesProxy = oflCesProxy,
111 OflEmsProxy = oflEmsProxy,
112 OnlCisProxy = onlCisProxy,
113 OnlLasProxy = onlLasProxy,
114 OnlCesProxy = onlCesProxy,
115 OnlEmsProxy = onlEmsProxy,
116 TileEMScale = emScale)
120 acc.addCondAlgo(emScaleCondAlg)
126 """Return component accumulator with configured private Tile EM scale tool
129 flags -- Athena configuration flags
131 Source -- source of EM scale conditions (COOL, FILE). Defaults to COOL.
132 TileEMScale -- name of Tile EM scale conditions object. Defaults to TileEMScale.
137 kwargs.setdefault(
'Source',
'COOL')
138 kwargs.setdefault(
'TileEMScale',
'TileEMScale')
140 source = kwargs[
'Source']
141 if source
not in _validSources:
142 raise(Exception(
"Invalid source: %s" % source))
144 emScale = kwargs[
'TileEMScale']
145 name =
'TileCondToolEmscale'
149 TileCondToolEmscale=CompFactory.TileCondToolEmscale
156 """Return component accumulator with configured private Tile expert EM scale tool
159 flags -- Athena configuration flags
161 Source -- source of EM scale conditions (COOL, FILE). Defaults to COOL.
162 TileEMScale -- name of Tile EM scale conditions object. Defaults to TileEMScale.
167 kwargs.setdefault(
'Source',
'COOL')
168 kwargs.setdefault(
'TileEMScale',
'TileEMScale')
170 source = kwargs[
'Source']
171 if source
not in _validSources:
172 raise(Exception(
"Invalid source: %s" % source))
174 emScale = kwargs[
'TileEMScale']
175 name =
'TileExpertToolEmscale'
179 TileExpertToolEmscale=CompFactory.TileExpertToolEmscale
185 if __name__ ==
"__main__":
187 from AthenaConfiguration.AllConfigFlags
import initConfigFlags
188 from AthenaConfiguration.TestDefaults
import defaultTestFiles
189 from AthenaCommon.Logging
import log
196 flags.Input.Files = defaultTestFiles.RAW_RUN2
205 print(emScaleExpertTool)
207 acc.printConfig(withDetails =
True, summariseProps =
True)
208 print(acc.getService(
'IOVDbSvc'))
209 acc.store(
open(
'TileEMScale.pkl',
'wb') )