ATLAS Offline Software
TopoAlgoDefLegacy.py
Go to the documentation of this file.
1 # Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
2 
3 from .TypeWideThresholdConfig import getTypeWideThresholdConfig
4 
5 # algorithm python base classes generated from C++ code
6 import L1TopoAlgorithms.L1TopoAlgConfig as AlgConf
7 import L1TopoHardware.L1TopoHardware as HW
8 from AthenaCommon.Logging import logging
9 log = logging.getLogger(__name__)
10 
12 
13  @staticmethod
15 
16  _etamax = 49
17  _minet = 0
18  _emscale_for_decision = 1000 / getTypeWideThresholdConfig("EM")["resolutionMeV"]
19 
20  alg = AlgConf.ClusterNoSort( name = 'EMall', inputs = 'ClusterTobArray', outputs = 'EMall')
21  alg.addgeneric('InputWidth', HW.InputWidthEM)
22  alg.addgeneric('OutputWidth', HW.InputWidthEM)
23  alg.addvariable('IsoMask', 0)
24  tm.registerTopoAlgo(alg)
25 
26 
27  alg = AlgConf.ClusterSelect( name = 'TAUabi', inputs = 'ClusterTobArray', outputs = 'TAUabi')
28  alg.addgeneric('InputWidth', HW.InputWidthTAU)
29  alg.addgeneric('InputWidth1stStage', HW.InputWidth1stStageSelectTAU )
30  alg.addgeneric('OutputWidth', HW.OutputWidthSelectTAU)
31  alg.addvariable('MinET', 12)
32  alg.addvariable('IsoMask', 2)
33  alg.addvariable('MinEta', 0)
34  alg.addvariable('MaxEta', _etamax)
35  alg.addgeneric('DoIsoCut', 1)
36  tm.registerTopoAlgo(alg)
37 
38 
39  alg = AlgConf.ClusterSelect( name = 'EMabi', inputs = 'ClusterTobArray', outputs = 'EMabi')
40  alg.addgeneric('InputWidth', HW.InputWidthEM)
41  alg.addgeneric('InputWidth1stStage', HW.InputWidth1stStageSelectEM )
42  alg.addgeneric('OutputWidth', HW.OutputWidthSelectEM)
43  alg.addvariable('MinET', 8)
44  alg.addvariable('IsoMask', 2)
45  alg.addvariable('MinEta', 0)
46  alg.addvariable('MaxEta', _etamax)
47  alg.addgeneric('DoIsoCut', 1)
48  tm.registerTopoAlgo(alg)
49 
50 
51  alg = AlgConf.ClusterSelect( name = 'EMabhi', inputs = 'ClusterTobArray', outputs = 'EMabhi')
52  alg.addgeneric('InputWidth', HW.InputWidthEM)
53  alg.addgeneric('InputWidth1stStage', HW.InputWidth1stStageSelectEM )
54  alg.addgeneric('OutputWidth', HW.OutputWidthSelectEM)
55  alg.addvariable('MinET', 8)
56  alg.addvariable('IsoMask', 3)
57  alg.addvariable('MinEta', 0)
58  alg.addvariable('MaxEta', _etamax)
59  alg.addgeneric('DoIsoCut', 1)
60  tm.registerTopoAlgo(alg)
61 
62 
63  alg = AlgConf.ClusterSelect( name = 'TAUab', inputs = 'ClusterTobArray', outputs = 'TAUab')
64  alg.addgeneric('InputWidth', HW.InputWidthTAU)
65  alg.addgeneric('InputWidth1stStage', HW.InputWidth1stStageSelectTAU )
66  alg.addgeneric('OutputWidth', HW.OutputWidthSelectTAU)
67  alg.addvariable('MinET', 12)
68  alg.addvariable('IsoMask', 0)
69  alg.addvariable('MinEta', 0)
70  alg.addvariable('MaxEta', _etamax)
71  alg.addgeneric('DoIsoCut', 0)
72  tm.registerTopoAlgo(alg)
73 
74 
75  alg = AlgConf.ClusterSort( name = 'EMs', inputs = 'ClusterTobArray', outputs = 'EMs')
76  alg.addgeneric('InputWidth', HW.InputWidthEM)
77  alg.addgeneric('InputWidth1stStage', HW.InputWidth1stStageSortEM)
78  alg.addgeneric('OutputWidth', HW.OutputWidthSortEM)
79  alg.addvariable('IsoMask', 0)
80  alg.addvariable('MinEta', 0)
81  alg.addvariable('MaxEta', _etamax)
82  alg.addgeneric('DoIsoCut', 0)
83  tm.registerTopoAlgo(alg)
84 
85 
86  alg = AlgConf.ClusterSort( name = 'EMshi', inputs = 'ClusterTobArray', outputs = 'EMshi')
87  alg.addgeneric('InputWidth', HW.InputWidthEM)
88  alg.addgeneric('InputWidth1stStage', HW.InputWidth1stStageSortEM)
89  alg.addgeneric('OutputWidth', HW.OutputWidthSortEM)
90  alg.addvariable('IsoMask', 3)
91  alg.addvariable('MinEta', 0)
92  alg.addvariable('MaxEta', _etamax)
93  alg.addgeneric('DoIsoCut', 1)
94  tm.registerTopoAlgo(alg)
95 
96 
97  alg = AlgConf.ClusterSort( name = 'TAUsi', inputs = 'ClusterTobArray', outputs = 'TAUsi')
98  alg.addgeneric('InputWidth', HW.InputWidthTAU)
99  alg.addgeneric('InputWidth1stStage', HW.InputWidth1stStageSortTAU)
100  alg.addgeneric('OutputWidth', HW.OutputWidthSortTAU)
101  alg.addvariable('IsoMask', 2)
102  alg.addvariable('MinEta', 0)
103  alg.addvariable('MaxEta', _etamax)
104  alg.addgeneric('DoIsoCut', 1)
105  tm.registerTopoAlgo(alg)
106 
107 
108  alg = AlgConf.JetNoSort( name = 'AJall', inputs = 'JetTobArray', outputs = 'AJall')
109  alg.addgeneric('InputWidth', HW.InputWidthJET)
110  alg.addgeneric('OutputWidth', HW.InputWidthJET)
111  alg.addgeneric('JetSize', HW.DefaultJetSize)
112  tm.registerTopoAlgo(alg)
113 
114 
115  alg = AlgConf.JetNoSort( name = 'AJjall', inputs = 'JetTobArray', outputs = 'AJjall')
116  alg.addgeneric('InputWidth', HW.InputWidthJET)
117  alg.addgeneric('OutputWidth', HW.InputWidthJET)
118  alg.addgeneric('JetSize', 1 if HW.DefaultJetSize.value==2 else 2)
119  tm.registerTopoAlgo(alg)
120 
121 
122  # for 0MATCH-4AJ20-4AJj15
123  alg = AlgConf.JetNoSortMatch( name = 'AJMatchall', inputs = 'JetTobArray', outputs = 'AJMatchall')
124  alg.addgeneric('InputWidth', HW.InputWidthJET)
125  alg.addgeneric('OutputWidth', HW.InputWidthJET)
126  alg.addgeneric('JetSize', 2 if HW.DefaultJetSize.value==2 else 1)
127  alg.addvariable('MinET1', 15) # 4x4
128  alg.addvariable('MinET2', 20) # 8x8
129  tm.registerTopoAlgo(alg)
130 
131 
132  # ab J lists:
133  for idc, jet_type in enumerate(['J', 'CJ', 'FJ']):
134  jetabseta = _etamax
135  _minet = 25
136  _mineta=0
137  if jet_type=='J':
138  jetabseta = 31
139  _minet = 20
140  elif jet_type=='CJ':
141  jetabseta = 26
142  _minet = 15
143  elif jet_type=='FJ':
144  _mineta = 31
145  _minet = 15
146  alg = AlgConf.JetSelect( name = jet_type+'ab', inputs = 'JetTobArray', outputs = jet_type+'ab')
147  alg.addgeneric('InputWidth', HW.InputWidthJET)
148  alg.addgeneric('InputWidth1stStage', HW.InputWidth1stStageSelectJET )
149  alg.addgeneric('OutputWidth', HW.OutputWidthSelectJET)
150  alg.addgeneric('JetSize', HW.DefaultJetSize.value)
151  alg.addvariable('MinET', _minet)
152  alg.addvariable('MinEta', _mineta)
153  alg.addvariable('MaxEta', jetabseta)
154  alg.addgeneric('DoEtaCut', 1)
155  tm.registerTopoAlgo(alg)
156 
157 
158  alg = AlgConf.JetSort( name = 'AJjs', inputs = 'JetTobArray', outputs = 'AJjs')
159  alg.addgeneric('InputWidth', HW.InputWidthJET)
160  alg.addgeneric('InputWidth1stStage', HW.InputWidth1stStageSortJET )
161  alg.addgeneric('OutputWidth', HW.OutputWidthSortJET )
162  alg.addgeneric('JetSize', 1 if HW.DefaultJetSize.value==2 else 2)
163  alg.addvariable('MinEta', 0)
164  alg.addvariable('MaxEta', _etamax)
165  alg.addgeneric('DoEtaCut', 0)
166  tm.registerTopoAlgo(alg)
167 
168 
169  # Sorted J lists:
170  for idc, jet_type in enumerate(['AJ', 'FJ']):
171  jetabseta = _etamax
172  _minet = 25
173  _mineta = 0
174  if jet_type=='J':
175  jetabseta = 31
176  _minet = 20
177  elif jet_type=='CJ':
178  jetabseta = 26
179  _minet = 15
180  elif jet_type=='FJ':
181  _mineta = 31
182  _minet = 15
183 
184  alg = AlgConf.JetSort( name = jet_type+'s', inputs = 'JetTobArray', outputs = jet_type+'s')
185  alg.addgeneric('InputWidth', HW.InputWidthJET)
186  alg.addgeneric('InputWidth1stStage', HW.InputWidth1stStageSortJET )
187  alg.addgeneric('OutputWidth', HW.OutputWidthSortJET )
188  alg.addgeneric('JetSize', HW.DefaultJetSize.value)
189  alg.addvariable('MinEta', _mineta)
190  alg.addvariable('MaxEta', jetabseta)
191  if jet_type=='FJ':
192  alg.addgeneric('DoEtaCut', 1)
193  else:
194  alg.addgeneric('DoEtaCut', 0)
195  tm.registerTopoAlgo(alg)
196 
197 
198  alg = AlgConf.JetSort( name = 'Js', inputs = 'JetTobArray', outputs = 'Js')
199  alg.addgeneric('InputWidth', HW.InputWidthJET)
200  alg.addgeneric('InputWidth1stStage', HW.InputWidth1stStageSortJET )
201  alg.addgeneric('OutputWidth', HW.OutputWidthSortJET )
202  alg.addgeneric('JetSize', HW.DefaultJetSize.value)
203  alg.addvariable('MinEta', 0)
204  alg.addvariable('MaxEta', 31)
205  alg.addgeneric('DoEtaCut', 1)
206  tm.registerTopoAlgo(alg)
207 
208 
209  alg = AlgConf.METNoSort( name = 'XENoSort', inputs = 'MetTobArray', outputs = 'XENoSort')
210  alg.addgeneric('InputWidth', HW.InputWidthMET)
211  alg.addgeneric('OutputWidth', HW.OutputWidthMET)
212  tm.registerTopoAlgo(alg)
213 
214  alg = AlgConf.MetSort( name = 'XE', inputs = 'MetTobArray', outputs = 'XE')
215  alg.addgeneric('InputWidth', HW.InputWidthMET)
216  alg.addgeneric('OutputWidth', HW.OutputWidthMET)
217  tm.registerTopoAlgo(alg)
218 
219  alg = AlgConf.MuonSelect( name = 'MUab', inputs = 'MuonTobArray', outputs = 'MUab')
220  alg.addgeneric('InputWidth', HW.InputWidthMU)
221  alg.addgeneric('InputWidth1stStage', HW.InputWidth1stStageSelectMU )
222  alg.addgeneric('OutputWidth', HW.OutputWidthSelectMU)
223  alg.addvariable('MinET', 4)
224  alg.addvariable('MinEta', 0)
225  alg.addvariable('MaxEta', 25)
226  tm.registerTopoAlgo(alg)
227 
228  alg = AlgConf.MuonSort( name = 'MUs', inputs = 'MuonTobArray', outputs = 'MUs')
229  alg.addgeneric('InputWidth', HW.InputWidthMU)
230  alg.addgeneric('InputWidth1stStage', HW.InputWidth1stStageSortMU )
231  alg.addgeneric('OutputWidth', HW.OutputWidthSortMU)
232  # alg.addvariable('MinET', 4)
233  alg.addvariable('MinEta', 0)
234  alg.addvariable('MaxEta', 25)
235  tm.registerTopoAlgo(alg)
236 
237 
238  alg = AlgConf.MuonSelect( name = 'CMUab', inputs = 'MuonTobArray', outputs = 'CMUab')
239  alg.addgeneric('InputWidth', HW.InputWidthMU)
240  alg.addgeneric('InputWidth1stStage', HW.InputWidth1stStageSelectMU )
241  alg.addgeneric('OutputWidth', HW.OutputWidthSelectMU)
242  alg.addvariable('MinET', 4)
243  alg.addvariable('MinEta', 0)
244  alg.addvariable('MaxEta', 10)
245  tm.registerTopoAlgo(alg)
246 
247 
248  alg = AlgConf.MuonSort_1BC( name = 'LMUs', inputs = 'LateMuonTobArray', outputs = 'LMUs')
249  alg.addgeneric('InputWidth', HW.InputWidthMU)
250  #alg.addgeneric('InputWidth1stStage', HW.InputWidth1stStageSortMU )
251  alg.addgeneric('OutputWidth', HW.OutputWidthSortMU)
252  alg.addgeneric('nDelayedMuons', 1)
253  alg.addvariable('MinEta', 0)
254  alg.addvariable('MaxEta', 25)
255  tm.registerTopoAlgo(alg)
256 
257 
258  # Abbreviated lists:
259  alg = AlgConf.ClusterSelect( name = 'EMab', inputs = 'ClusterTobArray', outputs = 'EMab')
260  alg.addgeneric('InputWidth', HW.InputWidthEM)
261  alg.addgeneric('InputWidth1stStage', HW.InputWidth1stStageSelectEM )
262  alg.addgeneric('OutputWidth', HW.OutputWidthSelectEM)
263  alg.addvariable('MinET', 5)
264  alg.addvariable('IsoMask', 0)
265  alg.addvariable('MinEta', 0)
266  alg.addvariable('MaxEta', _etamax)
267  alg.addgeneric('DoIsoCut', 0)
268  tm.registerTopoAlgo(alg)
269 
270 
271  # "all" lists:
272  alg = AlgConf.ClusterNoSort( name = 'TAUall', inputs = 'ClusterTobArray', outputs = 'TAUall')
273  alg.addgeneric('InputWidth', HW.InputWidthTAU)
274  alg.addgeneric('OutputWidth', HW.InputWidthTAU)
275  alg.addvariable('IsoMask', 0)
276  tm.registerTopoAlgo(alg)
277 
278 
279 
284 
285  # VBF items
286  algoList = [
287  { "algoname": 'INVM_AJ_HighMass', "Threlist": [ 900, 800, 700, 500 ], "maxInvm": 9999, "otype" : "AJ", "ocut1" : 30, "olist" : "s",
288  "nleading1" : 6, "inputwidth1": HW.OutputWidthSortJET, "ocut2" : 20, "nleading2" : 6},
289  { "algoname": 'INVM_AJ_LowMass', "Threlist": [ 400, 300, 200, 100 ], "maxInvm": 9999, "otype" : "AJ", "ocut1" : 30, "olist" : "s",
290  "nleading1" : 6, "inputwidth1": HW.OutputWidthSortJET, "ocut2" : 20, "nleading2" : 6}
291  ]
292  for x in algoList:
293  class d:
294  pass
295  for k in x:
296  setattr (d, k, x[k])
297  inputList = d.otype + d.olist
298  toponames=[]
299  for minInvm in d.Threlist:
300  toponame = "%iINVM%i-%s%s%s%s-%s%s%s%s" % (minInvm, d.maxInvm,
301  d.otype, str(d.ocut1) , d.olist, str(d.nleading1) if d.olist=="s" else "",
302  d.otype, str(d.ocut2) , d.olist, str(d.nleading2) if d.olist=="s" else "")
303  toponames.append(toponame)
304  alg = AlgConf.InvariantMassInclusive1( name = d.algoname, inputs = inputList, outputs = toponames)
305  alg.addgeneric('InputWidth', d.inputwidth1)
306  alg.addgeneric('MaxTob', d.nleading1)
307  alg.addgeneric('NumResultBits', len(toponames))
308  for bitid, minInvm in enumerate(d.Threlist):
309  alg.addvariable('MinET1', d.ocut1, bitid)
310  alg.addvariable('MinET2', d.ocut2, bitid)
311  alg.addvariable('MinMSqr', minInvm * minInvm, bitid)
312  alg.addvariable('MaxMSqr', d.maxInvm * d.maxInvm, bitid)
313  tm.registerTopoAlgo(alg)
314 
315 
316  # dimu INVM items
317  listofalgos = [
318  {"minInvm": 2, "maxInvm": 8, "mult": 2, "otype1" : "MU", "ocut1": 4, "olist" : "ab", "otype2" : "", "ocut2" : 0, "onebarrel": 0}, #2INVM8-2MU4ab
319  {"minInvm": 2, "maxInvm": 9, "mult": 2, "otype1" : "MU", "ocut1": 4, "olist" : "ab", "otype2" : "", "ocut2" : 0, "onebarrel": 0}, #2INVM9-2MU4ab
320  {"minInvm": 8, "maxInvm": 15, "mult": 1, "otype1" : "MU", "ocut1": 6, "olist" : "ab", "otype2" : "MU","ocut2" : 4, "onebarrel": 0}, #8INVM15-MU6ab-MU4ab
321  {"minInvm": 2, "maxInvm": 8, "mult": 1, "otype1" : "MU", "ocut1": 6, "olist" : "ab", "otype2" : "MU","ocut2" : 4, "onebarrel": 0}, #2INVM8-MU6ab-MU4ab
322  {"minInvm": 2, "maxInvm": 9, "mult": 1, "otype1" : "MU", "ocut1": 6, "olist" : "ab", "otype2" : "MU","ocut2" : 4, "onebarrel": 0}, #2INVM9-MU6ab-MU4ab
323  {"minInvm": 8, "maxInvm": 15, "mult": 2, "otype1" : "MU", "ocut1": 6, "olist" : "ab", "otype2" : "", "ocut2" : 0, "onebarrel": 0}, #8INVM15-2MU6ab
324  {"minInvm": 2, "maxInvm": 9, "mult": 2, "otype1" : "MU", "ocut1": 6, "olist" : "ab", "otype2" : "", "ocut2" : 0, "onebarrel": 0}, #2INVM9-2MU6ab
325  {"minInvm": 7, "maxInvm": 15, "mult": 2, "otype1" : "MU", "ocut1": 4, "olist" : "ab", "otype2" : "", "ocut2" : 0, "onebarrel": 0}, #7INVM15-2MU4ab
326  ]
327  for x in listofalgos:
328  class d:
329  pass
330  for k in x:
331  setattr (d, k, x[k])
332  obj1 = "%s%s%s%s" % ((str(d.mult) if d.mult>1 else ""), d.otype1, str(d.ocut1), d.olist)
333  obj2 = "-%s%s%s" % (d.otype2, str(d.ocut2), d.olist)
334  toponame = "%iINVM%i-%s%s%s" % (d.minInvm, d.maxInvm, "ONEBARREL-" if d.onebarrel==1 else "", obj1, "" if d.mult>1 else obj2)
335  log.debug("Define %s", toponame)
336  inputList = [d.otype1 + d.olist] if (d.mult>1 or d.otype1==d.otype2) else [d.otype1 + d.olist, d.otype2 + d.olist]
337  algoname = AlgConf.InvariantMassInclusive1 if (d.mult>1 or d.otype1==d.otype2) else AlgConf.InvariantMassInclusive2
338  alg = algoname( name = toponame, inputs = inputList, outputs = [ toponame ])
339  if (d.mult>1 or d.otype1==d.otype2):
340  alg.addgeneric('InputWidth', HW.OutputWidthSelectMU)
341  alg.addgeneric('MaxTob', HW.OutputWidthSelectMU)
342  alg.addgeneric('RequireOneBarrel', d.onebarrel)
343  else:
344  alg.addgeneric('InputWidth1', HW.OutputWidthSelectMU)
345  alg.addgeneric('InputWidth2', HW.OutputWidthSelectMU)
346  alg.addgeneric('MaxTob1', HW.OutputWidthSelectMU)
347  alg.addgeneric('MaxTob2', HW.OutputWidthSelectMU)
348  alg.addgeneric('NumResultBits', 1)
349  alg.addvariable('MinET1', d.ocut1)
350  alg.addvariable('MinET2', d.ocut2 if d.ocut2>0 else d.ocut1)
351  alg.addvariable('MinMSqr', d.minInvm * d.minInvm)
352  alg.addvariable('MaxMSqr', d.maxInvm * d.maxInvm)
353  tm.registerTopoAlgo(alg)
354 
355 
356  # dimu DR items
357  listofalgos=[
358  {"minDr": 2, "maxDr": 99, "mult": 2, "otype1" : "MU" ,"ocut1": 4, "olist" : "ab", "otype2" : "", "ocut2": 4, "onebarrel": 0}, # SM Y x, 2DR99-2MU4ab
359  {"minDr": 0, "maxDr": 10, "mult": 1, "otype1" : "MU" ,"ocut1": 10, "olist" : "ab", "otype2" : "MU", "ocut2": 6, "onebarrel": 0}, # Exotic LFV x, 0DR10-MU10ab-MU6ab
360  {"minDr": 2, "maxDr": 15, "mult": 2, "otype1" : "MU" ,"ocut1": 6, "olist" : "ab", "otype2" : "", "ocut2": 6, "onebarrel": 0}, #x, 2DR15-2MU6ab
361  {"minDr": 0, "maxDr": 15, "mult": 2, "otype1" : "MU" ,"ocut1": 4, "olist" : "ab", "otype2" : "", "ocut2": 4, "onebarrel": 0}, #0DR15-2MU4ab
362  {"minDr": 0, "maxDr": 15, "mult": 1, "otype1" : "MU", "ocut1": 6, "olist" : "ab", "otype2" : "MU", "ocut2": 4, "onebarrel": 0}, #0DR15-MU6ab-MU4ab
363  {"minDr": 0, "maxDr": 34, "mult": 2, "otype1" : "MU" ,"ocut1": 4, "olist" : "ab", "otype2" : "", "ocut2": 4, "onebarrel": 0}, #0DR34-2MU4ab
364  {"minDr": 0, "maxDr": 24, "mult": 2, "otype1" : "MU" ,"ocut1": 4, "olist" : "ab", "otype2" : "", "ocut2": 4, "onebarrel": 0}, #0DR24-2MU4ab
365  {"minDr": 0, "maxDr": 22, "mult": 2, "otype1" : "MU" ,"ocut1": 6, "olist" : "ab", "otype2" : "", "ocut2": 6, "onebarrel": 0}, #0DR22-2MU6ab
366  {"minDr": 0, "maxDr": 22, "mult": 1, "otype1" : "MU", "ocut1": 6, "olist" : "ab", "otype2" : "MU", "ocut2": 4, "onebarrel": 0}, #0DR22-MU6ab-MU4ab
367  {"minDr": 0, "maxDr": 15, "mult": 2, "otype1" : "MU", "ocut1": 6, "olist" : "ab", "otype2" : "", "ocut2": 6, "onebarrel": 0}, #0DR15-2MU6ab
368  ]
369  for x in listofalgos:
370  class d:
371  pass
372  for k in x:
373  setattr (d, k, x[k])
374  obj1 = "%s%s%s%s" % ((str(d.mult) if d.mult>1 else ""), d.otype1, str(d.ocut1), d.olist)
375  obj2 = "-%s%s%s" % (d.otype2, str(d.ocut2), d.olist)
376  toponame = "%iDR%i-%s%s%s" % (d.minDr, d.maxDr, "ONEBARREL-" if d.onebarrel==1 else "", obj1, "" if d.mult>1 else obj2)
377  log.debug("Define %s", toponame)
378  inputList = [d.otype1 + d.olist] if (d.mult>1 or d.otype1==d.otype2) else [d.otype1 + d.olist, d.otype2 + d.olist]
379  algoname = AlgConf.DeltaRSqrIncl1 if (d.mult>1 or d.otype1==d.otype2) else AlgConf.DeltaRSqrIncl2
380  alg = algoname( name = toponame, inputs = inputList, outputs = [ toponame ])
381  if (d.mult>1 or d.otype1==d.otype2):
382  alg.addgeneric('InputWidth', HW.OutputWidthSelectMU)
383  alg.addgeneric('MaxTob', HW.OutputWidthSelectMU)
384  alg.addgeneric('RequireOneBarrel', d.onebarrel)
385  else:
386  alg.addgeneric('InputWidth1', HW.OutputWidthSelectMU)
387  alg.addgeneric('InputWidth2', HW.OutputWidthSelectMU)
388  alg.addgeneric('MaxTob1', HW.OutputWidthSelectMU)
389  alg.addgeneric('MaxTob2', HW.OutputWidthSelectMU)
390  alg.addgeneric('NumResultBits', 1)
391  alg.addvariable('MinET1', d.ocut1)
392  alg.addvariable('MinET2', d.ocut2)
393  alg.addvariable('DeltaRMin', d.minDr*d.minDr)
394  alg.addvariable('DeltaRMax', d.maxDr*d.maxDr)
395  tm.registerTopoAlgo(alg)
396 
397 
398  # deta-dphi with ab+ab
399  algolist=[
400  { "minDeta": 5, "maxDeta": 99, "minDphi": 5, "maxDphi": 99, "mult": 1, "otype1" : "MU", "ocut1": 6, "olist1" : "ab", "nleading1": HW.OutputWidthSelectMU,
401  "otype2" : "MU", "ocut2": 4, "olist2": "ab", "nleading2": HW.OutputWidthSelectMU}, #5DETA99-5DPHI99-MU6ab-MU4ab
402  { "minDeta": 5, "maxDeta": 99, "minDphi": 5, "maxDphi": 99, "mult": 2, "otype1" : "MU", "ocut1": 6, "olist1" : "ab", "nleading1": HW.OutputWidthSelectMU,
403  "otype2" : "", "ocut2": 6, "olist2": "", "nleading2": HW.OutputWidthSelectMU}, #5DETA99-5DPHI99-2MU6ab
404  ]
405  for x in algolist:
406  class d:
407  pass
408  for k in x:
409  setattr (d, k, x[k])
410  obj1 = "%s%s%s%s" % ((str(d.mult) if d.mult>1 else ""), d.otype1, str(d.ocut1), d.olist1)
411  obj2 = "-%s%s%s" % (d.otype2, str(d.ocut2) if d.ocut2>0 else "", d.olist2)
412  toponame = "%sDETA%s-%sDPHI%s-%s%s" % (d.minDeta, d.maxDeta, d.minDphi, d.maxDphi, obj1, "" if d.mult>1 else obj2)
413  log.debug("Define %s", toponame)
414  inputList = [d.otype1 + d.olist1] if (d.mult>1 or d.otype1==d.otype2) else [d.otype1 + d.olist1, d.otype2 + d.olist2]
415  algoname = AlgConf.DeltaEtaPhiIncl1 if (d.mult>1 or d.otype1==d.otype2) else AlgConf.DeltaEtaPhiIncl2
416  alg = algoname( name = toponame, inputs = inputList, outputs = [ toponame ])
417  alg.addgeneric('NumResultBits', 1)
418  if (d.mult>1 or d.otype1==d.otype2):
419  alg.addgeneric('InputWidth', d.nleading1)
420  alg.addgeneric('MaxTob', d.nleading1)
421  alg.addvariable('MinET1', d.ocut1)
422  alg.addvariable('MinET2', d.ocut2)
423  alg.addvariable('MinDeltaEta', d.minDeta)
424  alg.addvariable('MaxDeltaEta', d.maxDeta)
425  alg.addvariable('MinDeltaPhi', d.minDphi)
426  alg.addvariable('MaxDeltaPhi', d.maxDphi)
427  else:
428  alg.addgeneric('InputWidth1', d.nleading1)
429  alg.addgeneric('InputWidth2', d.nleading2)
430  alg.addgeneric('MaxTob1', d.nleading1)
431  alg.addgeneric('MaxTob2', d.nleading2)
432  alg.addvariable('DeltaEtaMin', d.minDeta)
433  alg.addvariable('DeltaEtaMax', d.maxDeta)
434  alg.addvariable('DeltaPhiMin', d.minDphi)
435  alg.addvariable('DeltaPhiMax', d.maxDphi)
436  alg.addvariable('MinET1', d.ocut1)
437  alg.addvariable('MinET2', d.ocut2)
438  tm.registerTopoAlgo(alg)
439 
440 
441  algolist = [
442  { "minDr": 0, "maxDr": 28, "otype1" : "MU" ,"ocut1": 10, "olist1" : "ab", "nleading1": HW.OutputWidthSelectMU, "inputwidth1": HW.OutputWidthSelectMU,
443  "otype2" : "TAU", "ocut2": 12, "olist2" : "abi", "nleading2": HW.OutputWidthSelectTAU, "inputwidth2": HW.OutputWidthSelectTAU}, # 0DR28-MU10ab-TAU12abi
444  { "minDr": 0, "maxDr": 28, "otype1" : "TAU" ,"ocut1": 20, "olist1" : "abi","nleading1": HW.OutputWidthSelectTAU, "inputwidth1": HW.OutputWidthSelectTAU,
445  "otype2" : "TAU", "ocut2": 12, "olist2" : "abi", "nleading2": HW.OutputWidthSelectTAU, "inputwidth2": HW.OutputWidthSelectTAU}, # 0DR28-TAU20abi-TAU12abi
446  { "minDr": 0, "maxDr": 25, "otype1" : "TAU" ,"ocut1": 20, "olist1" : "abi","nleading1": HW.OutputWidthSelectTAU, "inputwidth1": HW.OutputWidthSelectTAU,
447  "otype2" : "TAU", "ocut2": 12, "olist2" : "abi", "nleading2": HW.OutputWidthSelectTAU, "inputwidth2": HW.OutputWidthSelectTAU}, # 0DR25-TAU20abi-TAU12abi
448  ]
449  for x in algolist:
450  class d:
451  pass
452  for k in x:
453  setattr (d, k, x[k])
454  obj1 = "%s%s%s" % (d.otype1, str(d.ocut1), d.olist1)
455  obj2 = "-%s%s%s" % (d.otype2, str(d.ocut2), d.olist2)
456  toponame = "%iDR%i-%s%s" % (d.minDr, d.maxDr, obj1, obj2)
457  log.debug("Define %s", toponame)
458  inputList = [d.otype1 + d.olist1] if d.otype1==d.otype2 else [d.otype1 + d.olist1, d.otype2 + d.olist2]
459  algoname = AlgConf.DeltaRSqrIncl1 if d.otype1==d.otype2 else AlgConf.DeltaRSqrIncl2
460  alg = algoname( name = toponame, inputs = inputList, outputs = [ toponame ])
461  if d.otype1==d.otype2:
462  alg.addgeneric('InputWidth', d.inputwidth1)
463  alg.addgeneric('MaxTob', d.nleading1)
464  else:
465  alg.addgeneric('InputWidth1', d.inputwidth1)
466  alg.addgeneric('InputWidth2', d.inputwidth2)
467  alg.addgeneric('MaxTob1', d.nleading1)
468  alg.addgeneric('MaxTob2', d.nleading2)
469  alg.addgeneric('NumResultBits', 1)
470  if d.otype1==d.otype2:
471  alg.addvariable('MinET1', d.ocut1)
472  alg.addvariable('MinET2', d.ocut2)
473  alg.addvariable('DeltaRMin', d.minDr*d.minDr)
474  alg.addvariable('DeltaRMax', d.maxDr*d.maxDr)
475  else:
476  alg.addvariable('MinET1', d.ocut1, 0)
477  alg.addvariable('MinET2', d.ocut2, 0)
478  alg.addvariable('DeltaRMin', d.minDr*d.minDr, 0)
479  alg.addvariable('DeltaRMax', d.maxDr*d.maxDr, 0)
480  tm.registerTopoAlgo(alg)
481 
482 
483  # (ATR-8194) L1Topo HT Trigger
484  algoList = [
485  {"minHT": 150, "otype" : "J", "ocut" : 20, "olist" : "s", "nleading" : 5, "inputwidth": HW.OutputWidthSortJET, "oeta" : 31}, #HT150-J20s5pETA31
486  {"minHT": 190, "otype" : "J", "ocut" : 15, "olist" : "s", "nleading" : 5, "inputwidth": HW.OutputWidthSortJET, "oeta" : 21}, #HT190-J15s5pETA21
487  {"minHT": 190, "otype" : "AJ", "ocut" : 15, "olist" : "all", "nleading" : HW.InputWidthJET, "inputwidth": HW.InputWidthJET, "oeta" : 21}, #HT190-AJ15allpETA21
488  {"minHT": 150, "otype" : "AJ", "ocut" : 20, "olist" : "all", "nleading" : HW.InputWidthJET, "inputwidth": HW.InputWidthJET, "oeta" : 31}, #HT150-AJ20allpETA31
489  {"minHT": 150, "otype" : "AJj","ocut" : 15, "olist" : "all", "nleading" : HW.InputWidthJET, "inputwidth": HW.InputWidthJET, "oeta" : 49}, #HT150-AJj15allpETA49
490  {"minHT": 20, "otype" : "AJj","ocut" : 15, "olist" : "all", "nleading" : HW.InputWidthJET, "inputwidth": HW.InputWidthJET, "oeta" : 49}, #HT20-AJj15allpETA49
491  ]
492  for x in algoList:
493  class d:
494  pass
495  for k in x:
496  setattr (d, k, x[k])
497  toponame = "HT%d-%s%s%s%spETA%s" % (d.minHT, d.otype, str(d.ocut), d.olist, str(d.nleading) if d.olist=="s" else "", str(d.oeta))
498  log.debug("Define %s", toponame)
499  inputList = d.otype + d.olist
500  alg = AlgConf.JetHT( name = toponame, inputs = inputList, outputs = [toponame])
501  alg.addgeneric('InputWidth', d.inputwidth)
502  alg.addgeneric('MaxTob', d.nleading)
503  alg.addgeneric('NumRegisters', 2 if d.olist=="all" else 0)
504  alg.addgeneric('NumResultBits', 1)
505  alg.addvariable('MinET', d.ocut)
506  alg.addvariable('MinEta', 0)
507  alg.addvariable('MaxEta', d.oeta)
508  alg.addvariable('MinHt', d.minHT)
509  tm.registerTopoAlgo(alg)
510 
511 
512  # INVM_EM for Jpsi
513  algoList = [
514  {"algoname": 'INVM_EMs6' , "ocutlist": [ 0, 7, 12 ], "minInvm": 1, "maxInvm": 5, "otype" : "EM", "olist" : "s", "nleading" : 1, "inputwidth": HW.OutputWidthSortEM}
515  ]
516  for x in algoList:
517  class d:
518  pass
519  for k in x:
520  setattr (d, k, x[k])
521  inputList = d.otype + d.olist
522  toponames=[]
523  for ocut in d.ocutlist:
524  toponame = "%iINVM%i-%s%s%s%s-EMs6" % (d.minInvm, d.maxInvm, d.otype, str(ocut) if ocut > 0 else "", d.olist, str(d.nleading) if d.olist=="s" else "")
525  toponames.append(toponame)
526  alg = AlgConf.InvariantMassInclusive2( name = d.algoname, inputs = [inputList, 'EMs'], outputs = toponames)
527  alg.addgeneric('InputWidth1', d.inputwidth)
528  #alg.addgeneric('InputWidth2', HW.InputWidthEM)
529  alg.addgeneric('InputWidth2', HW.OutputWidthSortEM)
530  alg.addgeneric('MaxTob1', d.nleading)
531  #alg.addgeneric('MaxTob2', HW.InputWidthEM)
532  alg.addgeneric('MaxTob2', HW.OutputWidthSortEM)
533  alg.addgeneric('NumResultBits', len(toponames))
534  for bitid, ocut in enumerate(d.ocutlist):
535  alg.addvariable('MinET1', ocut, bitid)
536  alg.addvariable('MinET2', 0, bitid)
537  alg.addvariable('MinMSqr', (d.minInvm * _emscale_for_decision)*(d.minInvm * _emscale_for_decision), bitid)
538  alg.addvariable('MaxMSqr', (d.maxInvm * _emscale_for_decision)*(d.maxInvm * _emscale_for_decision), bitid)
539  tm.registerTopoAlgo(alg)
540 
541 
542  # W T&P: MINDPHI(J, XE0), (EM, XE0)
543  alglist = [
544  {"minDPhi": 5, "otype" : "AJj", "ocut" : 10, "olist" : "s", "nleading" : 6, "inputwidth": HW.OutputWidthSortJET},
545  {"minDPhi": 10, "otype" : "AJj", "ocut" : 10, "olist" : "s", "nleading" : 6, "inputwidth": HW.OutputWidthSortJET},
546  {"minDPhi": 15, "otype" : "AJj", "ocut" : 10, "olist" : "s", "nleading" : 6, "inputwidth": HW.OutputWidthSortJET},
547  {"minDPhi": 5, "otype" : "EM", "ocut" : 12, "olist" : "s", "nleading" : 6, "inputwidth": HW.OutputWidthSortEM},#new
548  {"minDPhi": 5, "otype" : "EM", "ocut" : 15, "olist" : "s", "nleading" : 6, "inputwidth": HW.OutputWidthSortEM},#same
549  ]
550  for x in alglist:
551  class d:
552  pass
553  for k in x:
554  setattr (d, k, x[k])
555  toponame = "%02dMINDPHI-%s%s%s%s-XE0" % (d.minDPhi, d.otype, str(d.ocut) if d.ocut > 0 else "", d.olist, str(d.nleading) if d.olist=="s" else "")
556  log.debug("Define %s", toponame)
557  inputList = d.otype + d.olist
558  alg = AlgConf.MinDeltaPhiIncl2( name = toponame, inputs = [ inputList, 'XE'], outputs = [ toponame ])
559  alg.addgeneric('InputWidth1', d.inputwidth)
560  alg.addgeneric('InputWidth2', 1)
561  alg.addgeneric('MaxTob1', d.nleading)
562  alg.addgeneric('MaxTob2', 1)
563  alg.addgeneric('NumResultBits', 1)
564  alg.addvariable('MinET1', d.ocut)
565  alg.addvariable('MinET2', 0)
566  alg.addvariable('DeltaPhiMin', d.minDPhi, 0)
567  tm.registerTopoAlgo(alg)
568 
569 
570  # W T&P MT
571  alglistmt = [
572  {"minMT": 25, "otype" : "EM", "ocut" : 12, "olist" : "s", "nleading" : 6, "inputwidth": HW.OutputWidthSortEM},
573  {"minMT": 35, "otype" : "EM", "ocut" : 15, "olist" : "s", "nleading" : 6, "inputwidth": HW.OutputWidthSortEM},
574  ]
575  for x in alglistmt:
576  class d:
577  pass
578  for k in x:
579  setattr (d, k, x[k])
580  toponame = "%iMT-%s%s%s%s-XE0" % (d.minMT, d.otype, str(d.ocut) if d.ocut > 0 else "", d.olist, str(d.nleading) if d.olist=="s" else "")
581  log.debug("Define %s", toponame)
582  inputList = d.otype + d.olist
583  alg = AlgConf.TransverseMassInclusive1( name = toponame, inputs = [ inputList, 'XE'], outputs = [ toponame ])
584  alg.addgeneric('InputWidth', HW.OutputWidthSortEM)
585  alg.addgeneric('MaxTob', d.nleading)
586  alg.addgeneric('NumResultBits', 1)
587  alg.addvariable('MinET1', str(d.ocut))
588  alg.addvariable('MinET2', 0)
589  alg.addvariable('MinMTSqr', d.minMT*d.minMT)
590  tm.registerTopoAlgo(alg)
591 
592 
593  # VBF deta
594  algoList = [
595  { "minDeta": 63, "maxDeta": 127, "otype" : "FJ", "ocut1" : 20, "olist" : "s", "nleading1" : 1, "inputwidth1": HW.OutputWidthSortJET,
596  "ocut2" : 20, "nleading2": 2}, #63DETA127-FJ20s1-FJ20s2
597  { "minDeta": 0, "maxDeta": 20, "otype" : "J", "ocut1" : 50, "olist" : "s", "nleading1" : 1, "inputwidth1": HW.OutputWidthSortJET,
598  "ocut2" : 0, "nleading2": 2}, #0DETA20-J50s1-Js2
599  ]
600  for x in algoList:
601  class d:
602  pass
603  for k in x:
604  setattr (d, k, x[k])
605  toponame = "%iDETA%i-%s%s%s%s-%s%s%s%s" % (d.minDeta, d.maxDeta,
606  d.otype, str(d.ocut1) if d.ocut1 > 0 else "", d.olist, str(d.nleading1) if d.olist=="s" else "",
607  d.otype, str(d.ocut2) if d.ocut2 > 0 else "", d.olist, str(d.nleading2) if d.olist=="s" else "")
608  log.debug("Define %s", toponame)
609  inputList = d.otype + d.olist
610  alg = AlgConf.DeltaEtaIncl1( name = toponame, inputs = inputList, outputs = toponame)
611  alg.addgeneric('InputWidth', d.inputwidth1)
612  alg.addgeneric('MaxTob', d.nleading2)
613  alg.addgeneric('NumResultBits', 1)
614  alg.addvariable('MinET1', str(d.ocut1), 0)
615  alg.addvariable('MinET2', str(d.ocut2), 0)
616  alg.addvariable('MinDeltaEta', d.minDeta, 0)
617  alg.addvariable('MaxDeltaEta', d.maxDeta, 0)
618  tm.registerTopoAlgo(alg)
619 
620 
621  # ZH Trigger
622  supportedalgolist = [
623  {"minDPhi": 10, "otype" : "J", "ocut" : 20, "olist" : "s", "nleading" : 2, "inputwidth": HW.OutputWidthSortJET, "ocut2": 50 }, #10MINDPHI-J20s2-XE50
624  {"minDPhi": 10, "otype" : "J", "ocut" : 20, "olist" : "ab", "nleading" : HW.OutputWidthSelectJET, "inputwidth": HW.OutputWidthSelectJET, "ocut2": 50}, #10MINDPHI-J20ab-XE50
625  {"minDPhi": 10, "otype" : "CJ","ocut" : 20, "olist" : "ab", "nleading" : HW.OutputWidthSelectJET, "inputwidth": HW.OutputWidthSelectJET, "ocut2": 50}, #10MINDPHI-CJ20ab-XE50
626  {"minDPhi": 10, "otype" : "J", "ocut" : 20, "olist" : "s", "nleading" : 2, "inputwidth": HW.OutputWidthSortJET, "ocut2": 30 }, #10MINDPHI-J20s2-XE30
627  ]
628  for x in supportedalgolist:
629  class d:
630  pass
631  for k in x:
632  setattr (d, k, x[k])
633  toponame = "%iMINDPHI-%s%s%s%s-XE%i" % (d.minDPhi, d.otype, str(d.ocut) if d.ocut > 0 else "", d.olist, str(d.nleading) if d.olist=="s" else "",d.ocut2)
634  log.debug("Define %s", toponame)
635  inputList = d.otype + d.olist
636  alg = AlgConf.MinDeltaPhiIncl2( name = toponame, inputs = [inputList, 'XE'], outputs = [ toponame ])
637  alg.addgeneric('InputWidth1', d.inputwidth)
638  alg.addgeneric('InputWidth2', 1)
639  alg.addgeneric('MaxTob1', d.nleading)
640  alg.addgeneric('MaxTob2', 1)
641  alg.addgeneric('NumResultBits', 1)
642  alg.addvariable('MinET1', d.ocut)
643  alg.addvariable('MinET2', d.ocut2)
644  alg.addvariable('DeltaPhiMin', d.minDPhi, 0)
645  tm.registerTopoAlgo(alg)
646 
647 
648  # added for muon-jet:
649  algoList = [
650  {"minDr": 0, "maxDr": 4, "otype1" : "MU" ,"ocut1": 4, "olist1" : "ab", "otype2" : "CJ", "ocut2": 15, "olist2" : "ab"}, #0DR04-MU4ab-CJ15ab
651  {"minDr": 0, "maxDr": 4, "otype1" : "MU" ,"ocut1": 4, "olist1" : "ab", "otype2" : "CJ", "ocut2": 30, "olist2" : "ab"}, #0DR04-MU4ab-CJ30ab
652  {"minDr": 0, "maxDr": 4, "otype1" : "MU" ,"ocut1": 6, "olist1" : "ab", "otype2" : "CJ", "ocut2": 20, "olist2" : "ab"}, #0DR04-MU4ab-CJ20ab
653  {"minDr": 0, "maxDr": 4, "otype1" : "MU" ,"ocut1": 6, "olist1" : "ab", "otype2" : "CJ", "ocut2": 25, "olist2" : "ab"}, #0DR04-MU6ab-CJ25ab
654  {"minDr": 0, "maxDr": 4, "otype1" : "MU" ,"ocut1": 4, "olist1" : "ab", "otype2" : "CJ", "ocut2": 20, "olist2" : "ab"}, #0DR04-MU6ab-CJ20ab
655  ]
656  for x in algoList:
657  class d:
658  pass
659  for k in x:
660  setattr (d, k, x[k])
661  toponame = "%iDR%02d-%s%s%s-%s%s%s" % (d.minDr, d.maxDr, d.otype1, str(d.ocut1), d.olist1, d.otype2, str(d.ocut2), d.olist2)
662  log.debug("Define %s", toponame)
663  inputList = [d.otype1 + d.olist1, d.otype2 + d.olist2]
664  alg = AlgConf.DeltaRSqrIncl2( name = toponame, inputs = inputList, outputs = [ toponame ])
665  alg.addgeneric('InputWidth1', HW.OutputWidthSelectMU)
666  alg.addgeneric('InputWidth2', HW.OutputWidthSelectJET)
667  alg.addgeneric('MaxTob1', HW.OutputWidthSelectMU)
668  alg.addgeneric('MaxTob2', HW.OutputWidthSelectJET)
669  alg.addgeneric('NumResultBits', 1)
670  alg.addvariable('MinET1', d.ocut1, 0)
671  alg.addvariable('MinET2', d.ocut2, 0)
672  alg.addvariable('DeltaRMin', d.minDr*d.minDr, 0)
673  alg.addvariable('DeltaRMax', d.maxDr*d.maxDr, 0)
674  tm.registerTopoAlgo(alg)
675 
676 
677  # dimu INVM items
678  algolist=[
679  {"minInvm": 2, "maxInvm": 8, "mult": 1, "otype1" : "CMU","ocut1": 4, "olist" : "ab", "otype2" :"MU", "ocut2" : 4, "onebarrel": 0}, # 2INVM8-CMU4ab-MU4ab
680  {"minInvm": 2, "maxInvm": 8, "mult": 1, "otype1" : "MU", "ocut1": 6, "olist" : "ab", "otype2" : "MU","ocut2" : 4, "onebarrel": 1}, # 2INVM8-ONEBARREL-MU6ab-MU4ab
681  ]
682  for x in algolist:
683  class d:
684  pass
685  for k in x:
686  setattr (d, k, x[k])
687  obj1 = "%s%s%s%s" % ((str(d.mult) if d.mult>1 else ""), d.otype1, str(d.ocut1), d.olist)
688  obj2 = "-%s%s%s" % (d.otype2, str(d.ocut2), d.olist)
689  toponame = "%iINVM%i-%s%s%s" % (d.minInvm, d.maxInvm, "ONEBARREL-" if d.onebarrel==1 else "", obj1, "" if d.mult>1 else obj2)
690  log.debug("Define %s", toponame)
691  inputList = [d.otype1 + d.olist] if (d.mult>1 or d.otype1==d.otype2) else [d.otype1 + d.olist, d.otype2 + d.olist]
692  algoname = AlgConf.InvariantMassInclusive1 if (d.mult>1 or d.otype1==d.otype2) else AlgConf.InvariantMassInclusive2
693  alg = algoname( name = toponame, inputs = inputList, outputs = [ toponame ])
694  if (d.mult>1 or d.otype1==d.otype2):
695  alg.addgeneric('InputWidth', HW.OutputWidthSelectMU)
696  alg.addgeneric('MaxTob', HW.OutputWidthSelectMU)
697  alg.addgeneric('RequireOneBarrel', d.onebarrel)
698  else:
699  alg.addgeneric('InputWidth1', HW.OutputWidthSelectMU)
700  alg.addgeneric('InputWidth2', HW.OutputWidthSelectMU)
701  alg.addgeneric('MaxTob1', HW.OutputWidthSelectMU)
702  alg.addgeneric('MaxTob2', HW.OutputWidthSelectMU)
703  alg.addgeneric('NumResultBits', 1)
704  alg.addvariable('MinET1', d.ocut1)
705  alg.addvariable('MinET2', d.ocut2 if d.ocut2>0 else d.ocut1)
706  alg.addvariable('MinMSqr', d.minInvm * d.minInvm)
707  alg.addvariable('MaxMSqr', d.maxInvm * d.maxInvm)
708  tm.registerTopoAlgo(alg)
709 
710 
711  # dimu DR items
712  algolist = [
713  {"minDr": 0, "maxDr": 24, "mult": 2, "otype1" : "CMU","ocut1": 4, "olist" : "ab", "otype2" : "", "ocut2": 4, "onebarrel": 0}, #0DR24-2CMU4ab
714  {"minDr": 0, "maxDr": 24, "mult": 1, "otype1" : "CMU","ocut1": 4, "olist" : "ab", "otype2" : "MU","ocut2": 4, "onebarrel": 0}, #0DR24-CMU4ab-MU4ab
715  ]
716  for x in algolist:
717  class d:
718  pass
719  for k in x:
720  setattr (d, k, x[k])
721  obj1 = "%s%s%s%s" % ((str(d.mult) if d.mult>1 else ""), d.otype1, str(d.ocut1), d.olist)
722  obj2 = "-%s%s%s" % (d.otype2, str(d.ocut2), d.olist)
723  toponame = "%iDR%i-%s%s%s" % (d.minDr, d.maxDr, "ONEBARREL-" if d.onebarrel==1 else "", obj1, "" if d.mult>1 else obj2)
724  log.debug("Define %s", toponame)
725  inputList = [d.otype1 + d.olist] if (d.mult>1 or d.otype1==d.otype2) else [d.otype1 + d.olist, d.otype2 + d.olist]
726  algoname = AlgConf.DeltaRSqrIncl1 if (d.mult>1 or d.otype1==d.otype2) else AlgConf.DeltaRSqrIncl2
727  alg = algoname( name = toponame, inputs = inputList, outputs = [ toponame ])
728  if (d.mult>1 or d.otype1==d.otype2):
729  alg.addgeneric('InputWidth', HW.OutputWidthSelectMU)
730  alg.addgeneric('MaxTob', HW.OutputWidthSelectMU)
731  alg.addgeneric('RequireOneBarrel', d.onebarrel)
732  else:
733  alg.addgeneric('InputWidth1', HW.OutputWidthSelectMU)
734  alg.addgeneric('InputWidth2', HW.OutputWidthSelectMU)
735  alg.addgeneric('MaxTob1', HW.OutputWidthSelectMU)
736  alg.addgeneric('MaxTob2', HW.OutputWidthSelectMU)
737  alg.addgeneric('NumResultBits', 1)
738  alg.addvariable('MinET1', d.ocut1)
739  alg.addvariable('MinET2', d.ocut2)
740  alg.addvariable('DeltaRMin', d.minDr*d.minDr)
741  alg.addvariable('DeltaRMax', d.maxDr*d.maxDr)
742  tm.registerTopoAlgo(alg)
743 
744 
745  # deta-dphi with ab+ab
746  algoList = [
747  { "minDeta": 0, "maxDeta": 20, "minDphi": 0, "maxDphi": 20, "mult": 1, "otype1" : "TAU", "ocut1": 20, "olist1" : "abi", "nleading1": HW.OutputWidthSelectTAU,
748  "otype2" : "TAU", "ocut2": 12, "olist2": "abi", "nleading2": HW.OutputWidthSelectTAU },
749  ]
750  for x in algoList:
751  class d:
752  pass
753  for k in x:
754  setattr (d, k, x[k])
755  obj1 = "%s%s%s%s" % ((str(d.mult) if d.mult>1 else ""), d.otype1, str(d.ocut1), d.olist1)
756  obj2 = "-%s%s%s" % (d.otype2, str(d.ocut2) if d.ocut2>0 else "", d.olist2)
757  toponame = "%sDETA%s-%sDPHI%s-%s%s" % (d.minDeta, d.maxDeta, d.minDphi, d.maxDphi, obj1, "" if d.mult>1 else obj2)
758  log.debug("Define %s", toponame)
759  inputList = [d.otype1 + d.olist1] if (d.mult>1 or d.otype1==d.otype2) else [d.otype1 + d.olist1, d.otype2 + d.olist2]
760  algoname = AlgConf.DeltaEtaPhiIncl1 if (d.mult>1 or d.otype1==d.otype2) else AlgConf.DeltaEtaPhiIncl2
761  alg = algoname( name = toponame, inputs = inputList, outputs = [ toponame ])
762  alg.addgeneric('NumResultBits', 1)
763  if (d.mult>1 or d.otype1==d.otype2):
764  alg.addgeneric('InputWidth', d.nleading1)
765  alg.addgeneric('MaxTob', d.nleading1)
766  alg.addvariable('MinET1', d.ocut1, 0)
767  alg.addvariable('MinET2', d.ocut2, 0)
768  alg.addvariable('MinDeltaEta', d.minDeta, 0)
769  alg.addvariable('MaxDeltaEta', d.maxDeta, 0)
770  alg.addvariable('MinDeltaPhi', d.minDphi, 0)
771  alg.addvariable('MaxDeltaPhi', d.maxDphi, 0)
772  else:
773  alg.addgeneric('InputWidth1', d.nleading1)
774  alg.addgeneric('InputWidth2', d.nleading2)
775  alg.addgeneric('MaxTob1', d.nleading1)
776  alg.addgeneric('MaxTob2', d.nleading2)
777  alg.addvariable('MinET1', d.ocut1, 0)
778  alg.addvariable('MinET2', d.ocut2, 0)
779  alg.addvariable('DeltaEtaMin', d.minDeta, 0)
780  alg.addvariable('DeltaEtaMax', d.maxDeta, 0)
781  alg.addvariable('DeltaPhiMin', d.minDphi, 0)
782  alg.addvariable('DeltaPhiMax', d.maxDphi, 0)
783  tm.registerTopoAlgo(alg)
784 
785 
786  # LFV DETA ATR-14282
787  algoList = [
788  { "minDeta": 0, "maxDeta": "04", "mult": 1, "otype1" : "EM", "ocut1": 8, "olist1" : "abi", "nleading1": HW.OutputWidthSelectEM,
789  "otype2" : "MU", "ocut2": 10, "olist2": "ab", "nleading2": HW.OutputWidthSelectMU}, #0DETA04-EM8abi-MU10ab
790  { "minDeta": 0, "maxDeta": "04", "mult": 1, "otype1" : "EM", "ocut1": 15, "olist1" : "abi", "nleading1": HW.OutputWidthSelectEM,
791  "otype2" : "MU", "ocut2": 0, "olist2": "ab", "nleading2": HW.OutputWidthSelectMU}, #0DETA04-EM15abi-MUab
792  ]
793  for x in algoList:
794  class d:
795  pass
796  for k in x:
797  setattr (d, k, x[k])
798  toponame = "%sDETA%s-%s%s%s-%s%s%s" % (d.minDeta, d.maxDeta, d.otype1, str(d.ocut1), d.olist1, d.otype2, str(d.ocut2) if d.ocut2>0 else "", d.olist2)
799  log.debug("Define %s", toponame)
800  inputList = [d.otype1 + d.olist1, d.otype2 + d.olist2]
801  alg = AlgConf.DeltaEtaIncl2( name = toponame, inputs = inputList, outputs = [ toponame ])
802  alg.addgeneric('NumResultBits', 1)
803  alg.addgeneric('InputWidth1', d.nleading1)
804  alg.addgeneric('InputWidth2', d.nleading2)
805  alg.addgeneric('MaxTob1', d.nleading1)
806  alg.addgeneric('MaxTob2', d.nleading2)
807  alg.addvariable('MinET1', d.ocut1, 0)
808  alg.addvariable('MinET2', d.ocut2, 0)
809  alg.addvariable('MinDeltaEta', d.minDeta, 0)
810  alg.addvariable('MaxDeltaEta', d.maxDeta, 0)
811  tm.registerTopoAlgo(alg)
812 
813 
814  algoList = [
815  { "minDphi": 0, "maxDphi": "03", "mult": 1, "otype1" : "EM", "ocut1": 8, "olist1" : "abi", "nleading1": HW.OutputWidthSelectEM,
816  "otype2" : "MU", "ocut2": 10, "olist2": "ab", "nleading2": HW.OutputWidthSelectMU}, #0DPHI03-EM8abi-MU10ab
817  { "minDphi": 0, "maxDphi": "03", "mult": 1, "otype1" : "EM", "ocut1": 15, "olist1" : "abi", "nleading1": HW.OutputWidthSelectEM,
818  "otype2" : "MU", "ocut2": 0, "olist2": "ab", "nleading2": HW.OutputWidthSelectMU}, #0DPHI03-EM15abi-MUab
819  ]
820  for x in algoList:
821  class d:
822  pass
823  for k in x:
824  setattr (d, k, x[k])
825  toponame = "%sDPHI%s-%s%s%s-%s%s%s" % (d.minDphi, d.maxDphi, d.otype1, str(d.ocut1), d.olist1, d.otype2, str(d.ocut2) if d.ocut2>0 else "", d.olist2)
826  log.debug("Define %s", toponame)
827  inputList = [d.otype1 + d.olist1, d.otype2 + d.olist2]
828  alg = AlgConf.DeltaPhiIncl2( name = toponame, inputs = inputList, outputs = [ toponame ])
829  alg.addgeneric('NumResultBits', 1)
830  alg.addgeneric('InputWidth1', d.nleading1)
831  alg.addgeneric('InputWidth2', d.nleading2)
832  alg.addgeneric('MaxTob1', d.nleading1)
833  alg.addgeneric('MaxTob2', d.nleading2)
834  alg.addvariable('MinET1', d.ocut1, 0)
835  alg.addvariable('MinET2', d.ocut2, 0)
836  alg.addvariable('MinDeltaPhi', d.minDphi, 0)
837  alg.addvariable('MaxDeltaPhi', d.maxDphi, 0)
838  tm.registerTopoAlgo(alg)
839 
840  # JetMatch
841  toponame = "0MATCH-4AJ20pETA31-4AJj15pETA31"
842  alg = AlgConf.MultiplicityCustom( name = toponame, inputs = [ 'AJMatchall' ], outputs = [ toponame ])
843  alg.addgeneric('InputWidth', HW.InputWidthJET)
844  alg.addgeneric('NumResultBits', 1)
845  alg.addvariable('MinET', 0)
846  alg.addvariable('MinEta', 0)
847  alg.addvariable('MaxEta', 31)
848  alg.addvariable('MinMultiplicity', 4)
849  tm.registerTopoAlgo(alg)
850 
851 
852  # NoMatch for W T&P
853  toponame = "NOT-02MATCH-EM10s1-AJj15allpETA49"
854  alg = AlgConf.NotMatch( name = toponame, inputs = [ 'EMs', 'AJjall'], outputs = [ toponame ])
855  alg.addgeneric('InputWidth1', HW.OutputWidthSortEM)
856  alg.addgeneric('InputWidth2', HW.InputWidthJET)
857  alg.addgeneric('MaxTob1', 1)
858  alg.addgeneric('MaxTob2', HW.InputWidthJET)
859  alg.addgeneric('NumResultBits', 1)
860  alg.addvariable('MinET1', 10)
861  alg.addvariable('MinET2', 15)
862  alg.addvariable('EtaMin1', 0)
863  alg.addvariable('EtaMax1', 49)
864  alg.addvariable('EtaMin2', 0)
865  alg.addvariable('EtaMax2', 49)
866  alg.addvariable('DRCut', 4)
867  tm.registerTopoAlgo(alg)
868 
869 
870  # RATIO for W T&P
871  algolist = [
872  { "minRatio": 5, "ocut" : 15, "Ratio": "RATIO"},
873  { "minRatio": 90, "ocut" : 15, "Ratio": "RATIO2"},
874  { "minRatio": 250, "ocut" : 15, "Ratio": "RATIO2"},
875  ]
876  for x in algolist:
877  class d:
878  pass
879  for k in x:
880  setattr (d, k, x[k])
881  toponame = "%02d%s-XE0-HT0-AJj%sallpETA49" % (d.minRatio, d.Ratio, str(d.ocut))
882  log.debug("Define %s", toponame)
883  alg = AlgConf.Ratio( name = toponame, inputs = ['XE', 'AJjall'], outputs = [ toponame ])
884  alg.addgeneric('InputWidth1', 1)
885  alg.addgeneric('InputWidth2', HW.InputWidthJET)
886  alg.addgeneric('MaxTob1', 1)
887  alg.addgeneric('MaxTob2', HW.InputWidthJET)
888  alg.addgeneric('NumResultBits', 1)
889  alg.addgeneric('isXE2', 1 if d.Ratio=="RATIO2" else 0)
890  alg.addvariable('MinET2', str(d.ocut))
891  alg.addvariable('EtaMin', 0)
892  alg.addvariable('EtaMax', 49)
893  alg.addvariable('MinET1', 0)
894  alg.addvariable('HT', 0)
895  alg.addvariable('Ratio', str(d.minRatio))
896  tm.registerTopoAlgo(alg)
897 
898 
899  # RATIO MATCH dedicated to Exotic
900  toponame = '100RATIO-0MATCH-TAU30si2-EMall'
901  alg = AlgConf.RatioMatch( name = toponame, inputs = [ 'TAUsi', 'EMall'], outputs = [ toponame ])
902  alg.addgeneric('InputWidth1', HW.OutputWidthSortTAU)
903  alg.addgeneric('InputWidth2', HW.InputWidthEM)
904  alg.addgeneric('MaxTob1', 2)
905  alg.addgeneric('MaxTob2', HW.InputWidthEM)
906  alg.addgeneric('NumResultBits', 1)
907  alg.addvariable('MinET1', 30)
908  alg.addvariable('MinET2', 0)
909  alg.addvariable('Ratio', 100, 0)
910  tm.registerTopoAlgo(alg)
911 
912 
913  # NOT MATCH dedicated to Exotic
914  toponame = 'NOT-0MATCH-TAU30si1-EMall'
915  alg = AlgConf.NotMatch( name = toponame, inputs = [ 'TAUsi', 'EMall'], outputs = [ toponame ])
916  alg.addgeneric('InputWidth1', HW.OutputWidthSortTAU)
917  alg.addgeneric('InputWidth2', HW.InputWidthEM)
918  alg.addgeneric('MaxTob1', 1)
919  alg.addgeneric('MaxTob2', HW.InputWidthEM)
920  alg.addgeneric('NumResultBits', 1)
921  alg.addvariable('MinET1', 30)
922  alg.addvariable('MinET2', 0)
923  alg.addvariable('EtaMin1', 0)
924  alg.addvariable('EtaMax1', 49)
925  alg.addvariable('EtaMin2', 0)
926  alg.addvariable('EtaMax2', 49)
927  alg.addvariable('DRCut', 0)
928  tm.registerTopoAlgo(alg)
929 
930 
931  # MULT-BIT
932  algolist = [
933  {"otype1" : "CMU" ,"ocut1": 4, "olist1" : "ab", "nleading1": HW.OutputWidthSelectMU, "inputwidth1": HW.OutputWidthSelectMU}, #MULT-CMU4ab
934  {"otype1" : "CMU" ,"ocut1": 6, "olist1" : "ab", "nleading1": HW.OutputWidthSelectMU, "inputwidth1": HW.OutputWidthSelectMU}, #MULT-CMU6ab
935  ]
936  for x in algolist:
937  class d:
938  pass
939  for k in x:
940  setattr (d, k, x[k])
941  toponame = "MULT-%s%s%s" % (d.otype1, str(d.ocut1), d.olist1)
942  toponames = [toponame+"[0]", toponame+"[1]"]
943  log.debug("Define %s", toponames)
944  inputList = [d.otype1 + d.olist1]
945  alg = AlgConf.Multiplicity( name = toponame, inputs = inputList, outputs = toponames)
946  alg.addgeneric('InputWidth', d.inputwidth1)
947  alg.addgeneric('NumResultBits', 2)
948  alg.addvariable('MinET', d.ocut1-1) # for MU threshold -1
949  tm.registerTopoAlgo(alg)
950 
951 
952  # DISAMB 2 lists
953  algolist = [
954  { "disamb": 1, "otype1" : "TAU", "ocut1": 12, "olist1" : "abi", "nleading1": HW.OutputWidthSelectTAU,
955  "otype2" : "J", "ocut2": 25, "olist2": "ab", "nleading2": HW.OutputWidthSelectJET}, #1DISAMB-TAU12abi-J25ab
956  ]
957  for x in algolist:
958  class d:
959  pass
960  for k in x:
961  setattr (d, k, x[k])
962  obj1 = "%s%s%s" % (d.otype1, str(d.ocut1), d.olist1)
963  obj2 = "-%s%s%s" % (d.otype2, str(d.ocut2), d.olist2)
964  toponame = "%sDISAMB-%s%s" % ( d.disamb if d.disamb>0 else "", obj1, obj2)
965  log.debug("Define %s", toponame)
966  inputList = [d.otype1 + d.olist1, d.otype2 + d.olist2]
967  alg = AlgConf.DisambiguationIncl2( name = toponame, inputs = inputList, outputs = [ toponame ])
968  alg.addgeneric('InputWidth1', d.nleading1 if d.olist1.find("ab")>=0 else -1000)
969  alg.addgeneric('InputWidth2', d.nleading2 if d.olist2.find("ab")>=0 else -1000)
970  alg.addgeneric('MaxTob1', d.nleading1)
971  alg.addgeneric('MaxTob2', d.nleading2)
972  alg.addgeneric('NumResultBits', 1)
973  alg.addgeneric('ClusterOnly', 1 if (d.otype1=="EM" and d.otype2=="TAU") or (d.otype1=="TAU" and d.otype2=="EM") else 0 )
974  alg.addgeneric('ApplyDR', 0)
975  alg.addvariable('MinET1', d.ocut1)
976  alg.addvariable('MinET2', d.ocut2)
977  alg.addvariable('DisambDRSqrMin', d.disamb*d.disamb)
978  tm.registerTopoAlgo(alg)
979 
980 
981  # DISAMB 3 lists
982  algoList = [
983  { "disamb": 1, "otype1" : "EM", "ocut1": 15, "olist1": "shi","nleading1": 2, "inputwidth1": HW.OutputWidthSortEM,
984  "otype2" : "TAU", "ocut2": 12, "olist2": "abi", "nleading2": HW.OutputWidthSelectTAU, "inputwidth2": HW.OutputWidthSelectTAU,
985  "otype3" : "J", "ocut3": 25, "olist3": "ab", "nleading3": HW.OutputWidthSelectJET, "inputwidth3": HW.OutputWidthSelectJET}, #1DISAMB-EM15his2-TAU12abi-J25ab
986  { "disamb": 1, "otype1" : "TAU", "ocut1": 20, "olist1": "abi","nleading1": HW.OutputWidthSelectTAU, "inputwidth1": HW.OutputWidthSelectTAU,
987  "otype2" : "TAU", "ocut2": 12, "olist2": "abi", "nleading2": HW.OutputWidthSelectTAU, "inputwidth2": HW.OutputWidthSelectTAU,
988  "otype3" : "J", "ocut3": 25, "olist3": "ab", "nleading3": HW.OutputWidthSelectTAU, "inputwidth3": HW.OutputWidthSelectJET}, #1DISAMB-TAU20abi-TAU12abi-J25ab
989  ]
990  for x in algoList:
991  class d:
992  pass
993  for k in x:
994  setattr (d, k, x[k])
995  obj1 = "%s%s%s" % (d.otype1, str(d.ocut1), d.olist1.replace('shi','his') + (str(d.nleading1) if d.olist1.find('s')>=0 else ""))
996  obj2 = "-%s%s%s" % (d.otype2, str(d.ocut2), d.olist2.replace('shi','his') + (str(d.nleading2) if d.olist2.find('s')>=0 else ""))
997  obj3 = "-%s%s%s" % (d.otype3, str(d.ocut3), d.olist3)
998  toponame = "%sDISAMB-%s%s%s" % ( d.disamb if d.disamb>0 else "", obj1, obj2, obj3)
999  log.debug("Define %s", toponame)
1000  inputList = [d.otype1 + d.olist1, d.otype2 + d.olist2, d.otype3 + d.olist3]
1001  alg = AlgConf.DisambiguationIncl3( name = toponame, inputs = inputList, outputs = [ toponame ])
1002  alg.addgeneric('InputWidth1', d.inputwidth1)
1003  alg.addgeneric('InputWidth2', d.inputwidth2)
1004  alg.addgeneric('InputWidth3', d.inputwidth3)
1005  alg.addgeneric('MaxTob1', d.nleading1)
1006  alg.addgeneric('MaxTob2', d.nleading2)
1007  alg.addgeneric('MaxTob3', d.nleading3)
1008  alg.addgeneric('NumResultBits', 1)
1009  alg.addgeneric('ApplyDR', 0)
1010  alg.addvariable('MinET1', d.ocut1, 0)
1011  alg.addvariable('MinET2', d.ocut2, 0)
1012  alg.addvariable('MinET3', d.ocut3, 0)
1013  alg.addvariable('DisambDRSqr', d.disamb*d.disamb, 0) # DisambDR
1014  tm.registerTopoAlgo(alg)
1015 
1016 
1017  # DISAMB 3 lists with DR cut to 2nd and 3rd lists
1018  algolist = [
1019  { "disamb": 1, "otype1" : "EM", "ocut1": 15, "olist1": "shi","nleading1": 2, "inputwidth1": HW.OutputWidthSortEM,
1020  "otype2" : "TAU", "ocut2": 12, "olist2": "abi", "nleading2": HW.OutputWidthSelectTAU, "inputwidth2": HW.OutputWidthSelectTAU,
1021  "otype3" : "J", "ocut3": 25, "olist3": "ab", "nleading3": HW.OutputWidthSelectJET, "inputwidth3": HW.OutputWidthSelectJET,
1022  "drcutmin": 0, "drcutmax": 28}, #1DISAMB-J25ab-0DR28-EM15his2-TAU12abi
1023  { "disamb": 1, "otype1" : "TAU", "ocut1": 20, "olist1": "abi","nleading1": HW.OutputWidthSelectTAU, "inputwidth1": HW.OutputWidthSelectTAU,
1024  "otype2" : "TAU", "ocut2": 12, "olist2": "abi", "nleading2": HW.OutputWidthSelectTAU, "inputwidth2": HW.OutputWidthSelectTAU,
1025  "otype3" : "J", "ocut3": 25, "olist3": "ab", "nleading3": HW.OutputWidthSelectJET, "inputwidth3": HW.OutputWidthSelectJET,
1026  "drcutmin": 0, "drcutmax": 28}, # 1DISAMB-J25ab-0DR28-TAU20abi-TAU12abi
1027  { "disamb": 1, "otype1" : "TAU", "ocut1": 20, "olist1": "abi","nleading1": HW.OutputWidthSelectTAU, "inputwidth1": HW.OutputWidthSelectTAU,
1028  "otype2" : "TAU", "ocut2": 12, "olist2": "abi", "nleading2": HW.OutputWidthSelectTAU, "inputwidth2": HW.OutputWidthSelectTAU,
1029  "otype3" : "J", "ocut3": 25, "olist3": "ab", "nleading3": HW.OutputWidthSelectJET, "inputwidth3": HW.OutputWidthSelectJET,
1030  "drcutmin": 0, "drcutmax": 25}, # 1DISAMB-J25ab-0DR25-TAU20abi-TAU12abi
1031  ]
1032  for x in algolist:
1033  class d:
1034  pass
1035  for k in x:
1036  setattr (d, k, x[k])
1037  obj1 = "-%s%s%s" % (d.otype1, str(d.ocut1), d.olist1.replace('shi','his') + (str(d.nleading1) if d.olist1.find('s')>=0 else ""))
1038  obj2 = "-%s%s%s" % (d.otype2, str(d.ocut2), d.olist2.replace('shi','his') + (str(d.nleading2) if d.olist2.find('s')>=0 else ""))
1039  obj3 = "%s%s%s" % (d.otype3, str(d.ocut3), d.olist3)
1040  toponame = "%sDISAMB-%s-%dDR%d%s%s" % ( str(d.disamb) if d.disamb>0 else "", obj3, d.drcutmin, d.drcutmax, obj1, obj2)
1041  log.debug("Define %s", toponame)
1042  inputList = [d.otype1 + d.olist1, d.otype2 + d.olist2, d.otype3 + d.olist3]
1043  alg = AlgConf.DisambiguationDRIncl3( name = toponame, inputs = inputList, outputs = [ toponame ])
1044  alg.addgeneric('InputWidth1', d.inputwidth1)
1045  alg.addgeneric('InputWidth2', d.inputwidth2)
1046  alg.addgeneric('InputWidth3', d.inputwidth3)
1047  alg.addgeneric('MaxTob1', d.nleading1)
1048  alg.addgeneric('MaxTob2', d.nleading2)
1049  alg.addgeneric('MaxTob3', d.nleading3)
1050  alg.addgeneric('NumResultBits', 1)
1051  alg.addvariable('MinET1', d.ocut1, 0)
1052  alg.addvariable('MinET2', d.ocut2, 0)
1053  alg.addvariable('MinET3', d.ocut3, 0)
1054  alg.addvariable('DisambDRSqrMin', d.drcutmin*d.drcutmin, 0)
1055  alg.addvariable('DisambDRSqrMax', d.drcutmax*d.drcutmax, 0)
1056  alg.addvariable('DisambDRSqr', d.disamb*d.disamb, 0)
1057  tm.registerTopoAlgo(alg)
1058 
1059 
1060  # LAR 0<eta<1.4 and 9/16pi<phi<11/16pi for FE crate IO6
1061  algoList = [
1062  {"minEta": 1, "maxEta": 15, "minPhi": 17, "maxPhi": 23, "otype" : "EM", "ocut" : 20, "olist" : "shi", "inputwidth": HW.OutputWidthSortEM}, #LAR-EM20shi1
1063  {"minEta": 1, "maxEta": 14, "minPhi": 17, "maxPhi": 23, "otype" : "J", "ocut" : 100, "olist" : "s", "inputwidth": HW.OutputWidthSortJET}, #LAR-J100s1
1064  ]
1065  for x in algoList:
1066  class d:
1067  pass
1068  for k in x:
1069  setattr (d, k, x[k])
1070  toponame = "LAR-%s%s%s1" % ( d.otype, str(d.ocut), d.olist )
1071  log.debug("Define %s", toponame)
1072  inputList = d.otype + d.olist
1073  alg = AlgConf.EtaPhiWindow( name = toponame, inputs = inputList, outputs = toponame)
1074  alg.addgeneric('InputWidth', d.inputwidth)
1075  alg.addgeneric('MaxTob', 0)
1076  alg.addgeneric('NumResultBits', 1)
1077  alg.addvariable('MinET', str(d.ocut))
1078  alg.addvariable('EtaMin', d.minEta)
1079  alg.addvariable('EtaMax', d.maxEta)
1080  alg.addvariable('PhiMin', d.minPhi)
1081  alg.addvariable('PhiMax', d.maxPhi)
1082  tm.registerTopoAlgo(alg)
1083 
1084 
1085  xemap = [
1086  {"etcut": 0, "Threlist": [ 40, 50, 55, 60, 65, 75 ]}
1087  ]
1088  for x in xemap:
1089  class d:
1090  pass
1091  for k in x:
1092  setattr (d, k, x[k])
1093  log.debug("Define %s", toponame)
1094  inputList = ['XENoSort', 'AJall']
1095  toponames=[]
1096  for minxe in d.Threlist:
1097  toponames.append("KF-XE%s-AJall" % (minxe))
1098  alg = AlgConf.KalmanMETCorrection( name = "KF-XE-AJall", inputs = inputList, outputs = toponames)
1099  alg.addgeneric('InputWidth', HW.InputWidthJET)
1100  alg.addgeneric('NumResultBits', len(toponames))
1101  alg.addvariable('MinET', 0)
1102  for bitid,minxe in enumerate(d.Threlist):
1103  alg.addvariable('KFXE', str(minxe), bitid)
1104  tm.registerTopoAlgo(alg)
1105 
1106 
1107  # W T&P: MINDPHI(J, XE0), (EM, XE0)
1108  algoList = [
1109  {"minDPhi": 15, "otype" : "EM", "ocut" : 12, "olist" : "s", "nleading" : 6, "inputwidth": HW.OutputWidthSortEM},
1110  {"minDPhi": 15, "otype" : "EM", "ocut" : 15, "olist" : "s", "nleading" : 6, "inputwidth": HW.OutputWidthSortEM},
1111  ]
1112  for x in algoList:
1113  class d:
1114  pass
1115  for k in x:
1116  setattr (d, k, x[k])
1117  toponame = "%02dMINDPHI-%s%s%s%s-XE0" % (d.minDPhi, d.otype, str(d.ocut) if d.ocut > 0 else "", d.olist, str(d.nleading) if d.olist=="s" else "")
1118  log.debug("Define %s", toponame)
1119  inputList = d.otype + d.olist
1120  alg = AlgConf.MinDeltaPhiIncl2( name = toponame, inputs = [ inputList, 'XE'], outputs = [ toponame ])
1121  alg.addgeneric('InputWidth1', d.inputwidth)
1122  alg.addgeneric('InputWidth2', 1)
1123  alg.addgeneric('MaxTob1', d.nleading)
1124  alg.addgeneric('MaxTob2', 1)
1125  alg.addgeneric('NumResultBits', 1)
1126  alg.addvariable('MinET1', d.ocut)
1127  alg.addvariable('MinET2', 0)
1128  alg.addvariable('DeltaPhiMin', d.minDPhi, 0)
1129  tm.registerTopoAlgo(alg)
1130 
1131 
1132  # W T&P MT
1133  algoList = [
1134  {"minMT": 35, "otype" : "EM", "ocut" : 12, "olist" : "s", "nleading" : 6, "inputwidth": HW.OutputWidthSortEM},
1135  ]
1136  for x in algoList:
1137  class d:
1138  pass
1139  for k in x:
1140  setattr (d, k, x[k])
1141  toponame = "%iMT-%s%s%s%s-XE0" % (d.minMT, d.otype, str(d.ocut) if d.ocut > 0 else "", d.olist, str(d.nleading) if d.olist=="s" else "")
1142  log.debug("Define %s", toponame)
1143  inputList = d.otype + d.olist
1144  alg = AlgConf.TransverseMassInclusive1( name = toponame, inputs = [ inputList, 'XE'], outputs = [ toponame ])
1145  alg.addgeneric('InputWidth', HW.OutputWidthSortEM)
1146  alg.addgeneric('MaxTob', d.nleading)
1147  alg.addgeneric('NumResultBits', 1)
1148  alg.addvariable('MinET1', str(d.ocut))
1149  alg.addvariable('MinET2', 0)
1150  alg.addvariable('MinMTSqr', d.minMT*d.minMT)
1151  tm.registerTopoAlgo(alg)
1152 
1153 
1154  # DISAMB 2 lists with DR cut between objects in two lists
1155  algoList=[
1156  { "disamb": 0, "otype1" : "EM", "ocut1": 15, "olist1": "shi","nleading1": 2, "inputwidth1": HW.OutputWidthSortEM,
1157  "otype2" : "TAU", "ocut2": 12, "olist2": "abi", "nleading2": HW.OutputWidthSelectTAU, "inputwidth2": HW.OutputWidthSelectTAU, "drcutmin": 0, "drcutmax": 28},
1158  ]
1159  for x in algoList:
1160  class d:
1161  pass
1162  for k in x:
1163  setattr (d, k, x[k])
1164  obj1 = "-%s%s%s" % (d.otype1, str(d.ocut1), d.olist1.replace('shi','his') + (str(d.nleading1) if d.olist1.find('s')>=0 else ""))
1165  obj2 = "-%s%s%s" % (d.otype2, str(d.ocut2), d.olist2.replace('shi','his') + (str(d.nleading2) if d.olist2.find('s')>=0 else ""))
1166  toponame = "%sDISAMB-%dDR%d%s%s" % ( str(d.disamb) if d.disamb>0 else "", d.drcutmin, d.drcutmax, obj1, obj2)
1167  log.debug("Define %s", toponame)
1168  inputList = [d.otype1 + d.olist1, d.otype2 + d.olist2]
1169  alg = AlgConf.DisambiguationDRIncl2( name = toponame, inputs = inputList, outputs = [ toponame ])
1170  alg.addgeneric('InputWidth1', d.inputwidth1)
1171  alg.addgeneric('InputWidth2', d.inputwidth2)
1172  alg.addgeneric('MaxTob1', d.nleading1)
1173  alg.addgeneric('MaxTob2', d.nleading2)
1174  alg.addgeneric('NumResultBits', 1)
1175  alg.addvariable('MinET1', d.ocut1, 0)
1176  alg.addvariable('MinET2', d.ocut2, 0)
1177  alg.addvariable('DisambDRSqrMin', d.drcutmin*d.drcutmin, 0)
1178  alg.addvariable('DisambDRSqrMax', d.drcutmax*d.drcutmax, 0)
1179  tm.registerTopoAlgo(alg)
1180 
1181 
1182  # ZH Trigger
1183  algoList = [
1184  {"minDPhi": 10, "otype" : "AJ", "ocut" : 20, "olist" : "s", "nleading" : 2, "inputwidth": HW.OutputWidthSortJET},
1185  ]
1186  for x in algoList:
1187  class d:
1188  pass
1189  for k in x:
1190  setattr (d, k, x[k])
1191  toponame = "%iMINDPHI-%s%s%s%s-XE50" % (d.minDPhi, d.otype, str(d.ocut) if d.ocut > 0 else "", d.olist, str(d.nleading) if d.olist=="s" else "")
1192  log.debug("Define %s", toponame)
1193  inputList = d.otype + d.olist
1194  alg = AlgConf.MinDeltaPhiIncl2( name = toponame, inputs = [inputList, 'XE'], outputs = [ toponame ])
1195  alg.addgeneric('InputWidth1', d.inputwidth)
1196  alg.addgeneric('InputWidth2', 1)
1197  alg.addgeneric('MaxTob1', d.nleading)
1198  alg.addgeneric('MaxTob2', 1)
1199  alg.addgeneric('NumResultBits', 1)
1200  alg.addvariable('MinET1', d.ocut)
1201  alg.addvariable('MinET2', 50)
1202  alg.addvariable('DeltaPhiMin', d.minDPhi, 0)
1203  tm.registerTopoAlgo(alg)
1204 
1205  # LATE MUON : LATE-MU10s1
1206  for x in [
1207  #{"otype" : "LATE-MU", "ocut" : 10, "inputwidth": HW.OutputWidthSortMU},
1208  {"otype" : "LATE-MU", "ocut" : 10, "inputwidth": HW.NumberOfDelayedMuons},
1209  ]:
1210 
1211  class d:
1212  pass
1213  for k in x:
1214  setattr (d, k, x[k])
1215  toponame = "%s%ss1" % ( d.otype, str(d.ocut) )
1216  log.debug("Define %s", toponame)
1217  inputList = 'LMUs'
1218  alg = AlgConf.EtCut( name = toponame, inputs = inputList, outputs = toponame)
1219  alg.addgeneric('InputWidth', d.inputwidth)
1220  alg.addgeneric('MaxTob', 1)
1221  alg.addgeneric('NumResultBits', 1)
1222  alg.addvariable('MinET', str(d.ocut))
1223  tm.registerTopoAlgo(alg)
1224 
1225 
1226  # (ATR-12748) fat jet trigger with Simple Cone algo
1227  algoList = [
1228  {"minHT": 111, "otype" : "CJ", "ocut" : 15, "olist" : "ab", "nleading" : HW.OutputWidthSelectJET, "inputwidth": HW.OutputWidthSelectJET, "oeta" : 26}, #SC111-CJ15ab.ETA26
1229  {"minHT": 85, "otype" : "CJ", "ocut" : 15, "olist" : "ab", "nleading" : HW.OutputWidthSelectJET, "inputwidth": HW.OutputWidthSelectJET, "oeta" : 26}, #SC85-CJ15ab.ETA26
1230  ]
1231  for x in algoList:
1232  class d:
1233  pass
1234  for k in x:
1235  setattr (d, k, x[k])
1236  toponame = "SC%d-%s%s%s%spETA%s" % (d.minHT, d.otype, str(d.ocut), d.olist, str(d.nleading) if d.olist=="s" else "", str(d.oeta))
1237  log.debug("Define %s", toponame)
1238  inputList = d.otype + d.olist
1239  alg = AlgConf.SimpleCone( name = toponame, inputs = inputList, outputs = [toponame])
1240  alg.addgeneric('InputWidth', d.inputwidth)
1241  alg.addvariable('MinET', d.ocut)
1242  alg.addvariable('MinSumET', d.minHT)
1243  alg.addvariable('MaxRSqr', 10*10)
1244  tm.registerTopoAlgo(alg)
1245 
1246 
1247  # DISAMB-INVM
1248  # DISAMB-30INVM-EM20his2-TAU12ab
1249  algoList = [
1250  { "disamb": 0, "minInvm": 30, "maxInvm": 9999,"otype1" : "EM", "ocut1": 20, "olist1": "shi","nleading1": 2,
1251  "inputwidth1": HW.OutputWidthSortEM, "otype2" : "TAU", "ocut2": 12, "olist2": "ab", "nleading2": HW.OutputWidthSelectTAU,
1252  "inputwidth2": HW.OutputWidthSelectTAU},
1253  ]
1254  for x in algoList:
1255  class d:
1256  pass
1257  for k in x:
1258  setattr (d, k, x[k])
1259  obj1 = "%s%s%s" % (d.otype1, str(d.ocut1), d.olist1.replace('shi','his') + (str(d.nleading1) if d.olist1.find('s')>=0 else ""))
1260  obj2 = "-%s%s%s" % (d.otype2, str(d.ocut2), d.olist2)
1261  toponame = "%sDISAMB-%iINVM%s-%s%s" % ( d.disamb if d.disamb>0 else "", d.minInvm, str(d.maxInvm) if d.maxInvm<9999 else "", obj1, obj2)
1262  log.debug("Define %s", toponame)
1263  inputList = [d.otype1 + d.olist1, d.otype2 + d.olist2]
1264  #alg = AlgConf.DisambiguationInvariantMass2( name = toponame, inputs = inputList, outputs = toponame);
1265  alg = AlgConf.DisambiguationInvmIncl2( name = toponame, inputs = inputList, outputs = toponame)
1266  alg.addgeneric('InputWidth1', d.inputwidth1)
1267  alg.addgeneric('InputWidth2', d.inputwidth2)
1268  alg.addgeneric('MaxTob1', d.nleading1)
1269  alg.addgeneric('MaxTob2', d.nleading2)
1270  alg.addgeneric('NumResultBits', 1)
1271  alg.addvariable('MinET1', d.ocut1)
1272  alg.addvariable('MinET2', d.ocut2)
1273  alg.addvariable('MinMSqr', d.minInvm * d.minInvm)
1274  alg.addvariable('MaxMSqr', d.maxInvm * d.maxInvm)
1275  tm.registerTopoAlgo(alg)
1276 
1277 
1278  # 400INVM9999-AJ30s6.ETA31-AJ20s6p31ETA49
1279  algoList = [
1280  { "minInvm": 400, "maxInvm": 9999, "otype1" : "AJ", "ocut1": 30, "olist1" : "s", "nleading1" : 6, "inputwidth1": HW.OutputWidthSortJET,
1281  "otype2" : "AJ", "ocut2": 20, "olist2" : "s", "nleading2" : 6, "inputwidth2": HW.OutputWidthSortJET, "applyEtaCut": 1,
1282  "minEta1": 0 ,"maxEta1": 31 , "minEta2": 31 ,"maxEta2": 49 , },
1283  ]
1284  for x in algoList:
1285  class d:
1286  pass
1287  for k in x:
1288  setattr (d, k, x[k])
1289  obj1 = "%s%s%sp%sETA%i" % (d.otype1, str(d.ocut1), d.olist1 + (str(d.nleading1) if d.olist1.find('s')>=0 else ""),str(d.minEta1) if d.minEta1>0 else "", d.maxEta1)
1290  obj2 = "-%s%s%sp%sETA%i" % (d.otype2, str(d.ocut2), d.olist2 + (str(d.nleading2) if d.olist2.find('s')>=0 else ""),str(d.minEta2) if d.minEta2>0 else "", d.maxEta2)
1291  inputList = [d.otype1 + d.olist1, d.otype2 + d.olist2]
1292  toponame = "%iINVM%i-%s%s" % (d.minInvm, d.maxInvm, obj1, obj2)
1293  alg = AlgConf.InvariantMassInclusive2( name = toponame, inputs = inputList, outputs = toponame)
1294  alg.addgeneric('InputWidth1', d.inputwidth1)
1295  alg.addgeneric('InputWidth2', d.inputwidth2)
1296  alg.addgeneric('MaxTob1', d.nleading1)
1297  alg.addgeneric('MaxTob2', d.nleading2)
1298  alg.addgeneric('NumResultBits', 1)
1299  if (d.applyEtaCut>0):
1300  alg.addgeneric('ApplyEtaCut', d.applyEtaCut)
1301  alg.addvariable('MinET1', d.ocut1)
1302  alg.addvariable('MinET2', d.ocut2)
1303  alg.addvariable('MinMSqr', d.minInvm * d.minInvm )
1304  alg.addvariable('MaxMSqr', d.maxInvm * d.maxInvm )
1305  if (d.applyEtaCut>0):
1306  alg.addvariable('MinEta1', d.minEta1)
1307  alg.addvariable('MaxEta1', d.maxEta1)
1308  alg.addvariable('MinEta2', d.minEta2)
1309  alg.addvariable('MaxEta2', d.maxEta2)
1310  tm.registerTopoAlgo(alg)
1311 
1312 
1313  # FTK algorithms
1314  # they are not needed in Run 3, but leave in for consistency of the legacy topo menu
1315  algoList = [
1316  {"minEta": -16, "maxEta": 16, "minPhi": 15, "maxPhi": 29, "otype" : "EM", "ocut" : 20, "inputwidth": HW.OutputWidthSortEM},
1317  {"minEta": -16, "maxEta": 16, "minPhi": 15, "maxPhi": 29, "otype" : "J", "ocut" : 100, "inputwidth": HW.OutputWidthSortJET},
1318  {"minEta": -16, "maxEta": 16, "minPhi": 15, "maxPhi": 29, "otype" : "MU", "ocut" : 10, "inputwidth": HW.OutputWidthSortMU},
1319  ]
1320  for x in algoList:
1321  class d:
1322  pass
1323  for k in x:
1324  setattr (d, k, x[k])
1325  toponame = "FTK-%s%ss1" % ( d.otype, str(d.ocut) if not d.otype=="EM" else "20" ) # noqa: F821
1326  log.debug("Define %s", toponame)
1327  inputList = d.otype + 's' # noqa: F821
1328  alg = AlgConf.EtaPhiWindow( name = toponame, inputs = inputList, outputs = toponame)
1329  alg.addgeneric('InputWidth', d.inputwidth) # noqa: F821
1330  alg.addgeneric('MaxTob', 1)
1331  alg.addgeneric('NumResultBits', 1)
1332  alg.addvariable('MinET', str(d.ocut)) # noqa: F821
1333  alg.addvariable('EtaMin', d.minEta) # noqa: F821
1334  alg.addvariable('EtaMax', d.maxEta) # noqa: F821
1335  alg.addvariable('PhiMin', d.minPhi) # noqa: F821
1336  alg.addvariable('PhiMax', d.maxPhi) # noqa: F821
1337  tm.registerTopoAlgo(alg)
1338 
1339 
1340  # LAR ZEE
1341  algoList = [
1342  {"otype" : "EM", "ocut1" : 20, "ocut2" : 20, "olist" : "shi", "nleading1" : 2, "minInvm" : 60, "maxInvm" : 100, "inputwidth": HW.OutputWidthSortEM},
1343  ]
1344  for x in algoList:
1345  class d:
1346  pass
1347  for k in x:
1348  setattr (d, k, x[k])
1349  toponame = 'ZEE-EM20shi2'
1350  log.debug("Define %s", toponame)
1351  inputList = d.otype + d.olist
1352  alg = AlgConf.InvariantMassInclusive1( name = toponame, inputs = inputList, outputs = toponame)
1353  alg.addgeneric('InputWidth', d.inputwidth)
1354  alg.addgeneric('MaxTob', d.nleading1)
1355  alg.addgeneric('NumResultBits', 1)
1356  alg.addvariable('MinET1', d.ocut1)
1357  alg.addvariable('MinET2', d.ocut2)
1358  alg.addvariable('MinMSqr', (d.minInvm * _emscale_for_decision)*(d.minInvm * _emscale_for_decision))
1359  alg.addvariable('MaxMSqr', (d.maxInvm * _emscale_for_decision)*(d.maxInvm * _emscale_for_decision))
1360  tm.registerTopoAlgo(alg)
1361 
1362 
1363  # 0INVM9-EM7ab-EMab
1364  algoList = [
1365  {"minInvm" : 0, "maxInvm": 9, "otype" : "EM", "ocut1" : 7, "olist" : "ab", "inputwidth": HW.OutputWidthSelectEM, "ocut2" : 0},
1366  ]
1367  for x in algoList:
1368  class d:
1369  pass
1370  for k in x:
1371  setattr (d, k, x[k])
1372  inputList = d.otype + d.olist
1373  toponame = "%iINVM%i-%s%s%s-%s%s" % (d.minInvm, d.maxInvm,
1374  d.otype, str(d.ocut1) , d.olist,
1375  d.otype, d.olist)
1376  alg = AlgConf.InvariantMassInclusive1( name = toponame, inputs = inputList, outputs = toponame)
1377  alg.addgeneric('InputWidth', d.inputwidth)
1378  alg.addgeneric('MaxTob', HW.OutputWidthSelectEM)
1379  alg.addgeneric('NumResultBits', 1)
1380  alg.addvariable('MinET1', d.ocut1)
1381  alg.addvariable('MinET2', d.ocut2)
1382  alg.addvariable('MinMSqr', (d.minInvm * _emscale_for_decision)*(d.minInvm * _emscale_for_decision))
1383  alg.addvariable('MaxMSqr', (d.maxInvm * _emscale_for_decision)*(d.maxInvm * _emscale_for_decision))
1384  tm.registerTopoAlgo(alg)
1385 
1386 
1387  # added for b-phys, 0DR03-EM7ab-CJ15ab
1388  algoList = [
1389  {"minDr": 0, "maxDr": 3, "otype1" : "EM" ,"ocut1": 7, "olist1" : "ab", "otype2" : "CJ", "ocut2": 15, "olist2" : "ab"}
1390  ]
1391  for x in algoList:
1392  class d:
1393  pass
1394  for k in x:
1395  setattr (d, k, x[k])
1396  toponame = "%iDR%02d-%s%s%s-%s%s%s" % (d.minDr, d.maxDr, d.otype1, str(d.ocut1), d.olist1, d.otype2, str(d.ocut2), d.olist2)
1397  log.debug("Define %s", toponame)
1398  inputList = [d.otype1 + d.olist1, d.otype2 + d.olist2]
1399  alg = AlgConf.DeltaRSqrIncl2( name = toponame, inputs = inputList, outputs = [ toponame ])
1400  alg.addgeneric('InputWidth1', HW.OutputWidthSelectEM)
1401  alg.addgeneric('InputWidth2', HW.OutputWidthSelectJET)
1402  alg.addgeneric('MaxTob1', HW.OutputWidthSelectEM)
1403  alg.addgeneric('MaxTob2', HW.OutputWidthSelectJET)
1404  alg.addgeneric('NumResultBits', 1)
1405  alg.addvariable('MinET1', d.ocut1, 0)
1406  alg.addvariable('MinET2', d.ocut2, 0)
1407  alg.addvariable('DeltaRMin', d.minDr*d.minDr, 0)
1408  alg.addvariable('DeltaRMax', d.maxDr*d.maxDr, 0)
1409  tm.registerTopoAlgo(alg)
1410 
1411 
1412  # VBF items INVM_NFF
1413  algoList = [
1414  { "algoname": 'INVM_NFF', "Threlist": [ 600, 500, 400, 200 ], "maxInvm": 9999, "otype1" : "J", "ocut1" : 30, "olist1" : "s", "nleading1" : 6,
1415  "inputwidth": HW.OutputWidthSortJET, "otype2" : "AJ", "ocut2" : 20, "olist2" : "s", "nleading2" : 6 }
1416  ]
1417  for x in algoList:
1418  class d:
1419  pass
1420  for k in x:
1421  setattr (d, k, x[k])
1422  inputList = [d.otype1 + d.olist1, d.otype2 + d.olist1]
1423  toponames=[]
1424  for minInvm in d.Threlist:
1425  toponame = "%iINVM%i-%s%s%s%s-%s%s%s%s" % (minInvm, d.maxInvm,
1426  d.otype1, str(d.ocut1) , d.olist1, str(d.nleading1) if d.olist1=="s" else "",
1427  d.otype2, str(d.ocut2) , d.olist2, str(d.nleading2) if d.olist2=="s" else "")
1428  toponames.append(toponame)
1429  alg = AlgConf.InvariantMassInclusive2( name = d.algoname, inputs = inputList, outputs = toponames)
1430  alg.addgeneric('InputWidth1', d.inputwidth)
1431  alg.addgeneric('InputWidth2', d.inputwidth)
1432  alg.addgeneric('MaxTob1', d.nleading1)
1433  alg.addgeneric('MaxTob2', d.nleading2)
1434  alg.addgeneric('NumResultBits', len(toponames))
1435  for bitid, minInvm in enumerate(d.Threlist):
1436  alg.addvariable('MinET1', d.ocut1, bitid)
1437  alg.addvariable('MinET2', d.ocut2, bitid)
1438  alg.addvariable('MinMSqr', minInvm*minInvm , bitid)
1439  alg.addvariable('MaxMSqr', d.maxInvm *d.maxInvm , bitid)
1440  tm.registerTopoAlgo(alg)
1441 
1442 
1443  # Axion 2EM DPHI
1444  # 27DPHI32-EMs1-EMs6
1445  algoList = [
1446  {"minDphi": 27, "maxDphi": 32, "otype" : "EM", "ocut1" : 0, "olist" : "s", "nleading1" : 1, "inputwidth1": HW.OutputWidthSortEM, "ocut2" : 0, "nleading2": 6},
1447  ]
1448  for x in algoList:
1449  class d:
1450  pass
1451  for k in x:
1452  setattr (d, k, x[k])
1453  toponame = "%iDPHI%i-%s%s%s%s-%s%s%s%s" % (d.minDphi, d.maxDphi,
1454  d.otype, str(d.ocut1) if d.ocut1 > 0 else "", d.olist, str(d.nleading1) if d.olist=="s" else "",
1455  d.otype, str(d.ocut2) if d.ocut2 > 0 else "", d.olist, str(d.nleading2) if d.olist=="s" else "")
1456  log.debug("Define %s", toponame)
1457  inputList = d.otype + d.olist
1458  alg = AlgConf.DeltaPhiIncl1( name = toponame, inputs = inputList, outputs = toponame)
1459  alg.addgeneric('InputWidth', d.inputwidth1)
1460  alg.addgeneric('MaxTob', d.nleading2)
1461  alg.addgeneric('NumResultBits', 1)
1462  alg.addvariable('MinET1', d.ocut1 if d.ocut1 > 0 else 3, 0)
1463  alg.addvariable('MinET2', d.ocut2 if d.ocut2 > 0 else 3, 0)
1464  alg.addvariable('MinDeltaPhi', d.minDphi, 0)
1465  alg.addvariable('MaxDeltaPhi', d.maxDphi, 0)
1466  tm.registerTopoAlgo(alg)
1467 
1468 
1469  #ATR-20174, L1BPH-8M15-2MU4-BO
1470  toponame = "8INVM15-2CMU4ab"
1471  log.debug("Define %s", toponame)
1472  inputList = ['CMUab']
1473  alg = AlgConf.InvariantMassInclusive1( name = toponame, inputs = inputList, outputs = toponame)
1474  alg.addgeneric('InputWidth', HW.OutputWidthSelectMU)
1475  alg.addgeneric('MaxTob', HW.OutputWidthSelectMU)
1476  alg.addgeneric('NumResultBits', 1)
1477  alg.addvariable('MinMSqr', 8*8)
1478  alg.addvariable('MaxMSqr', 15*15)
1479  alg.addvariable('MinET1', 4)
1480  alg.addvariable('MinET2', 4)
1481  tm.registerTopoAlgo(alg)
1482 
1483 
1484 
python.L1.Config.TypeWideThresholdConfig.getTypeWideThresholdConfig
def getTypeWideThresholdConfig(ttype, do_HI_tob_thresholds=False, do_eFex_BDT_Tau=True)
Definition: TypeWideThresholdConfig.py:102
hist_file_dump.d
d
Definition: hist_file_dump.py:137
python.L1.Config.TopoAlgoDefLegacy.TopoAlgoDefLegacy.registerTopoAlgos
def registerTopoAlgos(tm)
Decision algorithms.
Definition: TopoAlgoDefLegacy.py:14
python.L1.Config.TopoAlgoDefLegacy.TopoAlgoDefLegacy
Definition: TopoAlgoDefLegacy.py:11
str
Definition: BTagTrackIpAccessor.cxx:11