2 from collections
import namedtuple
3 from AthenaCommon.Logging
import logging
4 log = logging.getLogger(__name__)
6 from ..Base.TopoAlgos
import EMMultiplicityAlgo, TauMultiplicityAlgo, JetMultiplicityAlgo, XEMultiplicityAlgo, LArSaturationAlgo, ZeroBiasAlgo
7 from ..Base.TopoAlgorithms
import AlgType, AlgCategory
11 Defines the TopoAlgorithms that calculate multiplicities for L1Calo thresholds
12 The thresholds have to be explicitly defined here.
17 emThresholds_3bits = [
18 'eEM5',
'eEM7',
'eEM9',
'eEM10L',
20 emThresholds_2bits = [
21 'eEM12L',
'eEM15',
'eEM18',
'eEM18L',
'eEM18M',
'eEM22M',
26 emVarThresholds_2bits = [
27 'eEM24VM',
'eEM26',
'eEM26L',
'eEM26M',
'eEM26T',
'eEM28M',
34 for em
in emThresholds_3bits:
37 nbits = 3, classtype=
'eEmMultiplicity')
38 tm.registerTopoAlgo(alg)
40 for em
in emThresholds_2bits:
43 nbits = 2, classtype=
'eEmMultiplicity')
44 tm.registerTopoAlgo(alg)
46 for em
in emVarThresholds_2bits:
49 nbits = 2, classtype=
'eEmVarMultiplicity')
50 tm.registerTopoAlgo(alg)
52 emThresholds_2bits = [
58 for em
in emThresholds_2bits:
61 nbits = 2, classtype=
'jEmMultiplicity')
62 tm.registerTopoAlgo(alg)
64 etauThresholds_3bits = [
65 'eTAU1',
'eTAU12',
'eTAU20',
69 jtauThresholds_3bits = [
72 ctauThresholds_3bits = [
78 etauThresholds_2bits = [
79 'eTAU20L',
'eTAU20M',
'eTAU30',
'eTAU30M',
'eTAU35',
'eTAU35M',
'eTAU40HM',
'eTAU60',
'eTAU80',
'eTAU140',
82 'eTAU40HT',
'eTAU60HM',
'eTAU60HL',
'eTAU80HL',
84 jtauThresholds_2bits = [
85 'jTAU1',
'jTAU30',
'jTAU30M',
89 ctauThresholds_2bits = [
96 for tau
in etauThresholds_3bits:
99 nbits = 3, classtype=
'eTauMultiplicity')
100 tm.registerTopoAlgo(alg)
102 for tau
in jtauThresholds_3bits:
105 nbits = 3, classtype=
'jTauMultiplicity')
106 tm.registerTopoAlgo(alg)
108 for tau
in ctauThresholds_3bits:
111 nbits = 3, classtype=
'cTauMultiplicity')
112 tm.registerTopoAlgo(alg)
114 for tau
in etauThresholds_2bits:
117 nbits = 2, classtype=
'eTauMultiplicity')
118 tm.registerTopoAlgo(alg)
120 for tau
in jtauThresholds_2bits:
123 nbits = 2, classtype=
'jTauMultiplicity')
124 tm.registerTopoAlgo(alg)
126 for tau
in ctauThresholds_2bits:
129 nbits = 2, classtype=
'cTauMultiplicity')
130 tm.registerTopoAlgo(alg)
133 jJThresholds_3bits = [
134 'jJ20',
'jJ30',
'jJ30p0ETA25',
'jJ40',
'jJ40p0ETA25',
'jJ50',
'jJ55',
'jJ55p0ETA23',
'jJ60',
137 'jJSPARE1',
'jJSPARE2',
139 jJThresholds_2bits = [
140 'jJ70p0ETA23',
'jJ80',
'jJ80p0ETA25',
'jJ85p0ETA21',
142 'jJ140',
'jJ160',
'jJ180',
'jJ500',
144 'jJ15p30ETA49',
'jJ20p30ETA49',
145 'jJ40p30ETA49',
'jJ50p30ETA49',
'jJ60p30ETA49',
'jJ90p30ETA49',
'jJ125p30ETA49',
148 'jJSPARE3',
'jJSPARE4',
151 for jJet
in jJThresholds_3bits:
154 nbits = 3, classtype=
'jJetMultiplicity')
155 tm.registerTopoAlgo(alg)
157 for jJet
in jJThresholds_2bits:
160 nbits = 2, classtype=
'jJetMultiplicity')
161 tm.registerTopoAlgo(alg)
163 jLJThresholds_2bits = [
165 'jLJ80',
'jLJ120',
'jLJ140',
'jLJ180',
168 'jLJ60',
'jLJ100',
'jLJ160',
'jLJ200',
171 for jLJet
in jLJThresholds_2bits:
174 nbits = 2, classtype=
'jLJetMultiplicity')
175 tm.registerTopoAlgo(alg)
177 gJThresholds_3bits = [
'gJ20p0ETA25',
'gJ20p25ETA49',
'gJSPARE1',]
178 gJThresholds_2bits = [
'gJ50p0ETA25',
'gJ100p0ETA25',
'gJ400p0ETA25']
180 for gJet
in gJThresholds_3bits:
183 nbits = 3, classtype=
'gJetMultiplicity')
184 tm.registerTopoAlgo(alg)
186 for gJet
in gJThresholds_2bits:
189 nbits = 2, classtype=
'gJetMultiplicity')
190 tm.registerTopoAlgo(alg)
192 gLJThresholds_2bits = [
193 'gLJ80p0ETA25',
'gLJ100p0ETA25',
'gLJ140p0ETA25',
'gLJ160p0ETA25',
196 'gLJSPARE1',
'gLJSPARE2',
'gLJSPARE3',
'gLJSPARE4',
199 for gLJet
in gLJThresholds_2bits:
202 nbits = 2, classtype=
'gLJetMultiplicity')
203 tm.registerTopoAlgo(alg)
206 'gXEJWOJ60',
'gXEJWOJ70',
'gXEJWOJ80',
'gXEJWOJ100',
'gXEJWOJ110',
'gXEJWOJ120',
'gXEJWOJ500',
208 'gXENC70',
'gXENC100',
210 'jXE60',
'jXE70',
'jXE80',
'jXE90',
'jXE100',
'jXE110',
'jXE120',
'jXE500',
212 'jXEC100',
'jTE200',
'jTEC200',
'jTEFWD100',
'jTEFWDA100',
'jTEFWDC100',
216 'jTE3',
'jTE4',
'jTE5',
'jTE10',
'jTE20',
'jTE50',
217 'jTE100',
'jTE600',
'jTE1500',
'jTE3000',
'jTE10000',
218 'jTEFWDA1',
'jTEFWDC1',
'jTEFWDA5',
'jTEFWDC5',
226 'jXESPARE1',
'jXESPARE2',
'jXESPARE3',
'jXESPARE4',
227 'jXESPARE5',
'jXESPARE6',
'jXESPARE7',
'jXESPARE8',
234 for XE
in XEThresholds:
238 tm.registerTopoAlgo(alg)
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) )