ATLAS Offline Software
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).
9 from AthenaConfiguration.AllConfigFlags import initConfigFlags
10 from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
11 from AthenaConfiguration.ComponentFactory import CompFactory
12 from AthenaConfiguration.MainServicesConfig import MainServicesCfg
13 from AthenaConfiguration.TestDefaults import defaultTestFiles
14 from AthenaCommon.Constants import DEBUG
15 
16 # I/O import(s).
17 from AthenaPoolCnvSvc.PoolReadConfig import PoolReadCfg
18 
19 # System import(s).
20 import 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 
33 if __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())
python.JetAnalysisCommon.ComponentAccumulator
ComponentAccumulator
Definition: JetAnalysisCommon.py:302
python.MainServicesConfig.MainServicesCfg
def MainServicesCfg(flags, LoopMgr='AthenaEventLoopMgr')
Definition: MainServicesConfig.py:256
Constants
some useful constants -------------------------------------------------—
python.AllConfigFlags.initConfigFlags
def initConfigFlags()
Definition: AllConfigFlags.py:19
python.TrackParticleCalibratorExampleConfig.TrackParticleCalibratorExampleAlgCfg
def TrackParticleCalibratorExampleAlgCfg(flags, **kwargs)
Definition: TrackParticleCalibratorExampleConfig.py:22
python.PoolReadConfig.PoolReadCfg
def PoolReadCfg(flags)
Definition: PoolReadConfig.py:69