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

Functions

 TLA2SkimmingCfg (flags)
 TLA2KernelCfg (flags, name='TLA2Kernel', **kwargs)
 TLA2Cfg (flags)

Function Documentation

◆ TLA2Cfg()

TLA2.TLA2Cfg ( flags)

Definition at line 115 of file TLA2.py.

115def TLA2Cfg(flags):
116 stream_name = 'StreamDAOD_TLA2'
117 acc = ComponentAccumulator()
118
119 # Get the lists of triggers needed for trigger matching.
120 # This is needed at this scope (for the slimming) and further down in the config chain
121 # for actually configuring the matching, so we create it here and pass it down
122 from DerivationFrameworkPhys.TriggerListsHelper import TriggerListsHelper
123 TLA2TriggerListsHelper = TriggerListsHelper(flags)
124
125
126 # Common augmentations and TLA2 thinning & skimming
127 acc.merge(TLA2KernelCfg(flags, name="TLA2Kernel", StreamName = stream_name, TriggerListsHelper = TLA2TriggerListsHelper))
128
129 # ============================
130 # Define contents of the format
131 # =============================
132 from OutputStreamAthenaPool.OutputStreamConfig import OutputStreamCfg
133 from xAODMetaDataCnv.InfileMetaDataConfig import SetupMetaDataForStreamCfg
134 from DerivationFrameworkCore.SlimmingHelper import SlimmingHelper
135
136 TLA2SlimmingHelper = SlimmingHelper("TLA2SlimmingHelper", NamesAndTypes = flags.Input.TypedCollections, flags = flags)
137
138 TLA2SlimmingHelper.SmartCollections = [
139 "EventInfo",
140 "Electrons",
141 "Photons",
142 "PrimaryVertices",
143 "Muons",
144 "AntiKt4EMTopoJets",
145 "AntiKt4EMPFlowJets",
146
147 ]
148
149 # Extra content
150 if flags.Input.isMC:
151 TLA2SlimmingHelper.ExtraVariables += [
152 "AntiKt4EMTopoJets.ConeExclBHadronsFinal.ConeExclCHadronsFinal.GhostBHadronsFinal.GhostCHadronsFinal.GhostBHadronsFinalCount.GhostBHadronsFinalPt.GhostCHadronsFinalCount.GhostCHadronsFinalPt",
153
154 "AntiKt4EMPFlowJets.ConeExclBHadronsFinal.ConeExclCHadronsFinal.GhostBHadronsFinal.GhostCHadronsFinal.GhostBHadronsFinalCount.GhostBHadronsFinalPt.GhostCHadronsFinalCount.GhostCHadronsFinalPt",
155
156 "TruthPrimaryVertices.t.x.y.z",
157
158 "EventInfo.hardScatterVertexLink.timeStampNSOffset",
159 ]
160 else:
161 TLA2SlimmingHelper.ExtraVariables += [
162 "AntiKt4EMPFlowJets.HECQuality.TrackSumMass.PSFrac.TrackSumPt.SumPtChargedPFOPt1000.EMFrac.Width.JetEMScaleMomentum_pt.JetEMScaleMomentum_eta.TracksForBTagging.SumPtTrkPt1000.TrackWidthPt500",
163
164 "EventInfo.hardScatterVertexLink.timeStampNSOffset",
165
166 "PrimaryVertices.neutralWeights.chiSquared.numberDoF.sumPt2.covariance.trackWeights"
167 ]
168
169 TLA2SlimmingHelper.AllVariables = [
170 # store event shape variables to get full objects (also included by jet CP content)
171 "Kt4EMTopoOriginEventShape","Kt4EMPFlowEventShape", # EMTopo and EMPFlow event shapes
172 "Kt4EMPFlowNeutEventShape", # new event shape used for Run 3 offline calibration
173 # store muon segments in case they are needed for offline jet calibrations
174 "MuonSegments",
175 ]
176
177 # add eEM RoIs
178 # based on L1CALOCore.py implementation
179 L1Calo_eEM_postfix = "" # empty unless otherwise set
180 # append to slimming helper dictionaties so that the code knows the container type
181 TLA2SlimmingHelper.AppendToDictionary.update(
182 {"L1_eEMRoI"+L1Calo_eEM_postfix : "xAOD::eFexEMRoIContainer",
183 "L1_eEMRoI"+L1Calo_eEM_postfix+"Aux" : "xAOD::eFexEMRoIAuxContainer"})
184 # add the RoIs to the derivation
185 TLA2SlimmingHelper.AllVariables += ["L1_eEMRoI"+L1Calo_eEM_postfix]
186
187
188 # Truth extra content
189 if flags.Input.isMC:
190 from DerivationFrameworkTLA.TLACommonConfig import addTLATruth3ContentToSlimmerTool
191 addTLATruth3ContentToSlimmerTool(TLA2SlimmingHelper)
192 TLA2SlimmingHelper.AllVariables += [
193 'TruthHFWithDecayParticles',
194 'TruthHFWithDecayVertices',
195 'TruthCharm',
196 'TruthPileupParticles',
197 'InTimeAntiKt4TruthJets',
198 'OutOfTimeAntiKt4TruthJets',
199 ]
200 TLA2SlimmingHelper.ExtraVariables += [
201 "Electrons.TruthLink",
202 "Photons.TruthLink"
203 ]
204 # truth jet collections for calibrations and performance studies
205 # replicates jet collection configuration in JETM1 (with the exception of AntiKt4TruthDressedWZJets which doesn't exist there)
206 TLA2SlimmingHelper.SmartCollections += ["AntiKt4TruthWZJets"]
207 TLA2SlimmingHelper.AllVariables += ["AntiKt4TruthJets", "AntiKt4TruthDressedWZJets"]
208
209 # Trigger content
210 # only save B-jet trigger content and trigger navigation when running on MC
211 TLA2SlimmingHelper.IncludeTriggerNavigation = True
212 TLA2SlimmingHelper.IncludeJetTriggerContent = True
213 TLA2SlimmingHelper.IncludeMuonTriggerContent = False
214 TLA2SlimmingHelper.IncludeTrackingTriggerContent = True
215 TLA2SlimmingHelper.IncludeEGammaTriggerContent = True
216 TLA2SlimmingHelper.IncludeTauTriggerContent = False
217 TLA2SlimmingHelper.IncludeEtMissTriggerContent = False
218 TLA2SlimmingHelper.IncludeBJetTriggerContent = True
219 TLA2SlimmingHelper.IncludeBPhysTriggerContent = False
220 TLA2SlimmingHelper.IncludeMinBiasTriggerContent = False
221 TLA2SlimmingHelper.OverrideJetTriggerContentWithTLAContent = True
222
223 # Trigger matching
224 # Run 2
225 if flags.Trigger.EDMVersion == 2:
226 from DerivationFrameworkPhys.TriggerMatchingCommonConfig import AddRun2TriggerMatchingToSlimmingHelper
227 AddRun2TriggerMatchingToSlimmingHelper(SlimmingHelper = TLA2SlimmingHelper,
228 OutputContainerPrefix = "TrigMatch_",
229 TriggerList = TLA2TriggerListsHelper.Run2TriggerNamesTau)
230 AddRun2TriggerMatchingToSlimmingHelper(SlimmingHelper = TLA2SlimmingHelper,
231 OutputContainerPrefix = "TrigMatch_",
232 TriggerList = TLA2TriggerListsHelper.Run2TriggerNamesNoTau)
233 # Run 3, or Run 2 with navigation conversion
234 if flags.Trigger.EDMVersion == 3 or (flags.Trigger.EDMVersion == 2 and flags.Trigger.doEDMVersionConversion):
235 from TrigNavSlimmingMT.TrigNavSlimmingMTConfig import AddRun3TrigNavSlimmingCollectionsToSlimmingHelper
236 AddRun3TrigNavSlimmingCollectionsToSlimmingHelper(TLA2SlimmingHelper)
237
238 # Output stream
239 TLA2ItemList = TLA2SlimmingHelper.GetItemList()
240 acc.merge(OutputStreamCfg(flags, "DAOD_TLA2", ItemList=TLA2ItemList, AcceptAlgs=["TLA2Kernel"]))
241 acc.merge(SetupMetaDataForStreamCfg(flags, "DAOD_TLA2", AcceptAlgs=["TLA2Kernel"], createMetadata=[MetadataCategory.CutFlowMetaData, MetadataCategory.TruthMetaData]))
242
243 return acc
244

◆ TLA2KernelCfg()

TLA2.TLA2KernelCfg ( flags,
name = 'TLA2Kernel',
** kwargs )
Configure the derivation framework driving algorithm (kernel) for TLA2

Definition at line 32 of file TLA2.py.

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

◆ TLA2SkimmingCfg()

TLA2.TLA2SkimmingCfg ( flags)
Configure the skimming tool

Definition at line 12 of file TLA2.py.

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