ATLAS Offline Software
Loading...
Searching...
No Matches
TrigPhotonFactoriesCfg.py
Go to the documentation of this file.
1# Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
2
3"""
4This file defines the factories of the algorithms to be used in a photon trigger sequence in athenaMT
5These are inspired by the offline factories, alhtough modified so they reflect the configuration we need for these algorithms at the HLT.
6Offline configurations are available here:
7 https://gitlab.cern.ch/atlas/athena/blob/master/Reconstruction/egamma/egammaAlgs/python/
8"""
9from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
10from AthenaConfiguration.ComponentFactory import CompFactory
11
12def PrecisionPhotonCaloIsoMonitorCfg(flags, name = 'PrecisionPhotonCaloIsoEgammaBuilderMon', ion=False):
13 acc = ComponentAccumulator()
14 from TriggerMenuMT.HLT.Egamma.TrigEgammaKeys import getTrigEgammaKeys
15 TrigEgammaKeys = getTrigEgammaKeys(flags, ion = ion)
16 from TrigEgammaMonitoring.egammaMonitorPrecisionConfig import egammaMonitorPrecisionCfg
17 monTool = egammaMonitorPrecisionCfg(flags, name)
18 collectionIn = TrigEgammaKeys.precisionPhotonContainer
19 PrecisionPhotonCaloIsoMonitor = CompFactory.egammaMonitorPhotonAlgorithm(
20 name = name,
21 PhotonKey = TrigEgammaKeys.precisionPhotonContainer,
22 IsoVarKeys = [ '%s.topoetcone20' % collectionIn, '%s.topoetcone40' % collectionIn],
23 MonTool = monTool)
24 acc.addEventAlgo(PrecisionPhotonCaloIsoMonitor)
25 return acc
26
27def TrigEMClusterToolCfg(flags, ion=False):
28 acc = ComponentAccumulator()
29 from TriggerMenuMT.HLT.Egamma.TrigEgammaKeys import getTrigEgammaKeys
30 TrigEgammaKeys = getTrigEgammaKeys(flags, ion = ion)
31 from egammaMVACalib.egammaMVACalibConfig import egammaMVASvcCfg
32 tool = CompFactory.EMClusterTool('TrigEMClusterTool_photon',
33 OutputClusterContainerName = TrigEgammaKeys.precisionPhotonEMClusterContainer,
34 MVACalibSvc = acc.getPrimaryAndMerge(egammaMVASvcCfg(flags,name = "TrigEgammaMVASvc")))
35 acc.setPrivateTools(tool)
36 return acc
37
39 acc = ComponentAccumulator()
40 from TriggerMenuMT.HLT.Egamma.TrigEgammaKeys import getTrigEgammaKeys
41 TrigEgammaKeys = getTrigEgammaKeys(flags)
42 from egammaTools.EMShowerBuilderConfig import EMShowerBuilderCfg
43 from egammaTools.EMPIDBuilderConfig import EMPIDBuilderPhotonCfg
44 TrigTopoEgammaPhotons = CompFactory.xAODEgammaBuilder( name = 'TrigTopoEgammaPhotons',
45 InputElectronRecCollectionName = TrigEgammaKeys.precisionElectronSuperClusterRecCollection,
46 InputPhotonRecCollectionName = TrigEgammaKeys.precisionPhotonSuperClusterCollection,
47 ElectronOutputName = TrigEgammaKeys.precisionElectronContainer,
48 PhotonOutputName = TrigEgammaKeys.precisionPhotonContainer,
49 EMClusterTool = acc.popToolsAndMerge(TrigEMClusterToolCfg(flags, ion=False)),
50 EMShowerTool = acc.popToolsAndMerge(EMShowerBuilderCfg(flags,name='TrigEMShowerBuilder',CellsName="CaloCells")),
51 PhotonTools = [acc.popToolsAndMerge(EMPIDBuilderPhotonCfg(flags,name='TrigEMPIDBuilderPhotonCfg'))],
52 doPhotons = True,
53 doElectrons = False,
54 )
55 acc.addEventAlgo(TrigTopoEgammaPhotons)
56 return acc
57
59 acc = ComponentAccumulator()
60 from TriggerMenuMT.HLT.Egamma.TrigEgammaKeys import getTrigEgammaKeys
61 TrigEgammaKeys = getTrigEgammaKeys(flags,ion=True)
62 from egammaTools.EMShowerBuilderConfig import EMShowerBuilderCfg
63 from egammaTools.EMPIDBuilderConfig import EMPIDBuilderPhotonCfg
64 TrigTopoEgammaPhotons = CompFactory.xAODEgammaBuilder( name = 'TrigTopoEgammaPhotons_HI',
65 InputElectronRecCollectionName = TrigEgammaKeys.precisionElectronSuperClusterRecCollection,
66 InputPhotonRecCollectionName = TrigEgammaKeys.precisionPhotonSuperClusterCollection,
67 ElectronOutputName = TrigEgammaKeys.precisionElectronContainer,
68 PhotonOutputName = TrigEgammaKeys.precisionPhotonContainer,
69 EMClusterTool = acc.popToolsAndMerge(TrigEMClusterToolCfg(flags, ion=True)),
70 EMShowerTool = acc.popToolsAndMerge(EMShowerBuilderCfg(flags,name='TrigEMShowerBuilder_HI',CellsName="CorrectedRoICaloCells")),
71 PhotonTools = [acc.popToolsAndMerge(EMPIDBuilderPhotonCfg(flags,name='TrigEMPIDBuilderPhotonCfg_HI'))],
72 doPhotons = True,
73 doElectrons = False,
74 )
75 acc.addEventAlgo(TrigTopoEgammaPhotons)
76 return acc
77
78def PrecisionPhotonTopoMonitorCfg(flags, ion=False,name = 'PrecisionPhotonTopoMonitoring'):
79
80 acc = ComponentAccumulator()
81 from TriggerMenuMT.HLT.Egamma.TrigEgammaKeys import getTrigEgammaKeys
82 TrigEgammaKeys = getTrigEgammaKeys(flags,ion=ion)
83 from TrigEgammaMonitoring.egammaMonitorPrecisionConfig import egammaMonitorPrecisionCfg
84 monTool = egammaMonitorPrecisionCfg(flags, name+('HI' if ion is True else ''))
85
86 PrecisionPhotonTopoMonitor = CompFactory.egammaMonitorPhotonAlgorithm(
87 name = name+('HI' if ion is True else ''),
88 PhotonKey = TrigEgammaKeys.precisionPhotonContainer,
89 MonTool = monTool
90 )
91
92 acc.addEventAlgo(PrecisionPhotonTopoMonitor)
93 return acc
94
95def PrecisionPhotonSuperClusterMonitorCfg(flags, ion = False, name ='PrecisionPhotonSuperClusterMonitoring'):
96
97 acc = ComponentAccumulator()
98 from TriggerMenuMT.HLT.Egamma.TrigEgammaKeys import getTrigEgammaKeys
99 TrigEgammaKeys = getTrigEgammaKeys(flags, ion=ion)
100 from TrigEgammaMonitoring.egammaMonitorPrecisionConfig import egammaMonitorSuperClusterCfg
101 monTool = egammaMonitorSuperClusterCfg(flags, name+('HI' if ion is True else ''))
102
103 PrecisionPhotonSuperClusterMonitor = CompFactory.egammaMonitorSuperClusterAlgorithm(
104 name = name+('HI' if ion is True else ''),
105 InputEgammaRecContainerName = TrigEgammaKeys.precisionPhotonSuperClusterCollection,
106 MonTool = monTool
107 )
108
109 acc.addEventAlgo(PrecisionPhotonSuperClusterMonitor)
110 return acc
PrecisionPhotonSuperClusterMonitorCfg(flags, ion=False, name='PrecisionPhotonSuperClusterMonitoring')
PrecisionPhotonTopoMonitorCfg(flags, ion=False, name='PrecisionPhotonTopoMonitoring')
PrecisionPhotonCaloIsoMonitorCfg(flags, name='PrecisionPhotonCaloIsoEgammaBuilderMon', ion=False)
TrigEMClusterToolCfg(flags, ion=False)