3 from AthenaConfiguration.ComponentFactory
import CompFactory
5 from AthenaConfiguration.ComponentAccumulator
import ComponentAccumulator,ConfigurationError
6 from IOVDbSvc.IOVDbSvcConfig
import IOVDbSvcCfg,addFolderList, getSqliteContent
11 LArDAC2uASymAlg = CompFactory.getComp(
"LArSymConditionsAlg<LArDAC2uAMC, LArDAC2uASym>")
12 LArMinBiasAverageSymAlg = CompFactory.getComp(
"LArSymConditionsAlg<LArMinBiasAverageMC, LArMinBiasAverageSym>")
13 LArMinBiasSymAlg = CompFactory.getComp(
"LArSymConditionsAlg<LArMinBiasMC, LArMinBiasSym>")
14 LArNoiseSymAlg = CompFactory.getComp(
"LArSymConditionsAlg<LArNoiseMC, LArNoiseSym>")
15 LArRampSymAlg = CompFactory.getComp(
"LArSymConditionsAlg<LArRampMC, LArRampSym>")
16 LArfSamplSymAlg = CompFactory.getComp(
"LArSymConditionsAlg<LArfSamplMC, LArfSamplSym>")
17 LArAutoCorrSymAlg = CompFactory.getComp(
"LArSymConditionsAlg<LArAutoCorrMC, LArAutoCorrSym>")
18 LAruA2MeVSymAlg = CompFactory.getComp(
"LArSymConditionsAlg<LAruA2MeVMC, LAruA2MeVSym>")
19 LArShapeSymAlg = CompFactory.getComp(
"LArSymConditionsAlg<LArShape32MC, LArShape32Sym>")
20 LArMPhysOverMcalSymAlg = CompFactory.getComp(
"LArSymConditionsAlg<LArMphysOverMcalMC, LArMphysOverMcalSym>")
23 LArHVScaleCorrCondFlatAlg = CompFactory.getComp(
"LArFlatConditionsAlg<LArHVScaleCorrFlat>")
24 LAruA2MeVCondAlg = CompFactory.getComp(
"LArFlatConditionsAlg<LAruA2MeVFlat>")
25 LArDAC2uACondAlg = CompFactory.getComp(
"LArFlatConditionsAlg<LArDAC2uAFlat>")
26 LArPedestalCondAlg = CompFactory.getComp(
"LArFlatConditionsAlg<LArPedestalFlat>")
27 LArRampCondAlg = CompFactory.getComp(
"LArFlatConditionsAlg<LArRampFlat>")
28 LArMphysOverMcalCondAlg = CompFactory.getComp(
"LArFlatConditionsAlg<LArMphysOverMcalFlat>")
29 LArOFCCondAlg = CompFactory.getComp(
"LArFlatConditionsAlg<LArOFCFlat>")
30 LArShapeCondAlg = CompFactory.getComp(
"LArFlatConditionsAlg<LArShapeFlat>")
32 LArHVScaleCorrSCCondFlatAlg = CompFactory.getComp(
"LArFlatConditionsAlg<LArHVScaleCorrSC>")
33 LArDAC2uASCCondAlg = CompFactory.getComp(
"LArFlatConditionsAlg<LArDAC2uASC>")
34 LArRampSCCondAlg = CompFactory.getComp(
"LArFlatConditionsAlg<LArRampSC>")
35 LAruA2MeVSCCondAlg = CompFactory.getComp(
"LArFlatConditionsAlg<LAruA2MeVSC>")
36 LArfSamplSCCondAlg = CompFactory.getComp(
"LArFlatConditionsAlg<LArfSamplSC>")
37 LArShapeSCCondAlg = CompFactory.getComp(
"LArFlatConditionsAlg<LArShapeSC>")
38 LArPedestalSCCondAlg = CompFactory.getComp(
"LArFlatConditionsAlg<LArPedestalSC>")
39 LArNoiseSCCondAlg = CompFactory.getComp(
"LArFlatConditionsAlg<LArNoiseSC>")
40 LArMinBiasSCCondAlg = CompFactory.getComp(
"LArFlatConditionsAlg<LArMinBiasSC>")
41 LArAutoCorrSCCondAlg = CompFactory.getComp(
"LArFlatConditionsAlg<LArAutoCorrSC>")
42 LArPileupAverageSCCondAlg = CompFactory.getComp(
"LArFlatConditionsAlg<LArMinBiasAverageSC>")
43 LArMphysOverMcalSCCondAlg = CompFactory.getComp(
"LArFlatConditionsAlg<LArMphysOverMcalSC>")
44 LArOFCSCCondAlg = CompFactory.getComp(
"LArFlatConditionsAlg<LArOFCSC>")
53 from AthenaConfiguration.Enums
import LHCPeriod
56 if flags.GeoModel.Run < LHCPeriod.Run2 :
67 sqliteFolders=
getSqliteContent(flags.IOVDb.SqliteInput,flags.IOVDb.SqliteFolders,flags.IOVDb.DatabaseInstance)
69 _larCondDBFoldersDataR2 = {
"Ramp":(
"LArRamp",
"/LAR/ElecCalibFlat/Ramp", LArRampCondAlg ),
70 "DAC2uA":(
"LArDAC2uA",
"/LAR/ElecCalibFlat/DAC2uA",LArDAC2uACondAlg),
71 "Pedestal":(
"LArPedestal",
"/LAR/ElecCalibFlat/Pedestal",LArPedestalCondAlg),
72 "uA2MeV":(
"LAruA2MeV",
"/LAR/ElecCalibFlat/uA2MeV", LAruA2MeVCondAlg),
73 "MphysOverMcal":(
"LArMphysOverMcal",
"/LAR/ElecCalibFlat/MphysOverMcal",LArMphysOverMcalCondAlg),
74 "OFC":(
"LArOFC",
"/LAR/ElecCalibFlat/OFC",LArOFCCondAlg),
75 "Shape":(
"LArShape",
"/LAR/ElecCalibFlat/Shape",LArShapeCondAlg),
76 "HVScaleCorr":(
"LArHVScaleCorr",
"/LAR/ElecCalibFlat/HVScaleCorr",LArHVScaleCorrCondFlatAlg),
77 "fSampl":(
"LArfSamplSym",
"/LAR/ElecCalibMC/fSampl",LArfSamplSymAlg),
81 iovDbSvc=result.getService(
"IOVDbSvc")
82 condLoader=result.getCondAlgo(
"CondInputLoader")
84 for condData
in condObjs:
86 outputKey,fldr,calg=_larCondDBFoldersDataR2[condData]
88 raise ConfigurationError(
"No conditions data %s found for Run-2 data" % condData)
90 if fldr
in sqliteFolders:
91 sqlite=sqliteFolders[fldr]
96 persClass=
"CondAttrListCollection"
98 if flags.LAr.OFCShapeFolder
and condData ==
"OFC":
99 fldr=
"/LAR/ElecCalibOfl/OFC/PhysWave/RTM/"+flags.LAr.OFCShapeFolder
100 dbString=sqlite
or "<db>COOLOFL_LAR/CONDBR2</db>"
101 persClass=
"LArOFCComplete"
103 elif flags.LAr.OFCShapeFolder
and condData ==
"Shape":
104 fldr=
"/LAR/ElecCalibOfl/Shape/RTM/"+flags.LAr.OFCShapeFolder
105 dbString=sqlite
or "<db>COOLOFL_LAR/CONDBR2</db>"
106 persClass=
"LArShapeComplete"
108 elif condData ==
"fSampl":
109 if not flags.Overlay.DataOverlay:
110 raise ConfigurationError(
"fSampl is only supported for data overlay")
111 dbString=
"<db>COOLOFL_LAR/OFLP200</db>"
112 persClass=
"LArfSamplMC"
113 result.addCondAlgo(CompFactory.LArMCSymCondAlg(ReadKey=
"LArOnOffIdMap"))
114 result.addCondAlgo(calg(ReadKey=
"LArfSampl", WriteKey=outputKey))
117 dbString=sqlite
or "<db>COOLONL_LAR/CONDBR2</db>"
119 iovDbSvc.Folders.append(fldr+dbString)
120 condLoader.Load.add((persClass,fldr))
122 result.addCondAlgo(calg (ReadKey=fldr, WriteKey=outputKey))
128 sqliteFolders=
getSqliteContent(flags.IOVDb.SqliteInput,tuple(flags.IOVDb.SqliteFolders),flags.IOVDb.DatabaseInstance)
130 _larCondDBFoldersDataSC = {
"Ramp":(
"LArRampSC",
"/LAR/ElecCalibFlatSC/Ramp", LArRampSCCondAlg ),
131 "DAC2uA":(
"LArDAC2uASC",
"/LAR/ElecCalibFlatSC/DAC2uA",LArDAC2uASCCondAlg),
132 "Pedestal":(
"LArPedestalSC",
"/LAR/ElecCalibFlatSC/Pedestal",LArPedestalSCCondAlg),
133 "uA2MeV":(
"LAruA2MeVSC",
"/LAR/ElecCalibFlatSC/uA2MeV", LAruA2MeVSCCondAlg),
134 "MphysOverMcal":(
"LArMphysOverMcalSC",
"/LAR/ElecCalibFlatSC/MphysOverMcal",LArMphysOverMcalSCCondAlg),
135 "OFC":(
"LArOFCSC",
"/LAR/ElecCalibFlatSC/OFC",LArOFCSCCondAlg),
136 "Shape":(
"LArShapeSC",
"/LAR/ElecCalibFlatSC/Shape",LArShapeSCCondAlg),
137 "HVScaleCorr":(
"LArHVScaleCorrSC",
"/LAR/ElecCalibFlatSC/HVScaleCorr",LArHVScaleCorrSCCondFlatAlg),
138 "fSampl":(
"LArfSamplSC",
"/LAR/ElecCalibMCSC/fSampl",LArfSamplSCCondAlg),
142 iovDbSvc=result.getService(
"IOVDbSvc")
143 condLoader=result.getCondAlgo(
"CondInputLoader")
145 for condData
in condObjs:
147 outputKey,fldr,calg=_larCondDBFoldersDataSC[condData]
149 raise ConfigurationError(
"No conditions data %s found for SCdata" % condData)
151 if fldr
in sqliteFolders:
152 sqlite=sqliteFolders[fldr]
156 persClass=
"CondAttrListCollection"
157 if condData ==
"fSampl":
159 dbString=
"<db>COOLOFL_LAR/OFLP200</db>"
160 result.addCondAlgo(calg(ReadKey=
"LArfSampl", WriteKey=outputKey))
163 dbString=sqlite
or "<db>COOLONL_LAR/CONDBR2</db>"
164 iovDbSvc.Folders.append(fldr+dbString)
165 condLoader.Load.add((persClass,fldr))
167 result.addCondAlgo(calg (ReadKey=fldr, WriteKey=outputKey))
175 _larCondDBFoldersDataR1 = {
"Ramp":(
"/LAR/ElecCalibOnl/Ramp",
"LAR_ONL",
"LArRampComplete",
None),
176 "DAC2uA":(
"/LAR/ElecCalibOnl/DAC2uA",
"LAR_ONL",
"LArDAC2uAMC",LArDAC2uASymAlg),
177 "Pedestal":(
"/LAR/ElecCalibOnl/Pedestal<key>LArPedestal</key>",
"LAR_ONL",
"LArPedestalComplete",
None),
178 "uA2MeV":(
"/LAR/ElecCalibOfl/uA2MeV/Symmetry",
"LAR_OFL",
"LAruA2MeVMC",LAruA2MeVSymAlg),
179 "MphysOverMcal":(
"/LAR/ElecCalibOfl/MphysOverMcal/RTM",
"LAR_OFL",
"LArMphysOverMcalComplete",
None),
180 "HVScaleCorr":(
"/LAR/ElecCalibOnl/HVScaleCorr",
"LAR_ONL",
"LArHVScaleCorrComplete",
None),
181 "OFC":(
"/LAR/ElecCalibOfl/OFC/PhysWave/RTM/"+ flags.LAr.OFCShapeFolder
if len(flags.LAr.OFCShapeFolder)>0
else "/LAR/ElecCalibOfl/OFC/PhysWave/RTM/5samples1phase",
"LAR_OFL",
"LArOFCComplete",
None),
182 "Shape":(
"/LAR/ElecCalibOfl/Shape/RTM/"+ flags.LAr.OFCShapeFolder
if len(flags.LAr.OFCShapeFolder)>0
else "/LAR/ElecCalibOfl/Shape/RTM/5samples1phase",
"LAR_OFL",
"LArShapeComplete",
None),
189 for condData
in condObjs:
191 folder,db,obj,calg=_larCondDBFoldersDataR1[condData]
193 raise ConfigurationError(
"No conditions data %s found for Run-1 data" % condData)
194 folderlist.append((folder,db,obj))
196 if obj.endswith (
'MC'):
198 result.addCondAlgo(calg(ReadKey=obj,WriteKey=obj+
"Sym"))
205 _larCondDBFoldersMC = {
206 "Ramp":(
"LArRampMC",
"/LAR/ElecCalibMC/Ramp",
"LArRamp", LArRampSymAlg ),
207 "AutoCorr":(
"LArAutoCorrMC",
"/LAR/ElecCalibMC/AutoCorr",
"LArAutoCorr", LArAutoCorrSymAlg),
208 "DAC2uA":(
"LArDAC2uAMC",
"/LAR/ElecCalibMC/DAC2uA",
"LArDAC2uA",LArDAC2uASymAlg),
209 "Pedestal":(
"LArPedestalMC",
"/LAR/ElecCalibMC/Pedestal",
"LArPedestal",
None),
210 "Noise":(
"LArNoiseMC",
"/LAR/ElecCalibMC/Noise",
"LArNoise",LArNoiseSymAlg),
211 "fSampl":(
"LArfSamplMC",
"/LAR/ElecCalibMC/fSampl",
"LArfSampl",LArfSamplSymAlg),
212 "uA2MeV":(
"LAruA2MeVMC",
"/LAR/ElecCalibMC/uA2MeV",
"LAruA2MeV", LAruA2MeVSymAlg),
213 "MinBias":(
"LArMinBiasMC",
"/LAR/ElecCalibMC/MinBias",
"LArMinBias",LArMinBiasSymAlg),
214 "Shape":(
"LArShape32MC",
"/LAR/ElecCalibMC/Shape",
"LArShape",LArShapeSymAlg),
215 "MinBiasAvc":(
"LArMinBiasAverageMC",
"/LAR/ElecCalibMC/MinBiasAverage",
"LArMinBiasAverage",LArMinBiasAverageSymAlg),
216 "MphysOverMcal":(
"LArMphysOverMcalMC",
"/LAR/ElecCalibMC/MphysOverMcal",
"LArMphysOverMcal",LArMPhysOverMcalSymAlg),
217 "HVScaleCorr" : (
"LArHVScaleCorrComplete",
'/LAR/ElecCalibMC/HVScaleCorr',
"LArHVScaleCorr",
None)
222 from LArCabling.LArCablingConfig
import LArOnOffIdMappingCfg
224 LArMCSymCondAlg=CompFactory.LArMCSymCondAlg
227 for folder
in folders:
229 classname,fldr,key,calg=_larCondDBFoldersMC[folder]
231 raise ConfigurationError(
"No conditions data %s found for Monte Carlo" % folder)
233 folderlist+=[(fldr,detdb,classname),]
235 result.addCondAlgo(calg(ReadKey=key,WriteKey=key+
"Sym"))
242 _larCondDBFoldersMC = {
243 "RampSC":(
'CondAttrListCollection',
"/LAR/ElecCalibMCSC/Ramp",
"LArRampSC", LArRampSCCondAlg ),
244 "DAC2uASC":(
'CondAttrListCollection',
"/LAR/ElecCalibMCSC/DAC2uA",
"LArDAC2uASC",LArDAC2uASCCondAlg),
245 "uA2MeVSC":(
'CondAttrListCollection',
"/LAR/ElecCalibMCSC/uA2MeV",
"LAruA2MeVSC",LAruA2MeVSCCondAlg),
246 "fSamplSC":(
'CondAttrListCollection',
'/LAR/ElecCalibMCSC/fSampl',
"LArfSamplSC",LArfSamplSCCondAlg),
247 "ShapeSC":(
'CondAttrListCollection',
'/LAR/ElecCalibMCSC/Shape',
"LArShapeSC",LArShapeSCCondAlg),
248 "PileupAverageSC":(
'CondAttrListCollection',
'/LAR/ElecCalibMCSC/LArPileupAverage',
"LArPileupAverageSC",LArPileupAverageSCCondAlg),
249 "PedestalSC":(
'CondAttrListCollection',
'/LAR/ElecCalibMCSC/Pedestal',
"LArPedestalSC",LArPedestalSCCondAlg),
250 "NoiseSC":(
'CondAttrListCollection',
'/LAR/ElecCalibMCSC/Noise',
"LArNoiseSC",LArNoiseSCCondAlg),
251 "MinBiasSC":(
'CondAttrListCollection',
'/LAR/ElecCalibMCSC/MinBias',
"LArMinBiasSC",LArMinBiasSCCondAlg),
252 "AutoCorrSC":(
'CondAttrListCollection',
'/LAR/ElecCalibMCSC/AutoCorr',
"LArAutoCorrSC",LArAutoCorrSCCondAlg)
257 for folder
in folders:
259 classname,fldr,key,calg=_larCondDBFoldersMC[folder]
261 raise ConfigurationError(
"No conditions data %s found for Monte Carlo" % folder)
263 folderlist+=[(fldr,detdb,classname),]
265 result.addCondAlgo(calg(ReadKey=fldr,WriteKey=key))
271 if __name__ ==
"__main__":
272 from AthenaConfiguration.AllConfigFlags
import initConfigFlags
273 from AthenaConfiguration.TestDefaults
import defaultTestFiles
277 flags1.Input.Files = defaultTestFiles.RAW_RUN2
279 acc1 = LArElecCalibDBCfg (flags1, [
'Ramp',
'Pedestal'])
280 acc1.printCondAlgs(summariseProps=
True)
281 print (
'IOVDbSvc:', acc1.getService(
'IOVDbSvc').Folders)
286 flags2.Input.Files = defaultTestFiles.RAW_RUN2
287 from AthenaConfiguration.Enums
import LHCPeriod
288 flags2.GeoModel.Run=LHCPeriod.Run1
290 acc2 = LArElecCalibDBCfg (flags2, [
'Ramp',
'Pedestal'])
291 acc2.printCondAlgs(summariseProps=
True)
292 print (
'IOVDbSvc:', acc2.getService(
'IOVDbSvc').Folders)
297 flags3.Input.Files = defaultTestFiles.ESD
299 acc3 = LArElecCalibDBCfg (flags3, [
'Ramp',
'Pedestal'])
300 acc3.printCondAlgs(summariseProps=
True)
301 print (
'IOVDbSvc:', acc3.getService(
'IOVDbSvc').Folders)