ATLAS Offline Software
Sleep_tf.py
Go to the documentation of this file.
1 #! /usr/bin/env python
2 
3 # Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
4 
5 
8 
9 import sys
10 import time
11 
12 
13 # Setup core logging here
14 from PyJobTransforms.trfLogger import msg
15 msg.info('logging set in %s', sys.argv[0])
16 
17 from PyJobTransforms.transform import transform
18 from PyJobTransforms.trfExe import scriptExecutor
19 import PyJobTransforms.trfArgClasses as trfArgClasses
20 from PyJobTransforms.trfDecorators import stdTrfExceptionHandler, sigUsrStackTrace
21 
22 @stdTrfExceptionHandler
23 @sigUsrStackTrace
24 def main():
25 
26  msg.info('This is %s', sys.argv[0])
27 
28 
29  trf = getTransform()
30  trf.parseCmdLineArgs(sys.argv[1:])
31  trf.execute()
32  trf.generateReport()
33 
34  msg.info("%s stopped at %s, trf exit code %d", (sys.argv[0], time.asctime(), trf.exitCode))
35  sys.exit(trf.exitCode)
36 
37 
39  trf = transform(executor = scriptExecutor(name = 'The Sandman', exe = 'sleep', exeArgs = ['dust']))
40  addMyArgs(trf.parser)
41  return trf
42 
43 
44 def addMyArgs(parser):
45  # Use arggroup to get these arguments in their own sub-section (of --help)
46  parser.defineArgGroup('Sleep_trf', 'Sleep_trf specific options')
47  parser.add_argument('--dust', type=trfArgClasses.argFactory(trfArgClasses.argInt), group='Sleep_trf',
48  help='How much dust to throw (=sleep time in seconds)', default=trfArgClasses.argInt(10))
49 
50 
51 if __name__ == '__main__':
52  main()
Sleep_tf.getTransform
def getTransform()
Definition: Sleep_tf.py:38
PyJobTransforms.trfArgClasses
Transform argument class definitions.
Amg::transform
Amg::Vector3D transform(Amg::Vector3D &v, Amg::Transform3D &tr)
Transform a point from a Trasformation3D.
Definition: GeoPrimitivesHelpers.h:156
Sleep_tf.main
def main()
Definition: Sleep_tf.py:24
PyJobTransforms.trfExe
Transform execution functions.
PyJobTransforms.trfLogger
Logging configuration for ATLAS job transforms.
PyJobTransforms.transform
Main package for new style ATLAS job transforms.
Sleep_tf.addMyArgs
def addMyArgs(parser)
Example of how to add some specific arguments to the transform.
Definition: Sleep_tf.py:44