DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
run_check Namespace Reference

Functions

 cli (skip_tps, number_of_data_producers, check_for_logfile_errors, run_duration, trigger_rate, run_dir)
 

Variables

 CONTEXT_SETTINGS = dict(help_option_names=['-h', '--help'])
 
 console = Console()
 
 show_default
 
 True
 
 standalone_mode
 

Function Documentation

◆ cli()

run_check.cli ( skip_tps,
number_of_data_producers,
check_for_logfile_errors,
run_duration,
trigger_rate,
run_dir )

Definition at line 28 of file run_check.py.

28def cli(skip_tps, number_of_data_producers, check_for_logfile_errors, run_duration, trigger_rate, run_dir):
29
30 dirfiles = [ join(run_dir, f) for f in os.listdir(run_dir) if os.path.isfile(f) ]
31 log_files = [ f for f in dirfiles if "log_" in f]
32 data_files = [ f for f in dirfiles if ".hdf5" in f]
33
34
35 current_td_match = 0
36 current_run_match = 0
37 run_trigger_counts = {}
38
39 for f in log_files:
40 if "log_trigger" in f:
41 for line in open(f).readlines():
42 match_tds = re.search(r"Sent (\d+) TDs\.", line)
43 if match_tds != None:
44 current_td_match = match_tds.group(1)
45 match_run = re.search(r"End of run (\d+)", line)
46 if match_run != None:
47 current_run_match = match_run.group(1)
48
49 if current_td_match != 0 and current_run_match != 0:
50 run_trigger_counts[current_run_match] = current_td_match
51 current_run_match = 0
52 current_td_match = 0
53
54
55 print(run_trigger_counts)
56 expected_event_count = run_duration * trigger_rate
57 expected_event_count_tolerance = 2
58
59 wib1_frag_hsi_trig_params = {"fragment_type_description": "WIB",
60 "hdf5_detector_group": "TPC", "hdf5_region_prefix": "APA",
61 "expected_fragment_count": number_of_data_producers,
62 "min_size_bytes": 37200, "max_size_bytes": 37200}
63 wib1_frag_multi_trig_params = {"fragment_type_description": "WIB",
64 "hdf5_detector_group": "TPC", "hdf5_region_prefix": "APA",
65 "expected_fragment_count": number_of_data_producers,
66 "min_size_bytes": 80, "max_size_bytes": 37200}
67 rawtp_frag_params = {"fragment_type_description": "Raw TP",
68 "hdf5_detector_group": "TPC", "hdf5_region_prefix": "TP_APA",
69 "expected_fragment_count": number_of_data_producers,
70 "min_size_bytes": 80, "max_size_bytes": 80}
71 triggertp_frag_params = {"fragment_type_description": "Trigger TP",
72 "hdf5_detector_group": "Trigger", "hdf5_region_prefix": "Region",
73 "expected_fragment_count": number_of_data_producers,
74 "min_size_bytes": 80, "max_size_bytes": 80}
75
76 def test_log_files():
77 if check_for_logfile_errors:
78 # Check that there are no warnings or errors in the log files
79 log_file_checks.logs_are_error_free(log_files)
80
81 def test_data_file():
82 local_expected_event_count = expected_event_count
83 local_event_count_tolerance = expected_event_count_tolerance
84 fragment_check_list = []
85 if not skip_tps:
86 local_expected_event_count+=(270 * number_of_data_producers * run_duration / 100)
87 local_event_count_tolerance+=(10 * number_of_data_producers * run_duration / 100)
88 fragment_check_list.append(wib1_frag_multi_trig_params)
89 fragment_check_list.append(rawtp_frag_params)
90 fragment_check_list.append(triggertp_frag_params)
91 if len(fragment_check_list) == 0:
92 fragment_check_list.append(wib1_frag_hsi_trig_params)
93
94 for idx in range(len(data_files)):
95 data_file = data_file_checks.DataFile(data_files[idx])
96 data_file_checks.sanity_check(data_file)
97 data_file_checks.check_file_attributes(data_file)
98 data_file_checks.check_event_count(data_file, local_expected_event_count, local_event_count_tolerance)
99 for jdx in range(len(fragment_check_list)):
100 data_file_checks.check_fragment_count(data_file, fragment_check_list[jdx])
101 data_file_checks.check_fragment_sizes(data_file, fragment_check_list[jdx])
102
103 test_log_files()
104 test_data_file()
105

Variable Documentation

◆ console

run_check.console = Console()

Definition at line 16 of file run_check.py.

◆ CONTEXT_SETTINGS

run_check.CONTEXT_SETTINGS = dict(help_option_names=['-h', '--help'])

Definition at line 14 of file run_check.py.

◆ show_default

run_check.show_default

Definition at line 108 of file run_check.py.

◆ standalone_mode

run_check.standalone_mode

Definition at line 108 of file run_check.py.

◆ True

run_check.True

Definition at line 108 of file run_check.py.