120 """Add event cleaning flags"""
123 acc.merge(
AddJvtDecorationAlgCfg(ConfigFlags, algName=
"JvtPassDecorAlg_EMTopo", jetContainer=
'AntiKt4EMTopo'))
126 from DerivationFrameworkTau.TauCommonConfig
import AddTauAugmentationCfg
128 acc.addSequence(CompFactory.AthSequencer(
'EventCleanSeq', Sequential=
True))
131 from AssociationUtils.AssociationUtilsConfig
import OverlapRemovalToolCfg
132 inputLabel_legacy =
'selected_eventClean_EMTopo'
133 outputLabel_legacy =
'DFCommonJets_passOR_EMTopo'
135 tauLabel =
'DFTauRNNLoose'
136 orTool_legacy = acc.popToolsAndMerge(
OverlapRemovalToolCfg(ConfigFlags,inputLabel=inputLabel_legacy,outputLabel=outputLabel_legacy,bJetLabel=bJetLabel))
137 algOR_legacy = CompFactory.OverlapRemovalGenUseAlg(
'OverlapRemovalGenUseAlg_EMTopo',
138 JetKey=
"AntiKt4EMTopoJets",
139 SelectionLabel=inputLabel_legacy,
140 OverlapLabel=outputLabel_legacy,
141 OverlapRemovalTool=orTool_legacy,
145 acc.addEventAlgo(algOR_legacy,
'EventCleanSeq')
148 inputLabel =
'selected_eventClean_EMPFlow'
149 outputLabel =
'DFCommonJets_passOR_EMPFlow'
150 orTool = acc.popToolsAndMerge(
OverlapRemovalToolCfg(ConfigFlags,inputLabel=inputLabel,outputLabel=outputLabel,bJetLabel=bJetLabel))
151 algOR = CompFactory.OverlapRemovalGenUseAlg(
'OverlapRemovalGenUseAlg',
152 SelectionLabel=inputLabel,
153 OverlapLabel=outputLabel,
154 OverlapRemovalTool=orTool,
157 acc.addEventAlgo(algOR,
'EventCleanSeq')
159 CommonAugmentation = CompFactory.DerivationFramework.CommonAugmentation
160 from DerivationFrameworkMuons.MuonsToolsConfig
import MuonJetDrToolCfg
161 muonJetDrTool = acc.getPrimaryAndMerge(
MuonJetDrToolCfg(ConfigFlags,
"MuonJetDrTool"))
162 acc.addEventAlgo(CommonAugmentation(
"DFCommonMuonsKernel2", AugmentationTools = [muonJetDrTool]),
'EventCleanSeq')
164 from JetSelectorTools.JetSelectorToolsConfig
import EventCleaningToolCfg,JetCleaningToolCfg
166 supportedWPs = [
'Loose',
'Tight',
'LooseLLP',
'VeryLooseLLP',
'SuperLooseLLP']
167 prefix =
"DFCommonJets_"
168 evt_lvl_suppWPs_PFlow = [
'LooseBad',
'TightBad']
170 for wp
in workingPoints:
171 if wp
not in supportedWPs:
174 cleaningLevel = wp +
'Bad'
177 cleaningLevel = wp.replace(
'LLP',
'BadLLP')
181 for evt_swp
in evt_lvl_suppWPs_PFlow:
182 if evt_swp == cleaningLevel:
187 if 'Loose' in cleaningLevel:
193 ConfigFlags,
'JetCleaningTool_'+cleaningLevel+
'_EMTopo',
194 'AntiKt4EMTopo', cleaningLevel,
False))
195 acc.addPublicTool(jetCleaningTool_legacy)
197 ConfigFlags,
'EventCleaningTool_'+wp+
'_EMTopo', cleaningLevel))
198 ecTool_legacy.JetCleanPrefix = prefix
199 ecTool_legacy.OrDecorator =
"passOR_EMTopo"
200 ecTool_legacy.JetContainer =
"AntiKt4EMTopoJets"
201 ecTool_legacy.JetCleaningTool = jetCleaningTool_legacy
202 acc.addPublicTool(ecTool_legacy)
204 eventCleanAlg_legacy = CompFactory.EventCleaningTestAlg(
'EventCleaningTestAlg_'+wp+
'_EMTopo',
205 EventCleaningTool=ecTool_legacy,
206 JetCollectionName=
"AntiKt4EMTopoJets",
207 EventCleanPrefix=prefix,
208 CleaningLevel=cleaningLevel,
210 acc.addEventAlgo(eventCleanAlg_legacy,
'EventCleanSeq')
215 ConfigFlags,
'JetCleaningTool_'+cleaningLevel,
216 'AntiKt4EMPFlowJets', cleaningLevel,
False))
217 acc.addPublicTool(jetCleaningTool)
219 ecTool = acc.popToolsAndMerge(
EventCleaningToolCfg(ConfigFlags,
'EventCleaningTool_' + wp, cleaningLevel))
220 ecTool.JetCleanPrefix = prefix
221 ecTool.OrDecorator =
"passOR_EMPFlow"
222 ecTool.JetContainer =
"AntiKt4EMPFlowJets"
223 ecTool.JetCleaningTool = jetCleaningTool
224 acc.addPublicTool(ecTool)
226 eventCleanAlg = CompFactory.EventCleaningTestAlg(
'EventCleaningTestAlg_'+wp,
227 EventCleaningTool=ecTool,
228 JetCollectionName=
"AntiKt4EMPFlowJets",
229 EventCleanPrefix=prefix,
230 CleaningLevel=cleaningLevel,
232 acc.addEventAlgo(eventCleanAlg,
'EventCleanSeq')