119 """Add event cleaning flags"""
122 acc.merge(
AddJvtDecorationAlgCfg(ConfigFlags, algName=
"JvtPassDecorAlg_EMTopo", jetContainer=
'AntiKt4EMTopo'))
125 from DerivationFrameworkTau.TauCommonConfig
import AddTauAugmentationCfg
127 acc.addSequence(CompFactory.AthSequencer(
'EventCleanSeq', Sequential=
True))
130 from AssociationUtils.AssociationUtilsConfig
import OverlapRemovalToolCfg
131 inputLabel_legacy =
'selected_eventClean_EMTopo'
132 outputLabel_legacy =
'DFCommonJets_passOR_EMTopo'
134 tauLabel =
'DFTauRNNLoose'
135 orTool_legacy = acc.popToolsAndMerge(
OverlapRemovalToolCfg(ConfigFlags,inputLabel=inputLabel_legacy,outputLabel=outputLabel_legacy,bJetLabel=bJetLabel))
136 algOR_legacy = CompFactory.OverlapRemovalGenUseAlg(
'OverlapRemovalGenUseAlg_EMTopo',
137 JetKey=
"AntiKt4EMTopoJets",
138 SelectionLabel=inputLabel_legacy,
139 OverlapLabel=outputLabel_legacy,
140 OverlapRemovalTool=orTool_legacy,
144 acc.addEventAlgo(algOR_legacy,
'EventCleanSeq')
147 inputLabel =
'selected_eventClean_EMPFlow'
148 outputLabel =
'DFCommonJets_passOR_EMPFlow'
149 orTool = acc.popToolsAndMerge(
OverlapRemovalToolCfg(ConfigFlags,inputLabel=inputLabel,outputLabel=outputLabel,bJetLabel=bJetLabel))
150 algOR = CompFactory.OverlapRemovalGenUseAlg(
'OverlapRemovalGenUseAlg',
151 SelectionLabel=inputLabel,
152 OverlapLabel=outputLabel,
153 OverlapRemovalTool=orTool,
156 acc.addEventAlgo(algOR,
'EventCleanSeq')
158 CommonAugmentation = CompFactory.DerivationFramework.CommonAugmentation
159 from DerivationFrameworkMuons.MuonsToolsConfig
import MuonJetDrToolCfg
160 muonJetDrTool = acc.getPrimaryAndMerge(
MuonJetDrToolCfg(ConfigFlags,
"MuonJetDrTool"))
161 acc.addEventAlgo(CommonAugmentation(
"DFCommonMuonsKernel2", AugmentationTools = [muonJetDrTool]),
'EventCleanSeq')
163 from JetSelectorTools.JetSelectorToolsConfig
import EventCleaningToolCfg,JetCleaningToolCfg
165 supportedWPs = [
'Loose',
'Tight',
'LooseLLP',
'VeryLooseLLP',
'SuperLooseLLP']
166 prefix =
"DFCommonJets_"
167 evt_lvl_suppWPs_PFlow = [
'LooseBad',
'TightBad']
169 for wp
in workingPoints:
170 if wp
not in supportedWPs:
173 cleaningLevel = wp +
'Bad'
176 cleaningLevel = wp.replace(
'LLP',
'BadLLP')
180 for evt_swp
in evt_lvl_suppWPs_PFlow:
181 if evt_swp == cleaningLevel:
186 if 'Loose' in cleaningLevel:
192 ConfigFlags,
'JetCleaningTool_'+cleaningLevel+
'_EMTopo',
193 'AntiKt4EMTopo', cleaningLevel,
False))
194 acc.addPublicTool(jetCleaningTool_legacy)
196 ConfigFlags,
'EventCleaningTool_'+wp+
'_EMTopo', cleaningLevel))
197 ecTool_legacy.JetCleanPrefix = prefix
198 ecTool_legacy.OrDecorator =
"passOR_EMTopo"
199 ecTool_legacy.JetContainer =
"AntiKt4EMTopoJets"
200 ecTool_legacy.JetCleaningTool = jetCleaningTool_legacy
201 acc.addPublicTool(ecTool_legacy)
203 eventCleanAlg_legacy = CompFactory.EventCleaningTestAlg(
'EventCleaningTestAlg_'+wp+
'_EMTopo',
204 EventCleaningTool=ecTool_legacy,
205 JetCollectionName=
"AntiKt4EMTopoJets",
206 EventCleanPrefix=prefix,
207 CleaningLevel=cleaningLevel,
209 acc.addEventAlgo(eventCleanAlg_legacy,
'EventCleanSeq')
214 ConfigFlags,
'JetCleaningTool_'+cleaningLevel,
215 'AntiKt4EMPFlowJets', cleaningLevel,
False))
216 acc.addPublicTool(jetCleaningTool)
218 ecTool = acc.popToolsAndMerge(
EventCleaningToolCfg(ConfigFlags,
'EventCleaningTool_' + wp, cleaningLevel))
219 ecTool.JetCleanPrefix = prefix
220 ecTool.OrDecorator =
"passOR_EMPFlow"
221 ecTool.JetContainer =
"AntiKt4EMPFlowJets"
222 ecTool.JetCleaningTool = jetCleaningTool
223 acc.addPublicTool(ecTool)
225 eventCleanAlg = CompFactory.EventCleaningTestAlg(
'EventCleaningTestAlg_'+wp,
226 EventCleaningTool=ecTool,
227 JetCollectionName=
"AntiKt4EMPFlowJets",
228 EventCleanPrefix=prefix,
229 CleaningLevel=cleaningLevel,
231 acc.addEventAlgo(eventCleanAlg,
'EventCleanSeq')