ATLAS Offline Software
Loading...
Searching...
No Matches
python.EventSelectionConfig Namespace Reference

Classes

class  EventSelectionConfig
class  EventSelectionMergerConfig

Functions

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

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.

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

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.

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 # first, we generate all the individual event selections
1010 # !!! it's important to pass noFilter=True, to avoid applying the individual filters in series
1011 for name, selectionCuts in selectionCutsDict.items():
1012 makeEventSelectionConfig(seq, name, electrons, muons, jets, largeRjets, photons, taus, met, metTerm, btagDecoration, preselection, selectionCuts, noFilter=True, debugMode=debugMode, cutFlowHistograms=cutFlowHistograms)
1013
1014 # now we are ready to collect all the filters and apply their logical OR
1015 # !!! subregions (name starts with "SUB") are not used in the final filtering
1016 config = EventSelectionMergerConfig()
1017 config.setOptionValue ('selections', [f'pass_{name}_%SYS%' for name in selectionCutsDict.keys() if not name.startswith("SUB")])
1018 config.setOptionValue ('noFilter', noFilter)
1019 seq.append(config)