16 Sampval=0, Qtval=0, Samppileup=False, Qtpileup=False,scale=0.):
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 theLArDSPThresholdFillAlg.ScaleIW=scale
50
51 if ModeType=="fixed":
52 theLArDSPThresholdFillAlg.tQThreshold=Qtval
53 theLArDSPThresholdFillAlg.samplesThreshold=Sampval
54
55 if ModeType=="noise":
56 theLArDSPThresholdFillAlg.sigmaNoiseSamples=Sampval
57 theLArDSPThresholdFillAlg.sigmaNoiseQt=Qtval
58 theLArDSPThresholdFillAlg.usePileupNoiseSamples=Samppileup
59 theLArDSPThresholdFillAlg.usePileupNoiseQt=Qtpileup
60
61 if fill:
62 theLArDSPThresholdFillAlg.Fill=True
63 theLArDSPThresholdFillAlg.Dump=True
64 else:
65 theLArDSPThresholdFillAlg.Fill=False
66 theLArDSPThresholdFillAlg.Dump=True
67
68 cfg.addEventAlgo(theLArDSPThresholdFillAlg)
69
70 if fill:
71 OutputList=[ "AthenaAttributeList#"+folder ]
72 OutputTagList=[tag]
73
74 from RegistrationServices.OutputConditionsAlgConfig import OutputConditionsAlgCfg
75 cfg.merge(OutputConditionsAlgCfg(flags,outputFile="LArDSPthresholdTemplates.pool.root",
76 ObjectList=OutputList,IOVTagList=OutputTagList,WriteIOV=True, Run1=RunSince))
77
78 cfg.addService(CompFactory.IOVRegistrationSvc(RecreateFolders = False,
79 OverrideNames = ["tQThr","samplesThr","trigSumThr",],
80 OverrideTypes = ["Blob16M","Blob16M","Blob16M",] ))
81
82
83 else:
84 from IOVDbSvc.IOVDbSvcConfig import addFolders
85 cfg.merge(addFolders(flags,folder+"<tag>"+tag+"</tag>"))
86
87 cfg.getService("PoolSvc").WriteCatalog="xmlcatalog_file:PoolFileCatalog_LARConfigurationDSPThresholdTemplates.xml"
88
89
90 from McEventSelector.McEventSelectorConfig import McEventSelectorCfg
91 cfg.merge(McEventSelectorCfg(flags,
92 RunNumber = flags.Input.RunNumbers[0],
93 EventsPerRun = 1,
94 FirstEvent = 1,
95 InitialTimeStamp = 0,
96 TimeStampInterval = 1))
97
98 return cfg
99