5__doc__ =
"ToolFactories to configure egammaAlgs to be used at the HLT"
8This file defines the factories of the algorithms to be used in an electron trigger sequence in athenaMT
9These are inspired by the offline factories, alhtough modified so they reflect the configuration we need for these algorithms at the HLT.
10Offline configurations are available here:
11 https://gitlab.cern.ch/atlas/athena/blob/master/Reconstruction/egamma/egammaAlgs/python/
16from AthenaConfiguration.ComponentFactory
import CompFactory
17from AthenaConfiguration.ComponentAccumulator
import ComponentAccumulator
18from AthenaConfiguration.Enums
import BeamType
21 acc = ComponentAccumulator()
22 name=
'TrigEMTrackMatchBuilder'+tag
23 from egammaTrackTools.egammaTrackToolsConfig
import EMExtrapolationToolsCfg
24 emExtrapolatorTools = acc.popToolsAndMerge(EMExtrapolationToolsCfg(flags))
25 builderTool = CompFactory.EMTrackMatchBuilder( name,
26 TrackParticlesName = trackparticles,
27 ExtrapolationTool = emExtrapolatorTools,
30 useCandidateMatch =
True,
32 SecondPassRescale =
True,
33 UseRescaleMetric =
True,
34 isCosmics = flags.Beam.Type
is BeamType.Cosmics)
35 acc.setPrivateTools(builderTool)
40 acc = ComponentAccumulator()
41 name =
'TrigEgammaRecElectron'+tag
42 electronRec = CompFactory.egammaRecBuilder( name,
43 InputClusterContainerName= calocluster,
44 egammaRecContainer= egammaRecContainer,
45 doConversions =
False,
47 acc.addEventAlgo(electronRec)
52 acc = ComponentAccumulator()
53 from egammaTools.egammaSwToolConfig
import egammaSwToolCfg
54 from egammaMVACalib.egammaMVACalibConfig
import egammaMVASvcCfg
55 superClusterBuilder = CompFactory.electronSuperClusterBuilder(
'TrigElectronSuperClusterBuilder'+tag,
56 InputEgammaRecContainerName = InputEgammaRecContainerName,
57 OutputEgammaRecContainerKey = SuperElectronRecCollectionName,
58 ClusterCorrectionTool = acc.popToolsAndMerge(egammaSwToolCfg(flags)),
59 MVACalibSvc = acc.getPrimaryAndMerge(egammaMVASvcCfg(flags)),
60 EtThresholdCut = 1000,
62 LinkToConstituents =
False)
63 acc.addEventAlgo(superClusterBuilder)
69 acc = ComponentAccumulator()
70 from egammaMVACalib.egammaMVACalibConfig
import egammaMVASvcCfg
71 tool = CompFactory.EMClusterTool(
'TrigEMClusterTool_electron'+variant,
72 OutputClusterContainerName = OutputClusterContainerName,
73 MVACalibSvc = acc.getPrimaryAndMerge(egammaMVASvcCfg(flags))
75 acc.setPrivateTools(tool)
79def TrigTopoEgammaElectronCfg(flags, tag, variant, cellsName, InputElectronRecCollectionName, InputPhotonRecCollectionName, ElectronOutputName, PhotonOutputName, OutputClusterContainerName):
80 acc = ComponentAccumulator()
81 from egammaTools.EMShowerBuilderConfig
import EMShowerBuilderCfg
82 builder = CompFactory.xAODEgammaBuilder(name=
'topoEgammaBuilder_TrigElectrons'+tag,
83 InputElectronRecCollectionName = InputElectronRecCollectionName,
84 InputPhotonRecCollectionName = InputPhotonRecCollectionName,
85 ElectronOutputName = ElectronOutputName,
86 PhotonOutputName = PhotonOutputName,
87 DummyElectronOutputName =
"HLT_PrecisionDummyElectron",
88 AmbiguityTool = CompFactory.EGammaAmbiguityTool(),
89 EMClusterTool = acc.popToolsAndMerge(
TrigEMClusterToolCfg(flags,variant,OutputClusterContainerName)),
90 EMShowerTool = acc.popToolsAndMerge(EMShowerBuilderCfg(flags, CellsName=cellsName)),
93 acc.addEventAlgo(builder)
98 from InDetTrackSelectionTool.InDetTrackSelectionToolConfig
import (
99 InDetTrackSelectionTool_Loose_Cfg)
100 acc = ComponentAccumulator()
102 tpicTool = CompFactory.xAOD.TrackParticlesInConeTool(TrackParticleLocation = trackParticleLocation)
103 tiTool = CompFactory.xAOD.TrackIsolationTool(name=
'TrigTrackIsolationTool'+tag,
104 TrackParticleLocation = trackParticleLocation,
106 TracksInConeTool = tpicTool,
107 TrackSelectionTool = acc.popToolsAndMerge(
108 InDetTrackSelectionTool_Loose_Cfg(flags, maxZ0SinTheta = 3, minPt = 1000)))
109 acc.setPrivateTools(tiTool)
114 acc = ComponentAccumulator()
115 from xAODPrimitives.xAODIso
import xAODIso
as isoPar
116 builder = CompFactory.IsolationBuilder(
117 name =
'TrigElectronIsolationBuilder'+tag,
118 ElectronCollectionContainerName = electronCollectionContainerName,
119 CaloCellIsolationTool =
None,
120 CaloTopoIsolationTool =
None,
121 PFlowIsolationTool =
None,
122 useBremAssoc = useBremAssoc,
124 ElIsoTypes = [[isoPar.ptcone30,isoPar.ptcone20]],
125 ElCorTypes = [[isoPar.coreTrackPtr]],
126 ElCorTypesExtra = [[]],
128 acc.addEventAlgo(builder)
132 acc = ComponentAccumulator()
133 name =
'PrecisionElectronTopoMonitoring'+tag
134 from TrigEgammaMonitoring.egammaMonitorPrecisionConfig
import egammaMonitorPrecisionCfg
135 monTool = egammaMonitorPrecisionCfg(flags, name)
136 PrecisionElectronTopoMonitor = CompFactory.egammaMonitorElectronAlgorithm(
138 ElectronKey = electronKey,
139 IsoVarKeys = isoVarKeys,
141 acc.addEventAlgo(PrecisionElectronTopoMonitor)
145 acc = ComponentAccumulator()
146 name =
'PrecisionElectronSuperClusterMonitoring'+tag
147 from TrigEgammaMonitoring.egammaMonitorPrecisionConfig
import egammaMonitorSuperClusterCfg
148 monTool = egammaMonitorSuperClusterCfg(flags, name)
149 PrecisionElectronSuperClusterMonitor = CompFactory.egammaMonitorSuperClusterAlgorithm(
151 InputEgammaRecContainerName = inputEgammaRecContainerName,
153 acc.addEventAlgo(PrecisionElectronSuperClusterMonitor)
PrecisionElectronTopoMonitorCfg(flags, tag, electronKey, isoVarKeys)
TrigEMTrackMatchBuilderToolCfg(flags, tag, trackparticles)
TrigTopoEgammaElectronCfg(flags, tag, variant, cellsName, InputElectronRecCollectionName, InputPhotonRecCollectionName, ElectronOutputName, PhotonOutputName, OutputClusterContainerName)
TrigElectronSuperClusterBuilderCfg(flags, tag, InputEgammaRecContainerName, SuperElectronRecCollectionName, trackparticles)
TrigTrackIsolationToolCfg(flags, tag, trackParticleLocation)
TrigEgammaRecElectronCfg(flags, tag, trackparticles, calocluster, egammaRecContainer)
PrecisionElectronSuperClusterMonitorCfg(flags, tag, inputEgammaRecContainerName)
TrigElectronIsoBuilderCfg(flags, tag, TrackParticleLocation, electronCollectionContainerName, useBremAssoc)
TrigEMClusterToolCfg(flags, variant, OutputClusterContainerName)