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 862 of file EventSelectionConfig.py.

863  name,
864  electrons=None, muons=None, jets=None,
865  largeRjets=None,
866  photons=None, taus=None, met=None, metTerm=None,
867  btagDecoration=None, preselection=None,
868  selectionCuts=None, noFilter=None,
869  debugMode=None, cutFlowHistograms=None):
870  """Create an event selection config block
871 
872  Keyword arguments:
873  name -- the name defining this selection
874  electrons -- the electron container and selection
875  muons -- the muon container and selection
876  jets -- the jet container and selection
877  largeRjets -- the large-R jet container and selection
878  photons -- the photon container and selection
879  taus -- the tau-jet container and selection
880  met -- the MET container
881  metTerm -- the MET term to use (e.g. 'Final', 'NonInt')
882  btagDecoration -- the b-tagging decoration to use when defining b-jets
883  preselection -- optional event-wise selection flag to start from
884  selectionCuts -- a string listing one selection cut per line
885  noFilter -- whether to disable the event filter
886  debugMode -- enables saving all intermediate decorations
887  cutFlowHistograms -- whether to toggle event cutflow histograms per systematic
888  """
889 
890  config = EventSelectionConfig(name)
891  config.setOptionValue ('electrons', electrons)
892  config.setOptionValue ('muons', muons)
893  config.setOptionValue ('jets', jets)
894  config.setOptionValue ('largeRjets', largeRjets)
895  config.setOptionValue ('photons', photons)
896  config.setOptionValue ('taus', taus)
897  config.setOptionValue ('met', met)
898  config.setOptionValue ('metTerm', metTerm)
899  config.setOptionValue ('btagDecoration', btagDecoration)
900  config.setOptionValue ('preselection', preselection)
901  config.setOptionValue ('selectionCuts', selectionCuts)
902  config.setOptionValue ('noFilter', noFilter)
903  config.setOptionValue ('debugMode', debugMode)
904  seq.append(config)
905 
906  # add event cutflow algorithm
907  if cutFlowHistograms:
908  makeEventCutFlowConfig(seq, 'EventInfo', selectionName='', postfix=name,
909  customSelections=name)
910 

◆ 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 911 of file EventSelectionConfig.py.

912  electrons=None, muons=None, jets=None,
913  largeRjets=None,
914  photons=None, taus=None, met=None, metTerm=None,
915  btagDecoration=None, preselection=None,
916  selectionCutsDict=None, noFilter=None,
917  debugMode=None, cutFlowHistograms=None):
918  """Create multiple event selection config blocks
919 
920  Keyword arguments:
921  electrons -- the electron container and selection
922  muons -- the muon container and selection
923  jets -- the jet container and selection
924  largeRjets -- the large-R jet container and selection
925  photons -- the photon container and selection
926  taus -- the tau-jet container and selection
927  met -- the MET container
928  metTerm -- the MET term to use (e.g. 'Final', 'NonInt')
929  btagDecoration -- the b-tagging decoration to use when defining b-jets
930  preselection -- optional event-wise selection flag to start from
931  selectionCutsDict -- a dictionary with key the name of the selection and value a string listing one selection cut per line
932  noFilter -- whether to disable the event filter
933  debugMode -- enables saving all intermediate decorations
934  cutFlowHistograms -- whether to toggle event cutflow histograms per region and per systematic
935  """
936 
937  # handle the case where a user is only providing one selection
938  if len(list(selectionCutsDict.keys())) == 1:
939  name, selectionCuts = list(selectionCutsDict.items())[0]
940  makeEventSelectionConfig(seq, name, electrons, muons, jets, largeRjets, photons, taus, met, metTerm, btagDecoration, preselection, selectionCuts, noFilter=noFilter, debugMode=debugMode, cutFlowHistograms=cutFlowHistograms)
941  return
942 
943  # first, we generate all the individual event selections
944  # !!! it's important to pass noFilter=True, to avoid applying the individual filters in series
945  for name, selectionCuts in selectionCutsDict.items():
946  makeEventSelectionConfig(seq, name, electrons, muons, jets, largeRjets, photons, taus, met, metTerm, btagDecoration, preselection, selectionCuts, noFilter=True, debugMode=debugMode, cutFlowHistograms=cutFlowHistograms)
947 
948  # now we are ready to collect all the filters and apply their logical OR
949  # !!! subregions (name starts with "SUB") are not used in the final filtering
950  config = EventSelectionMergerConfig()
951  config.setOptionValue ('selections', [f'pass_{name}_%SYS%' for name in selectionCutsDict.keys() if not name.startswith("SUB")])
952  config.setOptionValue ('noFilter', noFilter)
953  seq.append(config)
python.AsgAnalysisConfig.makeEventCutFlowConfig
def makeEventCutFlowConfig(seq, containerName, *postfix=None, selectionName, customSelections=None)
Definition: AsgAnalysisConfig.py:699
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:911
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:862