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