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 207 of file JETM7.py.

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

◆ JETM7ExtraContentCfg()

python.JETM7.JETM7ExtraContentCfg ( flags)

Definition at line 161 of file JETM7.py.

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

◆ JETM7KernelCfg()

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

Definition at line 26 of file JETM7.py.

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

◆ 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 acc = ComponentAccumulator()
15
16
17 jetSelection = '(count(AntiKt4EMPFlowJets.pt > 10.*GeV && abs(AntiKt4EMPFlowJets.eta) < 2.5) >= 1)'
18 JETM7OfflineSkimmingTool = CompFactory.DerivationFramework.xAODStringSkimmingTool(name = "JETM7OfflineSkimmingTool1",
19 expression = jetSelection)
20
21 acc.addPublicTool(JETM7OfflineSkimmingTool, primary=True)
22
23 return(acc)
24
25# Main algorithm config