5 __doc__ =
"ToolFactories to configure egammaAlgs to be used at the HLT"
8 This file defines the factories of the algorithms to be used in an electron trigger sequence in athenaMT
9 These are inspired by the offline factories, alhtough modified so they reflect the configuration we need for these algorithms at the HLT.
10 Offline configurations are available here:
11 https://gitlab.cern.ch/atlas/athena/blob/master/Reconstruction/egamma/egammaAlgs/python/
16 from AthenaConfiguration.ComponentFactory
import CompFactory
17 from AthenaConfiguration.ComponentAccumulator
import ComponentAccumulator
18 from AthenaConfiguration.Enums
import BeamType
22 name=
'TrigEMTrackMatchBuilder'+tag
23 from egammaTrackTools.egammaTrackToolsConfig
import EMExtrapolationToolsCfg
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)
41 name =
'TrigEgammaRecElectron'+tag
42 electronRec = CompFactory.egammaRecBuilder( name,
43 InputClusterContainerName= calocluster,
44 egammaRecContainer= egammaRecContainer,
45 doConversions =
False,
47 acc.addEventAlgo(electronRec)
53 from egammaTools.egammaSwToolConfig
import egammaSwToolCfg
54 from egammaMVACalib.egammaMVACalibConfig
import egammaMVASvcCfg
55 superClusterBuilder = CompFactory.electronSuperClusterBuilder(
'TrigElectronSuperClusterBuilder'+tag,
56 InputEgammaRecContainerName = InputEgammaRecContainerName,
57 OutputEgammaRecContainerKey = SuperElectronRecCollectionName,
60 EtThresholdCut = 1000,
62 LinkToConstituents =
False)
63 acc.addEventAlgo(superClusterBuilder)
70 from egammaMVACalib.egammaMVACalibConfig
import egammaMVASvcCfg
71 tool = CompFactory.EMClusterTool(
'TrigEMClusterTool_electron'+variant,
72 OutputClusterContainerName = OutputClusterContainerName,
75 acc.setPrivateTools(tool)
79 def TrigTopoEgammaElectronCfg(flags, tag, variant, cellsName, InputElectronRecCollectionName, InputPhotonRecCollectionName, ElectronOutputName, PhotonOutputName, OutputClusterContainerName):
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)),
93 acc.addEventAlgo(builder)
100 tpicTool = CompFactory.xAOD.TrackParticlesInConeTool(TrackParticleLocation = trackParticleLocation)
102 tiTool = CompFactory.xAOD.TrackIsolationTool(name=
'TrigTrackIsolationTool'+tag,
103 TrackParticleLocation = trackParticleLocation,
105 TracksInConeTool = tpicTool)
107 tiTool.TrackSelectionTool.maxZ0SinTheta = 3
108 tiTool.TrackSelectionTool.minPt = 1000
109 tiTool.TrackSelectionTool.CutLevel =
"Loose"
111 acc.setPrivateTools(tiTool)
117 from xAODPrimitives.xAODIso
import xAODIso
as isoPar
118 builder = CompFactory.IsolationBuilder(
119 name =
'TrigElectronIsolationBuilder'+tag,
120 ElectronCollectionContainerName = electronCollectionContainerName,
121 CaloCellIsolationTool =
None,
122 CaloTopoIsolationTool =
None,
123 PFlowIsolationTool =
None,
124 useBremAssoc = useBremAssoc,
126 ElIsoTypes = [[isoPar.ptcone30,isoPar.ptcone20]],
127 ElCorTypes = [[isoPar.coreTrackPtr]],
128 ElCorTypesExtra = [[]],
130 acc.addEventAlgo(builder)
135 name =
'PrecisionElectronTopoMonitoring'+tag
136 from TrigEgammaMonitoring.egammaMonitorPrecisionConfig
import egammaMonitorPrecisionCfg
138 PrecisionElectronTopoMonitor = CompFactory.egammaMonitorElectronAlgorithm(
140 ElectronKey = electronKey,
141 IsoVarKeys = isoVarKeys,
143 acc.addEventAlgo(PrecisionElectronTopoMonitor)
148 name =
'PrecisionElectronSuperClusterMonitoring'+tag
149 from TrigEgammaMonitoring.egammaMonitorPrecisionConfig
import egammaMonitorSuperClusterCfg
151 PrecisionElectronSuperClusterMonitor = CompFactory.egammaMonitorSuperClusterAlgorithm(
153 InputEgammaRecContainerName = inputEgammaRecContainerName,
155 acc.addEventAlgo(PrecisionElectronSuperClusterMonitor)