2 from AthenaConfiguration.ComponentFactory
import CompFactory
3 from AthenaCommon.Logging
import logging
7 IOVStart=[0,0],IOVEnd=[0x7FFFFFFF,0xFFFFFFFF]):
9 logger = logging.getLogger(
"LArBadFebDBAlgCfg" )
10 from LArGeoAlgsNV.LArGMConfig
import LArGMCfg
13 from LArCabling.LArCablingConfig
import LArOnOffIdMappingCfg
17 if dbname ==
"LAR_ONL":
18 folder=
"/LAR/BadChannels/KnownBADFEBs"
20 folder=
"/LAR/BadChannelsOfl/KnownBADFEBs"
23 if not tag.startswith(
"LAR"):
24 if not tag.startswith(
"-"): tag=
"-"+tag
25 tag=
"".
join(folder.split(
"/"))+tag
30 logger.info(
"Writing to folder %s, tag %s",folder,tag)
31 result.addCondAlgo(CompFactory.LArBadFebCondAlg(
"LArKnownBadFebAlg",ReadKey=
"",InputFileName=InputFile,WriteKey=
"LArBadFeb"))
34 theLArDBAlg=CompFactory.LArBadChannelDBAlg()
35 theLArDBAlg.WritingMode = 1
36 theLArDBAlg.FEBFolder=folder
37 result.addEventAlgo(theLArDBAlg)
39 from RegistrationServices.OutputConditionsAlgConfig
import OutputConditionsAlgCfg
41 ObjectList=[
"AthenaAttributeList#"+folder],
43 Run1=IOVStart[0],LB1=IOVStart[1],
44 Run2=IOVEnd[0],LB2=IOVEnd[1]))
49 if __name__==
"__main__":
51 parser= argparse.ArgumentParser()
52 parser.add_argument(
"inputfile")
53 parser.add_argument(
"--loglevel", default=
None, help=
"logging level (ALL, VERBOSE, DEBUG,INFO, WARNING, ERROR, or FATAL")
54 parser.add_argument(
"-r",
"--runnumber",default=0, type=int, help=
"IOV start (runnumber)")
55 parser.add_argument(
"-l",
"--lbnumber",default=0, type=int, help=
"IOV start (LB number)")
56 parser.add_argument(
"--runnumber2",default=0x7FFFFFFF, type=int, help=
"IOV start (runnumber)")
57 parser.add_argument(
"--lbnumber2",default=0xFFFFFFFF, type=int, help=
"IOV start (LB number)")
58 parser.add_argument(
"-o",
"--output",default=
"BadFebs.db", help=
"sqlite output file name")
59 parser.add_argument(
"-f",
"--folder",default=
None, help=
"database folder to create")
60 parser.add_argument(
"-t",
"--tag",default=
None, help=
"folder-level tag (or tag-suffix) to create")
63 (args,leftover)=parser.parse_known_args(sys.argv[1:])
66 print(
"ERROR, unhandled argument(s):",leftover)
69 from AthenaConfiguration.AllConfigFlags
import initConfigFlags
70 from LArCalibProcessing.LArCalibConfigFlags
import addLArCalibFlags
74 flags.Input.isMC =
False
75 flags.IOVDb.DatabaseInstance=
"CONDBR2"
76 flags.LAr.doAlign=
False
77 flags.Input.RunNumbers=[args.runnumber
if args.runnumber>0
else 300000]
78 flags.IOVDb.GlobalTag=
"CONDBR2-ES1PA-2022-06"
79 from AthenaConfiguration.TestDefaults
import defaultGeometryTags
80 flags.GeoModel.AtlasVersion=defaultGeometryTags.RUN3
82 flags.IOVDb.DBConnection=
"sqlite://;schema="+args.output+
";dbname=CONDBR2"
85 from AthenaCommon
import Constants
86 if hasattr(Constants,args.loglevel):
87 flags.Exec.OutputLevel=getattr(Constants,args.loglevel)
89 raise ValueError(
"Unknown log-level, allowed values are ALL, VERBOSE, DEBUG,INFO, WARNING, ERROR, FATAL")
93 from AthenaConfiguration.MainServicesConfig
import MainServicesCfg
96 from McEventSelector.McEventSelectorConfig
import McEventSelectorCfg
98 FirstLB=args.lbnumber,
101 InitialTimeStamp = 0,
102 TimeStampInterval = 1))
108 IOVStart=[args.runnumber,args.lbnumber],
109 IOVEnd=[args.runnumber2,args.lbnumber2]