26 Book the histograms for the efex monitoring. This is done in a separate method
27 to the algorithm creation (above) because the histograms are based on the list of container keys
28 given to the algorithm, which can be customized by the user before calling this method.
31 from AthenaConfiguration.ComponentAccumulator
import ComponentAccumulator
36 from TrigT1CaloMonitoring.LVL1CaloMonitoringConfig
import L1CaloMonitorCfgHelper
37 helper = L1CaloMonitorCfgHelper(flags,
None,
'EfexMonitoringCfg')
42 baseGroupName = EfexMonAlg.PackageName
46 trigPath = f
'Developer/{eFexAlg.name}/'
49 def pathFromKey(key,prefix="Nominal/"):
51 if "DAODSim" in key: path =
"DAODSim/"
52 elif "ReSim" in key: path =
"ReSim/"
53 elif "Sim" in key: path =
"Sim/"
54 if "_eEMx" in key: path +=
"eEMx"
55 elif "_eEM" in key: path +=
"eEM"
56 elif "_eTaux" in key: path +=
"eTAUx"
57 elif "_eTau" in key: path +=
"eTAU"
60 cut_names = [
"LowPtCut",
"HiPtCut"]
61 cut_vals = [EfexMonAlg.LowPtCut, EfexMonAlg.HiPtCut]
67 for phiOct
in range(0,8):
68 for etaIdx
in range(-25,25):
69 locIdxs += [
str(phiOct) +
":" +
str(etaIdx)]
71 for containerKey
in (
list(EfexMonAlg.eFexEMTobKeyList) +
list(EfexMonAlg.eFexTauTobKeyList)):
72 helper.defineHistogram(containerKey +
'_nTOBs_nocut;h_n'+containerKey+
'_nocut', title=
'Number of '+containerKey+
';Number of '+containerKey+
';Events',
73 fillGroup = baseGroupName,
74 path=trigPath+pathFromKey(containerKey)+
"NoCut",
75 type=
'TH1I', xbins=100,xmin=-0.5,xmax=99.5)
76 if "Sim" not in containerKey:
78 helper.defineHistogram(f
"LBN,{containerKey}_nTOBs_nocut;h_"+containerKey+
"_nTOBs", title =
"Average # of " + containerKey +
" TOBs;LBN",
79 fillGroup = baseGroupName +
"_" + containerKey,
80 path=trigPath+pathFromKey(containerKey)+
"NoCut",
82 xbins=1,xmin=0,xmax=1,ybins=20,ymin=-0.5,ymax=19.5, opt=[
'kAddBinsDynamically'])
85 commonAlgConfig = {
"libname":
"libdqm_summaries.so",
86 "name":
"L1Calo_BinsDiffFromStripMedian",
88 hotCuts = {
"ColdCut":-5,
"WarmCut":9,
"HotCut":20}
90 commonThresholdConfig = {
91 "NWrongKnown":[0,100],
97 "NConsecUnlikelyStrip":[2,5],
100 knownAnomalies_eEM = {
104 knownAnomalies_eTAU = {
109 helper.defineDQAlgorithm(
"Efex_eEM_etaThiMapFilled",
110 hanConfig=commonAlgConfig|hotCuts|knownAnomalies_eEM,
111 thresholdConfig=commonThresholdConfig
113 helper.defineDQAlgorithm(
"Efex_eTAU_etaThiMapFilled",
114 hanConfig=commonAlgConfig|hotCuts|knownAnomalies_eTAU,
115 thresholdConfig=commonThresholdConfig
118 helper.defineDQAlgorithm(
"Efex_eEM_etaPhiLBMapOutliers_Shifter",
119 hanConfig=commonAlgConfig|hotCuts|knownAnomalies_eEM|{
"NBinsY":64,
"LiveMode":1},
120 thresholdConfig=commonThresholdConfig
122 helper.defineDQAlgorithm(
"Efex_eEM_etaPhiLBMapOutliers",
123 hanConfig=commonAlgConfig|hotCuts|knownAnomalies_eEM|{
"NBinsY":64,
"LiveMode":0},
124 thresholdConfig=commonThresholdConfig
126 helper.defineDQAlgorithm(
"Efex_eTAU_etaPhiLBMapOutliers_Shifter",
127 hanConfig=commonAlgConfig|hotCuts|knownAnomalies_eTAU|{
"NBinsY":64,
"LiveMode":1},
128 thresholdConfig=commonThresholdConfig
130 helper.defineDQAlgorithm(
"Efex_eTAU_etaPhiLBMapOutliers",
131 hanConfig=commonAlgConfig|hotCuts|knownAnomalies_eTAU|{
"NBinsY":64,
"LiveMode":0},
132 thresholdConfig=commonThresholdConfig
137 for cut_name, cut_val
in zip(cut_names, cut_vals):
138 cut_title_addition =
'' if (cut_val == 0.0)
else ' [Et>=' +
'%.1f'%(cut_val/1000) +
'GeV]'
140 for containerKey
in EfexMonAlg.eFexEMTobKeyList:
141 fillGroup = baseGroupName+
'_'+containerKey+
'_'+cut_name
142 tobStr = containerKey
144 helper.defineHistogram(
'nEMTOBs;h_nEmTOBs', title=
'Number of '+tobStr+
's'+cut_title_addition+
';EM '+tobStr+
's;Number of EM '+tobStr+
's',
146 type=
'TH1I', path=trigPath+pathFromKey(containerKey)+cut_name, xbins=10,xmin=0,xmax=10)
148 helper.defineHistogram(
'TOBTransverseEnergy;h_TOBTransverseEnergy', title=tobStr+
' ET [MeV]'+cut_title_addition,
150 type=
'TH1F', path=trigPath+pathFromKey(containerKey)+cut_name, xbins=100,xmin=0,xmax=50000)
152 helper.defineHistogram(
'TOBEta;h_TOBEta', title=tobStr+
' Eta'+cut_title_addition,
154 type=
'TH1F', path=trigPath+pathFromKey(containerKey)+cut_name, xbins=50,xmin=-2.5,xmax=2.5)
156 helper.defineHistogram(
'TOBPhi;h_TOBPhi', title=tobStr+
' Phi'+cut_title_addition,
158 type=
'TH1F', path=trigPath+pathFromKey(containerKey)+cut_name, xbins=64,xmin=-math.pi,xmax=math.pi)
160 helper.defineHistogram(f
"TOBEta,TOBPhi;h_{containerKey}_{cut_name}_EtaPhiMap", title=tobStr+
' Count'+cut_title_addition+
';#eta;#phi',
162 hanConfig={
"display":
"SetPalette(55)",
163 "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"},
165 path=((
"Expert/Outputs/"+pathFromKey(containerKey,
""))
if "Sim" not in containerKey
and "x" not in containerKey
else trigPath+pathFromKey(containerKey)+cut_name),
166 xbins=50,xmin=-2.5,xmax=2.5,ybins=64,ymin=-math.pi,ymax=math.pi,opt=[
'kAlwaysCreate'])
168 if "Sim" not in containerKey
and "x" not in containerKey:
169 helper.defineHistogram(f
"LBN,binNumber;h_{containerKey}_{cut_name}_posVsLBN", title=tobStr+
' Count'+cut_title_addition+
';LB;64(x-1)+y',
171 hanConfig={
"Expert/algorithm":f
"Efex_{pathFromKey(containerKey,'')}_etaPhiLBMapOutliers",
"Shifter/algorithm":f
"Efex_{pathFromKey(containerKey,'')}_etaPhiLBMapOutliers_Shifter",
172 "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"},
174 paths=[
"Expert/Outputs/"+pathFromKey(containerKey,
"")+
"/detail",
"Shifter/Outputs/"+pathFromKey(containerKey,
"")],
175 xbins=1,xmin=0,xmax=10,
176 ybins=64*50,ymin=0.5,ymax=64*50+0.5,opt=[
'kAddBinsDynamically'])
178 helper.defineHistogram(
'TOBshelfNumber;h_TOBshelfNumber', title=tobStr+
' EM Shelf Number'+cut_title_addition,
180 type=
'TH1F', path=trigPath+pathFromKey(containerKey)+cut_name, xbins=2,xmin=0,xmax=2)
182 helper.defineHistogram(
'TOBeFEXNumberSh0;h_TOBeFEXNumberShelf0', title=tobStr+
' EM Module Number Shelf 0'+cut_title_addition,
184 type=
'TH1F', path=trigPath+pathFromKey(containerKey)+cut_name, xbins=12,xmin=0,xmax=12)
186 helper.defineHistogram(
'TOBeFEXNumberSh1;h_TOBeFEXNumberShelf1', title=tobStr+
' EM Module Number Shelf 1'+cut_title_addition,
188 type=
'TH1F', path=trigPath+pathFromKey(containerKey)+cut_name, xbins=12,xmin=0,xmax=12)
190 helper.defineHistogram(
'TOBfpga;h_TOBfpga', title=tobStr+
' EM FPGA'+cut_title_addition,
192 type=
'TH1F', path=trigPath+pathFromKey(containerKey)+cut_name, xbins=4,xmin=0,xmax=4)
194 helper.defineHistogram(
'TOBReta;h_TOBReta', title=tobStr+
' EM Reta'+cut_title_addition,
196 type=
'TH1F', path=trigPath+pathFromKey(containerKey)+cut_name,xbins=250,xmin=0,xmax=1)
198 helper.defineHistogram(
'TOBRhad;h_TOBRhad', title=tobStr+
' EM Rhad'+cut_title_addition,
200 type=
'TH1F', path=trigPath+pathFromKey(containerKey)+cut_name, xbins=250,xmin=0,xmax=1)
202 helper.defineHistogram(
'TOBWstot;h_TOBWstot', title=tobStr+
' EM Wstot'+cut_title_addition,
204 type=
'TH1F', path=trigPath+pathFromKey(containerKey)+cut_name, xbins=250,xmin=0,xmax=1)
206 threshold_labels = [
'fail',
'loose',
'medium',
'tight']
207 helper.defineHistogram(
'TOBReta_threshold;h_TOBReta_threshold', title=tobStr+
' EM Reta threshold'+cut_title_addition,
209 type=
'TH1F', path=trigPath+pathFromKey(containerKey)+cut_name,xbins=4,xmin=0,xmax=4.0,xlabels=threshold_labels)
211 helper.defineHistogram(
'TOBRhad_threshold;h_TOBRhad_threshold', title=tobStr+
' EM Rhad threshold'+cut_title_addition,
213 type=
'TH1F', path=trigPath+pathFromKey(containerKey)+cut_name, xbins=4,xmin=0,xmax=4.0,xlabels=threshold_labels)
215 helper.defineHistogram(
'TOBWstot_threshold;h_TOBWstot_threshold', title=tobStr+
' EM Wstot threshold'+cut_title_addition,
217 type=
'TH1F', path=trigPath+pathFromKey(containerKey)+cut_name, xbins=4,xmin=0,xmax=4.0,xlabels=threshold_labels)
220 for containerKey
in EfexMonAlg.eFexTauTobKeyList:
221 fillGroup = baseGroupName+
'_'+containerKey+
'_'+cut_name
222 tobStr = containerKey
224 helper.defineHistogram(
'nTauTOBs;h_nTauTOBs', title=
'Number of '+tobStr+
's'+cut_title_addition+
';Tau '+tobStr+
's;Number of Tau '+tobStr+
's',
225 fillGroup = fillGroup,
226 type=
'TH1I', path=trigPath+pathFromKey(containerKey)+cut_name, xbins=10,xmin=0,xmax=10)
228 helper.defineHistogram(
'tauTOBTransverseEnergy;h_tauTOBTransverseEnergy', title=tobStr+
' Tau Transverse Energy [MeV]'+cut_title_addition,
229 fillGroup = fillGroup,
230 type=
'TH1F', path=trigPath+pathFromKey(containerKey)+cut_name, xbins=100,xmin=0,xmax=50000)
232 helper.defineHistogram(
'tauTOBEta;h_tauTOBEta', title=tobStr+
' Tau Eta'+cut_title_addition,
233 fillGroup = fillGroup,
234 type=
'TH1F', path=trigPath+pathFromKey(containerKey)+cut_name, xbins=60,xmin=-2.5,xmax=2.5)
236 helper.defineHistogram(
'tauTOBPhi;h_tauTOBPhi', title=tobStr+
' Tau Phi'+cut_title_addition,
237 fillGroup = fillGroup,
238 type=
'TH1F', path=trigPath+pathFromKey(containerKey)+cut_name, xbins=100,xmin=-math.pi,xmax=math.pi)
240 helper.defineHistogram(f
"tauTOBEta,tauTOBPhi;h_{containerKey}_{cut_name}_EtaPhiMap", title=
'eTAU '+tobStr+
' Count'+cut_title_addition+
';#eta;#phi',
241 fillGroup = fillGroup,
242 hanConfig={
"display":
"SetPalette(55)",
243 "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"},
245 path=((
"Expert/Outputs/"+pathFromKey(containerKey,
""))
if "Sim" not in containerKey
and "x" not in containerKey
else (trigPath+pathFromKey(containerKey)+cut_name)),
246 xbins=50,xmin=-2.5,xmax=2.5,ybins=64,ymin=-math.pi,ymax=math.pi,opt=[
'kAlwaysCreate'])
248 if "Sim" not in containerKey
and "x" not in containerKey:
249 helper.defineHistogram(f
"LBN,binNumber;h_{containerKey}_{cut_name}_posVsLBN", title=
'eTAU '+tobStr+
' Count'+cut_title_addition+
';LB;64(x-1)+y',
251 hanConfig={
"Expert/algorithm":f
"Efex_{pathFromKey(containerKey,'')}_etaPhiLBMapOutliers",
"Shifter/algorithm":f
"Efex_{pathFromKey(containerKey,'')}_etaPhiLBMapOutliers_Shifter",
252 "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"},
254 paths=[
"Expert/Outputs/"+pathFromKey(containerKey,
"")+
"/detail",
"Shifter/Outputs/"+pathFromKey(containerKey,
"")],
255 xbins=1,xmin=0,xmax=10,
256 ybins=64*50,ymin=0.5,ymax=64*50+0.5,opt=[
'kAddBinsDynamically'])
258 helper.defineHistogram(
'tauTOBshelfNumber;h_tauTOBshelfNumber', title=tobStr+
' Tau Shelf Number'+cut_title_addition,
259 fillGroup = fillGroup,
260 type=
'TH1F', path=trigPath+pathFromKey(containerKey)+cut_name, xbins=2,xmin=0,xmax=2)
262 helper.defineHistogram(
'tauTOBeFEXNumberSh0;h_tauTOBeFEXNumberShelf0', title=tobStr+
' Tau Module Number Shelf 0'+cut_title_addition,
263 fillGroup = fillGroup,
264 type=
'TH1F', path=trigPath+pathFromKey(containerKey)+cut_name, xbins=12,xmin=0,xmax=12)
266 helper.defineHistogram(
'tauTOBeFEXNumberSh1;h_tauTOBeFEXNumberShelf1', title=tobStr+
' Tau Module Number Shelf 1'+cut_title_addition,
267 fillGroup = fillGroup,
268 type=
'TH1F', path=trigPath+pathFromKey(containerKey)+cut_name, xbins=12,xmin=0,xmax=12)
271 helper.defineHistogram(
'tauTOBfpga;h_tauTOBfpga', title=tobStr+
' Tau FPGA'+cut_title_addition,
272 fillGroup = fillGroup,
273 type=
'TH1F', path=trigPath+pathFromKey(containerKey)+cut_name, xbins=4,xmin=0,xmax=4)
275 helper.defineHistogram(
'tauTOBRcore;h_tauTOBRcore', title=tobStr+
' Tau rCore'+cut_title_addition,
276 fillGroup = fillGroup,
277 type=
'TH1F', path=trigPath+pathFromKey(containerKey)+cut_name, xbins=250,xmin=0,xmax=1)
279 helper.defineHistogram(
'tauTOBRhad;h_tauTOBRhad', title=tobStr+
' Tau rHad'+cut_title_addition,
280 fillGroup = fillGroup,
281 type=
'TH1F', path=trigPath+pathFromKey(containerKey)+cut_name, xbins=250,xmin=0,xmax=1)
283 helper.defineHistogram(
'tauTOBRcore_threshold;h_tauTOBRcore_threshold', title=tobStr+
' Tau rCore threshold'+cut_title_addition,
284 fillGroup = fillGroup,
285 type=
'TH1F', path=trigPath+pathFromKey(containerKey)+cut_name, xbins=4,xmin=0,xmax=4.0, xlabels=threshold_labels)
287 helper.defineHistogram(
'tauTOBRhad_threshold;h_tauTOBRhad_threshold', title=tobStr+
' Tau rHad threshold'+cut_title_addition,
288 fillGroup = fillGroup,
289 type=
'TH1F', path=trigPath+pathFromKey(containerKey)+cut_name, xbins=4,xmin=0,xmax=4.0, xlabels=threshold_labels)
291 helper.defineHistogram(
'tauTOBthree_threshold;h_tauTOBthree_threshold', title=tobStr+
' Tau 3 taus threshold'+cut_title_addition,
292 fillGroup = fillGroup,
293 type=
'TH1F', path=trigPath+pathFromKey(containerKey)+cut_name, xbins=4,xmin=0,xmax=4.0, xlabels=threshold_labels)
295 acc = helper.result()