7 from AthenaConfiguration.ComponentAccumulator
import ComponentAccumulator
8 from AthenaConfiguration.ComponentFactory
import CompFactory
9 from AthenaConfiguration.Enums
import MetadataCategory
13 """Configure the skimming tool"""
17 from DerivationFrameworkTLA.TLATriggerList
import SupportSingleJetTriggers, SupportMultiJetTriggers, SupportPhotonTriggers, PrimaryISRTLATriggers, SupportTLATriggers, PrimarySingleJetTLATriggers, PrimaryMultiJetTLATriggers
19 tlaFullTriggerList = SupportSingleJetTriggers + SupportMultiJetTriggers + SupportPhotonTriggers + PrimaryISRTLATriggers + SupportTLATriggers + PrimarySingleJetTLATriggers + PrimaryMultiJetTLATriggers
21 if not flags.Input.isMC:
22 TLA0TriggerSkimmingTool = CompFactory.DerivationFramework.TriggerSkimmingTool(
23 name =
"TLA0TriggerSkimmingTool1",
24 TriggerListOR = tlaFullTriggerList
26 acc.addPublicTool(TLA0TriggerSkimmingTool, primary=
True)
33 """Configure the derivation framework driving algorithm (kernel) for TLA0"""
38 if not flags.Input.isMC:
42 from DerivationFrameworkTLA.TLACommonConfig
import TLACommonAugmentationsCfg
45 from DerivationFrameworkInDet.InDetToolsConfig
import InDetTrackSelectionToolWrapperCfg
48 name =
"DFCommonTrackSelectionLoose",
50 DecorationName =
"DFTLA0Loose"))
52 acc.addEventAlgo(CompFactory.DerivationFramework.CommonAugmentation(
"TLA0CommonKernel", AugmentationTools = [DFCommonTrackSelection]))
55 from DerivationFrameworkInDet.InDetToolsConfig
import MuonTrackParticleThinningCfg, EgammaTrackParticleThinningCfg, JetTrackParticleThinningCfg
60 name =
"TLA0MuonTPThinningTool",
61 StreamName = kwargs[
'StreamName'],
63 InDetTrackParticlesKey =
"InDetTrackParticles"))
68 name =
"TLA0ElectronTPThinningTool",
69 StreamName = kwargs[
'StreamName'],
71 InDetTrackParticlesKey =
"InDetTrackParticles"))
73 TLA0_thinning_expression =
"InDetTrackParticles.DFTLA0Loose && ( abs(InDetTrackParticles.d0) < 5.0*mm ) && ( abs(DFCommonInDetTrackZ0AtPV*sin(InDetTrackParticles.theta)) < 5.0*mm )"
77 name =
"TLA0Akt4JetTPThinningTool",
78 StreamName = kwargs[
'StreamName'],
79 JetKey =
"AntiKt4EMTopoJets",
80 SelectionString =
"AntiKt4EMTopoJets.pt > 18*GeV",
81 TrackSelectionString = TLA0_thinning_expression,
82 InDetTrackParticlesKey =
"InDetTrackParticles"))
86 name =
"TLA0Akt4PFlowJetTPThinningTool",
87 StreamName = kwargs[
'StreamName'],
88 JetKey =
"AntiKt4EMPFlowJets",
89 SelectionString =
"AntiKt4EMPFlowJets.pt > 18*GeV",
90 TrackSelectionString = TLA0_thinning_expression,
91 InDetTrackParticlesKey =
"InDetTrackParticles"))
94 thinningTools = [TLA0MuonTPThinningTool,
95 TLA0ElectronTPThinningTool,
96 TLA0Akt4JetTPThinningTool,
97 TLA0Akt4PFlowJetTPThinningTool]
100 DerivationKernel = CompFactory.DerivationFramework.DerivationKernel
103 ThinningTools = thinningTools,
104 SkimmingTools = [skimmingTool]
if skimmingTool
is not None else []
112 stream_name =
'StreamDAOD_TLA0'
119 from DerivationFrameworkPhys.TriggerListsHelper
import TriggerListsHelper
120 TLA0TriggerListsHelper = TriggerListsHelper(flags)
124 acc.merge(
TLA0KernelCfg(flags, name=
"TLA0Kernel", StreamName = stream_name, TriggerListsHelper = TLA0TriggerListsHelper))
129 from OutputStreamAthenaPool.OutputStreamConfig
import OutputStreamCfg
130 from xAODMetaDataCnv.InfileMetaDataConfig
import SetupMetaDataForStreamCfg
131 from DerivationFrameworkCore.SlimmingHelper
import SlimmingHelper
133 TLA0SlimmingHelper =
SlimmingHelper(
"TLA0SlimmingHelper", NamesAndTypes = flags.Input.TypedCollections, flags = flags)
135 TLA0SlimmingHelper.SmartCollections = [
142 "AntiKt4EMPFlowJets",
143 "BTagging_AntiKt4EMPFlow",
148 TLA0SlimmingHelper.ExtraVariables += [
149 "AntiKt4EMTopoJets.DFCommonJets_QGTagger_truthjet_nCharged.DFCommonJets_QGTagger_truthjet_pt.DFCommonJets_QGTagger_truthjet_eta.DFCommonJets_QGTagger_NTracks.DFCommonJets_QGTagger_TracksWidth.DFCommonJets_QGTagger_TracksC1.ConeExclBHadronsFinal.ConeExclCHadronsFinal.GhostBHadronsFinal.GhostCHadronsFinal.GhostBHadronsFinalCount.GhostBHadronsFinalPt.GhostCHadronsFinalCount.GhostCHadronsFinalPt",
151 "AntiKt4EMPFlowJets.DFCommonJets_QGTagger_truthjet_nCharged.DFCommonJets_QGTagger_truthjet_pt.DFCommonJets_QGTagger_truthjet_eta.DFCommonJets_QGTagger_NTracks.DFCommonJets_QGTagger_TracksWidth.DFCommonJets_QGTagger_TracksC1.ConeExclBHadronsFinal.ConeExclCHadronsFinal.GhostBHadronsFinal.GhostCHadronsFinal.GhostBHadronsFinalCount.GhostBHadronsFinalPt.GhostCHadronsFinalCount.GhostCHadronsFinalPt",
153 "TruthPrimaryVertices.t.x.y.z",
155 "EventInfo.hardScatterVertexLink.timeStampNSOffset",
158 TLA0SlimmingHelper.ExtraVariables += [
159 "AntiKt4EMTopoJets.DFCommonJets_QGTagger_NTracks.DFCommonJets_QGTagger_TracksWidth.DFCommonJets_QGTagger_TracksC1",
161 "AntiKt4EMPFlowJets.DFCommonJets_QGTagger_NTracks.DFCommonJets_QGTagger_TracksWidth.DFCommonJets_QGTagger_TracksC1",
163 "EventInfo.hardScatterVertexLink.timeStampNSOffset",
166 TLA0SlimmingHelper.AllVariables = [
168 "Kt4EMTopoOriginEventShape",
"Kt4EMPFlowEventShape",
169 "Kt4EMPFlowPUSBEventShape",
"Kt4EMPFlowNeutEventShape",
176 L1Calo_eEM_postfix =
""
178 TLA0SlimmingHelper.AppendToDictionary.update(
179 {
"L1_eEMRoI"+L1Calo_eEM_postfix :
"xAOD::eFexEMRoIContainer",
180 "L1_eEMRoI"+L1Calo_eEM_postfix+
"Aux" :
"xAOD::eFexEMRoIAuxContainer"})
182 TLA0SlimmingHelper.AllVariables += [
"L1_eEMRoI"+L1Calo_eEM_postfix]
188 from DerivationFrameworkTLA.TLACommonConfig
import addTLATruth3ContentToSlimmerTool
190 TLA0SlimmingHelper.AllVariables += [
191 'TruthHFWithDecayParticles',
192 'TruthHFWithDecayVertices',
194 'TruthPileupParticles',
195 'InTimeAntiKt4TruthJets',
196 'OutOfTimeAntiKt4TruthJets',
198 TLA0SlimmingHelper.ExtraVariables += [
199 "Electrons.TruthLink",
204 TLA0SlimmingHelper.SmartCollections += [
"AntiKt4TruthWZJets"]
205 TLA0SlimmingHelper.AllVariables += [
"AntiKt4TruthJets",
"AntiKt4TruthDressedWZJets"]
209 TLA0SlimmingHelper.IncludeTriggerNavigation =
True
210 TLA0SlimmingHelper.IncludeJetTriggerContent =
True
211 TLA0SlimmingHelper.IncludeMuonTriggerContent =
False
212 TLA0SlimmingHelper.IncludeTrackingTriggerContent =
True
213 TLA0SlimmingHelper.IncludeEGammaTriggerContent =
True
214 TLA0SlimmingHelper.IncludeTauTriggerContent =
False
215 TLA0SlimmingHelper.IncludeEtMissTriggerContent =
False
216 TLA0SlimmingHelper.IncludeBJetTriggerContent =
True
217 TLA0SlimmingHelper.IncludeBPhysTriggerContent =
False
218 TLA0SlimmingHelper.IncludeMinBiasTriggerContent =
False
219 TLA0SlimmingHelper.OverrideJetTriggerContentWithTLAContent =
True
223 if flags.Trigger.EDMVersion == 2:
224 from DerivationFrameworkPhys.TriggerMatchingCommonConfig
import AddRun2TriggerMatchingToSlimmingHelper
226 OutputContainerPrefix =
"TrigMatch_",
227 TriggerList = TLA0TriggerListsHelper.Run2TriggerNamesTau)
229 OutputContainerPrefix =
"TrigMatch_",
230 TriggerList = TLA0TriggerListsHelper.Run2TriggerNamesNoTau)
232 if flags.Trigger.EDMVersion == 3
or (flags.Trigger.EDMVersion == 2
and flags.Trigger.doEDMVersionConversion):
233 from TrigNavSlimmingMT.TrigNavSlimmingMTConfig
import AddRun3TrigNavSlimmingCollectionsToSlimmingHelper
237 TLA0ItemList = TLA0SlimmingHelper.GetItemList()
238 acc.merge(
OutputStreamCfg(flags,
"DAOD_TLA0", ItemList=TLA0ItemList, AcceptAlgs=[
"TLA0Kernel"]))
239 acc.merge(
SetupMetaDataForStreamCfg(flags,
"DAOD_TLA0", AcceptAlgs=[
"TLA0Kernel"], createMetadata=[MetadataCategory.CutFlowMetaData, MetadataCategory.TruthMetaData]))