37 The histogram binning depends on the algorithm settings, configure separately
40 from AthenaConfiguration.ComponentAccumulator
import ComponentAccumulator
45 from TrigT1CaloMonitoring.LVL1CaloMonitoringConfig
import L1CaloMonitorCfgHelper
46 helper = L1CaloMonitorCfgHelper(flags,
None,
'EfexMonitoringCfg')
51 baseGroupName = EfexMonAlg.PackageName
55 trigPath =
'Developer/Efex/'
60 if "DAODSim" in key: path =
"DAODSim/"
61 elif "Sim" in key: path =
"Sim/"
62 if "_eEMx" in key: path +=
"eEMx"
63 elif "_eEM" in key: path +=
"eEM"
64 elif "_eTaux" in key: path +=
"eTAUx"
65 elif "_eTau" in key: path +=
"eTAU"
68 cut_names = [
"LowPtCut",
"HiPtCut"]
69 cut_vals = [EfexMonAlg.LowPtCut, EfexMonAlg.HiPtCut]
75 for phiOct
in range(0,8):
76 for etaIdx
in range(-25,25):
77 locIdxs += [
str(phiOct) +
":" +
str(etaIdx)]
79 for containerKey
in (
list(EfexMonAlg.eFexEMTobKeyList) +
list(EfexMonAlg.eFexTauTobKeyList)):
80 helper.defineHistogram(containerKey +
'_nTOBs_nocut;h_n'+containerKey+
'_nocut', title=
'Number of '+containerKey+
';Number of '+containerKey+
';Events',
81 fillGroup = baseGroupName,
82 type=
'TH1I', xbins=100,xmin=-0.5,xmax=99.5)
83 if "Sim" not in containerKey:
85 helper.defineHistogram(
"LBN,locIdx,tobEt;h_"+containerKey+
"_et_posLbnMap", title =
"Average " + containerKey +
" ET;LB;Position (Octant:Eta)",
86 fillGroup = baseGroupName +
"_" + containerKey,
87 path = (
"Expert/Outputs/" if "x" not in containerKey
else trigPath)+pathFromKey(containerKey),
88 hanConfig={
"description":
"Check for horizontal anomalies (hotspot/coldspot) or vertical anomalies (whole-system hot/cold)"},
90 xbins=1,xmin=0,xmax=1, ylabels=locIdxs, opt=[
'kAddBinsDynamically'])
91 helper.defineHistogram(f
"LBN,{containerKey}_nTOBs_nocut;h_"+containerKey+
"_nTOBs", title =
"Average # of " + containerKey +
" TOBs;LBN",
92 fillGroup = baseGroupName,
94 xbins=1,xmin=0,xmax=1,ybins=20,ymin=-0.5,ymax=19.5, opt=[
'kAddBinsDynamically'])
97 helper.defineDQAlgorithm(
"Efex_eEM_etaThiMapFilled",
98 hanConfig={
"libname":
"libdqm_summaries.so",
"name":
"Bins_Equal_Threshold",
"BinThreshold":
"0."},
99 thresholdConfig={
"NBins":[1,64*50]},
101 helper.defineDQAlgorithm(
"Efex_eTAU_etaThiMapFilled",
102 hanConfig={
"libname":
"libdqm_summaries.so",
"name":
"Bins_Equal_Threshold",
"BinThreshold":
"0."},
103 thresholdConfig={
"NBins":[0,64*50]},
107 for cut_name, cut_val
in zip(cut_names, cut_vals):
108 cut_title_addition =
'' if (cut_val == 0.0)
else ' [Et>=' +
'%.1f'%(cut_val/1000) +
'GeV]'
110 for containerKey
in EfexMonAlg.eFexEMTobKeyList:
111 fillGroup = baseGroupName+
'_'+containerKey+
'_'+cut_name
112 tobTypeStr =
"xTOB" if (
'xRoI' in containerKey)
else "TOB"
113 simStr =
"Sim" if (
'Sim' in containerKey)
else ""
114 tobStr = tobTypeStr + simStr
116 helper.defineHistogram(
'nEMTOBs;h_nEmTOBs', title=
'Number of eFex EM '+tobStr+
's'+cut_title_addition+
';EM '+tobStr+
's;Number of EM '+tobStr+
's',
118 type=
'TH1I', path=trigPath+pathFromKey(containerKey)+cut_name, xbins=10,xmin=0,xmax=10)
120 helper.defineHistogram(
'TOBTransverseEnergy;h_TOBTransverseEnergy', title=
'eFex '+tobStr+
' EM Transverse Energy [MeV]'+cut_title_addition,
122 type=
'TH1F', path=trigPath+pathFromKey(containerKey)+cut_name, xbins=100,xmin=0,xmax=50000)
124 helper.defineHistogram(
'TOBEta;h_TOBEta', title=
'eFex '+tobStr+
' EM Eta'+cut_title_addition,
126 type=
'TH1F', path=trigPath+pathFromKey(containerKey)+cut_name, xbins=50,xmin=-2.5,xmax=2.5)
128 helper.defineHistogram(
'TOBPhi;h_TOBPhi', title=
'eFex '+tobStr+
' EM Phi'+cut_title_addition,
130 type=
'TH1F', path=trigPath+pathFromKey(containerKey)+cut_name, xbins=64,xmin=-math.pi,xmax=math.pi)
132 helper.defineHistogram(f
"TOBEta,TOBPhi;h_{containerKey}_{cut_name}_EtaPhiMap", title=
'eEM '+tobStr+
' Count'+cut_title_addition+
';#eta;#phi',
134 hanConfig={
"display":
"SetPalette(55)",
135 "description":f
"Inspect for hot/cold spots - check help for list of known hot/coldspots, then check <a href='./detail/h_{containerKey}_{cut_name}_posVsLBN'>detail timeseries</a>. Warning if more than 1 deadspot, but could just be low stats",
"algorithm":
"Efex_eEM_etaThiMapFilled"},
137 path=((
"Expert/Outputs/"+pathFromKey(containerKey))
if "Sim" not in containerKey
and "x" not in containerKey
else trigPath+pathFromKey(containerKey)+cut_name),
138 xbins=50,xmin=-2.5,xmax=2.5,ybins=64,ymin=-math.pi,ymax=math.pi,opt=[
'kAlwaysCreate'])
140 if "Sim" not in containerKey
and "x" not in containerKey:
141 helper.defineHistogram(f
"LBN,binNumber;h_{containerKey}_{cut_name}_posVsLBN", title=
'eEM '+tobStr+
' Count'+cut_title_addition+
';LB;50(y-1)+x',
143 hanConfig={
"description":f
"Timeseries of TOB counts at each location ... y-axis relates to x and y bin numbers from <a href='../h_{containerKey}_{cut_name}_EtaPhiMap'>eta-phi map</a>. Use Projection X1 for 1D plot"},
145 path=
"Expert/Outputs/"+pathFromKey(containerKey)+
"/detail",
146 xbins=1,xmin=0,xmax=10,
147 ybins=64*50,ymin=0.5,ymax=64*50+0.5,opt=[
'kAddBinsDynamically'])
149 helper.defineHistogram(
'TOBshelfNumber;h_TOBshelfNumber', title=
'eFex '+tobStr+
' EM Shelf Number'+cut_title_addition,
151 type=
'TH1F', path=trigPath+pathFromKey(containerKey)+cut_name, xbins=2,xmin=0,xmax=2)
153 helper.defineHistogram(
'TOBeFEXNumberSh0;h_TOBeFEXNumberShelf0', title=
'eFex '+tobStr+
' EM Module Number Shelf 0'+cut_title_addition,
155 type=
'TH1F', path=trigPath+pathFromKey(containerKey)+cut_name, xbins=12,xmin=0,xmax=12)
157 helper.defineHistogram(
'TOBeFEXNumberSh1;h_TOBeFEXNumberShelf1', title=
'eFex '+tobStr+
' EM Module Number Shelf 1'+cut_title_addition,
159 type=
'TH1F', path=trigPath+pathFromKey(containerKey)+cut_name, xbins=12,xmin=0,xmax=12)
161 helper.defineHistogram(
'TOBfpga;h_TOBfpga', title=
'eFex '+tobStr+
' EM FPGA'+cut_title_addition,
163 type=
'TH1F', path=trigPath+pathFromKey(containerKey)+cut_name, xbins=4,xmin=0,xmax=4)
165 helper.defineHistogram(
'TOBReta;h_TOBReta', title=
'eFex '+tobStr+
' EM Reta'+cut_title_addition,
167 type=
'TH1F', path=trigPath+pathFromKey(containerKey)+cut_name,xbins=250,xmin=0,xmax=1)
169 helper.defineHistogram(
'TOBRhad;h_TOBRhad', title=
'eFex '+tobStr+
' EM Rhad'+cut_title_addition,
171 type=
'TH1F', path=trigPath+pathFromKey(containerKey)+cut_name, xbins=250,xmin=0,xmax=1)
173 helper.defineHistogram(
'TOBWstot;h_TOBWstot', title=
'eFex '+tobStr+
' EM Wstot'+cut_title_addition,
175 type=
'TH1F', path=trigPath+pathFromKey(containerKey)+cut_name, xbins=250,xmin=0,xmax=1)
177 threshold_labels = [
'fail',
'loose',
'medium',
'tight']
178 helper.defineHistogram(
'TOBReta_threshold;h_TOBReta_threshold', title=
'eFex '+tobStr+
' EM Reta threshold'+cut_title_addition,
180 type=
'TH1F', path=trigPath+pathFromKey(containerKey)+cut_name,xbins=4,xmin=0,xmax=4.0,xlabels=threshold_labels)
182 helper.defineHistogram(
'TOBRhad_threshold;h_TOBRhad_threshold', title=
'eFex '+tobStr+
' EM Rhad threshold'+cut_title_addition,
184 type=
'TH1F', path=trigPath+pathFromKey(containerKey)+cut_name, xbins=4,xmin=0,xmax=4.0,xlabels=threshold_labels)
186 helper.defineHistogram(
'TOBWstot_threshold;h_TOBWstot_threshold', title=
'eFex '+tobStr+
' EM Wstot threshold'+cut_title_addition,
188 type=
'TH1F', path=trigPath+pathFromKey(containerKey)+cut_name, xbins=4,xmin=0,xmax=4.0,xlabels=threshold_labels)
191 for containerKey
in EfexMonAlg.eFexTauTobKeyList:
192 fillGroup = baseGroupName+
'_'+containerKey+
'_'+cut_name
193 tobTypeStr =
"xTOB" if (
'xRoI' in containerKey)
else "TOB"
194 simStr =
"Sim" if (
'Sim' in containerKey)
else ""
195 tobStr = tobTypeStr + simStr
197 helper.defineHistogram(
'nTauTOBs;h_nTauTOBs', title=
'Number of eFex Tau '+tobStr+
's'+cut_title_addition+
';Tau '+tobStr+
's;Number of Tau '+tobStr+
's',
198 fillGroup = fillGroup,
199 type=
'TH1I', path=trigPath+pathFromKey(containerKey)+cut_name, xbins=10,xmin=0,xmax=10)
201 helper.defineHistogram(
'tauTOBTransverseEnergy;h_tauTOBTransverseEnergy', title=
'eFex '+tobStr+
' Tau Transverse Energy [MeV]'+cut_title_addition,
202 fillGroup = fillGroup,
203 type=
'TH1F', path=trigPath+pathFromKey(containerKey)+cut_name, xbins=100,xmin=0,xmax=50000)
205 helper.defineHistogram(
'tauTOBEta;h_tauTOBEta', title=
'eFex '+tobStr+
' Tau Eta'+cut_title_addition,
206 fillGroup = fillGroup,
207 type=
'TH1F', path=trigPath+pathFromKey(containerKey)+cut_name, xbins=60,xmin=-2.5,xmax=2.5)
209 helper.defineHistogram(
'tauTOBPhi;h_tauTOBPhi', title=
'eFex '+tobStr+
' Tau Phi'+cut_title_addition,
210 fillGroup = fillGroup,
211 type=
'TH1F', path=trigPath+pathFromKey(containerKey)+cut_name, xbins=100,xmin=-math.pi,xmax=math.pi)
213 helper.defineHistogram(f
"tauTOBEta,tauTOBPhi;h_{containerKey}_{cut_name}_EtaPhiMap", title=
'eTAU '+tobStr+
' Count'+cut_title_addition+
';#eta;#phi',
214 fillGroup = fillGroup,
215 hanConfig={
"display":
"SetPalette(55)",
216 "description":f
"Inspect for hot/cold spots - check help for list of known hot/coldspots, then check <a href='./detail/h_{containerKey}_{cut_name}_posVsLBN'>detail timeseries</a>. Warning if any deadspots/empty, but could just be low stats",
"algorithm":
"Efex_eTAU_etaThiMapFilled"},
218 path=((
"Expert/Outputs/"+pathFromKey(containerKey))
if "Sim" not in containerKey
and "x" not in containerKey
else (trigPath+pathFromKey(containerKey)+cut_name)),
219 xbins=50,xmin=-2.5,xmax=2.5,ybins=64,ymin=-math.pi,ymax=math.pi,opt=[
'kAlwaysCreate'])
221 if "Sim" not in containerKey
and "x" not in containerKey:
222 helper.defineHistogram(f
"LBN,binNumber;h_{containerKey}_{cut_name}_posVsLBN", title=
'eTAU '+tobStr+
' Count'+cut_title_addition+
';LB;50(y-1)+x',
224 hanConfig={
"description":f
"Timeseries of TOB counts at each location ... y-axis relates to x and y bin numbers from <a href='../h_{containerKey}_{cut_name}_EtaPhiMap'>eta-phi map</a>. Use Projection X1 for 1D plot"},
226 path=
"Expert/Outputs/"+pathFromKey(containerKey)+
"/detail",
227 xbins=1,xmin=0,xmax=10,
228 ybins=64*50,ymin=0.5,ymax=64*50+0.5,opt=[
'kAddBinsDynamically'])
230 helper.defineHistogram(
'tauTOBshelfNumber;h_tauTOBshelfNumber', title=
'eFex '+tobStr+
' Tau Shelf Number'+cut_title_addition,
231 fillGroup = fillGroup,
232 type=
'TH1F', path=trigPath+pathFromKey(containerKey)+cut_name, xbins=2,xmin=0,xmax=2)
234 helper.defineHistogram(
'tauTOBeFEXNumberSh0;h_tauTOBeFEXNumberShelf0', title=
'eFex '+tobStr+
' Tau Module Number Shelf 0'+cut_title_addition,
235 fillGroup = fillGroup,
236 type=
'TH1F', path=trigPath+pathFromKey(containerKey)+cut_name, xbins=12,xmin=0,xmax=12)
238 helper.defineHistogram(
'tauTOBeFEXNumberSh1;h_tauTOBeFEXNumberShelf1', title=
'eFex '+tobStr+
' Tau Module Number Shelf 1'+cut_title_addition,
239 fillGroup = fillGroup,
240 type=
'TH1F', path=trigPath+pathFromKey(containerKey)+cut_name, xbins=12,xmin=0,xmax=12)
243 helper.defineHistogram(
'tauTOBfpga;h_tauTOBfpga', title=
'eFex '+tobStr+
' Tau FPGA'+cut_title_addition,
244 fillGroup = fillGroup,
245 type=
'TH1F', path=trigPath+pathFromKey(containerKey)+cut_name, xbins=4,xmin=0,xmax=4)
247 helper.defineHistogram(
'tauTOBRcore;h_tauTOBRcore', title=
'eFex '+tobStr+
' Tau rCore'+cut_title_addition,
248 fillGroup = fillGroup,
249 type=
'TH1F', path=trigPath+pathFromKey(containerKey)+cut_name, xbins=250,xmin=0,xmax=1)
251 helper.defineHistogram(
'tauTOBRhad;h_tauTOBRhad', title=
'eFex '+tobStr+
' Tau rHad'+cut_title_addition,
252 fillGroup = fillGroup,
253 type=
'TH1F', path=trigPath+pathFromKey(containerKey)+cut_name, xbins=250,xmin=0,xmax=1)
255 helper.defineHistogram(
'tauTOBRcore_threshold;h_tauTOBRcore_threshold', title=
'eFex '+tobStr+
' Tau rCore threshold'+cut_title_addition,
256 fillGroup = fillGroup,
257 type=
'TH1F', path=trigPath+pathFromKey(containerKey)+cut_name, xbins=4,xmin=0,xmax=4.0, xlabels=threshold_labels)
259 helper.defineHistogram(
'tauTOBRhad_threshold;h_tauTOBRhad_threshold', title=
'eFex '+tobStr+
' Tau rHad threshold'+cut_title_addition,
260 fillGroup = fillGroup,
261 type=
'TH1F', path=trigPath+pathFromKey(containerKey)+cut_name, xbins=4,xmin=0,xmax=4.0, xlabels=threshold_labels)
263 helper.defineHistogram(
'tauTOBthree_threshold;h_tauTOBthree_threshold', title=
'eFex '+tobStr+
' Tau 3 taus threshold'+cut_title_addition,
264 fillGroup = fillGroup,
265 type=
'TH1F', path=trigPath+pathFromKey(containerKey)+cut_name, xbins=4,xmin=0,xmax=4.0, xlabels=threshold_labels)
267 acc = helper.result()