ATLAS Offline Software
TestBeam_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 """
6 Run Geant4 simulation on generated events and produce a HITS file.
7 """
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 athenaExecutor
18 from PyJobTransforms.trfArgs import addAthenaArguments, addDetectorArguments
19 from PyJobTransforms.trfDecorators import stdTrfExceptionHandler, sigUsrStackTrace
20 from SimuJobTransforms.simTrfArgs import addSimIOTrfArgs,addCommonSimTrfArgs, addCommonSimDigTrfArgs, addTestBeamArgs
21 
22 # Prodsys hack...
23 ListOfDefaultPositionalKeys=['--AMIConfig', '--AMITag', '--DBRelease', '--DataRunNumber', '--Eta', '--Theta', '--Z', '--asetup', '--athena', '--athenaopts', '--beamType', '--checkEventCount', '--command', '--conditionsTag', '--enableLooperKiller', '--env', '--eventAcceptanceEfficiency', '--execOnly', '--firstEvent', '--geometryVersion', '--ignoreErrors', '--ignoreFiles', '--ignorePatterns', '--imf', '--inputEvgenFile', '--jobNumber', '--maxEvents', '--outputHITSFile', '--physicsList', '--postExec', '--postInclude', '--preExec', '--preInclude', '--randomSeed', '--reportName', '--reportType', '--runNumber', '--showGraph', '--showPath', '--showSteps', '--skipEvents', '--skipFileValidation', '--skipInputFileValidation', '--skipOutputFileValidation', '--tcmalloc', '--testBeamConfig', '--useISF']
24 
25 @stdTrfExceptionHandler
26 @sigUsrStackTrace
27 def main():
28 
29  msg.info('This is %s' % sys.argv[0])
30 
31  trf = getTransform()
32  trf.parseCmdLineArgs(sys.argv[1:])
33  trf.execute()
34  if 'outputFileValidation' in trf._argdict and trf._argdict['outputFileValidation'].value is False:
35  msg.info('Skipping report generation')
36  else:
37  trf.generateReport()
38 
39  msg.info("%s stopped at %s, trf exit code %d" % (sys.argv[0], time.asctime(), trf.exitCode))
40  sys.exit(trf.exitCode)
41 
43  trf = transform(executor = athenaExecutor(name = 'TestBeamTf', skeletonCA = 'SimuJobTransforms.TestBeam_Skeleton',
44  substep = 'TBsim', tryDropAndReload = False, perfMonFile = 'ntuple.pmon.gz', inData=['NULL','Evgen'], outData=['HITS','NULL'] )) #may have to add evgen to outData if cosmics/cavern background jobs don't work.
45  addAthenaArguments(trf.parser)
46  addDetectorArguments(trf.parser)
47  addSimIOTrfArgs(trf.parser)
48  addCommonSimTrfArgs(trf.parser)
49  addCommonSimDigTrfArgs(trf.parser)
50  addTestBeamArgs(trf.parser)
51  return trf
52 
53 
54 
55 
61 
62 
63 if __name__ == '__main__':
64  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.simTrfArgs.addCommonSimTrfArgs
def addCommonSimTrfArgs(parser)
Add common Simulation transform arguments to an argparse ArgumentParser.
Definition: simTrfArgs.py:181
python.simTrfArgs.addCommonSimDigTrfArgs
def addCommonSimDigTrfArgs(parser)
Add common Simulation/Digitization transform arguments to an argparse ArgumentParser.
Definition: simTrfArgs.py:196
TestBeam_tf.main
def main()
Definition: TestBeam_tf.py:27
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
python.simTrfArgs.addTestBeamArgs
def addTestBeamArgs(parser)
Add arguments used only by TestBeam simulation jobs.
Definition: simTrfArgs.py:153
python.simTrfArgs.addSimIOTrfArgs
def addSimIOTrfArgs(parser)
Add common Simulation transform arguments to an argparse ArgumentParser.
Definition: simTrfArgs.py:169
TestBeam_tf.getTransform
def getTransform()
Definition: TestBeam_tf.py:42
PyJobTransforms.trfExe
Transform execution functions.
PyJobTransforms.trfLogger
Logging configuration for ATLAS job transforms.
PyJobTransforms.transform
Main package for new style ATLAS job transforms.