Skip to content

Commit

Permalink
hltDiff: add protection for empty input files
Browse files Browse the repository at this point in the history
  • Loading branch information
fwyzard committed Oct 5, 2015
1 parent 9bfc08b commit f39a106
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions HLTrigger/Tools/bin/hltDiff.cc
Original file line number Diff line number Diff line change
Expand Up @@ -668,10 +668,14 @@ void compare(std::vector<std::string> const & old_files, std::string const & old
break;
}

std::cout << "Found " << affected << " events out of " << counter << " with differences:\n" << std::endl;
std::cout << std::setw(12) << "Events" << std::setw(12) << "Accepted" << std::setw(12) << "Gained" << std::setw(12) << "Lost" << std::setw(12) << "Other" << " " << "Trigger" << std::endl;
for (unsigned int p = 0; p < old_config->size(); ++p)
std::cout << std::setw(12) << counter << differences[p] << " " << old_config->triggerName(p) << std::endl;
if (not counter) {
std::cout << "There are no common events between the old and new files." << std::endl;
} else {
std::cout << "Found " << affected << " events out of " << counter << " with differences:\n" << std::endl;
std::cout << std::setw(12) << "Events" << std::setw(12) << "Accepted" << std::setw(12) << "Gained" << std::setw(12) << "Lost" << std::setw(12) << "Other" << " " << "Trigger" << std::endl;
for (unsigned int p = 0; p < old_config->size(); ++p)
std::cout << std::setw(12) << counter << differences[p] << " " << old_config->triggerName(p) << std::endl;
}
}


Expand Down

0 comments on commit f39a106

Please sign in to comment.