12import modularAnalysis
as ma
13import b2test_utils
as b2tu
16output_triggers_to_test = [
"ffo",
"hie",
"INVALID_INPUT"]
19input_triggers_to_test = [
"t3_3",
"ehigh",
"INVALID_INPUT"]
22bits_to_test = [0, 17, 321]
26def check_file(input_file_name, trigger_variables):
27 """Run the check with a quick basf2 printout for the
28 first event in ``input_file_name`` on the validation server
"""
29 input_file = b2tu.require_file(input_file_name, '')
31 ma.inputMdst(input_file, path=pa)
32 ma.printVariableValues(
"", trigger_variables, path=pa)
33 b2tu.safe_process(pa, 10)
36def name_variables(name):
37 """List of trigger bits by name access"""
38 return f
"L1PSNM({name})", f
"L1FTDL({name})", f
"L1Prescale({name})"
41def bit_number_variables(bit):
42 """List of trigger bits by bit number access"""
43 return f
"L1PSNMBit({bit})", f
"L1FTDLBit({bit})", f
"L1InputBit({bit})", f
"L1PSNMBitPrescale({bit})"
46if __name__ ==
"__main__":
49 trigger_variables = [name_variables(name)
for name
in output_triggers_to_test]
50 trigger_variables += [bit_number_variables(bit)
for bit
in bits_to_test]
53 trigger_variables = [var
for row
in trigger_variables
for var
in row]
54 trigger_variables += [f
"L1Input({name})" for name
in input_triggers_to_test]
55 trigger_variables.sort()
58 b2.set_random_seed(
r"\m/")
59 b2tu.configure_logging_for_tests()
60 check_file(
"mdst/tests/mdst-v05-00-00.root", trigger_variables)