ATLAS Offline Software
Loading...
Searching...
No Matches
python.ReSimulation_Skeleton Namespace Reference

Functions

 fromRunArgs (runArgs)

Variables

 jobPropertiesDisallowed

Function Documentation

◆ fromRunArgs()

python.ReSimulation_Skeleton.fromRunArgs ( runArgs)

Definition at line 13 of file ReSimulation_Skeleton.py.

13def 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
68 specialConfigPreInclude(flags)
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.