ATLAS Offline Software
Functions | Variables
python.FastChainSkeleton Namespace Reference

Functions

def fromRunArgs (runArgs)
 

Variables

 jobPropertiesDisallowed
 

Function Documentation

◆ fromRunArgs()

def python.FastChainSkeleton.fromRunArgs (   runArgs)

Definition at line 15 of file FastChainSkeleton.py.

15 def fromRunArgs(runArgs):
16  from AthenaCommon.Logging import logging
17  logFastChain = logging.getLogger('FastChainSkeleton')
18  logFastChain.info('****************** STARTING FastChain Simulation *****************')
19 
20  logFastChain.info('**** Transformation run arguments')
21  logFastChain.info(str(runArgs))
22 
23  logFastChain.info('**** Setting-up configuration flags')
24  from AthenaConfiguration.AllConfigFlags import initConfigFlags
25  flags = initConfigFlags()
26 
27  from SimulationConfig.SimEnums import SimulationFlavour
28  commonRunArgsToFlags(runArgs, flags)
29 
30  # Set ProductionStep
31  from AthenaConfiguration.Enums import ProductionStep
32  flags.Common.ProductionStep = ProductionStep.FastChain
33 
34  # Set simulator
35  if hasattr(runArgs, 'simulator'):
36  flags.Sim.ISF.Simulator = SimulationFlavour(runArgs.simulator)
37 
38  # This is ISF
39  flags.Sim.ISFRun = True
40 
41  # Set input files
42  if hasattr(runArgs, 'inputRDO_BKGFile') or hasattr(runArgs, 'inputBS_SKIMFile'):
43  # Set inputs for Overlay
44  from OverlayConfiguration.OverlaySkeleton import setOverlayInputFiles
45  setOverlayInputFiles(runArgs, flags, logFastChain)
46  flags.Common.isOverlay = True
47  flags.Digitization.PileUp = False
48 
49  if flags.Overlay.DataOverlay and not flags.Overlay.ByteStream:
50  from SimulationConfig.SimEnums import VertexSource
51  flags.Sim.VertexSource = VertexSource.MatchingBkg
52  else:
53  # Setting input files for FastChain without overlay
54  if hasattr(runArgs, 'inputEVNTFile'):
55  flags.Input.Files = runArgs.inputEVNTFile
56  else:
57  raise RuntimeError('No input EVNT file defined')
58 
59  # Setting output files (including for Overlay) for FastChain
60  if hasattr(runArgs, 'outputHITSFile'):
61  flags.Output.HITSFileName = runArgs.outputHITSFile
62 
63  if hasattr(runArgs, 'outputRDOFile'):
64  if runArgs.outputRDOFile == 'None':
65  flags.Output.RDOFileName = ''
66  else:
67  flags.Output.RDOFileName = runArgs.outputRDOFile
68  else:
69  raise RuntimeError('No outputRDOFile defined')
70 
71  if flags.Common.isOverlay:
72  if hasattr(runArgs, 'outputRDO_SGNLFile'):
73  flags.Output.RDO_SGNLFileName = runArgs.outputRDO_SGNLFile
74 
75  if hasattr(runArgs, 'conditionsTag'):
76  flags.IOVDb.GlobalTag = runArgs.conditionsTag
77 
78  # Generate detector list (must be after input setting)
79  from SimuJobTransforms.SimulationHelpers import getDetectorsFromRunArgs
80  detectors = getDetectorsFromRunArgs(flags, runArgs)
81 
82  # Setup detector flags
83  from AthenaConfiguration.DetectorConfigFlags import setupDetectorFlags
84  setupDetectorFlags(flags, detectors, toggle_geometry=True)
85 
86  # Common simulation runtime arguments
87  from SimulationConfig.SimConfigFlags import simulationRunArgsToFlags
88  simulationRunArgsToFlags(runArgs, flags)
89 
90  # Setup digitization flags
91  from DigitizationConfig.DigitizationConfigFlags import digitizationRunArgsToFlags
92  digitizationRunArgsToFlags(runArgs, flags)
93 
94  # Setup flags for pile-up
95  if not flags.Common.isOverlay:
96  # Setup common digitization flags
97  from DigitizationConfig.DigitizationConfigFlags import setupDigitizationFlags
98  setupDigitizationFlags(runArgs, flags)
99  logFastChain.info('Running with pile-up: %s', flags.Digitization.PileUp)
100 
101  # Disable LVL1 trigger if triggerConfig explicitly set to 'NONE'
102  if hasattr(runArgs, 'triggerConfig') and runArgs.triggerConfig == 'NONE':
103  flags.Detector.EnableL1Calo = False
104 
105  # Setup perfmon flags from runargs
106  from PerfMonComps.PerfMonConfigHelpers import setPerfmonFlagsFromRunArgs
107  setPerfmonFlagsFromRunArgs(flags, runArgs)
108 
109  # Pre-include
110  processPreInclude(runArgs, flags)
111 
112  # Special Configuration preInclude
114 
115  # Pre-exec
116  processPreExec(runArgs, flags)
117 
118  if not flags.Common.isOverlay:
119  # Load pile-up stuff after pre-include/exec to ensure everything is up-to-date
120  from DigitizationConfig.DigitizationConfigFlags import pileupRunArgsToFlags
121  pileupRunArgsToFlags(runArgs, flags)
122 
123  # Setup pile-up profile
124  if flags.Digitization.PileUp:
125  from RunDependentSimComps.PileUpUtils import setupPileUpProfile
126  setupPileUpProfile(flags)
127 
128  flags.Sim.DoFullChain = True
129  # For jobs running Overlay we take the run number from the
130  # background RDOs, so we don't actually need to override the run
131  # number.
132  flags.Input.OverrideRunNumber = not flags.Common.isOverlay
133 
134  # To respect --athenaopts
135  flags.fillFromArgs()
136 
137  # Moving here so that it is ahead of flags being locked. Need to
138  # iterate on exact best position w.r.t. above calls
139  # Handle metadata correctly
140  if flags.Common.isOverlay:
141  from OverlayConfiguration.OverlayMetadata import fastChainOverlayMetadataCheck
143 
144  # Lock flags
145  flags.lock()
146 
147  if flags.Digitization.PileUp:
148  from DigitizationConfig.PileUpConfig import PileUpEventLoopMgrCfg
149  cfg = MainServicesCfg(flags, LoopMgr="PileUpEventLoopMgr")
150  cfg.merge(PileUpEventLoopMgrCfg(flags))
151  else:
152  cfg = MainServicesCfg(flags)
153 
154  cfg.merge(PoolReadCfg(flags))
155 
156  from BeamEffects.BeamEffectsAlgConfig import BeamEffectsAlgCfg
157  cfg.merge(BeamEffectsAlgCfg(flags))
158 
159  if not flags.Digitization.PileUp and not flags.Common.isOverlay:
160  # Make sure signal EventInfo is rebuilt from event context
161  # TODO: this is probably not needed, but keeping it to be in sync with standard simulation
162  from xAODEventInfoCnv.xAODEventInfoCnvConfig import EventInfoUpdateFromContextAlgCfg
163  cfg.merge(EventInfoUpdateFromContextAlgCfg(flags))
164 
165  if flags.Common.isOverlay:
166  from xAODEventInfoCnv.xAODEventInfoCnvConfig import EventInfoOverlayCfg
167  cfg.merge(EventInfoOverlayCfg(flags))
168  # CopyMcEventCollection should be before Kernel
169  if not flags.Overlay.DataOverlay:
170  from OverlayCopyAlgs.OverlayCopyAlgsConfig import CopyMcEventCollectionCfg
171  cfg.merge(CopyMcEventCollectionCfg(flags))
172 
173  from ISF_Config.ISF_MainConfig import ISF_KernelCfg
174  cfg.merge(ISF_KernelCfg(flags))
175 
176  # Main Overlay Steering
177  if flags.Common.isOverlay:
178  from OverlayConfiguration.OverlaySteering import OverlayMainContentCfg
179  cfg.merge(OverlayMainContentCfg(flags))
180  else:
181  from DigitizationConfig.DigitizationSteering import DigitizationMainContentCfg
182  cfg.merge(DigitizationMainContentCfg(flags))
183 
184  # Allow writing hits to output if requested
185  if flags.Output.HITSFileName:
186  from AthenaConfiguration.Enums import MetadataCategory
187  from OutputStreamAthenaPool.OutputStreamConfig import OutputStreamCfg
188  from SimuJobTransforms.SimOutputConfig import getStreamHITS_ItemList
189  from xAODMetaDataCnv.InfileMetaDataConfig import SetupMetaDataForStreamCfg
190  cfg.merge(OutputStreamCfg(flags, "HITS", ItemList=getStreamHITS_ItemList(flags)))
191  cfg.merge(SetupMetaDataForStreamCfg(flags, "HITS", createMetadata=[MetadataCategory.IOVMetaData]))
192 
193  # Special message service configuration
194  from DigitizationConfig.DigitizationSteering import DigitizationMessageSvcCfg
195  cfg.merge(DigitizationMessageSvcCfg(flags))
196 
197  # Special Configuration postInclude
198  specialConfigPostInclude(flags, cfg)
199 
200  # Post-include
201  processPostInclude(runArgs, flags, cfg)
202 
203  # Post-exec
204  processPostExec(runArgs, flags, cfg)
205 
206  from AthenaConfiguration.Utils import setupLoggingLevels
207  setupLoggingLevels(flags, cfg)
208 
209  # Run the final accumulator
210  sc = cfg.run()
211  sys.exit(not sc.isSuccess())

Variable Documentation

◆ jobPropertiesDisallowed

python.FastChainSkeleton.jobPropertiesDisallowed

Definition at line 12 of file FastChainSkeleton.py.

python.DigitizationSteering.DigitizationMainContentCfg
def DigitizationMainContentCfg(flags)
Definition: DigitizationSteering.py:58
python.PileUpConfig.PileUpEventLoopMgrCfg
def PileUpEventLoopMgrCfg(flags, name="PileUpEventLoopMgr", **kwargs)
Definition: PileUpConfig.py:248
python.DigitizationConfigFlags.digitizationRunArgsToFlags
def digitizationRunArgsToFlags(runArgs, flags)
Definition: DigitizationConfigFlags.py:147
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.OutputStreamConfig.OutputStreamCfg
def OutputStreamCfg(flags, streamName, ItemList=[], MetadataItemList=[], disableEventTag=False, trigNavThinningSvc=None, takeItemsFromInput=False, extendProvenanceRecord=True, AcceptAlgs=[], HelperTools=[])
Definition: OutputStreamConfig.py:12
python.OverlayCopyAlgsConfig.CopyMcEventCollectionCfg
def CopyMcEventCollectionCfg(flags, name="CopyMcEventCollection", **kwargs)
Definition: OverlayCopyAlgsConfig.py:161
BeamEffectsAlgConfig.BeamEffectsAlgCfg
def BeamEffectsAlgCfg(flags, name="BeamEffectsAlg", **kwargs)
Definition: BeamEffectsAlgConfig.py:106
python.DigitizationConfigFlags.setupDigitizationFlags
def setupDigitizationFlags(runArgs, flags)
Definition: DigitizationConfigFlags.py:254
python.TransformUtils.processPostInclude
def processPostInclude(runArgs, flags, cfg)
Definition: Tools/PyJobTransforms/python/TransformUtils.py:69
python.xAODEventInfoCnvConfig.EventInfoUpdateFromContextAlgCfg
def EventInfoUpdateFromContextAlgCfg(flags, name="EventInfoUpdateFromContextAlg", **kwargs)
Definition: xAODEventInfoCnvConfig.py:110
python.TransformUtils.processPreInclude
def processPreInclude(runArgs, flags)
Definition: Tools/PyJobTransforms/python/TransformUtils.py:62
python.FastChainSkeleton.fromRunArgs
def fromRunArgs(runArgs)
Definition: FastChainSkeleton.py:15
python.OverlaySteering.OverlayMainContentCfg
def OverlayMainContentCfg(configFlags)
Definition: OverlaySteering.py:29
python.DigitizationSteering.DigitizationMessageSvcCfg
def DigitizationMessageSvcCfg(flags)
Definition: DigitizationSteering.py:217
python.Utils.setupLoggingLevels
def setupLoggingLevels(flags, ca)
Definition: Control/AthenaConfiguration/python/Utils.py:46
python.CommonSimulationSteering.specialConfigPostInclude
def specialConfigPostInclude(flags, cfg)
Definition: CommonSimulationSteering.py:29
python.DigitizationConfigFlags.pileupRunArgsToFlags
def pileupRunArgsToFlags(runArgs, flags)
Definition: DigitizationConfigFlags.py:186
python.PerfMonConfigHelpers.setPerfmonFlagsFromRunArgs
def setPerfmonFlagsFromRunArgs(flags, runArgs)
Definition: PerfMonConfigHelpers.py:3
python.OverlayMetadata.fastChainOverlayMetadataCheck
def fastChainOverlayMetadataCheck(flags)
Definition: OverlayMetadata.py:212
python.MainServicesConfig.MainServicesCfg
def MainServicesCfg(flags, LoopMgr='AthenaEventLoopMgr')
Definition: MainServicesConfig.py:260
python.CommonRunArgsToFlags.commonRunArgsToFlags
def commonRunArgsToFlags(runArgs, configFlags)
Definition: CommonRunArgsToFlags.py:12
python.ISF_MainConfig.ISF_KernelCfg
def ISF_KernelCfg(flags)
Definition: ISF_MainConfig.py:378
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.CommonSimulationSteering.specialConfigPreInclude
def specialConfigPreInclude(flags)
Definition: CommonSimulationSteering.py:23
python.PileUpUtils.setupPileUpProfile
def setupPileUpProfile(flags)
Definition: PileUpUtils.py:335
python.AllConfigFlags.initConfigFlags
def initConfigFlags()
Definition: AllConfigFlags.py:19
python.xAODEventInfoCnvConfig.EventInfoOverlayCfg
def EventInfoOverlayCfg(flags, **kwargs)
Definition: xAODEventInfoCnvConfig.py:75
python.OverlaySkeleton.setOverlayInputFiles
def setOverlayInputFiles(runArgs, flags, log)
Definition: OverlaySkeleton.py:16
str
Definition: BTagTrackIpAccessor.cxx:11
python.SimulationHelpers.getDetectorsFromRunArgs
def getDetectorsFromRunArgs(flags, runArgs)
Definition: SimulationHelpers.py:5
InfileMetaDataConfig.SetupMetaDataForStreamCfg
def SetupMetaDataForStreamCfg(flags, streamName="", AcceptAlgs=None, createMetadata=None, propagateMetadataFromInput=True, *args, **kwargs)
Definition: InfileMetaDataConfig.py:222
python.PoolReadConfig.PoolReadCfg
def PoolReadCfg(flags)
Definition: PoolReadConfig.py:69
python.FilterHit_Skeleton.getStreamHITS_ItemList
def getStreamHITS_ItemList(flags)
Definition: FilterHit_Skeleton.py:12