Skip to content

Commit

Permalink
Fixing JetTags part2
Browse files Browse the repository at this point in the history
  • Loading branch information
anovak10 committed Nov 29, 2018
1 parent b3fd7a2 commit 550912e
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 14 deletions.
8 changes: 5 additions & 3 deletions RecoBTag/TensorFlow/plugins/DeepDoubleXTFJetTagsProducer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,10 @@ void DeepDoubleXTFJetTagsProducer::fillDescriptions(edm::ConfigurationDescriptio
desc.add<std::string>("singleThreadPool", "no_threads");

edm::ParameterSetDescription psBvL;
psBvL.add<std::vector<unsigned int>>("probQCD", {0});
psBvL.add<std::vector<unsigned int>>("probHbb", {1});
psBvL.add<std::vector<unsigned int>>("probQ", {0});
psBvL.add<std::vector<unsigned int>>("probH", {1});
psBvL.addOptional<std::vector<unsigned int>>("probQCD", {0});
psBvL.addOptional<std::vector<unsigned int>>("probHbb", {1});

edm::ParameterSetDescription psCvL;
psCvL.add<std::vector<unsigned int>>("probQCD", {0});
Expand All @@ -168,7 +170,7 @@ void DeepDoubleXTFJetTagsProducer::fillDescriptions(edm::ConfigurationDescriptio
};
auto descBvL(desc);
descBvL.ifValue( edm::ParameterDescription<std::string>("flavor", "BvL", true), flavorCases());
descriptions.add("pfDeepDoubleBvLJetTags", descBvL);
descriptions.add("pfDeepDoubleBJetTags", descBvL);

auto descCvL(desc);
descCvL.ifValue( edm::ParameterDescription<std::string>("flavor", "CvL", true), flavorCases());
Expand Down
2 changes: 1 addition & 1 deletion RecoBTag/TensorFlow/python/pfDeepDoubleX_cff.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from RecoBTag.TensorFlow.pfDeepDoubleBvLJetTags_cfi import pfDeepDoubleBvLJetTags
from RecoBTag.TensorFlow.pfDeepDoubleBJetTags_cfi import pfDeepDoubleBJetTags
from RecoBTag.TensorFlow.pfDeepDoubleCvBJetTags_cfi import pfDeepDoubleCvBJetTags
from RecoBTag.TensorFlow.pfDeepDoubleCvLJetTags_cfi import pfDeepDoubleCvLJetTags

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
import FWCore.ParameterSet.Config as cms
from pfDeepDoubleBvLJetTags_cfi import pfDeepDoubleBvLJetTags
from pfDeepDoubleBJetTags_cfi import pfDeepDoubleBJetTags
from pfDeepDoubleCvLJetTags_cfi import pfDeepDoubleCvLJetTags
from pfDeepDoubleCvBJetTags_cfi import pfDeepDoubleCvBJetTags

pfMassIndependentDeepDoubleBvLJetTags = pfDeepDoubleBvLJetTags.clone(
graph_path = 'RecoBTag/Combined/data/DeepDoubleX/94X/V01/DDB_mass_independent.pb')
pfMassIndependentDeepDoubleBvLJetTags = pfDeepDoubleBJetTags.clone(
graph_path = 'RecoBTag/Combined/data/DeepDoubleX/94X/V01/DDB_mass_independent.pb',
flav_table = cms.PSet(
probQCD = cms.vuint32(0),
probHbb = cms.vuint32(1)
)
)
pfMassIndependentDeepDoubleCvLJetTags = pfDeepDoubleCvLJetTags.clone(
graph_path = 'RecoBTag/Combined/data/DeepDoubleX/94X/V01/DDC_mass_independent.pb')
pfMassIndependentDeepDoubleCvBJetTags = pfDeepDoubleCvBJetTags.clone(
Expand Down
10 changes: 5 additions & 5 deletions RecoBTag/TensorFlow/test/plotDDX.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,18 @@
event.getByLabel (labelJ, handleJ)
jets = handleJ.product()
for jet in jets :
if jet.pt() < 300 or jet.pt() > 2000: continue
if jet.mass() < 40 or jet.mass() > 200: continue
#if jet.pt() < 300 or jet.pt() > 2000: continue
#if jet.mass() < 40 or jet.mass() > 200: continue

print(jet.pt(), jet.mass())
print("DDB", jet.bDiscriminator("pfDeepDoubleBvLJetTags:probQCD"), jet.bDiscriminator("pfDeepDoubleBvLJetTags:probHbb"))
print("DDB", jet.bDiscriminator("pfDeepDoubleBJetTags:probQ"), jet.bDiscriminator("pfDeepDoubleBJetTags:probH"))
print("DDB", jet.bDiscriminator("pfMassIndependentDeepDoubleBvLJetTags:probQCD"), jet.bDiscriminator("pfMassIndependentDeepDoubleBvLJetTags:probHbb"))
print("DDCvL", jet.bDiscriminator("pfDeepDoubleCvLJetTags:probQCD"), jet.bDiscriminator("pfDeepDoubleCvLJetTags:probHcc"))
print("DDCvL", jet.bDiscriminator("pfMassIndependentDeepDoubleCvLJetTags:probQCD"), jet.bDiscriminator("pfMassIndependentDeepDoubleCvLJetTags:probHcc"))
print("DDCvB", jet.bDiscriminator("pfDeepDoubleCvBJetTags:probHbb"), jet.bDiscriminator("pfDeepDoubleCvBJetTags:probHcc") )
print("DDCvB", jet.bDiscriminator("pfMassIndependentDeepDoubleCvBJetTags:probHbb"), jet.bDiscriminator("pfMassIndependentDeepDoubleCvBJetTags:probHcc"))
h_probQ_ddb.Fill(jet.bDiscriminator("pfDeepDoubleBvLJetTags:probQCD"))
h_probH_ddb.Fill(jet.bDiscriminator("pfDeepDoubleBvLJetTags:probHbb"))
h_probQ_ddb.Fill(jet.bDiscriminator("pfDeepDoubleBJetTags:probQ"))
h_probH_ddb.Fill(jet.bDiscriminator("pfDeepDoubleBJetTags:probH"))
h_probQ_ddc.Fill(jet.bDiscriminator("pfDeepDoubleCvLJetTags:probQCD"))
h_probH_ddc.Fill(jet.bDiscriminator("pfDeepDoubleCvLJetTags:probHcc"))

Expand Down
4 changes: 2 additions & 2 deletions RecoBTag/TensorFlow/test/test_deep_doublex_cfg.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@
jetCorrections = ('AK8PFchs', cms.vstring(['L2Relative', 'L3Absolute']), 'None'),
btagDiscriminators = [
'pfBoostedDoubleSecondaryVertexAK8BJetTags',
'pfDeepDoubleBvLJetTags:probQCD',
'pfDeepDoubleBvLJetTags:probHbb',
'pfDeepDoubleBJetTags:probQ',
'pfDeepDoubleBJetTags:probH',
'pfDeepDoubleCvLJetTags:probQCD',
'pfDeepDoubleCvLJetTags:probHcc',
'pfDeepDoubleCvBJetTags:probHbb',
Expand Down

0 comments on commit 550912e

Please sign in to comment.