diff --git a/PhysicsTools/PatAlgos/python/recoLayer0/bTagging_cff.py b/PhysicsTools/PatAlgos/python/recoLayer0/bTagging_cff.py index af501cf0a219f..84eeac73a7bd8 100644 --- a/PhysicsTools/PatAlgos/python/recoLayer0/bTagging_cff.py +++ b/PhysicsTools/PatAlgos/python/recoLayer0/bTagging_cff.py @@ -189,8 +189,8 @@ , 'pfNegativeDeepFlavourJetTags:probc' : [["pfNegativeDeepFlavourTagInfos"], ['pfDeepCSVNegativeTagInfos', "pfImpactParameterTagInfos", 'pfInclusiveSecondaryVertexFinderNegativeTagInfos']] , 'pfNegativeDeepFlavourJetTags:probuds' : [["pfNegativeDeepFlavourTagInfos"], ['pfDeepCSVNegativeTagInfos', "pfImpactParameterTagInfos", 'pfInclusiveSecondaryVertexFinderNegativeTagInfos']] , 'pfNegativeDeepFlavourJetTags:probg' : [["pfNegativeDeepFlavourTagInfos"], ['pfDeepCSVNegativeTagInfos', "pfImpactParameterTagInfos", 'pfInclusiveSecondaryVertexFinderNegativeTagInfos']] - , 'pfDeepDoubleBvLJetTags:probQCD' : [["pfDeepDoubleXTagInfos"], ['pfBoostedDoubleSVAK8TagInfos', "pfImpactParameterAK8TagInfos", 'pfInclusiveSecondaryVertexFinderAK8TagInfos']] - , 'pfDeepDoubleBvLJetTags:probHbb' : [["pfDeepDoubleXTagInfos"], ['pfBoostedDoubleSVAK8TagInfos', "pfImpactParameterAK8TagInfos", 'pfInclusiveSecondaryVertexFinderAK8TagInfos']] + , 'pfDeepDoubleBJetTags:probQ' : [["pfDeepDoubleXTagInfos"], ['pfBoostedDoubleSVAK8TagInfos', "pfImpactParameterAK8TagInfos", 'pfInclusiveSecondaryVertexFinderAK8TagInfos']] + , 'pfDeepDoubleBJetTags:probH' : [["pfDeepDoubleXTagInfos"], ['pfBoostedDoubleSVAK8TagInfos', "pfImpactParameterAK8TagInfos", 'pfInclusiveSecondaryVertexFinderAK8TagInfos']] , 'pfDeepDoubleCvLJetTags:probQCD' : [["pfDeepDoubleXTagInfos"], ['pfBoostedDoubleSVAK8TagInfos', "pfImpactParameterAK8TagInfos", 'pfInclusiveSecondaryVertexFinderAK8TagInfos']] , 'pfDeepDoubleCvLJetTags:probHcc' : [["pfDeepDoubleXTagInfos"], ['pfBoostedDoubleSVAK8TagInfos', "pfImpactParameterAK8TagInfos", 'pfInclusiveSecondaryVertexFinderAK8TagInfos']] , 'pfDeepDoubleCvBJetTags:probHbb' : [["pfDeepDoubleXTagInfos"], ['pfBoostedDoubleSVAK8TagInfos', "pfImpactParameterAK8TagInfos", 'pfInclusiveSecondaryVertexFinderAK8TagInfos']] diff --git a/RecoBTag/MXNet/test/test_deep_boosted_jet_cfg.py b/RecoBTag/MXNet/test/test_deep_boosted_jet_cfg.py new file mode 100644 index 0000000000000..b28dcae0a65eb --- /dev/null +++ b/RecoBTag/MXNet/test/test_deep_boosted_jet_cfg.py @@ -0,0 +1,75 @@ + +import FWCore.ParameterSet.Config as cms +from PhysicsTools.PatAlgos.tools.helpers import getPatAlgosToolsTask + +from FWCore.ParameterSet.VarParsing import VarParsing +options = VarParsing('analysis') +options.inputFiles = '/store/mc/RunIIFall17MiniAOD/ZprimeToWWToWlepWhad_narrow_M-3000_TuneCP5_13TeV-madgraph/MINIAODSIM/94X_mc2017_realistic_v10-v1/20000/3E25D208-8205-E811-8858-3417EBE64426.root' +options.maxEvents = -1 +options.parseArguments() + +process = cms.Process("PATtest") + +## MessageLogger +process.load("FWCore.MessageLogger.MessageLogger_cfi") +process.MessageLogger.cerr.FwkReport.reportEvery = 100 + + +## Options and Output Report +process.options = cms.untracked.PSet( wantSummary = cms.untracked.bool(True) ) + +## Source +process.source = cms.Source("PoolSource", + fileNames=cms.untracked.vstring(options.inputFiles) +) +## Maximal Number of Events +process.maxEvents = cms.untracked.PSet(input=cms.untracked.int32(options.maxEvents)) + +## Geometry and Detector Conditions (needed for a few patTuple production steps) +process.load("Configuration.Geometry.GeometryRecoDB_cff") +process.load("Configuration.StandardSequences.FrontierConditions_GlobalTag_cff") +from Configuration.AlCa.GlobalTag import GlobalTag +process.GlobalTag = GlobalTag(process.GlobalTag, 'auto:run2_mc') +process.load("Configuration.StandardSequences.MagneticField_cff") + +## Output Module Configuration (expects a path 'p') +from PhysicsTools.PatAlgos.patEventContent_cff import patEventContentNoCleaning +process.out = cms.OutputModule("PoolOutputModule", + fileName = cms.untracked.string('patTuple.root'), + ## save only events passing the full path + #SelectEvents = cms.untracked.PSet( SelectEvents = cms.vstring('p') ), + ## save PAT output; you need a '*' to unpack the list of commands + ## 'patEventContent' + outputCommands = cms.untracked.vstring('drop *', *patEventContentNoCleaning ) + ) + +patAlgosToolsTask = getPatAlgosToolsTask(process) +process.outpath = cms.EndPath(process.out, patAlgosToolsTask) + +## and add them to the event content +from PhysicsTools.PatAlgos.tools.jetTools import updateJetCollection +from RecoBTag.MXNet.pfDeepBoostedJet_cff import _pfDeepBoostedJetTagsAll as pfDeepBoostedJetTagsAll + +updateJetCollection( + process, + jetSource = cms.InputTag('slimmedJetsAK8'), + pvSource = cms.InputTag('offlineSlimmedPrimaryVertices'), + svSource = cms.InputTag('slimmedSecondaryVertices'), + rParam = 0.8, + jetCorrections = ('AK8PFPuppi', cms.vstring(['L2Relative', 'L3Absolute']), 'None'), + btagDiscriminators = pfDeepBoostedJetTagsAll + ) + +from Configuration.EventContent.EventContent_cff import MINIAODSIMEventContent +process.out.outputCommands.append('keep *_slimmedJetsAK8*_*_*') +process.out.outputCommands.append('keep *_offlineSlimmedPrimaryVertices*_*_*') +process.out.outputCommands.append('keep *_slimmedSecondaryVertices*_*_*') +process.out.outputCommands.append('keep *_selectedPatJets*_*_*') +process.out.outputCommands.append('keep *_selectedUpdatedPatJets*_*_*') +process.out.outputCommands.append('keep *_updatedPatJets*_*_*') + +process.out.fileName = 'test_deep_boosted_jet_MINIAODSIM.root' + +# ## +# process.options.wantSummary = False ## (to suppress the long output at the end of the job) +# process.add_(cms.Service("InitRootHandlers", DebugLevel =cms.untracked.int32(3))) diff --git a/RecoBTag/TensorFlow/plugins/DeepDoubleXTFJetTagsProducer.cc b/RecoBTag/TensorFlow/plugins/DeepDoubleXTFJetTagsProducer.cc index 19a52c6fa4d3e..8656ff202770c 100644 --- a/RecoBTag/TensorFlow/plugins/DeepDoubleXTFJetTagsProducer.cc +++ b/RecoBTag/TensorFlow/plugins/DeepDoubleXTFJetTagsProducer.cc @@ -168,7 +168,7 @@ void DeepDoubleXTFJetTagsProducer::fillDescriptions(edm::ConfigurationDescriptio }; auto descBvL(desc); descBvL.ifValue( edm::ParameterDescription("flavor", "BvL", true), flavorCases()); - descriptions.add("pfDeepDoubleBvLJetTags", descBvL); + descriptions.add("pfDeepDoubleBJetTags", descBvL); auto descCvL(desc); descCvL.ifValue( edm::ParameterDescription("flavor", "CvL", true), flavorCases()); diff --git a/RecoBTag/TensorFlow/python/pfDeepDoubleX_cff.py b/RecoBTag/TensorFlow/python/pfDeepDoubleX_cff.py index 32331fc050bd2..3cbd4cc21b7d1 100644 --- a/RecoBTag/TensorFlow/python/pfDeepDoubleX_cff.py +++ b/RecoBTag/TensorFlow/python/pfDeepDoubleX_cff.py @@ -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 diff --git a/RecoBTag/TensorFlow/python/pfMassIndependentDeepDoubleXJetTags_cff.py b/RecoBTag/TensorFlow/python/pfMassIndependentDeepDoubleXJetTags_cff.py index 0cacbdfa85c33..dce02112b84e5 100644 --- a/RecoBTag/TensorFlow/python/pfMassIndependentDeepDoubleXJetTags_cff.py +++ b/RecoBTag/TensorFlow/python/pfMassIndependentDeepDoubleXJetTags_cff.py @@ -1,9 +1,9 @@ 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( +pfMassIndependentDeepDoubleBvLJetTags = pfDeepDoubleBJetTags.clone( graph_path = 'RecoBTag/Combined/data/DeepDoubleX/94X/V01/DDB_mass_independent.pb') pfMassIndependentDeepDoubleCvLJetTags = pfDeepDoubleCvLJetTags.clone( graph_path = 'RecoBTag/Combined/data/DeepDoubleX/94X/V01/DDC_mass_independent.pb') diff --git a/RecoBTag/TensorFlow/test/plotDDX.py b/RecoBTag/TensorFlow/test/plotDDX.py index acc86108c48d6..60b757b7d6128 100644 --- a/RecoBTag/TensorFlow/test/plotDDX.py +++ b/RecoBTag/TensorFlow/test/plotDDX.py @@ -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:probQCD"), jet.bDiscriminator("pfDeepDoubleBJetTags:probHbb")) 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")) diff --git a/RecoBTag/TensorFlow/test/test_deep_doubleb_cfg_AOD.py b/RecoBTag/TensorFlow/test/test_deep_doubleb_cfg_AOD.py index 4357c89f98d06..f4a8e3ed3c8d0 100644 --- a/RecoBTag/TensorFlow/test/test_deep_doubleb_cfg_AOD.py +++ b/RecoBTag/TensorFlow/test/test_deep_doubleb_cfg_AOD.py @@ -70,8 +70,8 @@ jetCorrections = ('AK8PFPuppi', cms.vstring(['L1FastJet', 'L2Relative', 'L3Absolute']), 'Type-2'), btagDiscriminators = [ 'pfBoostedDoubleSecondaryVertexAK8BJetTags', - 'pfDeepDoubleBvLJetTags:probQCD', - 'pfDeepDoubleBvLJetTags:probHbb', + 'pfDeepDoubleBJetTags:probQ', + 'pfDeepDoubleBJetTags:probH', ] ) diff --git a/RecoBTag/TensorFlow/test/test_deep_doublex_cfg.py b/RecoBTag/TensorFlow/test/test_deep_doublex_cfg.py index 0998669925315..35510fe1ca556 100644 --- a/RecoBTag/TensorFlow/test/test_deep_doublex_cfg.py +++ b/RecoBTag/TensorFlow/test/test_deep_doublex_cfg.py @@ -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',