ATLAS Offline Software
Digi_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 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, addTriggerArguments
22 from PyJobTransforms.trfDecorators import stdTrfExceptionHandler, sigUsrStackTrace
23 from SimuJobTransforms.simTrfArgs import addForwardDetTrfArgs, addBasicDigiArgs, addPileUpTrfArgs, addCommonSimDigTrfArgs
24 
25 import PyJobTransforms.trfArgClasses as trfArgClasses
26 
27 # Prodsys hack...
28 ListOfDefaultPositionalKeys=['--AFPOn', '--ALFAOn', '--AddCaloDigi', '--DBRelease', '--DataRunNumber', '--FwdRegionOn', '--LucidOn', '--PileUpPresampling', '--ZDCOn', '--amiConfig', '--amiMetadataTag', '--asetup', '--athena', '--athenaopts', '--beamType', '--bunchSpacing', '--checkEventCount', '--command', '--conditionsTag', '--digiRndmSvc', '--digiSeedOffset1', '--digiSeedOffset2', '--doAllNoise', '--env', '--eventAcceptanceEfficiency', '--execOnly', '--geometryVersion', '--ignoreErrors', '--ignoreFiles', '--ignorePatterns', '--imf', '--inputBeamGasHitsFile', '--inputBeamHaloHitsFile', '--inputCavernHitsFile', '--inputHITSFile', '--inputHighPtMinbiasHitsFile', '--inputLowPtMinbiasHitsFile', '--jobNumber', '--maxEvents', '--numberOfBeamGas', '--numberOfBeamHalo', '--numberOfCavernBkg', '--numberOfHighPtMinBias', '--numberOfLowPtMinBias', '--outputRDOFile', '--outputRDO_FILTFile', '--pileupFinalBunch', '--pileupInitialBunch', '--postExec', '--postInclude', '--preExec', '--preInclude', '--reportName', '--reportType', '--runNumber', '--samplingFractionDbTag', '--showGraph', '--showPath', '--showSteps', '--skipEvents', '--skipFileValidation', '--skipInputFileValidation', '--skipOutputFileValidation', '--tcmalloc', '--testPileUpConfig', '--triggerConfig']
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 addDigitizationSubstep, addDigitizationArguments
50  addDigitizationSubstep(executorSet)
51  trf = transform(executor = executorSet, description = 'ATLAS Digitization transform. Inputs must be HITS. Outputs must be RDO.')
52  addAthenaArguments(trf.parser)
53  addDetectorArguments(trf.parser)
54  addTriggerArguments(trf.parser, addTrigFilter=False)
55  addDigitizationArguments(trf.parser)
56  return trf
57 
58 
59 
60 
66 
67 if __name__ == '__main__':
68  main()
Digi_tf.getTransform
def getTransform()
Definition: Digi_tf.py:47
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.trfArgs.addTriggerArguments
def addTriggerArguments(parser, addTrigFilter=True)
Add trigger related arguments.
Definition: trfArgs.py:515
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
python.SimTransformUtils.addDigitizationSubstep
def addDigitizationSubstep(executorSet, in_reco_chain=False)
Definition: SimTransformUtils.py:133
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.
python.SimTransformUtils.addDigitizationArguments
def addDigitizationArguments(parser)
Definition: SimTransformUtils.py:55
Digi_tf.main
def main()
Definition: Digi_tf.py:32