4 from AthenaConfiguration.ComponentFactory
import CompFactory
7 if __name__==
"__main__":
11 from time
import strptime
12 from calendar
import timegm
15 parser = argparse.ArgumentParser(formatter_class=argparse.ArgumentDefaultsHelpFormatter)
16 parser.add_argument(
'-d',
'--date', dest=
'date', default=
'2024-04-30:00:00:00', help=
'date', type=str)
17 parser.add_argument(
'-o',
'--outsqlite', dest=
'outsql', default=
"hvcorrections.sqlite", help=
'Output sqlite file', type=str)
18 parser.add_argument(
'-t',
'--tag', dest=
'glbtag', default=
'CONDBR2-BLKPA-2024-02', help=
'Global tag to use', type=str)
20 args = parser.parse_args()
21 if help
in args
and args.help
is not None and args.help:
26 ts=strptime(args.date+
'/UTC',
'%Y-%m-%d:%H:%M:%S/%Z')
27 TimeStamp=
int(timegm(ts))*1000000000
29 print(
"ERROR in time specification,",args.date,
" use e.g. 2024-05-25:14:01:00")
32 from LArCalibProcessing.TimeStampToRunLumi
import TimeStampToRunLumi
36 print(
"WARNING: Failed to convert time",TimeStamp,
"into a run/lumi number")
43 print(
"Working on run",RunNumber,
"LB",LumiBlock,
"Timestamp:",TimeStamp)
46 from AthenaConfiguration.MainServicesConfig
import MainServicesCfg
49 from AthenaConfiguration.AllConfigFlags
import initConfigFlags
50 from LArCalibProcessing.LArCalibConfigFlags
import addLArCalibFlags
55 LArHVScaleCorrFolder =
"/LAR/ElecCalibOfl/HVScaleCorr"
58 keyOutput =
"LArHVScaleCorr"
64 flags.IOVDb.DBConnection=
"sqlite://;schema="+args.outsql +
";dbname=L1CALO"
65 flags.IOVDb.GlobalTag = args.glbtag
67 from AthenaConfiguration.TestDefaults
import defaultGeometryTags
68 flags.GeoModel.AtlasVersion = defaultGeometryTags.RUN3
71 flags.Input.RunNumbers=[RunNumber,]
73 flags.Debug.DumpDetStore=
True
74 flags.Debug.DumpCondStore=
True
75 flags.Debug.DumpEvtStore=
True
81 from LArCabling.LArCablingConfig
import LArOnOffIdMappingCfg
85 from McEventSelector.McEventSelectorConfig
import McEventSelectorCfg
87 RunNumber = flags.Input.RunNumbers[0],
91 TimeStampInterval = 1))
94 from LArCalibUtils.LArHVScaleConfig
import LArHVScaleCfg
97 cfg.addEventAlgo(CompFactory.L1CaloHVDummyContainers())
103 L1CaloFolderList = []
104 L1CaloFolderList += [
"/TRIGGER/L1Calo/V1/Calibration/PpmDeadChannels"]
105 L1CaloFolderList += [
"/TRIGGER/L1Calo/V1/Conditions/DisabledTowers"]
106 L1CaloFolderList += [
"/TRIGGER/L1Calo/V1/Conditions/RunParameters"]
107 L1CaloFolderList += [
"/TRIGGER/L1Calo/V1/Configuration/PprChanDefaults"]
108 L1CaloFolderList += [
"/TRIGGER/L1Calo/V2/Configuration/PprChanDefaults"]
110 L1CaloFolderList += [
"/TRIGGER/L1Calo/V2/Configuration/PprChanStrategy"]
111 L1CaloFolderList += [
"/TRIGGER/L1Calo/V1/Calibration/Physics/PprChanCalib"]
113 L1CaloFolderList += [
"/TRIGGER/L1Calo/V2/Calibration/Physics/PprChanCalib"]
114 L1CaloFolderList += [
"/TRIGGER/L1Calo/V2/Calibration/Physics/PprChanCommon"]
115 L1CaloFolderList += [
"/TRIGGER/L1Calo/V2/Calibration/Physics/PprChanLowMu"]
116 L1CaloFolderList += [
"/TRIGGER/L1Calo/V2/Calibration/Physics/PprChanHighMu"]
118 L1CaloFolderList += [
"/TRIGGER/L1Calo/V2/Calibration/Calib1/PprChanCalib"]
119 L1CaloFolderList += [
"/TRIGGER/L1Calo/V2/Calibration/Calib1/PprChanCommon"]
120 L1CaloFolderList += [
"/TRIGGER/L1Calo/V2/Calibration/Calib1/PprChanLowMu"]
121 L1CaloFolderList += [
"/TRIGGER/L1Calo/V2/Calibration/Calib1/PprChanHighMu"]
123 L1CaloFolderList += [
"/TRIGGER/L1Calo/V2/Calibration/Calib2/PprChanCalib"]
124 L1CaloFolderList += [
"/TRIGGER/L1Calo/V2/Calibration/Calib2/PprChanCommon"]
125 L1CaloFolderList += [
"/TRIGGER/L1Calo/V2/Calibration/Calib2/PprChanLowMu"]
126 L1CaloFolderList += [
"/TRIGGER/L1Calo/V2/Calibration/Calib2/PprChanHighMu"]
128 L1CaloFolderList += [
"/TRIGGER/L1Calo/V1/Conditions/RunParameters"]
129 L1CaloFolderList += [
"/TRIGGER/L1Calo/V1/Conditions/DerivedRunPars"]
130 L1CaloFolderList += [
"/TRIGGER/Receivers/Conditions/VgaDac"]
131 L1CaloFolderList += [
"/TRIGGER/Receivers/Conditions/Strategy"]
133 from IOVDbSvc.IOVDbSvcConfig
import addFolders
134 for l1calofolder
in L1CaloFolderList:
135 cfg.merge(
addFolders(flags,l1calofolder, db=
"TRIGGER", tag=
"HEAD", className=
"CondAttrListCollection"))
136 cfg.addCondAlgo(CompFactory.L1CaloCondAlg(UsePhysicsRegime =
True, UseCalib1Regime =
False, UseCalib2Regime =
False))
138 from CaloConditions.CaloConditionsConfig
import CaloTTIdMapCfg
141 l1hvcorr = CompFactory.L1CaloHVCorrectionsForDB()
143 from TrigT1CaloCalibTools.L1CaloCalibToolsConfig
import L1CaloCells2TriggerTowersCfg
154 cfg.addEventAlgo(l1hvcorr)
157 from RegistrationServices.OutputConditionsAlgConfig
import OutputConditionsAlgCfg
159 ObjectList = [
"CondAttrListCollection#/TRIGGER/L1Calo/V1/Results/RxLayers",
160 "CondAttrListCollection#/TRIGGER/L1Calo/V1/Results/HVCorrections"],
166 cfg.addService(CompFactory.IOVRegistrationSvc(RecreateFolders =
True,
170 cfg.getService(
"IOVDbSvc").DBInstance=
""
172 print(
"Start running...")