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 AntiKt10UFOCSSKSoftDrop
31 from JetRecConfig.JetRecConfig
import JetRecCfg
35 AntiKt4EMTopo_deriv = AntiKt4EMTopo.clone(
36 modifiers = AntiKt4EMTopo.modifiers+(
"JetPtAssociation",
"QGTagging")
39 AntiKt4EMPFlow_deriv = AntiKt4EMPFlow.clone(
40 ghostdefs = AntiKt4EMPFlow.ghostdefs+[
"UnAssocMuonSegment"],
41 modifiers = AntiKt4EMPFlow.modifiers+(
"JetPtAssociation",
"QGTagging",
"fJVT",
"NNJVT",
"CaloEnergiesClus",
"JetPileupLabel",
"qgtransformer")
44 AntiKt10UFOCSSKSoftDrop_deriv = AntiKt10UFOCSSKSoftDrop.clone(
45 modifiers = AntiKt10UFOCSSKSoftDrop.modifiers+(
"toptransformer",
"wtransformer",
"wtransformer_massdec")
48 jetList = [AntiKt4EMTopo_deriv, AntiKt4EMPFlow_deriv,
49 AntiKtVR30Rmax4Rmin02PV0Track,
50 AntiKt10UFOCSSKSoftDrop_deriv]
58 """Add bad batman decoration for events with large EMEC-IW noise"""
62 CommonAugmentation = CompFactory.DerivationFramework.CommonAugmentation
63 from DerivationFrameworkJetEtMiss.JetToolConfig
import BadBatmanToolCfg
65 acc.addEventAlgo(CommonAugmentation(
"BadBatmanAugmentation", AugmentationTools = [badBatmanTool]))
70 """Add distance in train information to EventInfo"""
71 from DerivationFrameworkJetEtMiss.JetToolConfig
import DistanceInTrainToolCfg
75 CommonAugmentation = CompFactory.DerivationFramework.CommonAugmentation
77 acc.addEventAlgo(CommonAugmentation(
"DistanceInTrainAugmentation", AugmentationTools = [distanceInTrainTool]))
82 """Special rho definitions for PFlow jets"""
83 from JetRecConfig.JetRecConfig
import getInputAlgs,getConstitPJGAlg,reOrderAlgs
84 from JetRecConfig.StandardJetConstits
import stdConstitDic
as cst
85 from JetRecConfig.JetInputConfig
import buildEventShapeAlg
89 constit_algs =
getInputAlgs(cst.GPFlow, flags=ConfigFlags)
90 constit_algs, ca =
reOrderAlgs( [a
for a
in constit_algs
if a
is not None])
93 for a
in constit_algs:
109 from JetJvtEfficiency.JetJvtEfficiencyToolConfig
import getJvtEffToolCfg
111 passJvtTool = acc.popToolsAndMerge(
getJvtEffToolCfg(ConfigFlags, jetContainer))
112 passJvtTool.PassJVTKey =
"{}Jets.DFCommonJets_passJvt".
format(jetContainer)
113 passJvtTool.SuppressOutputDependence =
False
114 kwargs.setdefault(
"Decorators", [passJvtTool])
115 kwargs.setdefault(
"JetContainer",
"{}Jets".
format(jetContainer))
116 acc.addEventAlgo(CompFactory.JetDecorationAlg(algName, **kwargs), primary =
True)
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')
238 for item
in contentlist:
239 if item
not in slimhelper.AppendToDictionary:
240 slimhelper.AppendToDictionary.update({item:
'xAOD::JetContainer',
241 item+
"Aux":
'xAOD::JetAuxContainer'})
242 if item
in smartlist:
243 slimhelper.SmartCollections.append(item)
245 slimhelper.AllVariables.append(item)
253 slimhelper.ExtraVariables.append(
'CaloCalTopoClusters.calE.calEta.calPhi.calM')
256 if "LCOriginTopoClusters" not in slimhelper.AppendToDictionary:
257 slimhelper.AppendToDictionary.update({
"LCOriginTopoClusters":
'xAOD::CaloClusterContainer',
258 "LCOriginTopoClustersAux":
'xAOD::ShallowAuxContainer'})
259 slimhelper.ExtraVariables.append(
'LCOriginTopoClusters.calEta.calPhi.originalObjectLink')
262 if "EMOriginTopoClusters" not in slimhelper.AppendToDictionary:
263 slimhelper.AppendToDictionary.update({
"EMOriginTopoClusters":
'xAOD::CaloClusterContainer',
264 "EMOriginTopoClustersAux":
'xAOD::ShallowAuxContainer'})
265 slimhelper.ExtraVariables.append(
'EMOriginTopoClusters.calE.calEta.calPhi.originalObjectLink')