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