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