ATLAS Offline Software
Loading...
Searching...
No Matches
python.EGAM3 Namespace Reference

Functions

 EGAM3SkimmingToolCfg (flags)
 EGAM3eeMassTool1Cfg (flags)
 EGAM3eeMassTool2Cfg (flags)
 EGAM3eeMassTool3Cfg (flags)
 EGAM3KernelCfg (flags, name="EGAM3Kernel", **kwargs)
 EGAM3Cfg (flags)

Function Documentation

◆ EGAM3Cfg()

python.EGAM3.EGAM3Cfg ( flags)

Definition at line 416 of file EGAM3.py.

416def EGAM3Cfg(flags):
417 acc = ComponentAccumulator()
418
419 # Get the lists of triggers needed for trigger matching.
420 # This is needed at this scope (for the slimming) and further down
421 # in the config chain for actually configuring the matching, so we create
422 # it here and pass it down
423 # TODO: this should ideally be called higher up to avoid it being run
424 # multiple times in a train
425 from DerivationFrameworkPhys.TriggerListsHelper import TriggerListsHelper
426
427 EGAM3TriggerListsHelper = TriggerListsHelper(flags)
428
429 # configure skimming/thinning/augmentation tools
430 acc.merge(
431 EGAM3KernelCfg(
432 flags,
433 name="EGAM3Kernel",
434 StreamName="StreamDAOD_EGAM3",
435 TriggerListsHelper=EGAM3TriggerListsHelper,
436 )
437 )
438
439 # configure slimming
440 from OutputStreamAthenaPool.OutputStreamConfig import OutputStreamCfg
441 from xAODMetaDataCnv.InfileMetaDataConfig import SetupMetaDataForStreamCfg
442 from DerivationFrameworkCore.SlimmingHelper import SlimmingHelper
443
444 EGAM3SlimmingHelper = SlimmingHelper(
445 "EGAM3SlimmingHelper",
446 NamesAndTypes=flags.Input.TypedCollections,
447 flags=flags,
448 )
449
450 # ------------------------------------------
451 # containers for which we save all variables
452 # -------------------------------------------
453
454 # baseline
455 EGAM3SlimmingHelper.AllVariables = [
456 "Photons",
457 "GSFTrackParticles",
458 "egammaClusters",
459 "ForwardElectrons",
460 "ForwardElectronClusters",
461 ]
462
463 # for trigger studies we also add:
464 MenuType = ""
465 if flags.Trigger.EDMVersion == 2:
466 MenuType = "Run2"
467 elif flags.Trigger.EDMVersion == 3:
468 MenuType = "Run3"
469
470 if MenuType:
471 EGAM3SlimmingHelper.AllVariables += ExtraContainersTrigger[MenuType]
472 EGAM3SlimmingHelper.AllVariables += ExtraContainersPhotonTrigger[MenuType]
473 EGAM3SlimmingHelper.AllVariables += ExtraContainersElectronTrigger[MenuType]
474 if not flags.Input.isMC:
475 EGAM3SlimmingHelper.AllVariables += ExtraContainersTriggerDataOnly[MenuType]
476
477 # and on MC we also add:
478 if flags.Input.isMC:
479 EGAM3SlimmingHelper.AllVariables += [
480 "TruthEvents",
481 "TruthParticles",
482 "TruthVertices",
483 "egammaTruthParticles",
484 "MuonTruthParticles",
485 ]
486
487 # -------------------------------------------
488 # containers that we slim
489 # -------------------------------------------
490
491 # first add variables from smart-slimming
492 # adding only also those for which we add all variables since
493 # the XXXCPContent.py files also bring in some extra variables
494 # for other collections
495 EGAM3SlimmingHelper.SmartCollections = [
496 "Electrons",
497 "Photons",
498 "Muons",
499 "TauJets",
500 "PrimaryVertices",
501 "InDetTrackParticles",
502 "AntiKt4EMPFlowJets",
503
504 "MET_Baseline_AntiKt4EMPFlow",
505 ]
506 if flags.Input.isMC:
507 EGAM3SlimmingHelper.SmartCollections += [
508 "AntiKt4TruthJets",
509 "AntiKt4TruthDressedWZJets",
510 ]
511 if flags.Derivation.Egamma.addHLTJets:
512 EGAM3SlimmingHelper.SmartCollections += [
513 "HLT_AntiKt4EMPFlowJets_subresjesgscIS_ftf",
514 ]
515
516 # then add extra variables:
517
518 # electrons
519 EGAM3SlimmingHelper.ExtraVariables += ["Electrons.Loose.Medium.Tight"]
520
521 # muons
522 EGAM3SlimmingHelper.ExtraVariables += [
523 "Muons.ptcone20.ptcone30.ptcone40.etcone20.etcone30.etcone40"
524 ]
525
526 # conversion vertices
527 EGAM3SlimmingHelper.ExtraVariables += [
528 "GSFConversionVertices.x.y.z.px.py.pz.pt1.pt2.etaAtCalo.phiAtCalo",
529 "GSFConversionVertices.trackParticleLinks",
530 ]
531
532 # primary vertices
533 EGAM3SlimmingHelper.ExtraVariables += ["PrimaryVertices.x.y.sumPt2"]
534
535 # energy density
536 EGAM3SlimmingHelper.ExtraVariables += [
537 "TopoClusterIsoCentralEventShape.Density",
538 "TopoClusterIsoForwardEventShape.Density",
539 "NeutralParticleFlowIsoCentralEventShape.Density",
540 "NeutralParticleFlowIsoForwardEventShape.Density",
541 ]
542
543 from DerivationFrameworkEGamma import EGammaIsoConfig
544
545 (
546 pflowIsoVar,
547 densityList,
548 densityDict,
549 acc1,
550 ) = EGammaIsoConfig.makeEGammaCommonIsoCfg(flags)
551 acc.merge(acc1)
552 EGAM3SlimmingHelper.AppendToDictionary.update(densityDict)
553 EGAM3SlimmingHelper.ExtraVariables += densityList
554
555 # To have ptcone40
556 from IsolationAlgs.DerivationTrackIsoConfig import DerivationTrackIsoCfg
557
558 acc.merge(
559 DerivationTrackIsoCfg(
560 flags, object_types=("Photons",), ptCuts=(500, 1000), postfix="Extra"
561 )
562 )
563
564 # electrons: detailed shower shape and track variables
565 EGAM3SlimmingHelper.ExtraVariables += ElectronsCPDetailedContent
566 EGAM3SlimmingHelper.ExtraVariables += GSFTracksCPDetailedContent
567
568 # photons and electrons: gain and cluster energy per layer
569 from DerivationFrameworkCalo.DerivationFrameworkCaloConfig import (
570 getGainDecorations,
571 getClusterEnergyPerLayerDecorations,
572 )
573
574 gainDecorations = getGainDecorations(acc, flags, "EGAM3Kernel")
575 print("EGAM3 gain decorations: ", gainDecorations)
576 EGAM3SlimmingHelper.ExtraVariables.extend(gainDecorations)
577 clusterEnergyDecorations = getClusterEnergyPerLayerDecorations(acc, "EGAM3Kernel")
578 print("EGAM3 cluster energy decorations: ", clusterEnergyDecorations)
579 EGAM3SlimmingHelper.ExtraVariables.extend(clusterEnergyDecorations)
580
581 # photon HLT variables
582 if MenuType:
583 EGAM3SlimmingHelper.ExtraVariables += ExtraVariablesHLTPhotons[MenuType]
584
585 # truth
586 if flags.Input.isMC:
587 EGAM3SlimmingHelper.ExtraVariables += [
588 "Electrons.truthOrigin.truthType.truthParticleLink"
589 ]
590
591 # Add event info
592 if flags.Derivation.Egamma.doEventInfoSlimming:
593 EGAM3SlimmingHelper.SmartCollections.append("EventInfo")
594 else:
595 EGAM3SlimmingHelper.AllVariables += ["EventInfo"]
596
597 # Add egamma trigger objects
598 EGAM3SlimmingHelper.IncludeEGammaTriggerContent = True
599
600 # Trigger matching
601 # Run 2
602 if flags.Trigger.EDMVersion == 2:
603 from DerivationFrameworkPhys.TriggerMatchingCommonConfig import AddRun2TriggerMatchingToSlimmingHelper
604 AddRun2TriggerMatchingToSlimmingHelper(SlimmingHelper = EGAM3SlimmingHelper,
605 OutputContainerPrefix = "TrigMatch_",
606 TriggerList = EGAM3TriggerListsHelper.Run2TriggerNamesNoTau)
607 # Run 3, or Run 2 with navigation conversion
608 if flags.Trigger.EDMVersion == 3 or (flags.Trigger.EDMVersion == 2 and flags.Trigger.doEDMVersionConversion):
609 from TrigNavSlimmingMT.TrigNavSlimmingMTConfig import AddRun3TrigNavSlimmingCollectionsToSlimmingHelper
610 AddRun3TrigNavSlimmingCollectionsToSlimmingHelper(EGAM3SlimmingHelper)
611
612 # Add full CellContainer
613 EGAM3SlimmingHelper.StaticContent = [
614 "CaloCellContainer#AllCalo",
615 "CaloClusterCellLinkContainer#egammaClusters_links",
616 ]
617
618 EGAM3ItemList = EGAM3SlimmingHelper.GetItemList()
619 acc.merge(
620 OutputStreamCfg(
621 flags,
622 "DAOD_EGAM3",
623 ItemList=EGAM3ItemList,
624 AcceptAlgs=["EGAM3Kernel"],
625 )
626 )
627 acc.merge(
628 SetupMetaDataForStreamCfg(
629 flags,
630 "DAOD_EGAM3",
631 AcceptAlgs=["EGAM3Kernel"],
632 createMetadata=[
633 MetadataCategory.CutFlowMetaData,
634 MetadataCategory.TruthMetaData,
635 ],
636 )
637 )
638
639 return acc
void print(char *figname, TCanvas *c1)

◆ EGAM3eeMassTool1Cfg()

python.EGAM3.EGAM3eeMassTool1Cfg ( flags)
Configure the EGAM3 ee invariant mass augmentation tool 1

Definition at line 92 of file EGAM3.py.

92def EGAM3eeMassTool1Cfg(flags):
93 """Configure the EGAM3 ee invariant mass augmentation tool 1"""
94 acc = ComponentAccumulator()
95
96 # ====================================================================
97 # 1. ee invariant mass of events passing eegamma or eee selection for
98 # photon efficiency studies, di-electron triggers
99 #
100 # two opposite-sign medium el, pT>10 GeV, |eta|<2.5, mee>40 GeV
101 # eegamma: one reco photon, ET>10 GeV< |eta|<2.5
102 # eee: 3 electrons, pT>10 GeV, mee>40 GeV
103 # if skim size too large either require tight electrons (at least one)
104 # or raise electron pT threshold (at least one)
105 # ====================================================================
106
107 requirementElectrons = " && ".join(
108 ["(Electrons.DFCommonElectronsLHMedium)", "(Electrons.pt > 9.5*GeV)"]
109 )
110
111 acc.setPrivateTools(
112 CompFactory.DerivationFramework.EGInvariantMassTool(
113 name="EGAM3_EEMassTool11",
114 Object1Requirements=requirementElectrons,
115 Object2Requirements=requirementElectrons,
116 StoreGateEntryName="EGAM3_DiElectronMass1",
117 Mass1Hypothesis=0.511 * MeV,
118 Mass2Hypothesis=0.511 * MeV,
119 Container1Name="Electrons",
120 Container2Name="Electrons",
121 CheckCharge=True,
122 DoTransverseMass=False,
123 MinDeltaR=0.0,
124 )
125 )
126
127 return acc
128
129

◆ EGAM3eeMassTool2Cfg()

python.EGAM3.EGAM3eeMassTool2Cfg ( flags)
Configure the EGAM3 ee invariant mass augmentation tool 2

Definition at line 130 of file EGAM3.py.

130def EGAM3eeMassTool2Cfg(flags):
131 """Configure the EGAM3 ee invariant mass augmentation tool 2"""
132 acc = ComponentAccumulator()
133
134 # ====================================================================
135 # 2. dielectron invariant mass for eegamma selection for low-pT
136 # electron studies with T&P
137 #
138 # tag e: tight, |eta|<2.5, pT>25 GeV
139 # probe e: reco, ET>7 GeV, central electron
140 # gamma: tight, ET>10 GeV
141 # ====================================================================
142 # asymmetric electron cuts/single e trigger, low pT cut for subleading
143 # e (for e calibration studies at low pT)
144
145 requirementElectron1 = " && ".join(
146 ["(Electrons.DFCommonElectronsLHTight)", "(Electrons.pt > 24.5*GeV)"]
147 )
148 requirementElectron2 = "(Electrons.pt > 6.5*GeV)"
149
150 acc.setPrivateTools(
151 CompFactory.DerivationFramework.EGInvariantMassTool(
152 name="EGAM3_ZEEMassTool2",
153 Object1Requirements=requirementElectron1,
154 Object2Requirements=requirementElectron2,
155 StoreGateEntryName="EGAM3_DiElectronMass2",
156 Mass1Hypothesis=0.511 * MeV,
157 Mass2Hypothesis=0.511 * MeV,
158 Container1Name="Electrons",
159 Container2Name="Electrons",
160 CheckCharge=True,
161 DoTransverseMass=False,
162 MinDeltaR=0.0,
163 )
164 )
165
166 return acc
167
168

◆ EGAM3eeMassTool3Cfg()

python.EGAM3.EGAM3eeMassTool3Cfg ( flags)
Configure the EGAM3 ee invariant mass augmentation tool 3

Definition at line 169 of file EGAM3.py.

169def EGAM3eeMassTool3Cfg(flags):
170 """Configure the EGAM3 ee invariant mass augmentation tool 3"""
171 acc = ComponentAccumulator()
172
173 # ====================================================================
174 # 3. eegamma selection for low-pT electron studies with T&P
175 # tag e: tight, |eta|<2.5, pT>25 GeV
176 # probe e: reco, ET>7 GeV, forward electron
177 # gamma: tight, ET>10 GeV
178 # ====================================================================
179
180 requirementElectron1 = " && ".join(
181 ["(Electrons.DFCommonElectronsLHTight)", "(Electrons.pt > 24.5*GeV)"]
182 )
183 requirementElectron2 = "(ForwardElectrons.pt > 6.5*GeV)"
184
185 acc.setPrivateTools(
186 CompFactory.DerivationFramework.EGInvariantMassTool(
187 name="EGAM3_EEMassTool3",
188 Object1Requirements=requirementElectron1,
189 Object2Requirements=requirementElectron2,
190 StoreGateEntryName="EGAM3_DiElectronMass3",
191 Mass1Hypothesis=0.511 * MeV,
192 Mass2Hypothesis=0.511 * MeV,
193 Container1Name="Electrons",
194 Container2Name="ForwardElectrons",
195 CheckCharge=True,
196 DoTransverseMass=False,
197 MinDeltaR=0.0,
198 )
199 )
200
201 return acc
202
203
204# Main algorithm config

◆ EGAM3KernelCfg()

python.EGAM3.EGAM3KernelCfg ( flags,
name = "EGAM3Kernel",
** kwargs )
Configure the derivation framework driving algorithm (kernel)
for EGAM3

Definition at line 205 of file EGAM3.py.

205def EGAM3KernelCfg(flags, name="EGAM3Kernel", **kwargs):
206 """Configure the derivation framework driving algorithm (kernel)
207 for EGAM3"""
208 acc = ComponentAccumulator()
209
210 # Common augmentations
211 from DerivationFrameworkPhys.PhysCommonConfig import PhysCommonAugmentationsCfg
212
213 acc.merge(
214 PhysCommonAugmentationsCfg(
215 flags, TriggerListsHelper=kwargs["TriggerListsHelper"]
216 )
217 )
218
219 # EGAM3 augmentations
220 augmentationTools = []
221
222 # ====================================================================
223 # ee and egamma invariant masses
224 # ====================================================================
225 EGAM3eeMassTool1 = acc.popToolsAndMerge(EGAM3eeMassTool1Cfg(flags))
226 acc.addPublicTool(EGAM3eeMassTool1)
227 augmentationTools.append(EGAM3eeMassTool1)
228
229 EGAM3eeMassTool2 = acc.popToolsAndMerge(EGAM3eeMassTool2Cfg(flags))
230 acc.addPublicTool(EGAM3eeMassTool2)
231 augmentationTools.append(EGAM3eeMassTool2)
232
233 EGAM3eeMassTool3 = acc.popToolsAndMerge(EGAM3eeMassTool3Cfg(flags))
234 acc.addPublicTool(EGAM3eeMassTool3)
235 augmentationTools.append(EGAM3eeMassTool3)
236
237 # ====================================================================
238 # Common calo decoration tools
239 # ====================================================================
240 from DerivationFrameworkCalo.DerivationFrameworkCaloConfig import (
241 CaloDecoratorKernelCfg)
242 acc.merge(CaloDecoratorKernelCfg(flags))
243
244 # thinning tools
245 thinningTools = []
246 streamName = kwargs["StreamName"]
247
248 # Track thinning
249 if flags.Derivation.Egamma.doTrackThinning:
250 from DerivationFrameworkInDet.InDetToolsConfig import (
251 TrackParticleThinningCfg,
252 MuonTrackParticleThinningCfg,
253 TauTrackParticleThinningCfg,
254 )
255
256 TrackThinningKeepElectronTracks = True
257 TrackThinningKeepAllElectronTracks = False
258 TrackThinningKeepPhotonTracks = True
259 TrackThinningKeepAllPhotonTracks = True
260 TrackThinningKeepJetTracks = False
261 TrackThinningKeepMuonTracks = False
262 TrackThinningKeepTauTracks = False
263 TrackThinningKeepPVTracks = True
264
265 # Tracks associated with Electrons
266 if TrackThinningKeepElectronTracks:
267 EGAM3ElectronTPThinningTool = (
268 CompFactory.DerivationFramework.EgammaTrackParticleThinning(
269 name="EGAM3ElectronTPThinningTool",
270 StreamName=streamName,
271 SGKey="Electrons",
272 GSFTrackParticlesKey="GSFTrackParticles",
273 InDetTrackParticlesKey="InDetTrackParticles",
274 SelectionString="Electrons.pt > 0*GeV",
275 BestMatchOnly=True,
276 ConeSize=0.3,
277 )
278 )
279 acc.addPublicTool(EGAM3ElectronTPThinningTool)
280 thinningTools.append(EGAM3ElectronTPThinningTool)
281
282 # Tracks associated with Electrons (all tracks, large cone, for track
283 # isolation studies of the selected electrons)
284 if TrackThinningKeepAllElectronTracks:
285 EGAM3ElectronTPThinningTool2 = (
286 CompFactory.DerivationFramework.EgammaTrackParticleThinning(
287 name="EGAM3ElectronTPThinningTool2",
288 StreamName=streamName,
289 SGKey="Electrons",
290 GSFTrackParticlesKey="GSFTrackParticles",
291 InDetTrackParticlesKey="InDetTrackParticles",
292 SelectionString="Electrons.pt > 4*GeV",
293 BestMatchOnly=False,
294 ConeSize=0.6,
295 )
296 )
297 acc.addPublicTool(EGAM3ElectronTPThinningTool2)
298 thinningTools.append(EGAM3ElectronTPThinningTool2)
299
300 # Tracks associated with Photons
301 if TrackThinningKeepPhotonTracks:
302 EGAM3PhotonTPThinningTool = (
303 CompFactory.DerivationFramework.EgammaTrackParticleThinning(
304 name="EGAM3PhotonTPThinningTool",
305 StreamName=streamName,
306 SGKey="Photons",
307 GSFTrackParticlesKey="GSFTrackParticles",
308 InDetTrackParticlesKey="InDetTrackParticles",
309 GSFConversionVerticesKey="GSFConversionVertices",
310 SelectionString="Photons.pt > 0*GeV",
311 BestMatchOnly=True,
312 ConeSize=0.3,
313 )
314 )
315 acc.addPublicTool(EGAM3PhotonTPThinningTool)
316 thinningTools.append(EGAM3PhotonTPThinningTool)
317
318 # Tracks associated with Photons (all tracks, large cone,
319 # for track isolation studies of the selected photons)
320 if TrackThinningKeepAllPhotonTracks:
321 EGAM3PhotonTPThinningTool2 = (
322 CompFactory.DerivationFramework.EgammaTrackParticleThinning(
323 name="EGAM3PhotonTPThinningTool2",
324 StreamName=streamName,
325 SGKey="Photons",
326 GSFTrackParticlesKey="GSFTrackParticles",
327 InDetTrackParticlesKey="InDetTrackParticles",
328 GSFConversionVerticesKey="GSFConversionVertices",
329 SelectionString="Photons.pt > 9.5*GeV",
330 BestMatchOnly=False,
331 ConeSize=0.6,
332 )
333 )
334 acc.addPublicTool(EGAM3PhotonTPThinningTool2)
335 thinningTools.append(EGAM3PhotonTPThinningTool2)
336
337 # Tracks associated with Jets
338 if TrackThinningKeepJetTracks:
339 EGAM3JetTPThinningTool = (
340 CompFactory.DerivationFramework.JetTrackParticleThinning(
341 name="EGAM3JetTPThinningTool",
342 StreamName=streamName,
343 JetKey="AntiKt4EMPFlowJets",
344 InDetTrackParticlesKey="InDetTrackParticles",
345 )
346 )
347 acc.addPublicTool(EGAM3JetTPThinningTool)
348 thinningTools.append(EGAM3JetTPThinningTool)
349
350 # Tracks associated with Muons
351 if TrackThinningKeepMuonTracks:
352 EGAM3MuonTPThinningTool = acc.getPrimaryAndMerge(
353 MuonTrackParticleThinningCfg(
354 flags,
355 name="EGAM3MuonTPThinningTool",
356 StreamName=streamName,
357 MuonKey="Muons",
358 InDetTrackParticlesKey="InDetTrackParticles",
359 )
360 )
361 thinningTools.append(EGAM3MuonTPThinningTool)
362
363 # Tracks associated with Taus
364 if TrackThinningKeepTauTracks:
365 EGAM3TauTPThinningTool = acc.getPrimaryAndMerge(
366 TauTrackParticleThinningCfg(
367 flags,
368 name="EGAM3TauTPThinningTool",
369 StreamName=streamName,
370 TauKey="TauJets",
371 ConeSize=0.6,
372 InDetTrackParticlesKey="InDetTrackParticles",
373 DoTauTracksThinning=True,
374 TauTracksKey="TauTracks",
375 )
376 )
377 thinningTools.append(EGAM3TauTPThinningTool)
378
379 # Tracks from primary vertex
380 thinning_expression = " && ".join(
381 [
382 "(InDetTrackParticles.DFCommonTightPrimary)",
383 "(abs(DFCommonInDetTrackZ0AtPV)*sin(InDetTrackParticles.theta)<3*mm)",
384 "(InDetTrackParticles.pt>10*GeV)",
385 ]
386 )
387 if TrackThinningKeepPVTracks:
388 EGAM3TPThinningTool = acc.getPrimaryAndMerge(
389 TrackParticleThinningCfg(
390 flags,
391 name="EGAM3TPThinningTool",
392 StreamName=streamName,
393 SelectionString=thinning_expression,
394 InDetTrackParticlesKey="InDetTrackParticles",
395 )
396 )
397 thinningTools.append(EGAM3TPThinningTool)
398
399 # skimming
400 skimmingTool = acc.popToolsAndMerge(EGAM3SkimmingToolCfg(flags))
401 acc.addPublicTool(skimmingTool)
402
403 # setup the kernel
404 acc.addEventAlgo(
405 CompFactory.DerivationFramework.DerivationKernel(
406 name,
407 SkimmingTools=[skimmingTool],
408 AugmentationTools=augmentationTools,
409 ThinningTools=thinningTools,
410 )
411 )
412
413 return acc
414
415

◆ EGAM3SkimmingToolCfg()

python.EGAM3.EGAM3SkimmingToolCfg ( flags)
Configure the EGAM3 skimming tool

Definition at line 29 of file EGAM3.py.

29def EGAM3SkimmingToolCfg(flags):
30 """Configure the EGAM3 skimming tool"""
31 acc = ComponentAccumulator()
32
33 # eegamma or eee selection for photon efficiency studies, ee triggers
34 expression1a = " && ".join(
35 [
36 "(count(DFCommonPhotons_et>9.5*GeV)>=1)",
37 "(count(EGAM3_DiElectronMass1 > 40.0*GeV)>=1)",
38 ]
39 )
40 expression1b = " && ".join(
41 [
42 "(count(Electrons.pt>9.5*GeV)>=3)",
43 "(count(EGAM3_DiElectronMass1 > 40.0*GeV)>=1)",
44 ]
45 )
46
47 # eegamma selection for low-pT central electron studies with T&P
48 expression2 = " && ".join(
49 [
50 "(count(DFCommonPhotons_et>9.5*GeV && "
51 + "Photons.DFCommonPhotonsIsEMTight)>=1)",
52 "(count(EGAM3_DiElectronMass2 > 40.0*GeV)>=1)",
53 ]
54 )
55
56 # eegamma selection for low-pT forward electron studies with T&P
57 expression3 = " && ".join(
58 [
59 "(count(DFCommonPhotons_et>9.5*GeV && "
60 + "Photons.DFCommonPhotonsIsEMTight)>=1)",
61 "(count(EGAM3_DiElectronMass3 > 40.0*GeV)>=1)",
62 ]
63 )
64
65 # take OR of previous selections
66 expression = (
67 "( "
68 + expression1a
69 + " ) || "
70 + "( "
71 + expression1b
72 + " ) || "
73 + "( "
74 + expression2
75 + " ) || "
76 + "( "
77 + expression3
78 + " )"
79 )
80 print("EGAM3 skimming expression: ", expression)
81
82 skimmingTool = CompFactory.DerivationFramework.xAODStringSkimmingTool(
83 name="EGAM3SkimmingTool", expression=expression)
84 if flags.Trigger.EDMVersion < 0:
85 skimmingTool.TrigDecisionTool=None
86
87 acc.setPrivateTools(skimmingTool)
88
89 return acc
90
91