116 """Add event cleaning flags"""
119 acc.merge(
AddJvtDecorationAlgCfg(ConfigFlags, algName=
"JvtPassDecorAlg_EMTopo", jetContainer=
'AntiKt4EMTopo'))
122 from DerivationFrameworkTau.TauCommonConfig
import AddTauAugmentationCfg
139 acc.addSequence(CompFactory.AthSequencer(
'EventCleanSeq', Sequential=
True))
140 acc.addSequence(CompFactory.AthSequencer(
'EventCleanLockSeq', Sequential=
True))
143 from AssociationUtils.AssociationUtilsConfig
import OverlapRemovalToolCfg
144 outputLabel_legacy =
'DFCommonJets_passOR'
146 tauLabel =
'DFTauLoose'
147 orTool_legacy = acc.popToolsAndMerge(
OverlapRemovalToolCfg(ConfigFlags,outputLabel=outputLabel_legacy,bJetLabel=bJetLabel))
148 algOR_legacy = CompFactory.OverlapRemovalGenUseAlg(
'OverlapRemovalGenUseAlg_EMTopo',
149 JetKey=
"AntiKt4EMTopoJets",
150 OverlapLabel=outputLabel_legacy,
151 OverlapRemovalTool=orTool_legacy,
155 acc.addEventAlgo(algOR_legacy,
'EventCleanSeq')
158 outputLabel =
'DFCommonJets_passOR'
159 orTool = acc.popToolsAndMerge(
OverlapRemovalToolCfg(ConfigFlags,outputLabel=outputLabel,bJetLabel=bJetLabel))
160 algOR = CompFactory.OverlapRemovalGenUseAlg(
'OverlapRemovalGenUseAlg',
161 OverlapLabel=outputLabel,
162 OverlapRemovalTool=orTool,
165 acc.addEventAlgo(algOR,
'EventCleanSeq')
168 lockOR = CompFactory.DerivationFramework.LockDecorations \
169 (
'OverlapRemovalLockDecorAlg',
171 'Electrons.selected',
172 'Electrons.' + outputLabel,
174 'Muons.' + outputLabel,
176 'Photons.' + outputLabel,
177 'AntiKt4EMPFlowJets.selected',
178 'AntiKt4EMPFlowJets.' + outputLabel,
179 'AntiKt4EMTopoJets.selected',
180 'AntiKt4EMTopoJets.' + outputLabel,
182 'TauJets.' + outputLabel,
184 acc.addEventAlgo(lockOR,
'EventCleanLockSeq')
186 CommonAugmentation = CompFactory.DerivationFramework.CommonAugmentation
187 from DerivationFrameworkMuons.MuonsToolsConfig
import MuonJetDrToolCfg
188 muonJetDrTool = acc.getPrimaryAndMerge(
MuonJetDrToolCfg(ConfigFlags,
"MuonJetDrTool"))
189 acc.addEventAlgo(CommonAugmentation(
"DFCommonMuonsKernel2", AugmentationTools = [muonJetDrTool]),
'EventCleanSeq')
191 from JetSelectorTools.JetSelectorToolsConfig
import EventCleaningToolCfg,JetCleaningToolCfg
193 supportedWPs = [
'Loose',
'Tight',
'LooseLLP',
'VeryLooseLLP',
'SuperLooseLLP']
194 prefix =
"DFCommonJets_"
195 evt_lvl_suppWPs_PFlow = [
'LooseBad',
'TightBad']
197 for wp
in workingPoints:
198 if wp
not in supportedWPs:
201 cleaningLevel = wp +
'Bad'
204 cleaningLevel = wp.replace(
'LLP',
'BadLLP')
208 for evt_swp
in evt_lvl_suppWPs_PFlow:
209 if evt_swp == cleaningLevel:
214 if 'Loose' in cleaningLevel:
220 ConfigFlags,
'JetCleaningTool_'+cleaningLevel+
'_EMTopo',
221 'AntiKt4EMTopo', cleaningLevel,
False))
222 acc.addPublicTool(jetCleaningTool_legacy)
224 ConfigFlags,
'EventCleaningTool_'+wp+
'_EMTopo', cleaningLevel))
225 ecTool_legacy.JetCleanPrefix = prefix
226 ecTool_legacy.JetContainer =
"AntiKt4EMTopoJets"
227 ecTool_legacy.JetCleaningTool = jetCleaningTool_legacy
228 acc.addPublicTool(ecTool_legacy)
230 eventCleanAlg_legacy = CompFactory.EventCleaningTestAlg(
'EventCleaningTestAlg_'+wp+
'_EMTopo',
231 EventCleaningTool=ecTool_legacy,
232 JetCollectionName=
"AntiKt4EMTopoJets",
233 EventCleanPrefix=prefix,
234 CleaningLevel=cleaningLevel,
236 acc.addEventAlgo(eventCleanAlg_legacy,
'EventCleanSeq')
241 ConfigFlags,
'JetCleaningTool_'+cleaningLevel,
242 'AntiKt4EMPFlowJets', cleaningLevel,
False))
243 acc.addPublicTool(jetCleaningTool)
245 ecTool = acc.popToolsAndMerge(
EventCleaningToolCfg(ConfigFlags,
'EventCleaningTool_' + wp, cleaningLevel))
246 ecTool.JetCleanPrefix = prefix
247 ecTool.JetContainer =
"AntiKt4EMPFlowJets"
248 ecTool.JetCleaningTool = jetCleaningTool
249 acc.addPublicTool(ecTool)
251 eventCleanAlg = CompFactory.EventCleaningTestAlg(
'EventCleaningTestAlg_'+wp,
252 EventCleaningTool=ecTool,
253 JetCollectionName=
"AntiKt4EMPFlowJets",
254 EventCleanPrefix=prefix,
255 CleaningLevel=cleaningLevel,
257 acc.addEventAlgo(eventCleanAlg,
'EventCleanSeq')