7 from AthenaConfiguration.ComponentAccumulator
import ComponentAccumulator
8 from AthenaConfiguration.ComponentFactory
import CompFactory
9 from AthenaConfiguration.Enums
import MetadataCategory
13 """Configure the skimming tool"""
17 jetSelection =
'(count(AntiKt4EMPFlowJets.pt > 10.*GeV && abs(AntiKt4EMPFlowJets.eta) < 2.5) >= 1)'
18 JETM7OfflineSkimmingTool = CompFactory.DerivationFramework.xAODStringSkimmingTool(name =
"JETM7OfflineSkimmingTool1",
19 expression = jetSelection)
21 acc.addPublicTool(JETM7OfflineSkimmingTool, primary=
True)
27 """Configure the derivation framework driving algorithm (kernel) for JETM7"""
31 if not flags.Input.isMC:
35 from DerivationFrameworkPhys.PhysCommonConfig
import PhysCommonAugmentationsCfg
38 from DerivationFrameworkInDet.InDetToolsConfig
import InDetTrackSelectionToolWrapperCfg
41 name =
"DFJETM7CommonTrackSelectionLoose",
43 DecorationName =
"DFJETM7Loose"))
45 acc.addEventAlgo(CompFactory.DerivationFramework.CommonAugmentation(
"JETM7CommonKernel", AugmentationTools = [DFCommonTrackSelection]))
48 from DerivationFrameworkInDet.InDetToolsConfig
import MuonTrackParticleThinningCfg, EgammaTrackParticleThinningCfg, JetTrackParticleThinningCfg, TauTrackParticleThinningCfg
50 from DerivationFrameworkTools.DerivationFrameworkToolsConfig
import GenericObjectThinningCfg
52 muonSelectionString =
"(Muons.pt > 5*GeV)"
53 electronSelectionString =
"(Electrons.pt > 5*GeV)"
54 photonSelectionString =
"(Photons.pt > 5*GeV)"
55 jetSelectionString =
"(AntiKt4EMPFlowByVertexJets.pt > 7.*GeV && AntiKt4EMPFlowByVertexJets.Jvt > 0.4)"
56 tauJetSelectionString =
"(TauJets.pt > 20.*GeV && TauJets.nTracks > 0)"
60 name =
"JETM7MuonTPThinningTool",
61 StreamName = kwargs[
'StreamName'],
63 SelectionString = muonSelectionString,
64 InDetTrackParticlesKey =
"InDetTrackParticles"))
68 name =
"JETM7ElectronTPThinningTool",
69 StreamName = kwargs[
'StreamName'],
71 SelectionString = electronSelectionString,
72 InDetTrackParticlesKey =
"InDetTrackParticles"))
77 name =
"JETM7TauTPThinningTool",
78 StreamName = kwargs[
'StreamName'],
80 SelectionString = tauJetSelectionString,
81 InDetTrackParticlesKey =
"InDetTrackParticles",
82 DoTauTracksThinning =
True,
84 TauTracksKey =
"TauTracks"))
88 name =
"JETM7Akt4JetTPThinningTool",
89 StreamName = kwargs[
'StreamName'],
90 JetKey =
"AntiKt4EMPFlowByVertexJets",
91 SelectionString = jetSelectionString,
92 InDetTrackParticlesKey =
"InDetTrackParticles"))
98 name =
"JETM7Akt4PFlowByVertexJetThinningTool",
99 ContainerName =
"AntiKt4EMPFlowByVertexJets",
100 StreamName = kwargs[
'StreamName'],
101 SelectionString = jetSelectionString))
105 name =
"JETM7Akt4PFlowJetThinningTool",
106 ContainerName =
"AntiKt4EMPFlowJets",
107 StreamName = kwargs[
'StreamName'],
108 SelectionString =
"(abs(AntiKt4EMPFlowJets.eta) > 2.4)"))
112 name =
"JETM7MuonThinningTool",
113 ContainerName =
"Muons",
114 StreamName = kwargs[
'StreamName'],
115 SelectionString = muonSelectionString))
119 name =
"JETM7ElectronThinningTool",
120 ContainerName =
"Electrons",
121 StreamName = kwargs[
'StreamName'],
122 SelectionString = electronSelectionString))
125 name =
"JETM7TauJetThinningTool",
126 ContainerName =
"TauJets",
127 StreamName = kwargs[
'StreamName'],
128 SelectionString = tauJetSelectionString))
131 name =
"JETM7PhotonThinningTool",
132 ContainerName =
"Photons",
133 StreamName = kwargs[
'StreamName'],
134 SelectionString = photonSelectionString))
141 thinningTools = [JETM7MuonTPThinningTool,
142 JETM7ElectronTPThinningTool,
143 JETM7TauTPThinningTool,
144 JETM7Akt4JetTPThinningTool,
145 JETM7Akt4PFlowByVertexJetThinningTool,
146 JETM7Akt4PFlowJetThinningTool,
147 JETM7MuonThinningTool,
148 JETM7ElectronThinningTool,
149 JETM7TauJetThinningTool,
150 JETM7PhotonThinningTool,
153 DerivationKernel = CompFactory.DerivationFramework.DerivationKernel
155 ThinningTools = thinningTools,
156 SkimmingTools = [skimmingTool]
if not flags.Input.isMC
else []))
165 from JetRecConfig.JetRecConfig
import JetRecCfg
166 from JetRecConfig.StandardSmallRJets
import AntiKt4PV0Track, AntiKt4EMPFlowByVertex
171 jetList = [AntiKt4PV0Track]
176 jetList += [AntiKt4EMPFlowByVertex]
187 from DerivationFrameworkMCTruth.MCTruthCommonConfig
import AddTopQuarkAndDownstreamParticlesCfg
196 if flags.Trigger.EDMVersion == 2:
197 triggerNames = [
"JetContainer_a4tcemsubjesFS",
"JetContainer_a4tcemsubjesISFS",
"JetContainer_a10tclcwsubjesFS",
"JetContainer_GSCJet"]
199 for trigger
in triggerNames:
200 wrapperName = trigger+
'AuxWrapper'
201 auxContainerName =
'HLT_xAOD__'+trigger+
'Aux'
203 acc.addEventAlgo(CompFactory.xAODMaker.AuxStoreWrapper( wrapperName, SGKeys = [ auxContainerName+
"." ] ))
215 from DerivationFrameworkPhys.TriggerListsHelper
import TriggerListsHelper
216 JETM7TriggerListsHelper = TriggerListsHelper(flags)
219 acc.merge(
JETM7KernelCfg(flags, name=
"JETM7Kernel", StreamName =
'StreamDAOD_JETM7', TriggerListsHelper = JETM7TriggerListsHelper))
224 from OutputStreamAthenaPool.OutputStreamConfig
import OutputStreamCfg
225 from xAODMetaDataCnv.InfileMetaDataConfig
import SetupMetaDataForStreamCfg
226 from DerivationFrameworkCore.SlimmingHelper
import SlimmingHelper
228 JETM7SlimmingHelper =
SlimmingHelper(
"JETM7SlimmingHelper", NamesAndTypes = flags.Input.TypedCollections, flags = flags)
230 JETM7SlimmingHelper.SmartCollections = [
"Electrons",
"Photons",
"Muons",
"TauJets",
232 "InDetTrackParticles",
233 "AntiKt4EMPFlowJets",
238 JETM7SlimmingHelper.ExtraVariables = [
"InDetTrackParticles.TTVA_AMVFVertices.TTVA_AMVFWeights"]
243 from DerivationFrameworkMCTruth.MCTruthCommonConfig
import addTruth3ContentToSlimmerTool
246 JETM7SlimmingHelper.AppendToDictionary.update({
'TruthParticles':
'xAOD::TruthParticleContainer',
247 'TruthParticlesAux':
'xAOD::TruthParticleAuxContainer'})
249 JETM7SlimmingHelper.SmartCollections += [
"AntiKt4TruthWZJets"]
251 JETM7SlimmingHelper.AllVariables += [
"TruthTopQuarkWithDecayParticles",
"TruthTopQuarkWithDecayVertices",
252 "AntiKt4TruthJets",
"InTimeAntiKt4TruthJets",
"OutOfTimeAntiKt4TruthJets",
"TruthParticles",
253 "TruthVertices",
"TruthEvents"]
254 JETM7SlimmingHelper.ExtraVariables += [
"InDetTrackParticles.truthMatchProbability",
"TruthVertices.uid.z"]
258 JETM7SlimmingHelper.IncludeTriggerNavigation =
True
259 JETM7SlimmingHelper.IncludeJetTriggerContent =
False
260 JETM7SlimmingHelper.IncludeMuonTriggerContent =
False
261 JETM7SlimmingHelper.IncludeEGammaTriggerContent =
False
262 JETM7SlimmingHelper.IncludeTauTriggerContent =
False
263 JETM7SlimmingHelper.IncludeEtMissTriggerContent =
False
264 JETM7SlimmingHelper.IncludeBJetTriggerContent =
False
265 JETM7SlimmingHelper.IncludeBPhysTriggerContent =
False
266 JETM7SlimmingHelper.IncludeMinBiasTriggerContent =
False
270 if flags.Trigger.EDMVersion == 2:
271 from DerivationFrameworkPhys.TriggerMatchingCommonConfig
import AddRun2TriggerMatchingToSlimmingHelper
273 OutputContainerPrefix =
"TrigMatch_",
274 TriggerList = JETM7TriggerListsHelper.Run2TriggerNamesTau)
276 OutputContainerPrefix =
"TrigMatch_",
277 TriggerList = JETM7TriggerListsHelper.Run2TriggerNamesNoTau)
279 if flags.Trigger.EDMVersion == 3
or (flags.Trigger.EDMVersion == 2
and flags.Trigger.doEDMVersionConversion):
280 from TrigNavSlimmingMT.TrigNavSlimmingMTConfig
import AddRun3TrigNavSlimmingCollectionsToSlimmingHelper
283 jetOutputList = [
"AntiKt4EMPFlowByVertexJets"]
284 from DerivationFrameworkJetEtMiss.JetCommonConfig
import addJetsToSlimmingTool
288 JETM7ItemList = JETM7SlimmingHelper.GetItemList()
289 acc.merge(
OutputStreamCfg(flags,
"DAOD_JETM7", ItemList=JETM7ItemList, AcceptAlgs=[
"JETM7Kernel"]))
290 acc.merge(
SetupMetaDataForStreamCfg(flags,
"DAOD_JETM7", AcceptAlgs=[
"JETM7Kernel"], createMetadata=[MetadataCategory.CutFlowMetaData]))