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

Classes

class  TrigBSDumpGrepStep
class  ExtractExpertMonitoring

Functions

 check_hlt_properties (filename='HLTJobOptions.db.json')
 default_check_steps_OHMon (test, hist_path)
 filterBS (stream_name, extra_args='')
 decodeBS (stream_name, moduleID=0)

Detailed Description

Definitions of additional validation steps in Trigger ART tests relevant only for TrigP1Test.
The main common check steps are defined in the TrigValSteering.CheckSteps module.

Function Documentation

◆ check_hlt_properties()

check_hlt_properties ( filename = 'HLTJobOptions.db.json')
Check a few important job options in the JSON file

Definition at line 109 of file TrigP1TestSteps.py.

109def check_hlt_properties(filename='HLTJobOptions.db.json'):
110 '''Check a few important job options in the JSON file'''
111
112 log = get_logger()
113
114 with open(filename) as f:
115 props = json.load(f)['properties']
116
117 def checkprop(comp, prop, regex):
118 value = props[comp][prop]
119 if re.match(regex, value) is None:
120 log.error('Property "%s.%s" does not match "%s". Current value: "%s"', comp, prop, regex, value)
121 return False
122 return True
123
124 checks = [
125 checkprop('IOVDbSvc', 'CacheAlign', '0'),
126 checkprop('IOVDbSvc', 'CacheRun', '0'),
127 checkprop('IOVDbSvc', 'CacheTime', '0'),
128 checkprop('AtlasFieldMapCondAlg', 'LoadMapOnStart', 'True'),
129 checkprop('IOVDbSvc', 'Folders', r'.*/TRIGGER/LUMI/HLTPrefLumi\s*<extensible/>.*'),
130 checkprop('IOVDbSvc', 'Folders', r'.*/Indet/Onl/Beampos\s*<extensible/>.*'),
131 checkprop('IOVDbSvc', 'Folders', r'.*/TRIGGER/HLT/PrescaleKey <tag>HEAD</tag>\s*<extensible/>.*'),
132 ]
133 return 0 if all(checks) else 1
134
135

◆ decodeBS()

decodeBS ( stream_name,
moduleID = 0 )
Deserialise HLT data from ByteStream and save to an ESD file

Definition at line 166 of file TrigP1TestSteps.py.

166def decodeBS(stream_name, moduleID=0):
167 '''Deserialise HLT data from ByteStream and save to an ESD file'''
168 from TrigValTools.TrigValSteering import ExecStep
169 from TrigValTools.TrigValSteering.Common import find_file
170 decodeStep = ExecStep.ExecStep('DecodeBS_'+stream_name)
171 decodeStep.type = 'other'
172 decodeStep.executable = 'python'
173 decodeStep.input = ''
174 decodeStep.explicit_input = True
175 decodeStep.args = f'-m TrigP1Test.DecodeBS --moduleID={moduleID} --filesInput=' + find_file(f'data*_{stream_name}.*.data')
176 return decodeStep

◆ default_check_steps_OHMon()

default_check_steps_OHMon ( test,
hist_path )

Definition at line 136 of file TrigP1TestSteps.py.

136def default_check_steps_OHMon(test, hist_path):
137 steps = []
138 # Extract expert-monitoring.root file from OH server output
139 extract_hist = ExtractExpertMonitoring()
140 hist_path_split = hist_path.split(':')
141 if len(hist_path_split) > 1:
142 extract_hist.input_file = hist_path_split[0]
143 extract_hist.path_prefix = hist_path_split[1]
144 else:
145 extract_hist.input_file = hist_path
146 steps.append(extract_hist)
147 # Default check steps
148 steps.extend(CheckSteps.default_check_steps(test))
149 # Remove histogram merging step
150 matches = [step for step in steps if step.name == 'HistMerge']
151 for hm_step in matches:
152 steps.remove(hm_step)
153 return steps
154

◆ filterBS()

filterBS ( stream_name,
extra_args = '' )
Extract ByteStream data for a given stream from a file with multiple streams

Definition at line 155 of file TrigP1TestSteps.py.

155def filterBS(stream_name, extra_args = ''):
156 '''Extract ByteStream data for a given stream from a file with multiple streams'''
157 from TrigValTools.TrigValSteering import ExecStep
158 from TrigValTools.TrigValSteering.Common import find_file
159 filterStep = ExecStep.ExecStep('FilterBS_'+stream_name)
160 filterStep.type = 'other'
161 filterStep.executable = 'trigbs_extractStream.py'
162 filterStep.input = ''
163 filterStep.args = f'{extra_args} -s {stream_name} ' + find_file('data*_SingleStream.daq.RAW.*_output.*.data', max_files=None)
164 return filterStep
165