ATLAS Offline Software
TElectronTestAlgConfig.py
Go to the documentation of this file.
1 # Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
2 
3 # Simple script to run the TElectronTestAlg with CA
4 
5 
6 import sys
7 from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
8 from AthenaConfiguration.ComponentFactory import CompFactory
9 
10 
12 
13  acc = ComponentAccumulator()
14  TElectronTestAlg = CompFactory.getComp("CP::TElectronTestAlg")
15  testAlg = TElectronTestAlg(name="CP_TElectronTestAlg",
16  IdKey="Medium")
17  acc.addEventAlgo(testAlg)
18  return acc
19 
20 
21 if __name__ == "__main__":
22  from AthenaConfiguration.AllConfigFlags import initConfigFlags
23  flags = initConfigFlags()
24  flags.fillFromArgs()
25  flags.lock()
26  flags.dump()
27 
28  from AthenaConfiguration.MainServicesConfig import MainServicesCfg
29  cfg = MainServicesCfg(flags)
30  from AthenaPoolCnvSvc.PoolReadConfig import PoolReadCfg
31  cfg.merge(PoolReadCfg(flags))
32  MessageSvc = CompFactory.MessageSvc
33  cfg.addService(MessageSvc(infoLimit=0))
34  cfg.merge(TElectronTestAlgCfg())
35 
36  print("Start running...")
37  statusCode = None
38  statusCode = cfg.run()
39 
40  assert statusCode is not None, "Issue while running"
41  sys.exit(not statusCode.isSuccess())
python.JetAnalysisCommon.ComponentAccumulator
ComponentAccumulator
Definition: JetAnalysisCommon.py:302
python.TElectronTestAlgConfig.MessageSvc
MessageSvc
Definition: TElectronTestAlgConfig.py:32
TElectronTestAlg
Dual use Test Alg for TElectronEfficiencyTool.
python.MainServicesConfig.MainServicesCfg
def MainServicesCfg(flags, LoopMgr='AthenaEventLoopMgr')
Definition: MainServicesConfig.py:260
python.AllConfigFlags.initConfigFlags
def initConfigFlags()
Definition: AllConfigFlags.py:19
dbg::print
void print(std::FILE *stream, std::format_string< Args... > fmt, Args &&... args)
Definition: SGImplSvc.cxx:70
python.TElectronTestAlgConfig.TElectronTestAlgCfg
def TElectronTestAlgCfg()
Definition: TElectronTestAlgConfig.py:11
python.PoolReadConfig.PoolReadCfg
def PoolReadCfg(flags)
Definition: PoolReadConfig.py:69