ATLAS Offline Software
Loading...
Searching...
No Matches
AthExHIP/python/TrackParticleCalibratorExampleConfig.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# Simple ComponentAccumulator configuration for running
6# AthHIPExamples::TrackParticleCalibratorExampleAlg, offloading trivial
7# operations on xAOD::TrackParticleContrinaer, to a HIP device.
8#
9
10# Core import(s).
11from AthenaConfiguration.AllConfigFlags import initConfigFlags
12from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
13from AthenaConfiguration.ComponentFactory import CompFactory
14from AthenaConfiguration.MainServicesConfig import MainServicesCfg
15from AthenaConfiguration.TestDefaults import defaultTestFiles
16from AthenaCommon.Constants import DEBUG
17
18# I/O import(s).
19from AthenaPoolCnvSvc.PoolReadConfig import PoolReadCfg
20
21# Device/Accelerator import(s).
22from AthHIPComps.AthHIPCompsConfig import \
23 MemoryResourcesToolCfg, StreamToolCfg, CopiesToolCfg
24
25# System import(s).
26import sys
27
28def TrackParticleCalibratorExampleAlgCfg(flags, **kwargs):
29 '''Configure the example algorithm for running on a HIP device.
30 '''
31 # Create an accumulator to hold the configuration.
32 result = ComponentAccumulator()
33 # Create the example algorithm.
34 alg = CompFactory.AthHIPExamples.TrackParticleCalibratorExampleAlg(**kwargs)
35 alg.MemoryResourcesTool = result.popToolsAndMerge(MemoryResourcesToolCfg(flags, **kwargs))
36 alg.CopiesTool = result.popToolsAndMerge(CopiesToolCfg(flags, **kwargs))
37 alg.StreamTool = result.popToolsAndMerge(StreamToolCfg(flags, **kwargs))
38
39 # Add the algorithm to the accumulator, so that it would eventually be
40 # scheduled to run.
41 result.addEventAlgo(alg)
42 # Return the result to the caller.
43 return result
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(TrackParticleCalibratorExampleAlgCfg(flags, OutputLevel = DEBUG))
62
63 # Run the configuration.
64 sys.exit(acc.run().isFailure())