4 'LARConfigurationDSPThresholdFlatTemplates-Qt1sigma-samp1sigma',
5 'LARConfigurationDSPThresholdFlatTemplates-Qt1.5sigma-samp1.5sigma',
6 'LARConfigurationDSPThresholdFlatTemplates-Qt2sigma-samp2sigma',
7 'LARConfigurationDSPThresholdFlatTemplates-Qt3sigma-samp3sigma',
8 'LARConfigurationDSPThresholdFlatTemplates-Qt5sigma-samp5sigma',
9 'LARConfigurationDSPThresholdFlatTemplates-Qt3sigmamuPileup-samp3sigmamuPileup',
10 'LARConfigurationDSPThresholdFlatTemplates-Qt4sigmamuPileup-samp4sigmamuPileup',
11 'LARConfigurationDSPThresholdFlatTemplates-Qt5sigmamuPileup-samp5sigmamuPileup'
16 Sampval=0, Qtval=0, Samppileup=False, Qtpileup=False):
18 from LArGeoAlgsNV.LArGMConfig
import LArGMCfg
21 from LArCabling.LArCablingConfig
import LArOnOffIdMappingCfg
24 from LArBadChannelTool.LArBadChannelConfig
import LArBadChannelCfg,LArBadFebCfg
28 folder=
"/LAR/Configuration/DSPThresholdFlat/Templates"
32 setName=
"-".
join(tag.split(
"-")[1:])
34 from CaloTools.CaloNoiseCondAlgConfig
import CaloNoiseCondAlgCfg
39 from AthenaConfiguration.ComponentFactory
import CompFactory
40 theLArDSPThresholdFillAlg=CompFactory.LArDSPThresholdFillInline(
"LArDSPThresholdFillInline")
42 theLArDSPThresholdFillAlg.OutputLevel=INFO
43 theLArDSPThresholdFillAlg.Key=folder
44 theLArDSPThresholdFillAlg.OutFile=fileName+
".txt"
45 theLArDSPThresholdFillAlg.mode=ModeType
46 theLArDSPThresholdFillAlg.MaskBadChannels=
True
47 theLArDSPThresholdFillAlg.ProblemsToMask=[
"highNoiseHG",
"highNoiseMG",
"highNoiseLG" ]
48 theLArDSPThresholdFillAlg.NameOfSet=setName
51 theLArDSPThresholdFillAlg.tQThreshold=Qtval
52 theLArDSPThresholdFillAlg.samplesThreshold=Sampval
55 theLArDSPThresholdFillAlg.sigmaNoiseSamples=Sampval
56 theLArDSPThresholdFillAlg.sigmaNoiseQt=Qtval
57 theLArDSPThresholdFillAlg.usePileupNoiseSamples=Samppileup
58 theLArDSPThresholdFillAlg.usePileupNoiseQt=Qtpileup
61 theLArDSPThresholdFillAlg.Fill=
True
62 theLArDSPThresholdFillAlg.Dump=
True
64 theLArDSPThresholdFillAlg.Fill=
False
65 theLArDSPThresholdFillAlg.Dump=
True
67 cfg.addEventAlgo(theLArDSPThresholdFillAlg)
70 OutputList=[
"AthenaAttributeList#"+folder ]
73 from RegistrationServices.OutputConditionsAlgConfig
import OutputConditionsAlgCfg
75 ObjectList=OutputList,IOVTagList=OutputTagList,WriteIOV=
True, Run1=RunSince))
77 cfg.addService(CompFactory.IOVRegistrationSvc(RecreateFolders =
False,
78 OverrideNames = [
"tQThr",
"samplesThr",
"trigSumThr",],
79 OverrideTypes = [
"Blob16M",
"Blob16M",
"Blob16M",] ))
83 from IOVDbSvc.IOVDbSvcConfig
import addFolders
84 cfg.merge(
addFolders(flags,folder+
"<tag>"+tag+
"</tag>"))
86 cfg.getService(
"PoolSvc").WriteCatalog=
"xmlcatalog_file:PoolFileCatalog_LARConfigurationDSPThresholdTemplates.xml"
89 from McEventSelector.McEventSelectorConfig
import McEventSelectorCfg
91 RunNumber = flags.Input.RunNumbers[0],
95 TimeStampInterval = 1))
99 if __name__ ==
"__main__":
105 parser = argparse.ArgumentParser(formatter_class=argparse.ArgumentDefaultsHelpFormatter)
107 parser.add_argument(
'-r',
'--run', dest=
'run', default=500000, help=
'Run to read the noise')
108 parser.add_argument(
'-s',
'--since', dest=
'since', default=480000, help=
'Run to start IOV')
109 parser.add_argument(
'-t',
'--tagnum', dest=
'tagnum', default=0, help=
'Which tag to compute')
110 parser.add_argument(
'-x',
'--tagstr', dest=
'tagstr', default=
'', help=
'Tag string to compute')
111 parser.add_argument(
'-n',
'--noisetag', dest=
'noisetag', default=
"", help=
'Which noise tag to use')
112 parser.add_argument(
'--sqlite', dest=
'sql', default=
"", help=
'Sqlite file with noise folder')
113 parser.add_argument(
'-a',
'--localnoise', dest=
'localnoise', default=
False, action=
"store_true", help=
'read the noise from local sqlite')
114 parser.add_argument(
'-p',
'--localpileup', dest=
'localpileup', default=
False, action=
"store_true", help=
'read the pileup from local sqlite')
116 args = parser.parse_args()
117 if help
in args
and args.help
is not None and args.help:
121 for _, value
in args._get_kwargs():
122 if value
is not None:
125 from AthenaConfiguration.MainServicesConfig
import MainServicesCfg
126 from AthenaConfiguration.AllConfigFlags
import initConfigFlags
127 from LArCalibProcessing.LArCalibConfigFlags
import addLArCalibFlags
131 if args.tagstr !=
'':
132 if 'LARConfigurationDSPThresholdFlatTemplates-Qt' not in args.tagstr
or '-samp' not in args.tagstr:
137 tagstr = tagList[
int(args.tagnum)]
if int(args.tagnum)<len(tagList)
else tagList[0]
141 Qtstr=tagstr.split(
"Qt")[1]
142 Sampstr=tagstr.split(
"samp")[1]
144 if "sigma" in tagstr:
150 if len(Qtstr.split(
"sigma")) > 1:
151 print(Qtstr.split(
"sigma")[1])
152 if Qtstr.split(
"sigma")[1].
find(
"Pileup") > -1:
155 if len(Sampstr.split(
"sigma")) > 1:
156 print(Sampstr.split(
"sigma")[1])
157 if Sampstr.split(
"sigma")[1].
find(
"Pileup") > -1:
160 print(
"Setting pileup noise to (Qt,Samp) = ",QtPileup,SampPileup)
162 Qtstr=Qtstr.split(
"sigma")[0]
163 Sampstr=Sampstr.split(
"sigma")[0]
165 elif "HECFCAL" in tagstr:
172 Qtstr=Qtstr.split(
"-")[0]
179 flags.Input.RunNumbers = [
int(args.run),]
181 flags.IOVDb.DBConnection =
"sqlite://;schema=DSPThresholdTemplates.db;dbname=CONDBR2"
183 from AthenaConfiguration.TestDefaults
import defaultGeometryTags
184 flags.GeoModel.AtlasVersion = defaultGeometryTags.RUN3
186 flags.Detector.EnableID=
False
187 flags.Detector.EnableMuon=
False
188 flags.Detector.EnableForward=
False
190 flags.IOVDb.GlobalTag =
'CONDBR2-BLKPA-2024-03'
192 flags.Debug.DumpDetStore=
True
193 flags.Debug.DumpEvtStore=
True
194 flags.Debug.DumpCondStore=
True
197 flags.IOVDb.SqliteInput=args.sql
200 fldrs += [
"/CALO/Ofl/Noise/PileUpNoiseLumi"]
202 fldrs += [
"/LAR/NoiseOfl/CellNoise"]
203 flags.IOVDb.SqliteFolders=fldrs
205 flags.LAr.doHVCorr=
False
213 Sampval=SampVal, Qtval=QtVal, Samppileup=SampPileup, Qtpileup=QtPileup))
215 from IOVDbSvc.IOVDbSvcConfig
import addOverride
216 cfg.merge(
addOverride(flags,
"/CALO/Ofl/Noise/PileUpNoiseLumi",
"CALOOflNoisePileUpNoiseLumi-RUN2-UPD1-00"))
217 if args.noisetag!=
"":
218 cfg.merge(
addOverride(flags,
"/LAR/NoiseOfl/CellNoise",args.noisetag))