7 from AthenaConfiguration.ComponentAccumulator
import ComponentAccumulator
8 from AthenaConfiguration.ComponentFactory
import CompFactory
9 from AthenaConfiguration.Enums
import MetadataCategory
13 """Configure the skimming tool"""
16 from DerivationFrameworkTLA.TLATriggerList
import SupportPhotonTriggers, PrimaryISRTLATriggers, SupportTLATriggers
18 tlaLiteTriggerList = PrimaryISRTLATriggers + SupportTLATriggers + SupportPhotonTriggers
21 if not flags.Input.isMC:
22 TLA1TriggerSkimmingTool = CompFactory.DerivationFramework.TriggerSkimmingTool(
23 name =
"TLA1TriggerSkimmingTool1",
24 TriggerListOR = tlaLiteTriggerList
26 acc.addPublicTool(TLA1TriggerSkimmingTool, primary=
True)
33 """Configure the derivation framework driving algorithm (kernel) for TLA1"""
38 if not flags.Input.isMC:
42 from DerivationFrameworkTLA.TLACommonConfig
import TLACommonAugmentationsCfg
45 from DerivationFrameworkInDet.InDetToolsConfig
import InDetTrackSelectionToolWrapperCfg
48 name =
"DFCommonTrackSelectionLoose",
50 DecorationName =
"DFTLA1Loose"))
52 acc.addEventAlgo(CompFactory.DerivationFramework.CommonAugmentation(
"TLA1CommonKernel", AugmentationTools = [DFCommonTrackSelection]))
55 from DerivationFrameworkInDet.InDetToolsConfig
import MuonTrackParticleThinningCfg, EgammaTrackParticleThinningCfg, JetTrackParticleThinningCfg
60 name =
"TLA1MuonTPThinningTool",
61 StreamName = kwargs[
'StreamName'],
63 InDetTrackParticlesKey =
"InDetTrackParticles"))
68 name =
"TLA1ElectronTPThinningTool",
69 StreamName = kwargs[
'StreamName'],
71 InDetTrackParticlesKey =
"InDetTrackParticles"))
73 TLA1_thinning_expression =
"InDetTrackParticles.DFTLA1Loose && ( abs(InDetTrackParticles.d0) < 5.0*mm ) && ( abs(DFCommonInDetTrackZ0AtPV*sin(InDetTrackParticles.theta)) < 5.0*mm )"
77 name =
"TLA1Akt4JetTPThinningTool",
78 StreamName = kwargs[
'StreamName'],
79 JetKey =
"AntiKt4EMTopoJets",
80 SelectionString =
"AntiKt4EMTopoJets.pt > 18*GeV",
81 TrackSelectionString = TLA1_thinning_expression,
82 InDetTrackParticlesKey =
"InDetTrackParticles"))
86 name =
"TLA1Akt4PFlowJetTPThinningTool",
87 StreamName = kwargs[
'StreamName'],
88 JetKey =
"AntiKt4EMPFlowJets",
89 SelectionString =
"AntiKt4EMPFlowJets.pt > 18*GeV",
90 TrackSelectionString = TLA1_thinning_expression,
91 InDetTrackParticlesKey =
"InDetTrackParticles"))
94 thinningTools = [TLA1MuonTPThinningTool,
95 TLA1ElectronTPThinningTool,
96 TLA1Akt4JetTPThinningTool,
97 TLA1Akt4PFlowJetTPThinningTool]
100 DerivationKernel = CompFactory.DerivationFramework.DerivationKernel
103 ThinningTools = thinningTools,
104 SkimmingTools = [skimmingTool]
if skimmingTool
is not None else []
112 stream_name =
'StreamDAOD_TLA1'
118 from DerivationFrameworkPhys.TriggerListsHelper
import TriggerListsHelper
119 TLA1TriggerListsHelper = TriggerListsHelper(flags)
123 acc.merge(
TLA1KernelCfg(flags, name=
"TLA1Kernel", StreamName = stream_name, TriggerListsHelper = TLA1TriggerListsHelper))
128 from OutputStreamAthenaPool.OutputStreamConfig
import OutputStreamCfg
129 from xAODMetaDataCnv.InfileMetaDataConfig
import SetupMetaDataForStreamCfg
130 from DerivationFrameworkCore.SlimmingHelper
import SlimmingHelper
132 TLA1SlimmingHelper =
SlimmingHelper(
"TLA1SlimmingHelper", NamesAndTypes = flags.Input.TypedCollections, flags = flags)
134 TLA1SlimmingHelper.SmartCollections = [
141 "AntiKt4EMPFlowJets",
142 "BTagging_AntiKt4EMPFlow",
147 TLA1SlimmingHelper.ExtraVariables += [
148 "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",
150 "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",
152 "TruthPrimaryVertices.t.x.y.z",
154 "EventInfo.hardScatterVertexLink.timeStampNSOffset",
157 TLA1SlimmingHelper.ExtraVariables += [
158 "AntiKt4EMTopoJets.DFCommonJets_QGTagger_NTracks.DFCommonJets_QGTagger_TracksWidth.DFCommonJets_QGTagger_TracksC1",
160 "AntiKt4EMPFlowJets.DFCommonJets_QGTagger_NTracks.DFCommonJets_QGTagger_TracksWidth.DFCommonJets_QGTagger_TracksC1",
162 "EventInfo.hardScatterVertexLink.timeStampNSOffset",
165 TLA1SlimmingHelper.AllVariables = [
167 "Kt4EMTopoOriginEventShape",
"Kt4EMPFlowEventShape",
168 "Kt4EMPFlowPUSBEventShape",
"Kt4EMPFlowNeutEventShape",
175 L1Calo_eEM_postfix =
""
177 TLA1SlimmingHelper.AppendToDictionary.update(
178 {
"L1_eEMRoI"+L1Calo_eEM_postfix :
"xAOD::eFexEMRoIContainer",
179 "L1_eEMRoI"+L1Calo_eEM_postfix+
"Aux" :
"xAOD::eFexEMRoIAuxContainer"})
181 TLA1SlimmingHelper.AllVariables += [
"L1_eEMRoI"+L1Calo_eEM_postfix]
187 from DerivationFrameworkTLA.TLACommonConfig
import addTLATruth3ContentToSlimmerTool
189 TLA1SlimmingHelper.AllVariables += [
190 'TruthHFWithDecayParticles',
191 'TruthHFWithDecayVertices',
193 'TruthPileupParticles',
194 'InTimeAntiKt4TruthJets',
195 'OutOfTimeAntiKt4TruthJets',
197 TLA1SlimmingHelper.ExtraVariables += [
198 "Electrons.TruthLink",
203 TLA1SlimmingHelper.SmartCollections += [
"AntiKt4TruthWZJets"]
204 TLA1SlimmingHelper.AllVariables += [
"AntiKt4TruthJets",
"AntiKt4TruthDressedWZJets"]
208 TLA1SlimmingHelper.IncludeTriggerNavigation =
True
209 TLA1SlimmingHelper.IncludeJetTriggerContent =
True
210 TLA1SlimmingHelper.IncludeMuonTriggerContent =
False
211 TLA1SlimmingHelper.IncludeTrackingTriggerContent =
True
212 TLA1SlimmingHelper.IncludeEGammaTriggerContent =
True
213 TLA1SlimmingHelper.IncludeTauTriggerContent =
False
214 TLA1SlimmingHelper.IncludeEtMissTriggerContent =
False
215 TLA1SlimmingHelper.IncludeBJetTriggerContent =
True
216 TLA1SlimmingHelper.IncludeBPhysTriggerContent =
False
217 TLA1SlimmingHelper.IncludeMinBiasTriggerContent =
False
218 TLA1SlimmingHelper.OverrideJetTriggerContentWithTLAContent =
True
222 if flags.Trigger.EDMVersion == 2:
223 from DerivationFrameworkPhys.TriggerMatchingCommonConfig
import AddRun2TriggerMatchingToSlimmingHelper
225 OutputContainerPrefix =
"TrigMatch_",
226 TriggerList = TLA1TriggerListsHelper.Run2TriggerNamesTau)
228 OutputContainerPrefix =
"TrigMatch_",
229 TriggerList = TLA1TriggerListsHelper.Run2TriggerNamesNoTau)
231 if flags.Trigger.EDMVersion == 3
or (flags.Trigger.EDMVersion == 2
and flags.Trigger.doEDMVersionConversion):
232 from TrigNavSlimmingMT.TrigNavSlimmingMTConfig
import AddRun3TrigNavSlimmingCollectionsToSlimmingHelper
236 TLA1ItemList = TLA1SlimmingHelper.GetItemList()
237 acc.merge(
OutputStreamCfg(flags,
"DAOD_TLA1", ItemList=TLA1ItemList, AcceptAlgs=[
"TLA1Kernel"]))
238 acc.merge(
SetupMetaDataForStreamCfg(flags,
"DAOD_TLA1", AcceptAlgs=[
"TLA1Kernel"], createMetadata=[MetadataCategory.CutFlowMetaData, MetadataCategory.TruthMetaData]))