2 from AthenaConfiguration.ComponentFactory
import CompFactory
3 from IOVDbSvc.IOVDbSvcConfig
import addFolders
7 from LArGeoAlgsNV.LArGMConfig
import LArGMCfg
10 from LArCabling.LArCablingConfig
import LArOnOffIdMappingCfg
14 if dbname ==
"LAR_ONL":
15 folder=
"/LAR/BadChannels/KnownBADFEBs"
17 folder=
"/LAR/BadChannelsOfl/KnownBADFEBs"
20 if not tag.startswith(
"LAR"):
21 if not tag.startswith(
"-"): tag=
"-"+tag
22 tag=
"".
join(folder.split(
"/"))+tag
26 result.merge(
addFolders(flags,folder,dbname,tag=tag,
27 className=
"AthenaAttributeList"))
29 result.addCondAlgo(CompFactory.LArBadFebCondAlg(
"LArKnownBadFebAlg",ReadKey=folder,WriteKey=
"LArBadFeb"))
31 result.addEventAlgo(CompFactory.LArBadFeb2Ascii(FileName=OutputFile))
37 if __name__==
"__main__":
39 parser= argparse.ArgumentParser()
40 parser.add_argument(
"--loglevel", default=
None, help=
"logging level (ALL, VERBOSE, DEBUG,INFO, WARNING, ERROR, or FATAL")
41 parser.add_argument(
"-r",
"--runnumber",default=0x7fffffff, type=int, help=
"run number to query the DB")
42 parser.add_argument(
"-l",
"--lbnumber",default=1, type=int, help=
"LB number to query the DB")
43 parser.add_argument(
"-d",
"--database",default=
"LAR_OFL", help=
"Database name or sqlite file name")
44 parser.add_argument(
"-o",
"--output",default=
"bf_output.txt", help=
"output file name")
45 parser.add_argument(
"-f",
"--folder",default=
None, help=
"database folder to read")
46 parser.add_argument(
"-t",
"--tag",default=
None, help=
"folder-level tag to read")
48 (args,leftover)=parser.parse_known_args(sys.argv[1:])
51 print(
"ERROR, unhandled argument(s):",leftover)
54 from AthenaConfiguration.AllConfigFlags
import initConfigFlags
55 from LArCalibProcessing.LArCalibConfigFlags
import addLArCalibFlags
59 flags.Input.isMC =
False
60 flags.IOVDb.DatabaseInstance=
"CONDBR2"
61 flags.LAr.doAlign=
False
62 flags.Input.RunNumbers=[args.runnumber]
63 flags.IOVDb.GlobalTag=
"CONDBR2-ES1PA-2022-06"
64 from AthenaConfiguration.TestDefaults
import defaultGeometryTags
65 flags.GeoModel.AtlasVersion=defaultGeometryTags.RUN3
68 from AthenaCommon
import Constants
69 if hasattr(Constants,args.loglevel):
70 flags.Exec.OutputLevel=getattr(Constants,args.loglevel)
72 raise ValueError(
"Unknown log-level, allowed values are ALL, VERBOSE, DEBUG,INFO, WARNING, ERROR, FATAL")
76 from AthenaConfiguration.MainServicesConfig
import MainServicesCfg
79 from McEventSelector.McEventSelectorConfig
import McEventSelectorCfg
81 FirstLB=args.lbnumber,
85 TimeStampInterval = 1))