-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TauWPThreshold uses exceptions in string parsing #39627
Comments
assign reconstruction |
New categories assigned: reconstruction @mandrenguyen,@clacaputo you have been requested to review this Pull request/Issue and eventually sign? Thanks |
A new Issue was created by @makortel Matti Kortelainen. @Dr15Jones, @perrotta, @dpiparo, @rappoccio, @makortel, @smuzaffar can you please review it and eventually sign/assign? Thanks. cms-bot commands are listed here |
type tau @cms-sw/tau-pog-l2 |
Since parsing occurs only at the initialisation stage, I think |
The
deep_tau::TauWPThreshold
constructor uses exceptions string parsingcmssw/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 bestd::strtod
(from C) orstd::istringstream
(expensive).The text was updated successfully, but these errors were encountered: