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