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

Variable Documentation

◆ jobPropertiesDisallowed

python.TestBeam_Skeleton.jobPropertiesDisallowed

Definition at line 10 of file TestBeam_Skeleton.py.