12def egammaLRTReconstructionCfg(flags, name="egammaLRTReconstruction"):
13
14 mlog = logging.getLogger(name)
15 mlog.info('Starting EGamma LRT reconstruction configuration')
16
17 acc = ComponentAccumulator()
18
19
20 if flags.Egamma.doTracking:
21 from egammaAlgs.egammaSelectedTrackCopyConfig import (
22 egammaSelectedTrackCopyCfg)
23 emextLRT = acc.popToolsAndMerge(
24 EMExtrapolationToolsCfg(flags))
25 acc.merge(egammaSelectedTrackCopyCfg(
26 flags,
27 name="LRTegammaSelectedTrackCopy",
28 TrackParticleContainerName="InDetLargeD0TrackParticles",
29 OutputTrkPartContainerName="LRTegammaSelectedTrackParticles",
30 ExtrapolationTool=emextLRT)
31 )
32
33 from egammaAlgs.EMBremCollectionBuilderConfig import (
34 EMBremCollectionBuilderCfg)
35 acc.merge(EMBremCollectionBuilderCfg(
36 flags,
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)
42 )
43
44
45 if flags.Egamma.doCentral:
46 from egammaAlgs.egammaRecBuilderConfig import (
47 egammaRecBuilderCfg)
48 from egammaTools.EMTrackMatchBuilderConfig import (
49 EMTrackMatchBuilderCfg)
50 emextLRT = acc.popToolsAndMerge(
51 EMExtrapolationToolsCfg(flags))
52 lrtemtrackmatch = acc.popToolsAndMerge(EMTrackMatchBuilderCfg(
53 flags,
54 name='LRTEMTrackMatchBuilder',
55 TrackParticlesName='LRT'+flags.Egamma.Keys.Output.GSFTrackParticles,
56 ExtrapolationTool=emextLRT)
57 )
58 acc.merge(egammaRecBuilderCfg(
59 flags,
60 name='LRTegammaRecBuilder',
61 egammaRecContainer="LRT"+flags.Egamma.Keys.Internal.EgammaRecs,
62 TrackMatchBuilderTool=lrtemtrackmatch,
63 doConversions=False)
64 )
65
66 from egammaAlgs.egammaSuperClusterBuilderConfig import (
67 electronSuperClusterBuilderCfg)
68 acc.merge(electronSuperClusterBuilderCfg(
69 flags,
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)
78 )
79
80 from egammaAlgs.xAODEgammaBuilderConfig import (
81 xAODEgammaBuilderCfg)
82 from egammaTools.EMClusterToolConfig import (
83 EMClusterToolCfg)
84 LRTEMClusterTool = acc.popToolsAndMerge(EMClusterToolCfg(
85 flags,
86 name='LRTEMClusterTool',
87 OutputClusterContainerName='LRT'+flags.Egamma.Keys.Output.CaloClusters)
88 )
89 acc.merge(xAODEgammaBuilderCfg(
90 flags,
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,
97 doPhotons=False)
98 )
99
100
101 if flags.Egamma.doTruthAssociation:
102 from egammaAlgs.egammaTruthAssociationConfig import (
103 egammaTruthAssociationCfg)
104 acc.merge(egammaTruthAssociationCfg(
105 flags,
106 name='LRTegammaTruthAssociationAlg',
107 ElectronContainerName='LRT'+flags.Egamma.Keys.Output.Electrons,
108 EgammaTruthContainerName='LRT'+flags.Egamma.Keys.Output.TruthParticles,
109 MatchPhotons=False,
110 MatchForwardElectrons=False)
111 )
112
113 mlog.info("EGamma LRT reconstruction configured")
114
115 return acc
116
117