115 """Add event cleaning flags"""
118 acc.merge(
AddJvtDecorationAlgCfg(ConfigFlags, algName=
"JvtPassDecorAlg_EMTopo", jetContainer=
'AntiKt4EMTopo'))
121 from DerivationFrameworkTau.TauCommonConfig
import AddTauAugmentationCfg
138 acc.addSequence(CompFactory.AthSequencer(
'EventCleanSeq', Sequential=
True))
139 acc.addSequence(CompFactory.AthSequencer(
'EventCleanLockSeq', Sequential=
True))
142 from AssociationUtils.AssociationUtilsConfig
import OverlapRemovalToolCfg
143 outputLabel_legacy =
'DFCommonJets_passOR'
145 tauLabel =
'DFTauLoose'
146 orTool_legacy = acc.popToolsAndMerge(
OverlapRemovalToolCfg(ConfigFlags,outputLabel=outputLabel_legacy,bJetLabel=bJetLabel))
147 algOR_legacy = CompFactory.OverlapRemovalGenUseAlg(
'OverlapRemovalGenUseAlg_EMTopo',
148 JetKey=
"AntiKt4EMTopoJets",
149 OverlapLabel=outputLabel_legacy,
150 OverlapRemovalTool=orTool_legacy,
154 acc.addEventAlgo(algOR_legacy,
'EventCleanSeq')
157 outputLabel =
'DFCommonJets_passOR'
158 orTool = acc.popToolsAndMerge(
OverlapRemovalToolCfg(ConfigFlags,outputLabel=outputLabel,bJetLabel=bJetLabel))
159 algOR = CompFactory.OverlapRemovalGenUseAlg(
'OverlapRemovalGenUseAlg',
160 OverlapLabel=outputLabel,
161 OverlapRemovalTool=orTool,
164 acc.addEventAlgo(algOR,
'EventCleanSeq')
167 lockOR = CompFactory.DerivationFramework.LockDecorations \
168 (
'OverlapRemovalLockDecorAlg',
170 'Electrons.selected',
171 'Electrons.' + outputLabel,
173 'Muons.' + outputLabel,
175 'Photons.' + outputLabel,
176 'AntiKt4EMPFlowJets.selected',
177 'AntiKt4EMPFlowJets.' + outputLabel,
178 'AntiKt4EMTopoJets.selected',
179 'AntiKt4EMTopoJets.' + outputLabel,
181 'TauJets.' + outputLabel,
183 acc.addEventAlgo(lockOR,
'EventCleanLockSeq')
185 CommonAugmentation = CompFactory.DerivationFramework.CommonAugmentation
186 from DerivationFrameworkMuons.MuonsToolsConfig
import MuonJetDrToolCfg
187 muonJetDrTool = acc.getPrimaryAndMerge(
MuonJetDrToolCfg(ConfigFlags,
"MuonJetDrTool"))
188 acc.addEventAlgo(CommonAugmentation(
"DFCommonMuonsKernel2", AugmentationTools = [muonJetDrTool]),
'EventCleanSeq')
190 from JetSelectorTools.JetSelectorToolsConfig
import EventCleaningToolCfg,JetCleaningToolCfg
192 supportedWPs = [
'Loose',
'Tight',
'LooseLLP',
'VeryLooseLLP',
'SuperLooseLLP']
193 prefix =
"DFCommonJets_"
194 evt_lvl_suppWPs_PFlow = [
'LooseBad',
'TightBad']
196 for wp
in workingPoints:
197 if wp
not in supportedWPs:
200 cleaningLevel = wp +
'Bad'
203 cleaningLevel = wp.replace(
'LLP',
'BadLLP')
207 for evt_swp
in evt_lvl_suppWPs_PFlow:
208 if evt_swp == cleaningLevel:
213 if 'Loose' in cleaningLevel:
219 ConfigFlags,
'JetCleaningTool_'+cleaningLevel+
'_EMTopo',
220 'AntiKt4EMTopo', cleaningLevel,
False))
221 acc.addPublicTool(jetCleaningTool_legacy)
223 ConfigFlags,
'EventCleaningTool_'+wp+
'_EMTopo', cleaningLevel))
224 ecTool_legacy.JetCleanPrefix = prefix
225 ecTool_legacy.JetContainer =
"AntiKt4EMTopoJets"
226 ecTool_legacy.JetCleaningTool = jetCleaningTool_legacy
227 acc.addPublicTool(ecTool_legacy)
229 eventCleanAlg_legacy = CompFactory.EventCleaningTestAlg(
'EventCleaningTestAlg_'+wp+
'_EMTopo',
230 EventCleaningTool=ecTool_legacy,
231 JetCollectionName=
"AntiKt4EMTopoJets",
232 EventCleanPrefix=prefix,
233 CleaningLevel=cleaningLevel,
235 acc.addEventAlgo(eventCleanAlg_legacy,
'EventCleanSeq')
240 ConfigFlags,
'JetCleaningTool_'+cleaningLevel,
241 'AntiKt4EMPFlowJets', cleaningLevel,
False))
242 acc.addPublicTool(jetCleaningTool)
244 ecTool = acc.popToolsAndMerge(
EventCleaningToolCfg(ConfigFlags,
'EventCleaningTool_' + wp, cleaningLevel))
245 ecTool.JetCleanPrefix = prefix
246 ecTool.JetContainer =
"AntiKt4EMPFlowJets"
247 ecTool.JetCleaningTool = jetCleaningTool
248 acc.addPublicTool(ecTool)
250 eventCleanAlg = CompFactory.EventCleaningTestAlg(
'EventCleaningTestAlg_'+wp,
251 EventCleaningTool=ecTool,
252 JetCollectionName=
"AntiKt4EMPFlowJets",
253 EventCleanPrefix=prefix,
254 CleaningLevel=cleaningLevel,
256 acc.addEventAlgo(eventCleanAlg,
'EventCleanSeq')