118 """Add event cleaning flags"""
121 acc.merge(
AddJvtDecorationAlgCfg(ConfigFlags, algName=
"JvtPassDecorAlg_EMTopo", jetContainer=
'AntiKt4EMTopo'))
124 from DerivationFrameworkTau.TauCommonConfig
import AddTauAugmentationCfg
128 from AssociationUtils.AssociationUtilsConfig
import OverlapRemovalToolCfg
129 outputLabel_legacy =
'DFCommonJets_passOR'
131 tauLabel =
'DFTauLoose'
132 orTool_legacy = acc.popToolsAndMerge(
OverlapRemovalToolCfg(ConfigFlags,outputLabel=outputLabel_legacy,bJetLabel=bJetLabel))
133 algOR_legacy = CompFactory.OverlapRemovalGenUseAlg(
'OverlapRemovalGenUseAlg_EMTopo',
134 JetKey=
"AntiKt4EMTopoJets",
135 OverlapLabel=outputLabel_legacy,
136 OverlapRemovalTool=orTool_legacy,
140 acc.addEventAlgo(algOR_legacy)
143 outputLabel =
'DFCommonJets_passOR'
144 orTool = acc.popToolsAndMerge(
OverlapRemovalToolCfg(ConfigFlags,outputLabel=outputLabel,bJetLabel=bJetLabel))
145 algOR = CompFactory.OverlapRemovalGenUseAlg(
'OverlapRemovalGenUseAlg',
146 OverlapLabel=outputLabel,
147 OverlapRemovalTool=orTool,
150 acc.addEventAlgo(algOR)
152 CommonAugmentation = CompFactory.DerivationFramework.CommonAugmentation
153 from DerivationFrameworkMuons.MuonsToolsConfig
import MuonJetDrToolCfg
154 muonJetDrTool = acc.getPrimaryAndMerge(
MuonJetDrToolCfg(ConfigFlags,
"MuonJetDrTool"))
155 acc.addEventAlgo(CommonAugmentation(
"DFCommonMuonsKernel2", AugmentationTools = [muonJetDrTool]))
157 from JetSelectorTools.JetSelectorToolsConfig
import EventCleaningToolCfg,JetCleaningToolCfg
159 supportedWPs = [
'Loose',
'Tight',
'LooseLLP',
'VeryLooseLLP',
'SuperLooseLLP']
160 prefix =
"DFCommonJets_"
161 evt_lvl_suppWPs_PFlow = [
'LooseBad',
'TightBad']
163 for wp
in workingPoints:
164 if wp
not in supportedWPs:
167 cleaningLevel = wp +
'Bad'
170 cleaningLevel = wp.replace(
'LLP',
'BadLLP')
174 for evt_swp
in evt_lvl_suppWPs_PFlow:
175 if evt_swp == cleaningLevel:
180 if 'Loose' in cleaningLevel:
186 ConfigFlags,
'JetCleaningTool_'+cleaningLevel+
'_EMTopo',
187 'AntiKt4EMTopo', cleaningLevel,
False))
188 acc.addPublicTool(jetCleaningTool_legacy)
190 ConfigFlags,
'EventCleaningTool_'+wp+
'_EMTopo', cleaningLevel))
191 ecTool_legacy.JetCleanPrefix = prefix
192 ecTool_legacy.JetContainer =
"AntiKt4EMTopoJets"
193 ecTool_legacy.JetCleaningTool = jetCleaningTool_legacy
194 acc.addPublicTool(ecTool_legacy)
196 eventCleanAlg_legacy = CompFactory.EventCleaningTestAlg(
'EventCleaningTestAlg_'+wp+
'_EMTopo',
197 EventCleaningTool=ecTool_legacy,
198 JetCollectionName=
"AntiKt4EMTopoJets",
199 EventCleanPrefix=prefix,
200 CleaningLevel=cleaningLevel,
202 acc.addEventAlgo(eventCleanAlg_legacy)
207 ConfigFlags,
'JetCleaningTool_'+cleaningLevel,
208 'AntiKt4EMPFlowJets', cleaningLevel,
False))
209 acc.addPublicTool(jetCleaningTool)
211 ecTool = acc.popToolsAndMerge(
EventCleaningToolCfg(ConfigFlags,
'EventCleaningTool_' + wp, cleaningLevel))
212 ecTool.JetCleanPrefix = prefix
213 ecTool.JetContainer =
"AntiKt4EMPFlowJets"
214 ecTool.JetCleaningTool = jetCleaningTool
215 acc.addPublicTool(ecTool)
217 eventCleanAlg = CompFactory.EventCleaningTestAlg(
'EventCleaningTestAlg_'+wp,
218 EventCleaningTool=ecTool,
219 JetCollectionName=
"AntiKt4EMPFlowJets",
220 EventCleanPrefix=prefix,
221 CleaningLevel=cleaningLevel,
223 acc.addEventAlgo(eventCleanAlg)