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
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)"
59 name =
"JETM7MuonTPThinningTool",
60 StreamName = kwargs[
'StreamName'],
62 SelectionString = muonSelectionString,
63 InDetTrackParticlesKey =
"InDetTrackParticles"))
67 name =
"JETM7ElectronTPThinningTool",
68 StreamName = kwargs[
'StreamName'],
70 SelectionString = electronSelectionString,
71 InDetTrackParticlesKey =
"InDetTrackParticles"))
75 name =
"JETM7Akt4JetTPThinningTool",
76 StreamName = kwargs[
'StreamName'],
77 JetKey =
"AntiKt4EMPFlowByVertexJets",
78 SelectionString = jetSelectionString,
79 InDetTrackParticlesKey =
"InDetTrackParticles"))
84 name =
"JETM7Akt4PFlowByVertexJetThinningTool",
85 ContainerName =
"AntiKt4EMPFlowByVertexJets",
86 StreamName = kwargs[
'StreamName'],
87 SelectionString = jetSelectionString))
91 name =
"JETM7Akt4PFlowJetThinningTool",
92 ContainerName =
"AntiKt4EMPFlowJets",
93 StreamName = kwargs[
'StreamName'],
94 SelectionString =
"(abs(AntiKt4EMPFlowJets.eta) > 2.4)"))
98 name =
"JETM7MuonThinningTool",
99 ContainerName =
"Muons",
100 StreamName = kwargs[
'StreamName'],
101 SelectionString = muonSelectionString))
105 name =
"JETM7ElectronThinningTool",
106 ContainerName =
"Electrons",
107 StreamName = kwargs[
'StreamName'],
108 SelectionString = electronSelectionString))
112 name =
"JETM7PhotonThinningTool",
113 ContainerName =
"Photons",
114 StreamName = kwargs[
'StreamName'],
115 SelectionString = photonSelectionString))
122 thinningTools = [JETM7MuonTPThinningTool,
123 JETM7ElectronTPThinningTool,
124 JETM7Akt4JetTPThinningTool,
125 JETM7Akt4PFlowByVertexJetThinningTool,
126 JETM7Akt4PFlowJetThinningTool,
127 JETM7MuonThinningTool,
128 JETM7ElectronThinningTool,
129 JETM7PhotonThinningTool,
132 DerivationKernel = CompFactory.DerivationFramework.DerivationKernel
134 ThinningTools = thinningTools,
135 SkimmingTools =[skimmingTool]
if not flags.Input.isMC
else []))
144 from JetRecConfig.JetRecConfig
import JetRecCfg
145 from JetRecConfig.StandardSmallRJets
import AntiKt4PV0Track, AntiKt4EMPFlowByVertex
150 jetList = [AntiKt4PV0Track]
155 jetList += [AntiKt4EMPFlowByVertex]
166 from DerivationFrameworkMCTruth.MCTruthCommonConfig
import AddTopQuarkAndDownstreamParticlesCfg
175 if flags.Trigger.EDMVersion == 2:
176 triggerNames = [
"JetContainer_a4tcemsubjesFS",
"JetContainer_a4tcemsubjesISFS",
"JetContainer_a10tclcwsubjesFS",
"JetContainer_GSCJet"]
178 for trigger
in triggerNames:
179 wrapperName = trigger+
'AuxWrapper'
180 auxContainerName =
'HLT_xAOD__'+trigger+
'Aux'
182 acc.addEventAlgo(CompFactory.xAODMaker.AuxStoreWrapper( wrapperName, SGKeys = [ auxContainerName+
"." ] ))
194 from DerivationFrameworkPhys.TriggerListsHelper
import TriggerListsHelper
195 JETM7TriggerListsHelper = TriggerListsHelper(flags)
198 acc.merge(
JETM7KernelCfg(flags, name=
"JETM7Kernel", StreamName =
'StreamDAOD_JETM7', TriggerListsHelper = JETM7TriggerListsHelper))
203 from OutputStreamAthenaPool.OutputStreamConfig
import OutputStreamCfg
204 from xAODMetaDataCnv.InfileMetaDataConfig
import SetupMetaDataForStreamCfg
205 from DerivationFrameworkCore.SlimmingHelper
import SlimmingHelper
207 JETM7SlimmingHelper =
SlimmingHelper(
"JETM7SlimmingHelper", NamesAndTypes = flags.Input.TypedCollections, flags = flags)
209 JETM7SlimmingHelper.SmartCollections = [
"Electrons",
"Photons",
"Muons",
211 "InDetTrackParticles",
212 "AntiKt4EMPFlowJets",
217 JETM7SlimmingHelper.ExtraVariables = [
"InDetTrackParticles.TTVA_AMVFVertices.TTVA_AMVFWeights"]
222 from DerivationFrameworkMCTruth.MCTruthCommonConfig
import addTruth3ContentToSlimmerTool
225 JETM7SlimmingHelper.AppendToDictionary.update({
'TruthParticles':
'xAOD::TruthParticleContainer',
226 'TruthParticlesAux':
'xAOD::TruthParticleAuxContainer'})
228 JETM7SlimmingHelper.SmartCollections += [
"AntiKt4TruthWZJets"]
230 JETM7SlimmingHelper.AllVariables += [
"TruthTopQuarkWithDecayParticles",
"TruthTopQuarkWithDecayVertices",
231 "AntiKt4TruthJets",
"InTimeAntiKt4TruthJets",
"OutOfTimeAntiKt4TruthJets",
"TruthParticles",
232 "TruthVertices",
"TruthEvents"]
233 JETM7SlimmingHelper.ExtraVariables += [
"InDetTrackParticles.truthMatchProbability",
"TruthVertices.barcode.z"]
237 JETM7SlimmingHelper.IncludeTriggerNavigation =
True
238 JETM7SlimmingHelper.IncludeJetTriggerContent =
False
239 JETM7SlimmingHelper.IncludeMuonTriggerContent =
False
240 JETM7SlimmingHelper.IncludeEGammaTriggerContent =
False
241 JETM7SlimmingHelper.IncludeTauTriggerContent =
False
242 JETM7SlimmingHelper.IncludeEtMissTriggerContent =
False
243 JETM7SlimmingHelper.IncludeBJetTriggerContent =
False
244 JETM7SlimmingHelper.IncludeBPhysTriggerContent =
False
245 JETM7SlimmingHelper.IncludeMinBiasTriggerContent =
False
249 if flags.Trigger.EDMVersion == 2:
250 from DerivationFrameworkPhys.TriggerMatchingCommonConfig
import AddRun2TriggerMatchingToSlimmingHelper
252 OutputContainerPrefix =
"TrigMatch_",
253 TriggerList = JETM7TriggerListsHelper.Run2TriggerNamesTau)
255 OutputContainerPrefix =
"TrigMatch_",
256 TriggerList = JETM7TriggerListsHelper.Run2TriggerNamesNoTau)
258 if flags.Trigger.EDMVersion == 3
or (flags.Trigger.EDMVersion == 2
and flags.Trigger.doEDMVersionConversion):
259 from TrigNavSlimmingMT.TrigNavSlimmingMTConfig
import AddRun3TrigNavSlimmingCollectionsToSlimmingHelper
262 jetOutputList = [
"AntiKt4EMPFlowByVertexJets"]
263 from DerivationFrameworkJetEtMiss.JetCommonConfig
import addJetsToSlimmingTool
267 JETM7ItemList = JETM7SlimmingHelper.GetItemList()
268 acc.merge(
OutputStreamCfg(flags,
"DAOD_JETM7", ItemList=JETM7ItemList, AcceptAlgs=[
"JETM7Kernel"]))
269 acc.merge(
SetupMetaDataForStreamCfg(flags,
"DAOD_JETM7", AcceptAlgs=[
"JETM7Kernel"], createMetadata=[MetadataCategory.CutFlowMetaData]))