ATLAS Offline Software
AODMerge_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 # Setup core logging here
13 from PyJobTransforms.trfLogger import msg
14 msg.info('logging set in %s' % sys.argv[0])
15 
16 from PyJobTransforms.transform import transform
17 from PyJobTransforms.trfExe import POOLMergeExecutor
18 from PyJobTransforms.trfArgs import addAthenaArguments, addDetectorArguments
19 from PyJobTransforms.trfDecorators import stdTrfExceptionHandler, sigUsrStackTrace
20 from RecJobTransforms.recTransformUtils import addCommonRecTrfArgs
21 
22 import PyJobTransforms.trfArgClasses as trfArgClasses
23 
24 ListOfDefaultPositionalKeys=['--DBRelease', '--amiConfig', '--amiMetadataTag', '--asetup', '--athena', '--athenaopts', '--autoConfiguration', '--beamType', '--checkEventCount', '--command', '--conditionsTag', '--env', '--eventAcceptanceEfficiency', '--execOnly', '--geometryVersion', '--ignoreErrors', '--ignoreFilters', '--ignorePatterns', '--inputAODFile', '--maxEvents', '--noimf', '--notcmalloc', '--outputAOD_MRGFile', '--postExec', '--postInclude', '--preExec', '--preInclude', '--reportName', '--runNumber', '--showGraph', '--showPath', '--showSteps', '--skipEvents', '--skipFileValidation', '--skipInputFileValidation', '--skipOutputFileValidation']
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  executorSet = set()
42  executorSet.add(POOLMergeExecutor(name = 'AODMerge', inData = ['AOD'], outData = ['AOD_MRG']))
43 
44  trf = transform(executor = executorSet)
45 
46  addAthenaArguments(trf.parser)
47  addDetectorArguments(trf.parser)
48  addCommonRecTrfArgs(trf.parser)
49  addMyArgs(trf.parser)
50  return trf
51 
52 
53 def addMyArgs(parser):
54  # Use arggroup to get these arguments in their own sub-section (of --help)
55  parser.defineArgGroup('AODMerge_tf', 'AOD merge job specific options')
56  parser.add_argument('--inputAODFile', nargs='+',
57  type=trfArgClasses.argFactory(trfArgClasses.argPOOLFile, io='input', type='aod'),
58  help='Input AOD file', group='AODMerge_tf')
59  parser.add_argument('--inputAOD_MRGFile', nargs='+',
60  type=trfArgClasses.argFactory(trfArgClasses.argPOOLFile, io='input', type='aod'),
61  help='Input (premarged) AOD file', group='AODMerge_tf')
62  parser.add_argument('--outputAOD_MRGFile', '--outputAODFile',
63  type=trfArgClasses.argFactory(trfArgClasses.argPOOLFile, io='output', type='aod'),
64  help='Output merged AOD file', group='AODMerge_tf')
65 
66 if __name__ == '__main__':
67  main()
python.trfArgs.addDetectorArguments
def addDetectorArguments(parser)
Options related to the setup of the ATLAS detector (used in simulation and digitisation as well as re...
Definition: trfArgs.py:229
AODMerge_tf.addMyArgs
def addMyArgs(parser)
Definition: AODMerge_tf.py:53
PyJobTransforms.trfArgClasses
Transform argument class definitions.
python.recTransformUtils.addCommonRecTrfArgs
def addCommonRecTrfArgs(parser)
Definition: recTransformUtils.py:14
python.trfArgs.addAthenaArguments
def addAthenaArguments(parser, maxEventsDefaultSubstep='first', addValgrind=True, addPerfMon=True, addVTune=True)
Options related to running athena in general TODO: Some way to mask certain options (perExec,...
Definition: trfArgs.py:59
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.
PyJobTransforms.trfLogger
Logging configuration for ATLAS job transforms.
AODMerge_tf.main
def main()
Definition: AODMerge_tf.py:28
PyJobTransforms.transform
Main package for new style ATLAS job transforms.
AODMerge_tf.getTransform
def getTransform()
Definition: AODMerge_tf.py:40