Loading [MathJax]/jax/input/TeX/config.js
ATLAS Offline Software
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
Public Member Functions | Public Attributes | List of all members
python.EventSelectionConfig.EventSelectionConfig Class Reference
Inheritance diagram for python.EventSelectionConfig.EventSelectionConfig:
Collaboration diagram for python.EventSelectionConfig.EventSelectionConfig:

Public Member Functions

def __init__ (self, name='')
 
def makeAlgs (self, config)
 
def interpret (self, text, cfg)
 
def raise_misconfig (self, text, keyword)
 
def raise_missinginput (self, collection)
 
def check_float (self, test, requirePositive=True)
 
def check_int (self, test, requirePositive=True)
 
def check_string (self, test)
 
def check_sign (self, test)
 
def check_btagging (self, test)
 
def check_ghosts (self, test)
 
def getCutflow (self)
 
def setDecorationName (self, algorithm, config, decoration)
 
def checkDecorationName (self, decoration)
 
def add_IMPORT (self, text, config)
 
def add_NEL_selector (self, text, config)
 
def add_NMU_selector (self, text, config)
 
def add_SUMNELNMU_selector (self, text, config)
 
def add_SUMNLEPTONS_selector (self, text, config)
 
def add_NJET_selector (self, text, config)
 
def add_NBJET_selector (self, text, config)
 
def add_NPH_selector (self, text, config)
 
def add_NTAU_selector (self, text, config)
 
def add_NLJET_selector (self, text, config)
 
def add_NLJETMASS_selector (self, text, config)
 
def add_NLJETMASSWINDOW_selector (self, text, config)
 
def add_NJETGHOST_selector (self, text, config)
 
def add_NLJETGHOST_selector (self, text, config)
 
def add_NOBJ_selector (self, text, config)
 
def add_MET_selector (self, text, config)
 
def add_MWT_selector (self, text, config)
 
def add_METMWT_selector (self, text, config)
 
def add_MLL_selector (self, text, config)
 
def add_MLLWINDOW_selector (self, text, config)
 
def add_OS_selector (self, text, config)
 
def add_SS_selector (self, text, config)
 
def add_MLL_OSSF_selector (self, text, config)
 
def add_EVENTFLAG (self, text, config)
 
def add_GLOBALTRIGMATCH (self, text, config)
 
def add_RUNNUMBER (self, text, config)
 
def add_SAVE (self, text, config)
 

Public Attributes

 step
 
 currentDecoration
 
 cutflow
 
 name
 

Detailed Description

ConfigBlock for interpreting text-based event selections

Definition at line 34 of file EventSelectionConfig.py.

Constructor & Destructor Documentation

◆ __init__()

def python.EventSelectionConfig.EventSelectionConfig.__init__ (   self,
  name = '' 
)

Definition at line 37 of file EventSelectionConfig.py.

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
92  self.currentDecoration = ''
93  self.cutflow = []
94  self.name = name
95 

Member Function Documentation

◆ add_EVENTFLAG()

def python.EventSelectionConfig.EventSelectionConfig.add_EVENTFLAG (   self,
  text,
  config 
)

Definition at line 858 of file EventSelectionConfig.py.

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 

◆ add_GLOBALTRIGMATCH()

def python.EventSelectionConfig.EventSelectionConfig.add_GLOBALTRIGMATCH (   self,
  text,
  config 
)

Definition at line 868 of file EventSelectionConfig.py.

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 

◆ add_IMPORT()

def python.EventSelectionConfig.EventSelectionConfig.add_IMPORT (   self,
  text,
  config 
)

Definition at line 269 of file EventSelectionConfig.py.

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 

◆ add_MET_selector()

def python.EventSelectionConfig.EventSelectionConfig.add_MET_selector (   self,
  text,
  config 
)

Definition at line 674 of file EventSelectionConfig.py.

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 

◆ add_METMWT_selector()

def python.EventSelectionConfig.EventSelectionConfig.add_METMWT_selector (   self,
  text,
  config 
)

Definition at line 714 of file EventSelectionConfig.py.

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 

◆ add_MLL_OSSF_selector()

def python.EventSelectionConfig.EventSelectionConfig.add_MLL_OSSF_selector (   self,
  text,
  config 
)

Definition at line 829 of file EventSelectionConfig.py.

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 

◆ add_MLL_selector()

def python.EventSelectionConfig.EventSelectionConfig.add_MLL_selector (   self,
  text,
  config 
)

Definition at line 738 of file EventSelectionConfig.py.

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 

◆ add_MLLWINDOW_selector()

def python.EventSelectionConfig.EventSelectionConfig.add_MLLWINDOW_selector (   self,
  text,
  config 
)

Definition at line 760 of file EventSelectionConfig.py.

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 

◆ add_MWT_selector()

def python.EventSelectionConfig.EventSelectionConfig.add_MWT_selector (   self,
  text,
  config 
)

Definition at line 692 of file EventSelectionConfig.py.

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 

◆ add_NBJET_selector()

def python.EventSelectionConfig.EventSelectionConfig.add_NBJET_selector (   self,
  text,
  config 
)

Definition at line 433 of file EventSelectionConfig.py.

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 

◆ add_NEL_selector()

def python.EventSelectionConfig.EventSelectionConfig.add_NEL_selector (   self,
  text,
  config 
)

Definition at line 286 of file EventSelectionConfig.py.

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 

◆ add_NJET_selector()

def python.EventSelectionConfig.EventSelectionConfig.add_NJET_selector (   self,
  text,
  config 
)

Definition at line 405 of file EventSelectionConfig.py.

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 

◆ add_NJETGHOST_selector()

def python.EventSelectionConfig.EventSelectionConfig.add_NJETGHOST_selector (   self,
  text,
  config 
)

Definition at line 610 of file EventSelectionConfig.py.

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 

◆ add_NLJET_selector()

def python.EventSelectionConfig.EventSelectionConfig.add_NLJET_selector (   self,
  text,
  config 
)

Definition at line 527 of file EventSelectionConfig.py.

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 

◆ add_NLJETGHOST_selector()

def python.EventSelectionConfig.EventSelectionConfig.add_NLJETGHOST_selector (   self,
  text,
  config 
)

Definition at line 634 of file EventSelectionConfig.py.

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 

◆ add_NLJETMASS_selector()

def python.EventSelectionConfig.EventSelectionConfig.add_NLJETMASS_selector (   self,
  text,
  config 
)

Definition at line 553 of file EventSelectionConfig.py.

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 

◆ add_NLJETMASSWINDOW_selector()

def python.EventSelectionConfig.EventSelectionConfig.add_NLJETMASSWINDOW_selector (   self,
  text,
  config 
)

Definition at line 579 of file EventSelectionConfig.py.

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 

◆ add_NMU_selector()

def python.EventSelectionConfig.EventSelectionConfig.add_NMU_selector (   self,
  text,
  config 
)

Definition at line 316 of file EventSelectionConfig.py.

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 

◆ add_NOBJ_selector()

def python.EventSelectionConfig.EventSelectionConfig.add_NOBJ_selector (   self,
  text,
  config 
)

Definition at line 658 of file EventSelectionConfig.py.

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 

◆ add_NPH_selector()

def python.EventSelectionConfig.EventSelectionConfig.add_NPH_selector (   self,
  text,
  config 
)

Definition at line 471 of file EventSelectionConfig.py.

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 

◆ add_NTAU_selector()

def python.EventSelectionConfig.EventSelectionConfig.add_NTAU_selector (   self,
  text,
  config 
)

Definition at line 499 of file EventSelectionConfig.py.

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 

◆ add_OS_selector()

def python.EventSelectionConfig.EventSelectionConfig.add_OS_selector (   self,
  text,
  config 
)

Definition at line 783 of file EventSelectionConfig.py.

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 

◆ add_RUNNUMBER()

def python.EventSelectionConfig.EventSelectionConfig.add_RUNNUMBER (   self,
  text,
  config 
)

Definition at line 881 of file EventSelectionConfig.py.

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 

◆ add_SAVE()

def python.EventSelectionConfig.EventSelectionConfig.add_SAVE (   self,
  text,
  config 
)

Definition at line 896 of file EventSelectionConfig.py.

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 

◆ add_SS_selector()

def python.EventSelectionConfig.EventSelectionConfig.add_SS_selector (   self,
  text,
  config 
)

Definition at line 806 of file EventSelectionConfig.py.

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 

◆ add_SUMNELNMU_selector()

def python.EventSelectionConfig.EventSelectionConfig.add_SUMNELNMU_selector (   self,
  text,
  config 
)

Definition at line 346 of file EventSelectionConfig.py.

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 

◆ add_SUMNLEPTONS_selector()

def python.EventSelectionConfig.EventSelectionConfig.add_SUMNLEPTONS_selector (   self,
  text,
  config 
)

Definition at line 374 of file EventSelectionConfig.py.

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 

◆ check_btagging()

def python.EventSelectionConfig.EventSelectionConfig.check_btagging (   self,
  test 
)

Definition at line 223 of file EventSelectionConfig.py.

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 

◆ check_float()

def python.EventSelectionConfig.EventSelectionConfig.check_float (   self,
  test,
  requirePositive = True 
)

Definition at line 181 of file EventSelectionConfig.py.

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 

◆ check_ghosts()

def python.EventSelectionConfig.EventSelectionConfig.check_ghosts (   self,
  test 
)

Definition at line 230 of file EventSelectionConfig.py.

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 

◆ check_int()

def python.EventSelectionConfig.EventSelectionConfig.check_int (   self,
  test,
  requirePositive = True 
)

Definition at line 191 of file EventSelectionConfig.py.

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 

◆ check_sign()

def python.EventSelectionConfig.EventSelectionConfig.check_sign (   self,
  test 
)

Definition at line 210 of file EventSelectionConfig.py.

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 

◆ check_string()

def python.EventSelectionConfig.EventSelectionConfig.check_string (   self,
  test 
)

Definition at line 204 of file EventSelectionConfig.py.

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 

◆ checkDecorationName()

def python.EventSelectionConfig.EventSelectionConfig.checkDecorationName (   self,
  decoration 
)

Definition at line 262 of file EventSelectionConfig.py.

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 

◆ getCutflow()

def python.EventSelectionConfig.EventSelectionConfig.getCutflow (   self)

Definition at line 244 of file EventSelectionConfig.py.

244  def getCutflow(self):
245  return self.cutflow
246 

◆ interpret()

def python.EventSelectionConfig.EventSelectionConfig.interpret (   self,
  text,
  cfg 
)

Definition at line 111 of file EventSelectionConfig.py.

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 

◆ makeAlgs()

def python.EventSelectionConfig.EventSelectionConfig.makeAlgs (   self,
  config 
)

Definition at line 96 of file EventSelectionConfig.py.

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 

◆ raise_misconfig()

def python.EventSelectionConfig.EventSelectionConfig.raise_misconfig (   self,
  text,
  keyword 
)

Definition at line 175 of file EventSelectionConfig.py.

175  def raise_misconfig(self, text, keyword):
176  raise ValueError (f"[EventSelectionConfig] Misconfiguration! Check {keyword} in: {text}")
177 

◆ raise_missinginput()

def python.EventSelectionConfig.EventSelectionConfig.raise_missinginput (   self,
  collection 
)

Definition at line 178 of file EventSelectionConfig.py.

178  def raise_missinginput(self, collection):
179  raise ValueError (f"[EventSelectionConfig] Misconfiguration! Missing input collection for {collection}")
180 

◆ setDecorationName()

def python.EventSelectionConfig.EventSelectionConfig.setDecorationName (   self,
  algorithm,
  config,
  decoration 
)

Definition at line 247 of file EventSelectionConfig.py.

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 

Member Data Documentation

◆ currentDecoration

python.EventSelectionConfig.EventSelectionConfig.currentDecoration

Definition at line 92 of file EventSelectionConfig.py.

◆ cutflow

python.EventSelectionConfig.EventSelectionConfig.cutflow

Definition at line 93 of file EventSelectionConfig.py.

◆ name

python.EventSelectionConfig.EventSelectionConfig.name

Definition at line 94 of file EventSelectionConfig.py.

◆ step

python.EventSelectionConfig.EventSelectionConfig.step

Definition at line 91 of file EventSelectionConfig.py.


The documentation for this class was generated from the following file:
dumpHVPathFromNtuple.append
bool append
Definition: dumpHVPathFromNtuple.py:91
TCS::join
std::string join(const std::vector< std::string > &v, const char c=',')
Definition: Trigger/TrigT1/L1Topo/L1TopoCommon/Root/StringUtils.cxx:10
python.processes.powheg.ZZ.ZZ.__init__
def __init__(self, base_directory, **kwargs)
Constructor: all process options are set here.
Definition: ZZ.py:18
python.CaloAddPedShiftConfig.int
int
Definition: CaloAddPedShiftConfig.py:45
Trk::split
@ split
Definition: LayerMaterialProperties.h:38
python.LArMinBiasAlgConfig.float
float
Definition: LArMinBiasAlgConfig.py:65