ATLAS Offline Software
AtlasG4_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 Run Geant4 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, addCosmicsTrfArgs, addCommonSimTrfArgs, addCommonSimDigTrfArgs, addTrackRecordArgs
24 
25 
26 import PyJobTransforms.trfArgClasses as trfArgClasses
27 
28 # Prodsys hack...
29 ListOfDefaultPositionalKeys=['--AFPOn', '--ALFAOn', '--CosmicFilterVolume', '--CosmicFilterVolume2', '--CosmicPtSlice', '--DBRelease', '--DataRunNumber', '--FwdRegionOn', '--LucidOn', '--ZDCOn', '--amiConfig', '--amiMetadataTag', '--asetup', '--athena', '--athenaopts', '--beamType', '--checkEventCount', '--command', '--conditionsTag', '--enableLooperKiller', '--env', '--eventAcceptanceEfficiency', '--execOnly', '--firstEvent', '--geometryVersion', '--ignoreErrors', '--ignoreFiles', '--ignorePatterns', '--imf', '--inputEVNTFile', '--inputEVNT_TRFile', '--jobNumber', '--maxEvents', '--outputEVNT_TRFile', '--outputHITSFile', '--physicsList', '--postExec', '--postInclude', '--preExec', '--preInclude', '--randomSeed', '--reportName', '--reportType', '--runNumber', '--showGraph', '--showPath', '--showSteps', '--skipEvents', '--skipFileValidation', '--skipInputFileValidation', '--skipOutputFileValidation', '--tcmalloc', '--useISF']
30 
31 @stdTrfExceptionHandler
32 @sigUsrStackTrace
33 def main():
34 
35  msg.info('This is %s' % sys.argv[0])
36 
37  trf = getTransform()
38  trf.parseCmdLineArgs(sys.argv[1:])
39  trf.execute()
40  if 'outputFileValidation' in trf._argdict and trf._argdict['outputFileValidation'].value is False and not ('eventService' in trf._argdict and trf._argdict['eventService'].value):
41  msg.info('Skipping report generation')
42  else:
43  trf.generateReport()
44 
45  msg.info("%s stopped at %s, trf exit code %d" % (sys.argv[0], time.asctime(), trf.exitCode))
46  sys.exit(trf.exitCode)
47 
49  executorSet = set()
50  from SimuJobTransforms.SimTransformUtils import addAtlasG4Substep, addAtlasG4Arguments
51  addAtlasG4Substep(executorSet)
52  trf = transform(executor = executorSet, description = 'Legacy ATLAS Simulation transform. Inputs must be EVNT else a single particle Generator job options must be specified. Outputs must be HITS or TrackRecords.')
53  addAthenaArguments(trf.parser)
54  addDetectorArguments(trf.parser)
55  addAtlasG4Arguments(trf.parser)
56  return trf
57 
58 
59 
60 
66 
67 
68 if __name__ == '__main__':
69  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
python.SimTransformUtils.addAtlasG4Substep
def addAtlasG4Substep(executorSet)
Definition: SimTransformUtils.py:107
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
AtlasG4_tf.getTransform
def getTransform()
Definition: AtlasG4_tf.py:48
Amg::transform
Amg::Vector3D transform(Amg::Vector3D &v, Amg::Transform3D &tr)
Transform a point from a Trasformation3D.
Definition: GeoPrimitivesHelpers.h:156
AtlasG4_tf.main
def main()
Definition: AtlasG4_tf.py:33
python.SimTransformUtils.addAtlasG4Arguments
def addAtlasG4Arguments(parser)
Definition: SimTransformUtils.py:47
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.