ATLAS Offline Software
TruthCategoriesConfig.py
Go to the documentation of this file.
1 # Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
2 from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
3 from AthenaConfiguration.ComponentFactory import CompFactory
4 
5 def TruthCategoriesDecoratorCfg(ConfigFlags, name="TruthCategoriesDecorator", **kwargs):
7  from TruthConverters.TruthConvertersCfg import xAODtoHEPToolCfg
8  from TruthRivetTools.TruthRivetToolsCfg import HiggsTruthCategoryToolCfg
9  kwargs.setdefault("HepMCTool", acc.popToolsAndMerge(xAODtoHEPToolCfg(ConfigFlags)))
10  kwargs.setdefault("CategoryTool", acc.popToolsAndMerge(HiggsTruthCategoryToolCfg(ConfigFlags)))
11  the_alg = CompFactory.DerivationFramework.TruthCategoriesDecorator(name, **kwargs)
12  acc.addEventAlgo(the_alg, primary = True)
13  return acc
14 
15 if __name__ == "__main__":
16  from AthenaConfiguration.AllConfigFlags import initConfigFlags
17  flags = initConfigFlags()
18  args = flags.fillFromArgs()
19  flags.Input.Files = args.input
20  flags.Concurrency.NumThreads=args.threads
21  flags.Concurrency.NumConcurrentEvents=args.threads
22  from AthenaCommon.Constants import DEBUG
23 
24  flags.lock()
25  flags.dump()
26 
27  from AthenaConfiguration.MainServicesConfig import MainServicesCfg
28  cfg = MainServicesCfg(flags)
29  msgService = cfg.getService('MessageSvc')
30  msgService.Format = "S:%s E:%e % F%128W%S%7W%R%T %0W%M"
31 
32  from AthenaPoolCnvSvc.PoolReadConfig import PoolReadCfg
33  cfg.merge(PoolReadCfg(flags))
34  cfg.merge(TruthCategoriesDecoratorCfg(flags, OutputLevel = DEBUG))
35 
36  sc = cfg.run(flags.Exec.MaxEvents)
37  if not sc.isSuccess():
38  exit(1)
python.JetAnalysisCommon.ComponentAccumulator
ComponentAccumulator
Definition: JetAnalysisCommon.py:302
TruthRivetToolsCfg.HiggsTruthCategoryToolCfg
def HiggsTruthCategoryToolCfg(flags, name="HiggsTruthCategoryTool", **kwargs)
Definition: TruthRivetToolsCfg.py:5
python.TruthCategoriesConfig.TruthCategoriesDecoratorCfg
def TruthCategoriesDecoratorCfg(ConfigFlags, name="TruthCategoriesDecorator", **kwargs)
Definition: TruthCategoriesConfig.py:5
python.MainServicesConfig.MainServicesCfg
def MainServicesCfg(flags, LoopMgr='AthenaEventLoopMgr')
Definition: MainServicesConfig.py:260
Constants
some useful constants -------------------------------------------------—
calibdata.exit
exit
Definition: calibdata.py:236
python.AllConfigFlags.initConfigFlags
def initConfigFlags()
Definition: AllConfigFlags.py:19
python.PoolReadConfig.PoolReadCfg
def PoolReadCfg(flags)
Definition: PoolReadConfig.py:69
TruthConvertersCfg.xAODtoHEPToolCfg
def xAODtoHEPToolCfg(flags, name="xAODToHepMCTool", **kwargs)
Definition: TruthConvertersCfg.py:5