ATLAS Offline Software
Cat_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 
7 
8 import sys
9 import time
10 
11 # Setup core logging here
12 from PyJobTransforms.trfLogger import msg
13 msg.info('logging set in %s', sys.argv[0])
14 
15 from PyJobTransforms.transform import transform
16 from PyJobTransforms.trfExe import scriptExecutor
17 import PyJobTransforms.trfArgClasses as trfArgClasses
18 from PyJobTransforms.trfDecorators import stdTrfExceptionHandler, sigUsrStackTrace
19 
20 @stdTrfExceptionHandler
21 @sigUsrStackTrace
22 def main():
23 
24  msg.info('This is %s', sys.argv[0])
25 
26  trf = getTransform()
27  trf.parseCmdLineArgs(sys.argv[1:])
28  trf.execute()
29  trf.generateReport()
30 
31  msg.info("%s stopped at %s, trf exit code %d", sys.argv[0], time.asctime(), trf.exitCode)
32  sys.exit(trf.exitCode)
33 
35  trf = transform(executor = scriptExecutor(name = 'The Fabulous Cat', exe = 'cat', exeArgs = ['inFile']))
36  addMyArgs(trf.parser)
37  return trf
38 
39 
40 def addMyArgs(parser):
41  # Use arggroup to get these arguments in their own sub-section (of --help)
42  parser.defineArgGroup('Cat_trf', 'Cat_trf specific options')
43  parser.add_argument('--inFile', type=trfArgClasses.argFactory(trfArgClasses.argString),
44  group='Cat_trf', help='Input file for the cat')
45 
46 
47 if __name__ == '__main__':
48  main()
Cat_tf.addMyArgs
def addMyArgs(parser)
Example of how to add some specific arguments to the transform.
Definition: Cat_tf.py:40
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
PyJobTransforms.trfExe
Transform execution functions.
Cat_tf.getTransform
def getTransform()
Definition: Cat_tf.py:34
PyJobTransforms.trfLogger
Logging configuration for ATLAS job transforms.
PyJobTransforms.transform
Main package for new style ATLAS job transforms.
Cat_tf.main
def main()
Definition: Cat_tf.py:22