Loading [MathJax]/extensions/tex2jax.js
ATLAS Offline Software
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
EventSelectionConfig.py
Go to the documentation of this file.
1 # Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
2 
3 from AnalysisAlgorithmsConfig.ConfigBlock import ConfigBlock
4 from AsgAnalysisAlgorithms.AsgAnalysisConfig import makeEventCutFlowConfig
5 from AnalysisAlgorithmsConfig.ConfigAccumulator import DataType
6 
7 
8 class EventSelectionMergerConfig(ConfigBlock):
9  """ConfigBlock for merging the output of various selection streams"""
10 
11  def __init__(self):
12  super(EventSelectionMergerConfig, self).__init__()
13  self.addOption('selections', [], type=list,
14  info="the selection decisions (list of strings) to unify into a "
15  "final decision (internally: selection_1 || selection_2 || ...). "
16  "The default is [] (empty list).")
17  self.addOption('noFilter', False, type=bool,
18  info="do not apply an event filter. The default is False, i.e. "
19  "remove events not passing the full list of selection cuts.")
20 
21  def makeAlgs(self, config):
22  if not ( isinstance(self.selections, list) and self.selections and all(isinstance(item, str) for item in self.selections) ):
23  print('EventSelectionMerger: selections = ', self.selections)
24  raise ValueError('EventSelectionMerger requires a non-empty list of selection strings to be '
25  'passed as `selections`!')
26  alg = config.createAlgorithm('CP::SaveFilterAlg', 'EventSelectionMerger' + self.selections[0].split("_%SYS%")[0])
27  alg.FilterDescription = 'events passing at least one EventSelection algorithm'
28  alg.eventDecisionOutputDecoration = 'ignore_anySelection_%SYS%'
29  alg.selection = '||'.join([sel+',as_char' for sel in self.selections if sel])
30  alg.noFilter = self.noFilter
31  alg.selectionName = 'pass_anySelection_%SYS%'
32  alg.decorationName = 'ntuplepass_anySelection_%SYS%'
33 
34 class EventSelectionConfig(ConfigBlock):
35  """ConfigBlock for interpreting text-based event selections"""
36 
37  def __init__(self, name=''):
38  super(EventSelectionConfig, self).__init__()
39  self.addOption('name', name, type=str,
40  noneAction='error',
41  info="the name of the event selection, used to uniquely identify "
42  "the EventSelectionConfig block.")
43  self.addOption('electrons', "", type=str,
44  info="the input electron container, with a possible selection, in "
45  "the format container or container.selection. The default is '' "
46  "(empty string).")
47  self.addOption('muons', "", type=str,
48  info="the input muon container, with a possible selection, in the "
49  "format container or container.selection. The default is '' "
50  "(empty string).")
51  self.addOption('jets', "", type=str,
52  info="the input jet container, with a possible selection, in the "
53  "format container or container.selection. The default is '' "
54  "(empty string).")
55  self.addOption('largeRjets', "", type=str,
56  info="the large-R jet container, with a possible selection, in "
57  "the format container or container.selection. The default is '' "
58  "(empty string).")
59  self.addOption('photons', "", type=str,
60  info="the input photon container, with a possible selection, in "
61  "the format container or container.selection. The default is '' "
62  "(empty string).")
63  self.addOption('taus', "", type=str,
64  info="the input tau-jet container, with a possible selection, in "
65  "the format container or container.selection. The default is '' "
66  "(empty string).")
67  self.addOption('met', "", type=str,
68  info="he input MET container. The default is '' (empty string).")
69  #TODO: add info string
70  self.addOption('metTerm', "Final", type=str,
71  info="")
72  self.addOption('btagDecoration', "", type=str,
73  info="the b-tagging decoration to use when defining b-jets. "
74  "The default is '' (empty string).")
75  self.addOption('preselection', "", type=str,
76  info="the event-wise selection flag to start this event selection "
77  "from. The default is '' (empty string).")
78  self.addOption('selectionCuts', "", type=str,
79  noneAction='error',
80  info="a single string listing one selection cut per line.")
81  self.addOption('noFilter', False, type=bool,
82  info="do not apply an event filter. The default is False, i.e. "
83  "remove events not passing the full list of selection cuts.")
84  self.addOption('debugMode', False, type=bool,
85  info="whether to create an output branch for every single line "
86  "of the selection cuts. The default is False (only saves the"
87  " final decision).")
88  self.addOption('useDressedProperties', True, type=bool,
89  info="whether to use dressed truth electron and truth muon "
90  "kinematics rather than simple P4 kinematics.")
91  self.step = 0
93  self.cutflow = []
94  self.name = name
95 
96  def makeAlgs(self, config):
97  # need to re-initialize here to deal with multiple passes
98  self.step = 0
99  # initialize the pre-selection
100  self.currentDecoration = self.preselection
101  # re-initialize the cutflow
102  self.cutflow = []
103  # read the selection cuts
104  if self.selectionCuts is None:
105  raise ValueError ("[EventSelectionConfig] You must provide the 'selectionCuts' option to 'EventSelectionConfig': "
106  "a single string where each line represents a different selection cut to apply in order.")
107  for line in self.selectionCuts.split("\n"):
108  self.interpret(line, config)
109  config.addEventCutFlow(self.name, self.getCutflow())
110 
111  def interpret(self, text, cfg):
112  text = text.strip()
113  if not text:
114  return
115  if text.startswith("#"):
116  return
117  self.step += 1
118  if "EL_N" in text.split():
119  self.add_NEL_selector(text, cfg)
120  elif "MU_N" in text.split():
121  self.add_NMU_selector(text, cfg)
122  elif "SUM_EL_N_MU_N" in text.split():
123  self.add_SUMNELNMU_selector(text, cfg)
124  elif "SUM_EL_N_MU_N_TAU_N" in text.split():
125  self.add_SUMNLEPTONS_selector(text, cfg)
126  elif "JET_N_GHOST" in text.split():
127  self.add_NJETGHOST_selector(text, cfg)
128  elif "JET_N" in text.split():
129  self.add_NJET_selector(text, cfg)
130  elif "JET_N_BTAG" in text.split():
131  self.add_NBJET_selector(text, cfg)
132  elif "PH_N" in text.split():
133  self.add_NPH_selector(text, cfg)
134  elif "TAU_N" in text.split():
135  self.add_NTAU_selector(text, cfg)
136  elif "LJET_N_GHOST" in text.split():
137  self.add_NLJETGHOST_selector(text, cfg)
138  elif "LJET_N" in text.split():
139  self.add_NLJET_selector(text, cfg)
140  elif "OBJ_N" in text.split():
141  self.add_NOBJ_selector(text, cfg)
142  elif "MET" in text.split():
143  self.add_MET_selector(text, cfg)
144  elif "MWT" in text.split():
145  self.add_MWT_selector(text, cfg)
146  elif "MET+MWT" in text.split():
147  self.add_METMWT_selector(text, cfg)
148  elif "MLL" in text.split():
149  self.add_MLL_selector(text, cfg)
150  elif "MLLWINDOW" in text.split():
151  self.add_MLLWINDOW_selector(text, cfg)
152  elif "OS" in text.split():
153  self.add_OS_selector(text, cfg)
154  elif "SS" in text.split():
155  self.add_SS_selector(text, cfg)
156  elif "MLL_OSSF" in text.split():
157  self.add_MLL_OSSF_selector(text, cfg)
158  elif "LJETMASS_N" in text.split():
159  self.add_NLJETMASS_selector(text, cfg)
160  elif "LJETMASSWINDOW_N" in text.split():
161  self.add_NLJETMASSWINDOW_selector(text, cfg)
162  elif "SAVE" in text.split():
163  self.add_SAVE(text, cfg)
164  elif "IMPORT" in text.split():
165  self.add_IMPORT(text, cfg)
166  elif "EVENTFLAG" in text.split():
167  self.add_EVENTFLAG(text, cfg)
168  elif "GLOBALTRIGMATCH" in text.split():
169  self.add_GLOBALTRIGMATCH(text, cfg)
170  elif "RUN_NUMBER" in text.split():
171  self.add_RUNNUMBER(text, cfg)
172  else:
173  raise ValueError (f"[EventSelectionConfig] The following selection cut is not recognised! --> {text}")
174 
175  def raise_misconfig(self, text, keyword):
176  raise ValueError (f"[EventSelectionConfig] Misconfiguration! Check {keyword} in: {text}")
177 
178  def raise_missinginput(self, collection):
179  raise ValueError (f"[EventSelectionConfig] Misconfiguration! Missing input collection for {collection}")
180 
181  def check_float(self, test, requirePositive=True):
182  try:
183  value = float(test)
184  if not requirePositive or value >= 0:
185  return value
186  else:
187  raise ValueError (f"[EventSelectionConfig] Misconfiguration! Float {test} is not positive!")
188  except ValueError:
189  raise ValueError (f"[EventSelectionConfig] Misconfiguration! {test} should be a float, not {type(test)}!")
190 
191  def check_int(self, test, requirePositive=True):
192  try:
193  value = int(test)
194  if value == float(test):
195  if not requirePositive or value >= 0:
196  return value
197  else:
198  raise ValueError (f"[EventSelectionConfig] Misconfiguration! Int {test} us not positive!")
199  else:
200  raise ValueError (f"[EventSelectionConfig] Misconfiguration! {test} should be an int, not a float!")
201  except ValueError:
202  raise ValueError (f"[EventSelectionConfig] Misconfiguration! {test} should be an int, not {type(test)}")
203 
204  def check_string(self, test):
205  if not isinstance(test, str):
206  raise ValueError (f"[EventSelectionConfig] Misconfiguration! {test} should be a string, not a number!")
207  else:
208  return test
209 
210  def check_sign(self, test):
211  mapping = {
212  "<" : "LT",
213  ">" : "GT",
214  "==": "EQ",
215  ">=": "GE",
216  "<=": "LE"
217  }
218  try:
219  return mapping[test]
220  except KeyError:
221  raise KeyError (f"[EventSelectionConfig] Misconfiguration! {test} should be one of {list(mapping.keys())}")
222 
223  def check_btagging(self, test):
224  test = test.split(":")
225  if len(test) != 2:
226  raise ValueError (f"[EventSelectionConfig] Misconfiguration! {test} should be provided as 'btagger:btagWP'")
227  else:
228  return test
229 
230  def check_ghosts(self, test):
231  test = self.check_string(test)
232  values = test.split("!")
233  ghost_map = {
234  "B": "GhostBHadronsFinalCount",
235  "C": "GhostCHadronsFinalCount",
236  "T": "GhostTQuarksFinalCount",
237  "W": "GhostWBosonsCount",
238  "Z": "GhostZBosonsCount",
239  "H": "GhostHBosonsCount",
240  "TAU": "GhostTausFinalCount"
241  }
242  return [ghost_map.get(value.upper(), value) for value in values]
243 
244  def getCutflow(self):
245  return self.cutflow
246 
247  def setDecorationName(self, algorithm, config, decoration):
248  self.cutflow.append( decoration )
249  if algorithm is not None:
250  algorithm.decorationName = f'{decoration},as_char'
251  self.currentDecoration = decoration
252  if self.debugMode:
253  config.addOutputVar('EventInfo', decoration, decoration.split("_%SYS%")[0])
254  else:
255  if self.currentDecoration:
256  self.currentDecoration += '&&' + decoration
257  else:
258  self.currentDecoration = decoration
259  config.addSelection('EventInfo', '', decoration)
260  return
261 
262  def checkDecorationName(self, decoration):
263  if decoration == '':
264  return decoration
265  decoration = decoration.split("&&")
266  decoration = [sub + ',as_char' if ',as_char' not in sub else sub for sub in decoration]
267  return '&&'.join(decoration)
268 
269  def add_IMPORT(self, text, config):
270  # this is used to import a previous selection
271  items = text.split()
272  if items[0] != "IMPORT":
273  self.raise_misconfig(text, "IMPORT")
274  if len(items) != 2:
275  self.raise_misconfig(text, "number of arguments")
276  region = self.check_string(items[1])
277  if not self.currentDecoration:
278  self.currentDecoration = f'pass_{region}_%SYS%,as_char'
279  else:
280  self.currentDecoration = f'{self.currentDecoration},as_char&&pass_{region}_%SYS%'
281  # for the cutflow, we need to retrieve all the cuts corresponding to this IMPORT
282  imported_cuts = [cut for cut in config.getSelectionCutFlow('EventInfo', '') if cut.startswith(region)]
283  self.cutflow += imported_cuts
284  return
285 
286  def add_NEL_selector(self, text, config):
287  items = text.split()
288  if items[0] != "EL_N":
289  self.raise_misconfig(text, "EL_N")
290  if len(items) != 4 and len(items) != 5:
291  self.raise_misconfig(text, "number of arguments")
292  if not self.electrons:
293  self.raise_missinginput("electrons")
294  thisalg = f'{self.name}_NEL_{self.step}'
295  alg = config.createAlgorithm('CP::NObjectPtSelectorAlg', thisalg)
296  alg.particles, alg.objectSelection = config.readNameAndSelection(self.electrons)
297  if "Truth" in self.electrons:
298  alg.useDressedProperties = self.useDressedProperties
299  alg.eventPreselection = self.checkDecorationName(self.currentDecoration)
300  if len(items) == 4:
301  alg.minPt = self.check_float(items[1])
302  alg.sign = self.check_sign(items[2])
303  alg.count = self.check_int(items[3])
304  elif len(items) == 5:
305  extraSel = self.check_string(items[1])
306  if alg.objectSelection:
307  alg.objectSelection += "&&" + config.getFullSelection(self.electrons.split(".")[0], extraSel)
308  else:
309  alg.objectSelection = config.getFullSelection(self.electrons.split(".")[0], extraSel)
310  alg.minPt = self.check_float(items[2])
311  alg.sign = self.check_sign(items[3])
312  alg.count = self.check_int(items[4])
313  self.setDecorationName(alg, config, f'{thisalg}_%SYS%')
314  return
315 
316  def add_NMU_selector(self, text, config):
317  items = text.split()
318  if items[0] != "MU_N":
319  self.raise_misconfig(text, "MU_N")
320  if len(items) != 4 and len(items) != 5:
321  self.raise_misconfig(text, "number of arguments")
322  if not self.muons:
323  self.raise_missinginput("muons")
324  thisalg = f'{self.name}_NMU_{self.step}'
325  alg = config.createAlgorithm('CP::NObjectPtSelectorAlg', thisalg)
326  alg.particles, alg.objectSelection = config.readNameAndSelection(self.muons)
327  if "Truth" in self.muons:
328  alg.useDressedProperties = self.useDressedProperties
329  alg.eventPreselection = self.checkDecorationName(self.currentDecoration)
330  if len(items) == 4:
331  alg.minPt = self.check_float(items[1])
332  alg.sign = self.check_sign(items[2])
333  alg.count = self.check_int(items[3])
334  elif len(items) == 5:
335  extraSel = self.check_string(items[1])
336  if alg.objectSelection:
337  alg.objectSelection += "&&" + config.getFullSelection(self.muons.split(".")[0], extraSel)
338  else:
339  alg.objectSelection = config.getFullSelection(self.muons.split(".")[0], extraSel)
340  alg.minPt = self.check_float(items[2])
341  alg.sign = self.check_sign(items[3])
342  alg.count = self.check_int(items[4])
343  self.setDecorationName(alg, config, f'{thisalg}_%SYS%')
344  return
345 
346  def add_SUMNELNMU_selector(self, text, config):
347  items = text.split()
348  if items[0] != "SUM_EL_N_MU_N":
349  self.raise_misconfig(text, "SUM_EL_N_MU_N")
350  if len(items) != 4 and len(items) != 5:
351  self.raise_misconfig(text, "number of arguments")
352  if not self.electrons and not self.muons:
353  self.raise_missinginput("electrons or muons")
354  thisalg = f'{self.name}_SUMNELNMU_{self.step}'
355  alg = config.createAlgorithm('CP::SumNLeptonPtSelectorAlg', thisalg)
356  alg.electrons, alg.electronSelection = config.readNameAndSelection(self.electrons)
357  alg.muons, alg.muonSelection = config.readNameAndSelection(self.muons)
358  if "Truth" in self.electrons:
359  alg.useDressedProperties = self.useDressedProperties
360  alg.eventPreselection = self.checkDecorationName(self.currentDecoration)
361  if len(items) == 4:
362  alg.minPtEl = self.check_float(items[1])
363  alg.minPtMu = self.check_float(items[1])
364  alg.sign = self.check_sign(items[2])
365  alg.count = self.check_int(items[3])
366  elif len(items) == 5:
367  alg.minPtEl = self.check_float(items[1])
368  alg.minPtMu = self.check_float(items[2])
369  alg.sign = self.check_sign(items[3])
370  alg.count = self.check_int(items[4])
371  self.setDecorationName(alg, config, f'{thisalg}_%SYS%')
372  return
373 
374  def add_SUMNLEPTONS_selector(self, text, config):
375  items = text.split()
376  if items[0] != "SUM_EL_N_MU_N_TAU_N":
377  self.raise_misconfig(text, "SUM_EL_N_MU_N_TAU_N")
378  if len(items) != 4 and len(items) != 6:
379  self.raise_misconfig(text, "number of arguments")
380  if not self.electrons and not self.muons and not self.taus:
381  self.raise_missinginput("electrons, muons or taus")
382  thisalg = f'{self.name}_SUMNLEPTONS_{self.step}'
383  alg = config.createAlgorithm('CP::SumNLeptonPtSelectorAlg', thisalg)
384  alg.electrons, alg.electronSelection = config.readNameAndSelection(self.electrons)
385  alg.muons, alg.muonSelection = config.readNameAndSelection(self.muons)
386  alg.taus, alg.tauSelection = config.readNameAndSelection(self.taus)
387  if "Truth" in self.electrons:
388  alg.useDressedProperties = self.useDressedProperties
389  alg.eventPreselection = self.checkDecorationName(self.currentDecoration)
390  if len(items) == 4:
391  alg.minPtEl = self.check_float(items[1])
392  alg.minPtMu = self.check_float(items[1])
393  alg.minPtTau = self.check_float(items[1])
394  alg.sign = self.check_sign(items[2])
395  alg.count = self.check_int(items[3])
396  elif len(items) == 6:
397  alg.minPtEl = self.check_float(items[1])
398  alg.minPtMu = self.check_float(items[2])
399  alg.minPtTau = self.check_float(items[3])
400  alg.sign = self.check_sign(items[4])
401  alg.count = self.check_int(items[5])
402  self.setDecorationName(alg, config, f'{thisalg}_%SYS%')
403  return
404 
405  def add_NJET_selector(self, text, config):
406  items = text.split()
407  if items[0] != "JET_N":
408  self.raise_misconfig(text, "JET_N")
409  if len(items) != 4 and len(items) != 5:
410  self.raise_misconfig(text, "number of arguments")
411  if not self.jets:
412  self.raise_missinginput("jets")
413  thisalg = f'{self.name}_NJET_{self.step}'
414  alg = config.createAlgorithm('CP::NObjectPtSelectorAlg', thisalg)
415  alg.particles, alg.objectSelection = config.readNameAndSelection(self.jets)
416  alg.eventPreselection = self.checkDecorationName(self.currentDecoration)
417  if len(items) == 4:
418  alg.minPt = self.check_float(items[1])
419  alg.sign = self.check_sign(items[2])
420  alg.count = self.check_int(items[3])
421  elif len(items) == 5:
422  extraSel = self.check_string(items[1])
423  if alg.objectSelection:
424  alg.objectSelection += "&&" + config.getFullSelection(self.jets.split(".")[0], extraSel)
425  else:
426  alg.objectSelection = config.getFullSelection(self.jets.split(".")[0], extraSel)
427  alg.minPt = self.check_float(items[2])
428  alg.sign = self.check_sign(items[3])
429  alg.count = self.check_int(items[4])
430  self.setDecorationName(alg, config, f'{thisalg}_%SYS%')
431  return
432 
433  def add_NBJET_selector(self, text, config):
434  items = text.split()
435  if items[0] != "JET_N_BTAG":
436  self.raise_misconfig(text, "JET_N_BTAG")
437  if len(items) != 3 and len(items) != 4 and len(items) != 5:
438  self.raise_misconfig(text, "number of arguments")
439  if not self.jets:
440  self.raise_missinginput("jets")
441  thisalg = f'{self.name}_NBJET_{self.step}'
442  alg = config.createAlgorithm('CP::NObjectPtSelectorAlg', thisalg)
443  particles, selection = config.readNameAndSelection(self.jets)
444  alg.particles = particles
445  alg.objectSelection = f'{selection}&&{self.btagDecoration},as_char' if selection else f'{self.btagDecoration},as_char'
446  alg.eventPreselection = self.checkDecorationName(self.currentDecoration)
447  if len(items) == 3:
448  alg.sign = self.check_sign(items[1])
449  alg.count = self.check_int(items[2])
450  elif len(items) == 4:
451  if ":" in text:
452  btagger, btagWP = self.check_btagging(items[1])
453  customBtag = f'ftag_select_{btagger}_{btagWP}'
454  alg.objectSelection = f'{selection}&&{customBtag},as_char' if selection else f'{customBtag},as_char'
455  else:
456  extraSel = self.check_string(items[1])
457  alg.objectSelection += "&&" + config.getFullSelection(self.jets.split(".")[0], extraSel)
458  alg.sign = self.check_sign(items[2])
459  alg.count = self.check_int(items[3])
460  elif len(items) == 5:
461  extraSel = self.check_string(items[1])
462  btagger, btagWP = self.check_btagging(items[2])
463  customBtag = f'ftag_select_{btagger}_{btagWP}'
464  alg.objectSelection = f'{selection}&&{customBtag},as_char' if selection else f'{customBtag},as_char'
465  alg.objectSelection+= "&&" + config.getFullSelection(self.jets.split(".")[0], extraSel)
466  alg.sign = self.check_sign(items[3])
467  alg.count = self.check_int(items[4])
468  self.setDecorationName(alg, config, f'{thisalg}_%SYS%')
469  return
470 
471  def add_NPH_selector(self, text, config):
472  items = text.split()
473  if items[0] != "PH_N":
474  self.raise_misconfig(text, "PH_N")
475  if len(items) != 4 and len(items) != 5:
476  self.raise_misconfig(text, "number of arguments")
477  if not self.photons:
478  self.raise_missinginput("photons")
479  thisalg = f'{self.name}_NPH_{self.step}'
480  alg = config.createAlgorithm('CP::NObjectPtSelectorAlg', thisalg)
481  alg.particles, alg.objectSelection = config.readNameAndSelection(self.photons)
482  alg.eventPreselection = self.checkDecorationName(self.currentDecoration)
483  if len(items) == 4:
484  alg.minPt = self.check_float(items[1])
485  alg.sign = self.check_sign(items[2])
486  alg.count = self.check_int(items[3])
487  elif len(items) == 5:
488  extraSel = self.check_string(items[1])
489  if alg.objectSelection:
490  alg.objectSelection += "&&" + config.getFullSelection(self.photons.split(".")[0], extraSel)
491  else:
492  alg.objectSelection = config.getFullSelection(self.photons.split(".")[0], extraSel)
493  alg.minPt = self.check_float(items[2])
494  alg.sign = self.check_sign(items[3])
495  alg.count = self.check_int(items[4])
496  self.setDecorationName(alg, config, f'{thisalg}_%SYS%')
497  return
498 
499  def add_NTAU_selector(self, text, config):
500  items = text.split()
501  if items[0] != "TAU_N":
502  self.raise_misconfig(text, "TAU_N")
503  if len(items) != 4 and len(items) != 5:
504  self.raise_misconfig(text, "number of arguments")
505  if not self.taus:
506  self.raise_missinginput("taus")
507  thisalg = f'{self.name}_NTAU_{self.step}'
508  alg = config.createAlgorithm('CP::NObjectPtSelectorAlg', thisalg)
509  alg.particles, alg.objectSelection = config.readNameAndSelection(self.taus)
510  alg.eventPreselection = self.checkDecorationName(self.currentDecoration)
511  if len(items) == 4:
512  alg.minPt = self.check_float(items[1])
513  alg.sign = self.check_sign(items[2])
514  alg.count = self.check_int(items[3])
515  elif len(items) == 5:
516  extraSel = self.check_string(items[1])
517  if alg.objectSelection:
518  alg.objectSelection += "&&" + config.getFullSelection(self.taus.split(".")[0], extraSel)
519  else:
520  alg.objectSelection = config.getFullSelection(self.taus.split(".")[0], extraSel)
521  alg.minPt = self.check_float(items[2])
522  alg.sign = self.check_sign(items[3])
523  alg.count = self.check_int(items[4])
524  self.setDecorationName(alg, config, f'{thisalg}_%SYS%')
525  return
526 
527  def add_NLJET_selector(self, text, config):
528  items = text.split()
529  if items[0] != "LJET_N":
530  self.raise_misconfig(text, "LJET_N")
531  if len(items) != 4 and len(items) != 5:
532  self.raise_misconfig(text, "number of arguments")
533  thisalg = f'{self.name}_NLJET_{self.step}'
534  alg = config.createAlgorithm('CP::NObjectPtSelectorAlg', thisalg)
535  alg.particles, alg.objectSelection = config.readNameAndSelection(self.largeRjets)
536  alg.eventPreselection = self.checkDecorationName(self.currentDecoration)
537  if len(items) == 4:
538  alg.minPt = self.check_float(items[1])
539  alg.sign = self.check_sign(items[2])
540  alg.count = self.check_int(items[3])
541  elif len(items) == 5:
542  extraSel = self.check_string(items[1])
543  if alg.objectSelection:
544  alg.objectSelection += "&&" + config.getFullSelection(self.largeRjets.split(".")[0], extraSel)
545  else:
546  alg.objectSelection = config.getFullSelection(self.largeRjets.split(".")[0], extraSel)
547  alg.minPt = self.check_float(items[2])
548  alg.sign = self.check_sign(items[3])
549  alg.count = self.check_int(items[4])
550  self.setDecorationName(alg, config, f'{thisalg}_%SYS%')
551  return
552 
553  def add_NLJETMASS_selector(self, text, config):
554  items = text.split()
555  if items[0] != "LJETMASS_N":
556  self.raise_misconfig(text, "LJETMASS_N")
557  if len(items) != 4 and len(items) != 5:
558  self.raise_misconfig(text, "number of arguments")
559  thisalg = f'{self.name}_NLJETMASS_{self.step}'
560  alg = config.createAlgorithm('CP::NObjectMassSelectorAlg', thisalg)
561  alg.particles, alg.objectSelection = config.readNameAndSelection(self.largeRjets)
562  alg.eventPreselection = self.checkDecorationName(self.currentDecoration)
563  if len(items) == 4:
564  alg.minMass = self.check_float(items[1])
565  alg.sign = self.check_sign(items[2])
566  alg.count = self.check_int(items[3])
567  elif len(items) == 5:
568  extraSel = self.check_string(items[1])
569  if alg.objectSelection:
570  alg.objectSelection += "&&" + config.getFullSelection(self.largeRjets.split(".")[0], extraSel)
571  else:
572  alg.objectSelection = config.getFullSelection(self.largeRjets.split(".")[0], extraSel)
573  alg.minMass = self.check_float(items[2])
574  alg.sign = self.check_sign(items[3])
575  alg.count = self.check_int(items[4])
576  self.setDecorationName(alg, config, f'{thisalg}_%SYS%')
577  return
578 
579  def add_NLJETMASSWINDOW_selector(self, text, config):
580  items = text.split()
581  if items[0] != "LJETMASSWINDOW_N":
582  self.raise_misconfig(text, "LJETMASSWINDOW_N")
583  if len(items) != 5 and len(items) != 6 and len(items) != 7:
584  self.raise_misconfig(text, "number of arguments")
585  thisalg = f'{self.name}_NLJETMASSWINDOW_{self.step}'
586  alg = config.createAlgorithm('CP::NLargeRJetMassWindowSelectorAlg', thisalg)
587  alg.ljets, alg.ljetSelection = config.readNameAndSelection(self.largeRjets)
588  vetoMode = items[-1] == 'veto' or items[-1] == 'VETO'
589  if len(items) == 5 or (len(items) == 6 and vetoMode):
590  alg.lowMass = self.check_float(items[1])
591  alg.highMass = self.check_float(items[2])
592  alg.sign = self.check_sign(items[3])
593  alg.count = self.check_int(items[4])
594  alg.vetoMode = vetoMode
595  elif (len(items) == 6 and not vetoMode) or len(items) == 7:
596  extraSel = self.check_string(items[1])
597  if alg.ljetSelection:
598  alg.ljetSelection += "&&" + config.getFullSelection(self.largeRjets.split(".")[0], extraSel)
599  else:
600  alg.ljetSelection = config.getFullSelection(self.largeRjets.split(".")[0], extraSel)
601  alg.lowMass = self.check_float(items[2])
602  alg.highMass = self.check_float(items[3])
603  alg.sign = self.check_sign(items[4])
604  alg.count = self.check_int(items[5])
605  alg.vetoMode = vetoMode
606  alg.eventPreselection = self.checkDecorationName(self.currentDecoration)
607  self.setDecorationName(alg, config, f'{thisalg}_%SYS%')
608  return
609 
610  def add_NJETGHOST_selector(self, text, config):
611  items = text.split()
612  if items[0] != "JET_N_GHOST":
613  self.raise_misconfig(text, "JET_N_GHOST")
614  if len(items) != 4 and len(items) != 5:
615  self.raise_misconfig(text, "number of arguments")
616  thisalg = f'{self.name}_NJETGHOST_{self.step}'
617  alg = config.createAlgorithm('CP::JetNGhostSelectorAlg', thisalg)
618  alg.jets, alg.jetSelection = config.readNameAndSelection(self.jets)
619  ghosts = self.check_ghosts(items[1])
620  alg.ghost = ghosts[0]
621  if len(ghosts) > 1 :
622  alg.veto = ghosts[1]
623  if len(items) == 4:
624  alg.sign = self.check_sign(items[2])
625  alg.count = self.check_int(items[3])
626  elif len(items) == 5:
627  alg.minPt = self.check_float(items[2])
628  alg.sign = self.check_sign(items[3])
629  alg.count = self.check_int(items[4])
630  alg.eventPreselection = self.checkDecorationName(self.currentDecoration)
631  self.setDecorationName(alg, config, f'{thisalg}_%SYS%')
632  return
633 
634  def add_NLJETGHOST_selector(self, text, config):
635  items = text.split()
636  if items[0] != "LJET_N_GHOST":
637  self.raise_misconfig(text, "LJET_N_GHOST")
638  if len(items) != 4 and len(items) != 5:
639  self.raise_misconfig(text, "number of arguments")
640  thisalg = f'{self.name}_NLJETGHOST_{self.step}'
641  alg = config.createAlgorithm('CP::JetNGhostSelectorAlg', thisalg)
642  alg.jets, alg.jetSelection = config.readNameAndSelection(self.largeRjets)
643  ghosts = self.check_ghosts(items[1])
644  alg.ghost = ghosts[0]
645  if len(ghosts) > 1 :
646  alg.veto = ghosts[1]
647  if len(items) == 4:
648  alg.sign = self.check_sign(items[2])
649  alg.count = self.check_int(items[3])
650  elif len(items) == 5:
651  alg.minPt = self.check_float(items[2])
652  alg.sign = self.check_sign(items[3])
653  alg.count = self.check_int(items[4])
654  alg.eventPreselection = self.checkDecorationName(self.currentDecoration)
655  self.setDecorationName(alg, config, f'{thisalg}_%SYS%')
656  return
657 
658  def add_NOBJ_selector(self, text, config):
659  items = text.split()
660  if items[0] != "OBJ_N":
661  self.raise_misconfig(text, "OBJ_N")
662  if len(items) != 5:
663  self.raise_misconfig(text, "number of arguments")
664  thisalg = f'{self.name}_NOBJ_{self.step}'
665  alg = config.createAlgorithm('CP::NObjectPtSelectorAlg', thisalg)
666  alg.particles, alg.objectSelection = config.readNameAndSelection(self.check_string(items[1]))
667  alg.eventPreselection = self.checkDecorationName(self.currentDecoration)
668  alg.minPt = self.check_float(items[2])
669  alg.sign = self.check_sign(items[3])
670  alg.count = self.check_int(items[4])
671  self.setDecorationName(alg, config, f'{thisalg}_%SYS%')
672  return
673 
674  def add_MET_selector(self, text, config):
675  items = text.split()
676  if items[0] != "MET":
677  self.raise_misconfig(text, "MET")
678  if len(items) != 3:
679  self.raise_misconfig(text, "number of arguments")
680  if not self.met:
681  self.raise_missinginput("MET")
682  thisalg = f'{self.name}_MET_{self.step}'
683  alg = config.createAlgorithm('CP::MissingETSelectorAlg', thisalg)
684  alg.met = config.readName(self.met)
685  alg.metTerm = self.metTerm
686  alg.sign = self.check_sign(items[1])
687  alg.refMET = self.check_float(items[2])
688  alg.eventPreselection = self.checkDecorationName(self.currentDecoration)
689  self.setDecorationName(alg, config, f'{thisalg}_%SYS%')
690  return
691 
692  def add_MWT_selector(self, text, config):
693  items = text.split()
694  if items[0] != "MWT":
695  self.raise_misconfig(text, "MWT")
696  if len(items) != 3:
697  self.raise_misconfig(text, "number of arguments")
698  if not self.electrons and not self.muons:
699  self.raise_missinginput("electrons or muons")
700  thisalg = f'{self.name}_MWT_{self.step}'
701  alg = config.createAlgorithm('CP::TransverseMassSelectorAlg', thisalg)
702  alg.met = config.readName(self.met)
703  alg.metTerm = self.metTerm
704  alg.electrons, alg.electronSelection = config.readNameAndSelection(self.electrons)
705  alg.muons, alg.muonSelection = config.readNameAndSelection(self.muons)
706  if "Truth" in self.electrons or "Truth" in self.muons:
707  alg.useDressedProperties = self.useDressedProperties
708  alg.sign = self.check_sign(items[1])
709  alg.refMWT = self.check_float(items[2])
710  alg.eventPreselection = self.checkDecorationName(self.currentDecoration)
711  self.setDecorationName(alg, config, f'{thisalg}_%SYS%')
712  return
713 
714  def add_METMWT_selector(self, text, config):
715  items = text.split()
716  if items[0] != "MET+MWT":
717  self.raise_misconfig(text, "MET+MWT")
718  if len(items) != 3:
719  self.raise_misconfig(text, "number of arguments")
720  if not self.met:
721  self.raise_missinginput("MET")
722  if not self.electrons and not self.muons:
723  self.raise_missinginput("electrons or muons")
724  thisalg = f'{self.name}_METMWT_{self.step}'
725  alg = config.createAlgorithm('CP::MissingETPlusTransverseMassSelectorAlg', thisalg)
726  alg.met = config.readName(self.met)
727  alg.metTerm = self.metTerm
728  alg.electrons, alg.electronSelection = config.readNameAndSelection(self.electrons)
729  alg.muons, alg.muonSelection = config.readNameAndSelection(self.muons)
730  if "Truth" in self.electrons or "Truth" in self.muons:
731  alg.useDressedProperties = self.useDressedProperties
732  alg.sign = self.check_sign(items[1])
733  alg.refMETMWT = self.check_float(items[2])
734  alg.eventPreselection = self.checkDecorationName(self.currentDecoration)
735  self.setDecorationName(alg, config, f'{thisalg}_%SYS%')
736  return
737 
738  def add_MLL_selector(self, text, config):
739  items = text.split()
740  if items[0] != "MLL":
741  self.raise_misconfig(text, "MLL")
742  if len(items) != 3:
743  self.raise_misconfig(text, "number of arguments")
744  if not self.electrons and not self.muons:
745  self.raise_missinginput("electrons or muons")
746  thisalg = f'{self.name}_MLL_{self.step}'
747  alg = config.createAlgorithm('CP::DileptonInvariantMassSelectorAlg', thisalg)
748  if self.electrons:
749  alg.electrons, alg.electronSelection = config.readNameAndSelection(self.electrons)
750  if self.muons:
751  alg.muons, alg.muonSelection = config.readNameAndSelection(self.muons)
752  if "Truth" in self.electrons or "Truth" in self.muons:
753  alg.useDressedProperties = self.useDressedProperties
754  alg.sign = self.check_sign(items[1])
755  alg.refMLL = self.check_float(items[2])
756  alg.eventPreselection = self.checkDecorationName(self.currentDecoration)
757  self.setDecorationName(alg, config, f'{thisalg}_%SYS%')
758  return
759 
760  def add_MLLWINDOW_selector(self, text, config):
761  items = text.split()
762  if items[0] != "MLLWINDOW":
763  self.raise_misconfig(text, "MLLWINDOW")
764  if len(items) != 3 and len(items) != 4:
765  self.raise_misconfig(text, "number of arguments")
766  if not self.electrons and not self.muons:
767  self.raise_missinginput("electrons or muons")
768  thisalg = f'{self.name}_MLLWINDOW_{self.step}'
769  alg = config.createAlgorithm('CP::DileptonInvariantMassWindowSelectorAlg', thisalg)
770  if self.electrons:
771  alg.electrons, alg.electronSelection = config.readNameAndSelection(self.electrons)
772  if self.muons:
773  alg.muons, alg.muonSelection = config.readNameAndSelection(self.muons)
774  if "Truth" in self.electrons or "Truth" in self.muons:
775  alg.useDressedProperties = self.useDressedProperties
776  alg.lowMLL = self.check_float(items[1])
777  alg.highMLL = self.check_float(items[2])
778  alg.vetoMode = (len(items) == 4 and self.check_string(items[3]).lower() == "veto")
779  alg.eventPreselection = self.checkDecorationName(self.currentDecoration)
780  self.setDecorationName(alg, config, f'{thisalg}_%SYS%')
781  return
782 
783  def add_OS_selector(self, text, config):
784  items = text.split()
785  if len(items) != 1:
786  self.raise_misconfig(text, "number of arguments")
787  if not self.electrons and not self.muons:
788  self.raise_missinginput("electrons or muons")
789  thisalg = f'{self.name}_OS_{self.step}'
790  alg = config.createAlgorithm('CP::ChargeSelectorAlg', thisalg)
791  if self.electrons:
792  if "Particle" in self.electrons or "Truth" in self.electrons:
793  alg.truthElectrons, alg.truthElectronSelection = config.readNameAndSelection(self.electrons)
794  else:
795  alg.electrons, alg.electronSelection = config.readNameAndSelection(self.electrons)
796  if self.muons:
797  if "Particle" in self.muons or "Truth" in self.muons:
798  alg.truthMuons, alg.truthMuonSelection = config.readNameAndSelection(self.muons)
799  else:
800  alg.muons, alg.muonSelection = config.readNameAndSelection(self.muons)
801  alg.OS = True
802  alg.eventPreselection = self.checkDecorationName(self.currentDecoration)
803  self.setDecorationName(alg, config, f'{thisalg}_%SYS%')
804  return
805 
806  def add_SS_selector(self, text, config):
807  items = text.split()
808  if len(items) != 1:
809  self.raise_misconfig(text, "number of arguments")
810  if not self.electrons and not self.muons:
811  self.raise_missinginput("electrons or muons")
812  thisalg = f'{self.name}_SS_{self.step}'
813  alg = config.createAlgorithm('CP::ChargeSelectorAlg', thisalg)
814  if self.electrons:
815  if "Particle" in self.electrons or "Truth" in self.electrons:
816  alg.truthElectrons, alg.truthElectronSelection = config.readNameAndSelection(self.electrons)
817  else:
818  alg.electrons, alg.electronSelection = config.readNameAndSelection(self.electrons)
819  if self.muons:
820  if "Particle" in self.muons or "Truth" in self.muons:
821  alg.truthMuons, alg.truthMuonSelection = config.readNameAndSelection(self.muons)
822  else:
823  alg.muons, alg.muonSelection = config.readNameAndSelection(self.muons)
824  alg.OS = False
825  alg.eventPreselection = self.checkDecorationName(self.currentDecoration)
826  self.setDecorationName(alg, config, f'{thisalg}_%SYS%')
827  return
828 
829  def add_MLL_OSSF_selector(self, text, config):
830  items = text.split()
831  if items[0] != "MLL_OSSF":
832  self.raise_misconfig(text, "MLL_OSSF")
833  if len(items) != 3 and len(items) != 4:
834  self.raise_misconfig(text, "number of arguments")
835  if not self.electrons and not self.muons:
836  self.raise_missinginput("electrons or muons")
837  thisalg = f'{self.name}_MLL_OSSF_{self.step}'
838  alg = config.createAlgorithm('CP::DileptonOSSFInvariantMassWindowSelectorAlg', thisalg)
839  if self.electrons:
840  if "Particle" in self.electrons or "Truth" in self.electrons:
841  alg.truthElectrons, alg.truthElectronSelection = config.readNameAndSelection(self.electrons)
842  else:
843  alg.electrons, alg.electronSelection = config.readNameAndSelection(self.electrons)
844  if self.muons:
845  if "Particle" in self.muons or "Truth" in self.muons:
846  alg.truthMuons, alg.truthMuonSelection = config.readNameAndSelection(self.muons)
847  else:
848  alg.muons, alg.muonSelection = config.readNameAndSelection(self.muons)
849  if "Truth" in self.electrons or "Truth" in self.muons:
850  alg.useDressedProperties = self.useDressedProperties
851  alg.lowMll = self.check_float(items[1])
852  alg.highMll = self.check_float(items[2])
853  alg.vetoMode = (len(items) == 4 and self.check_string(items[3]).lower() == "veto")
854  alg.eventPreselection = self.checkDecorationName(self.currentDecoration)
855  self.setDecorationName(alg, config, f'{thisalg}_%SYS%')
856  return
857 
858  def add_EVENTFLAG(self, text, config):
859  items = text.split()
860  if items[0] != "EVENTFLAG":
861  self.raise_misconfig(text, "EVENTFLAG")
862  if len(items) != 2:
863  self.raise_misconfig(text, "number of arguments")
864  existingDecoration = self.check_string(items[1])
865  self.setDecorationName(None, config, existingDecoration)
866  return
867 
868  def add_GLOBALTRIGMATCH(self, text, config):
869  items = text.split()
870  if items[0] != "GLOBALTRIGMATCH":
871  self.raise_misconfig(text, "GLOBALTRIGMATCH")
872  if len(items) != 1 and len(items) != 2 :
873  self.raise_misconfig(text, "number of arguments")
874  if len(items) == 1:
875  self.setDecorationName(None, config, "globalTriggerMatch_%SYS%,as_char")
876  else:
877  postfix = self.check_string(items[1])
878  self.setDecorationName(None, config, f"globalTriggerMatch{postfix}_%SYS%,as_char")
879  return
880 
881  def add_RUNNUMBER(self, text, config):
882  items = text.split()
883  if items[0] != "RUN_NUMBER":
884  self.raise_misconfig(text, "RUN_NUMBER")
885  if len(items) != 3:
886  self.raise_misconfig(text, "number of arguments")
887  thisalg = f'{self.name}_RUN_NUMBER_{self.step}'
888  alg = config.createAlgorithm('CP::RunNumberSelectorAlg', thisalg)
889  alg.sign = self.check_sign(items[1])
890  alg.runNumber = self.check_int(items[2])
891  alg.useRandomRunNumber = config.dataType() is not DataType.Data
892  alg.eventPreselection = self.checkDecorationName(self.currentDecoration)
893  self.setDecorationName(alg, config, f'{thisalg}_%SYS%')
894  return
895 
896  def add_SAVE(self, text, config):
897  items = text.split()
898  if items[0] != "SAVE":
899  self.raise_misconfig(text, "SAVE")
900  if len(items) != 1:
901  self.raise_misconfig(text, "number of arguments")
902  thisalg = f'{self.name}_SAVE'
903  alg = config.createAlgorithm('CP::SaveFilterAlg', thisalg)
904  alg.FilterDescription = f'events passing < {self.name} >'
905  alg.eventDecisionOutputDecoration = f'ignore_{self.name}_%SYS%'
906  alg.selection = self.checkDecorationName(self.currentDecoration)
907  alg.noFilter = self.noFilter
908  alg.selectionName = f'pass_{self.name}_%SYS%,as_char' # this one is used as a selection
909  alg.decorationName = f'ntuplepass_{self.name}_%SYS%' # this one is saved to file
910  config.addOutputVar('EventInfo', f'ntuplepass_{self.name}_%SYS%', f'pass_{self.name}')
911  return
912 
914  name,
915  electrons=None, muons=None, jets=None,
916  largeRjets=None,
917  photons=None, taus=None, met=None, metTerm=None,
918  btagDecoration=None, preselection=None,
919  selectionCuts=None, noFilter=None,
920  debugMode=None, cutFlowHistograms=None):
921  """Create an event selection config block
922 
923  Keyword arguments:
924  name -- the name defining this selection
925  electrons -- the electron container and selection
926  muons -- the muon container and selection
927  jets -- the jet container and selection
928  largeRjets -- the large-R jet container and selection
929  photons -- the photon container and selection
930  taus -- the tau-jet container and selection
931  met -- the MET container
932  metTerm -- the MET term to use (e.g. 'Final', 'NonInt')
933  btagDecoration -- the b-tagging decoration to use when defining b-jets
934  preselection -- optional event-wise selection flag to start from
935  selectionCuts -- a string listing one selection cut per line
936  noFilter -- whether to disable the event filter
937  debugMode -- enables saving all intermediate decorations
938  cutFlowHistograms -- whether to toggle event cutflow histograms per systematic
939  """
940 
941  config = EventSelectionConfig(name)
942  config.setOptionValue ('electrons', electrons)
943  config.setOptionValue ('muons', muons)
944  config.setOptionValue ('jets', jets)
945  config.setOptionValue ('largeRjets', largeRjets)
946  config.setOptionValue ('photons', photons)
947  config.setOptionValue ('taus', taus)
948  config.setOptionValue ('met', met)
949  config.setOptionValue ('metTerm', metTerm)
950  config.setOptionValue ('btagDecoration', btagDecoration)
951  config.setOptionValue ('preselection', preselection)
952  config.setOptionValue ('selectionCuts', selectionCuts)
953  config.setOptionValue ('noFilter', noFilter)
954  config.setOptionValue ('debugMode', debugMode)
955  seq.append(config)
956 
957  # add event cutflow algorithm
958  if cutFlowHistograms:
959  makeEventCutFlowConfig(seq, 'EventInfo', selectionName='', postfix=name,
960  customSelections=name)
961 
963  electrons=None, muons=None, jets=None,
964  largeRjets=None,
965  photons=None, taus=None, met=None, metTerm=None,
966  btagDecoration=None, preselection=None,
967  selectionCutsDict=None, noFilter=None,
968  debugMode=None, cutFlowHistograms=None):
969  """Create multiple event selection config blocks
970 
971  Keyword arguments:
972  electrons -- the electron container and selection
973  muons -- the muon container and selection
974  jets -- the jet container and selection
975  largeRjets -- the large-R jet container and selection
976  photons -- the photon container and selection
977  taus -- the tau-jet container and selection
978  met -- the MET container
979  metTerm -- the MET term to use (e.g. 'Final', 'NonInt')
980  btagDecoration -- the b-tagging decoration to use when defining b-jets
981  preselection -- optional event-wise selection flag to start from
982  selectionCutsDict -- a dictionary with key the name of the selection and value a string listing one selection cut per line
983  noFilter -- whether to disable the event filter
984  debugMode -- enables saving all intermediate decorations
985  cutFlowHistograms -- whether to toggle event cutflow histograms per region and per systematic
986  """
987 
988  # handle the case where a user is only providing one selection
989  if len(list(selectionCutsDict.keys())) == 1:
990  name, selectionCuts = list(selectionCutsDict.items())[0]
991  makeEventSelectionConfig(seq, name, electrons, muons, jets, largeRjets, photons, taus, met, metTerm, btagDecoration, preselection, selectionCuts, noFilter=noFilter, debugMode=debugMode, cutFlowHistograms=cutFlowHistograms)
992  return
993 
994  # first, we generate all the individual event selections
995  # !!! it's important to pass noFilter=True, to avoid applying the individual filters in series
996  for name, selectionCuts in selectionCutsDict.items():
997  makeEventSelectionConfig(seq, name, electrons, muons, jets, largeRjets, photons, taus, met, metTerm, btagDecoration, preselection, selectionCuts, noFilter=True, debugMode=debugMode, cutFlowHistograms=cutFlowHistograms)
998 
999  # now we are ready to collect all the filters and apply their logical OR
1000  # !!! subregions (name starts with "SUB") are not used in the final filtering
1001  config = EventSelectionMergerConfig()
1002  config.setOptionValue ('selections', [f'pass_{name}_%SYS%' for name in selectionCutsDict.keys() if not name.startswith("SUB")])
1003  config.setOptionValue ('noFilter', noFilter)
1004  seq.append(config)
python.EventSelectionConfig.EventSelectionConfig.add_MWT_selector
def add_MWT_selector(self, text, config)
Definition: EventSelectionConfig.py:692
python.EventSelectionConfig.EventSelectionConfig.add_NJETGHOST_selector
def add_NJETGHOST_selector(self, text, config)
Definition: EventSelectionConfig.py:610
python.EventSelectionConfig.EventSelectionConfig.__init__
def __init__(self, name='')
Definition: EventSelectionConfig.py:37
python.EventSelectionConfig.EventSelectionConfig.add_MLLWINDOW_selector
def add_MLLWINDOW_selector(self, text, config)
Definition: EventSelectionConfig.py:760
python.EventSelectionConfig.EventSelectionConfig.check_float
def check_float(self, test, requirePositive=True)
Definition: EventSelectionConfig.py:181
python.EventSelectionConfig.EventSelectionConfig.check_string
def check_string(self, test)
Definition: EventSelectionConfig.py:204
python.EventSelectionConfig.EventSelectionConfig
Definition: EventSelectionConfig.py:34
python.EventSelectionConfig.EventSelectionConfig.add_SS_selector
def add_SS_selector(self, text, config)
Definition: EventSelectionConfig.py:806
python.EventSelectionConfig.EventSelectionConfig.add_NMU_selector
def add_NMU_selector(self, text, config)
Definition: EventSelectionConfig.py:316
python.EventSelectionConfig.EventSelectionConfig.setDecorationName
def setDecorationName(self, algorithm, config, decoration)
Definition: EventSelectionConfig.py:247
python.AsgAnalysisConfig.makeEventCutFlowConfig
def makeEventCutFlowConfig(seq, containerName, *postfix=None, selectionName, customSelections=None)
Definition: AsgAnalysisConfig.py:659
python.EventSelectionConfig.EventSelectionConfig.add_SAVE
def add_SAVE(self, text, config)
Definition: EventSelectionConfig.py:896
python.EventSelectionConfig.EventSelectionConfig.add_MET_selector
def add_MET_selector(self, text, config)
Definition: EventSelectionConfig.py:674
python.EventSelectionConfig.EventSelectionConfig.add_GLOBALTRIGMATCH
def add_GLOBALTRIGMATCH(self, text, config)
Definition: EventSelectionConfig.py:868
python.EventSelectionConfig.EventSelectionConfig.interpret
def interpret(self, text, cfg)
Definition: EventSelectionConfig.py:111
python.EventSelectionConfig.EventSelectionConfig.currentDecoration
currentDecoration
Definition: EventSelectionConfig.py:92
dumpHVPathFromNtuple.append
bool append
Definition: dumpHVPathFromNtuple.py:91
python.EventSelectionConfig.EventSelectionMergerConfig
Definition: EventSelectionConfig.py:8
python.EventSelectionConfig.EventSelectionConfig.add_NTAU_selector
def add_NTAU_selector(self, text, config)
Definition: EventSelectionConfig.py:499
python.EventSelectionConfig.EventSelectionMergerConfig.__init__
def __init__(self)
Definition: EventSelectionConfig.py:11
python.EventSelectionConfig.EventSelectionConfig.checkDecorationName
def checkDecorationName(self, decoration)
Definition: EventSelectionConfig.py:262
python.EventSelectionConfig.EventSelectionConfig.getCutflow
def getCutflow(self)
Definition: EventSelectionConfig.py:244
python.EventSelectionConfig.EventSelectionMergerConfig.makeAlgs
def makeAlgs(self, config)
Definition: EventSelectionConfig.py:21
python.EventSelectionConfig.EventSelectionConfig.add_EVENTFLAG
def add_EVENTFLAG(self, text, config)
Definition: EventSelectionConfig.py:858
python.EventSelectionConfig.EventSelectionConfig.add_RUNNUMBER
def add_RUNNUMBER(self, text, config)
Definition: EventSelectionConfig.py:881
python.EventSelectionConfig.EventSelectionConfig.name
name
Definition: EventSelectionConfig.py:94
python.EventSelectionConfig.EventSelectionConfig.check_int
def check_int(self, test, requirePositive=True)
Definition: EventSelectionConfig.py:191
python.EventSelectionConfig.makeMultipleEventSelectionConfigs
def makeMultipleEventSelectionConfigs(seq, electrons=None, muons=None, jets=None, largeRjets=None, photons=None, taus=None, met=None, metTerm=None, btagDecoration=None, preselection=None, selectionCutsDict=None, noFilter=None, debugMode=None, cutFlowHistograms=None)
Definition: EventSelectionConfig.py:962
python.LArMinBiasAlgConfig.int
int
Definition: LArMinBiasAlgConfig.py:59
python.EventSelectionConfig.EventSelectionConfig.add_OS_selector
def add_OS_selector(self, text, config)
Definition: EventSelectionConfig.py:783
histSizes.list
def list(name, path='/')
Definition: histSizes.py:38
python.EventSelectionConfig.EventSelectionConfig.raise_misconfig
def raise_misconfig(self, text, keyword)
Definition: EventSelectionConfig.py:175
python.EventSelectionConfig.EventSelectionConfig.add_SUMNLEPTONS_selector
def add_SUMNLEPTONS_selector(self, text, config)
Definition: EventSelectionConfig.py:374
python.EventSelectionConfig.EventSelectionConfig.add_NLJETMASS_selector
def add_NLJETMASS_selector(self, text, config)
Definition: EventSelectionConfig.py:553
python.EventSelectionConfig.EventSelectionConfig.add_IMPORT
def add_IMPORT(self, text, config)
Definition: EventSelectionConfig.py:269
python.EventSelectionConfig.EventSelectionConfig.add_NLJET_selector
def add_NLJET_selector(self, text, config)
Definition: EventSelectionConfig.py:527
print
void print(char *figname, TCanvas *c1)
Definition: TRTCalib_StrawStatusPlots.cxx:25
TCS::join
std::string join(const std::vector< std::string > &v, const char c=',')
Definition: Trigger/TrigT1/L1Topo/L1TopoCommon/Root/StringUtils.cxx:10
python.EventSelectionConfig.EventSelectionConfig.step
step
Definition: EventSelectionConfig.py:91
python.EventSelectionConfig.EventSelectionConfig.makeAlgs
def makeAlgs(self, config)
Definition: EventSelectionConfig.py:96
python.EventSelectionConfig.EventSelectionConfig.check_btagging
def check_btagging(self, test)
Definition: EventSelectionConfig.py:223
python.EventSelectionConfig.EventSelectionConfig.add_METMWT_selector
def add_METMWT_selector(self, text, config)
Definition: EventSelectionConfig.py:714
python.EventSelectionConfig.EventSelectionConfig.raise_missinginput
def raise_missinginput(self, collection)
Definition: EventSelectionConfig.py:178
python.EventSelectionConfig.EventSelectionConfig.add_NOBJ_selector
def add_NOBJ_selector(self, text, config)
Definition: EventSelectionConfig.py:658
python.EventSelectionConfig.EventSelectionConfig.add_NPH_selector
def add_NPH_selector(self, text, config)
Definition: EventSelectionConfig.py:471
python.EventSelectionConfig.EventSelectionConfig.add_NBJET_selector
def add_NBJET_selector(self, text, config)
Definition: EventSelectionConfig.py:433
python.EventSelectionConfig.EventSelectionConfig.add_NEL_selector
def add_NEL_selector(self, text, config)
Definition: EventSelectionConfig.py:286
python.EventSelectionConfig.EventSelectionConfig.cutflow
cutflow
Definition: EventSelectionConfig.py:93
python.EventSelectionConfig.EventSelectionConfig.add_SUMNELNMU_selector
def add_SUMNELNMU_selector(self, text, config)
Definition: EventSelectionConfig.py:346
python.EventSelectionConfig.EventSelectionConfig.check_sign
def check_sign(self, test)
Definition: EventSelectionConfig.py:210
python.EventSelectionConfig.EventSelectionConfig.add_NLJETMASSWINDOW_selector
def add_NLJETMASSWINDOW_selector(self, text, config)
Definition: EventSelectionConfig.py:579
python.EventSelectionConfig.EventSelectionConfig.check_ghosts
def check_ghosts(self, test)
Definition: EventSelectionConfig.py:230
python.EventSelectionConfig.EventSelectionConfig.add_MLL_OSSF_selector
def add_MLL_OSSF_selector(self, text, config)
Definition: EventSelectionConfig.py:829
Cut::all
@ all
Definition: SUSYToolsAlg.cxx:67
python.EventSelectionConfig.EventSelectionConfig.add_NLJETGHOST_selector
def add_NLJETGHOST_selector(self, text, config)
Definition: EventSelectionConfig.py:634
python.EventSelectionConfig.EventSelectionConfig.add_MLL_selector
def add_MLL_selector(self, text, config)
Definition: EventSelectionConfig.py:738
python.EventSelectionConfig.makeEventSelectionConfig
def makeEventSelectionConfig(seq, name, electrons=None, muons=None, jets=None, largeRjets=None, photons=None, taus=None, met=None, metTerm=None, btagDecoration=None, preselection=None, selectionCuts=None, noFilter=None, debugMode=None, cutFlowHistograms=None)
Definition: EventSelectionConfig.py:913
python.EventSelectionConfig.EventSelectionConfig.add_NJET_selector
def add_NJET_selector(self, text, config)
Definition: EventSelectionConfig.py:405
Trk::split
@ split
Definition: LayerMaterialProperties.h:38
python.LArMinBiasAlgConfig.float
float
Definition: LArMinBiasAlgConfig.py:65