ATLAS Offline Software
SignatureDicts.py
Go to the documentation of this file.
1 # Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
2 from AthenaCommon.Logging import logging
3 log = logging.getLogger( __name__ )
4 log.debug("Importing %s",__name__)
5 
6 from copy import deepcopy
7 import itertools
8 
9 #==========================================================
10 # This is stored in chainDict['Signature']
11 #==========================================================
12 
13 # this dictionary contains all the informations about the signatures, needed to create the Chaindicitonary. It has the shape of:
14 # 'signature': ('substring', 'group')
15 # if the substring is '', the signature is not mapped to the chain name
16 # if the group is '', the signature is not mapped to any group
17 SignatureDict = {
18  'Electron': ('e','AllTag'),
19  'Photon' : ('g','AllTag'),
20  'Muon' : ('mu','AllTag'),
21  'Bphysics': ('', 'AllTag'),
22  'Tau' : ('tau','JetMET'),
23  'Jet' : ('j', 'JetMET'),
24  'Bjet' : ('', 'JetMET'),
25  'MET' : ('xe', 'JetMET'),
26  'XS' : ('xs', 'JetMET'),
27  'TE' : ('te', 'JetMET'),
28  'MinBias' : ('mb', 'MinBias'),
29  'HeavyIon' : ('hi', 'MinBias'),
30  'Cosmic' : ('cosmic', ''),
31  'Calib' : ('calib', ''),
32  'Streaming' : ('streamer', ''),
33  'Monitor' : ('mon', ''),
34  'Beamspot' : ('beamspot','Beamspot'),
35  'MuonnoL1' : ( '', 'MuonnoL1'),
36  'EnhancedBias' : ('eb', ''),
37  'UnconventionalTracking' : (['isotrk', 'fslrt', 'dedxtrk', 'hitdvjet', 'fsvsi', 'distrk', 'dispjet', 'dispvtx'], 'JetMET'),
38  'Test' : ('TestChain', ''),
39  'Electronprobe': ('', 'AllProbe'),
40  'Photonprobe' : ('', 'AllProbe'),
41  'Tauprobe' : ('', 'AllProbe'),
42  'Muonprobe' : ('', 'AllProbe')
43 }
44 
45 
47  # removes the grouping from the dict and creates a new one signature : string
48  new_dict = {key: value[0] for key, value in SignatureDict.items() if value[0] != ''}
49  return new_dict
50 
51 SliceIDDict = getSignatureDict()
52 
54  # removes the substring from the dict and creates a new one signature : group
55  new_dict = {key: value[1] for key, value in SignatureDict.items() if value[1] != ''}
56  return new_dict
57 
59  ''' returns the list of substrings representing the signautres in the chain name'''
60 
61  list_of_strings = list(SliceIDDict.values()) # this is a list of lists
62  flattened_list = list(itertools.chain.from_iterable((item if isinstance(item, list) else [item]) for item in list_of_strings))
63  return flattened_list
64 
66  ''' returns the list of substrings representing the signautres in the chain name'''
67  return SliceIDDict.keys()
68 
69 
70 
71 class ChainStore(dict):
72  """Class to hold list of chains for each signature (dictionary with fixed set of keys)"""
73  _allowedSignatures = ['Egamma', 'Muon', 'Jet', 'Bjet', 'Bphysics', 'MET', 'Tau',
74  'HeavyIon', 'Beamspot', 'Cosmic', 'EnhancedBias',
75  'Monitor', 'Calib', 'Streaming', 'Combined', 'MinBias',
76  'UnconventionalTracking', 'Test']
77 
78  def __init__(self):
79  # Create dicionary with fixed set of keys in the orignal order
80  super().__init__({s : [] for s in self._allowedSignatures})
81 
82  def __setitem__(self, key, value):
83  if key not in self:
84  raise RuntimeError(f"'{key}' is not in the list of allowed signatures: {self._allowedSignatures}")
85  else:
86  dict.__setitem__(self, key, value)
87 
88 
89 #==========================================================
90 # ---- Generic Template for all chains ----
91 # ---- chainParts specific information given in ----
92 # ---- signature specific dictionaries below ----
93 #==========================================================
94 ChainDictTemplate = {
95  'chainName' : '',
96  'L1item' : '',
97  'topo' : '',
98  'signatures' : [],
99  'alignmentGroups' : [],
100  'stream' : '',
101  'groups' : [],
102  'EBstep' : '',
103  'chainParts' : [],
104  'sigDicts' : {},
105  'sigFolder' : [],
106  'subSigs' : [],
107  'extraComboHypos' : []
108 }
109 
110 #==========================================================
111 # Test chains
112 #==========================================================
113 # ---- Test Dictionary of all allowed Values ----
114 TestChainParts = {
115  'L1threshold' : '',
116  'signature' : ['Test'],
117  'alignmentGroup' : ['Test'],
118  'chainPartName' : '',
119  'multiplicity' : '',
120  'extra' : ['mv1', 'mv1step', 'mv2', 'ev1', 'ev2', 'ev3', 'gv1', 'mEmpty1', 'mEmpty2', 'mEmpty3', 'ev1dr', 'mv1dr','merge'],
121  'trigType' : ['TestChain'],
122  'threshold' : '',
123  'addInfo' : [''],
124  'sigFolder' : ['Test'],
125  'subSigs' : ['Test'],
126  'chainPartIndex': list(range(0,10))
127 }
128 
129 # ---- Test Dictionary of default Values ----
130 TestChainParts_Default = {
131  'signature' : ['Test'],
132  'alignmentGroup' : ['Test'],
133  'L1threshold' : '',
134  'multiplicity' : '',
135  'trigType' : '',
136  'threshold' : '',
137  'addInfo' : [],
138  'sigFolder' : ['Test'],
139  'subSigs' : ['Test'],
140  'chainPartIndex': 0
141 }
142 
143 #==========================================================
144 # Jet
145 #==========================================================
146 AllowedTopos_jet = []
147 # List of keys that pertain to jet reconstruction
148 # as opposed to the hypo configuration
149 JetRecoKeys = ['recoAlg','constitType','clusterCalib','constitMod','jetCalib','trkopt','ionopt']
150 # ---- Jet Dictionary of all allowed Values ----
151 JetChainParts = {
152  # Information common to all signatures
153  'signature' : ['Jet'],
154  'alignmentGroup': ['Jet','JetMET'],
155  'L1threshold' : '',
156  'chainPartName' : '',
157  'threshold' : '',
158  'multiplicity' : '',
159  'trigType' : ['j'],
160  'topo' : AllowedTopos_jet,
161  'extra' : [],
162  'addInfo' : ['perf'],
163  'sigFolder' : ['Jet'],
164  'subSigs' : ['Jet'],
165  'chainPartIndex': list(range(0,10)),
166  # Information unique to the jet slice
167  # Reco information
168  'recoAlg' : # Jet clustering algorithm
169  ['a2', 'a4', 'a10', 'a10r', 'a10t', 'a10sd'],
170  'constitType' : # Jet input type
171  ['tc','pf'], # 'ufo' might be added at some point
172  'clusterCalib' : # Topocluster calibration
173  ['em', 'lcw'],
174  'constitMod' : # Constituent modifiers
175  ['sk', 'cssk'],
176  'jetCalib' : # Jet calibration
177  ['jes', 'subjes', 'subjesIS', 'subjesgscIS', 'subresjesgscIS', 'subjesgsc', 'subresjesgsc', 'nojcalib'],
178  'scan' : # No longer used?
179  ['FS',],
180  'ionopt' : # Heavy ion configuration
181  ['noion','ion','ionp'],
182  'trkopt' : # Tracking configuration
183  ['notrk','ftf','roiftf'],
184  'trkpresel' : # Tracking preselection
185  ['nopresel',
186  # Single jet
187  'preselj50emf72',
188  'preselj30emf72',
189  'preselj20emf72',
190  'preselj20emf60',
191  'preselj20emf48',
192  'preselj20emf24',
193  'preselj20emf18',
194  'preselj20emf12',
195  'preselj20emf6',
196  'preselj20',
197  'preselj50',
198  'preselj80',
199  'preselj120',
200  'preselj140',
201  'preselj180',
202  'preselj190',
203  'preselj160',
204  'preselj200',
205  'preselj225',
206  # Multijets
207  'presel2j180',
208  'presel2j225',
209  'presel3c30',
210  'presel3c40',
211  'presel3c45',
212  'presel3j45',
213  'presel3j150',
214  'presel4j20',
215  'presel4c20',
216  'presel4c25',
217  'presel4c30',
218  'presel4c35',
219  'presel4c45',
220  'presel4j25',
221  'presel4c25',
222  'presel4j40',
223  'presel4c40',
224  'presel4j45',
225  'presel4j50',
226  'presel4j85',
227  'presel5c20',
228  'presel5j25',
229  'presel5j50',
230  'presel5j55',
231  'presel5c50',
232  'presel6j40',
233  'presel6j45',
234  'presel7j30',
235  # Multiple threshold
236  'preselj60XXj40',
237  'preselj140XXj45',
238  'preselj140XX2j45',
239  'preselj100XX2j45',
240  'preselj120XX2j45',
241  'preselj80XX2j45',
242  'presel2j180XXj80',
243  # Nonstandard eta regions
244  'presel5c55',
245  'presel6c20',
246  'presel6c25',
247  'presel6c45',
248  'preselj45XX2f40',
249  'preselc60XXc45XXc25XXc20', # L1J45p0ETA21_3J15p0ETA25
250  'preselc60XXj45XXf40',
251  'preselj60XXj45XXf40',
252  'presela60XXa40XX2a25',
253  'preseljHT400',
254  'preselcHT400',
255  'preseljHT450',
256  'preselcHT450',
257  'preseljHT500',
258  'preselcHT500',
259  'preseljHT600',
260  'preselcHT600',
261  'preselcHT650',
262  'preselcHT850',
263  #b-jet preselections
264  'presel1c100XX2c20bgtwo85',
265  'presel1c120XX2c20bgtwo90',
266  'presel1c120CXX1c20XX1c20bgtwo85',
267  'presel1c160XX1c20bgtwo90',
268  'presel1c160XX1c20bgtwo85',
269  'presel2c20XX2c20b85',
270  'presel2c20XX2c20b82',
271  'presel2c20XX2c20b80',
272  'presel2c20XX2c20bgtwo85',
273  'presel2c20XX2c20bg85',
274  'presel2c20XX2c20bg82',
275  'presel2c20XX2c20bg80',
276  'presel2c20XX2c20b90',
277  'presel3c20XX1c20b85',
278  'presel3c20XX1c20bg85',
279  # (b+)tau preselections
280  'presel4c20',
281  'presel3c20XX1c20bgtwo85',
282  'presel2c20XX1c20bgtwo85XX1c20gntau90',
283  'presel2c20XX1c20bgtwo85XX1c20gntau85',
284  'presel2c20XX1c20bgtwo82XX1c20gntau85',
285  'presel2c20XX1c20bgtwo82XX1c20gntau80',
286  'presel2c20XX1c20bgtwo80XX1c20gntau80',
287  'presel2c20XX1c20bgtwo85XX1c20uht1tau90',
288  'presel2c20XX1c20bgtwo85XX1c20uht1tau85',
289  'presel2c20XX1c20bgtwo85XX1c20uht1tau82',
290  'presel2c20XX1c20bgtwo85XX1c20uht1tau80',
291  'presel5c25XXc25bgtwo85',
292  'presel3j45bgtwo95',
293  'presel4j25bgtwo95',
294  'presel2j25XX2j25bgtwo85',
295  'presel3j25XX2j25bgtwo85',
296  'preselj50bgtwo85XX3j50',
297  'preselj80XX2j45bgtwo90',
298  'preselj140bgtwo85XXj45bgtwo85',
299  'presel2a20bgtwo90XX2a20',
300  'presela20bgtwo85XX3a20',
301  'presel3c20XX1c20gntau90',
302  'presel3c20XX1c20gntau85',
303  'preselj20b95',
304  'preselj2b77',
305  'preselj20b77',
306  'presel3j45b95',
307  'presel4j25b95',
308  'presel2j25XX2j25b85',
309  'presel3j25XX2j25b85',
310  'preselj50b85XX3j50',
311  'preselj80XX2j45b90',
312  'preselj140b85XXj45b85',
313  'presel5c25XXc25b85',
314  'presel2a20b90XX2a20',
315  'presela20b85XX3a20',
316  #beamspot preselction option
317  'presel2c20b85',
318  #DIPZ preselection
319  'preselZ128XX4c20',
320  'preselZ120XX4c20',
321  'preselZ116XX4c20',
322  'preselZ167MAXMULT5cXX4c20',
323  'preselZ138MAXMULT5cXX4c20',
324  'preselZ126MAXMULT5cXX4c20',
325  'preselZ120MAXMULT20cXX4c85',
326  'preselZ87XX3c20',
327  'preselZ84XX3c20',
328  'preselZ82XX3c20',
329  'preselZ120XX2c20XX2c20b85',
330  'preselZ138MAXMULT5cXX2c20XX2c20b85',
331  'preselZ84XX1c20XX2c20b85',
332  'preselZ120XX4c85',
333  'preselZ116XX4c20',
334  'preselZ138XX4c20',
335  'preselZ120MAXMULT20cXX4c20',
336  'preselZ84MAXMULT20cXX3c20',
337  'preselZ116MAXMULT5cXX4c20',
338  'preselZ116MAXMULT20cXX4c20',
339  'preselZ84XX1c20XX2c20b85',
340  'preselZ128XX2c20XX2c20b85',
341  'preselZ128MAXMULT20cXX4c85',
342  'preselZ128XX4c20XX1j20',
343  'preselZ128XX3c20XX1c20bg85',
344  'preselZ116XX3c20XX1c20bg85',
345  'preselZ128XX4c85',
346  'preselZ219XX6c20',
347  'preselZ197XX6c20',
348  'preselZ182XX6c20',
349  'preselZ142XX5c20',
350  'preselZ134XX5c20',
351  'preselZ124XX5c20'
352  ],
353  # Hypo information
354  # If hypoScenario is 'simple', then hypo configuration is handled based on the
355  # other dict contents. If it is not 'simple', then the configuration is 100%
356  # from the hypoScenario specification, and all other hypo entries are ignored.
357  # Complete scenario names for aliases can be found in Trigger/TrigHypothesis/TrigHLTJetHypo/python/hypoConfigBuilder.py
358  'hypoScenario' : ['simple', # Independent selections on individual jets, multiplicity+threshold cuts
359  # 'fbdj' (forward-backward + dijet) scenario:
360  # default eta selection for dijet mass cut is 0eta490
361  'FBDJSHARED', # Forward backward jets + dijet, default parameters, fb and dj can share
362  'FBDJNOSHARED10etXX20etXX34massXX50fbet', # f/b jets + dijet, expl. parameters, fb and dj do not share
363  # 'dijet' scenario applies always a mass cut (deta and dphi cuts are optional)
364  # 0eta490 is the default eta selections for j1/j2
365  # j12et sets the same et cuts for j1et and j2et
366  # j12eta sets the same eta cuts for j1eta and j2eta
367  # order:
368  # et cuts (mandatory)
369  # eta cuts (optional, if missing will use default)
370  # djmass sel (mandatory)
371  # djdphi sel (optional)
372  # djdeta sel (optional)
373  #
374  # pt threshold cuts
375  'DJMASS300j35', # alias
376  'DJMASS500j35', # alias
377  'DJMASS700j35', # alias
378  'DJMASS1000j35', # alias
379  'DJMASS900j50', # alias
380  'DJMASS1000j50', # alias
381  'DJMASS1000j50dphi240', # alias
382  'DJMASS1000j50dphi200x400deta', # alias
383  'DJMASS900j50dphi200x400deta', # alias
384  'DJMASS1000j50dphi260x200deta', # alias
385  'DJMASS900j50dphi260x200deta' , # alias
386  'DJMASS1000j50dphi260', # alias
387  'DJMASS900j50dphi260', # alias
388  'DJMASS1000j50x200deta', # alias
389  'DJMASS900j50x200deta', # alias
390  'DJMASS1000j30dphi260x200deta', # alias
391  'DJMASS900j30dphi260x200deta', # alias
392  'DIJET70j12etXX1000djmassXXdjdphi200XX400djdeta', # needed for hypoToolTests.py
393  'DIJET80j12etXX0j12eta240XX700djmass', # needed for hypoToolTests.py
394 
395  # 'ht' category applies a cut on HT (HT>value) computed by aggregation over single jets (default filtering: 30et and 0eta320)
396  'HT0',
397  'HT1000',
398  'HT290',
399  'HT300',
400  'HT500',
401  'HT940',
402  'HT50',
403  'HT300XX10ptXX0eta490',
404  'HT300XX10ptXX0eta490XXveto',
405  'HT300XX15ptXX0eta490',
406  'HT300XX15ptXX0eta490XXveto',
407  'HT400XX15ptXX0eta490',
408  'HT400XX15ptXX0eta490XXveto',
409  'HT500XX0eta240',
410  'HT650XX0eta240',
411  'HT850XX0eta240',
412  'HT940XX0eta240',
413  'HT940XX020jvt',
414  'HT940XX0eta240XX020jvt',
415  'HT1000XX0eta240',
416  'HT1000XX020jvt',
417  'HT1000XX0eta240XX020jvt',
418  'HT50XX10etXX0eta320', # needed for hypoToolTests.py
419  # DIPZ for testing only
420  'Z120XX4c20',
421  'Z120XX4c120',
422  'Z128XX4c20',
423  'Z120XX5c70',
424  'Z120XX6c55',
425  'Z120XX10c40',
426  'Z219XX6c20',
427  'Z197XX6c20',
428  'Z182XX6c20',
429  'Z142XX5c20',
430  'Z134XX5c20',
431  'Z124XX5c20',
432  # 'MULT' hypoScenario applies a cut on the number of jets
433  # in the input container after filtering on pt, eta.
434  'MULT0mult11XX10ptXX0eta490', # Heavy Ions
435  'MULT0mult11XX15ptXX0eta490', # Heavy Ions
436  ],
437  'exotHypo' : ['emergingPTF0p2dR1p2', 'emergingPTF0p1dR1p2', 'emergingPTF0p09dR1p2', 'emergingPTF0p08dR1p2', 'emergingPTF0p075dR1p2', 'emergingPTF0p07dR1p2', 'emergingPTF0p0dR1p2',
438  'emergingPTF0p2dR0p4', 'emergingPTF0p1dR0p4', 'emergingPTF0p09dR0p4', 'emergingPTF0p08dR0p4', 'emergingPTF0p075dR0p4', 'emergingPTF0p07dR0p4', 'emergingPTF0p0dR0p4',
439  'tracklessdR1p2', 'tracklessdR0p4',
440  'calratio','calratiormbib','calratiovar','calratiovarrmbib', # Exotics CalRatio jets (trackless and low-EMF, with option to clean out BIB)
441  'calratiovar103','calratiovar82','calratiovar59', 'calratiovar186', 'calratiovar150', 'calratiovar165' # Exotics CalRatio Jets ( requested by DPJ Team for alternative cut on ratio )
442  ],
443 
444  # Simple hypo configuration. Single property cuts defined as MINvarMAX
445  'etaRange' :
446  # These atypical explicit values are allowed to be in chain names.
447  # Otherwise use ['','a','c','f'] ==> [0eta320, 0eta490, 0eta240, 320eta490]
448  # suffix after threshold e.g. j420 == j420_0eta320, 6j55c == 6j55_0eta240
449  ['0eta290', '0eta200', '0eta180', '0eta160', '0eta140']
450  +['320eta490'], # TODO: Kept temporarily for validation
451  'jvt' : # Jet Vertex Tagger pileup discriminant
452  ['010jvt', '011jvt', '015jvt', '020jvt', '050jvt', '059jvt'],
453  'nnJvt' : # NN Jet Vertex Tagger pileup discriminant
454  ['nnJvtv1'], # No range cuts, boolean pass/fail
455  'momCuts' : # Generic moment cut on single jets
456  ['050momemfrac100','momemfrac006','momemfrac024','momemfrac012', 'momhecfrac010', '050momemfrac100XXmomhecfrac010', 'momemfrac072', 'momemfrac048' ],
457  'timing' : # delayed jets, with absolute delay requirement [ns]
458  ['2timing','2timing15'],
459  'timeSig' : # delayed jets, based on pT-dependent significance of delay [sigma]
460  ['1timeSig', '1p5timeSig', '2timeSig', '3timeSig','2timeSig15','3timeSig15'],
461  'prefilters' : # Pre-hypo jet selectors (including cleaning)
462  ['CLEANlb', 'CLEANllp', 'MASK300ceta210XX300nphi10',
463  # ptrangeXrY (X, Y matches regex \d+) triggers a prehypo selection of
464  # jets by ordering by pt, and selecting those with indices in [X,Y]
465  'PTRANGE0r1',
466  'PTRANGE2r3',
467  'MAXMULT20c',
468  'MAXMULT6c',],
469  'bsel': [ '95bdips','90bdips','85bdips','80bdips','77bdips'
470  , '95bgnone','90bgnone','85bgnone','80bgnone','77bgnone'
471  , '60bgntwoxt', '65bgntwoxt', '70bgntwoxt', '75bgntwoxt'
472  , '80bgntwoxt', '85bgntwoxt', '90bgntwoxt', '95bgntwoxt'
473  , '79bgntwox', '86bgntwox', '91bgntwox', '96bgntwox'
474  , '95bgntwo','90bgntwo','85bgntwo','80bgntwo','82bgntwo','77bgntwo','75bgntwo','60bgntwo'
475  ],
476  'tausel':
477  [ '75gntau' , '80gntau', '85gntau' , '90gntau'
478  , '75uht1tau' , '80uht1tau', '85uht1tau' , '90uht1tau'
479  ],
480  'smc' : # "Single mass condition" -- rename?
481  ['30smcINF', '35smcINF', '40smcINF', '50smcINF', '60smcINF', 'nosmc'],
482  # Setup for alternative data stream readout
483  # B-tagging information
484  'bTag' : ['boffperf' ,
485  # GN1 series
486  'bgn160', 'bgn165', 'bgn170', 'bgn172',
487  'bgn175', 'bgn177', 'bgn180', 'bgn182',
488  'bgn185',
489  'bgn182bb96', 'bgn177bb96', 'bgn175bb90',
490  # GN2 series
491  'bgn260', 'bgn265', 'bgn270', 'bgn272',
492  'bgn275', 'bgn277', 'bgn280', 'bgn282',
493  'bgn285', ],
494  'ditauTag' : ['ditauOmni0Trk3', 'ditauOmni0Trk4', 'ditauOmni0Trk5', 'ditauOmni0Trk9',
495  'ditauOmni1Trk3', 'ditauOmni1Trk4', 'ditauOmni1Trk5', 'ditauOmni1Trk9',
496  'ditauOmni2Trk3', 'ditauOmni2Trk4', 'ditauOmni2Trk5', 'ditauOmni2Trk9',
497  'ditauOmni3Trk3', 'ditauOmni3Trk4', 'ditauOmni3Trk5', 'ditauOmni3Trk9',
498  'ditauOmni4Trk3', 'ditauOmni4Trk4', 'ditauOmni4Trk5', 'ditauOmni4Trk9',
499  'ditauOmni5Trk3', 'ditauOmni5Trk4', 'ditauOmni5Trk5', 'ditauOmni5Trk9',
500  'ditauOmni6Trk3', 'ditauOmni6Trk4', 'ditauOmni6Trk5', 'ditauOmni6Trk9',
501  'ditauOmni7Trk3', 'ditauOmni7Trk4', 'ditauOmni7Trk5', 'ditauOmni7Trk9',
502  'ditauOmni8Trk3', 'ditauOmni8Trk4', 'ditauOmni8Trk5', 'ditauOmni8Trk9',
503  'ditauOmni9Trk3', 'ditauOmni9Trk4', 'ditauOmni9Trk5', 'ditauOmni9Trk9',
504  'ditauOmni01Trk3', 'ditauOmni01Trk4', 'ditauOmni01Trk5', 'ditauOmni01Trk9',
505  'ditauOmni02Trk3', 'ditauOmni02Trk4', 'ditauOmni02Trk5', 'ditauOmni02Trk9',
506  'ditauOmni03Trk3', 'ditauOmni03Trk4', 'ditauOmni03Trk5', 'ditauOmni03Trk9',
507  'ditauOmni04Trk3', 'ditauOmni04Trk4', 'ditauOmni04Trk5', 'ditauOmni04Trk9',
508  'ditauOmni05Trk3', 'ditauOmni05Trk4', 'ditauOmni05Trk5', 'ditauOmni05Trk9',
509  'ditauOmni06Trk3', 'ditauOmni06Trk4', 'ditauOmni06Trk5', 'ditauOmni06Trk9',
510  'ditauOmni07Trk3', 'ditauOmni07Trk4', 'ditauOmni07Trk5', 'ditauOmni07Trk9',
511  'ditauOmni08Trk3', 'ditauOmni08Trk4', 'ditauOmni08Trk5', 'ditauOmni08Trk9',
512  'ditauOmni09Trk3', 'ditauOmni09Trk4', 'ditauOmni09Trk5', 'ditauOmni09Trk9',
513  ],
514  'bTracking' : [],
515  'bConfig' : ['split',],
516  'bMatching' : ['antimatchdr05mu'],
517  'tboundary' : ['SHARED'], # simple scenario tree boundary marker
518 
519  # beamspot
520  'beamspotChain' : ['beamspotVtx'],
521  'pileuprm' : # scedule pileup removal algo for single jet, the m_min LogR value is minimul criteria to for jet LogR to start removal algorithm, the m_max LogR is the desired logR cut to pass for jetschedule pileup removal algo for single jet, the m_min LogR value is minimal criteria for jet LogR to start the removal algorithm, the n_max LogR is the desired logR cut to pass for jet
522  ['n041pileuprmn015' ],# left value is min LogR,right is max LogR, n stands for negative (for example n041 means -0.41 )
523 }
524 
525 # ---- Jet Dictionary of default Values ----
526 JetChainParts_Default = {
527  'signature' : ['Jet'],
528  'alignmentGroup': ['Jet'],
529  'L1threshold' : '',
530  'threshold' : '',
531  'multiplicity' : '',
532  'trigType' : '',
533  'topo' : [],
534  'extra' : '',
535  'addInfo' : [],
536  'sigFolder' : ['Jet'],
537  'subSigs' : ['Jet'],
538  'chainPartIndex': 0,
539  #
540  'recoAlg' :'a4',
541  'constitType' :'tc',
542  'clusterCalib' :'em',
543  'constitMod' :'',
544  'jetCalib' :'default',
545  'scan' :'FS',
546  'ionopt' : 'noion',
547  'trkopt' : 'notrk',
548  'trkpresel' : 'nopresel',
549  #
550  'etaRange' : '0eta320',
551  'jvt' : '',
552  'nnJvt' : '',
553  'momCuts' : '',
554  'timing' : '',
555  'timeSig' : '',
556  'prefilters' : [],
557  'bsel' : '',
558  'tausel' : '',
559  'hypoScenario' : 'simple',
560  'exotHypo' : [],
561  'smc' : 'nosmc',
562  #
563  'bTag' : '',
564  'ditauTag' : '',
565  'bTracking' : '',
566  'bConfig' : [],
567  'bMatching' : [],
568  #
569  'tboundary' : '',
570 
571  'beamspotChain' : '',
572  'pileuprm' : '',
573  }
574 
575 # ---- bJet Dictionary of default Values that are different to the ones for normal jet chains ----
576 bJetChainParts_Default = {
577  'etaRange' : '0eta290',
578  'sigFolder' : ['Bjet'],
579  'subSigs' : ['Bjet'],
580 }
581 
582 ditauJetChainParts_Default = {
583  'sigFolder' : ['Tau'],
584  'subSigs' : ['Ditau'],
585 }
586 # ---- Beamspot Dictionary for chains confiugred through jets
587 BeamspotJetChainParts_Default = {
588  'signature' : 'Beamspot',
589  'alignmentGroup' : ['Beamspot'],
590  'sigFolder' : ['CalibCosmicMon'],
591  'subSigs' : ['Beamspot'],
592  'beamspotChain' : '',
593  'chainPartIndex': 0
594  }
595 
596 #==========================================================
597 # Muon
598 #==========================================================
599 AllowedTopos_mu = [
600  'b7invmAB9vtx20', 'b11invmAB60vtx20', 'b11invmAB24vtx20', 'b24invmAB60vtx20',
601  '50invmAB130' # Zmumu
602  ]
603 
604 # ---- Muon Dictionary of all allowed Values ----
605 MuonChainParts = {
606  'signature' : ['Muon'],
607  'alignmentGroup' : ['Muon','MuonnoL1'],
608  'L1threshold' : '',
609  'chainPartName' : [],
610  'multiplicity' : '',
611  'trigType' : ['mu'],
612  'etaRange' : ['0eta105'],
613  'threshold' : '',
614  'tnpInfo' : ['probe'],
615  'extra' : ['noL1', 'lateMu', "muoncalib" ,'noL2Comb','vtx','mucombTag'],
616  'IDinfo' : [],
617  'isoInfo' : ['ivarloose', 'ivarmedium', 'ivarperf','iloosems'],
618  'l2AlgInfo' : ['l2io','l2mt'],
619  'lrtInfo' : ['d0loose','d0medium','d0tight'],
620  'invMassInfo' : ['invmJPsiOS','invmDimu'],
621  'msonlyInfo' : ['msonly'],
622  'addInfo' : ['idperf','LRT','3layersEC','cosmic',"muonqual","nscan","nscan10","nscan20","nscan30","nscan40",'idtp','idReuse','fT'],
623  'topo' : AllowedTopos_mu,
624  'flavour' : [],
625  'sigFolder' : ['Muon'],
626  'subSigs' : ['Muon'],
627  'chainPartIndex': list(range(0,10))
628 }
629 # ---- MuonDictionary of default Values ----
630 MuonChainParts_Default = {
631  'signature' : ['Muon'],
632  'alignmentGroup' : ['Muon'],
633  'L1threshold' : '',
634  'multiplicity' : '',
635  'trigType' : '',
636  'etaRange' : '0eta250',
637  'threshold' : '',
638  'tnpInfo' : '',
639  'extra' : '',
640  'IDinfo' : '',
641  'isoInfo' : '',
642  'l2AlgInfo' : [],
643  'lrtInfo' : [],
644  'addInfo' : [],
645  'invMassInfo' : '',
646  'msonlyInfo' : [],
647  'topo' : [],
648  'flavour' : '',
649  'sigFolder' : ['Muon'],
650  'subSigs' : ['Muon'],
651  'chainPartIndex': 0
652 }
653 
654 #==========================================================
655 # Bphysics
656 #==========================================================
657 AllowedTopos_Bphysics = [
658  'bJpsimumu','bJpsi','bJpsimutrk','bUpsimumu','bUpsi','bBmumu','bDimu','bDimu2700','bDimu6000','bPhi','bTau','b3mu',
659  'bBmumux', 'bBmux', 'b0dRAB12vtx20', 'b0dRAB127invmAB22vtx20', 'b0dRAB207invmAB22vtx20', 'b7invmAB22vtx20',
660 
661 
663  'Bidperf','BsmumuPhi','BpmumuKp','BcmumuPi','BdmumuKst','LbPqKm','BcmumuDsloose','BcmumuDploose','BcmumuD0Xloose','BcmumuDstarloose',
664  'BpmuD0X','BdmuDpX','BdmuDstarX','BsmuDsX','LbmuLcX',
665  # topoExtras
666  'Lxy0','sigmaLxy3','noos','nocut','lowpt'
667 
668 
669 ]
670 AllowedTopos_Bphysics_topoVariant = [
671  'Bidperf','BsmumuPhi','BpmumuKp','BcmumuPi','BdmumuKst','LbPqKm','BcmumuDsloose','BcmumuDploose','BcmumuD0Xloose','BcmumuDstarloose',
672  'BpmuD0X','BdmuDpX','BdmuDstarX','BsmuDsX','LbmuLcX'
673 ]
674 AllowedTopos_Bphysics_topoExtra = ['Lxy0','noos','nocut','lowpt']
675 AllAllowedTopos_Bphysics = AllowedTopos_Bphysics_topoVariant+AllowedTopos_Bphysics_topoExtra+AllowedTopos_Bphysics
676 
677 # ---- Bphysics Dictionary of all allowed Values ----
678 BphysicsChainParts = deepcopy(MuonChainParts)
679 BphysicsChainParts['signature'] = ['Bphysics']
680 BphysicsChainParts['sigFolder'] = ['Bphysics']
681 BphysicsChainParts['subSigs'] = ['Bphysics']
682 BphysicsChainParts['topo'] = AllowedTopos_Bphysics
683 
684 # ---- Bphysics Dictionary of default Values ----
685 BphysicsChainParts_Default = deepcopy(MuonChainParts_Default)
686 BphysicsChainParts_Default['signature'] = ['Bphysics']
687 BphysicsChainParts_Default['sigFolder'] = ['Bphysics']
688 BphysicsChainParts_Default['subSigs'] = ['Bphysics']
689 BphysicsChainParts_Default['topo'] = []
690 
691 
692 #==========================================================
693 # Taus
694 #==========================================================
695 AllowedTopos_tau = []
696 
697 # ---- Tau Dictionary of all allowed Values ----
698 TauChainParts = {
699  'signature' : ['Tau'],
700  'alignmentGroup': ['Tau', 'JetMET'],
701  'extra' : [],
702  'L1threshold' : '',
703  'chainPartName' : '',
704  'threshold' : '',
705  'reconstruction': [
706  # BRT calibration (no-tracking)
707  'ptonly',
708 
709  # Standard reconstruction triggers
710  # 2-step FTF (Core + Iso) + PT
711  # Split in different sequences to avoid running unnecesary TauIDs
712  'tracktwoMVA', # GNTau, DeepSet and MesonCuts triggers
713  'tracktwoLLP', # RNNLLP triggers
714 
715  # LRT reconstruction triggers
716  # 1-step FTF (LRT) + PT
717  'trackLRT', # RNNLLP triggers
718  ],
719  'jet' : ['lc', 'pf'], # Only use LCTopo jets for now
720  'preselection' : [],
721  'selection' : [
722  'idperf', # No selection
723  'perf', # NTrk selection
724 
725  # GNTau ID WPs:
726  'verylooseGNTau', 'looseGNTau', 'mediumGNTau', 'tightGNTau',
727 
728  # RNN/DeepSet ID WPs (for tracktwoMVA/LLP/LRT reco with DeepSet/RNNLLP TauIDs):
729  'looseRNN', 'mediumRNN', 'tightRNN',
730 
731  # Meson b-phys triggers (used with tracktwoMVA reco without cutting on the RNN/DeepSet score):
732  'kaonpi1', 'kaonpi2', 'dipion1', 'dipion2', 'dipion3', 'dipion4', 'dikaonmass', 'singlepion',
733  ],
734  'multiplicity' : '',
735  'trigType' : ['tau'],
736  'tnpInfo' : ['probe'],
737  'topo' : AllowedTopos_tau,
738  'sigFolder' : ['Tau'],
739  'subSigs' : ['Tau'],
740  'chainPartIndex': list(range(0,10))
741 }
742 TauChainParts_Default = {
743  'signature' : ['Tau'],
744  'alignmentGroup': ['Tau'],
745  'extra' : '',
746  'L1threshold' : '',
747  'chainPartName' : '',
748  'threshold' : '',
749  'reconstruction': 'tracktwoMVA',
750  'jet' : 'lc',
751  'preselection' : '',
752  'selection' : '',
753  'multiplicity' : '',
754  'trigType' : '',
755  'tnpInfo' : '',
756  'topo' : [],
757  'sigFolder' : ['Tau'],
758  'subSigs' : ['Tau'],
759  'chainPartIndex': 0
760 }
761 
762 
763 #==========================================================
764 # MET
765 #==========================================================
766 AllowedTopos_xe = []
767 # ---- Met Dictionary of all allowed Values ----
768 METChainParts = {
769  'signature' : ['MET'],
770  'alignmentGroup' : ['MET','JetMET'],
771  'L1threshold' : '',
772  'chainPartName' : '',
773  'threshold' : '',
774  'multiplicity' : '',
775  'topo' : AllowedTopos_xe,
776  'trigType' : ['xe'],
777  'extra' : ['noL1'],
778  'calib' : ['lcw','em'],
779  'jetCalib' : JetChainParts['jetCalib'],
780  'L2recoAlg' : [],
781  'EFrecoAlg' : ['cell', 'tc', 'tcpufit', 'mht', 'trkmht', 'pfsum', 'cvfpufit', 'pfopufit', 'mhtpufit', 'nn'],
782  'constitType' : JetChainParts['constitType'],
783  'nSigma' : ["default", "sig30", "sig35", "sig40", "sig45", "sig50", "sig55", "sig60"],
784  'L2muonCorr' : [],
785  'EFmuonCorr' : [],
786  'addInfo' : ['FStracks'],
787  'sigFolder' : ['MET'],
788  'subSigs' : ['MET'],
789  'constitmod' : ['cssk', 'vssk'],
790  'chainPartIndex': list(range(0,10))
791 }
792 # ---- MetDictionary of default Values ----
793 METChainParts_Default = {
794  'signature' : ['MET'],
795  'alignmentGroup' : ['MET'],
796  'L1threshold' : '',
797  'trigType' : '',
798  'threshold' : '',
799  'extra' : '',
800  'calib' : 'lcw',
801  'jetCalib' : JetChainParts_Default['jetCalib'],
802  'nSigma' : "default",
803  'L2recoAlg' : '',
804  'EFrecoAlg' : '',
805  'L2muonCorr' : '',
806  'EFmuonCorr' : '',
807  'addInfo' : '',
808  'constitType' : 'tc',
809  'constitmod' : '',
810  'sigFolder' : ['MET'],
811  'subSigs' : ['MET'],
812  'chainPartIndex': 0
813 }
814 
815 #==========================================================
816 # XS
817 #==========================================================
818 # ---- xs Dictionary of all allowed Values ----
819 XSChainParts = METChainParts
820 XSChainParts['signature'] = ['XS']
821 XSChainParts['trigType'] = ['xs']
822 
823 # ---- xs Dictionary of default Values ----
824 XSChainParts_Default = METChainParts_Default
825 XSChainParts_Default['signature'] = ['XS']
826 XSChainParts_Default['trigType'] = ''
827 
828 #==========================================================
829 # TE
830 #==========================================================
831 # ---- te Dictionary of all allowed Values ----
832 TEChainParts = METChainParts
833 TEChainParts['signature'] = ['TE']
834 TEChainParts['trigType'] = ['te']
835 
836 # ---- te Dictionary of default Values ----
837 TEChainParts_Default = METChainParts_Default
838 TEChainParts_Default['signature'] = ['TE']
839 TEChainParts_Default['trigType'] = ''
840 
841 #==========================================================
842 # Electron Chains
843 #==========================================================
844 AllowedTopos_e = ['Jpsiee','Zeg','Zee','Heg','bBeeM6000']
845 # ---- Electron Dictionary of all allowed Values ----
846 ElectronChainParts = {
847  'signature' : ['Electron'],
848  'alignmentGroup' : ['Electron','Egamma'],
849  'chainPartName' : '',
850  'L1threshold' : '',
851  'tnpInfo' : ['probe'],
852  'extra' : ['ion'],
853  'multiplicity' : '',
854  'trigType' : ['e'],
855  'threshold' : '',
856  'etaRange' : [],
857  'IDinfo' : ['dnnloose','dnnmedium','dnntight','lhvloose','lhloose','lhmedium','lhtight','vloose','loose','medium','tight', 'mergedtight'],
858  'isoInfo' : ['ivarloose','ivarmedium','ivartight'],
859  'idperfInfo' : ['idperf'],
860  'gsfInfo' : ['nogsf'],
861  'lrtInfo' : ['lrtloose','lrtmedium','lrttight','lrtxtight','lrtvxtight'],
862  'caloInfo' : [],
863  'lhInfo' : ['nod0', 'nopix'],
864  'L2IDAlg' : ['noringer'],
865  'addInfo' : [ 'etcut', 'etcut1step',"fwd",'nopid'],
866  'sigFolder' : ['Egamma'],
867  'subSigs' : ['Electron'],
868  'topo' : AllowedTopos_e,
869  'chainPartIndex': list(range(0,10))
870 }
871 
872 # ---- Egamma Dictionary of default Values ----
873 ElectronChainParts_Default = {
874  'signature' : ['Electron'],
875  'alignmentGroup' : ['Electron'],
876  'multiplicity' : '',
877  'L1threshold' : '',
878  'trigType' : '',
879  'threshold' : '',
880  'etaRange' : '0eta250',
881  'tnpInfo' : '',
882  'extra' : '',
883  'IDinfoType' : '',
884  'IDinfo' : '',
885  'isoInfo' : '',
886  'reccalibInfo' : '',
887  'idperfInfo' : '',
888  'gsfInfo' : '',
889  'lrtInfo' : '',
890  'caloInfo' : '',
891  'lhInfo' : '',
892  'L2IDAlg' : '',
893  'hypoInfo' : '',
894  'recoAlg' : '',
895  'FSinfo' : '',
896  'addInfo' : [],
897  'sigFolder' : ['Egamma'],
898  'subSigs' : ['Electron'],
899  'topo' : [],
900  'chainPartIndex': 0
901 }
902 
903 #==========================================================
904 # Photon chains
905 #==========================================================
906 # ---- Photon Dictionary of all allowed Values ----
907 AllowedTopos_g = ['dPhi25', 'm80']
908 PhotonChainParts = {
909  'L1threshold' : '',
910  'signature' : ['Photon'],
911  'alignmentGroup' : ['Photon','Egamma'],
912  'chainPartName' : '',
913  'multiplicity' : '',
914  'trigType' : ['g'],
915  'threshold' : '',
916  'tnpInfo' : ['probe'],
917  'extra' : ['hiptrt', 'ion'],
918  'IDinfo' : ['etcut','loose','medium','tight'],
919  'isoInfo' : ['noiso', 'icaloloose','icalomedium','icalotight'],
920  'reccalibInfo' : [],
921  'trkInfo' : [],
922  'caloInfo' : [],
923  'L2IDAlg' : ['noringer','ringer'],
924  'hypoInfo' : '',
925  'recoAlg' : [],
926  'FSinfo' : [],
927  'addInfo' : ['etcut','nopid'],
928  'sigFolder' : ['Egamma'],
929  'subSigs' : ['Photon'],
930  'topo' : AllowedTopos_g,
931  'chainPartIndex': list(range(0,10)),
932  }
933 
934 # ---- Photon Dictionary of default Values ----
935 PhotonChainParts_Default = {
936  'signature' : ['Photon'],
937  'alignmentGroup' : ['Photon'],
938  'L1threshold' : '',
939  'multiplicity' : '',
940  'trigType' : '',
941  'threshold' : '',
942  'tnpInfo' : '',
943  'extra' : '',
944  'IDinfo' : '',
945  'isoInfo' : '',
946  'reccalibInfo' : '',
947  'trkInfo' : '',
948  'caloInfo' : '',
949  'L2IDAlg' : '',
950  'hypoInfo' : '',
951  'recoAlg' : '',
952  'FSinfo' : '',
953  'addInfo' : [],
954  'sigFolder' : ['Egamma'],
955  'subSigs' : ['Photon'],
956  'topo' : [],
957  'chainPartIndex': 0
958  }
959 
960 #==========================================================
961 # MinBias chains
962 #==========================================================
963 # ---- MinBias Dictionary of all allowed Values ----
964 MinBiasChainParts = {
965  'signature' : ['MinBias'],
966  'alignmentGroup' : ['MinBias'],
967  'L1threshold' : '',
968  'chainPartName' : '',
969  'multiplicity' : '',
970  'trigType' : ['mb'],
971  'threshold' : '',
972  'extra' : ['noisesup', 'vetombts2in', 'vetombts1side2in', 'vetospmbts2in', "vetosp" ,'ion', 'ncb', 'blayer', 'dijet', 'all', 'q2'], #ncb = non collision background, blayer = only sum innermost pix layer
973  'IDinfo' : [],
974  'ZDCinfo' : ['lg', 'hg'],
975  'trkInfo' : ['hlttr', 'ftk', 'costr'],
976  'hypoSPInfo' : ['sp2', 'sp3', 'sp5', 'sp10', 'sp15', 'sp50', 'sp100', 'sp300', 'sp400', 'sp500', 'sp600', 'sp700', 'sp800', 'sp900',
977  'sp1000', 'sp1100', 'sp1200', 'sp1300', 'sp1400', 'sp1500', 'sp1600', 'sp1700', 'sp1800',
978  'sp2000', 'sp2100', 'sp2200', 'sp2300', 'sp2400', 'sp2500', 'sp2700', 'sp2800', 'sp2900', 'sp3000',
979  'sp3100', 'sp3500', 'sp4100', 'sp4500', 'sp4800', 'sp5000', 'sp5200',
980  'vpix15', 'vpix30', 'vpix35', 'vpix40', 'vpix45', 'vpix50', 'vpix55', 'vpix60',
981  'pix20','pix50','pix100', 'pix200', 'pix500', 'pix1000',
982  'nototpix20', 'nototpix30','nototpix50', 'nototpix70', 'nototpix100', 'nototpix200', 'nototpix500'],
983  'pileupInfo' : ['pusup0', 'pusup7', 'pusup10', 'pusup15', 'pusup20', 'pusup30', 'pusup40','pusup50','pusup60', 'pusup70', 'pusup80', 'pusup90', 'pusup100', 'pusup110', 'pusup120', 'pusup130', 'pusup150', 'pusup180', 'pusup190',
984  'pusup200', 'pusup220', 'pusup240', 'pusup250', 'pusup260', 'pusup270', 'pusup280', 'pusup290', 'pusup300'],
985  'hypoTrkInfo' : ['trk3','trk5','trk10','trk15', 'trk20', 'trk25', 'trk30', 'trk35', 'trk40', 'trk45', 'trk50', 'trk55', 'trk60', 'trk65', 'trk70', 'trk75', 'trk80', 'trk90',
986  'trk100', 'trk110', 'trk120', 'trk130', 'trk140', 'trk150', 'trk160', 'trk180', 'trk200', 'trk220', 'trk240', 'trk260', 'trk280', 'trk290',
987  '2trk6', '1trk4', '1trk5', '1trk2', '0trk2'], #ranges for exclusive tracks
988  'hypoPtInfo' : [ 'pt0p2', 'pt0p5', 'pt1', 'pt2', 'pt4', 'pt6', 'pt8', 'pt10' ],
989  'recoAlg' : ['mbts', 'sptrk', 'sp', 'noalg', 'perf', 'hmt', 'hmtperf', 'idperf', 'zdcperf', 'afprec', 'afptof', 'afpdz5', 'afpdz10', 'excl', 'pixsptrk'],
990  'addInfo' : ['peb', 'pc'],
991  'sigFolder' : ['MinBias'],
992  'subSigs' : ['MinBias'],
993  'chainPartIndex': list(range(0,10))
994  }
995 # ---- MinBiasDictionary of default Values ----
996 MinBiasChainParts_Default = {
997  'signature' : ['MinBias'],
998  'alignmentGroup' : ['MinBias'],
999  'L1threshold' : '',
1000  'chainPartName' : '',
1001  'multiplicity' : '',
1002  'trigType' : '',
1003  'threshold' : '',
1004  'extra' : '',
1005  'IDinfo' : '',
1006  'ZDCinfo' : '',
1007  'trkInfo' : '',
1008  'hypoSPInfo' : '',
1009  'pileupInfo' : '',
1010  'hypoTrkInfo' : '',
1011  'hypoPtInfo' : '',
1012  'hypoSumEtInfo': '',
1013  'recoAlg' : [],
1014  'addInfo' : [],
1015  'sigFolder' : ['MinBias'],
1016  'subSigs' : ['MinBias'],
1017  'chainPartIndex': 0
1018  }
1019 
1020 #==========================================================
1021 # HeavyIon chains
1022 #==========================================================
1023 # ---- HeavyIon Dictionary of all allowed Values ----
1024 HeavyIonChainParts = {
1025  'signature' : ['HeavyIon'],
1026  'alignmentGroup' : ['HeavyIon'],
1027  'L1threshold' : '',
1028  'chainPartName' : '',
1029  'multiplicity' : '',
1030  'trigType' : ['hi'],
1031  'threshold' : '',
1032  'extra' : [],
1033  'IDinfo' : [],
1034  'trkInfo' : [],
1035  'eventShape' : [],
1036  'eventShapeVeto' : [],
1037  'hypoL2Info' : [],
1038  'pileupInfo' : [],
1039  'hypoEFInfo' : [],
1040  'hypoEFsumEtInfo': [],
1041  'hypoFgapInfo' : ['FgapAC3', 'FgapAC5', 'FgapAC10', 'FgapA3', 'FgapA5', 'FgapA10', 'FgapC3', 'FgapC5', 'FgapC10'],
1042  'hypoUCCInfo' : ['uccTh1','uccTh2','uccTh3'],
1043  'recoAlg' : [],
1044  'addInfo' : [],
1045  'sigFolder' : ['HeavyIon'],
1046  'subSigs' : ['HeavyIon'],
1047  'chainPartIndex': list(range(0,10))
1048  }
1049 
1050 # ---- HeavyIonDictionary of default Values ----
1051 HeavyIonChainParts_Default = {
1052  'signature' : ['HeavyIon'],
1053  'alignmentGroup' : ['HeavyIon'],
1054  'L1threshold' : '',
1055  'chainPartName' : '',
1056  'multiplicity' : '',
1057  'trigType' : '',
1058  'threshold' : '',
1059  'extra' : '',
1060  'IDinfo' : '',
1061  'trkInfo' : '',
1062  'eventShape' : '',
1063  'eventShapeVeto' : '',
1064  'hypoL2Info' : '',
1065  'pileupInfo' : '',
1066  'hypoEFInfo' : '',
1067  'hypoEFsumEtInfo': '',
1068  'hypoFgapInfo' : [],
1069  'hypoUCCInfo' : [],
1070  'recoAlg' : [],
1071  'addInfo' : [],
1072  'sigFolder' : ['HeavyIon'],
1073  'subSigs' : ['HeavyIon'],
1074  'chainPartIndex': 0
1075  }
1076 
1077 #==========================================================
1078 # ---- CosmicDef chains -----
1079 #==========================================================
1080 AllowedCosmicChainIdentifiers = ['larps','larhec',
1081  'sct', 'id',]
1082 
1083 # ---- Cosmic Chain Dictionary of all allowed Values ----
1084 CosmicChainParts = {
1085  'signature' : ['Cosmic'],
1086  'alignmentGroup' : ['Cosmic'],
1087  'chainPartName' : '',
1088  'L1threshold' : '',
1089  'purpose' : AllowedCosmicChainIdentifiers,
1090  'addInfo' : ['cosmicid','noise', 'beam', 'laser', 'AllTE', 'central', 'ds','CIS'], #'trtd0cut'
1091  'trackingAlg' : ['idscan', 'sitrack', 'trtxk'],
1092  'hits' : ['4hits'],
1093  'threshold' : '',
1094  'multiplicity' : '',
1095  'trigType' : 'cosmic',
1096  'extra' : '',
1097  'sigFolder' : ['CalibCosmicMon'],
1098  'subSigs' : ['Cosmic'],
1099  'chainPartIndex': list(range(0,10))
1100  }
1101 
1102 # ---- Cosmic Chain Default Dictionary of all allowed Values ----
1103 CosmicChainParts_Default = {
1104  'signature' : ['Cosmic'],
1105  'alignmentGroup' : ['Cosmic'],
1106  'chainPartName' : '',
1107  'L1threshold' : '',
1108  'purpose' : [],
1109  'addInfo' : [],
1110  'trackingAlg' : [],
1111  'hits' : [],
1112  'threshold' : '',
1113  'multiplicity' : '',
1114  'trigType' : '',
1115  'extra' : '',
1116  'sigFolder' : ['CalibCosmicMon'],
1117  'subSigs' : ['Cosmic'],
1118  'chainPartIndex': 0
1119  }
1120 
1121 #==========================================================
1122 # ---- StreamingDef chains -----
1123 #==========================================================
1124 AllowedStreamingChainIdentifiers = ['noalg']
1125 
1126 # ---- Streaming Chain Dictionary of all allowed Values ----
1127 StreamingChainParts = {
1128  'signature' : ['Streaming'],
1129  'alignmentGroup' : ['Streaming'],
1130  'chainPartName' : '',
1131  'L1threshold' : '',
1132  'threshold' : '',
1133  'multiplicity' : '',
1134  # No effect on configuration, used in special cases for
1135  # disambiguation or to allow events from the same L1 seed
1136  # to be written to different streams
1137  # New cases should be discussed with Menu Coordinators
1138  'streamingInfo' : ['laser', 'CIS','idmon','mb','l1calo', 'cosmicmuons', 'bkg','vdm', 'zb', 'eb'],
1139  'trigType' : 'streamer',
1140  'extra' : '',
1141  'streamType' : AllowedStreamingChainIdentifiers,
1142  'algo' : ['NoAlg'],
1143  'sigFolder' : ['CalibCosmicMon'],
1144  'subSigs' : ['Streaming'],
1145  'chainPartIndex': list(range(0,10))
1146  }
1147 
1148 # ---- Cosmic Chain Default Dictionary of all allowed Values ----
1149 StreamingChainParts_Default = {
1150  'signature' : ['Streaming'],
1151  'alignmentGroup' : ['Streaming'],
1152  'chainPartName' : '',
1153  'L1threshold' : '',
1154  'threshold' : '',
1155  'multiplicity' : '',
1156  'streamingInfo' : '',
1157  'trigType' : '',
1158  'extra' : '',
1159  'streamType' : '',
1160  'algo' : [],
1161  'sigFolder' : ['CalibCosmicMon'],
1162  'subSigs' : ['Streaming'],
1163  'chainPartIndex': 0
1164  }
1165 
1166 #==========================================================
1167 # ---- CalibDef chains -----
1168 #==========================================================
1169 AllowedCalibChainIdentifiers = ['csccalib', 'larcalib',
1170  'idcalib', 'l1calocalib',
1171  'tilelarcalib',
1172  'larnoiseburst','ibllumi',
1173  'l1satmon', 'zdcpeb',
1174  'calibAFP', 'larpsallem', 'larpsall',
1175  'acceptedevts', 'metcalo', 'mettrk',
1176  ]
1177 
1178 # ---- Calib Chain Dictionary of all allowed Values ----
1179 
1180 
1181 CalibChainParts = {
1182  'signature' : ['Calib'],
1183  'alignmentGroup' : ['Calib'],
1184  'chainPartName' : '',
1185  'L1threshold' : '',
1186  'purpose' : AllowedCalibChainIdentifiers,
1187  'location' : ['central', 'fwd'],
1188  'addInfo' : ['loose','noise','beam'],
1189  'hypo' : ['trk4','trk9', 'trk16', 'trk29', 'conej40', 'conej165', 'conej75_320eta490', 'conej140_320eta490','satu20em'],
1190  'streamingInfo' : ['vdm',],
1191  'threshold' : '',
1192  'multiplicity' : '',
1193  'trigType' : ['trk'],
1194  'extra' : ['bs',''],
1195  'sigFolder' : ['CalibCosmicMon'],
1196  'subSigs' : ['Calib'],
1197  'chainPartIndex': list(range(0,10))
1198  }
1199 
1200 
1201 # ---- Calib Chain Default Dictionary of all allowed Values ----
1202 CalibChainParts_Default = {
1203  'signature' : ['Calib'],
1204  'alignmentGroup' : ['Calib'],
1205  'chainPartName' : '',
1206  'L1threshold' : '',
1207  'purpose' : [],
1208  'addInfo' : [],
1209  'hypo' : '',
1210  # 'hits' : [],
1211  'streamingInfo' : [],
1212  'threshold' : '',
1213  'multiplicity' : '',
1214  'location' : '',
1215  'trigType' : '',
1216  'extra' : '',
1217  'sigFolder' : ['CalibCosmicMon'],
1218  'subSigs' : ['Calib'],
1219  'chainPartIndex': 0
1220  }
1221 
1222 #==========================================================
1223 # ---- MonitorDef chains -----
1224 #==========================================================
1225 AllowedMonitorChainIdentifiers = ['robrequest', 'timeburner',
1226  'idmon','larsupercellmon',
1227  'l1calooverflow', 'l1topoPh1debug',
1228  'mistimemonl1bccorr','mistimemonl1bccorrnomu',
1229  'mistimemoncaltimenomu','mistimemoncaltime',
1230  'mistimemonj400', 'caloclustermon']
1231 
1232 # ---- Monitor Chain Dictionary of all allowed Values ----
1233 MonitorChainParts = {
1234  'signature' : ['Monitor'],
1235  'alignmentGroup' : ['Monitor'],
1236  'chainPartName' : '',
1237  'L1threshold' : '',
1238  'monType' : AllowedMonitorChainIdentifiers,
1239  'hypo' : ['trkFS',],
1240  'threshold' : '',
1241  'multiplicity' : '',
1242  'isLegacyL1' : ['legacy'],
1243  'trigType' : 'mon',
1244  'extra' : '',
1245  'sigFolder' : ['CalibCosmicMon'],
1246  'subSigs' : ['Monitor'],
1247  'chainPartIndex': list(range(0,10))
1248  }
1249 
1250 # ---- Monitor Chain Default Dictionary of all allowed Values ----
1251 MonitorChainParts_Default = {
1252  'signature' : ['Monitor'],
1253  'alignmentGroup' : ['Monitor'],
1254  'chainPartName' : '',
1255  'L1threshold' : '',
1256  'monType' : [],
1257  'hypo' : '',
1258  'threshold' : '',
1259  'multiplicity' : '',
1260  'isLegacyL1' : [],
1261  'trigType' : '',
1262  'extra' : '',
1263  'sigFolder' : ['CalibCosmicMon'],
1264  'subSigs' : ['Monitor'],
1265  'chainPartIndex': 0
1266  }
1267 
1268 #==========================================================
1269 # ---- EB chains -----
1270 #==========================================================
1271 AllowedEBChainIdentifiers = ['eb']
1272 
1273 # ---- Enhanced Bias Chain Dictionary of all allowed Values ----
1274 EnhancedBiasChainParts = {
1275  'signature' : ['EnhancedBias'],
1276  'alignmentGroup' : ['EnhancedBias'],
1277  'chainPartName' : '',
1278  'L1threshold' : '',
1279  'algType' : ['medium','firstempty','empty','unpairediso','unpairednoniso', 'low'],
1280  'threshold' : '',
1281  'multiplicity' : '',
1282  'trigType' : '',
1283  'extra' : '',
1284  'sigFolder' : ['CalibCosmicMon'],
1285  'subSigs' : ['EnhancedBias'],
1286  'chainPartIndex': list(range(0,10))
1287  }
1288 
1289 # ---- EnhancedBias Chain Default Dictionary of all allowed Values ----
1290 EnhancedBiasChainParts_Default = {
1291  'signature' : ['EnhancedBias'],
1292  'alignmentGroup' : ['EnhancedBias'],
1293  'chainPartName' : '',
1294  'L1threshold' : '',
1295  'algType' : 'physics',
1296  'threshold' : '',
1297  'multiplicity' : '',
1298  'trigType' : '',
1299  'extra' : '',
1300  'sigFolder' : ['CalibCosmicMon'],
1301  'subSigs' : ['EnhancedBias'],
1302  'chainPartIndex': 0
1303  }
1304 
1305 #==========================================================
1306 # ---- BeamspotDef chains -----
1307 #==========================================================
1308 AllowedBeamspotChainIdentifiers = ['beamspot',]
1309 BeamspotChainParts = {
1310  'signature' : ['Beamspot'],
1311  'alignmentGroup' : ['Beamspot'],
1312  'chainPartName' : '',
1313  'L1threshold' : '',
1314  'monType' : AllowedBeamspotChainIdentifiers,
1315  'location' : ['vtx'],
1316  'addInfo' : ['trkFS', 'allTE', 'activeTE','idperf'],
1317  'hypo' : [],
1318  'l2IDAlg' : ['trkfast'],
1319  'threshold' : '',
1320  'multiplicity' : '',
1321  'trigType' : 'beamspot',
1322  'extra' : '',
1323  'sigFolder' : ['CalibCosmicMon'],
1324  'subSigs' : ['Beamspot'],
1325  'chainPartIndex': list(range(0,10)),
1326  'beamspotChain' : [],
1327  }
1328 
1329 # ---- Beamspot Chain Default Dictionary of all allowed Values ----
1330 BeamspotChainParts_Default = {
1331  'signature' : ['Beamspot'],
1332  'alignmentGroup' : ['Beamspot'],
1333  'chainPartName' : '',
1334  'L1threshold' : '',
1335  'monType' : [],
1336  'addInfo' : [],
1337  'hypo' : [],
1338  'l2IDAlg' : [],
1339  'threshold' : '',
1340  'multiplicity' : '',
1341  'location' : 'vtx',
1342  'trigType' : '',
1343  'extra' : '',
1344  'sigFolder' : ['CalibCosmicMon'],
1345  'subSigs' : ['Beamspot'],
1346  'chainPartIndex' : 0,
1347  'beamspotChain' : '',
1348  }
1349 
1350 #==========================================================
1351 # Unconventional Tracking
1352 #==========================================================
1353 # ---- Unconventional Tracking Dictionary of all allowed Values ----
1354 UnconventionalTrackingChainParts = {
1355  'signature' : ['UnconventionalTracking'],
1356  'alignmentGroup' : ['UnconventionalTracking'],
1357  'L1threshold' : '',
1358  'chainPartName' : [],
1359  'multiplicity' : '',
1360  'trigType' : ['isotrk', 'fslrt', 'dedxtrk', 'hitdvjet', 'fsvsi', 'distrk', 'dispjet', 'dispvtx'],
1361  'threshold' : '',
1362  'IDinfo' : ['loose','medium','tight','vloose'],
1363  'isoInfo' : ['iaggrmedium','iaggrloose','imedium','iloose'],
1364  'extra' : '',
1365  'addInfo' : ['perf'],
1366  'dispjetConfig' : ['3d2p', '1p', 'x3d1p', '2p'],
1367  'sigFolder' : ['UnconventionalTracking'],
1368  'subSigs' : ['UnconventionalTracking'],
1369  'chainPartIndex': list(range(0,10))
1370 }
1371 # ---- Unconventional Tracking Dictionary of default Values ----
1372 UnconventionalTrackingChainParts_Default = {
1373  'signature' : ['UnconventionalTracking'],
1374  'alignmentGroup' : ['UnconventionalTracking'],
1375  'L1threshold' : '',
1376  'chainPartName' : [],
1377  'multiplicity' : '',
1378  'IDinfo' : '',
1379  'trigType' : '',
1380  'threshold' : '',
1381  'isoInfo' : '',
1382  'extra' : '',
1383  'addInfo' : '',
1384  'dispjetConfig' : '',
1385  'sigFolder' : ['UnconventionalTracking'],
1386  'subSigs' : ['UnconventionalTracking'],
1387  'chainPartIndex': 0
1388 }
1389 
1390 #==========================================================
1391 # Combined Chains
1392 #==========================================================
1393 AllowedTopos_comb = [
1394  'idZmumu','idJpsimumu',
1395  'dRAA12', 'dRAB15', '03dRAB','02dRAB10','03dRAB10','03dRAB30','03dRAB35','dRAD04', 'dRAF04','dRAB03','dRAB04', 'dRAB05', '02dRAB','02dRAC','03dRAC30','03dRAC35','02dRBC','15dRBC45','50invmAB','60invmAB','afpdijet','18dphiAB','18dphiAC','80mTAC','80mTAD',
1396  'anomdet','anomdetL','anomdetM','anomdetT',
1397  '29dphiAA', '29dphiAB', '30dphiAA', '30dphiAB', # g-2 tau triggers
1398  '90invmAB',# TEST
1399  '1invmAB5','50invmAB130','50invmBC130', # Jpsiee, Zee/Zeg
1400  '25dphiAA','25dphiBB','25dphiCC','invmAA80', # Low-mass diphoton
1401  '10invmAA70', # Low-mass dimuon
1402  'invmAB10', '10invmAB70',
1403  '7invmAB9', '11invmAB60', '11invmAB24', '24invmAB60', '7invmAA9', '11invmAA60', '11invmAA24', '24invmAA60',
1404  '20detaAA' # Low mass Drell-Yan
1405  ]
1406 
1407 # ---- Combined Dictionary of all allowed Values ----
1408 CombinedChainParts = deepcopy(PhotonChainParts)
1409 CombinedChainParts['signature'] = ['Photon','Muon']
1410 CombinedChainParts['chainParts'] = ['g','mu'],
1411 CombinedChainParts['topo'] = AllowedTopos_comb
1412 # ---- Combined Dictionary of default Values ----
1413 CombinedChainParts_Default = deepcopy(PhotonChainParts_Default)
1414 CombinedChainParts_Default['signature'] = ['Photon','Muon']
1415 CombinedChainParts_Default['chainParts'] = ['g','mu'],
1416 CombinedChainParts_Default['trigType'] = ''
1417 CombinedChainParts_Default['topo'] = []
1418 
1419 #==========================================================
1420 # ----- Allowed HLT Topo Keywords (also: generic topos like DR, DETA, DPHI...)
1421 #==========================================================
1422 #NOTE: removed jets from list, special case for VBF triggers
1423 AllowedTopos = AllowedTopos_e + AllowedTopos_g + AllowedTopos_mu + AllowedTopos_Bphysics + AllowedTopos_xe + AllowedTopos_tau + AllowedTopos_comb
1424 
1425 #==========================================================
1426 # Obtain signature type
1427 #==========================================================
1429  import re
1430  theMatchingTokens = []
1431  reverseSliceIDDict = { subvalue: key for key, value in SliceIDDict.items() for subvalue in ([value] if not isinstance(value, list) else value) } #reversed SliceIDDict
1432  for sig,token in SliceIDDict.items():
1433  token = token if isinstance(token, list) else [token]
1434  for subtoken in token:
1435  if re.match(r'^\d*'+subtoken+r'\d*\w*$', chainpart):
1436  theMatchingTokens += [subtoken]
1437  if len(theMatchingTokens) > 0:
1438  return reverseSliceIDDict[sorted(theMatchingTokens, key=lambda x: len(x), reverse=True)[0]]
1439  else:
1440  log.error('No signature matching chain part %s was found.', chainpart)
1441 
1442  raise Exception('[getSignatureNameFromToken] Cannot find signature from chain name, exiting.')
1443 
1444  return False
1445 
1446 
1447 #==========================================================
1448 # Signature dictionaries to use
1449 #==========================================================
1451  if signature == 'Electron':
1452  return [ElectronChainParts_Default, ElectronChainParts]
1453  if signature == 'Photon':
1454  return [PhotonChainParts_Default, PhotonChainParts]
1455  if signature == "Jet":
1456  return [JetChainParts_Default, JetChainParts]
1457  if signature == "Bjet":
1458  return [bJetChainParts_Default, JetChainParts]
1459  if signature == "Beamspot_Jet":
1460  return [BeamspotJetChainParts_Default, JetChainParts]
1461  if signature == "Tau":
1462  return [TauChainParts_Default, TauChainParts]
1463  if signature == "Ditau":
1464  return [ditauJetChainParts_Default, JetChainParts]
1465  if (signature == "Muon"):
1466  return [MuonChainParts_Default, MuonChainParts]
1467  if (signature == "Bphysics"):
1468  return [BphysicsChainParts_Default, BphysicsChainParts]
1469  if (signature == "Combined"):
1470  return [CombinedChainParts_Default, CombinedChainParts]
1471  if signature == "MET":
1472  return [METChainParts_Default, METChainParts]
1473  if signature == "XS":
1474  return [XSChainParts_Default, XSChainParts]
1475  if signature == "TE":
1476  return [TEChainParts_Default, TEChainParts]
1477  if signature == "MinBias":
1478  return [MinBiasChainParts_Default, MinBiasChainParts]
1479  if signature == "HeavyIon":
1480  return [HeavyIonChainParts_Default, HeavyIonChainParts]
1481  if signature == "Cosmic":
1482  return [CosmicChainParts_Default, CosmicChainParts]
1483  if signature == "Calib":
1484  return [CalibChainParts_Default, CalibChainParts]
1485  if signature == "Streaming":
1486  return [StreamingChainParts_Default, StreamingChainParts]
1487  if signature == "Monitor":
1488  return [MonitorChainParts_Default, MonitorChainParts]
1489  if signature == "Beamspot":
1490  return [BeamspotChainParts_Default, BeamspotChainParts]
1491  if signature == "EnhancedBias":
1492  return [EnhancedBiasChainParts_Default, EnhancedBiasChainParts]
1493  if signature == "UnconventionalTracking":
1494  return [UnconventionalTrackingChainParts_Default, UnconventionalTrackingChainParts]
1495  if signature == "Test":
1496  return [TestChainParts_Default, TestChainParts]
1497  else:
1498  raise RuntimeError("ERROR Cannot find corresponding dictionary for signature", signature)
1499 
1500 #==========================================================
1501 # Analysis the base pattern: <mult><signatureType><threshold><extraInfo>
1502 #==========================================================
1504  import re
1505  allTrigTypes = []
1506  for v in SliceIDDict.values():
1507  if isinstance(v, list):
1508  allTrigTypes += v
1509  else:
1510  allTrigTypes.append(v)
1511 
1512  possibleTT = '|'.join(allTrigTypes)
1513  pattern = re.compile(r"(?P<multiplicity>\d*)(?P<trigType>(%s))(?P<threshold>\d+)(?P<extra>\w*)" % (possibleTT))
1514  return pattern
DerivationFramework::TriggerMatchingUtils::sorted
std::vector< typename R::value_type > sorted(const R &r, PROJ proj={})
Helper function to create a sorted vector from an unsorted range.
python.HLT.Menu.SignatureDicts.getSignatureDict
def getSignatureDict()
Definition: SignatureDicts.py:46
python.HLT.Menu.SignatureDicts.getListOfSignatures
def getListOfSignatures()
Definition: SignatureDicts.py:65
python.HLT.Menu.SignatureDicts.ChainStore.__init__
def __init__(self)
Definition: SignatureDicts.py:78
python.HLT.Menu.SignatureDicts.getBasePattern
def getBasePattern()
Definition: SignatureDicts.py:1503
python.HLT.Menu.SignatureDicts.ChainStore._allowedSignatures
_allowedSignatures
Definition: SignatureDicts.py:73
python.HLT.Menu.SignatureDicts.ChainStore
Definition: SignatureDicts.py:71
python.HLT.Menu.SignatureDicts.getListOfSignatureStrings
def getListOfSignatureStrings()
Definition: SignatureDicts.py:58
plotBeamSpotVxVal.range
range
Definition: plotBeamSpotVxVal.py:194
histSizes.list
def list(name, path='/')
Definition: histSizes.py:38
python.HLT.Menu.SignatureDicts.getSignatureGroupingDict
def getSignatureGroupingDict()
Definition: SignatureDicts.py:53
python.HLT.Menu.SignatureDicts.getSignatureNameFromToken
def getSignatureNameFromToken(chainpart)
Definition: SignatureDicts.py:1428
TCS::join
std::string join(const std::vector< std::string > &v, const char c=',')
Definition: Trigger/TrigT1/L1Topo/L1TopoCommon/Root/StringUtils.cxx:10
python.HLT.Menu.SignatureDicts.getSignatureInformation
def getSignatureInformation(signature)
Definition: SignatureDicts.py:1450
python.HLT.Menu.SignatureDicts.ChainStore.__setitem__
def __setitem__(self, key, value)
Definition: SignatureDicts.py:82