3 """ Instantiate the EGamma LRT reconstruction.
6 from AthenaCommon.Logging
import logging
7 from AthenaConfiguration.ComponentAccumulator
import ComponentAccumulator
8 from egammaTrackTools.egammaTrackToolsConfig
import (
9 EMExtrapolationToolsCfg)
14 mlog = logging.getLogger(name)
15 mlog.info(
'Starting EGamma LRT reconstruction configuration')
20 if flags.Egamma.doTracking:
21 from egammaAlgs.egammaSelectedTrackCopyConfig
import (
22 egammaSelectedTrackCopyCfg)
23 emextLRT = acc.popToolsAndMerge(
27 name=
"LRTegammaSelectedTrackCopy",
28 TrackParticleContainerName=
"InDetLargeD0TrackParticles",
29 OutputTrkPartContainerName=
"LRTegammaSelectedTrackParticles",
30 ExtrapolationTool=emextLRT)
33 from egammaAlgs.EMBremCollectionBuilderConfig
import (
34 EMBremCollectionBuilderCfg)
37 name=
'LRTEMBremCollectionBuilder',
38 TrackParticleContainerName=
'InDetLargeD0TrackParticles',
39 SelectedTrackParticleContainerName=
'LRTegammaSelectedTrackParticles',
40 OutputTrkPartContainerName=
'LRT'+flags.Egamma.Keys.Output.GSFTrackParticles,
41 OutputTrackContainerName=
'LRT'+flags.Egamma.Keys.Output.GSFTracks)
45 if flags.Egamma.doCentral:
46 from egammaAlgs.egammaRecBuilderConfig
import (
48 from egammaTools.EMTrackMatchBuilderConfig
import (
49 EMTrackMatchBuilderCfg)
50 emextLRT = acc.popToolsAndMerge(
54 name=
'LRTEMTrackMatchBuilder',
55 TrackParticlesName=
'LRT'+flags.Egamma.Keys.Output.GSFTrackParticles,
56 ExtrapolationTool=emextLRT)
60 name=
'LRTegammaRecBuilder',
61 egammaRecContainer=
"LRT"+flags.Egamma.Keys.Internal.EgammaRecs,
62 TrackMatchBuilderTool=lrtemtrackmatch,
66 from egammaAlgs.egammaSuperClusterBuilderConfig
import (
67 electronSuperClusterBuilderCfg)
70 name=
'LRTelectronSuperClusterBuilder',
71 InputEgammaRecContainerName=
'LRT' +
72 flags.Egamma.Keys.Internal.EgammaRecs,
73 OutputEgammaRecContainerKey=
'LRT' +
74 flags.Egamma.Keys.Internal.ElectronSuperRecs,
75 SuperClusterCollectionName =
'LRT' +
76 flags.Egamma.Keys.Internal.ElectronSuperClusters,
77 TrackMatchBuilderTool=lrtemtrackmatch)
80 from egammaAlgs.xAODEgammaBuilderConfig
import (
82 from egammaTools.EMClusterToolConfig
import (
86 name=
'LRTEMClusterTool',
87 OutputClusterContainerName=
'LRT'+flags.Egamma.Keys.Output.CaloClusters)
91 name=
'LRTxAODEgammaBuilder',
92 InputElectronRecCollectionName=
'LRT' +
93 flags.Egamma.Keys.Internal.ElectronSuperRecs,
94 ElectronOutputName=
'LRT'+flags.Egamma.Keys.Output.Electrons,
95 PhotonOutputName=
"LRT"+flags.Egamma.Keys.Output.Photons,
96 EMClusterTool=LRTEMClusterTool,
101 if flags.Egamma.doTruthAssociation:
102 from egammaAlgs.egammaTruthAssociationConfig
import (
103 egammaTruthAssociationCfg)
106 name=
'LRTegammaTruthAssociationAlg',
107 ElectronContainerName=
'LRT'+flags.Egamma.Keys.Output.Electrons,
108 EgammaTruthContainerName=
'LRT'+flags.Egamma.Keys.Output.TruthParticles,
110 MatchForwardElectrons=
False)
113 mlog.info(
"EGamma LRT reconstruction configured")
118 if __name__ ==
"__main__":
119 from AthenaConfiguration.AllConfigFlags
import initConfigFlags
120 from AthenaConfiguration.TestDefaults
import defaultTestFiles
121 from AthenaConfiguration.MainServicesConfig
import MainServicesCfg
123 flags.Input.Files = defaultTestFiles.RDO_RUN2
124 flags.Output.doWriteESD =
True
125 flags.Output.doWriteAOD =
True
130 acc.printConfig(withDetails=
True,
133 with open(
"egammalrtbuilderconfig.pkl",
"wb")
as f: