3 from AthenaConfiguration.ComponentFactory
import CompFactory
6 from LArGeoAlgsNV.LArGMConfig
import LArGMCfg
10 from LArCabling.LArCablingConfig
import LArOnOffIdMappingCfg
15 if dbname
in (
"LAR",
"LAR_ONL"):
16 folder=
"/LAR/BadChannels/MissingFEBs"
18 folder=
"/LAR/BadChannelsOfl/MissingFEBs"
21 if not tag.startswith(
"LAR"):
22 if not tag.startswith(
"-"): tag=
"-"+tag
23 tag=
"".
join(folder.split(
"/"))+tag
27 if 'MissingFEBs' in folder:
28 from LArBadChannelTool.LArBadChannelConfig
import LArBadFebCfg
31 elif 'KnownBADFEBs' in folder:
32 from LArBadChannelTool.LArBadFebsConfig
import LArKnownBadFebCfg
34 ReadKey=
'LArKnownBadFEBs'
35 elif 'KnownMNBFEBs' in folder:
36 from LArBadChannelTool.LArBadFebsConfig
import LArKnownMNBFebCfg
38 ReadKey=
'LArKnownMNBFEBs'
40 print(
'Unknown folder: ',folder,
' exiting !!!')
44 theLArMF2Ascii=CompFactory.LArBadFeb2Ascii(FileName=OutputFile,BFKey=ReadKey)
45 result.addEventAlgo(theLArMF2Ascii)
51 if __name__==
"__main__":
53 parser= argparse.ArgumentParser()
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=0x7fffffff, type=int, help=
"run number to query the DB")
56 parser.add_argument(
"-l",
"--lbnumber",default=1, type=int, help=
"LB number to query the DB")
57 parser.add_argument(
"-d",
"--database",default=
"LAR_OFL", help=
"Database name or sqlite file name")
58 parser.add_argument(
"-o",
"--output",default=
"bc_output.txt", help=
"output file name")
59 parser.add_argument(
"-f",
"--folder",default=
None, help=
"database folder to read")
60 parser.add_argument(
"-t",
"--tag",default=
None, help=
"folder-level tag to read")
61 parser.add_argument(
"-s",
"--summary",default=
"", help=
"Executive summary file")
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]
78 flags.IOVDb.GlobalTag=
"CONDBR2-ES1PA-2022-06"
79 from AthenaConfiguration.TestDefaults
import defaultGeometryTags
80 flags.GeoModel.AtlasVersion=defaultGeometryTags.RUN3
83 from AthenaCommon
import Constants
84 if hasattr(Constants,args.loglevel):
85 flags.Exec.OutputLevel=getattr(Constants,args.loglevel)
87 raise ValueError(
"Unknown log-level, allowed values are ALL, VERBOSE, DEBUG,INFO, WARNING, ERROR, FATAL")
91 from AthenaConfiguration.MainServicesConfig
import MainServicesCfg
94 from McEventSelector.McEventSelectorConfig
import McEventSelectorCfg
96 FirstLB=args.lbnumber,
100 TimeStampInterval = 1))
103 dbname=args.database,
106 summaryfile=args.summary))