Skip to content

Commit

Permalink
Add a check for invalid arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
jmcarcell authored and tmadlener committed Jun 28, 2024
1 parent d007ec3 commit d7fe460
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions k4EDM4hep2LcioConv/src/k4Lcio2EDM4hepConv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,9 @@ podio::Frame convertRunHeader(EVENT::LCRunHeader* rheader) {
}

int find_ndf(double chi2, double prob) {
if (chi2 < 0 || prob < 0 || prob > 1) {
throw std::invalid_argument("Invalid input for find_ndf. Either chi2 < 0, prob < 0 or prob > 1 in a LCIO Vertex.");
}
int lower = 0;
// Initial guess for the upper bound. If it's not enough, it will be increased
int upper = 100;
Expand Down

0 comments on commit d7fe460

Please sign in to comment.