diff --git a/PhysicsTools/NanoAOD/plugins/GenJetFlavourTableProducer.cc b/PhysicsTools/NanoAOD/plugins/GenJetFlavourTableProducer.cc index c977ea22ec854..ed46d0a13f89e 100644 --- a/PhysicsTools/NanoAOD/plugins/GenJetFlavourTableProducer.cc +++ b/PhysicsTools/NanoAOD/plugins/GenJetFlavourTableProducer.cc @@ -63,6 +63,8 @@ void GenJetFlavourTableProducer::produce(edm::Event& iEvent, const edm::EventSet unsigned int ncand = 0; std::vector partonFlavour; std::vector hadronFlavour; + std::vector nBHadrons; + std::vector nCHadrons; for (const reco::GenJet& jet : jetsProd) { if (!cut_(jet)) @@ -73,6 +75,8 @@ void GenJetFlavourTableProducer::produce(edm::Event& iEvent, const edm::EventSet if (deltaR(jet.p4(), jetFlavourInfoMatching.first->p4()) < deltaR_) { partonFlavour.push_back(jetFlavourInfoMatching.second.getPartonFlavour()); hadronFlavour.push_back(jetFlavourInfoMatching.second.getHadronFlavour()); + nBHadrons.push_back(jetFlavourInfoMatching.second.getbHadrons().size()); + nCHadrons.push_back(jetFlavourInfoMatching.second.getcHadrons().size()); matched = true; break; } @@ -80,12 +84,16 @@ void GenJetFlavourTableProducer::produce(edm::Event& iEvent, const edm::EventSet if (!matched) { partonFlavour.push_back(0); hadronFlavour.push_back(0); + nBHadrons.push_back(0); + nCHadrons.push_back(0); } } auto tab = std::make_unique(ncand, name_, false, true); tab->addColumn("partonFlavour", partonFlavour, "flavour from parton matching"); tab->addColumn("hadronFlavour", hadronFlavour, "flavour from hadron ghost clustering"); + tab->addColumn("nBHadrons", nBHadrons, "number of b-hadrons"); + tab->addColumn("nCHadrons", nCHadrons, "number of c-hadrons"); iEvent.put(std::move(tab)); } diff --git a/PhysicsTools/NanoAOD/python/jetMC_cff.py b/PhysicsTools/NanoAOD/python/jetMC_cff.py index 463569e1415a2..2c2cc3d1ac253 100644 --- a/PhysicsTools/NanoAOD/python/jetMC_cff.py +++ b/PhysicsTools/NanoAOD/python/jetMC_cff.py @@ -88,8 +88,6 @@ name = _fatJetTable.name, extension = cms.bool(True), variables = cms.PSet( - nBHadrons = Var("jetFlavourInfo().getbHadrons().size()", "uint8", doc="number of b-hadrons"), - nCHadrons = Var("jetFlavourInfo().getcHadrons().size()", "uint8", doc="number of c-hadrons"), hadronFlavour = Var("hadronFlavour()", "uint8", doc="flavour from hadron ghost clustering"), # cut should follow genJetAK8Table.cut genJetAK8Idx = Var("?genJetFwdRef().backRef().isNonnull() && genJetFwdRef().backRef().pt() > 100.?genJetFwdRef().backRef().key():-1", "int16", doc="index of matched gen AK8 jet"), diff --git a/PhysicsTools/NanoAOD/python/nanoDQM_cfi.py b/PhysicsTools/NanoAOD/python/nanoDQM_cfi.py index c05cfdbb989e4..75b641d0f81e9 100644 --- a/PhysicsTools/NanoAOD/python/nanoDQM_cfi.py +++ b/PhysicsTools/NanoAOD/python/nanoDQM_cfi.py @@ -223,8 +223,6 @@ Plot1D('muEF', 'muEF', 20, 0, 1, 'muon Energy Fraction'), Plot1D('neEmEF', 'neEmEF', 20, 0, 1, 'charged Electromagnetic EnergyFraction'), Plot1D('neHEF', 'neHEF', 20, 0, 1, 'neutral Hadron Energy Fraction'), - Plot1D('nBHadrons', 'nBHadrons', 4, -0.5, 3.5, 'number of b-hadrons'), - Plot1D('nCHadrons', 'nCHadrons', 4, -0.5, 3.5, 'number of c-hadrons'), Plot1D('particleNetMD_QCD', 'particleNetMD_QCD', 20, 0, 1, 'Mass-decorrelated ParticleNet tagger raw QCD score'), Plot1D('particleNetMD_Xbb', 'particleNetMD_Xbb', 20, 0, 1, 'Mass-decorrelated ParticleNet tagger raw X->bb score. For X->bb vs QCD tagging, use Xbb/(Xbb+QCD)'), Plot1D('particleNetMD_Xcc', 'particleNetMD_Xcc', 20, 0, 1, 'Mass-decorrelated ParticleNet tagger raw X->cc score. For X->cc vs QCD tagging, use Xcc/(Xcc+QCD)'), @@ -323,6 +321,8 @@ Plot1D('eta', 'eta', 20, -7, 7, 'eta'), Plot1D('hadronFlavour', 'hadronFlavour', 6, -0.5, 5.5, 'flavour from hadron ghost clustering'), Plot1D('mass', 'mass', 20, 0, 200, 'mass'), + Plot1D('nBHadrons', 'nBHadrons', 4, -0.5, 3.5, 'number of b-hadrons'), + Plot1D('nCHadrons', 'nCHadrons', 4, -0.5, 3.5, 'number of c-hadrons'), Plot1D('partonFlavour', 'partonFlavour', 40, -9.5, 30.5, 'flavour from parton matching'), Plot1D('phi', 'phi', 20, -3.14159, 3.14159, 'phi'), Plot1D('pt', 'pt', 20, 0, 200, 'pt'), @@ -335,6 +335,8 @@ Plot1D('eta', 'eta', 20, -7, 7, 'eta'), Plot1D('hadronFlavour', 'hadronFlavour', 6, -0.5, 5.5, 'flavour from hadron ghost clustering'), Plot1D('mass', 'mass', 20, 0, 200, 'mass'), + Plot1D('nBHadrons', 'nBHadrons', 4, -0.5, 3.5, 'number of b-hadrons'), + Plot1D('nCHadrons', 'nCHadrons', 4, -0.5, 3.5, 'number of c-hadrons'), Plot1D('partonFlavour', 'partonFlavour', 40, -9.5, 30.5, 'flavour from parton matching'), Plot1D('phi', 'phi', 20, -3.14159, 3.14159, 'phi'), Plot1D('pt', 'pt', 20, 0, 200, 'pt'),