Skip to content

Commit

Permalink
Merge pull request #3 from andrzejnovak/switch
Browse files Browse the repository at this point in the history
Use cloning in modules, Add back DeepDoubleBTagInfo.h in the meantime so PR can be tested
  • Loading branch information
andrzejnovak authored Nov 8, 2018
2 parents 3c81d7b + 27bdb12 commit 81b0d65
Show file tree
Hide file tree
Showing 8 changed files with 60 additions and 93 deletions.
16 changes: 16 additions & 0 deletions DataFormats/BTauReco/interface/DeepDoubleBTagInfo.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#ifndef DataFormats_BTauReco_DeepDoubleBTagInfo_h
#define DataFormats_BTauReco_DeepDoubleBTagInfo_h

#include "DataFormats/BTauReco/interface/FeaturesTagInfo.h"
#include "DataFormats/BTauReco/interface/DeepDoubleXFeatures.h"

//keeping for posterity
namespace reco {

typedef FeaturesTagInfo<btagbtvdeep::DeepDoubleXFeatures> DeepDoubleBTagInfo;

DECLARE_EDM_REFS( DeepDoubleBTagInfo )

}

#endif // DataFormats_BTauReco_DeepDoubleBTagInfo_h
2 changes: 0 additions & 2 deletions RecoBTag/TensorFlow/plugins/DeepDoubleXTFJetTagsProducer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,6 @@ void DeepDoubleXTFJetTagsProducer::fillDescriptions(edm::ConfigurationDescriptio
desc.add<std::vector<std::string>>("output_names",
{ "ID_pred/Softmax" });

{
edm::ParameterSetDescription psBvL;
psBvL.add<std::vector<unsigned int>>("probQCD", {0});
psBvL.add<std::vector<unsigned int>>("probHbb", {1});
Expand All @@ -158,7 +157,6 @@ void DeepDoubleXTFJetTagsProducer::fillDescriptions(edm::ConfigurationDescriptio
"CvB" >> (edm::ParameterDescription<edm::ParameterSetDescription>("flav_table", psCvB, true) and
edm::ParameterDescription<edm::FileInPath>("graph_path", edm::FileInPath("RecoBTag/Combined/data/DeepDoubleX/94X/V01/DDCvB.pb"), true))
);
}

desc.add<bool>("batch_eval", false);

Expand Down
27 changes: 9 additions & 18 deletions RecoBTag/TensorFlow/python/pfDeepDoubleCvBJetTags_cfi.py
Original file line number Diff line number Diff line change
@@ -1,21 +1,12 @@
import FWCore.ParameterSet.Config as cms
from pfDeepDoubleBvLJetTags_cfi import pfDeepDoubleBvLJetTags

pfDeepDoubleCvBJetTags = cms.EDProducer('DeepDoubleXTFJetTagsProducer',
src = cms.InputTag('pfDeepDoubleXTagInfos'),
input_names = cms.vstring(
'input_1',
'input_2',
'input_3'
),
graph_path = cms.FileInPath('RecoBTag/Combined/data/DeepDoubleX/94X/V01/DDCvB.pb'),
lp_names = cms.vstring('db_input_batchnorm/keras_learning_phase'),
output_names = cms.vstring('ID_pred/Softmax'),
flavor = cms.string('CvB'),
flav_table = cms.PSet(
probHbb = cms.vuint32(0),
probHcc = cms.vuint32(1)
),
batch_eval = cms.bool(False),
nThreads = cms.uint32(1),
singleThreadPool = cms.string('no_threads')
pfDeepDoubleCvBJetTags = pfDeepDoubleBvLJetTags.clone(
flavor = 'CvB',
graph_path = cms.FileInPath('RecoBTag/Combined/data/DeepDoubleX/94X/V01/DDCvB.pb'),
flav_table = cms.PSet(
probHbb = cms.vuint32(0),
probHcc = cms.vuint32(1)
)
)

26 changes: 8 additions & 18 deletions RecoBTag/TensorFlow/python/pfDeepDoubleCvLJetTags_cfi.py
Original file line number Diff line number Diff line change
@@ -1,21 +1,11 @@
import FWCore.ParameterSet.Config as cms
from pfDeepDoubleBvLJetTags_cfi import pfDeepDoubleBvLJetTags

pfDeepDoubleCvLJetTags = cms.EDProducer('DeepDoubleXTFJetTagsProducer',
src = cms.InputTag('pfDeepDoubleXTagInfos'),
input_names = cms.vstring(
'input_1',
'input_2',
'input_3'
),
graph_path = cms.FileInPath('RecoBTag/Combined/data/DeepDoubleX/94X/V01/DDC.pb'),
lp_names = cms.vstring('db_input_batchnorm/keras_learning_phase'),
output_names = cms.vstring('ID_pred/Softmax'),
flavor = cms.string('CvL'),
flav_table = cms.PSet(
probQCD = cms.vuint32(0),
probHcc = cms.vuint32(1)
),
batch_eval = cms.bool(False),
nThreads = cms.uint32(1),
singleThreadPool = cms.string('no_threads')
pfDeepDoubleCvLJetTags = pfDeepDoubleBvLJetTags.clone(
flavor = 'CvL',
graph_path = cms.FileInPath('RecoBTag/Combined/data/DeepDoubleX/94X/V01/DDC.pb'),
flav_table = cms.PSet(
probQCD = cms.vuint32(0),
probHcc = cms.vuint32(1)
)
)
Original file line number Diff line number Diff line change
@@ -1,21 +1,12 @@
import FWCore.ParameterSet.Config as cms
from pfDeepDoubleBvLJetTags_cfi import pfDeepDoubleBvLJetTags

pfMassIndependentDeepDoubleBvLJetTags = cms.EDProducer('DeepDoubleXTFJetTagsProducer',
src = cms.InputTag('pfDeepDoubleXTagInfos'),
input_names = cms.vstring(
'input_1',
'input_2',
'input_3'
),
graph_path = cms.FileInPath('RecoBTag/Combined/data/DeepDoubleX/94X/V01/DDB_mass_independent.pb'),
lp_names = cms.vstring('db_input_batchnorm/keras_learning_phase'),
output_names = cms.vstring('ID_pred/Softmax'),
flavor = cms.string('BvL'),
flav_table = cms.PSet(
probQCD = cms.vuint32(0),
probHbb = cms.vuint32(1)
),
batch_eval = cms.bool(False),
nThreads = cms.uint32(1),
singleThreadPool = cms.string('no_threads')
pfMassIndependentDeepDoubleBvLJetTags = pfDeepDoubleBvLJetTags.clone(
flavor = 'BvL',
graph_path = cms.FileInPath('RecoBTag/Combined/data/DeepDoubleX/94X/V01/DDB_mass_independent.pb'),
flav_table = cms.PSet(
probQCD = cms.vuint32(0),
probHbb = cms.vuint32(1)
)
)

Original file line number Diff line number Diff line change
@@ -1,21 +1,12 @@
import FWCore.ParameterSet.Config as cms
from pfDeepDoubleBvLJetTags_cfi import pfDeepDoubleBvLJetTags

pfMassIndependentDeepDoubleCvBJetTags = cms.EDProducer('DeepDoubleXTFJetTagsProducer',
src = cms.InputTag('pfDeepDoubleXTagInfos'),
input_names = cms.vstring(
'input_1',
'input_2',
'input_3'
),
graph_path = cms.FileInPath('RecoBTag/Combined/data/DeepDoubleX/94X/V01/DDCvB_mass_independent.pb'),
lp_names = cms.vstring('db_input_batchnorm/keras_learning_phase'),
output_names = cms.vstring('ID_pred/Softmax'),
flavor = cms.string('CvB'),
flav_table = cms.PSet(
probHbb = cms.vuint32(0),
probHcc = cms.vuint32(1)
),
batch_eval = cms.bool(False),
nThreads = cms.uint32(1),
singleThreadPool = cms.string('no_threads')
pfMassIndependentDeepDoubleCvBJetTags = pfDeepDoubleBvLJetTags.clone(
flavor = 'CvB',
graph_path = cms.FileInPath('RecoBTag/Combined/data/DeepDoubleX/94X/V01/DDCvB_mass_independent.pb'),
flav_table = cms.PSet(
probHbb = cms.vuint32(0),
probHcc = cms.vuint32(1)
)
)

Original file line number Diff line number Diff line change
@@ -1,21 +1,11 @@
import FWCore.ParameterSet.Config as cms
from pfDeepDoubleBvLJetTags_cfi import pfDeepDoubleBvLJetTags

pfMassIndependentDeepDoubleCvLJetTags = cms.EDProducer('DeepDoubleXTFJetTagsProducer',
src = cms.InputTag('pfDeepDoubleXTagInfos'),
input_names = cms.vstring(
'input_1',
'input_2',
'input_3'
),
graph_path = cms.FileInPath('RecoBTag/Combined/data/DeepDoubleX/94X/V01/DDC_mass_independent.pb'),
lp_names = cms.vstring('db_input_batchnorm/keras_learning_phase'),
output_names = cms.vstring('ID_pred/Softmax'),
flavor = cms.string('CvL'),
flav_table = cms.PSet(
probQCD = cms.vuint32(0),
probHcc = cms.vuint32(1)
),
batch_eval = cms.bool(False),
nThreads = cms.uint32(1),
singleThreadPool = cms.string('no_threads')
pfMassIndependentDeepDoubleCvLJetTags = pfDeepDoubleBvLJetTags.clone(
flavor = 'CvL',
graph_path = cms.FileInPath('RecoBTag/Combined/data/DeepDoubleX/94X/V01/DDC_mass_independent.pb'),
flav_table = cms.PSet(
probQCD = cms.vuint32(0),
probHcc = cms.vuint32(1)
)
)
2 changes: 1 addition & 1 deletion RecoBTag/TensorFlow/test/plotDDX.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
if jet.mass() < 40 or jet.mass() > 200: continue

print jet.pt(), jet.mass()
print "DDB", jet.bDiscriminator("pfDeepDoubleBvLJetTags:probQCD"), jet.bDiscriminator("pfDeepDoubleBvLJetTags:probHbb") , jet.bDiscriminator("pfDeepDoubleBvLJetTags:probHcc")
print "DDB", jet.bDiscriminator("pfDeepDoubleBvLJetTags:probQCD"), jet.bDiscriminator("pfDeepDoubleBvLJetTags:probHbb") , jet.bDiscriminator("pfDeepDoubleBvLJetTags:probHcc")
print "DDCvL", jet.bDiscriminator("pfDeepDoubleCvLJetTags:probQCD"), jet.bDiscriminator("pfDeepDoubleCvLJetTags:probHcc") , jet.bDiscriminator("pfDeepDoubleCvLJetTags:probHbb")
print "DDCvL", jet.bDiscriminator("pfMassIndependentDeepDoubleCvLJetTags:probQCD"), jet.bDiscriminator("pfMassIndependentDeepDoubleCvLJetTags:probHcc") , jet.bDiscriminator("pfDeepDoubleMassIndependentCvLJetTags:probHbb")
print "DDCvB", jet.bDiscriminator("pfDeepDoubleCvBJetTags:probHbb"), jet.bDiscriminator("pfDeepDoubleCvBJetTags:probHcc") , jet.bDiscriminator("pfDeepDoubleCvBJetTags:probQCD")
Expand Down

0 comments on commit 81b0d65

Please sign in to comment.