-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add protection against nan inputs for DeepMET
- Loading branch information
Showing
4 changed files
with
18 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,17 @@ | ||
#include "RecoMET/METPUSubtraction/interface/DeepMETHelp.h" | ||
#include <cmath> | ||
|
||
namespace deepmet_helper { | ||
float scale_and_rm_outlier(float val, float scale) { | ||
float ret_val = val * scale; | ||
if (ret_val > 1e6 || ret_val < -1e6) | ||
if (std::isnan(ret_val) || ret_val > 1e6 || ret_val < -1e6) | ||
return 0.; | ||
return ret_val; | ||
} | ||
|
||
float rm_outlier(float val) { | ||
if (std::isnan(val) || val > 1e6 || val < -1e6) | ||
return 0.; | ||
return val; | ||
} | ||
} // namespace deepmet_helper |