226 List of the constraints in terms of multiplicity algorithms, to make sure the menu fits
229 The Phase-I L1Topo boards contain 2 FPGAs, with 2 output fibers each (connected to the CTP).
230 Up to 96 bits per fiber.
242 multLimits = namedtuple(
'ML', [
'thrtype',
'conn',
'nbit',
'startbit',
'endbit'])
245 multLimits(thrtype=
'eEM', conn=
'Topo1Opt0', nbit=3, startbit=0, endbit=11),
246 multLimits(thrtype=
'eEM', conn=
'Topo1Opt0', nbit=2, startbit=24, endbit=43),
247 multLimits(thrtype=
'eEMV', conn=
'Topo1Opt0', nbit=2, startbit=44, endbit=63),
248 multLimits(thrtype=
'ZeroBiasA', conn=
'Topo1Opt0', nbit=1, startbit=64, endbit=64),
251 multLimits(thrtype=
'eTAU', conn=
'Topo1Opt1', nbit=3, startbit=0, endbit=8 ),
252 multLimits(thrtype=
'eTAU', conn=
'Topo1Opt1', nbit=2, startbit=12, endbit=35),
253 multLimits(thrtype=
'gLJ', conn=
'Topo1Opt1', nbit=2, startbit=40, endbit=55),
254 multLimits(thrtype=
'gJ', conn=
'Topo1Opt1', nbit=3, startbit=58, endbit=66),
255 multLimits(thrtype=
'gJ', conn=
'Topo1Opt1', nbit=2, startbit=70, endbit=75),
256 multLimits(thrtype=
'eTAU', conn=
'Topo1Opt1', nbit=2, startbit=78, endbit=81),
259 multLimits(thrtype=
'jJ', conn=
'Topo1Opt2', nbit=3, startbit=0, endbit=32),
260 multLimits(thrtype=
'jJ', conn=
'Topo1Opt2', nbit=2, startbit=36, endbit=73),
263 multLimits(thrtype=
'jTAU', conn=
'Topo1Opt3', nbit=3, startbit=0, endbit=2 ),
264 multLimits(thrtype=
'jTAU', conn=
'Topo1Opt3', nbit=2, startbit=6, endbit=7 ),
265 multLimits(thrtype=
'cTAU', conn=
'Topo1Opt3', nbit=3, startbit=14, endbit=22),
266 multLimits(thrtype=
'cTAU', conn=
'Topo1Opt3', nbit=2, startbit=23, endbit=30),
267 multLimits(thrtype=
'jEM', conn=
'Topo1Opt3', nbit=2, startbit=31, endbit=36),
268 multLimits(thrtype=
'LArSaturation', conn=
'Topo1Opt3', nbit=1, startbit=37, endbit=37),
269 multLimits(thrtype=
'ZeroBiasB', conn=
'Topo1Opt3', nbit=1, startbit=38, endbit=38),
270 multLimits(thrtype=
'EN', conn=
'Topo1Opt3', nbit=1, startbit=39, endbit=86),
273 for conn
in l1menu.connectors:
274 if 'Topo1' not in conn.name
or conn.legacy:
continue
276 for tl
in conn.triggerLines:
277 if 'Perf' in tl.name:
continue
279 algo = l1menu.topoAlgos.topoAlgos[AlgCategory.MULTI][AlgType.MULT][f
'Mult_{tl.name}']
282 if 'LArSaturation' in algo.name:
283 thrtype =
'LArSaturation'
284 elif 'XE' in algo.input
or 'TE' in algo.input
or 'MHT' in algo.input
or 'ESPRESSO' in algo.input:
286 elif 'eEmVar' in algo.classtype:
289 for ml
in multiplicities:
290 if conn.name == ml.conn
and thrtype == ml.thrtype
and algo.nbits == ml.nbit
and tl.startbit >= ml.startbit
and tl.endbit <= ml.endbit:
293 raise RuntimeError(f
'The multiplicity algorithm {algo.name} with startbit {tl.startbit} does not fit in the current Topo1 and CTP FWs. If this is intended, please correct the multiplicity constraints and communicate the new menu to the L1Topo and CTP groups.')
296 for etl
in conn.emptyTriggerLines:
297 log.debug(
'Empty Multiplicity placeholder in bits %i-%i of %s', etl.startbit, etl.endbit, conn.name)
298 for ml
in multiplicities:
300 if conn.name == ml.conn
and etl.startbit >= ml.startbit
and etl.endbit <= ml.endbit:
301 raise RuntimeError(f
'One of the Empty or (Empty, nbits) Multiplicity algorithm placeholders in the L1 Menu is overlapping with the declared multiplicity algorithm bit ranges ({conn.name}, bits {etl.startbit}-{etl.endbit}). Check the bit mapping and algorithm alignments!')