diff --git a/DataFormats/BTauReco/interface/DeepDoubleBTagInfo.h b/DataFormats/BTauReco/interface/DeepDoubleBTagInfo.h deleted file mode 100644 index 70ec4aa9941f0..0000000000000 --- a/DataFormats/BTauReco/interface/DeepDoubleBTagInfo.h +++ /dev/null @@ -1,15 +0,0 @@ -#ifndef DataFormats_BTauReco_DeepDoubleBTagInfo_h -#define DataFormats_BTauReco_DeepDoubleBTagInfo_h - -#include "DataFormats/BTauReco/interface/FeaturesTagInfo.h" -#include "DataFormats/BTauReco/interface/DeepDoubleBFeatures.h" - -namespace reco { - -typedef FeaturesTagInfo DeepDoubleBTagInfo; - -DECLARE_EDM_REFS( DeepDoubleBTagInfo ) - -} - -#endif // DataFormats_BTauReco_DeepDoubleBTagInfo_h diff --git a/DataFormats/BTauReco/interface/DeepDoubleBFeatures.h b/DataFormats/BTauReco/interface/DeepDoubleXFeatures.h similarity index 63% rename from DataFormats/BTauReco/interface/DeepDoubleBFeatures.h rename to DataFormats/BTauReco/interface/DeepDoubleXFeatures.h index 08859f343c88c..71e1c7d884be8 100644 --- a/DataFormats/BTauReco/interface/DeepDoubleBFeatures.h +++ b/DataFormats/BTauReco/interface/DeepDoubleXFeatures.h @@ -1,5 +1,5 @@ -#ifndef DataFormats_BTauReco_DeepDoubleBFeatures_h -#define DataFormats_BTauReco_DeepDoubleBFeatures_h +#ifndef DataFormats_BTauReco_DeepDoubleXFeatures_h +#define DataFormats_BTauReco_DeepDoubleXFeatures_h #include @@ -10,9 +10,18 @@ namespace btagbtvdeep { -class DeepDoubleBFeatures { +class DeepDoubleXFeatures { public: + + bool empty() const { + return is_empty_; + } + + void filled(){ + is_empty_ = false; + } + JetFeatures jet_features; BoostedDoubleSVTagInfoFeatures tag_info_features; @@ -21,9 +30,12 @@ class DeepDoubleBFeatures { std::vector c_pf_features; std::size_t npv; // used by deep flavour -}; + private: + bool is_empty_ = true; + +}; } -#endif //DataFormats_BTauReco_DeepDoubleBFeatures_h +#endif //DataFormats_BTauReco_DeepDoubleXFeatures_h diff --git a/DataFormats/BTauReco/interface/DeepDoubleXTagInfo.h b/DataFormats/BTauReco/interface/DeepDoubleXTagInfo.h new file mode 100644 index 0000000000000..f126c1b686a46 --- /dev/null +++ b/DataFormats/BTauReco/interface/DeepDoubleXTagInfo.h @@ -0,0 +1,15 @@ +#ifndef DataFormats_BTauReco_DeepDoubleXTagInfo_h +#define DataFormats_BTauReco_DeepDoubleXTagInfo_h + +#include "DataFormats/BTauReco/interface/FeaturesTagInfo.h" +#include "DataFormats/BTauReco/interface/DeepDoubleXFeatures.h" + +namespace reco { + +typedef FeaturesTagInfo DeepDoubleXTagInfo; + +DECLARE_EDM_REFS( DeepDoubleXTagInfo ) + +} + +#endif // DataFormats_BTauReco_DeepDoubleXTagInfo_h diff --git a/DataFormats/BTauReco/src/classes.h b/DataFormats/BTauReco/src/classes.h index 2d35f90389e99..7a25b4bbb1c2b 100755 --- a/DataFormats/BTauReco/src/classes.h +++ b/DataFormats/BTauReco/src/classes.h @@ -54,11 +54,12 @@ #include "DataFormats/BTauReco/interface/ChargedCandidateFeatures.h" #include "DataFormats/BTauReco/interface/DeepFlavourFeatures.h" #include "DataFormats/BTauReco/interface/DeepFlavourTagInfo.h" -#include "DataFormats/BTauReco/interface/DeepDoubleBFeatures.h" -#include "DataFormats/BTauReco/interface/DeepDoubleBTagInfo.h" +#include "DataFormats/BTauReco/interface/DeepDoubleXFeatures.h" +#include "DataFormats/BTauReco/interface/DeepDoubleXTagInfo.h" #include "DataFormats/BTauReco/interface/DeepBoostedJetTagInfo.h" + namespace reco { typedef TrackTauImpactParameterAssociationCollection::map_type TrackTauImpactParameterAssociationMapType; typedef TrackTauImpactParameterAssociationCollection::ref_type TrackTauImpactParameterAssociationRefType; @@ -419,15 +420,15 @@ namespace DataFormats_BTauReco { edm::Wrapper deep_flavour_tag_info_collection_edm_wrapper; btagbtvdeep::BoostedDoubleSVTagInfoFeatures boosted_double_sv_tag_info_features; - btagbtvdeep::DeepDoubleBFeatures deep_doubleb_features; - reco::DeepDoubleBTagInfo deep_doubleb_tag_info; - reco::DeepDoubleBTagInfoCollection deep_doubleb_tag_info_collection; - reco::DeepDoubleBTagInfoRef deep_doubleb_tag_info_collection_ref; - reco::DeepDoubleBTagInfoFwdRef deep_doubleb_tag_info_collection_fwd_ref; - reco::DeepDoubleBTagInfoRefProd deep_doubleb_tag_info_collection_ref_prod; - reco::DeepDoubleBTagInfoRefVector deep_doubleb_tag_info_collection_ref_vector; - edm::Wrapper deep_doubleb_tag_info_collection_edm_wrapper; - + btagbtvdeep::DeepDoubleXFeatures deep_doublex_features; + reco::DeepDoubleXTagInfo deep_doublex_tag_info; + reco::DeepDoubleXTagInfoCollection deep_doublex_tag_info_collection; + reco::DeepDoubleXTagInfoRef deep_doublex_tag_info_collection_ref; + reco::DeepDoubleXTagInfoFwdRef deep_doublex_tag_info_collection_fwd_ref; + reco::DeepDoubleXTagInfoRefProd deep_doublex_tag_info_collection_ref_prod; + reco::DeepDoubleXTagInfoRefVector deep_doublex_tag_info_collection_ref_vector; + edm::Wrapper deep_doublex_tag_info_collection_edm_wrapper; + btagbtvdeep::DeepBoostedJetFeatures deep_boosted_jet_tag_info_features; reco::DeepBoostedJetTagInfo deep_boosted_jet_tag_info; reco::DeepBoostedJetTagInfoCollection deep_boosted_jet_tag_info_collection; diff --git a/DataFormats/BTauReco/src/classes_def.xml b/DataFormats/BTauReco/src/classes_def.xml index 38ae4a5b9ad72..70f22e609fd86 100644 --- a/DataFormats/BTauReco/src/classes_def.xml +++ b/DataFormats/BTauReco/src/classes_def.xml @@ -447,8 +447,8 @@ - - + + @@ -462,15 +462,15 @@ - - - - - - - - - + + + + + + + + + diff --git a/PhysicsTools/PatAlgos/python/recoLayer0/bTagging_cff.py b/PhysicsTools/PatAlgos/python/recoLayer0/bTagging_cff.py index d8a42f9dc32b0..65fc65a775a76 100644 --- a/PhysicsTools/PatAlgos/python/recoLayer0/bTagging_cff.py +++ b/PhysicsTools/PatAlgos/python/recoLayer0/bTagging_cff.py @@ -41,8 +41,9 @@ # DeepFlavour tag infos , 'pfDeepFlavourTagInfos' , 'pfNegativeDeepFlavourTagInfos' - # DeepDoubleB tag infos - , 'pfDeepDoubleBTagInfos' + # DeepDoubleB/C tag infos + , 'pfDeepDoubleXTagInfos' + , 'pfDeepDoubleXTagInfosNopt' # DeepBoostedJet tag infos , 'pfDeepBoostedJetTagInfos' ] @@ -189,8 +190,20 @@ , 'pfNegativeDeepFlavourJetTags:probc' : [["pfNegativeDeepFlavourTagInfos"], ['pfDeepCSVNegativeTagInfos', "pfImpactParameterTagInfos", 'pfInclusiveSecondaryVertexFinderNegativeTagInfos']] , 'pfNegativeDeepFlavourJetTags:probuds' : [["pfNegativeDeepFlavourTagInfos"], ['pfDeepCSVNegativeTagInfos', "pfImpactParameterTagInfos", 'pfInclusiveSecondaryVertexFinderNegativeTagInfos']] , 'pfNegativeDeepFlavourJetTags:probg' : [["pfNegativeDeepFlavourTagInfos"], ['pfDeepCSVNegativeTagInfos', "pfImpactParameterTagInfos", 'pfInclusiveSecondaryVertexFinderNegativeTagInfos']] - , 'pfDeepDoubleBJetTags:probQ' : [["pfDeepDoubleBTagInfos"], ['pfBoostedDoubleSVAK8TagInfos', "pfImpactParameterAK8TagInfos", 'pfInclusiveSecondaryVertexFinderAK8TagInfos']] - , 'pfDeepDoubleBJetTags:probH' : [["pfDeepDoubleBTagInfos"], ['pfBoostedDoubleSVAK8TagInfos', "pfImpactParameterAK8TagInfos", 'pfInclusiveSecondaryVertexFinderAK8TagInfos']] + , 'pfDeepDoubleBJetTags:probQ' : [["pfDeepDoubleXTagInfosNopt"], ['pfBoostedDoubleSVAK8TagInfos', "pfImpactParameterAK8TagInfos", 'pfInclusiveSecondaryVertexFinderAK8TagInfos']] + , 'pfDeepDoubleBJetTags:probH' : [["pfDeepDoubleXTagInfosNopt"], ['pfBoostedDoubleSVAK8TagInfos', "pfImpactParameterAK8TagInfos", 'pfInclusiveSecondaryVertexFinderAK8TagInfos']] + , 'pfDeepDoubleBvLJetTags:probQCD' : [["pfDeepDoubleXTagInfos"], ['pfBoostedDoubleSVAK8TagInfos', "pfImpactParameterAK8TagInfos", 'pfInclusiveSecondaryVertexFinderAK8TagInfos']] + , 'pfDeepDoubleBvLJetTags:probHbb' : [["pfDeepDoubleXTagInfos"], ['pfBoostedDoubleSVAK8TagInfos', "pfImpactParameterAK8TagInfos", 'pfInclusiveSecondaryVertexFinderAK8TagInfos']] + , 'pfDeepDoubleCvLJetTags:probQCD' : [["pfDeepDoubleXTagInfos"], ['pfBoostedDoubleSVAK8TagInfos', "pfImpactParameterAK8TagInfos", 'pfInclusiveSecondaryVertexFinderAK8TagInfos']] + , 'pfDeepDoubleCvLJetTags:probHcc' : [["pfDeepDoubleXTagInfos"], ['pfBoostedDoubleSVAK8TagInfos', "pfImpactParameterAK8TagInfos", 'pfInclusiveSecondaryVertexFinderAK8TagInfos']] + , 'pfDeepDoubleCvBJetTags:probHbb' : [["pfDeepDoubleXTagInfos"], ['pfBoostedDoubleSVAK8TagInfos', "pfImpactParameterAK8TagInfos", 'pfInclusiveSecondaryVertexFinderAK8TagInfos']] + , 'pfDeepDoubleCvBJetTags:probHcc' : [["pfDeepDoubleXTagInfos"], ['pfBoostedDoubleSVAK8TagInfos', "pfImpactParameterAK8TagInfos", 'pfInclusiveSecondaryVertexFinderAK8TagInfos']] + , 'pfMassIndependentDeepDoubleBvLJetTags:probQCD' : [["pfDeepDoubleXTagInfos"], ['pfBoostedDoubleSVAK8TagInfos', "pfImpactParameterAK8TagInfos", 'pfInclusiveSecondaryVertexFinderAK8TagInfos']] + , 'pfMassIndependentDeepDoubleBvLJetTags:probHbb' : [["pfDeepDoubleXTagInfos"], ['pfBoostedDoubleSVAK8TagInfos', "pfImpactParameterAK8TagInfos", 'pfInclusiveSecondaryVertexFinderAK8TagInfos']] + , 'pfMassIndependentDeepDoubleCvLJetTags:probQCD' : [["pfDeepDoubleXTagInfos"], ['pfBoostedDoubleSVAK8TagInfos', "pfImpactParameterAK8TagInfos", 'pfInclusiveSecondaryVertexFinderAK8TagInfos']] + , 'pfMassIndependentDeepDoubleCvLJetTags:probHcc' : [["pfDeepDoubleXTagInfos"], ['pfBoostedDoubleSVAK8TagInfos', "pfImpactParameterAK8TagInfos", 'pfInclusiveSecondaryVertexFinderAK8TagInfos']] + , 'pfMassIndependentDeepDoubleCvBJetTags:probHbb' : [["pfDeepDoubleXTagInfos"], ['pfBoostedDoubleSVAK8TagInfos', "pfImpactParameterAK8TagInfos", 'pfInclusiveSecondaryVertexFinderAK8TagInfos']] + , 'pfMassIndependentDeepDoubleCvBJetTags:probHcc' : [["pfDeepDoubleXTagInfos"], ['pfBoostedDoubleSVAK8TagInfos', "pfImpactParameterAK8TagInfos", 'pfInclusiveSecondaryVertexFinderAK8TagInfos']] } # meta-taggers are simple arithmetic on top of other taggers, they are stored here diff --git a/PhysicsTools/PatAlgos/python/slimming/applyDeepBtagging_cff.py b/PhysicsTools/PatAlgos/python/slimming/applyDeepBtagging_cff.py index b1c54b0c8ac39..befcbe07f6f97 100644 --- a/PhysicsTools/PatAlgos/python/slimming/applyDeepBtagging_cff.py +++ b/PhysicsTools/PatAlgos/python/slimming/applyDeepBtagging_cff.py @@ -47,6 +47,26 @@ def applyDeepBtagging( process, postfix="" ) : # update slimmed jets to include particle-based deep taggers (keep same name) # make clone for DeepTags-less slimmed AK8 jets, so output name is preserved addToProcessAndTask('slimmedJetsAK8NoDeepTags', process.slimmedJetsAK8.clone(), process, task) + _btagDiscriminators = cms.PSet( names = cms.vstring( + 'pfDeepDoubleBJetTags:probQ', + 'pfDeepDoubleBJetTags:probH' ) + ) + from Configuration.Eras.Modifier_run2_miniAOD_devel_cff import run2_miniAOD_devel + run2_miniAOD_devel.toModify(_btagDiscriminators, names = _btagDiscriminators.names + [ + 'pfDeepDoubleBvLJetTags:probQCD', + 'pfDeepDoubleBvLJetTags:probHbb', + 'pfDeepDoubleCvLJetTags:probQCD', + 'pfDeepDoubleCvLJetTags:probHcc', + 'pfDeepDoubleCvBJetTags:probHbb', + 'pfDeepDoubleCvBJetTags:probHcc', + 'pfMassIndependentDeepDoubleBvLJetTags:probQCD', + 'pfMassIndependentDeepDoubleBvLJetTags:probHbb', + 'pfMassIndependentDeepDoubleCvLJetTags:probQCD', + 'pfMassIndependentDeepDoubleCvLJetTags:probHcc', + 'pfMassIndependentDeepDoubleCvBJetTags:probHbb', + 'pfMassIndependentDeepDoubleCvBJetTags:probHcc', + ] + pfDeepBoostedJetTagsAll + ) updateJetCollection( process, jetSource = cms.InputTag('slimmedJetsAK8NoDeepTags'), @@ -59,11 +79,7 @@ def applyDeepBtagging( process, postfix="" ) : elSource = cms.InputTag('slimmedElectrons'), rParam = 0.8, jetCorrections = ('AK8PFPuppi', cms.vstring(['L2Relative', 'L3Absolute']), 'None'), - btagDiscriminators = [ - 'pfDeepDoubleBJetTags:probQ', - 'pfDeepDoubleBJetTags:probH', - ], -# ] + pfDeepBoostedJetTagsAll, # uncomment it to test DeepBoostedJet + btagDiscriminators = _btagDiscriminators.names, postfix = 'SlimmedAK8DeepTags'+postfix, printWarning = False ) diff --git a/PhysicsTools/PatAlgos/python/tools/jetTools.py b/PhysicsTools/PatAlgos/python/tools/jetTools.py index eb93baba9c444..beb9223cd73a6 100644 --- a/PhysicsTools/PatAlgos/python/tools/jetTools.py +++ b/PhysicsTools/PatAlgos/python/tools/jetTools.py @@ -620,9 +620,19 @@ def setupBTagging(process, jetSource, pfCandidates, explicitJTA, pvSource, svSou flip = flip), process, task) - if btagInfo == 'pfDeepDoubleBTagInfos': + if btagInfo == 'pfDeepDoubleXTagInfos': addToProcessAndTask(btagPrefix+btagInfo+labelName+postfix, - btag.pfDeepDoubleBTagInfos.clone( + btag.pfDeepDoubleXTagInfos.clone( + jets = jetSource, + vertices=pvSource, + secondary_vertices=svSource, + shallow_tag_infos = cms.InputTag(btagPrefix+'pfBoostedDoubleSVAK8TagInfos'+labelName+postfix), + ), + process, task) + + if btagInfo == 'pfDeepDoubleXTagInfosNopt': + addToProcessAndTask(btagPrefix+btagInfo+labelName+postfix, + btag.pfDeepDoubleXTagInfosNopt.clone( jets = jetSource, vertices=pvSource, secondary_vertices=svSource, diff --git a/RecoBTag/Configuration/python/RecoBTag_cff.py b/RecoBTag/Configuration/python/RecoBTag_cff.py index 170ceb6abe864..cb5fd4c174b7d 100644 --- a/RecoBTag/Configuration/python/RecoBTag_cff.py +++ b/RecoBTag/Configuration/python/RecoBTag_cff.py @@ -8,6 +8,7 @@ from RecoBTag.CTagging.RecoCTagging_cff import * from RecoBTag.Combined.deepFlavour_cff import * from RecoBTag.TensorFlow.pfDeepFlavour_cff import * +from RecoBTag.TensorFlow.pfDeepDoubleX_cff import * from RecoBTag.MXNet.pfDeepBoostedJet_cff import * from RecoVertex.AdaptiveVertexFinder.inclusiveVertexing_cff import * diff --git a/RecoBTag/FeatureTools/plugins/DeepDoubleBTagInfoProducer.cc b/RecoBTag/FeatureTools/plugins/DeepDoubleXTagInfoProducer.cc similarity index 92% rename from RecoBTag/FeatureTools/plugins/DeepDoubleBTagInfoProducer.cc rename to RecoBTag/FeatureTools/plugins/DeepDoubleXTagInfoProducer.cc index b69b23a762035..891c6028c2615 100644 --- a/RecoBTag/FeatureTools/plugins/DeepDoubleBTagInfoProducer.cc +++ b/RecoBTag/FeatureTools/plugins/DeepDoubleXTagInfoProducer.cc @@ -18,8 +18,8 @@ #include "TrackingTools/Records/interface/TransientTrackRecord.h" #include "TrackingTools/TransientTrack/interface/TransientTrackBuilder.h" -#include "DataFormats/BTauReco/interface/DeepDoubleBFeatures.h" -#include "DataFormats/BTauReco/interface/DeepDoubleBTagInfo.h" +#include "DataFormats/BTauReco/interface/DeepDoubleXFeatures.h" +#include "DataFormats/BTauReco/interface/DeepDoubleXTagInfo.h" #include "RecoBTag/FeatureTools/interface/BoostedDoubleSVTagInfoConverter.h" #include "RecoBTag/FeatureTools/interface/ChargedCandidateConverter.h" @@ -34,17 +34,17 @@ #include "RecoBTag/FeatureTools/interface/deep_helpers.h" -class DeepDoubleBTagInfoProducer : public edm::stream::EDProducer<> +class DeepDoubleXTagInfoProducer : public edm::stream::EDProducer<> { public: - explicit DeepDoubleBTagInfoProducer(const edm::ParameterSet&); - ~DeepDoubleBTagInfoProducer() override; + explicit DeepDoubleXTagInfoProducer(const edm::ParameterSet&); + ~DeepDoubleXTagInfoProducer() override; static void fillDescriptions(edm::ConfigurationDescriptions& descriptions); private: - typedef std::vector DeepDoubleBTagInfoCollection; + typedef std::vector DeepDoubleXTagInfoCollection; typedef reco::VertexCompositePtrCandidateCollection SVCollection; typedef reco::VertexCollection VertexCollection; typedef edm::View @@ -59,6 +59,7 @@ class DeepDoubleBTagInfoProducer : public edm::stream::EDProducer<> } const double jet_radius_; + const double min_jet_pt_; const double min_candidate_pt_; edm::EDGetTokenT> jet_token_; @@ -67,9 +68,10 @@ class DeepDoubleBTagInfoProducer : public edm::stream::EDProducer<> edm::EDGetTokenT shallow_tag_info_token_; }; -DeepDoubleBTagInfoProducer::DeepDoubleBTagInfoProducer( +DeepDoubleXTagInfoProducer::DeepDoubleXTagInfoProducer( const edm::ParameterSet& iConfig) : jet_radius_(iConfig.getParameter("jet_radius")) + , min_jet_pt_(iConfig.getParameter("min_jet_pt")) , min_candidate_pt_(iConfig.getParameter("min_candidate_pt")) , jet_token_(consumes>( iConfig.getParameter("jets"))) @@ -80,34 +82,35 @@ DeepDoubleBTagInfoProducer::DeepDoubleBTagInfoProducer( , shallow_tag_info_token_(consumes( iConfig.getParameter("shallow_tag_infos"))) { - produces(); + produces(); } -DeepDoubleBTagInfoProducer::~DeepDoubleBTagInfoProducer() +DeepDoubleXTagInfoProducer::~DeepDoubleXTagInfoProducer() { } -void DeepDoubleBTagInfoProducer::fillDescriptions( +void DeepDoubleXTagInfoProducer::fillDescriptions( edm::ConfigurationDescriptions& descriptions) { - // pfDeepDoubleBTagInfos + // pfDeepDoubleXTagInfos edm::ParameterSetDescription desc; desc.add("shallow_tag_infos", edm::InputTag("pfBoostedDoubleSVAK8TagInfos")); desc.add("jet_radius", 0.8); + desc.add("min_jet_pt", 150); desc.add("min_candidate_pt", 0.95); desc.add("vertices", edm::InputTag("offlinePrimaryVertices")); desc.add("secondary_vertices", edm::InputTag("inclusiveCandidateSecondaryVertices")); desc.add("jets", edm::InputTag("ak8PFJetsCHS")); - descriptions.add("pfDeepDoubleBTagInfos", desc); + descriptions.add("pfDeepDoubleXTagInfos", desc); } -void DeepDoubleBTagInfoProducer::produce(edm::Event& iEvent, +void DeepDoubleXTagInfoProducer::produce(edm::Event& iEvent, const edm::EventSetup& iSetup) { - auto output_tag_infos = std::make_unique(); + auto output_tag_infos = std::make_unique(); edm::Handle> jets; iEvent.getByToken(jet_token_, jets); @@ -137,11 +140,15 @@ void DeepDoubleBTagInfoProducer::produce(edm::Event& iEvent, { // create data containing structure - btagbtvdeep::DeepDoubleBFeatures features; + btagbtvdeep::DeepDoubleXFeatures features; // reco jet reference (use as much as possible) const auto& jet = jets->at(jet_n); + edm::RefToBase jet_ref(jets, jet_n); + if (jet.pt() > min_jet_pt_) + { + features.filled(); // TagInfoCollection not in an associative container so search for matchs const edm::View& taginfos = *shallow_tag_infos; edm::Ptr match; @@ -338,7 +345,7 @@ void DeepDoubleBTagInfoProducer::produce(edm::Event& iEvent, } } } - + } output_tag_infos->emplace_back(features, jet_ref); } @@ -346,4 +353,4 @@ void DeepDoubleBTagInfoProducer::produce(edm::Event& iEvent, } // define this as a plug-in -DEFINE_FWK_MODULE(DeepDoubleBTagInfoProducer); +DEFINE_FWK_MODULE(DeepDoubleXTagInfoProducer); diff --git a/RecoBTag/FeatureTools/python/pfDeepDoubleXTagInfosNopt_cfi.py b/RecoBTag/FeatureTools/python/pfDeepDoubleXTagInfosNopt_cfi.py new file mode 100644 index 0000000000000..01fb04f1e7bdb --- /dev/null +++ b/RecoBTag/FeatureTools/python/pfDeepDoubleXTagInfosNopt_cfi.py @@ -0,0 +1,7 @@ +import FWCore.ParameterSet.Config as cms + +from pfDeepDoubleXTagInfos_cfi import pfDeepDoubleXTagInfos + +pfDeepDoubleXTagInfosNopt = pfDeepDoubleXTagInfos.clone( + min_jet_pt = 0 +) diff --git a/RecoBTag/TensorFlow/interface/tensor_fillers.h b/RecoBTag/TensorFlow/interface/tensor_fillers.h index 6ea1de6f3315b..0a110ce626086 100644 --- a/RecoBTag/TensorFlow/interface/tensor_fillers.h +++ b/RecoBTag/TensorFlow/interface/tensor_fillers.h @@ -3,9 +3,7 @@ #include "PhysicsTools/TensorFlow/interface/TensorFlow.h" #include "DataFormats/BTauReco/interface/DeepFlavourTagInfo.h" -#include "DataFormats/BTauReco/interface/DeepDoubleBTagInfo.h" - - +#include "DataFormats/BTauReco/interface/DeepDoubleXTagInfo.h" namespace btagbtvdeep { @@ -23,9 +21,9 @@ namespace btagbtvdeep { void db_tensor_filler(tensorflow::Tensor & tensor, std::size_t jet_n, - const btagbtvdeep::DeepDoubleBFeatures & features) ; - - + const btagbtvdeep::DeepDoubleXFeatures & features) ; + + void c_pf_tensor_filler(tensorflow::Tensor & tensor, std::size_t jet_n, std::size_t c_pf_n, diff --git a/RecoBTag/TensorFlow/plugins/DeepDoubleBTFJetTagsProducer.cc b/RecoBTag/TensorFlow/plugins/DeepDoubleXTFJetTagsProducer.cc similarity index 65% rename from RecoBTag/TensorFlow/plugins/DeepDoubleBTFJetTagsProducer.cc rename to RecoBTag/TensorFlow/plugins/DeepDoubleXTFJetTagsProducer.cc index dadc9ba959d46..2d97bfa26d27c 100644 --- a/RecoBTag/TensorFlow/plugins/DeepDoubleBTFJetTagsProducer.cc +++ b/RecoBTag/TensorFlow/plugins/DeepDoubleXTFJetTagsProducer.cc @@ -12,7 +12,7 @@ #include "DataFormats/BTauReco/interface/JetTag.h" -#include "DataFormats/BTauReco/interface/DeepDoubleBTagInfo.h" +#include "DataFormats/BTauReco/interface/DeepDoubleXTagInfo.h" #include "PhysicsTools/TensorFlow/interface/TensorFlow.h" @@ -26,23 +26,23 @@ // make use of a cache struct that can be extended in the future if nedded. In addition, the graph // is protected via std::atomic, which should not affect the performance as it is only accessed in // the module constructor and not in the actual produce loop. -struct DeepDoubleBTFCache { - DeepDoubleBTFCache() : graphDef(nullptr) { +struct DeepDoubleXTFCache { + DeepDoubleXTFCache() : graphDef(nullptr) { } std::atomic graphDef; }; -class DeepDoubleBTFJetTagsProducer : public edm::stream::EDProducer> { +class DeepDoubleXTFJetTagsProducer : public edm::stream::EDProducer> { public: - explicit DeepDoubleBTFJetTagsProducer(const edm::ParameterSet&, const DeepDoubleBTFCache*); - ~DeepDoubleBTFJetTagsProducer() override; + explicit DeepDoubleXTFJetTagsProducer(const edm::ParameterSet&, const DeepDoubleXTFCache*); + ~DeepDoubleXTFJetTagsProducer() override; static void fillDescriptions(edm::ConfigurationDescriptions&); - static std::unique_ptr initializeGlobalCache(const edm::ParameterSet&); - static void globalEndJob(const DeepDoubleBTFCache*); + static std::unique_ptr initializeGlobalCache(const edm::ParameterSet&); + static void globalEndJob(const DeepDoubleXTFCache*); enum InputIndexes { kGlobal = 0, @@ -55,7 +55,7 @@ class DeepDoubleBTFJetTagsProducer : public edm::stream::EDProducer TagInfoCollection; + typedef std::vector TagInfoCollection; typedef reco::JetTagCollection JetTagCollection; void beginStream(edm::StreamID) override {} @@ -76,8 +76,8 @@ class DeepDoubleBTFJetTagsProducer : public edm::stream::EDProducer(iConfig.getParameter("src"))), input_names_(iConfig.getParameter>("input_names")), output_names_(iConfig.getParameter>("output_names")), @@ -116,7 +116,7 @@ DeepDoubleBTFJetTagsProducer::DeepDoubleBTFJetTagsProducer(const edm::ParameterS } } -DeepDoubleBTFJetTagsProducer::~DeepDoubleBTFJetTagsProducer() +DeepDoubleXTFJetTagsProducer::~DeepDoubleXTFJetTagsProducer() { // close and delete the session if (session_ != nullptr) { @@ -124,36 +124,78 @@ DeepDoubleBTFJetTagsProducer::~DeepDoubleBTFJetTagsProducer() } } -void DeepDoubleBTFJetTagsProducer::fillDescriptions(edm::ConfigurationDescriptions& descriptions) +void DeepDoubleXTFJetTagsProducer::fillDescriptions(edm::ConfigurationDescriptions& descriptions) { - // pfDeepDoubleBJetTags + // pfDeepDoubleBvLJetTags edm::ParameterSetDescription desc; - desc.add("src", edm::InputTag("pfDeepDoubleBTagInfos")); desc.add>("input_names", { "input_1", "input_2", "input_3" }); - desc.add("graph_path", - edm::FileInPath("RecoBTag/Combined/data/DeepDoubleB/V01/constant_graph_PtCut_MassSculptPen.pb")); desc.add>("lp_names", { "db_input_batchnorm/keras_learning_phase" }); desc.add>("output_names", { "ID_pred/Softmax" }); - { - edm::ParameterSetDescription psd0; - psd0.add>("probQ", {0}); - psd0.add>("probH", {1}); - desc.add("flav_table", psd0); - } desc.add("batch_eval", false); desc.add("nThreads", 1); desc.add("singleThreadPool", "no_threads"); + + edm::ParameterSetDescription psB; + psB.add>("probQ", {0}); + psB.add>("probH", {1}); + + edm::ParameterSetDescription psBvL; + psBvL.add>("probQCD", {0}); + psBvL.add>("probHbb", {1}); + + edm::ParameterSetDescription psCvL; + psCvL.add>("probQCD", {0}); + psCvL.add>("probHcc", {1}); + + edm::ParameterSetDescription psCvB; + psCvB.add>("probHbb", {0}); + psCvB.add>("probHcc", {1}); + + using FIP = edm::FileInPath; + using PDFIP = edm::ParameterDescription; + using IT = edm::InputTag; + using PDIT = edm::ParameterDescription; + using PDPSD = edm::ParameterDescription; + using PDCases = edm::ParameterDescriptionCases; + auto flavorCases = [&](){ return + "B" >> (PDPSD("flav_table", psB , true) and + PDIT("src", IT("pfDeepDoubleXTagInfosNopt"), true) and + PDFIP("graph_path", FIP("RecoBTag/Combined/data/DeepDoubleB/V01/constant_graph_PtCut_MassSculptPen.pb"), true)) or + "BvL" >> (PDPSD("flav_table", psBvL, true) and + PDIT("src", IT("pfDeepDoubleXTagInfos"), true) and + PDFIP("graph_path", FIP("RecoBTag/Combined/data/DeepDoubleX/94X/V01/DDB.pb"), true)) or + "CvL" >> (PDPSD("flav_table", psCvL, true) and + PDIT("src", IT("pfDeepDoubleXTagInfos"), true) and + PDFIP("graph_path", FIP("RecoBTag/Combined/data/DeepDoubleX/94X/V01/DDC.pb"), true) ) or + "CvB" >> (PDPSD("flav_table", psCvB, true) and + PDIT("src", IT("pfDeepDoubleXTagInfos"), true) and + PDFIP("graph_path", FIP("RecoBTag/Combined/data/DeepDoubleX/94X/V01/DDCvB.pb"), true)); + }; + auto descB(desc); + descB.ifValue( edm::ParameterDescription("flavor", "B", true), flavorCases()); + descriptions.add("pfDeepDoubleBJetTags", descB); + + auto descBvL(desc); + descBvL.ifValue( edm::ParameterDescription("flavor", "BvL", true), flavorCases()); + descriptions.add("pfDeepDoubleBvLJetTags", descBvL); + + auto descCvL(desc); + descCvL.ifValue( edm::ParameterDescription("flavor", "CvL", true), flavorCases()); + descriptions.add("pfDeepDoubleCvLJetTags", descCvL); + + auto descCvB(desc); + descCvB.ifValue( edm::ParameterDescription("flavor", "CvB", true), flavorCases()); + descriptions.add("pfDeepDoubleCvBJetTags", descCvB); - descriptions.add("pfDeepDoubleBJetTags", desc); } -std::unique_ptr DeepDoubleBTFJetTagsProducer::initializeGlobalCache( +std::unique_ptr DeepDoubleXTFJetTagsProducer::initializeGlobalCache( const edm::ParameterSet& iConfig) { // set the tensorflow log level to error @@ -163,25 +205,25 @@ std::unique_ptr DeepDoubleBTFJetTagsProducer::initializeGlob std::string pbFile = iConfig.getParameter("graph_path").fullPath(); // load the graph def and save it in the cache - DeepDoubleBTFCache* cache = new DeepDoubleBTFCache(); + DeepDoubleXTFCache* cache = new DeepDoubleXTFCache(); cache->graphDef = tensorflow::loadGraphDef(pbFile); - return std::unique_ptr(cache); + return std::unique_ptr(cache); } -void DeepDoubleBTFJetTagsProducer::globalEndJob(const DeepDoubleBTFCache* cache) +void DeepDoubleXTFJetTagsProducer::globalEndJob(const DeepDoubleXTFCache* cache) { if (cache->graphDef != nullptr) { delete cache->graphDef; } } -void DeepDoubleBTFJetTagsProducer::produce(edm::Event& iEvent, const edm::EventSetup& iSetup) +void DeepDoubleXTFJetTagsProducer::produce(edm::Event& iEvent, const edm::EventSetup& iSetup) { - + edm::Handle tag_infos; iEvent.getByToken(src_, tag_infos); - + // initialize output collection std::vector> output_tags; for (std::size_t i=0; i < flav_pairs_.size(); i++) { @@ -193,12 +235,18 @@ void DeepDoubleBTFJetTagsProducer::produce(edm::Event& iEvent, const edm::EventS output_tags.emplace_back(std::make_unique()); } } - - const int64_t n_jets = tag_infos->size(); + + // count jets to actually run inference on + int64_t n_jets = 0; + for (std::size_t i=0; i < tag_infos->size(); i++){ + const auto & features = tag_infos->at(i).features(); + if (!features.empty()) n_jets += 1 ; + } + // count all jets to generate output_tags for each and set to default (-1) + const int64_t n_jets_all = tag_infos->size(); // either all jets or one per batch for the time being - const int64_t n_batch_jets = batch_eval_ ? n_jets : 1; + const int64_t n_batch_jets = batch_eval_ ? n_jets_all : 1; - std::vector input_sizes { {n_batch_jets, 1, 27}, // input_1 - global double-b features {n_batch_jets, 60, 8}, // input_2 - charged pf @@ -221,26 +269,28 @@ void DeepDoubleBTFJetTagsProducer::produce(edm::Event& iEvent, const edm::EventS for (std::size_t i=0; i < lp_tensors_.size(); i++) { input_tensors[input_sizes.size() + i] = tensorflow::NamedTensor(lp_names_[i], lp_tensors_[i]); } - - std::size_t n_batches = n_jets/n_batch_jets; // either 1 or n_jets + + std::size_t n_batches = n_jets_all/n_batch_jets; // either 1 or n_jets for (std::size_t batch_n=0; batch_n < n_batches; batch_n++) { - // tensors have to be zeroed before filling per batch for (std::size_t i=0; i < input_sizes.size(); i++) { input_tensors[i].second.flat().setZero(); } - + // don't run batch unless filled + bool run_this_batch = false; // fill values of the input tensors for (std::size_t jet_bn=0; jet_bn < (std::size_t) n_batch_jets; jet_bn++) { // global jet index (jet_bn is the jet batch index) std::size_t jet_n = batch_n*n_batch_jets + jet_bn; - - // jet and other global features + // only fill if features not empty const auto & features = tag_infos->at(jet_n).features(); + if (features.empty()) continue ; + // if at least one jet has features, run inferences + run_this_batch = true; + // jet and other global features db_tensor_filler(input_tensors.at(kGlobal).second, jet_bn, features); - // c_pf candidates auto max_c_pf_n = std::min(features.c_pf_features.size(), (std::size_t) input_sizes.at(kChargedCandidates).dim_size(1)); @@ -262,31 +312,36 @@ void DeepDoubleBTFJetTagsProducer::produce(edm::Event& iEvent, const edm::EventS } // run the session std::vector outputs; + if (run_this_batch){ tensorflow::run(session_, input_tensors, output_names_, &outputs); - + } // set output values for flavour probs for (std::size_t jet_bn=0; jet_bn < (std::size_t) n_batch_jets; jet_bn++) { // global jet index (jet_bn is the jet batch index) std::size_t jet_n = batch_n*n_batch_jets + jet_bn; + const auto & features = tag_infos->at(jet_n).features(); const auto & jet_ref = tag_infos->at(jet_n).jet(); for (std::size_t flav_n=0; flav_n < flav_pairs_.size(); flav_n++) { const auto & flav_pair = flav_pairs_.at(flav_n); float o_sum = 0.; - for (const unsigned int & ind : flav_pair.second) { - o_sum += outputs.at(kJetFlavour).matrix()(jet_bn, ind); + if (!features.empty()) { + for (const unsigned int & ind : flav_pair.second) { + o_sum += outputs.at(kJetFlavour).matrix()(jet_bn, ind); + } + (*(output_tags.at(flav_n)))[jet_ref] = o_sum; + } else { + (*(output_tags.at(flav_n)))[jet_ref] = -1.; } - (*(output_tags.at(flav_n)))[jet_ref] = o_sum; } - } + } } for (std::size_t i=0; i < flav_pairs_.size(); i++) { iEvent.put(std::move(output_tags[i]), flav_pairs_.at(i).first); } - } //define this as a plug-in -DEFINE_FWK_MODULE(DeepDoubleBTFJetTagsProducer); +DEFINE_FWK_MODULE(DeepDoubleXTFJetTagsProducer); diff --git a/RecoBTag/TensorFlow/python/pfDeepDoubleX_cff.py b/RecoBTag/TensorFlow/python/pfDeepDoubleX_cff.py new file mode 100644 index 0000000000000..15dd3735092d0 --- /dev/null +++ b/RecoBTag/TensorFlow/python/pfDeepDoubleX_cff.py @@ -0,0 +1,7 @@ +from RecoBTag.TensorFlow.pfDeepDoubleBJetTags_cfi import pfDeepDoubleBJetTags +from RecoBTag.TensorFlow.pfDeepDoubleBvLJetTags_cfi import pfDeepDoubleBvLJetTags +from RecoBTag.TensorFlow.pfDeepDoubleCvBJetTags_cfi import pfDeepDoubleCvBJetTags +from RecoBTag.TensorFlow.pfDeepDoubleCvLJetTags_cfi import pfDeepDoubleCvLJetTags + +from RecoBTag.TensorFlow.pfMassIndependentDeepDoubleXJetTags_cff import * + diff --git a/RecoBTag/TensorFlow/python/pfDeepFlavour_cff.py b/RecoBTag/TensorFlow/python/pfDeepFlavour_cff.py index 9f41d24a4d3cd..565a8103f841b 100644 --- a/RecoBTag/TensorFlow/python/pfDeepFlavour_cff.py +++ b/RecoBTag/TensorFlow/python/pfDeepFlavour_cff.py @@ -2,12 +2,11 @@ from RecoBTag.FeatureTools.pfDeepFlavourTagInfos_cfi import pfDeepFlavourTagInfos from RecoBTag.FeatureTools.pfNegativeDeepFlavourTagInfos_cfi import pfNegativeDeepFlavourTagInfos -from RecoBTag.FeatureTools.pfDeepDoubleBTagInfos_cfi import pfDeepDoubleBTagInfos +from RecoBTag.FeatureTools.pfDeepDoubleXTagInfos_cfi import pfDeepDoubleXTagInfos +from RecoBTag.FeatureTools.pfDeepDoubleXTagInfosNopt_cfi import pfDeepDoubleXTagInfosNopt from RecoBTag.TensorFlow.pfDeepFlavourJetTags_cfi import pfDeepFlavourJetTags from RecoBTag.TensorFlow.pfNegativeDeepFlavourJetTags_cfi import pfNegativeDeepFlavourJetTags -from RecoBTag.TensorFlow.pfDeepDoubleBJetTags_cfi import pfDeepDoubleBJetTags - from CommonTools.PileupAlgos.Puppi_cff import puppi from PhysicsTools.PatAlgos.slimming.primaryVertexAssociation_cfi import primaryVertexAssociation diff --git a/RecoBTag/TensorFlow/python/pfMassIndependentDeepDoubleXJetTags_cff.py b/RecoBTag/TensorFlow/python/pfMassIndependentDeepDoubleXJetTags_cff.py new file mode 100644 index 0000000000000..9e7780140b8b0 --- /dev/null +++ b/RecoBTag/TensorFlow/python/pfMassIndependentDeepDoubleXJetTags_cff.py @@ -0,0 +1,13 @@ +import FWCore.ParameterSet.Config as cms +from pfDeepDoubleBvLJetTags_cfi import pfDeepDoubleBvLJetTags +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') +pfMassIndependentDeepDoubleCvLJetTags = pfDeepDoubleCvLJetTags.clone( + graph_path = 'RecoBTag/Combined/data/DeepDoubleX/94X/V01/DDC_mass_independent.pb') +pfMassIndependentDeepDoubleCvBJetTags = pfDeepDoubleCvBJetTags.clone( + graph_path = 'RecoBTag/Combined/data/DeepDoubleX/94X/V01/DDCvB_mass_independent.pb') + + diff --git a/RecoBTag/TensorFlow/src/tensor_fillers.cc b/RecoBTag/TensorFlow/src/tensor_fillers.cc index 524f9b880edd3..35629465b8d6e 100644 --- a/RecoBTag/TensorFlow/src/tensor_fillers.cc +++ b/RecoBTag/TensorFlow/src/tensor_fillers.cc @@ -40,7 +40,7 @@ namespace btagbtvdeep { void db_tensor_filler(tensorflow::Tensor & tensor, std::size_t jet_n, - const btagbtvdeep::DeepDoubleBFeatures & features) { + const btagbtvdeep::DeepDoubleXFeatures & features) { float* ptr = &tensor.tensor()(jet_n, 0, 0); diff --git a/RecoBTag/TensorFlow/test/plotDDX.py b/RecoBTag/TensorFlow/test/plotDDX.py new file mode 100644 index 0000000000000..f495e51e8d2d3 --- /dev/null +++ b/RecoBTag/TensorFlow/test/plotDDX.py @@ -0,0 +1,50 @@ +from __future__ import print_function +import ROOT +from DataFormats.FWLite import Handle, Events + +events_c = Events('output_test_DDX.root') + +handleJ = Handle ("std::vector") +labelJ = ("selectedUpdatedPatJets","","PATtest") + +h_probQ_ddb = ROOT.TH1F('h_probQ_ddb', ';prob Q;', 40, 0., 1.) +h_probH_ddb = ROOT.TH1F('h_probH_ddb', ';prob H;', 40, 0., 1.) + +h_probQ_ddc = ROOT.TH1F('h_probQ_ddc', ';prob Q;', 40, 0., 1.) +h_probH_ddc = ROOT.TH1F('h_probH_ddc', ';prob H;', 40, 0., 1.) + +for iev,event in enumerate(events_c): + 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 + + print(jet.pt(), jet.mass()) + print("DDBold", jet.bDiscriminator("pfDeepDoubleBJetTags:probQ"), jet.bDiscriminator("pfDeepDoubleBJetTags:probH")) + print("DDB", jet.bDiscriminator("pfDeepDoubleBvLJetTags:probQCD"), jet.bDiscriminator("pfDeepDoubleBvLJetTags: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("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")) + +c1a = ROOT.TCanvas() +h_probH_ddb.Draw("HISTO") +h_probH_ddb.SetLineColor(632) +h_probH_ddb.SetLineStyle(10) +h_probQ_ddb.Draw("SAME") +c1a.Draw() +c1a.SaveAs("ProbQ_vc_vb.png") + +c1b = ROOT.TCanvas() +h_probH_ddc.Draw("HISTO") +h_probH_ddc.SetLineColor(632) +h_probH_ddc.SetLineStyle(10) +h_probQ_ddc.Draw("SAME") +c1b.Draw() +c1b.SaveAs("ProbH_vc_vb.png") diff --git a/RecoBTag/TensorFlow/test/test_deep_doubleb_cfg_AOD.py b/RecoBTag/TensorFlow/test/test_deep_doubleb_cfg_AOD.py index 12c563e89160e..e07c4d6c89fa4 100644 --- a/RecoBTag/TensorFlow/test/test_deep_doubleb_cfg_AOD.py +++ b/RecoBTag/TensorFlow/test/test_deep_doubleb_cfg_AOD.py @@ -110,7 +110,7 @@ process.out.outputCommands.append('keep *_selectedPatJets*_*_*') process.out.outputCommands.append('keep *_selectedUpdatedPatJets*_*_*') process.out.outputCommands.append('keep *_pfBoostedDoubleSVAK8TagInfos*_*_*') -process.out.outputCommands.append('keep *_pfDeepDoubleBTagInfos*_*_*') +process.out.outputCommands.append('keep *_pfDeepDoubleXTagInfos*_*_*') process.out.outputCommands.append('keep *_updatedPatJets*_*_*') print process.out.outputCommands diff --git a/RecoBTag/TensorFlow/test/test_deep_doubleb_cfg.py b/RecoBTag/TensorFlow/test/test_deep_doublex_cfg.py similarity index 61% rename from RecoBTag/TensorFlow/test/test_deep_doubleb_cfg.py rename to RecoBTag/TensorFlow/test/test_deep_doublex_cfg.py index 71e1ab3a61c3b..f7adcde3fe311 100644 --- a/RecoBTag/TensorFlow/test/test_deep_doubleb_cfg.py +++ b/RecoBTag/TensorFlow/test/test_deep_doublex_cfg.py @@ -49,27 +49,36 @@ pvSource = cms.InputTag('offlineSlimmedPrimaryVertices'), svSource = cms.InputTag('slimmedSecondaryVertices'), rParam = 0.8, - jetCorrections = ('AK8PFchs', cms.vstring(['L1FastJet', 'L2Relative', 'L3Absolute']), 'None'), + jetCorrections = ('AK8PFchs', cms.vstring(['L2Relative', 'L3Absolute']), 'None'), btagDiscriminators = [ 'pfBoostedDoubleSecondaryVertexAK8BJetTags', 'pfDeepDoubleBJetTags:probQ', - 'pfDeepDoubleBJetTags:probH', + 'pfDeepDoubleBJetTags:probH', + 'pfDeepDoubleBvLJetTags:probQCD', + 'pfDeepDoubleBvLJetTags:probHbb', + 'pfDeepDoubleCvLJetTags:probQCD', + 'pfDeepDoubleCvLJetTags:probHcc', + 'pfDeepDoubleCvBJetTags:probHbb', + 'pfDeepDoubleCvBJetTags:probHcc', + 'pfMassIndependentDeepDoubleBvLJetTags:probQCD', + 'pfMassIndependentDeepDoubleBvLJetTags:probHbb', + 'pfMassIndependentDeepDoubleCvLJetTags:probQCD', + 'pfMassIndependentDeepDoubleCvLJetTags:probHcc', + 'pfMassIndependentDeepDoubleCvBJetTags:probHbb', + 'pfMassIndependentDeepDoubleCvBJetTags:probHcc', ] ) from PhysicsTools.PatAlgos.patInputFiles_cff import filesRelValTTbarPileUpMINIAODSIM process.source.fileNames = filesRelValTTbarPileUpMINIAODSIM -#process.source.fileNames = cms.untracked.vstring('root://cmsxrootd.fnal.gov//store/mc/PhaseIFall16MiniAOD/TT_TuneCUETP8M2T4_13TeV-powheg-pythia8/MINIAODSIM/PhaseIFall16PUFlat20to50_PhaseIFall16_81X_upgrade2017_realistic_v26-v1/50000/08358A47-61E3-E611-8B77-001E677928AE.root') -#process.source.fileNames = cms.untracked.vstring('root://cmsxrootd.fnal.gov//store/mc/RunIISummer16MiniAODv2/BulkGravTohhTohbbhbb_narrow_M-2500_13TeV-madgraph/MINIAODSIM/PUMoriond17_80X_mcRun2_asymptotic_2016_TrancheIV_v6-v1/80000/0A83E4E2-34B6-E611-89A0-549F35AE4FA2.root', -# 'root://cmsxrootd.fnal.gov//store/mc/RunIISummer16MiniAODv2/BulkGravTohhTohbbhbb_narrow_M-2500_13TeV-madgraph/MINIAODSIM/PUMoriond17_80X_mcRun2_asymptotic_2016_TrancheIV_v6-v1/80000/A88400F5-39B6-E611-BEB3-A0369F7F9DE0.root') - -process.source.fileNames = cms.untracked.vstring('root://cmsxrootd.fnal.gov//store/relval/CMSSW_10_1_0_pre2/RelValTTbar_13/MINIAODSIM/100X_mcRun2_asymptotic_v2_FastSim-v1/20000/3E39F14C-0420-E811-B368-0025905A6068.root', - 'root://cmsxrootd.fnal.gov//store/relval/CMSSW_10_1_0_pre2/RelValTTbar_13/MINIAODSIM/100X_mcRun2_asymptotic_v2_FastSim-v1/20000/40C11C7A-0E1F-E811-8A3A-0025905A607E.root', - 'root://cmsxrootd.fnal.gov//store/relval/CMSSW_10_1_0_pre2/RelValTTbar_13/MINIAODSIM/100X_mcRun2_asymptotic_v2_FastSim-v1/20000/F297A748-B220-E811-B9DD-0CC47A4C8EA8.root') -#process.source.fileNames = cms.untracked.vstring('root://cmsxrootd.fnal.gov//store/relval/CMSSW_10_1_0_pre2/RelValQCD_FlatPt_15_3000_13/MINIAODSIM/100X_mcRun2_asymptotic_v2_FastSim-v1/20000/8C8833F5-D822-E811-8ED5-0CC47A4D76A2.root') - -process.maxEvents.input = -1 +process.source.fileNames = cms.untracked.vstring( +#'/store/relval/CMSSW_10_3_0_pre2/RelValTTbar_13/MINIAODSIM/PU25ns_103X_upgrade2018_realistic_v2-v1/20000/85820ACA-657B-BC44-AC74-AACD6D54B348.root' +#'/store/mc/RunIIFall17MiniAOD/GluGluHToBB_M125_13TeV_powheg_pythia8/MINIAODSIM/94X_mc2017_realistic_v10-v1/20000/C8932584-5006-E811-9840-141877410512.root', +'/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 = 100 from Configuration.EventContent.EventContent_cff import MINIAODSIMEventContent process.out.outputCommands.append('keep *_slimmedJetsAK8*_*_*') @@ -78,10 +87,10 @@ process.out.outputCommands.append('keep *_selectedPatJets*_*_*') process.out.outputCommands.append('keep *_selectedUpdatedPatJets*_*_*') process.out.outputCommands.append('keep *_pfBoostedDoubleSVAK8TagInfos*_*_*') -process.out.outputCommands.append('keep *_pfDeepDoubleBTagInfos*_*_*') +process.out.outputCommands.append('keep *_pfDeepDoubleXTagInfos*_*_*') process.out.outputCommands.append('keep *_updatedPatJets*_*_*') -process.out.fileName = 'test_deep_doubleb_MINIAODSIM.root' +process.out.fileName = 'output_test_DDX.root' # ## # process.options.wantSummary = False ## (to suppress the long output at the end of the job)