ATLAS Offline Software
Functions | Variables
python.ReSimulation_Skeleton Namespace Reference

Functions

def fromRunArgs (runArgs)
 

Variables

 jobPropertiesDisallowed
 

Function Documentation

◆ fromRunArgs()

def python.ReSimulation_Skeleton.fromRunArgs (   runArgs)

Definition at line 13 of file ReSimulation_Skeleton.py.

13 def fromRunArgs(runArgs):
14  from AthenaCommon.Logging import logging
15  log = logging.getLogger('Sim_tf')
16  log.info('****************** STARTING Simulation *****************')
17 
18  log.info('**** Transformation run arguments')
19  log.info(str(runArgs))
20 
21  log.info('**** Setting-up configuration flags')
22  from AthenaConfiguration.AllConfigFlags import initConfigFlags
23  from SimulationConfig.SimEnums import SimulationFlavour
24  flags = initConfigFlags()
25 
26  commonRunArgsToFlags(runArgs, flags)
27 
28  # Set ProductionStep
29  from AthenaConfiguration.Enums import ProductionStep
30  flags.Common.ProductionStep = ProductionStep.Simulation
31 
32  # Set the simulator
33  if hasattr(runArgs, 'simulator'):
34  flags.Sim.ISF.Simulator = SimulationFlavour(runArgs.simulator)
35 
36  # This is ISF and resimulation
37  flags.Sim.ISFRun = True
38  flags.Sim.ISF.ReSimulation = True
39 
40  # Generate detector list
41  from SimuJobTransforms.SimulationHelpers import getDetectorsFromRunArgs
42  detectors = getDetectorsFromRunArgs(flags, runArgs)
43 
44  if hasattr(runArgs, 'inputHITSFile'):
45  flags.Input.Files = runArgs.inputHITSFile
46  else:
47  log.error('No inputHITSFile provided. Please try using Sim_tf.py instead.')
48  raise RuntimeError('No intputHITSFile provided.')
49 
50  if hasattr(runArgs, 'outputHITS_RSMFile'):
51  if runArgs.outputHITS_RSMFile == 'None':
52  flags.Output.HITSFileName = ''
53  else:
54  flags.Output.HITSFileName = runArgs.outputHITS_RSMFile
55 
56  # Setup detector flags
57  from AthenaConfiguration.DetectorConfigFlags import setupDetectorFlags
58  setupDetectorFlags(flags, detectors, toggle_geometry=True)
59 
60  # Setup perfmon flags from runargs
61  from PerfMonComps.PerfMonConfigHelpers import setPerfmonFlagsFromRunArgs
62  setPerfmonFlagsFromRunArgs(flags, runArgs)
63 
64  # Pre-include
65  processPreInclude(runArgs, flags)
66 
67  # Special Configuration preInclude
69 
70  # Pre-exec
71  processPreExec(runArgs, flags)
72 
73  # Common simulation runtime arguments
74  from SimulationConfig.SimConfigFlags import simulationRunArgsToFlags
75  simulationRunArgsToFlags(runArgs, flags)
76 
77  # To respect --athenaopts
78  flags.fillFromArgs()
79 
80  # Lock flags
81  flags.lock()
82 
83  cfg = CommonSimulationCfg(flags, log)
84 
85  # Add OLD suffix to the names of collections read in from the input HITS file
86  from SimuJobTransforms.ReSimInputConfig import RenameHitCollectionsOnReadCfg
87  cfg.merge(RenameHitCollectionsOnReadCfg(flags))
88 
89  # Special Configuration postInclude
90  specialConfigPostInclude(flags, cfg)
91 
92  # Post-include
93  processPostInclude(runArgs, flags, cfg)
94 
95  # Post-exec
96  processPostExec(runArgs, flags, cfg)
97 
98  # Write AMI tag into in-file metadata
99  from PyUtils.AMITagHelperConfig import AMITagCfg
100  cfg.merge(AMITagCfg(flags, runArgs))
101 
102  import time
103  tic = time.time()
104  # Run the final accumulator
105  sc = cfg.run()
106  log.info("Run resimulation in " + str(time.time()-tic) + " seconds")
107 
108  sys.exit(not sc.isSuccess())

Variable Documentation

◆ jobPropertiesDisallowed

python.ReSimulation_Skeleton.jobPropertiesDisallowed

Definition at line 10 of file ReSimulation_Skeleton.py.

python.TransformUtils.processPreExec
def processPreExec(runArgs, flags)
Definition: Tools/PyJobTransforms/python/TransformUtils.py:41
python.TransformUtils.processPostExec
def processPostExec(runArgs, flags, cfg)
Definition: Tools/PyJobTransforms/python/TransformUtils.py:50
python.ReSimulation_Skeleton.fromRunArgs
def fromRunArgs(runArgs)
Definition: ReSimulation_Skeleton.py:13
python.CommonSimulationSteering.CommonSimulationCfg
def CommonSimulationCfg(flags, log)
Definition: CommonSimulationSteering.py:35
python.TransformUtils.processPostInclude
def processPostInclude(runArgs, flags, cfg)
Definition: Tools/PyJobTransforms/python/TransformUtils.py:69
python.TransformUtils.processPreInclude
def processPreInclude(runArgs, flags)
Definition: Tools/PyJobTransforms/python/TransformUtils.py:62
python.CommonSimulationSteering.specialConfigPostInclude
def specialConfigPostInclude(flags, cfg)
Definition: CommonSimulationSteering.py:29
python.PerfMonConfigHelpers.setPerfmonFlagsFromRunArgs
def setPerfmonFlagsFromRunArgs(flags, runArgs)
Definition: PerfMonConfigHelpers.py:3
python.CommonRunArgsToFlags.commonRunArgsToFlags
def commonRunArgsToFlags(runArgs, configFlags)
Definition: CommonRunArgsToFlags.py:12
python.DetectorConfigFlags.setupDetectorFlags
def setupDetectorFlags(flags, custom_list=None, use_metadata=False, toggle_geometry=False, validate_only=False, keep_beampipe=False)
Definition: DetectorConfigFlags.py:289
python.SimConfigFlags.simulationRunArgsToFlags
def simulationRunArgsToFlags(runArgs, flags)
Definition: SimConfigFlags.py:267
python.ReSimInputConfig.RenameHitCollectionsOnReadCfg
def RenameHitCollectionsOnReadCfg(flags)
Definition: ReSimInputConfig.py:5
python.CommonSimulationSteering.specialConfigPreInclude
def specialConfigPreInclude(flags)
Definition: CommonSimulationSteering.py:23
python.AMITagHelperConfig.AMITagCfg
def AMITagCfg(flags, runArgs=None, fixBroken=False)
Definition: AMITagHelperConfig.py:77
python.AllConfigFlags.initConfigFlags
def initConfigFlags()
Definition: AllConfigFlags.py:19
str
Definition: BTagTrackIpAccessor.cxx:11
python.SimulationHelpers.getDetectorsFromRunArgs
def getDetectorsFromRunArgs(flags, runArgs)
Definition: SimulationHelpers.py:5