ATLAS Offline Software
HITSMerge_tf.py
Go to the documentation of this file.
1 #! /usr/bin/env python
2 
3 # Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
4 
5 """
6 Merge multiple input HITS files into a single output HITS file.
7 Optionally run algorithms to tweak the output. Optionally merge Log
8 file tarballs at the same time.
9 """
10 
11 import os.path
12 import sys
13 import time
14 
15 import logging
16 
17 # Setup core logging here
18 from PyJobTransforms.trfLogger import msg
19 msg.info('logging set in %s' % sys.argv[0])
20 
21 from PyJobTransforms.transform import transform
22 from PyJobTransforms.trfExe import athenaExecutor
23 from PyJobTransforms.trfArgs import addAthenaArguments, addDetectorArguments
24 from SimuJobTransforms.simTrfArgs import addHITSMergeArgs
25 from PyJobTransforms.trfDecorators import stdTrfExceptionHandler, sigUsrStackTrace
26 
27 import PyJobTransforms.trfArgClasses as trfArgClasses
28 
29 # Prodsys hack...
30 ListOfDefaultPositionalKeys=['--DBRelease', '--amiConfig', '--amiMetadataTag', '--asetup', '--athena', '--athenaopts', '--beamType', '--checkEventCount', '--command', '--conditionsTag', '--env', '--eventAcceptanceEfficiency', '--execOnly', '--geometryVersion', '--ignoreErrors', '--ignoreFiles', '--ignorePatterns', '--imf', '--inputHITSFile', '--inputLogsFile', '--maxEvents', '--outputHITS_MRGFile', '--postExec', '--postInclude', '--preExec', '--preInclude', '--reportName', '--reportType', '--runNumber', '--showGraph', '--showPath', '--showSteps', '--skipEvents', '--skipFileValidation', '--skipInputFileValidation', '--skipOutputFileValidation', '--tcmalloc']
31 
32 @stdTrfExceptionHandler
33 @sigUsrStackTrace
34 def main():
35 
36  msg.info('This is %s' % sys.argv[0])
37 
38  trf = getTransform()
39  trf.parseCmdLineArgs(sys.argv[1:])
40  trf.execute()
41  if 'outputFileValidation' in trf._argdict and trf._argdict['outputFileValidation'].value is False:
42  msg.info('Skipping report generation')
43  else:
44  trf.generateReport()
45 
46  msg.info("%s stopped at %s, trf exit code %d" % (sys.argv[0], time.asctime(), trf.exitCode))
47  sys.exit(trf.exitCode)
48 
50  executorSet = set()
51  from SimuJobTransforms.SimTransformUtils import addStandardHITSMergeSubstep, addHITSMergeArguments
52  addStandardHITSMergeSubstep(executorSet)
53  trf = transform(executor = executorSet, description = 'HITS Merging transform. Inputs must be HITS. Outputs must be HITS_MRG (i.e. HITS). ')
54  addAthenaArguments(trf.parser)
55  addDetectorArguments(trf.parser)
56  addHITSMergeArguments(trf.parser)
57  return trf
58 
59 
60 
61 
67 
68 
69 if __name__ == '__main__':
70  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
PyJobTransforms.trfArgClasses
Transform argument class definitions.
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
HITSMerge_tf.main
def main()
Definition: HITSMerge_tf.py:34
python.SimTransformUtils.addStandardHITSMergeSubstep
def addStandardHITSMergeSubstep(executorSet)
Definition: SimTransformUtils.py:127
PyJobTransforms.trfExe
Transform execution functions.
PyJobTransforms.trfLogger
Logging configuration for ATLAS job transforms.
PyJobTransforms.transform
Main package for new style ATLAS job transforms.
python.SimTransformUtils.addHITSMergeArguments
def addHITSMergeArguments(parser)
Definition: SimTransformUtils.py:51
HITSMerge_tf.getTransform
def getTransform()
Definition: HITSMerge_tf.py:49