Description
The deep_tau::TauWPThreshold
constructor uses exceptions string parsing
cmssw/RecoTauTag/RecoTau/src/DeepTauBase.cc
Lines 19 to 25 in bae128c
I encountered this exception being thrown many times (don't know how many because I gave up) when trying to catch a different exception, so the parse error does not seem to be as exceptional that exceptions would be justified (see https://twiki.cern.ch/twiki/bin/view/CMSPublic/SWGuideEdmExceptionUse#Exception_Handling,
https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#Re-throw
https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#Re-errors)
I'd suggest to parse the string in a way that does not use exceptions to signal an invalid value. E,g, std::from_chars()
looks like a good candidate, but GCC (or libstdc++) implements it for floating point numbers only in version 11 (to which we'll hopefully switch to soon). An alternative could be std::strtod
(from C) or std::istringstream
(expensive).