8 from AthenaConfiguration.ComponentAccumulator
import ComponentAccumulator
9 from AthenaConfiguration.ComponentFactory
import CompFactory
12 """Main config for jet reconstruction and decorations"""
17 if "McEventCollection#GEN_EVENT" not in ConfigFlags.Input.TypedCollections:
27 """Jet reconstruction needed for PHYS/PHYSLITE"""
29 from JetRecConfig.StandardSmallRJets
import AntiKt4EMTopo,AntiKt4EMPFlow,AntiKtVR30Rmax4Rmin02PV0Track
30 from JetRecConfig.StandardLargeRJets
import AntiKt10LCTopoTrimmed,AntiKt10UFOCSSKSoftDrop
31 from JetRecConfig.JetRecConfig
import JetRecCfg
35 AntiKt4EMTopo_deriv = AntiKt4EMTopo.clone(
36 modifiers = AntiKt4EMTopo.modifiers+(
"JetPtAssociation",
"QGTagging")
39 AntiKt4EMPFlow_deriv = AntiKt4EMPFlow.clone(
40 modifiers = AntiKt4EMPFlow.modifiers+(
"JetPtAssociation",
"QGTagging",
"fJVT",
"NNJVT",
"CaloEnergiesClus",
"JetPileupLabel")
43 jetList = [AntiKt4EMTopo_deriv, AntiKt4EMPFlow_deriv,
44 AntiKtVR30Rmax4Rmin02PV0Track,
45 AntiKt10LCTopoTrimmed,AntiKt10UFOCSSKSoftDrop]
54 """Add bad batman decoration for events with large EMEC-IW noise"""
58 CommonAugmentation = CompFactory.DerivationFramework.CommonAugmentation
59 from DerivationFrameworkJetEtMiss.JetToolConfig
import BadBatmanToolCfg
61 acc.addEventAlgo(CommonAugmentation(
"BadBatmanAugmentation", AugmentationTools = [badBatmanTool]))
66 """Add distance in train information to EventInfo"""
67 from DerivationFrameworkJetEtMiss.JetToolConfig
import DistanceInTrainToolCfg
71 CommonAugmentation = CompFactory.DerivationFramework.CommonAugmentation
73 acc.addEventAlgo(CommonAugmentation(
"DistanceInTrainAugmentation", AugmentationTools = [distanceInTrainTool]))
78 """Special rho definitions for PFlow jets"""
79 from JetRecConfig.JetRecConfig
import getInputAlgs,getConstitPJGAlg,reOrderAlgs
80 from JetRecConfig.StandardJetConstits
import stdConstitDic
as cst
81 from JetRecConfig.JetInputConfig
import buildEventShapeAlg
85 constit_algs =
getInputAlgs(cst.GPFlow, flags=ConfigFlags)
86 constit_algs, ca =
reOrderAlgs( [a
for a
in constit_algs
if a
is not None])
89 for a
in constit_algs:
105 from JetJvtEfficiency.JetJvtEfficiencyToolConfig
import getJvtEffToolCfg
107 passJvtTool = acc.popToolsAndMerge(
getJvtEffToolCfg(ConfigFlags, jetContainer))
108 passJvtTool.PassJVTKey =
"{}Jets.DFCommonJets_passJvt".
format(jetContainer)
109 passJvtTool.SuppressOutputDependence =
False
110 kwargs.setdefault(
"Decorators", [passJvtTool])
111 kwargs.setdefault(
"JetContainer",
"{}Jets".
format(jetContainer))
112 acc.addEventAlgo(CompFactory.JetDecorationAlg(algName, **kwargs), primary =
True)
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')
263 for item
in contentlist:
264 if item
not in slimhelper.AppendToDictionary:
265 slimhelper.AppendToDictionary.update({item:
'xAOD::JetContainer',
266 item+
"Aux":
'xAOD::JetAuxContainer'})
267 if item
in smartlist:
268 slimhelper.SmartCollections.append(item)
270 slimhelper.AllVariables.append(item)
278 slimhelper.ExtraVariables.append(
'CaloCalTopoClusters.calE.calEta.calPhi.calM')
281 if "LCOriginTopoClusters" not in slimhelper.AppendToDictionary:
282 slimhelper.AppendToDictionary.update({
"LCOriginTopoClusters":
'xAOD::CaloClusterContainer',
283 "LCOriginTopoClustersAux":
'xAOD::ShallowAuxContainer'})
284 slimhelper.ExtraVariables.append(
'LCOriginTopoClusters.calEta.calPhi.originalObjectLink')
287 if "EMOriginTopoClusters" not in slimhelper.AppendToDictionary:
288 slimhelper.AppendToDictionary.update({
"EMOriginTopoClusters":
'xAOD::CaloClusterContainer',
289 "EMOriginTopoClustersAux":
'xAOD::ShallowAuxContainer'})
290 slimhelper.ExtraVariables.append(
'EMOriginTopoClusters.calE.calEta.calPhi.originalObjectLink')