ATLAS Offline Software
ReSim_tf.py
Go to the documentation of this file.
1 #! /usr/bin/env python
2 
3 # Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
4 
5 """
6 Run ISF simulation on generated events and produce a HITS file.
7 """
8 
9 import os.path
10 import sys
11 import time
12 
13 import logging
14 
15 # Setup core logging here
16 from PyJobTransforms.trfLogger import msg
17 msg.info('logging set in %s' % sys.argv[0])
18 
19 from PyJobTransforms.transform import transform
20 from PyJobTransforms.trfExe import athenaExecutor
21 from PyJobTransforms.trfArgs import addAthenaArguments, addDetectorArguments
22 from PyJobTransforms.trfDecorators import stdTrfExceptionHandler, sigUsrStackTrace
23 from SimuJobTransforms.simTrfArgs import addForwardDetTrfArgs, addCommonSimTrfArgs, addCommonSimDigTrfArgs, addSim_tfArgs, addHITSMergeArgs
24 
25 import PyJobTransforms.trfArgClasses as trfArgClasses
26 
27 # Prodsys hack...
28 ListOfDefaultPositionalKeys=['--AFPOn', '--ALFAOn', '--AMIConfig', '--AMITag', '--CosmicFilterVolume', '--CosmicFilterVolume2', '--CosmicPtSlice', '--DBRelease', '--DataRunNumber', '--FwdRegionOn', '--HGTDOn', '--LucidOn', '--ZDCOn', '--argJSON', '--asetup', '--athena', '--athenaMPEventsBeforeFork', '--athenaMPMergeTargetSize', '--athenaMPStrategy', '--athenaMPUseEventOrders', '--athenaopts', '--attempt', '--beamType', '--checkEventCount', '--command', '--conditionsTag', '--dumpJSON', '--dumpPickle', '--enableLooperKiller', '--env', '--eventAcceptanceEfficiency', '--eventService', '--execOnly', '--fileValidation', '--geometryVersion', '--ignoreErrors', '--ignoreFiles', '--ignorePatterns', '--imf', '--inputEVNT_TRFile', '--inputFileValidation', '--inputHITSFile', '--inputLogsFile', '--jobNumber', '--jobid', '--maxEvents', '--outputEVNT_TRFile', '--outputFileValidation', '--outputHITS_MRGFile', '--outputHITS_RSMFile', '--parallelFileValidation', '--physicsList', '--postExec', '--postInclude', '--preExec', '--preInclude', '--randomSeed', '--reportName', '--reportType', '--runNumber', '--sharedWriter', '--showGraph', '--showPath', '--showSteps', '--simulator', '--skipEvents', '--steering', '--taskid', '--tcmalloc', '--trackRecordType', '--truthStrategy', '--useISF', '--valgrind', '--valgrindDefaultOpts', '--valgrindExtraOpts']
29 
30 @stdTrfExceptionHandler
31 @sigUsrStackTrace
32 def main():
33 
34  msg.info('This is %s' % sys.argv[0])
35 
36  trf = getTransform()
37  trf.parseCmdLineArgs(sys.argv[1:])
38  trf.execute()
39  if 'outputFileValidation' in trf._argdict and trf._argdict['outputFileValidation'].value is False:
40  msg.info('Skipping report generation')
41  else:
42  trf.generateReport()
43 
44  msg.info("%s stopped at %s, trf exit code %d" % (sys.argv[0], time.asctime(), trf.exitCode))
45  sys.exit(trf.exitCode)
46 
48  executorSet = set()
49  from SimuJobTransforms.SimTransformUtils import addReSimulationSubstep, addReSimulationArguments
50  addReSimulationSubstep(executorSet)
51  trf = transform(executor = executorSet, description = 'ATLAS Simulation transform. Inputs must be HITS. Outputs must be HITS_RSM')
52  addAthenaArguments(trf.parser)
53  addDetectorArguments(trf.parser)
54  addReSimulationArguments(trf.parser)
55  return trf
56 
57 
58 
59 
65 
66 
67 if __name__ == '__main__':
68  main()
python.SimTransformUtils.addReSimulationSubstep
def addReSimulationSubstep(executorSet)
Definition: SimTransformUtils.py:95
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
python.SimTransformUtils.addReSimulationArguments
def addReSimulationArguments(parser)
Definition: SimTransformUtils.py:34
ReSim_tf.main
def main()
Definition: ReSim_tf.py:32
ReSim_tf.getTransform
def getTransform()
Definition: ReSim_tf.py:47
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
PyJobTransforms.trfExe
Transform execution functions.
PyJobTransforms.trfLogger
Logging configuration for ATLAS job transforms.
PyJobTransforms.transform
Main package for new style ATLAS job transforms.