ATLAS Offline Software
Loading...
Searching...
No Matches
EGAM1.py
Go to the documentation of this file.
1# Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
2# ====================================================================
3# EGAM1.py
4# This defines DAOD_EGAM1, a skimmed DAOD format for Run 3.
5# Z->ee reduction for central electrons - for electron ID and calibration
6# It requires the flag EGAM1 in Derivation_tf.py
7# ====================================================================
8
9from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
10from AthenaConfiguration.ComponentFactory import CompFactory
11from AthenaConfiguration.Enums import MetadataCategory
12
13from AthenaCommon.SystemOfUnits import MeV
14
15from DerivationFrameworkEGamma.PhotonsCPDetailedContent import (
16 PhotonsCPDetailedContent,
17)
18
19from DerivationFrameworkEGamma.TriggerContent import (
20 ExtraContainersTrigger,
21 ExtraContainersElectronTrigger,
22)
23
24
26 """Configure the EGAM1 skimming tool"""
27 expression = " || ".join(
28 [
29 "(count( EGAM1_DiElectronMass1 > 50.0*GeV ) >= 1)",
30 "(count( EGAM1_DiElectronMass2 > 50.0*GeV ) >= 1)",
31 "(count( EGAM1_DiElectronMass3 > 50.0*GeV ) >= 1)",
32 "(count( EGAM1_ElectronPhotonMass > 50.0*GeV )>=1)",
33 ]
34 )
35 print("EGAM1 skimming expression: ", expression)
36
37 from DerivationFrameworkTools.DerivationFrameworkToolsConfig import (
38 xAODStringSkimmingToolCfg)
39 return xAODStringSkimmingToolCfg(
40 flags, name = "EGAM1SkimmingTool", expression = expression)
41
42
44 """Configure the EGAM1 ee invariant mass augmentation tool 1"""
45 acc = ComponentAccumulator()
46
47 # ====================================================================
48 # 1. di-electron invariant mass for events passing the Z->ee
49 # selection for the e-gamma calibration, based on single e trigger
50 #
51 # 1 tight e, central, pT>25 GeV
52 # 1 medium e, pT>20 GeV
53 # opposite-sign
54 # mee>50 GeV (cut applied in skimming step later)
55 # ====================================================================
56
57 requirement_tag = " && ".join(
58 ["(Electrons.DFCommonElectronsLHTight)", "(Electrons.pt > 24.5*GeV)"]
59 )
60
61 requirement_probe = " && ".join(
62 ["(Electrons.DFCommonElectronsLHMedium)", "(Electrons.pt > 19.5*GeV)"]
63 )
64
65 acc.setPrivateTools(
66 CompFactory.DerivationFramework.EGInvariantMassTool(
67 name="EGAM1_ZEEMassTool1",
68 Object1Requirements=requirement_tag,
69 Object2Requirements=requirement_probe,
70 StoreGateEntryName="EGAM1_DiElectronMass1",
71 Mass1Hypothesis=0.511 * MeV,
72 Mass2Hypothesis=0.511 * MeV,
73 Container1Name="Electrons",
74 Container2Name="Electrons",
75 CheckCharge=True,
76 DoTransverseMass=False,
77 MinDeltaR=0.0,
78 )
79 )
80
81 return acc
82
83
85 """Configure the EGAM1 ee invariant mass augmentation tool 2"""
86 acc = ComponentAccumulator()
87
88 # ====================================================================
89 # 2. di-electron invariant mass for events passing the Z->e selection
90 # for the e-gamma calibration, based on di-electron triggers
91 #
92 # 2 medium e, central, pT>20 GeV
93 # opposite-sign
94 # mee>50 GeV (cut applied in skimming step later)
95 # ====================================================================
96
97 requirement = " && ".join(
98 ["(Electrons.DFCommonElectronsLHMedium)", "(Electrons.pt > 19.5*GeV)"]
99 )
100
101 acc.setPrivateTools(
102 CompFactory.DerivationFramework.EGInvariantMassTool(
103 name="EGAM1_ZEEMassTool2",
104 Object1Requirements=requirement,
105 Object2Requirements=requirement,
106 StoreGateEntryName="EGAM1_DiElectronMass2",
107 Mass1Hypothesis=0.511 * MeV,
108 Mass2Hypothesis=0.511 * MeV,
109 Container1Name="Electrons",
110 Container2Name="Electrons",
111 CheckCharge=True,
112 DoTransverseMass=False,
113 MinDeltaR=0.0,
114 )
115 )
116
117 return acc
118
119
121 """Configure the EGAM1 ee invariant mass augmentation tool 3"""
122 acc = ComponentAccumulator()
123
124 # ====================================================================
125 # 3. di-electron invariant mass for events passing the Z->ee
126 # selection for the e efficiencies with tag and probe.
127 # Based on single e trigger, for reco (central) and ID SF(central)
128 #
129 # 1 tight e, central, pT>25 GeV
130 # 1 e, central, pT>4 GeV
131 # opposite-sign + same-sign
132 # mee>50 GeV (cut applied in skimming step later)
133 # ====================================================================
134
135 requirement_tag = " && ".join(
136 ["(Electrons.DFCommonElectronsLHMedium)", "(Electrons.pt > 24.5*GeV)"]
137 )
138
139 requirement_probe = "Electrons.pt > 4*GeV"
140
141 acc.setPrivateTools(
142 CompFactory.DerivationFramework.EGInvariantMassTool(
143 name="EGAM1_ZEEMassTool3",
144 Object1Requirements=requirement_tag,
145 Object2Requirements=requirement_probe,
146 StoreGateEntryName="EGAM1_DiElectronMass3",
147 Mass1Hypothesis=0.511 * MeV,
148 Mass2Hypothesis=0.511 * MeV,
149 Container1Name="Electrons",
150 Container2Name="Electrons",
151 CheckCharge=False,
152 DoTransverseMass=False,
153 MinDeltaR=0.0,
154 )
155 )
156
157 return acc
158
159
161 """Configure the EGAM1 e+photon mass augmentation tool"""
162 acc = ComponentAccumulator()
163
164 # ====================================================================
165 # 4. Z->eg selection based on single e trigger, for reco SF (central)
166 # for tag and probe
167 #
168 # 1 tight e, central, pT>25 GeV
169 # note: use medium instead of tight for early data upon electron
170 # group request
171 # 1 gamma, pT>15 GeV, central
172 # opposite sign + same sign
173 # mey>50 GeV (cut applied in skimming step later)
174 # ====================================================================
175
176 requirement_tag = " && ".join(
177 ["(Electrons.DFCommonElectronsLHMedium)", "(Electrons.pt > 24.5*GeV)"]
178 )
179
180 requirement_probe = "DFCommonPhotons_et > 14.5*GeV"
181
182 acc.setPrivateTools(
183 CompFactory.DerivationFramework.EGInvariantMassTool(
184 name="EGAM1_ZEGMassTool",
185 Object1Requirements=requirement_tag,
186 Object2Requirements=requirement_probe,
187 StoreGateEntryName="EGAM1_ElectronPhotonMass",
188 Mass1Hypothesis=0.511 * MeV,
189 Mass2Hypothesis=0.511 * MeV,
190 Container1Name="Electrons",
191 Container2Name="Photons",
192 Pt2BranchName="DFCommonPhotons_et",
193 Eta2BranchName="DFCommonPhotons_eta",
194 Phi2BranchName="DFCommonPhotons_phi",
195 CheckCharge=False,
196 DoTransverseMass=False,
197 MinDeltaR=0.0,
198 )
199 )
200 return acc
201
202
203# Main algorithm config
204def EGAM1KernelCfg(flags, name="EGAM1Kernel", **kwargs):
205 """Configure the derivation framework driving algorithm (kernel)
206 for EGAM1"""
207 acc = ComponentAccumulator()
208
209 # Schedule extra jets collections
210 from JetRecConfig.StandardSmallRJets import AntiKt4PV0Track
211 from JetRecConfig.JetRecConfig import JetRecCfg
212
213 jetList = [AntiKt4PV0Track]
214 for jd in jetList:
215 acc.merge(JetRecCfg(flags, jd))
216
217 # Common augmentations
218 from DerivationFrameworkPhys.PhysCommonConfig import PhysCommonAugmentationsCfg
219
220 acc.merge(
221 PhysCommonAugmentationsCfg(
222 flags, TriggerListsHelper=kwargs["TriggerListsHelper"]
223 )
224 )
225
226 # EGAM1 augmentations
227 augmentationTools = []
228
229 # ====================================================================
230 # ee and egamma invariant masses
231 # ====================================================================
232 EGAM1ZeeMassTool1 = acc.popToolsAndMerge(EGAM1ZeeMassTool1Cfg(flags))
233 acc.addPublicTool(EGAM1ZeeMassTool1)
234 augmentationTools.append(EGAM1ZeeMassTool1)
235
236 EGAM1ZeeMassTool2 = acc.popToolsAndMerge(EGAM1ZeeMassTool2Cfg(flags))
237 acc.addPublicTool(EGAM1ZeeMassTool2)
238 augmentationTools.append(EGAM1ZeeMassTool2)
239
240 EGAM1ZeeMassTool3 = acc.popToolsAndMerge(EGAM1ZeeMassTool3Cfg(flags))
241 acc.addPublicTool(EGAM1ZeeMassTool3)
242 augmentationTools.append(EGAM1ZeeMassTool3)
243
244 EGAM1ZegMassTool = acc.popToolsAndMerge(EGAM1ZegMassToolCfg(flags))
245 acc.addPublicTool(EGAM1ZegMassTool)
246 augmentationTools.append(EGAM1ZegMassTool)
247
248 # ====================================================================
249 # Common calo decoration tools
250 # ====================================================================
251 from DerivationFrameworkCalo.DerivationFrameworkCaloConfig import (
252 CaloDecoratorKernelCfg)
253 acc.merge(CaloDecoratorKernelCfg(flags))
254
255 # thinning tools
256 thinningTools = []
257 streamName = kwargs["StreamName"]
258
259 # Track thinning
260 if flags.Derivation.Egamma.doTrackThinning:
261 from DerivationFrameworkInDet.InDetToolsConfig import (
262 TrackParticleThinningCfg,
263 MuonTrackParticleThinningCfg,
264 TauTrackParticleThinningCfg,
265 )
266
267 TrackThinningKeepElectronTracks = True
268 TrackThinningKeepPhotonTracks = True
269 TrackThinningKeepAllElectronTracks = True
270 TrackThinningKeepJetTracks = False
271 TrackThinningKeepMuonTracks = False
272 TrackThinningKeepTauTracks = False
273 TrackThinningKeepPVTracks = True
274
275 # Tracks associated with Electrons
276 if TrackThinningKeepElectronTracks:
277 EGAM1ElectronTPThinningTool = (
278 CompFactory.DerivationFramework.EgammaTrackParticleThinning(
279 name="EGAM1ElectronTPThinningTool",
280 StreamName=streamName,
281 SGKey="Electrons",
282 GSFTrackParticlesKey="GSFTrackParticles",
283 InDetTrackParticlesKey="InDetTrackParticles",
284 SelectionString="Electrons.pt > 0*GeV",
285 BestMatchOnly=True,
286 ConeSize=0.3,
287 )
288 )
289 acc.addPublicTool(EGAM1ElectronTPThinningTool)
290 thinningTools.append(EGAM1ElectronTPThinningTool)
291
292 # Tracks associated with Electrons (all tracks, large cone, for track
293 # isolation studies of the selected electrons)
294 if TrackThinningKeepAllElectronTracks:
295 EGAM1ElectronTPThinningTool2 = (
296 CompFactory.DerivationFramework.EgammaTrackParticleThinning(
297 name="EGAM1ElectronTPThinningTool2",
298 StreamName=streamName,
299 SGKey="Electrons",
300 GSFTrackParticlesKey="GSFTrackParticles",
301 InDetTrackParticlesKey="InDetTrackParticles",
302 SelectionString="Electrons.pt > 4*GeV",
303 BestMatchOnly=False,
304 ConeSize=0.6,
305 )
306 )
307 acc.addPublicTool(EGAM1ElectronTPThinningTool2)
308 thinningTools.append(EGAM1ElectronTPThinningTool2)
309
310 # Tracks associated with Photons
311 if TrackThinningKeepPhotonTracks:
312 EGAM1PhotonTPThinningTool = (
313 CompFactory.DerivationFramework.EgammaTrackParticleThinning(
314 name="EGAM1PhotonTPThinningTool",
315 StreamName=streamName,
316 SGKey="Photons",
317 GSFTrackParticlesKey="GSFTrackParticles",
318 InDetTrackParticlesKey="InDetTrackParticles",
319 GSFConversionVerticesKey="GSFConversionVertices",
320 SelectionString="Photons.pt > 0*GeV",
321 BestMatchOnly=True,
322 ConeSize=0.3,
323 )
324 )
325 acc.addPublicTool(EGAM1PhotonTPThinningTool)
326 thinningTools.append(EGAM1PhotonTPThinningTool)
327
328 # Tracks associated with Jets
329 if TrackThinningKeepJetTracks:
330 EGAM1JetTPThinningTool = (
331 CompFactory.DerivationFramework.JetTrackParticleThinning(
332 name="EGAM1JetTPThinningTool",
333 StreamName=streamName,
334 JetKey="AntiKt4EMPFlowJets",
335 InDetTrackParticlesKey="InDetTrackParticles",
336 )
337 )
338 acc.addPublicTool(EGAM1JetTPThinningTool)
339 thinningTools.append(EGAM1JetTPThinningTool)
340
341 # Tracks associated with Muons
342 if TrackThinningKeepMuonTracks:
343 EGAM1MuonTPThinningTool = acc.getPrimaryAndMerge(
344 MuonTrackParticleThinningCfg(
345 flags,
346 name="EGAM1MuonTPThinningTool",
347 StreamName=streamName,
348 MuonKey="Muons",
349 InDetTrackParticlesKey="InDetTrackParticles",
350 )
351 )
352 thinningTools.append(EGAM1MuonTPThinningTool)
353
354 # Tracks associated with Taus
355 if TrackThinningKeepTauTracks:
356 EGAM1TauTPThinningTool = acc.getPrimaryAndMerge(
357 TauTrackParticleThinningCfg(
358 flags,
359 name="EGAM1TauTPThinningTool",
360 StreamName=streamName,
361 TauKey="TauJets",
362 ConeSize=0.6,
363 InDetTrackParticlesKey="InDetTrackParticles",
364 DoTauTracksThinning=True,
365 TauTracksKey="TauTracks",
366 )
367 )
368 thinningTools.append(EGAM1TauTPThinningTool)
369
370 # Tracks from primary vertex
371 thinning_expression = " && ".join(
372 [
373 "(InDetTrackParticles.DFCommonTightPrimary)",
374 "(abs(DFCommonInDetTrackZ0AtPV)*sin(InDetTrackParticles.theta)<3*mm)",
375 "(InDetTrackParticles.pt>10*GeV)",
376 ]
377 )
378 if TrackThinningKeepPVTracks:
379 EGAM1TPThinningTool = acc.getPrimaryAndMerge(
380 TrackParticleThinningCfg(
381 flags,
382 name="EGAM1TPThinningTool",
383 StreamName=streamName,
384 SelectionString=thinning_expression,
385 InDetTrackParticlesKey="InDetTrackParticles",
386 )
387 )
388 thinningTools.append(EGAM1TPThinningTool)
389
390 # keep topoclusters around electrons
391 from DerivationFrameworkCalo.DerivationFrameworkCaloConfig import (
392 CaloClusterThinningCfg,
393 )
394
395 EGAM1CCTCThinningTool = acc.getPrimaryAndMerge(
396 CaloClusterThinningCfg(
397 flags,
398 name="EGAM1CCTCThinningTool",
399 StreamName=streamName,
400 SGKey="Electrons",
401 SelectionString="Electrons.pt>4*GeV",
402 TopoClCollectionSGKey="CaloCalTopoClusters",
403 ConeSize=0.5,
404 )
405 )
406 thinningTools.append(EGAM1CCTCThinningTool)
407
408 # truth thinning
409 if flags.Input.isMC:
410 # W, Z and Higgs
411 truth_cond_WZH = " && ".join(
412 ["(abs(TruthParticles.pdgId) >= 23)", "(abs(TruthParticles.pdgId) <= 25)"]
413 )
414 # Leptons
415 truth_cond_lep = " && ".join(
416 ["(abs(TruthParticles.pdgId) >= 11)", "(abs(TruthParticles.pdgId) <= 16)"]
417 )
418 # Top quark
419 truth_cond_top = "(abs(TruthParticles.pdgId) == 6)"
420 # Photon
421 truth_cond_gam = " && ".join(
422 ["(abs(TruthParticles.pdgId) == 22)", "(TruthParticles.pt > 1*GeV)"]
423 )
424 # stable particles
425 truth_cond_finalState = "(TruthParticles.isGenStable)"
426 truth_expression = (
427 "( "
428 + truth_cond_WZH
429 + " ) || "
430 + "( "
431 + truth_cond_lep
432 + " ) || "
433 + "( "
434 + truth_cond_top
435 + " ) || "
436 + "( "
437 + truth_cond_gam
438 + " ) || "
439 + "( "
440 + truth_cond_finalState
441 + " )"
442 )
443 print("EGAM1 truth thinning expression: ", truth_expression)
444
445 EGAM1TruthThinningTool = CompFactory.DerivationFramework.GenericTruthThinning(
446 name="EGAM1TruthThinningTool",
447 StreamName=streamName,
448 ParticleSelectionString=truth_expression,
449 PreserveDescendants=False,
450 PreserveGeneratorDescendants=True,
451 PreserveAncestors=True,
452 )
453 acc.addPublicTool(EGAM1TruthThinningTool)
454 thinningTools.append(EGAM1TruthThinningTool)
455
456 # skimming
457 skimmingTool = acc.getPrimaryAndMerge(EGAM1SkimmingToolCfg(flags))
458
459 # setup the kernel
460 acc.addEventAlgo(
461 CompFactory.DerivationFramework.DerivationKernel(
462 name,
463 SkimmingTools=[skimmingTool],
464 AugmentationTools=augmentationTools,
465 ThinningTools=thinningTools,
466 )
467 )
468
469 return acc
470
471
472def EGAM1Cfg(flags):
473 acc = ComponentAccumulator()
474
475 # Get the lists of triggers needed for trigger matching.
476 # This is needed at this scope (for the slimming) and further down
477 # in the config chain for actually configuring the matching, so we create
478 # it here and pass it down
479 # TODO: this should ideally be called higher up to avoid it being run
480 # multiple times in a train
481
482 from DerivationFrameworkPhys.TriggerListsHelper import TriggerListsHelper
483 EGAM1TriggerListsHelper = TriggerListsHelper(flags)
484
485 # configure skimming/thinning/augmentation tools
486 acc.merge(
488 flags,
489 name="EGAM1Kernel",
490 StreamName="StreamDAOD_EGAM1",
491 TriggerListsHelper=EGAM1TriggerListsHelper,
492 )
493 )
494
495 # configure slimming
496 from OutputStreamAthenaPool.OutputStreamConfig import OutputStreamCfg
497 from xAODMetaDataCnv.InfileMetaDataConfig import SetupMetaDataForStreamCfg
498 from DerivationFrameworkCore.SlimmingHelper import SlimmingHelper
499
500 EGAM1SlimmingHelper = SlimmingHelper(
501 "EGAM1SlimmingHelper",
502 NamesAndTypes=flags.Input.TypedCollections,
503 flags=flags,
504 )
505
506 # ------------------------------------------
507 # containers for which we save all variables
508 # -------------------------------------------
509
510 # baseline
511 EGAM1SlimmingHelper.AllVariables = [
512 "Electrons",
513 "GSFTrackParticles",
514 "egammaClusters",
515 "CaloCalTopoClusters",
516 ]
517
518 # for trigger studies we also add trigger containers
519 MenuType = ""
520 if flags.Trigger.EDMVersion == 2:
521 MenuType = "Run2"
522 elif flags.Trigger.EDMVersion == 3:
523 MenuType = "Run3"
524 if MenuType:
525 EGAM1SlimmingHelper.AllVariables += ExtraContainersTrigger[MenuType]
526 EGAM1SlimmingHelper.AllVariables += ExtraContainersElectronTrigger[MenuType]
527
528 # and on MC we also add:
529 if flags.Input.isMC:
530 EGAM1SlimmingHelper.AllVariables += [
531 "TruthEvents",
532 "TruthParticles",
533 "TruthVertices",
534 "egammaTruthParticles",
535 ]
536
537 # -------------------------------------------
538 # containers that we slim
539 # -------------------------------------------
540
541 # first add variables from smart-slimming
542 # adding only also those for which we add all variables since
543 # the XXXCPContent.py files also bring in some extra variables
544 # for other collections
545 EGAM1SlimmingHelper.SmartCollections = [
546 "Electrons",
547 "Photons",
548 "Muons",
549 "TauJets",
550 "PrimaryVertices",
551 "InDetTrackParticles",
552 "AntiKt4EMPFlowJets",
553
554 "MET_Baseline_AntiKt4EMPFlow",
555 ]
556 if flags.Input.isMC:
557 EGAM1SlimmingHelper.SmartCollections += [
558 "AntiKt4TruthJets",
559 "AntiKt4TruthDressedWZJets",
560 ]
561
562 # then add extra variables:
563
564 # muons
565 EGAM1SlimmingHelper.ExtraVariables += [
566 "Muons.ptcone20.ptcone30.ptcone40.etcone20.etcone30.etcone40"
567 ]
568
569 # conversion vertices
570 EGAM1SlimmingHelper.ExtraVariables += [
571 "GSFConversionVertices.x.y.z.px.py.pz.pt1.pt2.etaAtCalo.phiAtCalo",
572 "GSFConversionVertices.trackParticleLinks",
573 ]
574
575 # primary vertices
576 EGAM1SlimmingHelper.ExtraVariables += ["PrimaryVertices.sumPt2"]
577
578 # track jets
579 EGAM1SlimmingHelper.ExtraVariables += [
580 "AntiKt4PV0TrackJets.pt.eta.phi.e.m.btaggingLink.constituentLinks"
581 ]
582
583 # energy density
584 EGAM1SlimmingHelper.ExtraVariables += [
585 "TopoClusterIsoCentralEventShape.Density",
586 "TopoClusterIsoForwardEventShape.Density",
587 "NeutralParticleFlowIsoCentralEventShape.Density",
588 "NeutralParticleFlowIsoForwardEventShape.Density",
589 ]
590
591 from DerivationFrameworkEGamma import EGammaIsoConfig
592
593 (
594 pflowIsoVar,
595 densityList,
596 densityDict,
597 acc1,
598 ) = EGammaIsoConfig.makeEGammaCommonIsoCfg(flags)
599 acc.merge(acc1)
600 EGAM1SlimmingHelper.AppendToDictionary.update(densityDict)
601 EGAM1SlimmingHelper.ExtraVariables += densityList
602
603 # photons: detailed shower shape variables
604 EGAM1SlimmingHelper.ExtraVariables += PhotonsCPDetailedContent
605
606 # photons: gain and cluster energy per layer
607 from DerivationFrameworkCalo.DerivationFrameworkCaloConfig import (
608 getGainDecorations,
609 getClusterEnergyPerLayerDecorations,
610 )
611
612 gainDecorations = getGainDecorations(acc, flags, "EGAM1Kernel")
613 print("EGAM1 gain decorations: ", gainDecorations)
614 EGAM1SlimmingHelper.ExtraVariables.extend(gainDecorations)
615 clusterEnergyDecorations = getClusterEnergyPerLayerDecorations(acc, "EGAM1Kernel")
616 print("EGAM1 cluster energy decorations: ", clusterEnergyDecorations)
617 EGAM1SlimmingHelper.ExtraVariables.extend(clusterEnergyDecorations)
618
619 # truth
620 if flags.Input.isMC:
621 EGAM1SlimmingHelper.ExtraVariables += [
622 "MuonTruthParticles.e.px.py.pz.status.pdgId.truthOrigin.truthType"
623 ]
624
625 EGAM1SlimmingHelper.ExtraVariables += [
626 "Photons.truthOrigin.truthType.truthParticleLink"
627 ]
628
629 # Add event info
630 if flags.Derivation.Egamma.doEventInfoSlimming:
631 EGAM1SlimmingHelper.SmartCollections.append("EventInfo")
632 else:
633 EGAM1SlimmingHelper.AllVariables += ["EventInfo"]
634
635 # Add egamma trigger objects
636 EGAM1SlimmingHelper.IncludeEGammaTriggerContent = True
637
638 # Trigger matching
639 # Run 2
640 if flags.Trigger.EDMVersion == 2:
641 from DerivationFrameworkPhys.TriggerMatchingCommonConfig import AddRun2TriggerMatchingToSlimmingHelper
642 AddRun2TriggerMatchingToSlimmingHelper(SlimmingHelper = EGAM1SlimmingHelper,
643 OutputContainerPrefix = "TrigMatch_",
644 TriggerList = EGAM1TriggerListsHelper.Run2TriggerNamesNoTau)
645 # Run 3, or Run 2 with navigation conversion
646 if flags.Trigger.EDMVersion == 3 or (flags.Trigger.EDMVersion == 2 and flags.Trigger.doEDMVersionConversion):
647 from TrigNavSlimmingMT.TrigNavSlimmingMTConfig import AddRun3TrigNavSlimmingCollectionsToSlimmingHelper
648 AddRun3TrigNavSlimmingCollectionsToSlimmingHelper(EGAM1SlimmingHelper)
649
650 # Add full CellContainer
651 EGAM1SlimmingHelper.StaticContent = [
652 "CaloCellContainer#AllCalo",
653 "CaloClusterCellLinkContainer#egammaClusters_links",
654 ]
655
656 # PLIT variables
657 if flags.Derivation.Egamma.addPLITInputs:
658 from LeptonTaggers.LeptonTaggersConfig import DecorateImprovedPromptLeptonAlgsCfg, GetExtraImprovedPromptVariablesForDxAOD
659 acc.merge(DecorateImprovedPromptLeptonAlgsCfg(flags))
660 EGAM1SlimmingHelper.ExtraVariables += [ item for item in GetExtraImprovedPromptVariablesForDxAOD() if item.startswith("Electrons")]
661 if flags.Derivation.Egamma.addPLITOutputs:
662 from LeptonTaggers.LeptonTaggersConfig import DecoratePLITAlgsCfg, GetExtraPLITVariablesForDxAOD
663 acc.merge(DecoratePLITAlgsCfg(flags))
664 EGAM1SlimmingHelper.ExtraVariables += [ item for item in GetExtraPLITVariablesForDxAOD() if item.startswith("Electrons")]
665
666 EGAM1ItemList = EGAM1SlimmingHelper.GetItemList()
667 acc.merge(
668 OutputStreamCfg(
669 flags,
670 "DAOD_EGAM1",
671 ItemList=EGAM1ItemList,
672 AcceptAlgs=["EGAM1Kernel"],
673 )
674 )
675 acc.merge(
676 SetupMetaDataForStreamCfg(
677 flags,
678 "DAOD_EGAM1",
679 AcceptAlgs=["EGAM1Kernel"],
680 createMetadata=[
681 MetadataCategory.CutFlowMetaData,
682 MetadataCategory.TruthMetaData,
683 ],
684 )
685 )
686
687 return acc
void print(char *figname, TCanvas *c1)
EGAM1ZegMassToolCfg(flags)
Definition EGAM1.py:160
EGAM1ZeeMassTool1Cfg(flags)
Definition EGAM1.py:43
EGAM1SkimmingToolCfg(flags)
Definition EGAM1.py:25
EGAM1Cfg(flags)
Definition EGAM1.py:472
EGAM1ZeeMassTool2Cfg(flags)
Definition EGAM1.py:84
EGAM1KernelCfg(flags, name="EGAM1Kernel", **kwargs)
Definition EGAM1.py:204
EGAM1ZeeMassTool3Cfg(flags)
Definition EGAM1.py:120