3from AnalysisAlgorithmsConfig.ConfigBlock
import ConfigBlock
4from AsgAnalysisAlgorithms.AsgAnalysisConfig
import makeEventCutFlowConfig
5from AnalysisAlgorithmsConfig.ConfigAccumulator
import DataType
9 """ConfigBlock for merging the output of various selection streams"""
12 super(EventSelectionMergerConfig, self).
__init__()
13 self.addOption(
'selections', [], type=list,
14 info=
"the selection decisions to unify into a "
15 "final decision (internally: `selection_1 || selection_2 || ...`). ")
16 self.addOption(
'noFilter',
False, type=bool,
17 info=
"do not apply an event filter, i.e. setting it to `False` "
18 "removes events not passing the full list of selection cuts.")
21 """Return the instance name for this block"""
27 raise ValueError(
'EventSelectionMerger requires a non-empty list of selection strings to be '
28 'passed as `selections`!')
29 alg = config.createAlgorithm(
'CP::SaveFilterAlg',
'EventSelectionMerger' + self.
selections[0].
split(
"_%SYS%")[0])
30 alg.FilterDescription =
'events passing at least one EventSelection algorithm'
31 alg.eventDecisionOutputDecoration =
'ignore_anySelection_%SYS%'
32 alg.selection =
'||'.join([sel+
',as_char' for sel
in self.
selections if sel])
33 alg.noFilter = self.noFilter
34 alg.selectionName =
'pass_anySelection_%SYS%'
35 alg.decorationName =
'ntuplepass_anySelection_%SYS%'
38 """ConfigBlock for interpreting text-based event selections"""
41 super(EventSelectionConfig, self).
__init__()
42 self.addOption(
'name',
'', type=str,
44 info=
"the name of the event selection, used to uniquely identify "
45 "the `EventSelectionConfig` block.")
46 self.addOption(
'electrons',
"", type=str,
47 info=
"the input electron container, with a possible selection, in "
48 "the format `container` or `container.selection`.")
49 self.addOption(
'muons',
"", type=str,
50 info=
"the input muon container, with a possible selection, in the "
51 "format `container` or `container.selection`.")
52 self.addOption(
'jets',
"", type=str,
53 info=
"the input jet container, with a possible selection, in the "
54 "format `container` or `container.selection`.")
55 self.addOption(
'largeRjets',
"", type=str,
56 info=
"the large-R jet container, with a possible selection, in "
57 "the format `container` or `container.selection`.")
58 self.addOption(
'photons',
"", type=str,
59 info=
"the input photon container, with a possible selection, in "
60 "the format `container` or `container.selection`.")
61 self.addOption(
'taus',
"", type=str,
62 info=
"the input tau-jet container, with a possible selection, in "
63 "the format `container` or `container.selection`.")
64 self.addOption(
'met',
"", type=str,
65 info=
"the input MET container.")
66 self.addOption(
'metTerm',
"Final", type=str,
67 info=
"the MET term to use when computing MET-based quantities.")
68 self.addOption(
'btagDecoration',
"", type=str,
69 info=
"the b-tagging decoration to use when defining b-jets.")
70 self.addOption(
'preselection',
"", type=str,
71 info=
"the event-wise selection flag to start this event selection "
73 self.addOption(
'selectionCuts',
"", type=str,
75 info=
"a single string listing one selection cut per line. "
76 "See [available keywords](https://topcptoolkit.docs.cern.ch/latest/settings/eventselection/#available-keywords).")
77 self.addOption(
'noFilter',
False, type=bool,
78 info=
"do not apply an event filter, i.e. setting it to `False` "
79 "removes events not passing the full list of selection cuts.")
80 self.addOption(
'debugMode',
False, type=bool,
81 info=
"whether to create an output branch for every single line "
82 "of the selection cuts. Setting it to `False` only saves the"
84 self.addOption(
'useDressedProperties',
True, type=bool,
85 info=
"whether to use dressed truth electron and truth muon "
86 "kinematics rather than simple 4-vector kinematics.")
92 """Return the instance name for this block"""
103 if self.selectionCuts
is None:
104 raise ValueError (
"[EventSelectionConfig] You must provide the 'selectionCuts' option to 'EventSelectionConfig': "
105 "a single string where each line represents a different selection cut to apply in order.")
106 for line
in self.selectionCuts.
split(
"\n"):
114 if text.startswith(
"#"):
117 if "EL_N" in text.split():
119 elif "MU_N" in text.split():
121 elif "SUM_EL_N_MU_N" in text.split():
123 elif "SUM_EL_N_MU_N_TAU_N" in text.split():
125 elif "JET_N_GHOST" in text.split():
127 elif "JET_N" in text.split():
129 elif "JET_N_BTAG" in text.split():
131 elif "PH_N" in text.split():
133 elif "TAU_N" in text.split():
135 elif "LJET_N_GHOST" in text.split():
137 elif "LJET_N" in text.split():
139 elif "OBJ_N" in text.split():
141 elif "MET" in text.split():
143 elif "MWT" in text.split():
145 elif "MET+MWT" in text.split():
147 elif "MLL" in text.split():
149 elif "MLLWINDOW" in text.split():
151 elif "OS" in text.split():
153 elif "SS" in text.split():
155 elif "MLL_OSSF" in text.split():
157 elif "LJETMASS_N" in text.split():
159 elif "LJETMASSWINDOW_N" in text.split():
161 elif "SAVE" in text.split():
163 elif "IMPORT" in text.split():
165 elif "EVENTFLAG" in text.split():
167 elif "GLOBALTRIGMATCH" in text.split():
169 elif "RUN_NUMBER" in text.split():
172 raise ValueError (f
"[EventSelectionConfig] The following selection cut is not recognised! --> {text}")
175 raise ValueError (f
"[EventSelectionConfig] Misconfiguration! Check {keyword} in: {text}")
178 raise ValueError (f
"[EventSelectionConfig] Misconfiguration! Missing input collection for {collection}")
183 if not requirePositive
or value >= 0:
186 raise ValueError (f
"[EventSelectionConfig] Misconfiguration! Float {test} is not positive!")
188 raise ValueError (f
"[EventSelectionConfig] Misconfiguration! {test} should be a float, not {type(test)}!")
193 if value == float(test):
194 if not requirePositive
or value >= 0:
197 raise ValueError (f
"[EventSelectionConfig] Misconfiguration! Int {test} us not positive!")
199 raise ValueError (f
"[EventSelectionConfig] Misconfiguration! {test} should be an int, not a float!")
201 raise ValueError (f
"[EventSelectionConfig] Misconfiguration! {test} should be an int, not {type(test)}")
204 if not isinstance(test, str):
205 raise ValueError (f
"[EventSelectionConfig] Misconfiguration! {test} should be a string, not a number!")
220 raise KeyError (f
"[EventSelectionConfig] Misconfiguration! {test} should be one of {list(mapping.keys())}")
223 test = test.split(
":")
225 raise ValueError (f
"[EventSelectionConfig] Misconfiguration! {test} should be provided as 'btagger:btagWP'")
231 values = test.split(
"!")
233 "B":
"GhostBHadronsFinalCount",
234 "C":
"GhostCHadronsFinalCount",
235 "T":
"GhostTQuarksFinalCount",
236 "W":
"GhostWBosonsCount",
237 "Z":
"GhostZBosonsCount",
238 "H":
"GhostHBosonsCount",
239 "TAU":
"GhostTausFinalCount"
241 return [ghost_map.get(value.upper(), value)
for value
in values]
247 self.
cutflow.append( decoration )
248 if algorithm
is not None:
249 algorithm.decorationName = f
'{decoration},as_char'
252 config.addOutputVar(
'EventInfo', decoration, decoration.split(
"_%SYS%")[0])
258 config.addSelection(
'EventInfo',
'', decoration)
264 decoration = decoration.split(
"&&")
265 decoration = [sub +
',as_char' if ',as_char' not in sub
else sub
for sub
in decoration]
266 return '&&'.join(decoration)
270 return oldSelection +
"&&" + config.getFullSelection(container, newSelection)
272 return config.getFullSelection(container, newSelection)
277 if items[0] !=
"IMPORT":
285 self.
currentDecoration = f
'{self.currentDecoration},as_char&&pass_{region}_%SYS%'
287 imported_cuts = [cut
for cut
in config.getSelectionCutFlow(
'EventInfo',
'')
if cut.startswith(region)]
293 if items[0] !=
"EL_N":
295 if len(items) != 4
and len(items) != 5:
299 thisalg = f
'{self.name}_NEL_{self.step}'
300 alg = config.createAlgorithm(
'CP::NObjectPtSelectorAlg', thisalg)
301 alg.particles, alg.objectSelection = config.readNameAndSelection(self.
electrons)
303 alg.useDressedProperties = self.useDressedProperties
309 elif len(items) == 5:
320 if items[0] !=
"MU_N":
322 if len(items) != 4
and len(items) != 5:
326 thisalg = f
'{self.name}_NMU_{self.step}'
327 alg = config.createAlgorithm(
'CP::NObjectPtSelectorAlg', thisalg)
328 alg.particles, alg.objectSelection = config.readNameAndSelection(self.
muons)
329 if "Truth" in self.
muons:
330 alg.useDressedProperties = self.useDressedProperties
336 elif len(items) == 5:
347 if items[0] !=
"SUM_EL_N_MU_N":
349 if len(items) != 4
and len(items) != 5
and len(items) != 7:
353 thisalg = f
'{self.name}_SUMNELNMU_{self.step}'
354 alg = config.createAlgorithm(
'CP::SumNLeptonPtSelectorAlg', thisalg)
355 alg.electrons, alg.electronSelection = config.readNameAndSelection(self.
electrons)
356 alg.muons, alg.muonSelection = config.readNameAndSelection(self.
muons)
358 alg.useDressedProperties = self.useDressedProperties
365 elif len(items) == 5:
370 elif len(items) == 7:
384 if items[0] !=
"SUM_EL_N_MU_N_TAU_N":
386 if len(items) != 4
and len(items) != 6
and len(items) != 9:
390 thisalg = f
'{self.name}_SUMNLEPTONS_{self.step}'
391 alg = config.createAlgorithm(
'CP::SumNLeptonPtSelectorAlg', thisalg)
392 alg.electrons, alg.electronSelection = config.readNameAndSelection(self.
electrons)
393 alg.muons, alg.muonSelection = config.readNameAndSelection(self.
muons)
394 alg.taus, alg.tauSelection = config.readNameAndSelection(self.
taus)
396 alg.useDressedProperties = self.useDressedProperties
404 elif len(items) == 6:
410 elif len(items) == 9:
427 if items[0] !=
"JET_N":
429 if len(items) != 4
and len(items) != 5:
433 thisalg = f
'{self.name}_NJET_{self.step}'
434 alg = config.createAlgorithm(
'CP::NObjectPtSelectorAlg', thisalg)
435 alg.particles, alg.objectSelection = config.readNameAndSelection(self.
jets)
441 elif len(items) == 5:
452 if items[0] !=
"JET_N_BTAG":
454 if len(items) != 3
and len(items) != 4
and len(items) != 5:
458 thisalg = f
'{self.name}_NBJET_{self.step}'
459 alg = config.createAlgorithm(
'CP::NObjectPtSelectorAlg', thisalg)
460 particles, selection = config.readNameAndSelection(self.
jets)
461 alg.particles = particles
462 alg.objectSelection = f
'{selection}&&{self.btagDecoration},as_char' if selection
else f
'{self.btagDecoration},as_char'
467 elif len(items) == 4:
470 customBtag = f
'ftag_select_{btagger}_{btagWP}'
471 alg.objectSelection = f
'{selection}&&{customBtag},as_char' if selection
else f
'{customBtag},as_char'
477 elif len(items) == 5:
480 customBtag = f
'ftag_select_{btagger}_{btagWP}'
481 alg.objectSelection = f
'{selection}&&{customBtag},as_char' if selection
else f
'{customBtag},as_char'
490 if items[0] !=
"PH_N":
492 if len(items) != 4
and len(items) != 5:
496 thisalg = f
'{self.name}_NPH_{self.step}'
497 alg = config.createAlgorithm(
'CP::NObjectPtSelectorAlg', thisalg)
498 alg.particles, alg.objectSelection = config.readNameAndSelection(self.
photons)
504 elif len(items) == 5:
515 if items[0] !=
"TAU_N":
517 if len(items) != 4
and len(items) != 5:
521 thisalg = f
'{self.name}_NTAU_{self.step}'
522 alg = config.createAlgorithm(
'CP::NObjectPtSelectorAlg', thisalg)
523 alg.particles, alg.objectSelection = config.readNameAndSelection(self.
taus)
529 elif len(items) == 5:
540 if items[0] !=
"LJET_N":
542 if len(items) != 4
and len(items) != 5:
544 thisalg = f
'{self.name}_NLJET_{self.step}'
545 alg = config.createAlgorithm(
'CP::NObjectPtSelectorAlg', thisalg)
546 alg.particles, alg.objectSelection = config.readNameAndSelection(self.largeRjets)
552 elif len(items) == 5:
563 if items[0] !=
"LJETMASS_N":
565 if len(items) != 4
and len(items) != 5:
567 thisalg = f
'{self.name}_NLJETMASS_{self.step}'
568 alg = config.createAlgorithm(
'CP::NObjectMassSelectorAlg', thisalg)
569 alg.particles, alg.objectSelection = config.readNameAndSelection(self.largeRjets)
575 elif len(items) == 5:
586 if items[0] !=
"LJETMASSWINDOW_N":
588 if len(items) != 5
and len(items) != 6
and len(items) != 7:
590 thisalg = f
'{self.name}_NLJETMASSWINDOW_{self.step}'
591 alg = config.createAlgorithm(
'CP::NLargeRJetMassWindowSelectorAlg', thisalg)
592 alg.ljets, alg.ljetSelection = config.readNameAndSelection(self.largeRjets)
593 vetoMode = items[-1] ==
'veto' or items[-1] ==
'VETO'
594 if len(items) == 5
or (len(items) == 6
and vetoMode):
599 alg.vetoMode = vetoMode
600 elif (len(items) == 6
and not vetoMode)
or len(items) == 7:
607 alg.vetoMode = vetoMode
614 if items[0] !=
"JET_N_GHOST":
616 if len(items) != 4
and len(items) != 5:
618 thisalg = f
'{self.name}_NJETGHOST_{self.step}'
619 alg = config.createAlgorithm(
'CP::JetNGhostSelectorAlg', thisalg)
620 alg.jets, alg.jetSelection = config.readNameAndSelection(self.
jets)
622 alg.ghost = ghosts[0]
628 elif len(items) == 5:
638 if items[0] !=
"LJET_N_GHOST":
640 if len(items) != 4
and len(items) != 5:
642 thisalg = f
'{self.name}_NLJETGHOST_{self.step}'
643 alg = config.createAlgorithm(
'CP::JetNGhostSelectorAlg', thisalg)
644 alg.jets, alg.jetSelection = config.readNameAndSelection(self.largeRjets)
646 alg.ghost = ghosts[0]
652 elif len(items) == 5:
662 if items[0] !=
"OBJ_N":
666 thisalg = f
'{self.name}_NOBJ_{self.step}'
667 alg = config.createAlgorithm(
'CP::NObjectPtSelectorAlg', thisalg)
668 alg.particles, alg.objectSelection = config.readNameAndSelection(self.
check_string(items[1]))
678 if items[0] !=
"MET":
684 thisalg = f
'{self.name}_MET_{self.step}'
685 alg = config.createAlgorithm(
'CP::MissingETSelectorAlg', thisalg)
686 alg.met = config.readName(self.
met)
687 alg.metTerm = self.metTerm
696 if items[0] !=
"MWT":
702 thisalg = f
'{self.name}_MWT_{self.step}'
703 alg = config.createAlgorithm(
'CP::TransverseMassSelectorAlg', thisalg)
704 alg.met = config.readName(self.
met)
705 alg.metTerm = self.metTerm
706 alg.electrons, alg.electronSelection = config.readNameAndSelection(self.
electrons)
707 alg.muons, alg.muonSelection = config.readNameAndSelection(self.
muons)
709 alg.useDressedProperties = self.useDressedProperties
718 if items[0] !=
"MET+MWT":
726 thisalg = f
'{self.name}_METMWT_{self.step}'
727 alg = config.createAlgorithm(
'CP::MissingETPlusTransverseMassSelectorAlg', thisalg)
728 alg.met = config.readName(self.
met)
729 alg.metTerm = self.metTerm
730 alg.electrons, alg.electronSelection = config.readNameAndSelection(self.
electrons)
731 alg.muons, alg.muonSelection = config.readNameAndSelection(self.
muons)
733 alg.useDressedProperties = self.useDressedProperties
742 if items[0] !=
"MLL":
748 thisalg = f
'{self.name}_MLL_{self.step}'
749 alg = config.createAlgorithm(
'CP::DileptonInvariantMassSelectorAlg', thisalg)
751 alg.electrons, alg.electronSelection = config.readNameAndSelection(self.
electrons)
753 alg.muons, alg.muonSelection = config.readNameAndSelection(self.
muons)
755 alg.useDressedProperties = self.useDressedProperties
764 if items[0] !=
"MLLWINDOW":
766 if len(items) != 3
and len(items) != 4:
770 thisalg = f
'{self.name}_MLLWINDOW_{self.step}'
771 alg = config.createAlgorithm(
'CP::DileptonInvariantMassWindowSelectorAlg', thisalg)
773 alg.electrons, alg.electronSelection = config.readNameAndSelection(self.
electrons)
775 alg.muons, alg.muonSelection = config.readNameAndSelection(self.
muons)
777 alg.useDressedProperties = self.useDressedProperties
780 alg.vetoMode = (len(items) == 4
and self.
check_string(items[3]).lower() ==
"veto")
787 if not items
or len(items) > 4:
791 thisalg = f
'{self.name}_OS_{self.step}'
792 alg = config.createAlgorithm(
'CP::ChargeSelectorAlg', thisalg)
793 if self.
electrons and (len(items) == 1
or "el" in items):
795 alg.truthElectrons, alg.truthElectronSelection = config.readNameAndSelection(self.
electrons)
797 alg.electrons, alg.electronSelection = config.readNameAndSelection(self.
electrons)
798 if self.
muons and (len(items) == 1
or "mu" in items):
799 if "Particle" in self.
muons or "Truth" in self.
muons:
800 alg.truthMuons, alg.truthMuonSelection = config.readNameAndSelection(self.
muons)
802 alg.muons, alg.muonSelection = config.readNameAndSelection(self.
muons)
803 if self.
taus and (len(items) == 1
or "tau" in items):
804 if "Particle" in self.
taus or "Truth" in self.
taus:
805 alg.truthTaus, alg.truthTauSelection = config.readNameAndSelection(self.
taus)
807 alg.taus, alg.tauSelection = config.readNameAndSelection(self.
taus)
815 if not items
or len(items) > 4:
819 thisalg = f
'{self.name}_SS_{self.step}'
820 alg = config.createAlgorithm(
'CP::ChargeSelectorAlg', thisalg)
821 if self.
electrons and (len(items) == 1
or "el" in items):
823 alg.truthElectrons, alg.truthElectronSelection = config.readNameAndSelection(self.
electrons)
825 alg.electrons, alg.electronSelection = config.readNameAndSelection(self.
electrons)
826 if self.
muons and (len(items) == 1
or "mu" in items):
827 if "Particle" in self.
muons or "Truth" in self.
muons:
828 alg.truthMuons, alg.truthMuonSelection = config.readNameAndSelection(self.
muons)
830 alg.muons, alg.muonSelection = config.readNameAndSelection(self.
muons)
831 if self.
taus and (len(items) == 1
or "tau" in items):
832 if "Particle" in self.
taus or "Truth" in self.
taus:
833 alg.truthTaus, alg.truthTauSelection = config.readNameAndSelection(self.
taus)
835 alg.taus, alg.tauSelection = config.readNameAndSelection(self.
taus)
843 if items[0] !=
"MLL_OSSF":
845 if len(items) != 3
and len(items) != 4:
849 thisalg = f
'{self.name}_MLL_OSSF_{self.step}'
850 alg = config.createAlgorithm(
'CP::DileptonOSSFInvariantMassWindowSelectorAlg', thisalg)
853 alg.truthElectrons, alg.truthElectronSelection = config.readNameAndSelection(self.
electrons)
855 alg.electrons, alg.electronSelection = config.readNameAndSelection(self.
electrons)
857 if "Particle" in self.
muons or "Truth" in self.
muons:
858 alg.truthMuons, alg.truthMuonSelection = config.readNameAndSelection(self.
muons)
860 alg.muons, alg.muonSelection = config.readNameAndSelection(self.
muons)
862 alg.useDressedProperties = self.useDressedProperties
865 alg.vetoMode = (len(items) == 4
and self.
check_string(items[3]).lower() ==
"veto")
872 if items[0] !=
"EVENTFLAG":
882 if items[0] !=
"GLOBALTRIGMATCH":
884 if len(items) != 1
and len(items) != 2 :
890 self.
setDecorationName(
None, config, f
"globalTriggerMatch{postfix}_%SYS%,as_char")
895 if items[0] !=
"RUN_NUMBER":
899 thisalg = f
'{self.name}_RUN_NUMBER_{self.step}'
900 alg = config.createAlgorithm(
'CP::RunNumberSelectorAlg', thisalg)
903 alg.useRandomRunNumber = config.dataType()
is not DataType.Data
910 if items[0] !=
"SAVE":
914 thisalg = f
'{self.name}_SAVE'
915 alg = config.createAlgorithm(
'CP::SaveFilterAlg', thisalg)
916 alg.FilterDescription = f
'events passing < {self.name} >'
917 alg.eventDecisionOutputDecoration = f
'ignore_{self.name}_%SYS%'
919 alg.noFilter = self.noFilter
920 alg.selectionName = f
'pass_{self.name}_%SYS%,as_char'
921 alg.decorationName = f
'ntuplepass_{self.name}_%SYS%'
922 config.addOutputVar(
'EventInfo', f
'ntuplepass_{self.name}_%SYS%', f
'pass_{self.name}')
927 electrons=None, muons=None, jets=None,
929 photons=None, taus=None, met=None, metTerm=None,
930 btagDecoration=None, preselection=None,
931 selectionCuts=None, noFilter=None,
932 debugMode=None, cutFlowHistograms=None):
933 """Create an event selection config block
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
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)
971 if cutFlowHistograms:
972 makeEventCutFlowConfig(seq,
'EventInfo', selectionName=
'', postfix=name,
973 customSelections=name)
976 electrons=None, muons=None, jets=None,
978 photons=None, taus=None, met=None, metTerm=None,
979 btagDecoration=None, preselection=None,
980 selectionCutsDict=None, noFilter=None,
981 debugMode=None, cutFlowHistograms=None):
982 """Create multiple event selection config blocks
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
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)
1009 config.setOptionValue (
'selections', [f
'pass_{name}_%SYS%' for name
in selectionCutsDict.keys()
if not name.startswith(
"SUB")])
1010 config.setOptionValue (
'noFilter', noFilter)
void print(char *figname, TCanvas *c1)
add_NJET_selector(self, text, config)
setDecorationName(self, algorithm, config, decoration)
add_SUMNELNMU_selector(self, text, config)
raise_missinginput(self, collection)
extendObjectSelection(self, config, container, oldSelection, newSelection)
add_NEL_selector(self, text, config)
add_RUNNUMBER(self, text, config)
add_MLL_selector(self, text, config)
check_int(self, test, requirePositive=True)
add_METMWT_selector(self, text, config)
add_EVENTFLAG(self, text, config)
add_NLJETGHOST_selector(self, text, config)
add_NOBJ_selector(self, text, config)
add_NMU_selector(self, text, config)
add_MWT_selector(self, text, config)
add_SUMNLEPTONS_selector(self, text, config)
add_IMPORT(self, text, config)
add_NLJET_selector(self, text, config)
add_GLOBALTRIGMATCH(self, text, config)
raise_misconfig(self, text, keyword)
add_NBJET_selector(self, text, config)
add_SS_selector(self, text, config)
checkDecorationName(self, decoration)
add_NLJETMASS_selector(self, text, config)
check_float(self, test, requirePositive=True)
interpret(self, text, cfg)
add_OS_selector(self, text, config)
add_MET_selector(self, text, config)
add_NTAU_selector(self, text, config)
check_btagging(self, test)
add_NPH_selector(self, text, config)
add_MLLWINDOW_selector(self, text, config)
add_SAVE(self, text, config)
add_NJETGHOST_selector(self, text, config)
add_NLJETMASSWINDOW_selector(self, text, config)
add_MLL_OSSF_selector(self, text, config)
std::vector< std::string > split(const std::string &s, const std::string &t=":")
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)