ATLAS Offline Software
egammaTrackThinnerConfig.py
Go to the documentation of this file.
1 # Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
2 
3 from AthenaCommon.Logging import logging
4 from AthenaConfiguration.ComponentFactory import CompFactory
5 from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
6 
8  flags,
9  name='egammaTrackThinner',
10  **kwargs):
11 
12  acc = ComponentAccumulator()
13 
14  kwargs.setdefault("StreamName", "StreamAOD")
15  kwargs.setdefault("InputElectronContainerName",
16  flags.Egamma.Keys.Output.Electrons)
17  kwargs.setdefault("InputPhotonContainerName",
18  flags.Egamma.Keys.Output.Photons)
19  if flags.Detector.GeometryITk:
20  kwargs.setdefault("InputForwardElectronContainerName",
21  flags.Egamma.Keys.Output.ForwardElectrons)
22  kwargs.setdefault("TrackParticleContainerName",
23  flags.Egamma.Keys.Output.GSFTrackParticles)
24  kwargs.setdefault("VertexContainerName",
25  flags.Egamma.Keys.Output.ConversionVertices)
26 
27  acc.addEventAlgo(CompFactory.egammaTrackThinner(name, **kwargs))
28 
29  return acc
30 
31 
32 if __name__ == "__main__":
33  from AthenaConfiguration.AllConfigFlags import initConfigFlags
34  from AthenaConfiguration.TestDefaults import defaultTestFiles
35  from AthenaConfiguration.ComponentAccumulator import printProperties
36  from AthenaConfiguration.MainServicesConfig import MainServicesCfg
37  flags = initConfigFlags()
38  flags.Input.Files = defaultTestFiles.ESD
39 
40  acc = MainServicesCfg(flags)
41  mlog = logging.getLogger("egammaTrackThinnerConfigTest")
42  mlog.info("Configuring egammaTrackThinner: ")
43  acc.merge(egammaTrackThinnerCfg(flags))
44  printProperties(mlog,
45  acc.getEventAlgo("egammaTrackThinner"),
46  nestLevel=1,
47  printDefaults=True)
48  with open("egammatrackthinner.pkl", "wb") as f:
49  acc.store(f)
python.JetAnalysisCommon.ComponentAccumulator
ComponentAccumulator
Definition: JetAnalysisCommon.py:302
egammaTrackThinnerConfig.egammaTrackThinnerCfg
def egammaTrackThinnerCfg(flags, name='egammaTrackThinner', **kwargs)
Definition: egammaTrackThinnerConfig.py:7
python.MainServicesConfig.MainServicesCfg
def MainServicesCfg(flags, LoopMgr='AthenaEventLoopMgr')
Definition: MainServicesConfig.py:260
extractSporadic.printProperties
def printProperties(h, q, hLB)
Definition: extractSporadic.py:8
Trk::open
@ open
Definition: BinningType.h:40
python.AllConfigFlags.initConfigFlags
def initConfigFlags()
Definition: AllConfigFlags.py:19