ATLAS Offline Software
Loading...
Searching...
No Matches
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).
7from AthenaConfiguration.AllConfigFlags import initConfigFlags
8from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
9from AthenaConfiguration.ComponentFactory import CompFactory
10from AthenaConfiguration.MainServicesConfig import MainServicesCfg
11from AthenaConfiguration.TestDefaults import defaultTestFiles
12from AthenaCommon.Constants import DEBUG
13
14# I/O import(s).
15from AthenaPoolCnvSvc.PoolReadConfig import PoolReadCfg
16
17# Device import(s).
18from AthDeviceComps.AthDeviceCompsConfig import \
19 MemoryResourcesToolCfg, CopiesToolCfg
20
21# System import(s).
22import sys
23
24
25def 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
45if __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())