ATLAS Offline Software
Loading...
Searching...
No Matches
WriteHiveDataObjConfig.py
Go to the documentation of this file.
1# Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
2
3from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
4
5
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
40if __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.Files = []
47 flags.Input.RunNumbers = [284500]
48 flags.Input.TimeStamps = [1] # dummy value
49 # workaround for building xAOD::EventInfo without input files
50 flags.Input.TypedCollections = []
51 flags.Exec.MaxEvents = 20
52 flags.fillFromArgs()
53 flags.lock()
54
55 # The example runs with no input file. We configure it with the McEventSelector
56 cfg = MainEvgenServicesCfg(flags, withSequences=True)
57
58 cfg.merge(WriteHiveDataObjCfg(flags))
59
60 # Output stream
61 from OutputStreamAthenaPool.OutputStreamConfig import OutputStreamCfg
62
63 cfg.merge(OutputStreamCfg(flags, "ExampleStream", ItemList=["HiveDataObj#*"]))
64
65 # Execute
66 import sys
67
68 sys.exit(cfg.run().isFailure())