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

738  name,
739  electrons=None, muons=None, jets=None,
740  largeRjets=None,
741  photons=None, taus=None, met=None, metTerm=None,
742  btagDecoration=None, preselection=None,
743  selectionCuts=None, noFilter=None,
744  debugMode=None, cutFlowHistograms=None):
745  """Create an event selection config block
746 
747  Keyword arguments:
748  name -- the name defining this selection
749  electrons -- the electron container and selection
750  muons -- the muon container and selection
751  jets -- the jet container and selection
752  largeRjets -- the large-R jet container and selection
753  photons -- the photon container and selection
754  taus -- the tau-jet container and selection
755  met -- the MET container
756  metTerm -- the MET term to use (e.g. 'Final', 'NonInt')
757  btagDecoration -- the b-tagging decoration to use when defining b-jets
758  preselection -- optional event-wise selection flag to start from
759  selectionCuts -- a string listing one selection cut per line
760  noFilter -- whether to disable the event filter
761  debugMode -- enables saving all intermediate decorations
762  cutFlowHistograms -- whether to toggle event cutflow histograms per systematic
763  """
764 
765  config = EventSelectionConfig(name)
766  config.setOptionValue ('electrons', electrons)
767  config.setOptionValue ('muons', muons)
768  config.setOptionValue ('jets', jets)
769  config.setOptionValue ('largeRjets', largeRjets)
770  config.setOptionValue ('photons', photons)
771  config.setOptionValue ('taus', taus)
772  config.setOptionValue ('met', met)
773  config.setOptionValue ('metTerm', metTerm)
774  config.setOptionValue ('btagDecoration', btagDecoration)
775  config.setOptionValue ('preselection', preselection)
776  config.setOptionValue ('selectionCuts', selectionCuts)
777  config.setOptionValue ('noFilter', noFilter)
778  config.setOptionValue ('debugMode', debugMode)
779  seq.append(config)
780 
781  # add event cutflow algorithm
782  if cutFlowHistograms:
783  makeEventCutFlowConfig(seq, 'EventInfo', selectionName='', postfix=name,
784  customSelections=name)
785 

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

787  electrons=None, muons=None, jets=None,
788  largeRjets=None,
789  photons=None, taus=None, met=None, metTerm=None,
790  btagDecoration=None, preselection=None,
791  selectionCutsDict=None, noFilter=None,
792  debugMode=None, cutFlowHistograms=None):
793  """Create multiple event selection config blocks
794 
795  Keyword arguments:
796  electrons -- the electron container and selection
797  muons -- the muon container and selection
798  jets -- the jet container and selection
799  largeRjets -- the large-R jet container and selection
800  photons -- the photon container and selection
801  taus -- the tau-jet container and selection
802  met -- the MET container
803  metTerm -- the MET term to use (e.g. 'Final', 'NonInt')
804  btagDecoration -- the b-tagging decoration to use when defining b-jets
805  preselection -- optional event-wise selection flag to start from
806  selectionCutsDict -- a dictionary with key the name of the selection and value a string listing one selection cut per line
807  noFilter -- whether to disable the event filter
808  debugMode -- enables saving all intermediate decorations
809  cutFlowHistograms -- whether to toggle event cutflow histograms per region and per systematic
810  """
811 
812  # handle the case where a user is only providing one selection
813  if len(list(selectionCutsDict.keys())) == 1:
814  name, selectionCuts = list(selectionCutsDict.items())[0]
815  makeEventSelectionConfig(seq, name, electrons, muons, jets, largeRjets, photons, taus, met, metTerm, btagDecoration, preselection, selectionCuts, noFilter=noFilter, debugMode=debugMode, cutFlowHistograms=cutFlowHistograms)
816  return
817 
818  # first, we generate all the individual event selections
819  # !!! it's important to pass noFilter=True, to avoid applying the individual filters in series
820  for name, selectionCuts in selectionCutsDict.items():
821  makeEventSelectionConfig(seq, name, electrons, muons, jets, largeRjets, photons, taus, met, metTerm, btagDecoration, preselection, selectionCuts, noFilter=True, debugMode=debugMode, cutFlowHistograms=cutFlowHistograms)
822 
823  # now we are ready to collect all the filters and apply their logical OR
824  # !!! subregions (name starts with "SUB") are not used in the final filtering
825  config = EventSelectionMergerConfig()
826  config.setOptionValue ('selections', [f'pass_{name}_%SYS%' for name in selectionCutsDict.keys() if not name.startswith("SUB")])
827  config.setOptionValue ('noFilter', noFilter)
828  seq.append(config)
python.AsgAnalysisConfig.makeEventCutFlowConfig
def makeEventCutFlowConfig(seq, containerName, *postfix=None, selectionName, customSelections=None)
Definition: AsgAnalysisConfig.py:673
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:786
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:737