ATLAS Offline Software
Loading...
Searching...
No Matches
TrackParticleCalibratorExampleConfig.py
Go to the documentation of this file.
1# Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
2#
3# Simple ComponentAccumulator configuration for running
4# AthCUDAExamples::TrackParticleCalibratorExampleAlg, offloading trivial
5# operations on xAOD::TrackParticleContrinaer, to a CUDA device.
6#
7
8# Core import(s).
9from AthenaConfiguration.AllConfigFlags import initConfigFlags
10from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
11from AthenaConfiguration.ComponentFactory import CompFactory
12from AthenaConfiguration.MainServicesConfig import MainServicesCfg
13from AthenaConfiguration.TestDefaults import defaultTestFiles
14from AthenaCommon.Constants import DEBUG
15
16# I/O import(s).
17from AthenaPoolCnvSvc.PoolReadConfig import PoolReadCfg
18
19# System import(s).
20import sys
21
23 '''Configure the example algorithm for running on a CUDA device.
24 '''
25 # Create an accumulator to hold the configuration.
26 result = ComponentAccumulator()
27 # Create the example algorithm.
28 alg = CompFactory.AthCUDAExamples.TrackParticleCalibratorExampleAlg(**kwargs)
29 result.addEventAlgo(alg)
30 # Return the result to the caller.
31 return result
32
33if __name__ == '__main__':
34
35 # Set up the job's flags.
36 flags = initConfigFlags()
37 flags.Exec.MaxEvents = 100
38 flags.Input.Files = defaultTestFiles.AOD_RUN3_DATA
39 flags.fillFromArgs()
40 flags.lock()
41
42 # Set up the main services.
43 acc = MainServicesCfg(flags)
44
45 # Set up the input file reading.
46 acc.merge(PoolReadCfg(flags))
47
48 # Set up the example algorithm.
49 acc.merge(TrackParticleCalibratorExampleAlgCfg(flags, OutputLevel = DEBUG))
50
51 # Run the configuration.
52 sys.exit(acc.run().isFailure())