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/'
57 keyDirPathMap = {
'L1_eEMRoI' :
'eEM',
58 'L1_eEMxRoI' :
'eEMx',
'L1_eEMRoISim' :
'TOBSim/eEM',
'L1_eEMxRoISim' :
'xTOBSim/eEM',
59 'L1_eTauRoI' :
'eTAU',
60 'L1_eTauxRoI' :
'eTAUx',
'L1_eTauRoISim' :
'TOBSim/eTau',
61 'L1_eTauxRoISim' :
'xTOBSim/eTau'}
62 cut_names = [
"LowPtCut",
"HiPtCut"]
63 cut_vals = [EfexMonAlg.LowPtCut, EfexMonAlg.HiPtCut]
69 for phiOct
in range(0,8):
70 for etaIdx
in range(-25,25):
71 locIdxs += [
str(phiOct) +
":" +
str(etaIdx)]
73 for containerKey
in (
list(EfexMonAlg.eFexEMTobKeyList) +
list(EfexMonAlg.eFexTauTobKeyList)):
74 helper.defineHistogram(containerKey +
'_nTOBs_nocut;h_n'+containerKey+
'_nocut', title=
'Number of '+containerKey+
';Number of '+containerKey+
';Events',
75 fillGroup = baseGroupName,
76 type=
'TH1I', xbins=100,xmin=-0.5,xmax=99.5)
77 if "Sim" not in containerKey:
79 helper.defineHistogram(
"LBN,locIdx,tobEt;h_"+containerKey+
"_et_posLbnMap", title =
"Average " + containerKey +
" ET;LB;Position (Octant:Eta)",
80 fillGroup = baseGroupName +
"_" + containerKey,
81 path = (
"Expert/Outputs/" if "x" not in containerKey
else trigPath)+keyDirPathMap[containerKey],
82 hanConfig={
"description":
"Check for horizontal anomalies (hotspot/coldspot) or vertical anomalies (whole-system hot/cold)"},
84 xbins=1,xmin=0,xmax=1, ylabels=locIdxs, opt=[
'kAddBinsDynamically'])
85 helper.defineHistogram(f
"LBN,{containerKey}_nTOBs_nocut;h_"+containerKey+
"_nTOBs", title =
"Average # of " + containerKey +
" TOBs;LBN",
86 fillGroup = baseGroupName,
88 xbins=1,xmin=0,xmax=1,ybins=20,ymin=-0.5,ymax=19.5, opt=[
'kAddBinsDynamically'])
92 for cut_name, cut_val
in zip(cut_names, cut_vals):
93 cut_title_addition =
'' if (cut_val == 0.0)
else ' [Et>=' +
'%.1f'%(cut_val/1000) +
'GeV]'
95 for containerKey
in EfexMonAlg.eFexEMTobKeyList:
96 fillGroup = baseGroupName+
'_'+containerKey+
'_'+cut_name
97 tobTypeStr =
"xTOB" if (
'xRoI' in containerKey)
else "TOB"
98 simStr =
"Sim" if (
'Sim' in containerKey)
else ""
99 tobStr = tobTypeStr + simStr
101 helper.defineHistogram(
'nEMTOBs;h_nEmTOBs', title=
'Number of eFex EM '+tobStr+
's'+cut_title_addition+
';EM '+tobStr+
's;Number of EM '+tobStr+
's',
103 type=
'TH1I', path=trigPath+keyDirPathMap[containerKey]+cut_name, xbins=10,xmin=0,xmax=10)
105 helper.defineHistogram(
'TOBTransverseEnergy;h_TOBTransverseEnergy', title=
'eFex '+tobStr+
' EM Transverse Energy [MeV]'+cut_title_addition,
107 type=
'TH1F', path=trigPath+keyDirPathMap[containerKey]+cut_name, xbins=100,xmin=0,xmax=50000)
109 helper.defineHistogram(
'TOBEta;h_TOBEta', title=
'eFex '+tobStr+
' EM Eta'+cut_title_addition,
111 type=
'TH1F', path=trigPath+keyDirPathMap[containerKey]+cut_name, xbins=50,xmin=-2.5,xmax=2.5)
113 helper.defineHistogram(
'TOBPhi;h_TOBPhi', title=
'eFex '+tobStr+
' EM Phi'+cut_title_addition,
115 type=
'TH1F', path=trigPath+keyDirPathMap[containerKey]+cut_name, xbins=64,xmin=-math.pi,xmax=math.pi)
117 helper.defineHistogram(f
"tauTOBEta,tauTOBPhi;h_{containerKey}_{cut_name}_EtaPhiMap", title=
'eEM '+tobStr+
' Count'+cut_title_addition+
';#eta;#phi',
119 hanConfig={
"description":
"Inspect for hot/cold spots - check help for list of known hot/coldspots"},
121 path=((
"Expert/Outputs/"+keyDirPathMap[containerKey])
if "Sim" not in containerKey
and "x" not in containerKey
else trigPath+keyDirPathMap[containerKey]+cut_name),
122 xbins=50,xmin=-2.5,xmax=2.5,ybins=64,ymin=-math.pi,ymax=math.pi)
124 helper.defineHistogram(
'TOBshelfNumber;h_TOBshelfNumber', title=
'eFex '+tobStr+
' EM Shelf Number'+cut_title_addition,
126 type=
'TH1F', path=trigPath+keyDirPathMap[containerKey]+cut_name, xbins=2,xmin=0,xmax=2)
128 helper.defineHistogram(
'TOBeFEXNumberSh0;h_TOBeFEXNumberShelf0', title=
'eFex '+tobStr+
' EM Module Number Shelf 0'+cut_title_addition,
130 type=
'TH1F', path=trigPath+keyDirPathMap[containerKey]+cut_name, xbins=12,xmin=0,xmax=12)
132 helper.defineHistogram(
'TOBeFEXNumberSh1;h_TOBeFEXNumberShelf1', title=
'eFex '+tobStr+
' EM Module Number Shelf 1'+cut_title_addition,
134 type=
'TH1F', path=trigPath+keyDirPathMap[containerKey]+cut_name, xbins=12,xmin=0,xmax=12)
136 helper.defineHistogram(
'TOBfpga;h_TOBfpga', title=
'eFex '+tobStr+
' EM FPGA'+cut_title_addition,
138 type=
'TH1F', path=trigPath+keyDirPathMap[containerKey]+cut_name, xbins=4,xmin=0,xmax=4)
140 helper.defineHistogram(
'TOBReta;h_TOBReta', title=
'eFex '+tobStr+
' EM Reta'+cut_title_addition,
142 type=
'TH1F', path=trigPath+keyDirPathMap[containerKey]+cut_name,xbins=250,xmin=0,xmax=1)
144 helper.defineHistogram(
'TOBRhad;h_TOBRhad', title=
'eFex '+tobStr+
' EM Rhad'+cut_title_addition,
146 type=
'TH1F', path=trigPath+keyDirPathMap[containerKey]+cut_name, xbins=250,xmin=0,xmax=1)
148 helper.defineHistogram(
'TOBWstot;h_TOBWstot', title=
'eFex '+tobStr+
' EM Wstot'+cut_title_addition,
150 type=
'TH1F', path=trigPath+keyDirPathMap[containerKey]+cut_name, xbins=250,xmin=0,xmax=1)
152 threshold_labels = [
'fail',
'loose',
'medium',
'tight']
153 helper.defineHistogram(
'TOBReta_threshold;h_TOBReta_threshold', title=
'eFex '+tobStr+
' EM Reta threshold'+cut_title_addition,
155 type=
'TH1F', path=trigPath+keyDirPathMap[containerKey]+cut_name,xbins=4,xmin=0,xmax=4.0,xlabels=threshold_labels)
157 helper.defineHistogram(
'TOBRhad_threshold;h_TOBRhad_threshold', title=
'eFex '+tobStr+
' EM Rhad threshold'+cut_title_addition,
159 type=
'TH1F', path=trigPath+keyDirPathMap[containerKey]+cut_name, xbins=4,xmin=0,xmax=4.0,xlabels=threshold_labels)
161 helper.defineHistogram(
'TOBWstot_threshold;h_TOBWstot_threshold', title=
'eFex '+tobStr+
' EM Wstot threshold'+cut_title_addition,
163 type=
'TH1F', path=trigPath+keyDirPathMap[containerKey]+cut_name, xbins=4,xmin=0,xmax=4.0,xlabels=threshold_labels)
166 for containerKey
in EfexMonAlg.eFexTauTobKeyList:
167 fillGroup = baseGroupName+
'_'+containerKey+
'_'+cut_name
168 tobTypeStr =
"xTOB" if (
'xRoI' in containerKey)
else "TOB"
169 simStr =
"Sim" if (
'Sim' in containerKey)
else ""
170 tobStr = tobTypeStr + simStr
172 helper.defineHistogram(
'nTauTOBs;h_nTauTOBs', title=
'Number of eFex Tau '+tobStr+
's'+cut_title_addition+
';Tau '+tobStr+
's;Number of Tau '+tobStr+
's',
173 fillGroup = fillGroup,
174 type=
'TH1I', path=trigPath+keyDirPathMap[containerKey]+cut_name, xbins=10,xmin=0,xmax=10)
176 helper.defineHistogram(
'tauTOBTransverseEnergy;h_tauTOBTransverseEnergy', title=
'eFex '+tobStr+
' Tau Transverse Energy [MeV]'+cut_title_addition,
177 fillGroup = fillGroup,
178 type=
'TH1F', path=trigPath+keyDirPathMap[containerKey]+cut_name, xbins=100,xmin=0,xmax=50000)
180 helper.defineHistogram(
'tauTOBEta;h_tauTOBEta', title=
'eFex '+tobStr+
' Tau Eta'+cut_title_addition,
181 fillGroup = fillGroup,
182 type=
'TH1F', path=trigPath+keyDirPathMap[containerKey]+cut_name, xbins=60,xmin=-2.5,xmax=2.5)
184 helper.defineHistogram(
'tauTOBPhi;h_tauTOBPhi', title=
'eFex '+tobStr+
' Tau Phi'+cut_title_addition,
185 fillGroup = fillGroup,
186 type=
'TH1F', path=trigPath+keyDirPathMap[containerKey]+cut_name, xbins=100,xmin=-math.pi,xmax=math.pi)
188 helper.defineHistogram(f
"tauTOBEta,tauTOBPhi;h_{containerKey}_{cut_name}_EtaPhiMap", title=
'eTAU '+tobStr+
' Count'+cut_title_addition+
';#eta;#phi',
189 fillGroup = fillGroup,
190 hanConfig={
"description":
"Inspect for hot/cold spots - check help for list of known hot/cold spots</a>"},
192 path=((
"Expert/Outputs/"+keyDirPathMap[containerKey])
if "Sim" not in containerKey
and "x" not in containerKey
else (trigPath+keyDirPathMap[containerKey]+cut_name)),
193 xbins=50,xmin=-2.5,xmax=2.5,ybins=64,ymin=-math.pi,ymax=math.pi)
195 helper.defineHistogram(
'tauTOBshelfNumber;h_tauTOBshelfNumber', title=
'eFex '+tobStr+
' Tau Shelf Number'+cut_title_addition,
196 fillGroup = fillGroup,
197 type=
'TH1F', path=trigPath+keyDirPathMap[containerKey]+cut_name, xbins=2,xmin=0,xmax=2)
199 helper.defineHistogram(
'tauTOBeFEXNumberSh0;h_tauTOBeFEXNumberShelf0', title=
'eFex '+tobStr+
' Tau Module Number Shelf 0'+cut_title_addition,
200 fillGroup = fillGroup,
201 type=
'TH1F', path=trigPath+keyDirPathMap[containerKey]+cut_name, xbins=12,xmin=0,xmax=12)
203 helper.defineHistogram(
'tauTOBeFEXNumberSh1;h_tauTOBeFEXNumberShelf1', title=
'eFex '+tobStr+
' Tau Module Number Shelf 1'+cut_title_addition,
204 fillGroup = fillGroup,
205 type=
'TH1F', path=trigPath+keyDirPathMap[containerKey]+cut_name, xbins=12,xmin=0,xmax=12)
208 helper.defineHistogram(
'tauTOBfpga;h_tauTOBfpga', title=
'eFex '+tobStr+
' Tau FPGA'+cut_title_addition,
209 fillGroup = fillGroup,
210 type=
'TH1F', path=trigPath+keyDirPathMap[containerKey]+cut_name, xbins=4,xmin=0,xmax=4)
212 helper.defineHistogram(
'tauTOBRcore;h_tauTOBRcore', title=
'eFex '+tobStr+
' Tau rCore'+cut_title_addition,
213 fillGroup = fillGroup,
214 type=
'TH1F', path=trigPath+keyDirPathMap[containerKey]+cut_name, xbins=250,xmin=0,xmax=1)
216 helper.defineHistogram(
'tauTOBRhad;h_tauTOBRhad', title=
'eFex '+tobStr+
' Tau rHad'+cut_title_addition,
217 fillGroup = fillGroup,
218 type=
'TH1F', path=trigPath+keyDirPathMap[containerKey]+cut_name, xbins=250,xmin=0,xmax=1)
220 helper.defineHistogram(
'tauTOBRcore_threshold;h_tauTOBRcore_threshold', title=
'eFex '+tobStr+
' Tau rCore threshold'+cut_title_addition,
221 fillGroup = fillGroup,
222 type=
'TH1F', path=trigPath+keyDirPathMap[containerKey]+cut_name, xbins=4,xmin=0,xmax=4.0, xlabels=threshold_labels)
224 helper.defineHistogram(
'tauTOBRhad_threshold;h_tauTOBRhad_threshold', title=
'eFex '+tobStr+
' Tau rHad threshold'+cut_title_addition,
225 fillGroup = fillGroup,
226 type=
'TH1F', path=trigPath+keyDirPathMap[containerKey]+cut_name, xbins=4,xmin=0,xmax=4.0, xlabels=threshold_labels)
228 helper.defineHistogram(
'tauTOBthree_threshold;h_tauTOBthree_threshold', title=
'eFex '+tobStr+
' Tau 3 taus threshold'+cut_title_addition,
229 fillGroup = fillGroup,
230 type=
'TH1F', path=trigPath+keyDirPathMap[containerKey]+cut_name, xbins=4,xmin=0,xmax=4.0, xlabels=threshold_labels)
232 acc = helper.result()