Skip to content
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

Demo PR for DeepTau v2p5 integration #1

Merged
Merged
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,345 changes: 906 additions & 439 deletions RecoTauTag/RecoTau/interface/DeepTauBase.h

Large diffs are not rendered by default.

35 changes: 35 additions & 0 deletions RecoTauTag/RecoTau/interface/DeepTauScaling.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#ifndef RecoTauTag_RecoTau_DeepTauScaling_h
#define RecoTauTag_RecoTau_DeepTauScaling_h

namespace deep_tau {
namespace Scaling {
constexpr float inf = std::numeric_limits<float>::infinity();
enum class FeatureT{TauFlat, GridGlobal, PfCand_electron, PfCand_muon, PfCand_chHad, PfCand_nHad, PfCand_gamma, Electron, Muon};

struct ScalingParams
{
std::vector<float> mean_;
std::vector<float> std_;
std::vector<float> lim_min_;
std::vector<float> lim_max_;

template <typename T>
static float getValue(T value) {
return std::isnormal(value) ? static_cast<float>(value) : 0.f;
}

template<typename T>
float scale(T value, int var_index) const{
const float fixed_value = getValue(value);
const float mean = mean_.at(var_index);
const float std = std_.at(var_index);
const float lim_min = lim_min_.at(var_index);
const float lim_max = lim_max_.at(var_index);
const float norm_value = (fixed_value - mean) / std;
return std::clamp(norm_value, lim_min, lim_max);
};
};
}; // Scaling namespace
}; // deep_tau namespace

#endif
646 changes: 327 additions & 319 deletions RecoTauTag/RecoTau/plugins/DeepTauId.cc

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion RecoTauTag/RecoTau/python/tools/runTauIdMVA.py
Original file line number Diff line number Diff line change
@@ -20,7 +20,7 @@ def __init__(self, process, debug = False,
originalTauName = "slimmedTaus",
updatedTauName = "slimmedTausNewID",
postfix = "",
toKeep = ["deepTau2022v2p5"],
toKeep = ["deepTau2017v2p1", "deepTau2022v2p5"],
tauIdDiscrMVA_trainings_run2_2017 = { 'tauIdMVAIsoDBoldDMwLT2017' : "tauIdMVAIsoDBoldDMwLT2017", },
tauIdDiscrMVA_WPs_run2_2017 = {
'tauIdMVAIsoDBoldDMwLT2017' : {