ATLAS Offline Software
Loading...
Searching...
No Matches
TruthCategoriesConfig.py
Go to the documentation of this file.
1# Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
2from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
3from AthenaConfiguration.ComponentFactory import CompFactory
4
5def TruthCategoriesDecoratorCfg(ConfigFlags, name="TruthCategoriesDecorator", **kwargs):
6 acc = ComponentAccumulator()
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
15if __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)
TruthCategoriesDecoratorCfg(ConfigFlags, name="TruthCategoriesDecorator", **kwargs)