19 from LArMonitoring.GlobalVariables
import lArDQGlobals
20 from AthenaCommon.Logging
import logging
21 log = logging.getLogger(
'LArCoherentNoisefractionConfigCore ')
23 larCoherentNoisefractionMonAlg = helper.addAlgorithm(algoinstance,
'larCoherentNoisefractionMonAlg')
26 allGroups=[
"tot",
"top",
"bot",
"left",
"right",
"q1",
"q2",
"q3",
"q4",
"qs11",
"qs22",
"qs3",
"qs4"]
27 groupsNChan=[128,64,64,64,64,32,32,32,32,32,32,32,32]
28 allMonitor=[
True,
True,
True,
True,
True,
True,
True,
True,
True,
True,
True,
True,
True]
33 larCoherentNoisefractionMonAlg.IsCalibrationRun = inputFlags.LArMon.calibRun
34 except AttributeError:
35 larCoherentNoisefractionMonAlg.IsCalibrationRun =
False
37 larCoherentNoisefractionMonAlg.LArDigitContainerKey = inputFlags.LArMon.LArDigitKey
38 except AttributeError:
39 larCoherentNoisefractionMonAlg.LArDigitContainerKey =
'FREE'
40 larCoherentNoisefractionMonAlg.ListOfGroupNames = allGroups
41 larCoherentNoisefractionMonAlg.GroupNchan = groupsNChan
42 if len(groupsToMonitor) == 0:
43 customGroupstoMonitor = allMonitor
45 if len(customGroupstoMonitor) != len(allMonitor):
46 from AthenaCommon.Logging
import logging
47 logging.getLogger().warning(
"Wrong list of groups to monitor, setting all !")
48 customGroupstoMonitor = allMonitor
50 customGroupstoMonitor = groupsToMonitor
51 larCoherentNoisefractionMonAlg.GroupsToMonitor = customGroupstoMonitor
52 log.info(
"GroupsToMonitor: ",customGroupstoMonitor)
55 customFEBStoMonitor = inputFlags.LArMon.customFEBsToMonitor
56 except AttributeError:
57 customFEBStoMonitor = [
"endcapAft19slot12",
"endcapAft19slot09",
"endcapAft20slot09"]
60 from ROOT
import LArStrHelper
62 customFEBStoMonitor=[larStrHelp.fixFEBname(nm)
for nm
in customFEBStoMonitor]
65 larCoherentNoisefractionMonAlg.TriggerChain =
"HLT_noalg_zb_L1ZB, HLT_noalg_cosmiccalo_L1RD1_EMPTY"
68 setCustomFEBS=
set(customFEBStoMonitor)
69 febsToMonitorBarrelA=list(setCustomFEBS.intersection(lArDQGlobals.febsBarrelA))
70 febsToMonitorEndcapA=list(setCustomFEBS.intersection(lArDQGlobals.febsEndcapA))
71 febsToMonitorBarrelC=list(setCustomFEBS.intersection(lArDQGlobals.febsBarrelC))
72 febsToMonitorEndcapC=list(setCustomFEBS.intersection(lArDQGlobals.febsEndcapC))
74 if len(febsToMonitorBarrelA)==0
and len(febsToMonitorEndcapA)==0
and len(febsToMonitorBarrelC)==0
and len(febsToMonitorEndcapC)==0:
75 log.warning(
" None of the following FEBs were recognised, no plot will be produced")
76 log.warning(customFEBStoMonitor)
77 larCoherentNoisefractionMonAlg.PlotsOFF=
True
78 larCoherentNoisefractionMonAlg.PlotCustomFEBSset=
False
79 larCoherentNoisefractionMonAlg.FEBlist=[]
82 larCoherentNoisefractionMonAlg.PlotCustomFEBSset=
True
83 larCoherentNoisefractionMonAlg.FEBlist=febsToMonitorBarrelA+febsToMonitorBarrelC+febsToMonitorEndcapA+febsToMonitorEndcapC
87 for grp
in range(0,len(allGroups)):
88 if not customGroupstoMonitor[grp]:
continue
91 cnfArray = helper.addArray([larCoherentNoisefractionMonAlg.FEBlist],larCoherentNoisefractionMonAlg,allGroups[grp])
95 tot_plot_name=allGroups[grp]+
"_cnf_tot"
96 tot_var_and_name=
"SumDev;"+tot_plot_name
97 cnfArray.defineHistogram(tot_var_and_name,
100 path=hist_path+
'BarrelA',
101 xbins=lArDQGlobals.CNFN_tot, xmin=lArDQGlobals.CNFXmin_tot, xmax=lArDQGlobals.CNFXmax_tot,
102 pattern=febsToMonitorBarrelA)
104 cnfArray.defineHistogram(tot_var_and_name,
107 path=hist_path+
'BarrelC',
108 xbins=lArDQGlobals.CNFN_tot, xmin=lArDQGlobals.CNFXmin_tot, xmax=lArDQGlobals.CNFXmax_tot,
109 pattern=febsToMonitorBarrelC)
111 cnfArray.defineHistogram(tot_var_and_name,
114 path=hist_path+
'EndcapA',
115 xbins=lArDQGlobals.CNFN_tot, xmin=lArDQGlobals.CNFXmin_tot, xmax=lArDQGlobals.CNFXmax_tot,
116 pattern=febsToMonitorEndcapA)
119 cnfArray.defineHistogram(tot_var_and_name,
122 path=hist_path+
'EndcapC',
123 xbins=lArDQGlobals.CNFN_tot, xmin=lArDQGlobals.CNFXmin_tot, xmax=lArDQGlobals.CNFXmax_tot,
124 pattern=febsToMonitorEndcapC)
127 noncoh_plot_name=allGroups[grp]+
"_cnf_noncoh"
128 noncoh_var_and_name=
"Dev;"+noncoh_plot_name
130 cnfArray.defineHistogram(noncoh_var_and_name,
131 title=noncoh_plot_name,
133 path=hist_path+
'BarrelA',
134 xbins=lArDQGlobals.CNFN_ncoh, xmin=lArDQGlobals.CNFXmin_ncoh, xmax=lArDQGlobals.CNFXmax_ncoh,
135 pattern=febsToMonitorBarrelA)
137 cnfArray.defineHistogram(noncoh_var_and_name,
138 title=noncoh_plot_name,
140 path=hist_path+
'BarrelC',
141 xbins=lArDQGlobals.CNFN_ncoh, xmin=lArDQGlobals.CNFXmin_ncoh, xmax=lArDQGlobals.CNFXmax_ncoh,
142 pattern=febsToMonitorBarrelC)
144 cnfArray.defineHistogram(noncoh_var_and_name,
145 title=noncoh_plot_name,
147 path=hist_path+
'EndcapA',
148 xbins=lArDQGlobals.CNFN_ncoh, xmin=lArDQGlobals.CNFXmin_ncoh, xmax=lArDQGlobals.CNFXmax_ncoh,
149 pattern=febsToMonitorEndcapA)
151 cnfArray.defineHistogram(noncoh_var_and_name,
152 title=noncoh_plot_name,
154 path=hist_path+
'EndcapC',
155 xbins=lArDQGlobals.CNFN_ncoh, xmin=lArDQGlobals.CNFXmin_ncoh, xmax=lArDQGlobals.CNFXmax_ncoh,
156 pattern=febsToMonitorEndcapC)
158 log.info(cnfArray.toolList())
160 from AthenaConfiguration.ComponentAccumulator
import ComponentAccumulator
161 cfg=ComponentAccumulator()
162 cfg.merge(helper.result())