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