8 from AthenaConfiguration.ComponentAccumulator
import ComponentAccumulator
9 from AthenaConfiguration.ComponentFactory
import CompFactory
10 from AthenaConfiguration.Enums
import MetadataCategory
14 """Configure the derivation framework driving algorithm (kernel) for STDM13"""
18 from DerivationFrameworkPhys.PhysCommonConfig
import PhysCommonAugmentationsCfg
21 from DerivationFrameworkInDet.InDetToolsConfig
import TrackParticleThinningCfg
24 lepton_skimming_expression =
'count( (Muons.pt > 25*GeV) && (0 == Muons.muonType || 1 == Muons.muonType || 4 == Muons.muonType) ) + count(( Electrons.pt > 25*GeV) && ((Electrons.Loose) || (Electrons.DFCommonElectronsLHLoose))) >= 1'
26 STDM13StringSkimmingTool = CompFactory.DerivationFramework.xAODStringSkimmingTool(
27 name =
"STDM13StringSkimmingTool",
28 expression = lepton_skimming_expression )
29 acc.addPublicTool(STDM13StringSkimmingTool)
30 STDM13SkimmingTool = CompFactory.DerivationFramework.FilterCombinationAND(
"STDM13SkimmingTool", FilterList = [STDM13StringSkimmingTool])
32 acc.addPublicTool(STDM13SkimmingTool, primary =
True)
33 tp_thinning_expression =
"abs(DFCommonInDetTrackZ0AtPV*sin(InDetTrackParticles.theta)) < 6.0*mm"
36 name =
"STDM13TPThinningTool",
37 StreamName = kwargs[
'StreamName'],
38 SelectionString = tp_thinning_expression,
39 InDetTrackParticlesKey =
"InDetTrackParticles"))
41 thinningTools = [ STDM13TPThinningTool ]
42 skimmingTools = [ STDM13SkimmingTool ]
44 DerivationKernel = CompFactory.DerivationFramework.DerivationKernel
45 acc.addEventAlgo(
DerivationKernel(name, SkimmingTools = skimmingTools, ThinningTools = thinningTools))
56 from DerivationFrameworkPhys.TriggerListsHelper
import TriggerListsHelper
57 STDM13TriggerListsHelper = TriggerListsHelper(flags)
60 acc.merge(
STDM13KernelCfg(flags, name=
"STDM13Kernel", StreamName =
'StreamDAOD_STDM13', TriggerListsHelper = STDM13TriggerListsHelper))
65 from OutputStreamAthenaPool.OutputStreamConfig
import OutputStreamCfg
66 from xAODMetaDataCnv.InfileMetaDataConfig
import SetupMetaDataForStreamCfg
67 from DerivationFrameworkCore.SlimmingHelper
import SlimmingHelper
69 STDM13SlimmingHelper =
SlimmingHelper(
"STDM13SlimmingHelper", NamesAndTypes = flags.Input.TypedCollections, flags = flags)
71 STDM13SlimmingHelper.SmartCollections = [
75 "MET_Baseline_AntiKt4EMPFlow",
77 "InDetTrackParticles",
78 "BTagging_AntiKt4EMPFlow",
81 STDM13SlimmingHelper.AllVariables = [
84 "InDetTrackParticles",
85 "BTagging_AntiKt4EMPFlow",
86 "AntiKt4TruthDressedWZJets",
87 "TruthEvents",
"TruthHFWithDecayParticles",
"TruthBoson",
"TruthBottom",
"TruthCharm",
"TruthElectrons",
"TruthMuons",
"TruthTop",
"TruthTaus",
"MET_Truth",
88 "TruthPrimaryVertices",
"TruthHFWithDecayVertices",
91 STDM13SlimmingHelper.IncludeTriggerNavigation =
False
92 STDM13SlimmingHelper.IncludeJetTriggerContent =
False
93 STDM13SlimmingHelper.IncludeMuonTriggerContent =
False
94 STDM13SlimmingHelper.IncludeEGammaTriggerContent =
False
95 STDM13SlimmingHelper.IncludeJetTauEtMissTriggerContent =
False
96 STDM13SlimmingHelper.IncludeTauTriggerContent =
False
97 STDM13SlimmingHelper.IncludeEtMissTriggerContent =
False
98 STDM13SlimmingHelper.IncludeBJetTriggerContent =
False
99 STDM13SlimmingHelper.IncludeBPhysTriggerContent =
False
100 STDM13SlimmingHelper.IncludeMinBiasTriggerContent =
False
104 if flags.Trigger.EDMVersion == 2:
105 from DerivationFrameworkPhys.TriggerMatchingCommonConfig
import AddRun2TriggerMatchingToSlimmingHelper
107 OutputContainerPrefix =
"TrigMatch_",
108 TriggerList = STDM13TriggerListsHelper.Run2TriggerNamesTau)
110 OutputContainerPrefix =
"TrigMatch_",
111 TriggerList = STDM13TriggerListsHelper.Run2TriggerNamesNoTau)
113 if flags.Trigger.EDMVersion == 3
or (flags.Trigger.EDMVersion == 2
and flags.Trigger.doEDMVersionConversion):
114 from TrigNavSlimmingMT.TrigNavSlimmingMTConfig
import AddRun3TrigNavSlimmingCollectionsToSlimmingHelper
118 STDM13ItemList = STDM13SlimmingHelper.GetItemList()
119 acc.merge(
OutputStreamCfg(flags,
"DAOD_STDM13", ItemList=STDM13ItemList, AcceptAlgs=[
"STDM13Kernel"]))
120 acc.merge(
SetupMetaDataForStreamCfg(flags,
"DAOD_STDM13", AcceptAlgs=[
"STDM13Kernel"], createMetadata=[MetadataCategory.CutFlowMetaData, MetadataCategory.TruthMetaData]))