192def EGAM10Cfg(flags):
193 acc = ComponentAccumulator()
194
195
196
197
198
199
200
201
202 from DerivationFrameworkPhys.TriggerListsHelper import TriggerListsHelper
203
204 EGAM10TriggerListsHelper = TriggerListsHelper(flags)
205
206
207 acc.merge(
208 EGAM10KernelCfg(
209 flags,
210 name="EGAM10Kernel",
211 StreamName="StreamDAOD_EGAM10",
212 TriggerListsHelper=EGAM10TriggerListsHelper,
213 )
214 )
215
216
217 from OutputStreamAthenaPool.OutputStreamConfig import OutputStreamCfg
218 from xAODMetaDataCnv.InfileMetaDataConfig import SetupMetaDataForStreamCfg
219 from DerivationFrameworkCore.SlimmingHelper import SlimmingHelper
220
222 "EGAM10SlimmingHelper",
223 NamesAndTypes=flags.Input.TypedCollections,
224 flags=flags,
225 )
226
227
228
229
230
231
232 EGAM10SlimmingHelper.AllVariables = [
233 "CaloCalTopoClusters",
234 "egammaClusters"
235 ]
236
237
238 if flags.Input.isMC:
239 EGAM10SlimmingHelper.AppendToDictionary.update(
240 {
241 "TruthIsoCentralEventShape": "xAOD::EventShape",
242 "TruthIsoCentralEventShapeAux": "xAOD::EventShapeAuxInfo",
243 "TruthIsoForwardEventShape": "xAOD::EventShape",
244 "TruthIsoForwardEventShapeAux": "xAOD::EventShapeAuxInfo",
245 }
246 )
247 EGAM10SlimmingHelper.AllVariables += [
248 "TruthEvents",
249 "TruthParticles",
250 "TruthVertices",
251 "TruthMuons",
252 "TruthElectrons",
253 "TruthPhotons",
254 "TruthNeutrinos",
255 "TruthTaus",
256 "AntiKt4TruthJets",
257 "AntiKt4TruthDressedWZJets",
258 "egammaTruthParticles",
259 "TruthIsoCentralEventShape",
260 "TruthIsoForwardEventShape",
261 ]
262
263
264
265
266
267
268
269
270
271
272
273 EGAM10SlimmingHelper.SmartCollections = [
274 "Electrons",
275 "Photons",
276 "InDetTrackParticles",
277 "PrimaryVertices",
278 "AntiKt4EMPFlowJets",
279 ]
280
281 if flags.Input.isMC:
282 EGAM10SlimmingHelper.SmartCollections += [
283 "AntiKt4TruthJets",
284 "AntiKt4TruthDressedWZJets",
285 ]
286
287
288
289
290 EGAM10SlimmingHelper.ExtraVariables += [
291 "egammaClusters.PHI2CALOFRAME.ETA2CALOFRAME.phi_sampl",
292 ]
293
294
295 EGAM10SlimmingHelper.ExtraVariables += [
296 "Photons.ptcone30.ptcone40.f3.f3core",
297 "Photons.maxEcell_time.maxEcell_energy.maxEcell_gain.maxEcell_onlId",
298 "Photons.maxEcell_x.maxEcell_y.maxEcell_z",
299 "Photons.ptcone40_Nonprompt_All_MaxWeightTTVA_pt1000",
300 "Photons.ptcone40_Nonprompt_All_MaxWeightTTVA_pt500",
301 "Photons.ptcone20_Nonprompt_All_MaxWeightTTVA_pt500",
302 "Photons.ptvarcone30_Nonprompt_All_MaxWeightTTVA_pt1000",
303 "Photons.ptvarcone30_Nonprompt_All_MaxWeightTTVA_pt500",
304 ]
305
306
307 EGAM10SlimmingHelper.ExtraVariables += [
308 "Electrons.topoetcone30.topoetcone40.ptcone20.ptcone30",
309 "Electrons.ptcone40.maxEcell_time.maxEcell_energy.maxEcell_gain",
310 "Electrons.maxEcell_onlId.maxEcell_x.maxEcell_y.maxEcell_z",
311 ]
312
313
314 EGAM10SlimmingHelper.ExtraVariables += [
315 "PrimaryVertices.covariance.trackWeights.sumPt2.sumPt",
316 "PrimaryVertices.pt.eta.phi",
317 ]
318
319
320 EGAM10SlimmingHelper.ExtraVariables += [
321 "InDetTrackParticles.TTVA_AMVFVertices.TTVA_AMVFWeights"
322 ]
323
324
325 EGAM10SlimmingHelper.ExtraVariables += PhotonsCPDetailedContent
326
327
328 from DerivationFrameworkCalo.DerivationFrameworkCaloConfig import (
329 getGainDecorations,
330 getClusterEnergyPerLayerDecorations,
331 )
332
333 gainDecorations = getGainDecorations(acc, flags, "EGAM10Kernel")
334 print(
"EGAM10 gain decorations: ", gainDecorations)
335 EGAM10SlimmingHelper.ExtraVariables.extend(gainDecorations)
336 clusterEnergyDecorations = getClusterEnergyPerLayerDecorations(acc, "EGAM10Kernel")
337 print(
"EGAM10 cluster energy decorations: ", clusterEnergyDecorations)
338 EGAM10SlimmingHelper.ExtraVariables.extend(clusterEnergyDecorations)
339
340
341 EGAM10SlimmingHelper.ExtraVariables += [
342 "TopoClusterIsoCentralEventShape.Density",
343 "TopoClusterIsoForwardEventShape.Density",
344 ]
345
346 from DerivationFrameworkEGamma import EGammaIsoConfig
347
348 (
349 pflowIsoVar,
350 densityList,
351 densityDict,
352 acc1,
353 ) = EGammaIsoConfig.makeEGammaCommonIsoCfg(flags)
354 acc.merge(acc1)
355 EGAM10SlimmingHelper.AppendToDictionary.update(densityDict)
356 EGAM10SlimmingHelper.ExtraVariables += densityList + [f"Photons{pflowIsoVar}"]
357
358
359 from IsolationAlgs.DerivationTrackIsoConfig import DerivationTrackIsoCfg
360
361 acc.merge(
362 DerivationTrackIsoCfg(
363 flags, object_types=("Photons",), ptCuts=(500, 1000), postfix="Extra"
364 )
365 )
366
367
368 if flags.Input.isMC:
369 EGAM10SlimmingHelper.ExtraVariables += [
370 "Electrons.truthClassification.truthOrigin.truthType.truthParticleLink.truthPdgId",
371 "Electrons.lastEgMotherTruthClassification.lastEgMotherTruthType.lastEgMotherTruthOrigin",
372 "Electrons.lastEgMotherTruthParticleLink.lastEgMotherPdgId",
373 "Electrons.firstEgMotherTruthClassification.firstEgMotherTruthType.firstEgMotherTruthOrigin",
374 "Electrons.firstEgMotherTruthParticleLink.firstEgMotherPdgId",
375 ]
376
377 EGAM10SlimmingHelper.ExtraVariables += [
378 "Photons.truthClassification.truthOrigin.truthType.truthParticleLink"
379 ]
380
381 EGAM10SlimmingHelper.ExtraVariables += [
382 "TruthIsoCentralEventShape.DensitySigma.Density.DensityArea",
383 "TruthIsoForwardEventShape.DensitySigma.Density.DensityArea",
384 ]
385
386
387 if flags.Derivation.Egamma.doEventInfoSlimming:
388 EGAM10SlimmingHelper.SmartCollections.append("EventInfo")
389 else:
390 EGAM10SlimmingHelper.AllVariables += ["EventInfo"]
391
392
393 EGAM10SlimmingHelper.IncludeEGammaTriggerContent = True
394
395
396
397 if flags.Trigger.EDMVersion == 2:
398 from DerivationFrameworkPhys.TriggerMatchingCommonConfig import AddRun2TriggerMatchingToSlimmingHelper
399 AddRun2TriggerMatchingToSlimmingHelper(SlimmingHelper = EGAM10SlimmingHelper,
400 OutputContainerPrefix = "TrigMatch_",
401 TriggerList = EGAM10TriggerListsHelper.Run2TriggerNamesNoTau)
402
403 if flags.Trigger.EDMVersion == 3 or (flags.Trigger.EDMVersion == 2 and flags.Trigger.doEDMVersionConversion):
404 from TrigNavSlimmingMT.TrigNavSlimmingMTConfig import AddRun3TrigNavSlimmingCollectionsToSlimmingHelper
405 AddRun3TrigNavSlimmingCollectionsToSlimmingHelper(EGAM10SlimmingHelper)
406
407
408 EGAM10SlimmingHelper.StaticContent = [
409 "CaloCellContainer#AllCalo",
410 "CaloClusterCellLinkContainer#egammaClusters_links",
411 ]
412
413 EGAM10ItemList = EGAM10SlimmingHelper.GetItemList()
414 acc.merge(
415 OutputStreamCfg(
416 flags,
417 "DAOD_EGAM10",
418 ItemList=EGAM10ItemList,
419 AcceptAlgs=["EGAM10Kernel"],
420 )
421 )
422 acc.merge(
423 SetupMetaDataForStreamCfg(
424 flags,
425 "DAOD_EGAM10",
426 AcceptAlgs=["EGAM10Kernel"],
427 createMetadata=[
428 MetadataCategory.CutFlowMetaData,
429 MetadataCategory.TruthMetaData,
430 ],
431 )
432 )
433
434 return acc
void print(char *figname, TCanvas *c1)