ATLAS Offline Software
egammaTruthParticleConfig.py
Go to the documentation of this file.
1 # Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
2 
3 #
4 # @file egammaD3PDAnalysis/python/egammaTruthParticleConfig.py
5 # @author scott snyder <snyder@bnl.gov>
6 # @date Mar, 2011
7 # @brief Configure algorithms to build filtered TruthParticleContainer
8 # for egamma truth.
9 #
10 
11 
12 from D3PDMakerConfig.D3PDMakerFlags import D3PDMakerFlags
13 from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
14 from AthenaConfiguration.ComponentFactory import CompFactory
15 
16 D3PD = CompFactory.D3PD
17 
18 
20  algname = 'egammaTruthBuilder',
21  sequenceName = None,
22  **kwargs):
23 
24  acc = ComponentAccumulator()
25 
26  if 'ParticleCaloExtensionTool' not in kwargs:
27  from TrkConfig.AtlasExtrapolatorConfig import \
28  MCTruthClassifierExtrapolatorCfg
29  extrapolator = acc.popToolsAndMerge \
30  (MCTruthClassifierExtrapolatorCfg (flags))
31 
32  from TrackToCalo.TrackToCaloConfig import EMParticleCaloExtensionToolCfg
33  extension = EMParticleCaloExtensionToolCfg \
34  (flags, Extrapolator=extrapolator)
35 
36  kwargs['ParticleCaloExtensionTool'] = acc.popToolsAndMerge (extension)
37 
38  kwargs.setdefault ('InputKey', D3PDMakerFlags.TruthSGKey)
39  kwargs.setdefault ('OutputKey', 'egammaTruth')
40  kwargs.setdefault ('AuxPrefix', D3PDMakerFlags.EgammaUserDataPrefix)
41 
42  # From egammaD3PDAnalysis
43  acc.addEventAlgo (D3PD.egammaTruthAlg (algname, **kwargs))
44  return acc
45 
python.JetAnalysisCommon.ComponentAccumulator
ComponentAccumulator
Definition: JetAnalysisCommon.py:302
D3PD::egammaTruthAlg
Select egtruth particles.
Definition: egammaTruthAlg.h:36
python.egammaTruthParticleConfig.egammaTruthParticleCfg
def egammaTruthParticleCfg(flags, algname='egammaTruthBuilder', sequenceName=None, **kwargs)
Definition: egammaTruthParticleConfig.py:19