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

Functions

 fromRunArgs (runArgs)

Variables

 jobPropertiesDisallowed

Function Documentation

◆ fromRunArgs()

python.TestBeam_Skeleton.fromRunArgs ( runArgs)

Definition at line 13 of file TestBeam_Skeleton.py.

13def fromRunArgs(runArgs):
14 from AthenaCommon.Logging import logging
15 log = logging.getLogger('TeamBeam')
16 log.info('****************** STARTING ATLASG4 Test Beam *****************')
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 AthenaConfiguration.Enums import BeamType
24 from SimulationConfig.SimEnums import SimulationFlavour
25 flags = initConfigFlags()
26 commonRunArgsToFlags(runArgs, flags)
27
28 if not hasattr(runArgs, 'geometryVersion'):
29 log.info('no geometryVersion specified, so assuming tb_Tile2000_2003_5B')
30 flags.GeoModel.AtlasVersion = "ATLAS-CTB-01" # 'tb_Tile2000_2003_5B' # "ctbh8"
31
32 # Set ProductionStep
33 from AthenaConfiguration.Enums import ProductionStep
34 flags.Common.ProductionStep = ProductionStep.Simulation
35 # Set BeamType
36 flags.Beam.Type = BeamType.TestBeam
37 # Set Default ParticleGun configuration
38 flags.Sim.GenerationConfiguration="ParticleGun.ParticleGunConfig.ParticleGun_TestBeam_SingleParticleCfg"
39 flags.IOVDb.DatabaseInstance = "TMCP200"
40 # Set the simulator
41 flags.Sim.ISF.Simulator = SimulationFlavour.AtlasG4
42
43 # This is not ISF
44 flags.Sim.ISFRun = False
45
46 # Generate detector list
47 detectors = set()
48 detectors.add('Tile')
49
50 # Setup input: Three possible cases:
51 # 1) inputEVNTFile (normal)
52 # 2) inputEVNT_TRFile (TrackRecords from pre-simulated events,
53 # used with TrackRecordGenerator)
54 # 3) no input file (on-the-fly generation - typically ParticleGun
55 # or CosmicGenerator)
56 if hasattr(runArgs, 'inputEVNTFile'):
57 flags.Input.Files = runArgs.inputEVNTFile
58 else:
59 # Common cases
60 # 3a) ParticleGun
61 flags.Input.Files = []
62 flags.Input.isMC = True
63 log.info('No inputEVNTFile provided. Assuming that you are running a generator on the fly.')
64 if hasattr(runArgs, 'outputHITSFile'):
65 if runArgs.outputHITSFile == 'None':
66 flags.Output.HITSFileName = ''
67 else:
68 flags.Output.HITSFileName = runArgs.outputHITSFile
69 else:
70 raise RuntimeError('No outputHITSFile defined')
71
72 if hasattr(runArgs, 'conditionsTag'):
73 flags.IOVDb.GlobalTag = runArgs.conditionsTag
74
75 # Setup detector flags
76 from AthenaConfiguration.DetectorConfigFlags import setupDetectorFlags
77 setupDetectorFlags(flags, detectors, toggle_geometry=True)
78
79 # Setup perfmon flags from runargs
80 from PerfMonComps.PerfMonConfigHelpers import setPerfmonFlagsFromRunArgs
81 setPerfmonFlagsFromRunArgs(flags, runArgs)
82
83 # Pre-include
84 processPreInclude(runArgs, flags)
85
86 # Special Configuration preInclude
87 specialConfigPreInclude(flags)
88
89 # Pre-exec
90 processPreExec(runArgs, flags)
91
92 # Common simulation runtime arguments
93 from SimulationConfig.SimConfigFlags import simulationRunArgsToFlags
94 simulationRunArgsToFlags(runArgs, flags)
95
96 # Common simulation runtime arguments
97 from SimulationConfig.TestBeamConfigFlags import testBeamRunArgsToFlags
98 testBeamRunArgsToFlags(runArgs, flags)
99
100 # To respect --athenaopts
101 flags.fillFromArgs()
102
103 # Lock flags
104 flags.lock()
105
106 cfg = CommonSimulationCfg(flags, log)
107
108 # Special Configuration postInclude
109 specialConfigPostInclude(flags, cfg)
110
111 # Post-include
112 processPostInclude(runArgs, flags, cfg)
113
114 # Post-exec
115 processPostExec(runArgs, flags, cfg)
116
117 # Write AMI tag into in-file metadata
118 from PyUtils.AMITagHelperConfig import AMITagCfg
119 cfg.merge(AMITagCfg(flags, runArgs))
120
121 import time
122 tic = time.time()
123 # Run the final accumulator
124 sc = cfg.run()
125 log.info("Run G4AtlasAlg in " + str(time.time()-tic) + " seconds")
126
127 sys.exit(not sc.isSuccess())
STL class.

Variable Documentation

◆ jobPropertiesDisallowed

python.TestBeam_Skeleton.jobPropertiesDisallowed

Definition at line 10 of file TestBeam_Skeleton.py.