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 86 of file OverlaySkeleton.py.

86 def fromRunArgs(runArgs):
87  from AthenaCommon.Logging import logging
88  logOverlay = logging.getLogger('Overlay')
89  logOverlay.info('****************** STARTING OVERLAY *****************')
90 
91  logOverlay.info('**** Transformation run arguments')
92  logOverlay.info(str(runArgs))
93 
94  logOverlay.info('**** Setting-up configuration flags')
95  from AthenaConfiguration.AllConfigFlags import initConfigFlags
96  flags = initConfigFlags()
97 
98  commonRunArgsToFlags(runArgs, flags)
99 
100  flags.Common.ProductionStep = ProductionStep.Overlay
101 
102  # Setting input files for Overlay
103  setOverlayInputFiles(runArgs, flags, logOverlay)
104 
105  # Setting output files for Overlay
106  if hasattr(runArgs, 'outputRDOFile'):
107  if runArgs.outputRDOFile == 'None':
108  flags.Output.RDOFileName = ''
109  else:
110  flags.Output.RDOFileName = runArgs.outputRDOFile
111  else:
112  raise RuntimeError('No output RDO file defined')
113 
114  if hasattr(runArgs, 'outputRDO_SGNLFile'):
115  flags.Output.RDO_SGNLFileName = runArgs.outputRDO_SGNLFile
116 
117  # Autoconfigure enabled subdetectors
118  if hasattr(runArgs, 'detectors'):
119  detectors = runArgs.detectors
120  else:
121  detectors = None
122 
123  # Setup digitization flags
124  from DigitizationConfig.DigitizationConfigFlags import digitizationRunArgsToFlags
125  digitizationRunArgsToFlags(runArgs, flags)
126 
127  # Setup detector flags
128  from AthenaConfiguration.DetectorConfigFlags import setupDetectorFlags
129  setupDetectorFlags(flags, detectors, use_metadata=True, toggle_geometry=True)
130 
131  # Disable LVL1 trigger if triggerConfig explicitly set to 'NONE'
132  if hasattr(runArgs, 'triggerConfig') and runArgs.triggerConfig == 'NONE':
133  flags.Detector.EnableL1Calo = False
134 
135  # Setup perfmon flags from runargs
136  from PerfMonComps.PerfMonConfigHelpers import setPerfmonFlagsFromRunArgs
137  setPerfmonFlagsFromRunArgs(flags, runArgs)
138 
139  # Special Configuration preInclude
141 
142  # Pre-include
143  processPreInclude(runArgs, flags)
144 
145  # Pre-exec
146  processPreExec(runArgs, flags)
147 
148  # To respect --athenaopts
149  flags.fillFromArgs()
150 
151  # Moving here so that it is ahead of flags being locked. Need to
152  # iterate on exact best position w.r.t. above calls
153  from OverlayConfiguration.OverlayMetadata import overlayMetadataCheck
154  # Handle metadata correctly
155  overlayMetadataCheck(flags)
156 
157  # Lock flags
158  flags.lock()
159 
160  # Main overlay steering
161  from OverlayConfiguration.OverlaySteering import OverlayMainCfg
162  cfg = OverlayMainCfg(flags)
163 
164  # Special message service configuration
165  from DigitizationConfig.DigitizationSteering import DigitizationMessageSvcCfg
166  cfg.merge(DigitizationMessageSvcCfg(flags))
167 
168  # Special Configuration postInclude
169  specialConfigPostInclude(flags, cfg)
170 
171  # Post-include
172  processPostInclude(runArgs, flags, cfg)
173 
174  # Post-exec
175  processPostExec(runArgs, flags, cfg)
176 
177  # Write AMI tag into in-file metadata
178  from PyUtils.AMITagHelperConfig import AMITagCfg
179  cfg.merge(AMITagCfg(flags, runArgs))
180 
181  # Run the final configuration
182  sc = cfg.run()
183  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  flags.Input.Files = runArgs.inputRDO_BKGFile
34 
35  if flags.Input.isMC:
36  log.info('Running MC+MC overlay')
37  flags.Overlay.DataOverlay = False
38  else:
39  log.info('Running MC+data overlay')
40  flags.Overlay.DataOverlay = True
41 
42  if flags.Common.ProductionStep == ProductionStep.Overlay:
43  flags.Input.SecondaryFiles = runArgs.inputHITSFile
44  elif flags.Common.ProductionStep == ProductionStep.FastChain:
45  if not hasEVNT_Input:
46  raise RuntimeError('No input EVNT file defined')
47  else:
48  flags.Input.SecondaryFiles = runArgs.inputEVNTFile
49  else:
50  raise RuntimeError('No secondaryFiles are defined')
51 
52  if flags.Input.isMC:
53  # take MCChannelNumber from secondary input:
54  flags.Input.MCChannelNumber = GetFileMD(flags.Input.SecondaryFiles, allowEmpty=False).get("mc_channel_number", 0)
55 
56  # runNumber is MC channel number in reco
57  if hasattr(runArgs, 'runNumber'):
58  if flags.Input.MCChannelNumber != runArgs.runNumber:
59  log.warning('Got different MC channel number (%d) from runNumber than from metadata (%d)', runArgs.runNumber, flags.Input.MCChannelNumber)
60  flags.Input.MCChannelNumber = runArgs.runNumber
61  else:
62  log.info('MC channel number: %d', flags.Input.MCChannelNumber)
63  else:
64  log.info('Running MC+data overlay from ByteStream')
65  flags.Overlay.DataOverlay = True
66  flags.Overlay.ByteStream = True
67  flags.Input.isMC = False
68  if flags.Common.ProductionStep == ProductionStep.Overlay:
69  flags.Input.Files = runArgs.inputHITSFile
70  elif flags.Common.ProductionStep == ProductionStep.FastChain:
71  if not hasEVNT_Input:
72  raise RuntimeError('No input EVNT file defined')
73  else:
74  flags.Input.Files = runArgs.inputEVNTFile
75  else:
76  raise RuntimeError('No input files are defined')
77 
78  flags.Input.SecondaryFiles = runArgs.inputBS_SKIMFile
79 
80  # take secondary metadata for some flags
81  # TODO: autoconfigure
82  flags.Input.RunNumbers = list(GetFileMD(flags.Input.SecondaryFiles).get("runNumbers", []))
83  flags.Input.LumiBlockNumbers = list(GetFileMD(flags.Input.SecondaryFiles).get("lumiBlockNumbers", []))
84 
85 

Variable Documentation

◆ jobPropertiesDisallowed

python.OverlaySkeleton.jobPropertiesDisallowed

Definition at line 13 of file OverlaySkeleton.py.

python.AutoConfigFlags.GetFileMD
def GetFileMD(filenames, allowEmpty=True, maxLevel='peeker')
Definition: AutoConfigFlags.py:65
python.DigitizationConfigFlags.digitizationRunArgsToFlags
def digitizationRunArgsToFlags(runArgs, flags)
Definition: DigitizationConfigFlags.py:147
python.OverlaySkeleton.fromRunArgs
def fromRunArgs(runArgs)
Definition: OverlaySkeleton.py:86
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:176
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
histSizes.list
def list(name, path='/')
Definition: histSizes.py:38
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