ATLAS Offline Software
Classes | Functions
python.EventSelectionConfig Namespace Reference

Classes

class  EventSelectionConfig
 
class  EventSelectionMergerConfig
 

Functions

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)
 
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)
 

Function Documentation

◆ makeEventSelectionConfig()

def python.EventSelectionConfig.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 
)
Create an event selection config block

Keyword arguments:
    name -- the name defining this selection
    electrons -- the electron container and selection
    muons -- the muon container and selection
    jets -- the jet container and selection
    largeRjets -- the large-R jet container and selection
    photons -- the photon container and selection
    taus -- the tau-jet container and selection
    met -- the MET container
    metTerm -- the MET term to use (e.g. 'Final', 'NonInt')
    btagDecoration -- the b-tagging decoration to use when defining b-jets
    preselection -- optional event-wise selection flag to start from
    selectionCuts -- a string listing one selection cut per line
    noFilter -- whether to disable the event filter
    debugMode -- enables saving all intermediate decorations
    cutFlowHistograms -- whether to toggle event cutflow histograms per systematic

Definition at line 933 of file EventSelectionConfig.py.

934  name,
935  electrons=None, muons=None, jets=None,
936  largeRjets=None,
937  photons=None, taus=None, met=None, metTerm=None,
938  btagDecoration=None, preselection=None,
939  selectionCuts=None, noFilter=None,
940  debugMode=None, cutFlowHistograms=None):
941  """Create an event selection config block
942 
943  Keyword arguments:
944  name -- the name defining this selection
945  electrons -- the electron container and selection
946  muons -- the muon container and selection
947  jets -- the jet container and selection
948  largeRjets -- the large-R jet container and selection
949  photons -- the photon container and selection
950  taus -- the tau-jet container and selection
951  met -- the MET container
952  metTerm -- the MET term to use (e.g. 'Final', 'NonInt')
953  btagDecoration -- the b-tagging decoration to use when defining b-jets
954  preselection -- optional event-wise selection flag to start from
955  selectionCuts -- a string listing one selection cut per line
956  noFilter -- whether to disable the event filter
957  debugMode -- enables saving all intermediate decorations
958  cutFlowHistograms -- whether to toggle event cutflow histograms per systematic
959  """
960 
961  config = EventSelectionConfig()
962  config.setOptionValue ('name', name)
963  config.setOptionValue ('electrons', electrons)
964  config.setOptionValue ('muons', muons)
965  config.setOptionValue ('jets', jets)
966  config.setOptionValue ('largeRjets', largeRjets)
967  config.setOptionValue ('photons', photons)
968  config.setOptionValue ('taus', taus)
969  config.setOptionValue ('met', met)
970  config.setOptionValue ('metTerm', metTerm)
971  config.setOptionValue ('btagDecoration', btagDecoration)
972  config.setOptionValue ('preselection', preselection)
973  config.setOptionValue ('selectionCuts', selectionCuts)
974  config.setOptionValue ('noFilter', noFilter)
975  config.setOptionValue ('debugMode', debugMode)
976  seq.append(config)
977 
978  # add event cutflow algorithm
979  if cutFlowHistograms:
980  makeEventCutFlowConfig(seq, 'EventInfo', selectionName='', postfix=name,
981  customSelections=name)
982 

◆ makeMultipleEventSelectionConfigs()

def python.EventSelectionConfig.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 
)
Create multiple event selection config blocks

   Keyword arguments:
    electrons -- the electron container and selection
    muons -- the muon container and selection
    jets -- the jet container and selection
    largeRjets -- the large-R jet container and selection
    photons -- the photon container and selection
    taus -- the tau-jet container and selection
    met -- the MET container
    metTerm -- the MET term to use (e.g. 'Final', 'NonInt')
    btagDecoration -- the b-tagging decoration to use when defining b-jets
    preselection -- optional event-wise selection flag to start from
    selectionCutsDict -- a dictionary with key the name of the selection and value a string listing one selection cut per line
    noFilter -- whether to disable the event filter
    debugMode -- enables saving all intermediate decorations
    cutFlowHistograms -- whether to toggle event cutflow histograms per region and per systematic

Definition at line 983 of file EventSelectionConfig.py.

984  electrons=None, muons=None, jets=None,
985  largeRjets=None,
986  photons=None, taus=None, met=None, metTerm=None,
987  btagDecoration=None, preselection=None,
988  selectionCutsDict=None, noFilter=None,
989  debugMode=None, cutFlowHistograms=None):
990  """Create multiple event selection config blocks
991 
992  Keyword arguments:
993  electrons -- the electron container and selection
994  muons -- the muon container and selection
995  jets -- the jet container and selection
996  largeRjets -- the large-R jet container and selection
997  photons -- the photon container and selection
998  taus -- the tau-jet container and selection
999  met -- the MET container
1000  metTerm -- the MET term to use (e.g. 'Final', 'NonInt')
1001  btagDecoration -- the b-tagging decoration to use when defining b-jets
1002  preselection -- optional event-wise selection flag to start from
1003  selectionCutsDict -- a dictionary with key the name of the selection and value a string listing one selection cut per line
1004  noFilter -- whether to disable the event filter
1005  debugMode -- enables saving all intermediate decorations
1006  cutFlowHistograms -- whether to toggle event cutflow histograms per region and per systematic
1007  """
1008 
1009  # handle the case where a user is only providing one selection
1010  if len(list(selectionCutsDict.keys())) == 1:
1011  name, selectionCuts = list(selectionCutsDict.items())[0]
1012  makeEventSelectionConfig(seq, name, electrons, muons, jets, largeRjets, photons, taus, met, metTerm, btagDecoration, preselection, selectionCuts, noFilter=noFilter, debugMode=debugMode, cutFlowHistograms=cutFlowHistograms)
1013  return
1014 
1015  # first, we generate all the individual event selections
1016  # !!! it's important to pass noFilter=True, to avoid applying the individual filters in series
1017  for name, selectionCuts in selectionCutsDict.items():
1018  makeEventSelectionConfig(seq, name, electrons, muons, jets, largeRjets, photons, taus, met, metTerm, btagDecoration, preselection, selectionCuts, noFilter=True, debugMode=debugMode, cutFlowHistograms=cutFlowHistograms)
1019 
1020  # now we are ready to collect all the filters and apply their logical OR
1021  # !!! subregions (name starts with "SUB") are not used in the final filtering
1022  config = EventSelectionMergerConfig()
1023  config.setOptionValue ('selections', [f'pass_{name}_%SYS%' for name in selectionCutsDict.keys() if not name.startswith("SUB")])
1024  config.setOptionValue ('noFilter', noFilter)
1025  seq.append(config)
python.AsgAnalysisConfig.makeEventCutFlowConfig
def makeEventCutFlowConfig(seq, containerName, *postfix=None, selectionName, customSelections=None)
Definition: AsgAnalysisConfig.py:805
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:983
histSizes.list
def list(name, path='/')
Definition: histSizes.py:38
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:933