ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Control
AthenaExamples
AthExDevice
python
EventDataCopyExampleConfig.py
Go to the documentation of this file.
1
#!/usr/bin/env athena.py
2
#
3
# Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
4
#
5
6
# Core import(s).
7
from
AthenaConfiguration.AllConfigFlags
import
initConfigFlags
8
from
AthenaConfiguration.ComponentAccumulator
import
ComponentAccumulator
9
from
AthenaConfiguration.ComponentFactory
import
CompFactory
10
from
AthenaConfiguration.MainServicesConfig
import
MainServicesCfg
11
from
AthenaConfiguration.TestDefaults
import
defaultTestFiles
12
from
AthenaCommon.Constants
import
DEBUG
13
14
# I/O import(s).
15
from
AthenaPoolCnvSvc.PoolReadConfig
import
PoolReadCfg
16
17
# Device import(s).
18
from
AthDeviceComps.AthDeviceCompsConfig
import
\
19
MemoryResourcesToolCfg, CopiesToolCfg
20
21
# System import(s).
22
import
sys
23
24
25
def
EventDataCopyExampleAlgCfg
(flags, **kwargs):
26
'''Configure the example algorithm for copying event data to a device.
27
'''
28
29
# Create an accumulator to hold the configuration.
30
result = ComponentAccumulator()
31
32
# Create the example algorithm.
33
alg = CompFactory.AthExDevice.EventDataCopyExampleAlg(**kwargs)
34
alg.MemoryResourcesTool = \
35
result.popToolsAndMerge(MemoryResourcesToolCfg(flags, **kwargs))
36
alg.CopiesTool = result.popToolsAndMerge(CopiesToolCfg(flags, **kwargs))
37
38
# Add the algorithm to the accumulator.
39
result.addEventAlgo(alg)
40
41
# Return the result to the caller.
42
return
result
43
44
45
if
__name__ ==
'__main__'
:
46
47
# Set up the job's flags.
48
flags = initConfigFlags()
49
flags.Exec.MaxEvents = 100
50
flags.Input.Files = defaultTestFiles.AOD_RUN3_DATA
51
flags.fillFromArgs()
52
flags.lock()
53
54
# Set up the main services.
55
acc = MainServicesCfg(flags)
56
57
# Set up the input file reading.
58
acc.merge(PoolReadCfg(flags))
59
60
# Set up the example algorithm.
61
acc.merge(
EventDataCopyExampleAlgCfg
(flags, OutputLevel=DEBUG))
62
63
# Run the configuration.
64
sys.exit(acc.run().isFailure())
Constants
python.EventDataCopyExampleConfig.EventDataCopyExampleAlgCfg
EventDataCopyExampleAlgCfg(flags, **kwargs)
Definition
EventDataCopyExampleConfig.py:25
Generated on
for ATLAS Offline Software by
1.17.0