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

Code quality fix for DNN TauID (102X) #25650

Merged
merged 1 commit into from Jan 16, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions RecoTauTag/RecoTau/interface/DeepTauBase.h
Expand Up @@ -83,9 +83,9 @@ class DeepTauBase : public edm::stream::EDProducer<edm::GlobalCache<DeepTauCache


DeepTauBase(const edm::ParameterSet& cfg, const OutputCollection& outputs, const DeepTauCache* cache);
virtual ~DeepTauBase() {}
~DeepTauBase() override {}

virtual void produce(edm::Event& event, const edm::EventSetup& es) override;
void produce(edm::Event& event, const edm::EventSetup& es) override;

static std::unique_ptr<DeepTauCache> initializeGlobalCache(const edm::ParameterSet& cfg);
static void globalEndJob(const DeepTauCache* cache){ }
Expand Down
2 changes: 1 addition & 1 deletion RecoTauTag/RecoTau/plugins/DPFIsolation.cc
Expand Up @@ -82,7 +82,7 @@ class DPFIsolation : public deep_tau::DeepTauBase {
}

private:
virtual tensorflow::Tensor getPredictions(edm::Event& event, const edm::EventSetup& es,
tensorflow::Tensor getPredictions(edm::Event& event, const edm::EventSetup& es,
edm::Handle<TauCollection> taus) override
{
edm::Handle<pat::PackedCandidateCollection> pfcands;
Expand Down
2 changes: 1 addition & 1 deletion RecoTauTag/RecoTau/plugins/DeepTauId.cc
Expand Up @@ -293,7 +293,7 @@ class DeepTauId : public deep_tau::DeepTauBase {
}

private:
virtual tensorflow::Tensor getPredictions(edm::Event& event, const edm::EventSetup& es,
tensorflow::Tensor getPredictions(edm::Event& event, const edm::EventSetup& es,
edm::Handle<TauCollection> taus) override
{
edm::Handle<pat::ElectronCollection> electrons;
Expand Down
2 changes: 1 addition & 1 deletion RecoTauTag/RecoTau/src/DeepTauBase.cc
Expand Up @@ -60,7 +60,7 @@ DeepTauBase::Output::ResultMap DeepTauBase::Output::get_value(const edm::Handle<
float x = 0;
for(size_t num_elem : num_)
x += pred.matrix<float>()(tau_index, num_elem);
if(x != 0 && den_.size() > 0) {
if(x != 0 && !den_.empty()) {
float den_val = 0;
for(size_t den_elem : den_)
den_val += pred.matrix<float>()(tau_index, den_elem);
Expand Down