ATLAS Offline Software
Loading...
Searching...
No Matches
TLA0 Namespace Reference

Functions

 TLA0SkimmingCfg (flags)
 TLA0KernelCfg (flags, name='TLA0Kernel', **kwargs)
 TLA0Cfg (flags)

Function Documentation

◆ TLA0Cfg()

TLA0.TLA0Cfg ( flags)

Definition at line 111 of file TLA0.py.

111def TLA0Cfg(flags):
112 stream_name = 'StreamDAOD_TLA0'
113 acc = ComponentAccumulator()
114
115 # Get the lists of triggers needed for trigger matching.
116 # This is needed at this scope (for the slimming) and further down in the config chain
117 # for actually configuring the matching, so we create it here and pass it down
118
119 from DerivationFrameworkPhys.TriggerListsHelper import TriggerListsHelper
120 TLA0TriggerListsHelper = TriggerListsHelper(flags)
121
122
123 # Common augmentations and TLA0 thinning & skimming
124 acc.merge(TLA0KernelCfg(flags, name="TLA0Kernel", StreamName = stream_name, TriggerListsHelper = TLA0TriggerListsHelper))
125
126 # ============================
127 # Define contents of the format
128 # =============================
129 from OutputStreamAthenaPool.OutputStreamConfig import OutputStreamCfg
130 from xAODMetaDataCnv.InfileMetaDataConfig import SetupMetaDataForStreamCfg
131 from DerivationFrameworkCore.SlimmingHelper import SlimmingHelper
132
133 TLA0SlimmingHelper = SlimmingHelper("TLA0SlimmingHelper", NamesAndTypes = flags.Input.TypedCollections, flags = flags)
134
135 TLA0SlimmingHelper.SmartCollections = [
136 "EventInfo",
137 "Electrons",
138 "Photons",
139 "PrimaryVertices",
140 "Muons",
141 "AntiKt4EMTopoJets",
142 "AntiKt4EMPFlowJets",
143
144 ]
145
146 # Extra content
147 if flags.Input.isMC:
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",
150
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",
152
153 "TruthPrimaryVertices.t.x.y.z",
154
155 "EventInfo.hardScatterVertexLink.timeStampNSOffset",
156 ]
157 else:
158 TLA0SlimmingHelper.ExtraVariables += [
159 "AntiKt4EMTopoJets.DFCommonJets_QGTagger_NTracks.DFCommonJets_QGTagger_TracksWidth.DFCommonJets_QGTagger_TracksC1",
160
161 "AntiKt4EMPFlowJets.DFCommonJets_QGTagger_NTracks.DFCommonJets_QGTagger_TracksWidth.DFCommonJets_QGTagger_TracksC1",
162
163 "EventInfo.hardScatterVertexLink.timeStampNSOffset",
164 ]
165
166 TLA0SlimmingHelper.AllVariables = [
167 # store event shape variables to get full objects (also included by jet CP content)
168 "Kt4EMTopoOriginEventShape","Kt4EMPFlowEventShape", # EMTopo and EMPFlow event shapes
169 "Kt4EMPFlowPUSBEventShape","Kt4EMPFlowNeutEventShape", # newer event shapes for testing (e.g. if offline jet calibration changes)
170 # store muon segments in case they are needed for offline jet calibrations
171 "MuonSegments",
172 ]
173
174 # add eEM RoIs
175 # based on L1CALOCore.py implementation
176 L1Calo_eEM_postfix = "" # empty unless otherwise set
177 # append to slimming helper dictionaties so that the code knows the container type
178 TLA0SlimmingHelper.AppendToDictionary.update(
179 {"L1_eEMRoI"+L1Calo_eEM_postfix : "xAOD::eFexEMRoIContainer",
180 "L1_eEMRoI"+L1Calo_eEM_postfix+"Aux" : "xAOD::eFexEMRoIAuxContainer"})
181 # add the RoIs to the derivation
182 TLA0SlimmingHelper.AllVariables += ["L1_eEMRoI"+L1Calo_eEM_postfix]
183
184
185 # Truth extra content
186 if flags.Input.isMC:
187 # from DerivationFrameworkMCTruth.MCTruthCommonConfig import addTruth3ContentToSlimmerTool
188 from DerivationFrameworkTLA.TLACommonConfig import addTLATruth3ContentToSlimmerTool
189 addTLATruth3ContentToSlimmerTool(TLA0SlimmingHelper)
190 TLA0SlimmingHelper.AllVariables += [
191 'TruthHFWithDecayParticles',
192 'TruthHFWithDecayVertices',
193 'TruthCharm',
194 'TruthPileupParticles',
195 'InTimeAntiKt4TruthJets',
196 'OutOfTimeAntiKt4TruthJets',
197 ]
198 TLA0SlimmingHelper.ExtraVariables += [
199 "Electrons.TruthLink",
200 "Photons.TruthLink"
201 ]
202 # truth jet collections for calibrations and performance studies
203 # replicates jet collection configuration in JETM1 (with the exception of AntiKt4TruthDressedWZJets which doesn't exist there)
204 TLA0SlimmingHelper.SmartCollections += ["AntiKt4TruthWZJets"]
205 TLA0SlimmingHelper.AllVariables += ["AntiKt4TruthJets", "AntiKt4TruthDressedWZJets"]
206
207 # Trigger content
208 # only save B-jet trigger content and trigger navigation when running on MC
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
220
221 # Trigger matching
222 # Run 2
223 if flags.Trigger.EDMVersion == 2:
224 from DerivationFrameworkPhys.TriggerMatchingCommonConfig import AddRun2TriggerMatchingToSlimmingHelper
225 AddRun2TriggerMatchingToSlimmingHelper(SlimmingHelper = TLA0SlimmingHelper,
226 OutputContainerPrefix = "TrigMatch_",
227 TriggerList = TLA0TriggerListsHelper.Run2TriggerNamesTau)
228 AddRun2TriggerMatchingToSlimmingHelper(SlimmingHelper = TLA0SlimmingHelper,
229 OutputContainerPrefix = "TrigMatch_",
230 TriggerList = TLA0TriggerListsHelper.Run2TriggerNamesNoTau)
231 # Run 3, or Run 2 with navigation conversion
232 if flags.Trigger.EDMVersion == 3 or (flags.Trigger.EDMVersion == 2 and flags.Trigger.doEDMVersionConversion):
233 from TrigNavSlimmingMT.TrigNavSlimmingMTConfig import AddRun3TrigNavSlimmingCollectionsToSlimmingHelper
234 AddRun3TrigNavSlimmingCollectionsToSlimmingHelper(TLA0SlimmingHelper)
235
236 # Output stream
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]))
240
241 return acc
242

◆ TLA0KernelCfg()

TLA0.TLA0KernelCfg ( flags,
name = 'TLA0Kernel',
** kwargs )
Configure the derivation framework driving algorithm (kernel) for TLA0

Definition at line 32 of file TLA0.py.

32def TLA0KernelCfg(flags, name='TLA0Kernel', **kwargs):
33 """Configure the derivation framework driving algorithm (kernel) for TLA0"""
34 acc = ComponentAccumulator()
35
36 # Skimming
37 skimmingTool = None
38 if not flags.Input.isMC:
39 skimmingTool = acc.getPrimaryAndMerge(TLA0SkimmingCfg(flags))
40
41 # Common augmentations
42 from DerivationFrameworkTLA.TLACommonConfig import TLACommonAugmentationsCfg
43 acc.merge(TLACommonAugmentationsCfg(flags, prefix="TLA0_", TriggerListsHelper = kwargs['TriggerListsHelper']))
44
45 from DerivationFrameworkInDet.InDetToolsConfig import InDetTrackSelectionToolWrapperCfg
46 DFCommonTrackSelection = acc.getPrimaryAndMerge(InDetTrackSelectionToolWrapperCfg(
47 flags,
48 name = "DFCommonTrackSelectionLoose",
49 CutLevel = "Loose",
50 DecorationName = "DFTLA0Loose"))
51
52 acc.addEventAlgo(CompFactory.DerivationFramework.CommonAugmentation("TLA0CommonKernel", AugmentationTools = [DFCommonTrackSelection]))
53
54 # Thinning tools...
55 from DerivationFrameworkInDet.InDetToolsConfig import MuonTrackParticleThinningCfg, EgammaTrackParticleThinningCfg, JetTrackParticleThinningCfg
56
57 # Include inner detector tracks associated with muons
58 TLA0MuonTPThinningTool = acc.getPrimaryAndMerge(MuonTrackParticleThinningCfg(
59 flags,
60 name = "TLA0MuonTPThinningTool",
61 StreamName = kwargs['StreamName'],
62 MuonKey = "Muons",
63 InDetTrackParticlesKey = "InDetTrackParticles"))
64
65 # Include inner detector tracks associated with electonrs
66 TLA0ElectronTPThinningTool = acc.getPrimaryAndMerge(EgammaTrackParticleThinningCfg(
67 flags,
68 name = "TLA0ElectronTPThinningTool",
69 StreamName = kwargs['StreamName'],
70 SGKey = "Electrons",
71 InDetTrackParticlesKey = "InDetTrackParticles"))
72
73 TLA0_thinning_expression = "InDetTrackParticles.DFTLA0Loose && ( abs(InDetTrackParticles.d0) < 5.0*mm ) && ( abs(DFCommonInDetTrackZ0AtPV*sin(InDetTrackParticles.theta)) < 5.0*mm )"
74
75 TLA0Akt4JetTPThinningTool = acc.getPrimaryAndMerge(JetTrackParticleThinningCfg(
76 flags,
77 name = "TLA0Akt4JetTPThinningTool",
78 StreamName = kwargs['StreamName'],
79 JetKey = "AntiKt4EMTopoJets",
80 SelectionString = "AntiKt4EMTopoJets.pt > 18*GeV",
81 TrackSelectionString = TLA0_thinning_expression,
82 InDetTrackParticlesKey = "InDetTrackParticles"))
83
84 TLA0Akt4PFlowJetTPThinningTool = acc.getPrimaryAndMerge(JetTrackParticleThinningCfg(
85 flags,
86 name = "TLA0Akt4PFlowJetTPThinningTool",
87 StreamName = kwargs['StreamName'],
88 JetKey = "AntiKt4EMPFlowJets",
89 SelectionString = "AntiKt4EMPFlowJets.pt > 18*GeV",
90 TrackSelectionString = TLA0_thinning_expression,
91 InDetTrackParticlesKey = "InDetTrackParticles"))
92
93 # Finally the kernel itself
94 thinningTools = [TLA0MuonTPThinningTool,
95 TLA0ElectronTPThinningTool,
96 TLA0Akt4JetTPThinningTool,
97 TLA0Akt4PFlowJetTPThinningTool]
98
99 # create the derivation kernel
100 DerivationKernel = CompFactory.DerivationFramework.DerivationKernel
101 acc.addEventAlgo(DerivationKernel(
102 name,
103 ThinningTools = thinningTools,
104 SkimmingTools = [skimmingTool] if skimmingTool is not None else []
105 ))
106
107
108 return acc
109
110# Main setup of the config & format

◆ TLA0SkimmingCfg()

TLA0.TLA0SkimmingCfg ( flags)
Configure the skimming tool

Definition at line 12 of file TLA0.py.

12def TLA0SkimmingCfg(flags):
13 """Configure the skimming tool"""
14 acc = ComponentAccumulator()
15
16
17 from DerivationFrameworkTLA.TLATriggerList import SupportSingleJetTriggers, SupportMultiJetTriggers, SupportPhotonTriggers, PrimaryISRTLATriggers, SupportTLATriggers, PrimarySingleJetTLATriggers, PrimaryMultiJetTLATriggers
18
19 tlaFullTriggerList = SupportSingleJetTriggers + SupportMultiJetTriggers + SupportPhotonTriggers + PrimaryISRTLATriggers + SupportTLATriggers + PrimarySingleJetTLATriggers + PrimaryMultiJetTLATriggers
20
21 if not flags.Input.isMC:
22 TLA0TriggerSkimmingTool = CompFactory.DerivationFramework.TriggerSkimmingTool(
23 name = "TLA0TriggerSkimmingTool1",
24 TriggerListOR = tlaFullTriggerList
25 )
26 acc.addPublicTool(TLA0TriggerSkimmingTool, primary=True)
27
28 return acc
29
30
31# Main thinning config and common augmentations