3 from AthenaConfiguration.ComponentFactory
import CompFactory
4 from AthenaMonitoring
import AthMonitorCfgHelper
7 """ Configure general ZDC chains monitoring algs """
8 monConfig = AthMonitorCfgHelper(configFlags,
'FwdZDCMonitoringAlgs')
10 zdcMonAlg = monConfig.addAlgorithm(CompFactory.FwdZDCMonitoringAlg,
'FwdZDCTrigMonitoringAlg')
12 zdcMonAlg.triggerList += [
'L1_ZDC_A',
'L1_ZDC_C',
'L1_ZDC_A_C',
'L1_ZDC_XOR']
15 length = len(zdcMonAlg.triggerList)
17 zdcCountsGroup = monConfig.addGroup(zdcMonAlg,
'ZDCall', topPath=
'L1/FwdZDC/')
18 zdcCountsGroup.defineHistogram(
'TrigCounts', title=
'Trigger counts;;Event rate',
19 xbins=length, xmin=0, xmax=length, xlabels=
list(zdcMonAlg.triggerList))
20 zdcCountsGroup.defineHistogram(
'moduleNum,moduleEnergy', type=
'TH2F', title=
';channel ID;CalibEnergy per channel [GeV]',
21 xbins=8, xmin=-0.5, xmax=7.5,
22 ybins=120, ymin=0, ymax=6e4)
23 zdcCountsGroup.defineHistogram(
'e_A,e_C', type=
'TH2F', title=
';Low Gain ADC counts on side A [GeV];Low Gain ADC counts on side C [GeV]',
24 xbins=160, xmin=0.0, xmax=8e4,
25 ybins=160, ymin=0.0, ymax=8e4)
26 zdcCountsGroup.defineHistogram(
'e_A', title=
';CalibEnergy on side A [GeV];counts',
27 xbins=160, xmin=0.0, xmax=8e4)
28 zdcCountsGroup.defineHistogram(
'e_C', title=
';CalibEnergy on side C [GeV];counts',
29 xbins=160, xmin=0.0, xmax=8e4)
32 for chain
in zdcMonAlg.triggerList:
33 zdcExpGroup = monConfig.addGroup(zdcMonAlg, chain+
'_expert', topPath=
'L1/FwdZDC/'+chain+
'/' )
34 zdcExpGroup.defineHistogram(
'moduleNum,moduleEnergy', type=
'TH2F', title=
'occupancy for {};channel ID;CalibEnergy per channel [GeV]'.
format(chain),
35 xbins=8, xmin=-0.5, xmax=7.5,
36 ybins=120, ymin=0, ymax=6e4)
37 zdcExpGroup.defineHistogram(
'e_A,e_C', type=
'TH2F', title=
'occupancy for {};CalibEnergy on side A [GeV];CalibEnergy on side C [GeV]'.
format(chain),
38 xbins=160, xmin=0.0, xmax=8e4,
39 ybins=160, ymin=0.0, ymax=8e4)
40 zdcExpGroup.defineHistogram(
'e_A', title=
'occupancy for {};CalibEnergy on side A [GeV];counts'.
format(chain),
41 xbins=160,xmin=0.0,xmax=8e4)
42 zdcExpGroup.defineHistogram(
'e_C', title=
'occupancy for {};CalibEnergy on side C [GeV];counts'.
format(chain),
43 xbins=160,xmin=0.0,xmax=8e4)
46 return monConfig.result()
49 if __name__==
'__main__':
51 from AthenaCommon.Logging
import log
56 from AthenaConfiguration.AllConfigFlags
import initConfigFlags
58 flags.Output.HISTFileName =
'ExampleMonitorOutput.root'
63 from AthenaConfiguration.MainServicesConfig
import MainServicesCfg
64 from AthenaPoolCnvSvc.PoolReadConfig
import PoolReadCfg
70 cfg.getEventAlgo(
'FwdZDCTrigMonitoringAlg').OutputLevel = DEBUG
71 cfg.printConfig(withDetails=
False)
72 with open(
"cfg.pkl",
"wb")
as f: