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