35 gSystem->ExpandPathName(list_file_path);
37 list<string> file_list;
38 ifstream list_file(list_file_path.
Data());
40 while (getline(list_file, s))
41 file_list.push_back(s);
42 if (file_list.empty()) {
43 cout <<
"WARNING: There are no files in the list of the input text file: " << list_file_path << endl;
46 cout <<
"Total records in the input text file: " << file_list.size() << endl;
48 unordered_set<int> logbook_runs;
50 if (record_count < 0) {
51 cout <<
"ERROR: getting the records of period " << period_number <<
" from the Electronic Logbook failed"
55 cout <<
"Logbook records of period " << period_number <<
": " << record_count <<
" (" << logbook_runs.size()
58 vector<string> missing_files;
59 vector<string> existing_files;
61 unordered_set<int> missing_runs, existing_runs;
62 int skipped_files = 0;
63 for (
auto const& cur_file_path : file_list) {
67 if (str_run_number ==
"") {
68 cout <<
"ERROR: No run number found in the file name: " << cur_file_path <<
", skipping.." << endl;
72 int run_number = stoi(str_run_number);
75 if (logbook_runs.count(run_number) == 0) {
76 missing_files.push_back(cur_file_path);
77 missing_runs.insert(run_number);
79 existing_files.push_back(cur_file_path);
80 existing_runs.insert(run_number);
85 sort(missing_files.begin(), missing_files.end());
86 sort(existing_files.begin(), existing_files.end());
88 if (!missing_files.empty()) {
89 cout << endl <<
"Files not corresponding any run in the logbook:" << endl;
90 for (
auto const& cur_file_path : missing_files)
91 cout << cur_file_path << endl;
94 if (!existing_files.empty()) {
95 cout << endl <<
"Files for runs described in the logbook:" << endl;
96 for (
auto const& cur_file_path : existing_files)
97 cout << cur_file_path << endl;
102 cout <<
"Files: " << existing_files.size() <<
" present in the logbook, " << missing_files.size() <<
" missing";
103 if (skipped_files > 0)
104 cout <<
", " << skipped_files <<
" skipped (no run number in the file name)";
106 cout <<
"Runs: " << existing_runs.size() <<
" present in the logbook, " << missing_runs.size() <<
" missing"