225 List of the constraints in terms of multiplicity algorithms, to make sure the menu fits
228 The Phase-I L1Topo boards contain 2 FPGAs, with 2 output fibers each (connected to the CTP).
229 Up to 96 bits per fiber.
241 multLimits = namedtuple(
'ML', [
'thrtype',
'conn',
'nbit',
'startbit',
'endbit'])
244 multLimits(thrtype=
'eEM', conn=
'Topo1Opt0', nbit=3, startbit=0, endbit=11),
245 multLimits(thrtype=
'eEM', conn=
'Topo1Opt0', nbit=2, startbit=24, endbit=43),
246 multLimits(thrtype=
'eEMV', conn=
'Topo1Opt0', nbit=2, startbit=44, endbit=63),
247 multLimits(thrtype=
'ZeroBiasA', conn=
'Topo1Opt0', nbit=1, startbit=64, endbit=64),
250 multLimits(thrtype=
'eTAU', conn=
'Topo1Opt1', nbit=3, startbit=0, endbit=8 ),
251 multLimits(thrtype=
'eTAU', conn=
'Topo1Opt1', nbit=2, startbit=12, endbit=35),
252 multLimits(thrtype=
'gLJ', conn=
'Topo1Opt1', nbit=2, startbit=40, endbit=55),
253 multLimits(thrtype=
'gJ', conn=
'Topo1Opt1', nbit=3, startbit=58, endbit=66),
254 multLimits(thrtype=
'gJ', conn=
'Topo1Opt1', nbit=2, startbit=70, endbit=75),
255 multLimits(thrtype=
'eTAU', conn=
'Topo1Opt1', nbit=2, startbit=78, endbit=81),
258 multLimits(thrtype=
'jJ', conn=
'Topo1Opt2', nbit=3, startbit=0, endbit=32),
259 multLimits(thrtype=
'jJ', conn=
'Topo1Opt2', nbit=2, startbit=36, endbit=73),
262 multLimits(thrtype=
'jTAU', conn=
'Topo1Opt3', nbit=3, startbit=0, endbit=2 ),
263 multLimits(thrtype=
'jTAU', conn=
'Topo1Opt3', nbit=2, startbit=6, endbit=7 ),
264 multLimits(thrtype=
'cTAU', conn=
'Topo1Opt3', nbit=3, startbit=14, endbit=22),
265 multLimits(thrtype=
'cTAU', conn=
'Topo1Opt3', nbit=2, startbit=23, endbit=30),
266 multLimits(thrtype=
'jEM', conn=
'Topo1Opt3', nbit=2, startbit=31, endbit=36),
267 multLimits(thrtype=
'LArSaturation', conn=
'Topo1Opt3', nbit=1, startbit=37, endbit=37),
268 multLimits(thrtype=
'ZeroBiasB', conn=
'Topo1Opt3', nbit=1, startbit=38, endbit=38),
269 multLimits(thrtype=
'EN', conn=
'Topo1Opt3', nbit=1, startbit=39, endbit=86),
272 for conn
in l1menu.connectors:
273 if 'Topo1' not in conn.name
or conn.legacy:
continue
275 for tl
in conn.triggerLines:
276 if 'Perf' in tl.name:
continue
278 algo = l1menu.topoAlgos.topoAlgos[AlgCategory.MULTI][AlgType.MULT][f
'Mult_{tl.name}']
281 if 'LArSaturation' in algo.name:
282 thrtype =
'LArSaturation'
283 elif 'XE' in algo.input
or 'TE' in algo.input
or 'MHT' in algo.input
or 'ESPRESSO' in algo.input:
285 elif 'eEmVar' in algo.classtype:
288 for ml
in multiplicities:
289 if conn.name == ml.conn
and thrtype == ml.thrtype
and algo.nbits == ml.nbit
and tl.startbit >= ml.startbit
and tl.endbit <= ml.endbit:
292 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.')
295 for etl
in conn.emptyTriggerLines:
296 log.debug(
'Empty Multiplicity placeholder in bits %i-%i of %s', etl.startbit, etl.endbit, conn.name)
297 for ml
in multiplicities:
299 if conn.name == ml.conn
and etl.startbit >= ml.startbit
and etl.endbit <= ml.endbit:
300 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!')