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