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

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

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

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