ATLAS Offline Software
RAWMerge_tf.py
Go to the documentation of this file.
1 #! /usr/bin/env python
2 
3 # Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
4 
5 
8 
9 import sys
10 import time
11 
12 # This is a hack for Prodsys I. To generate this list use the --dumpargs option to the transform, then paste in here
13 # N.B. This all has to go on one line!
14 ListOfDefaultPositionalKeys=['--allowRename', '--amiConfig', '--amiMetadataTag', '--checkEventCount', '--env', '--execOnly', '--ignoreErrors', '--inputBSFile', '--maskEmptyInputs', '--noimf', '--notcmalloc', '--outputBS_MRGFile', '--reportName', '--showGraph', '--showPath', '--showSteps', '--skipFileValidation', '--skipInputFileValidation', '--skipOutputFileValidation']
15 
16 # Setup core logging here
17 from PyJobTransforms.trfLogger import msg
18 msg.info('logging set in %s' % sys.argv[0])
19 
20 from PyJobTransforms.transform import transform
21 from PyJobTransforms.trfExe import bsMergeExecutor
22 from PyJobTransforms.trfDecorators import stdTrfExceptionHandler, sigUsrStackTrace
23 
24 import PyJobTransforms.trfArgClasses as trfArgClasses
25 
26 @stdTrfExceptionHandler
27 @sigUsrStackTrace
28 def main():
29 
30  msg.info('This is %s' % sys.argv[0])
31 
32  trf = getTransform()
33  trf.parseCmdLineArgs(sys.argv[1:])
34  trf.execute()
35  trf.generateReport()
36 
37  msg.info("%s stopped at %s, trf exit code %d" % (sys.argv[0], time.asctime(), trf.exitCode))
38  sys.exit(trf.exitCode)
39 
41  trf = transform(executor = bsMergeExecutor(name = 'RAWFileMerge', exe = 'file_merging',
42  inData = set(['BS']), outData = set(['BS_MRG'])))
43 
44  addMyArgs(trf.parser)
45  return trf
46 
47 
48 def addMyArgs(parser):
49  # Use arggroup to get these arguments in their own sub-section (of --help)
50  parser.defineArgGroup('RAWMerge_tf', 'RAWMerge specific options')
51  parser.add_argument('--inputBSFile', nargs='+',
52  type=trfArgClasses.argFactory(trfArgClasses.argBSFile, io='input'),
53  help='Input BS file(s)', group='RAWMerge_tf')
54  parser.add_argument('--outputBS_MRGFile', '--outputBSFile',
55  type=trfArgClasses.argFactory(trfArgClasses.argBSFile, io='output'),
56  help='Output merged BS file (best if this file ends in ._0001.data, but see allowRename option below)',
57  group='RAWMerge_tf')
58  parser.add_argument('--maskEmptyInputs', type=trfArgClasses.argFactory(trfArgClasses.argBool), group='RAWMerge_tf',
59  help='If true then empty BS files are not included in the merge (default True)',
60  default=trfArgClasses.argBool('True'))
61  parser.add_argument('--allowRename', type=trfArgClasses.argFactory(trfArgClasses.argBool), group='RAWMerge_tf',
62  help='If true merged BS file will be forcibly renamed to the value of "outputBSFile" (default True)',
63  default=trfArgClasses.argBool('True'))
64 
65 
66 if __name__ == '__main__':
67  main()
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
CxxUtils::set
constexpr std::enable_if_t< is_bitmask_v< E >, E & > set(E &lhs, E rhs)
Convenience function to set bits in a class enum bitmask.
Definition: bitmask.h:232
PyJobTransforms.trfExe
Transform execution functions.
RAWMerge_tf.getTransform
def getTransform()
Definition: RAWMerge_tf.py:40
PyJobTransforms.trfLogger
Logging configuration for ATLAS job transforms.
RAWMerge_tf.main
def main()
Definition: RAWMerge_tf.py:28
PyJobTransforms.transform
Main package for new style ATLAS job transforms.
RAWMerge_tf.addMyArgs
def addMyArgs(parser)
Definition: RAWMerge_tf.py:48