Skip to content

Commit

Permalink
Using switch in producer
Browse files Browse the repository at this point in the history
  • Loading branch information
anovak10 committed Nov 2, 2018
1 parent d656aa9 commit 0ed5f6f
Show file tree
Hide file tree
Showing 7 changed files with 50 additions and 5 deletions.
42 changes: 39 additions & 3 deletions RecoBTag/TensorFlow/plugins/DeepDoubleXTFJetTagsProducer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -132,19 +132,55 @@ void DeepDoubleXTFJetTagsProducer::fillDescriptions(edm::ConfigurationDescriptio
desc.add<edm::InputTag>("src", edm::InputTag("pfDeepDoubleXTagInfos"));
desc.add<std::vector<std::string>>("input_names",
{ "input_1", "input_2", "input_3" });
desc.add<edm::FileInPath>("graph_path",
edm::FileInPath("RecoBTag/Combined/data/DeepDoubleB/V01/constant_graph_PtCut_MassSculptPen.pb"));
//desc.add<edm::FileInPath>("graph_path",
// edm::FileInPath("RecoBTag/Combined/data/DeepDoubleB/V01/constant_graph_PtCut_MassSculptPen.pb"));
desc.add<std::vector<std::string>>("lp_names",
{ "db_input_batchnorm/keras_learning_phase" });
desc.add<std::vector<std::string>>("output_names",
{ "ID_pred/Softmax" });

/*desc.ifValue( edm::ParameterDescription<std::string>("model", "BvL", true),
"BvL" >> edm::ParameterDescription<edm::FileInPath>("graph_path", edm::FileInPath("RecoBTag/Combined/data/DeepDoubleB/V01/constant_graph_PtCut_MassSculptPen.pb"), true) or
"CvL" >> edm::ParameterDescription<edm::FileInPath>("graph_path", edm::FileInPath("RecoBTag/Combined/data/DeepDoubleX/94X/V01/DDC.pb"), true) or
"CvB" >> edm::ParameterDescription<edm::FileInPath>("graph_path", edm::FileInPath("RecoBTag/Combined/data/DeepDoubleX/94X/V01/DDCvB.pb"), true)
);*/

{
edm::ParameterSetDescription psBvL;
psBvL.add<std::vector<unsigned int>>("probQCD", {0});
psBvL.add<std::vector<unsigned int>>("probHbb", {1});
//psBvL.add<edm::FileInPath>("graph_path", edm::FileInPath("RecoBTag/Combined/data/DeepDoubleB/V01/constant_graph_PtCut_MassSculptPen.pb"));

edm::ParameterSetDescription psCvL;
psCvL.add<std::vector<unsigned int>>("probQCD", {0});
psCvL.add<std::vector<unsigned int>>("probHcc", {1});
//psCvL.add<edm::FileInPath>("graph_path", edm::FileInPath("RecoBTag/Combined/data/DeepDoubleX/94X/V01/DDC.pb"));

edm::ParameterSetDescription psCvB;
psCvB.add<std::vector<unsigned int>>("probHbb", {0});
psCvB.add<std::vector<unsigned int>>("probHcc", {1});
//psCvB.add<edm::FileInPath>("graph_path", edm::FileInPath("RecoBTag/Combined/data/DeepDoubleX/94X/V01/DDCvB.pb"));

desc.ifValue( edm::ParameterDescription<std::string>("flavor", "BvL", true),
"BvL" >> (edm::ParameterDescription<edm::ParameterSetDescription>("flav_table", psBvL, true) and
edm::ParameterDescription<edm::FileInPath>("graph_path", edm::FileInPath("RecoBTag/Combined/data/DeepDoubleB/V01/constant_graph_PtCut_MassSculptPen.pb"), true)) or
"CvL" >> (edm::ParameterDescription<edm::ParameterSetDescription>("flav_table", psCvL, true) and
edm::ParameterDescription<edm::FileInPath>("graph_path", edm::FileInPath("RecoBTag/Combined/data/DeepDoubleX/94X/V01/DDC.pb"), true) ) or
"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))
);
}
/* {
edm::ParameterSetDescription psd0;
psd0.addOptional<std::vector<unsigned int>>("probQCD", {0});
psd0.addOptional<std::vector<unsigned int>>("probHbb", {1});
psd0.addOptional<std::vector<unsigned int>>("probHcc");
desc.add<edm::ParameterSetDescription>("flav_table", psd0);
}
desc.add<edm::FileInPath>("graph_path",
edm::FileInPath("RecoBTag/Combined/data/DeepDoubleB/V01/constant_graph_PtCut_MassSculptPen.pb"));
} */

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

Expand Down
1 change: 1 addition & 0 deletions RecoBTag/TensorFlow/python/pfDeepDoubleCvBJetTags_cfi.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
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)
Expand Down
1 change: 1 addition & 0 deletions RecoBTag/TensorFlow/python/pfDeepDoubleCvLJetTags_cfi.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
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)
Expand Down
8 changes: 6 additions & 2 deletions RecoBTag/TensorFlow/test/test_deep_doublex_cfg.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,11 @@
'pfDeepDoubleCvLJetTags:probQCD',
'pfDeepDoubleCvLJetTags:probHcc',
'pfDeepDoubleCvBJetTags:probHbb',
'pfDeepDoubleCvBJetTags:probHcc'
'pfDeepDoubleCvBJetTags:probHcc',
'pfMassIndependentDeepDoubleCvLJetTags:probQCD',
'pfMassIndependentDeepDoubleCvLJetTags:probHcc',
'pfMassIndependentDeepDoubleCvBJetTags:probHbb',
'pfMassIndependentDeepDoubleCvBJetTags:probHcc',
]
)

Expand All @@ -70,7 +74,7 @@
#'/store/mc/RunIIFall17MiniAODv2/GluGluHToCC_M125_13TeV_powheg_pythia8/MINIAODSIM/PU2017_12Apr2018_94X_mc2017_realistic_v14-v2/30000/72164088-CB67-E811-9D0D-008CFA197AC4.root',
#'/store/mc/RunIIFall17MiniAOD/QCD_HT700to1000_TuneCP5_13TeV-madgraph-pythia8/MINIAODSIM/94X_mc2017_realistic_v10-v1/20000/C0F304A4-23FA-E711-942E-E0071B6CAD20.root'
)
process.maxEvents.input = -1
process.maxEvents.input = 1000

from Configuration.EventContent.EventContent_cff import MINIAODSIMEventContent
process.out.outputCommands.append('keep *_slimmedJetsAK8*_*_*')
Expand Down

0 comments on commit 0ed5f6f

Please sign in to comment.