ATLAS Offline Software
Functions | Variables
python.OverlaySkeleton Namespace Reference

Functions

def setOverlayInputFiles (runArgs, flags, log)
 
def fromRunArgs (runArgs)
 

Variables

 jobPropertiesDisallowed
 

Function Documentation

◆ fromRunArgs()

def python.OverlaySkeleton.fromRunArgs (   runArgs)

Definition at line 65 of file OverlaySkeleton.py.

65 def fromRunArgs(runArgs):
66  from AthenaCommon.Logging import logging
67  logOverlay = logging.getLogger('Overlay')
68  logOverlay.info('****************** STARTING OVERLAY *****************')
69 
70  logOverlay.info('**** Transformation run arguments')
71  logOverlay.info(str(runArgs))
72 
73  logOverlay.info('**** Setting-up configuration flags')
74  from AthenaConfiguration.AllConfigFlags import initConfigFlags
75  flags = initConfigFlags()
76 
77  commonRunArgsToFlags(runArgs, flags)
78 
79  flags.Common.ProductionStep = ProductionStep.Overlay
80 
81  # Setting input files for Overlay
82  setOverlayInputFiles(runArgs, flags, logOverlay)
83 
84  # Setting output files for Overlay
85  if hasattr(runArgs, 'outputRDOFile'):
86  if runArgs.outputRDOFile == 'None':
87  flags.Output.RDOFileName = ''
88  else:
89  flags.Output.RDOFileName = runArgs.outputRDOFile
90  else:
91  raise RuntimeError('No output RDO file defined')
92 
93  if hasattr(runArgs, 'outputRDO_SGNLFile'):
94  flags.Output.RDO_SGNLFileName = runArgs.outputRDO_SGNLFile
95 
96  # Autoconfigure enabled subdetectors
97  if hasattr(runArgs, 'detectors'):
98  detectors = runArgs.detectors
99  else:
100  detectors = None
101 
102  # Setup digitization flags
103  from DigitizationConfig.DigitizationConfigFlags import digitizationRunArgsToFlags
104  digitizationRunArgsToFlags(runArgs, flags)
105 
106  # Setup detector flags
107  from AthenaConfiguration.DetectorConfigFlags import setupDetectorFlags
108  setupDetectorFlags(flags, detectors, use_metadata=True, toggle_geometry=True)
109 
110  # Disable LVL1 trigger if triggerConfig explicitly set to 'NONE'
111  if hasattr(runArgs, 'triggerConfig') and runArgs.triggerConfig == 'NONE':
112  flags.Detector.EnableL1Calo = False
113 
114  # Setup perfmon flags from runargs
115  from PerfMonComps.PerfMonConfigHelpers import setPerfmonFlagsFromRunArgs
116  setPerfmonFlagsFromRunArgs(flags, runArgs)
117 
118  # Special Configuration preInclude
120 
121  # Pre-include
122  processPreInclude(runArgs, flags)
123 
124  # Pre-exec
125  processPreExec(runArgs, flags)
126 
127  # To respect --athenaopts
128  flags.fillFromArgs()
129 
130  # Moving here so that it is ahead of flags being locked. Need to
131  # iterate on exact best position w.r.t. above calls
132  from OverlayConfiguration.OverlayMetadata import overlayMetadataCheck
133  # Handle metadata correctly
134  overlayMetadataCheck(flags)
135 
136  # Lock flags
137  flags.lock()
138 
139  # Main overlay steering
140  from OverlayConfiguration.OverlaySteering import OverlayMainCfg
141  cfg = OverlayMainCfg(flags)
142 
143  # Special message service configuration
144  from DigitizationConfig.DigitizationSteering import DigitizationMessageSvcCfg
145  cfg.merge(DigitizationMessageSvcCfg(flags))
146 
147  # Special Configuration postInclude
148  specialConfigPostInclude(flags, cfg)
149 
150  # Post-include
151  processPostInclude(runArgs, flags, cfg)
152 
153  # Post-exec
154  processPostExec(runArgs, flags, cfg)
155 
156  # Write AMI tag into in-file metadata
157  from PyUtils.AMITagHelperConfig import AMITagCfg
158  cfg.merge(AMITagCfg(flags, runArgs))
159 
160  # Run the final configuration
161  sc = cfg.run()
162  sys.exit(not sc.isSuccess())

◆ setOverlayInputFiles()

def python.OverlaySkeleton.setOverlayInputFiles (   runArgs,
  flags,
  log 
)

Definition at line 16 of file OverlaySkeleton.py.

16 def setOverlayInputFiles(runArgs, flags, log):
17  hasRDO_BKGInput = hasattr(runArgs, 'inputRDO_BKGFile')
18  hasBS_SKIMInput = hasattr(runArgs, 'inputBS_SKIMFile')
19  hasEVNT_Input = hasattr(runArgs, 'inputEVNTFile')
20 
21  if flags.Common.ProductionStep == ProductionStep.Overlay and not hasattr(runArgs, 'inputHITSFile'):
22  raise RuntimeError('No input HITS file defined')
23 
24  if hasRDO_BKGInput and hasBS_SKIMInput:
25  raise RuntimeError('Both RDO_BKG and BS_SKIM are defined')
26  if not hasRDO_BKGInput and not hasBS_SKIMInput:
27  raise RuntimeError('Define one of RDO_BKG and BS_SKIM file types')
28 
29  if hasattr(runArgs, 'skipSecondaryEvents'):
30  flags.Overlay.SkipSecondaryEvents = runArgs.skipSecondaryEvents
31 
32  if hasRDO_BKGInput:
33  log.info('Running MC+MC overlay')
34  flags.Overlay.DataOverlay = False
35  flags.Input.isMC = True
36  flags.Input.Files = runArgs.inputRDO_BKGFile
37  if flags.Common.ProductionStep == ProductionStep.Overlay:
38  flags.Input.SecondaryFiles = runArgs.inputHITSFile
39  elif flags.Common.ProductionStep == ProductionStep.FastChain:
40  if not hasEVNT_Input:
41  raise RuntimeError('No input EVNT file defined')
42  else:
43  flags.Input.SecondaryFiles = runArgs.inputEVNTFile
44  else:
45  raise RuntimeError('No secondaryFiles are defined')
46 
47  # take MCChannelNumber from secondary input:
48  flags.Input.MCChannelNumber = GetFileMD(flags.Input.SecondaryFiles, allowEmpty=False).get("mc_channel_number", 0)
49 
50  # runNumber is MC channel number in reco
51  if hasattr(runArgs, 'runNumber'):
52  if flags.Input.MCChannelNumber != runArgs.runNumber:
53  log.warning('Got different MC channel number (%d) from runNumber than from metadata (%d)', runArgs.runNumber, flags.Input.MCChannelNumber)
54  flags.Input.MCChannelNumber = runArgs.runNumber
55  else:
56  log.info('MC channel number: %d', flags.Input.MCChannelNumber)
57  else:
58  log.info('Running MC+data overlay')
59  flags.Overlay.DataOverlay = True
60  flags.Input.isMC = False
61  flags.Input.Files = runArgs.inputHITSFile
62  flags.Input.SecondaryFiles = runArgs.inputBS_SKIMFile
63 
64 

Variable Documentation

◆ jobPropertiesDisallowed

python.OverlaySkeleton.jobPropertiesDisallowed

Definition at line 13 of file OverlaySkeleton.py.

python.DigitizationConfigFlags.digitizationRunArgsToFlags
def digitizationRunArgsToFlags(runArgs, flags)
Definition: DigitizationConfigFlags.py:147
python.OverlaySkeleton.fromRunArgs
def fromRunArgs(runArgs)
Definition: OverlaySkeleton.py:65
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.OverlayMetadata.overlayMetadataCheck
def overlayMetadataCheck(flags)
Definition: OverlayMetadata.py:193
python.AutoConfigFlags.GetFileMD
def GetFileMD(filenames, allowEmpty=True)
Definition: AutoConfigFlags.py:51
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.DigitizationSteering.DigitizationMessageSvcCfg
def DigitizationMessageSvcCfg(flags)
Definition: DigitizationSteering.py:217
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.OverlaySteering.OverlayMainCfg
def OverlayMainCfg(configFlags)
Definition: OverlaySteering.py:19
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
get
T * get(TKey *tobj)
get a TObject* from a TKey* (why can't a TObject be a TKey?)
Definition: hcg.cxx:127
python.OverlaySkeleton.setOverlayInputFiles
def setOverlayInputFiles(runArgs, flags, log)
Definition: OverlaySkeleton.py:16
str
Definition: BTagTrackIpAccessor.cxx:11