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

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

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

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