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