8 from AthenaConfiguration.ComponentAccumulator
import ComponentAccumulator
9 from AthenaConfiguration.ComponentFactory
import CompFactory
10 from AthenaConfiguration.Enums
import MetadataCategory
14 """Configure the skimming tool"""
18 jetSelection =
'(count(AntiKt4EMPFlowJets.pt > 10.*GeV && abs(AntiKt4EMPFlowJets.eta) < 2.5) >= 1)'
19 JETM7OfflineSkimmingTool = CompFactory.DerivationFramework.xAODStringSkimmingTool(name =
"JETM7OfflineSkimmingTool1",
20 expression = jetSelection)
22 acc.addPublicTool(JETM7OfflineSkimmingTool, primary=
True)
28 """Configure the derivation framework driving algorithm (kernel) for JETM7"""
32 if not flags.Input.isMC:
36 from DerivationFrameworkPhys.PhysCommonConfig
import PhysCommonAugmentationsCfg
39 from DerivationFrameworkInDet.InDetToolsConfig
import InDetTrackSelectionToolWrapperCfg
42 name =
"DFJETM7CommonTrackSelectionLoose",
44 DecorationName =
"DFJETM7Loose"))
46 acc.addEventAlgo(CompFactory.DerivationFramework.CommonAugmentation(
"JETM7CommonKernel", AugmentationTools = [DFCommonTrackSelection]))
49 from DerivationFrameworkInDet.InDetToolsConfig
import MuonTrackParticleThinningCfg, EgammaTrackParticleThinningCfg, JetTrackParticleThinningCfg
51 from DerivationFrameworkTools.DerivationFrameworkToolsConfig
import GenericObjectThinningCfg
53 muonSelectionString =
"(Muons.pt > 5*GeV)"
54 electronSelectionString =
"(Electrons.pt > 5*GeV)"
55 photonSelectionString =
"(Photons.pt > 5*GeV)"
56 jetSelectionString =
"(AntiKt4EMPFlowByVertexJets.pt > 7.*GeV && AntiKt4EMPFlowByVertexJets.Jvt > 0.4)"
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"))
76 name =
"JETM7Akt4JetTPThinningTool",
77 StreamName = kwargs[
'StreamName'],
78 JetKey =
"AntiKt4EMPFlowByVertexJets",
79 SelectionString = jetSelectionString,
80 InDetTrackParticlesKey =
"InDetTrackParticles"))
85 name =
"JETM7Akt4PFlowByVertexJetThinningTool",
86 ContainerName =
"AntiKt4EMPFlowByVertexJets",
87 StreamName = kwargs[
'StreamName'],
88 SelectionString = jetSelectionString))
92 name =
"JETM7Akt4PFlowJetThinningTool",
93 ContainerName =
"AntiKt4EMPFlowJets",
94 StreamName = kwargs[
'StreamName'],
95 SelectionString =
"(abs(AntiKt4EMPFlowJets.eta) > 2.4)"))
99 name =
"JETM7MuonThinningTool",
100 ContainerName =
"Muons",
101 StreamName = kwargs[
'StreamName'],
102 SelectionString = muonSelectionString))
106 name =
"JETM7ElectronThinningTool",
107 ContainerName =
"Electrons",
108 StreamName = kwargs[
'StreamName'],
109 SelectionString = electronSelectionString))
113 name =
"JETM7PhotonThinningTool",
114 ContainerName =
"Photons",
115 StreamName = kwargs[
'StreamName'],
116 SelectionString = photonSelectionString))
123 thinningTools = [JETM7MuonTPThinningTool,
124 JETM7ElectronTPThinningTool,
125 JETM7Akt4JetTPThinningTool,
126 JETM7Akt4PFlowByVertexJetThinningTool,
127 JETM7Akt4PFlowJetThinningTool,
128 JETM7MuonThinningTool,
129 JETM7ElectronThinningTool,
130 JETM7PhotonThinningTool,
133 DerivationKernel = CompFactory.DerivationFramework.DerivationKernel
135 ThinningTools = thinningTools,
136 SkimmingTools =[skimmingTool]
if not flags.Input.isMC
else []))
145 from JetRecConfig.JetRecConfig
import JetRecCfg
146 from JetRecConfig.StandardSmallRJets
import AntiKt4PV0Track, AntiKt4EMPFlowByVertex
151 jetList = [AntiKt4PV0Track]
156 jetList += [AntiKt4EMPFlowByVertex]
167 from DerivationFrameworkMCTruth.MCTruthCommonConfig
import AddTopQuarkAndDownstreamParticlesCfg
176 if flags.Trigger.EDMVersion == 2:
177 triggerNames = [
"JetContainer_a4tcemsubjesFS",
"JetContainer_a4tcemsubjesISFS",
"JetContainer_a10tclcwsubjesFS",
"JetContainer_GSCJet"]
179 for trigger
in triggerNames:
180 wrapperName = trigger+
'AuxWrapper'
181 auxContainerName =
'HLT_xAOD__'+trigger+
'Aux'
183 acc.addEventAlgo(CompFactory.xAODMaker.AuxStoreWrapper( wrapperName, SGKeys = [ auxContainerName+
"." ] ))
195 from DerivationFrameworkPhys.TriggerListsHelper
import TriggerListsHelper
196 JETM7TriggerListsHelper = TriggerListsHelper(flags)
199 acc.merge(
JETM7KernelCfg(flags, name=
"JETM7Kernel", StreamName =
'StreamDAOD_JETM7', TriggerListsHelper = JETM7TriggerListsHelper))
204 from OutputStreamAthenaPool.OutputStreamConfig
import OutputStreamCfg
205 from xAODMetaDataCnv.InfileMetaDataConfig
import SetupMetaDataForStreamCfg
206 from DerivationFrameworkCore.SlimmingHelper
import SlimmingHelper
208 JETM7SlimmingHelper =
SlimmingHelper(
"JETM7SlimmingHelper", NamesAndTypes = flags.Input.TypedCollections, flags = flags)
210 JETM7SlimmingHelper.SmartCollections = [
"Electrons",
"Photons",
"Muons",
212 "InDetTrackParticles",
213 "AntiKt4EMPFlowJets",
218 JETM7SlimmingHelper.ExtraVariables = [
"InDetTrackParticles.TTVA_AMVFVertices.TTVA_AMVFWeights"]
223 from DerivationFrameworkMCTruth.MCTruthCommonConfig
import addTruth3ContentToSlimmerTool
226 JETM7SlimmingHelper.AppendToDictionary.update({
'TruthParticles':
'xAOD::TruthParticleContainer',
227 'TruthParticlesAux':
'xAOD::TruthParticleAuxContainer'})
229 JETM7SlimmingHelper.SmartCollections += [
"AntiKt4TruthWZJets"]
231 JETM7SlimmingHelper.AllVariables += [
"TruthTopQuarkWithDecayParticles",
"TruthTopQuarkWithDecayVertices",
232 "AntiKt4TruthJets",
"InTimeAntiKt4TruthJets",
"OutOfTimeAntiKt4TruthJets",
"TruthParticles",
233 "TruthVertices",
"TruthEvents"]
234 JETM7SlimmingHelper.ExtraVariables += [
"InDetTrackParticles.truthMatchProbability",
"TruthVertices.barcode.z"]
238 JETM7SlimmingHelper.IncludeTriggerNavigation =
True
239 JETM7SlimmingHelper.IncludeJetTriggerContent =
False
240 JETM7SlimmingHelper.IncludeMuonTriggerContent =
False
241 JETM7SlimmingHelper.IncludeEGammaTriggerContent =
False
242 JETM7SlimmingHelper.IncludeTauTriggerContent =
False
243 JETM7SlimmingHelper.IncludeEtMissTriggerContent =
False
244 JETM7SlimmingHelper.IncludeBJetTriggerContent =
False
245 JETM7SlimmingHelper.IncludeBPhysTriggerContent =
False
246 JETM7SlimmingHelper.IncludeMinBiasTriggerContent =
False
250 if flags.Trigger.EDMVersion == 2:
251 from DerivationFrameworkPhys.TriggerMatchingCommonConfig
import AddRun2TriggerMatchingToSlimmingHelper
253 OutputContainerPrefix =
"TrigMatch_",
254 TriggerList = JETM7TriggerListsHelper.Run2TriggerNamesTau)
256 OutputContainerPrefix =
"TrigMatch_",
257 TriggerList = JETM7TriggerListsHelper.Run2TriggerNamesNoTau)
259 if flags.Trigger.EDMVersion == 3
or (flags.Trigger.EDMVersion == 2
and flags.Trigger.doEDMVersionConversion):
260 from TrigNavSlimmingMT.TrigNavSlimmingMTConfig
import AddRun3TrigNavSlimmingCollectionsToSlimmingHelper
263 jetOutputList = [
"AntiKt4EMPFlowByVertexJets"]
264 from DerivationFrameworkJetEtMiss.JetCommonConfig
import addJetsToSlimmingTool
268 JETM7ItemList = JETM7SlimmingHelper.GetItemList()
269 acc.merge(
OutputStreamCfg(flags,
"DAOD_JETM7", ItemList=JETM7ItemList, AcceptAlgs=[
"JETM7Kernel"]))
270 acc.merge(
SetupMetaDataForStreamCfg(flags,
"DAOD_JETM7", AcceptAlgs=[
"JETM7Kernel"], createMetadata=[MetadataCategory.CutFlowMetaData]))