246 def checkMultAlgoFWconstraints(l1menu):
248 List of the constraints in terms of multiplicity algorithms to make sure the menu fits
252 multLimits = namedtuple(
'ML',
"thrtype, conn, nbit, startbit, endbit")
254 multLimits( thrtype=
'eEM', conn=
'Topo1Opt0', nbit=3, startbit=0, endbit=11),
255 multLimits( thrtype=
'eEM', conn=
'Topo1Opt0', nbit=2, startbit=24, endbit=43),
256 multLimits( thrtype=
'eEMV', conn=
'Topo1Opt0', nbit=2, startbit=44, endbit=63),
257 multLimits( thrtype=
'ZeroBiasA', conn=
'Topo1Opt0', nbit=1, startbit=64, endbit=64),
258 multLimits( thrtype=
'eTAU', conn=
'Topo1Opt1', nbit=3, startbit=0, endbit=8 ),
259 multLimits( thrtype=
'eTAU', conn=
'Topo1Opt1', nbit=2, startbit=12, endbit=31),
260 multLimits( thrtype=
'gLJ', conn=
'Topo1Opt1', nbit=2, startbit=33, endbit=51),
261 multLimits( thrtype=
'gJ', conn=
'Topo1Opt1', nbit=3, startbit=54, endbit=62),
262 multLimits( thrtype=
'gJ', conn=
'Topo1Opt1', nbit=2, startbit=66, endbit=71),
263 multLimits( thrtype=
'eTAU', conn=
'Topo1Opt1', nbit=2, startbit=72, endbit=80),
264 multLimits( thrtype=
'jJ', conn=
'Topo1Opt2', nbit=3, startbit=0, endbit=32),
265 multLimits( thrtype=
'jJ', conn=
'Topo1Opt2', nbit=2, startbit=36, endbit=73),
266 multLimits( thrtype=
'jLJ', conn=
'Topo1Opt2', nbit=2, startbit=78, endbit=93),
267 multLimits( thrtype=
'jTAU', conn=
'Topo1Opt3', nbit=3, startbit=0, endbit=2 ),
268 multLimits( thrtype=
'jTAU', conn=
'Topo1Opt3', nbit=2, startbit=6, endbit=11),
269 multLimits( thrtype=
'cTAU', conn=
'Topo1Opt3', nbit=3, startbit=14, endbit=19),
270 multLimits( thrtype=
'cTAU', conn=
'Topo1Opt3', nbit=2, startbit=23, endbit=28),
271 multLimits( thrtype=
'jEM', conn=
'Topo1Opt3', nbit=2, startbit=31, endbit=36),
272 multLimits( thrtype=
'LArSaturation', conn=
'Topo1Opt3', nbit=1, startbit=37, endbit=37),
273 multLimits( thrtype=
'ZeroBiasB', conn=
'Topo1Opt3', nbit=1, startbit=38, endbit=38),
274 multLimits( thrtype=
'EN', conn=
'Topo1Opt3', nbit=1, startbit=39, endbit=86),
278 for conn
in l1menu.connectors:
279 if 'Topo1' not in conn.name
or conn.legacy:
281 for tl
in conn.triggerLines:
282 if 'Perf' in tl.name:
284 tl_name =
'Mult_'+tl.name
285 algo = l1menu.topoAlgos.topoAlgos[AlgCategory.MULTI][AlgType.MULT][tl_name]
287 for ml
in multiplicities:
289 if 'LArSaturation' in algo.name:
290 thrtype =
'LArSaturation'
291 elif 'XE' in algo.input
or 'TE' in algo.input
or 'MHT' in algo.input:
293 if 'eEmVar' in algo.classtype:
295 if conn.name==ml.conn
and thrtype==ml.thrtype
and algo.nbits==ml.nbit
and tl.startbit>=ml.startbit
and (tl.startbit+tl.nbits-1)<=ml.endbit:
298 raise RuntimeError(
"The multiplicity algorithm %s with startbit %i does not fit with Topo1 and CTP FW. If this is intended, please correct the multiplicity constraints and communicate the new menu to the L1TOPO and CTP groups." % (algo.name, tl.startbit) )