2 from AthenaConfiguration.ComponentFactory
import CompFactory
3 from AthenaCommon.Logging
import logging
7 IOVStart=[0,0],IOVEnd=[0x7FFFFFFF,0xFFFFFFFF]):
9 logger = logging.getLogger(
"LArBadChannelDBAlgCfg" )
10 from LArGeoAlgsNV.LArGMConfig
import LArGMCfg
14 from LArCabling.LArCablingConfig
import LArOnOffIdMappingCfg
19 if dbname
in (
"LAR",
"LAR_ONL"):
20 folder=
"/LAR/BadChannels/MissingFEBs"
22 folder=
"/LAR/BadChannelsOfl/MissingFEBs"
25 tag=
"".
join(folder.split(
"/"))+
"-RUN2-UPD1-00"
27 if not tag.startswith(
"LAR"):
28 if not tag.startswith(
"-"): tag=
"-"+tag
29 tag=
"".
join(folder.split(
"/"))+tag
31 logger.info(
"Writing to folder %s, tag %s",folder,tag)
32 result.addCondAlgo(CompFactory.LArBadFebCondAlg(ReadKey=
"",InputFileName=InputFile))
35 theLArDBAlg=CompFactory.LArBadChannelDBAlg()
36 theLArDBAlg.WritingMode = 1
37 theLArDBAlg.FEBFolder=folder
38 result.addEventAlgo(theLArDBAlg)
40 from RegistrationServices.OutputConditionsAlgConfig
import OutputConditionsAlgCfg
42 ObjectList=[
"AthenaAttributeList#"+folder],
44 Run1=IOVStart[0],LB1=IOVStart[1],
45 Run2=IOVEnd[0],LB2=IOVEnd[1]))
50 if __name__==
"__main__":
52 parser= argparse.ArgumentParser()
53 parser.add_argument(
"inputfile")
54 parser.add_argument(
"--loglevel", default=
None, help=
"logging level (ALL, VERBOSE, DEBUG,INFO, WARNING, ERROR, or FATAL")
55 parser.add_argument(
"-r",
"--runnumber",default=0, type=int, help=
"IOV start (runnumber)")
56 parser.add_argument(
"-l",
"--lbnumber",default=0, type=int, help=
"IOV start (LB number)")
57 parser.add_argument(
"--runnumber2",default=0x7FFFFFFF, type=int, help=
"IOV start (runnumber)")
58 parser.add_argument(
"--lbnumber2",default=0xFFFFFFFF, type=int, help=
"IOV start (LB number)")
59 parser.add_argument(
"-o",
"--output",default=
"BadChannels.db", help=
"sqlite output file name")
60 parser.add_argument(
"-f",
"--folder",default=
None, help=
"database folder to create")
61 parser.add_argument(
"-t",
"--tag",default=
None, help=
"folder-level tag (or tag-suffix) to create")
64 (args,leftover)=parser.parse_known_args(sys.argv[1:])
67 print(
"ERROR, unhandled argument(s):",leftover)
70 from AthenaConfiguration.AllConfigFlags
import initConfigFlags
71 from LArCalibProcessing.LArCalibConfigFlags
import addLArCalibFlags
75 flags.Input.isMC =
False
76 flags.IOVDb.DatabaseInstance=
"CONDBR2"
77 flags.LAr.doAlign=
False
78 flags.Input.RunNumbers=[args.runnumber
if args.runnumber>0
else 300000]
79 flags.IOVDb.GlobalTag=
"CONDBR2-ES1PA-2022-06"
80 from AthenaConfiguration.TestDefaults
import defaultGeometryTags
81 flags.GeoModel.AtlasVersion=defaultGeometryTags.RUN3
83 flags.IOVDb.DBConnection=
"sqlite://;schema="+args.output+
";dbname=CONDBR2"
86 from AthenaCommon
import Constants
87 if hasattr(Constants,args.loglevel):
88 flags.Exec.OutputLevel=getattr(Constants,args.loglevel)
90 raise ValueError(
"Unknown log-level, allowed values are ALL, VERBOSE, DEBUG,INFO, WARNING, ERROR, FATAL")
94 from AthenaConfiguration.MainServicesConfig
import MainServicesCfg
97 from McEventSelector.McEventSelectorConfig
import McEventSelectorCfg
99 FirstLB=args.lbnumber,
102 InitialTimeStamp = 0,
103 TimeStampInterval = 1))
109 IOVStart=[args.runnumber,args.lbnumber],
110 IOVEnd=[args.runnumber2,args.lbnumber2]