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

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

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

982 debugMode=None, cutFlowHistograms=None):
983 """Create multiple event selection config blocks
984
985 Keyword arguments:
986 electrons -- the electron container and selection
987 muons -- the muon container and selection
988 jets -- the jet container and selection
989 largeRjets -- the large-R jet container and selection
990 photons -- the photon container and selection
991 taus -- the tau-jet container and selection
992 met -- the MET container
993 metTerm -- the MET term to use (e.g. 'Final', 'NonInt')
994 btagDecoration -- the b-tagging decoration to use when defining b-jets
995 preselection -- optional event-wise selection flag to start from
996 selectionCutsDict -- a dictionary with key the name of the selection and value a string listing one selection cut per line
997 noFilter -- whether to disable the event filter
998 debugMode -- enables saving all intermediate decorations
999 cutFlowHistograms -- whether to toggle event cutflow histograms per region and per systematic
1000 """
1001
1002 # first, we generate all the individual event selections
1003 # !!! it's important to pass noFilter=True, to avoid applying the individual filters in series
1004 for name, selectionCuts in selectionCutsDict.items():
1005 makeEventSelectionConfig(seq, name, electrons, muons, jets, largeRjets, photons, taus, met, metTerm, btagDecoration, preselection, selectionCuts, noFilter=True, debugMode=debugMode, cutFlowHistograms=cutFlowHistograms)
1006
1007 # now we are ready to collect all the filters and apply their logical OR
1008 # !!! subregions (name starts with "SUB") are not used in the final filtering
1009 config = EventSelectionMergerConfig()
1010 config.setOptionValue ('selections', [f'pass_{name}_%SYS%' for name in selectionCutsDict.keys() if not name.startswith("SUB")])
1011 config.setOptionValue ('noFilter', noFilter)
1012 seq.append(config)