ATLAS Offline Software
WriteHiveDataObjConfig.py
Go to the documentation of this file.
1 # Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
2 
3 from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
4 
5 
6 def WriteHiveDataObjCfg(flags):
7  """
8  Configure and return a ComponentAccumulator with all Hive algorithms.
9  """
10  from AthExHive.AthExHiveConfig import (
11  HiveAlgAConf,
12  HiveAlgBConf,
13  HiveAlgCConf,
14  HiveAlgDConf,
15  HiveAlgEConf,
16  HiveAlgFConf,
17  HiveAlgGConf,
18  HiveAlgVConf,
19  )
20 
21  # Merge algs into CA
22  alg_configs = [
23  HiveAlgAConf,
24  HiveAlgBConf,
25  HiveAlgCConf,
26  HiveAlgDConf,
27  HiveAlgEConf,
28  HiveAlgFConf,
29  HiveAlgGConf,
30  HiveAlgVConf,
31  ]
32 
33  cfg = ComponentAccumulator()
34  for alg_conf in alg_configs:
35  cfg.merge(alg_conf(flags))
36 
37  return cfg
38 
39 
40 if __name__ == "__main__":
41  # Setup configuration flags
42  from AthenaConfiguration.MainServicesConfig import MainEvgenServicesCfg
43  from AthenaConfiguration.AllConfigFlags import initConfigFlags
44 
45  flags = initConfigFlags()
46  flags.Input.RunNumbers = [284500]
47  flags.Input.TimeStamps = [1] # dummy value
48  # workaround for building xAOD::EventInfo without input files
49  flags.Input.TypedCollections = []
50  flags.Exec.MaxEvents = 20
51  flags.fillFromArgs()
52  flags.lock()
53 
54  # The example runs with no input file. We configure it with the McEventSelector
55  cfg = MainEvgenServicesCfg(flags, withSequences=True)
56 
57  cfg.merge(WriteHiveDataObjCfg(flags))
58 
59  # Output stream
60  from OutputStreamAthenaPool.OutputStreamConfig import OutputStreamCfg
61 
62  cfg.merge(OutputStreamCfg(flags, "ExampleStream", ItemList=["HiveDataObj#*"]))
63 
64  # Execute
65  import sys
66 
67  sys.exit(cfg.run().isFailure())
python.JetAnalysisCommon.ComponentAccumulator
ComponentAccumulator
Definition: JetAnalysisCommon.py:302
python.OutputStreamConfig.OutputStreamCfg
def OutputStreamCfg(flags, streamName, ItemList=[], MetadataItemList=[], disableEventTag=False, trigNavThinningSvc=None, takeItemsFromInput=False, extendProvenanceRecord=True, keepProvenanceTagsRegEx=None, AcceptAlgs=[], HelperTools=[])
Definition: OutputStreamConfig.py:16
python.MainServicesConfig.MainEvgenServicesCfg
def MainEvgenServicesCfg(flags, LoopMgr="AthenaEventLoopMgr", withSequences=True)
Definition: MainServicesConfig.py:409
WriteHiveDataObjConfig.WriteHiveDataObjCfg
def WriteHiveDataObjCfg(flags)
Definition: WriteHiveDataObjConfig.py:6
python.AllConfigFlags.initConfigFlags
def initConfigFlags()
Definition: AllConfigFlags.py:19