16 Sampval=0, Qtval=0, Samppileup=False, Qtpileup=False):
17
18 from LArGeoAlgsNV.LArGMConfig import LArGMCfg
19 cfg=LArGMCfg(flags)
20
21 from LArCabling.LArCablingConfig import LArOnOffIdMappingCfg
22 cfg.merge(LArOnOffIdMappingCfg(flags))
23
24 from LArBadChannelTool.LArBadChannelConfig import LArBadChannelCfg,LArBadFebCfg
25 cfg.merge(LArBadChannelCfg(flags))
26 cfg.merge(LArBadFebCfg(flags))
27
28 folder="/LAR/Configuration/DSPThresholdFlat/Templates"
29
30 fileName=ModeType+tag
31
32 setName="-".join(tag.split("-")[1:])
33
34 from CaloTools.CaloNoiseCondAlgConfig import CaloNoiseCondAlgCfg
35 cfg.merge(CaloNoiseCondAlgCfg(flags,"totalNoise"))
36 cfg.merge(CaloNoiseCondAlgCfg(flags,"electronicNoise"))
37 cfg.merge(CaloNoiseCondAlgCfg(flags,"pileupNoise"))
38
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
49
50 if ModeType=="fixed":
51 theLArDSPThresholdFillAlg.tQThreshold=Qtval
52 theLArDSPThresholdFillAlg.samplesThreshold=Sampval
53
54 if ModeType=="noise":
55 theLArDSPThresholdFillAlg.sigmaNoiseSamples=Sampval
56 theLArDSPThresholdFillAlg.sigmaNoiseQt=Qtval
57 theLArDSPThresholdFillAlg.usePileupNoiseSamples=Samppileup
58 theLArDSPThresholdFillAlg.usePileupNoiseQt=Qtpileup
59
60 if fill:
61 theLArDSPThresholdFillAlg.Fill=True
62 theLArDSPThresholdFillAlg.Dump=True
63 else:
64 theLArDSPThresholdFillAlg.Fill=False
65 theLArDSPThresholdFillAlg.Dump=True
66
67 cfg.addEventAlgo(theLArDSPThresholdFillAlg)
68
69 if fill:
70 OutputList=[ "AthenaAttributeList#"+folder ]
71 OutputTagList=[tag]
72
73 from RegistrationServices.OutputConditionsAlgConfig import OutputConditionsAlgCfg
74 cfg.merge(OutputConditionsAlgCfg(flags,outputFile="LArDSPthresholdTemplates.pool.root",
75 ObjectList=OutputList,IOVTagList=OutputTagList,WriteIOV=True, Run1=RunSince))
76
77 cfg.addService(CompFactory.IOVRegistrationSvc(RecreateFolders = False,
78 OverrideNames = ["tQThr","samplesThr","trigSumThr",],
79 OverrideTypes = ["Blob16M","Blob16M","Blob16M",] ))
80
81
82 else:
83 from IOVDbSvc.IOVDbSvcConfig import addFolders
84 cfg.merge(addFolders(flags,folder+"<tag>"+tag+"</tag>"))
85
86 cfg.getService("PoolSvc").WriteCatalog="xmlcatalog_file:PoolFileCatalog_LARConfigurationDSPThresholdTemplates.xml"
87
88
89 from McEventSelector.McEventSelectorConfig import McEventSelectorCfg
90 cfg.merge(McEventSelectorCfg(flags,
91 RunNumber = flags.Input.RunNumbers[0],
92 EventsPerRun = 1,
93 FirstEvent = 1,
94 InitialTimeStamp = 0,
95 TimeStampInterval = 1))
96
97 return cfg
98