5 '''Function to configure LVL1 JepJem algorithm in the monitoring system.'''
9 from AthenaConfiguration.ComponentFactory
import CompFactory
10 from AthenaConfiguration.ComponentAccumulator
import ComponentAccumulator
14 from AthenaMonitoring
import AthMonitorCfgHelper
15 helper = AthMonitorCfgHelper(inputFlags,
'JepJemMonitoringCfg')
18 JepJemMonAlg = helper.addAlgorithm(CompFactory.JepJemMonitorAlgorithm,
'JepJemMonAlg')
21 groupName =
'JepJemMonitor'
22 JepJemMonAlg.PackageName = groupName
24 JepJemMonAlg.s_maxSlices = maxSlices
26 JepJemMonAlg.s_crates = crates
28 JepJemMonAlg.s_modules = modules
30 JepJemMonAlg.s_tobsPerJEM = tobsPerJEM
35 inputPath = trigPath +
'/Input/'
36 outputPath = trigPath +
'/Output/'
37 errorPath = trigPath +
'/Errors/'
38 monRoIPath = outputPath +
'/RoI/'
39 monESumPath = outputPath +
'/EnergySums/'
40 monHardPath = errorPath +
'/Hardware/'
43 myGroup = helper.addGroup(JepJemMonAlg, groupName, mainDir)
49 phimax_1d = 2.*math.pi
51 etabins_1d = [-4.9,-3.2,-2.9,-2.7,-2.4,-2.2,-2.0,-1.8,
52 -1.6,-1.4,-1.2,-1.0,-0.8,-0.6,-0.4,-0.2,
53 0.0,0.2,0.4,0.6,0.8,1.0,1.2,1.4,1.6,1.8,
54 2.0,2.2,2.4,2.7,2.9,3.2,4.9]
64 'xbins': jebins - 1,
'xmin': 1,
'xmax': maxEnergyRange
70 'xbins': phibins_1d,
'xmin': phimin,
'xmax': phimax_1d
73 'xbins': etabins_2d,
'xmin': etamin_2d,
'xmax': etamax_2d,
74 'ybins': phibins_2d,
'ymin': phimin,
'ymax': phimax_2d
78 eta_phi_xlabels = [
''] * 32
79 for ch
in range(-11, 12, 2):
81 if chan>=-1: chan += 1
83 eta_phi_xlabels[chan+16] =
"{}/{:.2f}".
format(chan, eta)
84 eta_phi_xlabels[1] =
"-15/-3.05"
85 eta_phi_xlabels[3] =
"-13/-2.55"
86 eta_phi_xlabels[28] =
"12/2.55"
87 eta_phi_xlabels[30] =
"14/3.05"
89 eta_phi_ylabels = [
''] * 32
91 halfPhiBin = math.pi/32.
92 for chan
in range(0, 32, 2):
93 rad = chan*phiBin + halfPhiBin
94 eta_phi_ylabels[chan+1] =
"{}/{:.2f}".
format(chan, rad)
95 eta_phi_ylabels[-1] =
"etaVphi"
97 eta_phi_bin_labels = {
98 'xlabels': eta_phi_xlabels,
99 'ylabels': eta_phi_ylabels
104 myGroup.defineHistogram(
'phiJepJemJE_em;jem_em_1d_jetEl_Phi',
105 title=
'EM TowerSum distribution per #phi -- JEM input;#phi', type=
'TH1F',
106 path=inputPath, cutmask=
'', **phi_bins)
107 myGroup.defineHistogram(
'etaJepJemJE_em;jem_em_1d_jetEl_Eta',
108 title=
'EM TowerSum distribution per #eta -- JEM input;#eta', type=
'TH1F',
109 path=inputPath, cutmask=
'', **eta_bins)
110 myGroup.defineHistogram(
'etJepJemJE_em;jem_em_1d_jetEl_Energy',
111 title=
'TowerSum EM energy distribution -- JEM input;em energy [GeV]', type=
'TH1F',
112 path=inputPath, cutmask=
'', **energy_bins)
115 myGroup.defineHistogram(
'phiJepJemJE_had;jem_had_1d_jetEl_Phi',
116 title=
'HAD TowerSum distribution per #phi -- JEM input;#phi', type=
'TH1F',
117 path=inputPath, cutmask=
'',
118 xbins=phibins_1d, xmin=phimin, xmax=phimax_1d)
119 myGroup.defineHistogram(
'etaJepJemJE_had;jem_had_1d_jetEl_Eta',
120 title=
'HAD TowerSum distribution per #eta -- JEM input;#eta', type=
'TH1F',
121 path=inputPath, cutmask=
'', **eta_bins)
122 myGroup.defineHistogram(
'etJepJemJE_had;jem_had_1d_jetEl_Energy',
123 title=
'TowerSum HAD energy distribution -- JEM input;had energy [GeV]', type=
'TH1F',
124 path=inputPath, cutmask=
'', **energy_bins)
127 myGroup.defineHistogram(
'etaScaledJepJemJE_em,phiScaledJepJemJE_em;jem_em_2d_etaPhi_jetEl_HitMapWeighted',
128 title=
'#eta - #phi map of EM TowerSum weighted with energy -- JEM input', type=
'TH2F',
129 cutmask=
'', path=inputPath, **eta_phi_bins, **eta_phi_bin_labels,
133 myGroup.defineHistogram(
'etaScaledJepJemJE_had,phiScaledJepJemJE_had;jem_had_2d_etaPhi_jetEl_HitMapWeighted',
134 title=
'#eta - #phi map of HAD TowerSum weighted with energy -- JEM input', type=
'TH2F',
135 cutmask=
'', path=inputPath, **eta_phi_bins, **eta_phi_bin_labels,
140 myGroup.defineHistogram(
'jem_1d_TriggeredSlice_num;jem_1d_TriggeredSlice',
141 title=
'Number of the Triggered Slice for JE;#Slice', type=
'TH1F',
142 path=inputPath, cutmask=
'', xlabels=[
str(i)
for i
in range(maxSlices)],
143 xbins=maxSlices, xmin=0, xmax=maxSlices)
146 myGroup.defineHistogram(
'JEMEtSums_Ex;jem_1d_energy_SubSumsEx',
147 title=
'JEM E_{x}^{JEM} -- JEM DAQ;Ex [GeV]', type=
'TH1F',
148 path=monESumPath, cutmask=
'',
149 xbins=jebins, xmin=0, xmax=maxEnergySum)
150 myGroup.defineHistogram(
'JEMEtSums_Ey;jem_1d_energy_SubSumsEy',
151 title=
'JEM E_{y}^{JEM} -- JEM DAQ;Ey [GeV]', type=
'TH1F',
152 path=monESumPath, cutmask=
'',
153 xbins=jebins, xmin=0, xmax=maxEnergySum)
154 myGroup.defineHistogram(
'JEMEtSums_Et;jem_1d_energy_SubSumsEt',
155 title=
'JEM E_{t}^{JEM} -- JEM DAQ;Et [GeV]', type=
'TH1F',
156 path=monESumPath, cutmask=
'',
157 xbins=jebins, xmin=0, xmax=maxEnergySum)
160 for i
in range(maxSlices):
162 myGroup.defineHistogram(
'etaSliceJepJemJE_em_num{0},phiSliceJepJemJE_em_num{0};jem_em_2d_etaPhi_jetEl_HitMapSlice{0}'.
format(i),
163 title=
'#eta - #phi map of EM TowerSum for Timeslice {0} -- JEM input'.
format(i), type=
'TH2F',
164 cutmask=
'', path=inputPath, **eta_phi_bins, **eta_phi_bin_labels)
166 myGroup.defineHistogram(
'etaSliceJepJemJE_had_num{0},phiSliceJepJemJE_had_num{0};jem_had_2d_etaPhi_jetEl_HitMapSlice{0}'.
format(i),
167 title=
'#eta - #phi map of HAD TowerSum for Timeslice {0} -- JEM input'.
format(i), type=
'TH2F',
168 cutmask=
'', path=inputPath, **eta_phi_bins, **eta_phi_bin_labels)
172 subStatus_labels = [
"GLinkParity",
"GLinkProtocol",
"BCNMismatch",
"FIFOOverflow",
"ModuleError",
"",
"GLinkDown",
"GLinkTimeout"]
173 numberPairs_labels = [
""] * 32
174 for first
in range(0, 2):
176 for second
in range(0, 15, 2):
177 numberPairs_labels[bin] =
"{}/{}".
format(first, second)
180 myGroup.defineHistogram(
'GLinkParityError,jemLoc;jepjem_2d_Status',
181 title=
'Error reports from JEM SubStatus Word;;Crate/Module', type=
'TH2F',
182 cutmask=
'', path=monHardPath,
183 xbins=8,xmin=0.,xmax=8.0,ybins=32,ymin=0.,ymax=32.0,
184 xlabels=subStatus_labels, ylabels=numberPairs_labels)
186 myGroup.defineHistogram(
'etaScaledJepJemJE_em,phiScaledJepJemJE_em;jem_em_2d_etaPhi_jetEl_Parity',
187 title=
'Jet Element EM Parity Errors;#eta;#phi', type=
'TH2F',
188 cutmask=
'parityErrorJepJE_em', path=monHardPath, **eta_phi_bins)
189 myGroup.defineHistogram(
'etaScaledJepJemJE_em,phiScaledJepJemJE_em;jem_em_2d_etaPhi_jetEl_LinkDown',
190 title=
'Jet Element EM Link Down Errors;#eta;#phi', type=
'TH2F',
191 cutmask=
'linkDownErrorJepJE_em', path=monHardPath, **eta_phi_bins)
193 myGroup.defineHistogram(
'etaScaledJepJemJE_had,phiScaledJepJemJE_had;jem_had_2d_etaPhi_jetEl_Parity',
194 title=
'Jet Element Had Parity Errors;#eta;#phi', type=
'TH2F',
195 cutmask=
'parityErrorJepJE_had', path=monHardPath, **eta_phi_bins)
196 myGroup.defineHistogram(
'etaScaledJepJemJE_had,phiScaledJepJemJE_had;jem_had_2d_etaPhi_jetEl_LinkDown',
197 title=
'Jet Element Had Link Down Errors;#eta;#phi', type=
'TH2F',
198 cutmask=
'linkDownErrorJepJE_had', path=monHardPath, **eta_phi_bins)
201 NumberOfSummaryBins=5
202 err_summary_bin_labels = [
"EM parity",
"Had parity",
"EM link",
"Had link",
"JEM status"]
204 myGroup.defineHistogram(
'jem_1d_ErrorSummary;jem_1d_ErrorSummary',
205 title=
'Summary of JEM Data Errors;;',type=
'TH1F',
206 cutmask=
'',path=monHardPath, xlabels=err_summary_bin_labels,
207 xbins=NumberOfSummaryBins, xmin=0.,xmax=NumberOfSummaryBins)
211 myGroup.defineHistogram(
'GLinkParityError,jemLoc;jem_2d_ErrorEventNumbers',
212 title=
'JEM Error Event Numbers;Events with Error/Mismatch',type=
'TH2I',
213 cutmask=
'',path=monHardPath,
214 xbins=EventSamples, xmin=0, xmax=EventSamples, xlabels=[
str(i + 1)
for i
in range(EventSamples)],
215 ybins=NumberOfSummaryBins, ymin=0, ymax=NumberOfSummaryBins, ylabels=err_summary_bin_labels)
220 eta_phi_roi_xlabels = [
''] * 32
221 for chan
in range(-10, 12, 2):
223 eta_phi_roi_xlabels[chan+15] =
"{}/{:.2f}".
format(chan, eta)
224 eta_phi_roi_xlabels[1] =
"-14/-2.95"
225 eta_phi_roi_xlabels[3] =
"-12/-2.45"
226 eta_phi_roi_xlabels[27] =
"12/2.45"
227 eta_phi_roi_xlabels[29] =
"14/2.95"
228 eta_phi_roi_xlabels[31] =
"16/4.05"
230 eta_phi_roi_ylabels = [
''] * 32
232 for chan
in range(0, 32, 2):
233 rad = (chan + 1)*phiBin
234 eta_phi_roi_ylabels[chan] =
"{}/{:.2f}".
format(chan, rad)
235 eta_phi_roi_ylabels[-1] =
"etaVphi"
237 eta_phi_roi_bin_labels = {
238 'xlabels': eta_phi_roi_xlabels,
239 'ylabels': eta_phi_roi_ylabels
244 myGroup.defineHistogram(
'jemRoiEnergyLg;jem_1d_roi_EnergyLg',
245 title=
'JEM TOB RoI Energy Large Window Size;', type=
'TH1F',
246 cutmask=
'', path=monRoIPath,
247 xbins=jebins, xmin=0., xmax=maxLarge)
248 myGroup.defineHistogram(
'jemRoiEnergySm;jem_1d_roi_EnergySm',
249 title=
'JEM TOB RoI Energy Small Window Size;', type=
'TH1F',
250 cutmask=
'', path=monRoIPath,
251 xbins=jebins, xmin=0., xmax=maxSmall)
253 tobsPerJEMLabels = [
str(i + 1)
for i
in range(tobsPerJEM + 1)]
254 tobsPerJEMLabels[-1] =
'More'
255 myGroup.defineHistogram(
'jemRoiTOBsPerJEM;jem_1d_roi_TOBsPerJEM',
256 title=
'JEM TOB RoI TOBs per JEM;Number of TOBs', type=
'TH1F',
257 cutmask=
'', path=monRoIPath, xlabels=tobsPerJEMLabels,
258 xbins=tobsPerJEM + 1, xmin=1, xmax=tobsPerJEM + 2)
260 myGroup.defineHistogram(
'jemRoiEta,jemRoiPhi;jem_2d_etaPhi_roi_Hitmap',
261 title=
'JEM TOB RoIs Hit Map;;', type=
'TH2F',
262 cutmask=
'', path=monRoIPath, **eta_phi_bins, **eta_phi_roi_bin_labels)
263 myGroup.defineHistogram(
'jemRoiEtaWeighted,jemRoiPhiWeighted;jem_2d_etaPhi_roi_EtWeighted',
264 title=
'JEM TOB RoIs Hit Map Weighted by Energy;;', type=
'TH2F',
265 cutmask=
'', path=monRoIPath, **eta_phi_bins, **eta_phi_roi_bin_labels,
266 weight=
'jemRoiEnergyWeight')
268 acc = helper.result()