ATLAS Offline Software
Loading...
Searching...
No Matches
python.JETM7 Namespace Reference

Functions

 JETM7SkimmingToolCfg (flags)
 JETM7KernelCfg (flags, name='JETM7Kernel', **kwargs)
 JETM7ExtraContentCfg (flags)
 JETM7Cfg (flags)

Function Documentation

◆ JETM7Cfg()

python.JETM7.JETM7Cfg ( flags)

Definition at line 202 of file JETM7.py.

202def JETM7Cfg(flags):
203
204 acc = ComponentAccumulator()
205
206 # Get the lists of triggers needed for trigger matching.
207 # This is needed at this scope (for the slimming) and further down in the config chain
208 # for actually configuring the matching, so we create it here and pass it down
209 # TODO: this should ideally be called higher up to avoid it being run multiple times in a train
210 from DerivationFrameworkPhys.TriggerListsHelper import TriggerListsHelper
211 JETM7TriggerListsHelper = TriggerListsHelper(flags)
212
213 # Skimming, thinning, augmentation, extra content
214 acc.merge(JETM7KernelCfg(flags, name="JETM7Kernel", StreamName = 'StreamDAOD_JETM7', TriggerListsHelper = JETM7TriggerListsHelper))
215
216 # ============================
217 # Define contents of the format
218 # =============================
219 from OutputStreamAthenaPool.OutputStreamConfig import OutputStreamCfg
220 from xAODMetaDataCnv.InfileMetaDataConfig import SetupMetaDataForStreamCfg
221 from DerivationFrameworkCore.SlimmingHelper import SlimmingHelper
222
223 JETM7SlimmingHelper = SlimmingHelper("JETM7SlimmingHelper", NamesAndTypes = flags.Input.TypedCollections, flags = flags)
224
225 JETM7SlimmingHelper.SmartCollections = ["Electrons", "Photons", "Muons", "TauJets",
226 "PrimaryVertices",
227 "InDetTrackParticles",
228 "AntiKt4EMPFlowJets",
229 "EventInfo",
230 ]
231
232
233 JETM7SlimmingHelper.ExtraVariables = ["InDetTrackParticles.TTVA_AMVFVertices.TTVA_AMVFWeights"]
234
235 # Truth containers
236 if flags.Input.isMC:
237
238 from DerivationFrameworkMCTruth.MCTruthCommonConfig import addTruth3ContentToSlimmerTool
239 addTruth3ContentToSlimmerTool(JETM7SlimmingHelper)
240
241 JETM7SlimmingHelper.AppendToDictionary.update({'TruthParticles': 'xAOD::TruthParticleContainer',
242 'TruthParticlesAux': 'xAOD::TruthParticleAuxContainer'})
243
244 JETM7SlimmingHelper.SmartCollections += ["AntiKt4TruthWZJets"]
245
246 JETM7SlimmingHelper.AllVariables += ["TruthTopQuarkWithDecayParticles","TruthTopQuarkWithDecayVertices",
247 "AntiKt4TruthJets", "InTimeAntiKt4TruthJets", "OutOfTimeAntiKt4TruthJets", "TruthParticles",
248 "TruthVertices", "TruthEvents"]
249 JETM7SlimmingHelper.ExtraVariables += ["InDetTrackParticles.truthMatchProbability", "TruthVertices.uid.z"]
250
251
252 # Trigger content
253 JETM7SlimmingHelper.IncludeTriggerNavigation = True
254 JETM7SlimmingHelper.IncludeJetTriggerContent = False
255 JETM7SlimmingHelper.IncludeMuonTriggerContent = False
256 JETM7SlimmingHelper.IncludeEGammaTriggerContent = False
257 JETM7SlimmingHelper.IncludeTauTriggerContent = False
258 JETM7SlimmingHelper.IncludeEtMissTriggerContent = False
259 JETM7SlimmingHelper.IncludeBJetTriggerContent = False
260 JETM7SlimmingHelper.IncludeBPhysTriggerContent = False
261 JETM7SlimmingHelper.IncludeMinBiasTriggerContent = False
262
263 # Trigger matching
264 # Run 2
265 if flags.Trigger.EDMVersion == 2:
266 from DerivationFrameworkPhys.TriggerMatchingCommonConfig import AddRun2TriggerMatchingToSlimmingHelper
267 AddRun2TriggerMatchingToSlimmingHelper(SlimmingHelper = JETM7SlimmingHelper,
268 OutputContainerPrefix = "TrigMatch_",
269 TriggerList = JETM7TriggerListsHelper.Run2TriggerNamesTau)
270 AddRun2TriggerMatchingToSlimmingHelper(SlimmingHelper = JETM7SlimmingHelper,
271 OutputContainerPrefix = "TrigMatch_",
272 TriggerList = JETM7TriggerListsHelper.Run2TriggerNamesNoTau)
273 # Run 3, or Run 2 with navigation conversion
274 if flags.Trigger.EDMVersion == 3 or (flags.Trigger.EDMVersion == 2 and flags.Trigger.doEDMVersionConversion):
275 from TrigNavSlimmingMT.TrigNavSlimmingMTConfig import AddRun3TrigNavSlimmingCollectionsToSlimmingHelper
276 AddRun3TrigNavSlimmingCollectionsToSlimmingHelper(JETM7SlimmingHelper)
277
278 jetOutputList = ["AntiKt4EMPFlowByVertexJets"]
279 from DerivationFrameworkJetEtMiss.JetCommonConfig import addJetsToSlimmingTool
280 addJetsToSlimmingTool(JETM7SlimmingHelper, jetOutputList, JETM7SlimmingHelper.SmartCollections)
281
282 # Output stream
283 JETM7ItemList = JETM7SlimmingHelper.GetItemList()
284 acc.merge(OutputStreamCfg(flags, "DAOD_JETM7", ItemList=JETM7ItemList, AcceptAlgs=["JETM7Kernel"]))
285 acc.merge(SetupMetaDataForStreamCfg(flags, "DAOD_JETM7", AcceptAlgs=["JETM7Kernel"], createMetadata=[MetadataCategory.CutFlowMetaData]))
286
287 return acc
288
289
290
291

◆ JETM7ExtraContentCfg()

python.JETM7.JETM7ExtraContentCfg ( flags)

Definition at line 156 of file JETM7.py.

156def JETM7ExtraContentCfg(flags):
157
158 acc = ComponentAccumulator()
159
160 from JetRecConfig.JetRecConfig import JetRecCfg
161 from JetRecConfig.StandardSmallRJets import AntiKt4PV0Track, AntiKt4EMPFlowByVertex
162
163 #=======================================
164 # R = 0.4 track-jets (needed for Rtrk)
165 #=======================================
166 jetList = [AntiKt4PV0Track]
167
168 #=======================================
169 # R = 0.4 by-vertex jets
170 #=======================================
171 jetList += [AntiKt4EMPFlowByVertex]
172
173
174 for jd in jetList:
175 acc.merge(JetRecCfg(flags,jd))
176
177 #=======================================
178 # More detailed truth information
179 #=======================================
180
181 if flags.Input.isMC:
182 from DerivationFrameworkMCTruth.MCTruthCommonConfig import AddTopQuarkAndDownstreamParticlesCfg
183 acc.merge(AddTopQuarkAndDownstreamParticlesCfg(flags, generations=4, rejectHadronChildren=True))
184
185 #=======================================
186 # Add Run-2 jet trigger collections
187 # Only needed for Run-2 due to different aux container type (JetTrigAuxContainer) which required special wrapper for conversion to AuxContainerBase
188 # In Run-3, the aux. container type is directly JetAuxContainer (no conversion needed)
189 #=======================================
190
191 if flags.Trigger.EDMVersion == 2:
192 triggerNames = ["JetContainer_a4tcemsubjesFS", "JetContainer_a4tcemsubjesISFS", "JetContainer_a10tclcwsubjesFS", "JetContainer_GSCJet"]
193
194 for trigger in triggerNames:
195 wrapperName = trigger+'AuxWrapper'
196 auxContainerName = 'HLT_xAOD__'+trigger+'Aux'
197
198 acc.addEventAlgo(CompFactory.xAODMaker.AuxStoreWrapper( wrapperName, SGKeys = [ auxContainerName+"." ] ))
199
200 return acc
201

◆ JETM7KernelCfg()

python.JETM7.JETM7KernelCfg ( flags,
name = 'JETM7Kernel',
** kwargs )
Configure the derivation framework driving algorithm (kernel) for JETM7

Definition at line 21 of file JETM7.py.

21def JETM7KernelCfg(flags, name='JETM7Kernel', **kwargs):
22 """Configure the derivation framework driving algorithm (kernel) for JETM7"""
23 acc = ComponentAccumulator()
24
25 # Skimming
26 if not flags.Input.isMC:
27 skimmingTool = acc.getPrimaryAndMerge(JETM7SkimmingToolCfg(flags))
28
29 # Common augmentations
30 from DerivationFrameworkPhys.PhysCommonConfig import PhysCommonAugmentationsCfg
31 acc.merge(PhysCommonAugmentationsCfg(flags, TriggerListsHelper = kwargs['TriggerListsHelper']))
32
33 from DerivationFrameworkInDet.InDetToolsConfig import InDetTrackSelectionToolWrapperCfg
34 DFCommonTrackSelection = acc.getPrimaryAndMerge(InDetTrackSelectionToolWrapperCfg(
35 flags,
36 name = "DFJETM7CommonTrackSelectionLoose",
37 CutLevel = "Loose",
38 DecorationName = "DFJETM7Loose"))
39
40 acc.addEventAlgo(CompFactory.DerivationFramework.CommonAugmentation("JETM7CommonKernel", AugmentationTools = [DFCommonTrackSelection]))
41
42 # Thinning tools...
43 from DerivationFrameworkInDet.InDetToolsConfig import MuonTrackParticleThinningCfg, EgammaTrackParticleThinningCfg, JetTrackParticleThinningCfg, TauTrackParticleThinningCfg
44 # from DerivationFrameworkMCTruth.TruthDerivationToolsConfig import GenericTruthThinningCfg
45 from DerivationFrameworkTools.DerivationFrameworkToolsConfig import GenericObjectThinningCfg
46
47 muonSelectionString = "(Muons.pt > 5*GeV)"
48 electronSelectionString = "(Electrons.pt > 5*GeV)"
49 photonSelectionString = "(Photons.pt > 5*GeV)"
50 jetSelectionString = "(AntiKt4EMPFlowByVertexJets.pt > 7.*GeV && AntiKt4EMPFlowByVertexJets.Jvt > 0.4)"
51 tauJetSelectionString = "(TauJets.pt > 20.*GeV && TauJets.nTracks > 0)"
52
53 # Include inner detector tracks associated with muons
54 JETM7MuonTPThinningTool = acc.getPrimaryAndMerge(MuonTrackParticleThinningCfg(flags,
55 name = "JETM7MuonTPThinningTool",
56 StreamName = kwargs['StreamName'],
57 MuonKey = "Muons",
58 SelectionString = muonSelectionString,
59 InDetTrackParticlesKey = "InDetTrackParticles"))
60
61 # Include inner detector tracks associated with electrons
62 JETM7ElectronTPThinningTool = acc.getPrimaryAndMerge(EgammaTrackParticleThinningCfg(flags,
63 name = "JETM7ElectronTPThinningTool",
64 StreamName = kwargs['StreamName'],
65 SGKey = "Electrons",
66 SelectionString = electronSelectionString,
67 InDetTrackParticlesKey = "InDetTrackParticles"))
68
69 # Include inner detector tracks associated with taus
70 JETM7TauTPThinningTool = acc.getPrimaryAndMerge(TauTrackParticleThinningCfg(
71 flags,
72 name = "JETM7TauTPThinningTool",
73 StreamName = kwargs['StreamName'],
74 TauKey = "TauJets",
75 SelectionString = tauJetSelectionString,
76 InDetTrackParticlesKey = "InDetTrackParticles",
77 DoTauTracksThinning = True,
78 ConeSize = 0.6,
79 TauTracksKey = "TauTracks"))
80
81 # Include inner detector tracks associated with by-vertex jets
82 JETM7Akt4JetTPThinningTool = acc.getPrimaryAndMerge(JetTrackParticleThinningCfg(flags,
83 name = "JETM7Akt4JetTPThinningTool",
84 StreamName = kwargs['StreamName'],
85 JetKey = "AntiKt4EMPFlowByVertexJets",
86 SelectionString = jetSelectionString,
87 InDetTrackParticlesKey = "InDetTrackParticles"))
88
89
90
91 # Store EMPFlowByVertexJets with JVT > 0.4. This will result in jets extending up to about 2.6 in |eta|
92 JETM7Akt4PFlowByVertexJetThinningTool = acc.getPrimaryAndMerge(GenericObjectThinningCfg(flags,
93 name = "JETM7Akt4PFlowByVertexJetThinningTool",
94 ContainerName = "AntiKt4EMPFlowByVertexJets",
95 StreamName = kwargs['StreamName'],
96 SelectionString = jetSelectionString))
97
98 # Store regular EMPFlowJets for |eta| > 2.4 to retain forward jets with a PV0 interpretation
99 JETM7Akt4PFlowJetThinningTool = acc.getPrimaryAndMerge(GenericObjectThinningCfg(flags,
100 name = "JETM7Akt4PFlowJetThinningTool",
101 ContainerName = "AntiKt4EMPFlowJets",
102 StreamName = kwargs['StreamName'],
103 SelectionString = "(abs(AntiKt4EMPFlowJets.eta) > 2.4)"))
104
105
106 JETM7MuonThinningTool = acc.getPrimaryAndMerge(GenericObjectThinningCfg(flags,
107 name = "JETM7MuonThinningTool",
108 ContainerName = "Muons",
109 StreamName = kwargs['StreamName'],
110 SelectionString = muonSelectionString))
111
112
113 JETM7ElectronThinningTool = acc.getPrimaryAndMerge(GenericObjectThinningCfg(flags,
114 name = "JETM7ElectronThinningTool",
115 ContainerName = "Electrons",
116 StreamName = kwargs['StreamName'],
117 SelectionString = electronSelectionString))
118
119 JETM7TauJetThinningTool = acc.getPrimaryAndMerge(GenericObjectThinningCfg(flags,
120 name = "JETM7TauJetThinningTool",
121 ContainerName = "TauJets",
122 StreamName = kwargs['StreamName'],
123 SelectionString = tauJetSelectionString))
124
125 JETM7PhotonThinningTool = acc.getPrimaryAndMerge(GenericObjectThinningCfg(flags,
126 name = "JETM7PhotonThinningTool",
127 ContainerName = "Photons",
128 StreamName = kwargs['StreamName'],
129 SelectionString = photonSelectionString))
130
131
132 # Extra jet content:
133 acc.merge(JETM7ExtraContentCfg(flags))
134
135 # Finally the kernel itself
136 thinningTools = [JETM7MuonTPThinningTool,
137 JETM7ElectronTPThinningTool,
138 JETM7TauTPThinningTool,
139 JETM7Akt4JetTPThinningTool,
140 JETM7Akt4PFlowByVertexJetThinningTool,
141 JETM7Akt4PFlowJetThinningTool,
142 JETM7MuonThinningTool,
143 JETM7ElectronThinningTool,
144 JETM7TauJetThinningTool,
145 JETM7PhotonThinningTool,
146 ]
147
148 DerivationKernel = CompFactory.DerivationFramework.DerivationKernel
149 acc.addEventAlgo(DerivationKernel(name,
150 ThinningTools = thinningTools,
151 SkimmingTools = [skimmingTool] if not flags.Input.isMC else []))
152
153
154 return acc
155

◆ JETM7SkimmingToolCfg()

python.JETM7.JETM7SkimmingToolCfg ( flags)
Configure the skimming tool

Definition at line 12 of file JETM7.py.

12def JETM7SkimmingToolCfg(flags):
13 """Configure the skimming tool"""
14 jetSelection = '(count(AntiKt4EMPFlowJets.pt > 10.*GeV && abs(AntiKt4EMPFlowJets.eta) < 2.5) >= 1)'
15 from DerivationFrameworkTools.DerivationFrameworkToolsConfig import (
16 xAODStringSkimmingToolCfg)
17 return xAODStringSkimmingToolCfg(flags, name = "JETM7OfflineSkimmingTool1",
18 expression = jetSelection)
19
20# Main algorithm config