diff --git a/CommonTools/PileupAlgos/plugins/PuppiProducer.cc b/CommonTools/PileupAlgos/plugins/PuppiProducer.cc index 045842aec1dcf..c96e687a3b556 100644 --- a/CommonTools/PileupAlgos/plugins/PuppiProducer.cc +++ b/CommonTools/PileupAlgos/plugins/PuppiProducer.cc @@ -41,21 +41,22 @@ PuppiProducer::PuppiProducer(const edm::ParameterSet& iConfig) { tokenPFCandidates_ = consumes(iConfig.getParameter("candName")); tokenVertices_ = consumes(iConfig.getParameter("vertexName")); - produces>(); - produces>(); - produces>(); + ptokenPupOut_ = produces>(); + ptokenP4PupOut_ = produces>(); + ptokenValues_ = produces>(); if (fUseExistingWeights || fClonePackedCands) - produces(); - else - produces(); + ptokenPackedPuppiCandidates_ = produces(); + else { + ptokenPuppiCandidates_ = produces(); + } if (fPuppiDiagnostics) { - produces("PuppiNAlgos"); - produces>("PuppiRawAlphas"); - produces>("PuppiAlphas"); - produces>("PuppiAlphasMed"); - produces>("PuppiAlphasRms"); + ptokenNalgos_ = produces("PuppiNAlgos"); + ptokenRawAlphas_ = produces>("PuppiRawAlphas"); + ptokenAlphas_ = produces>("PuppiAlphas"); + ptokenAlphasMed_ = produces>("PuppiAlphasMed"); + ptokenAlphasRms_ = produces>("PuppiAlphasRms"); } } // ------------------------------------------------------------------------------------------ @@ -238,8 +239,8 @@ void PuppiProducer::produce(edm::Event& iEvent, const edm::EventSetup& iSetup) { } //Fill it into the event - std::unique_ptr> lPupOut(new edm::ValueMap()); - edm::ValueMap::Filler lPupFiller(*lPupOut); + edm::ValueMap lPupOut; + edm::ValueMap::Filler lPupFiller(lPupOut); lPupFiller.insert(hPFProduct, lWeights.begin(), lWeights.end()); lPupFiller.fill(); @@ -252,9 +253,10 @@ void PuppiProducer::produce(edm::Event& iEvent, const edm::EventSetup& iSetup) { // Since the size of the ValueMap must be equal to the input collection, we need // to search the "puppi" particles to find a match for each input. If none is found, // the input is set to have a four-vector of 0,0,0,0 - fPuppiCandidates.reset(new PFOutputCollection); - fPackedPuppiCandidates.reset(new PackedOutputCollection); - std::unique_ptr> p4PupOut(new edm::ValueMap()); + PFOutputCollection fPuppiCandidates; + PackedOutputCollection fPackedPuppiCandidates; + + edm::ValueMap p4PupOut; LorentzVectorCollection puppiP4s; std::vector values(hPFProduct->size()); @@ -263,6 +265,7 @@ void PuppiProducer::produce(edm::Event& iEvent, const edm::EventSetup& iSetup) { ++iCand; std::unique_ptr pCand; std::unique_ptr pfCand; + if (fUseExistingWeights || fClonePackedCands) { const pat::PackedCandidate* cand = dynamic_cast(&aCand); if (!cand) @@ -274,6 +277,7 @@ void PuppiProducer::produce(edm::Event& iEvent, const edm::EventSetup& iSetup) { pfCand.reset(new reco::PFCandidate(cand ? *cand : reco::PFCandidate(aCand.charge(), aCand.p4(), id))); } + // Here, we are using new weights computed and putting them in the packed candidates. if (fClonePackedCands && (!fUseExistingWeights)) { if (fPuppiForLeptons) pCand->setPuppiWeight(pCand->puppiWeight(), lWeights[iCand]); @@ -286,58 +290,62 @@ void PuppiProducer::produce(edm::Event& iEvent, const edm::EventSetup& iSetup) { lWeights[iCand] * aCand.pz(), lWeights[iCand] * aCand.energy()); + // Here, we are using existing weights, or we're using packed candidates. + // That is, whether or not we recomputed the weights, we store the + // source candidate appropriately, and set the p4 of the packed candidate. if (fUseExistingWeights || fClonePackedCands) { pCand->setP4(puppiP4s.back()); pCand->setSourceCandidatePtr(aCand.sourceCandidatePtr(0)); - fPackedPuppiCandidates->push_back(*pCand); + fPackedPuppiCandidates.push_back(*pCand); } else { pfCand->setP4(puppiP4s.back()); pfCand->setSourceCandidatePtr(aCand.sourceCandidatePtr(0)); - fPuppiCandidates->push_back(*pfCand); + fPuppiCandidates.push_back(*pfCand); } } //Compute the modified p4s - edm::ValueMap::Filler p4PupFiller(*p4PupOut); + edm::ValueMap::Filler p4PupFiller(p4PupOut); p4PupFiller.insert(hPFProduct, puppiP4s.begin(), puppiP4s.end()); p4PupFiller.fill(); - iEvent.put(std::move(lPupOut)); - iEvent.put(std::move(p4PupOut)); + iEvent.emplace(ptokenPupOut_, lPupOut); + iEvent.emplace(ptokenP4PupOut_, p4PupOut); if (fUseExistingWeights || fClonePackedCands) { - edm::OrphanHandle oh = iEvent.put(std::move(fPackedPuppiCandidates)); + edm::OrphanHandle oh = + iEvent.emplace(ptokenPackedPuppiCandidates_, fPackedPuppiCandidates); for (unsigned int ic = 0, nc = oh->size(); ic < nc; ++ic) { reco::CandidatePtr pkref(oh, ic); values[ic] = pkref; } } else { - edm::OrphanHandle oh = iEvent.put(std::move(fPuppiCandidates)); + edm::OrphanHandle oh = iEvent.emplace(ptokenPuppiCandidates_, fPuppiCandidates); for (unsigned int ic = 0, nc = oh->size(); ic < nc; ++ic) { reco::CandidatePtr pkref(oh, ic); values[ic] = pkref; } } - std::unique_ptr> pfMap_p(new edm::ValueMap()); - edm::ValueMap::Filler filler(*pfMap_p); + edm::ValueMap pfMap_p; + edm::ValueMap::Filler filler(pfMap_p); filler.insert(hPFProduct, values.begin(), values.end()); filler.fill(); - iEvent.put(std::move(pfMap_p)); + iEvent.emplace(ptokenValues_, pfMap_p); ////////////////////////////////////////////// if (fPuppiDiagnostics && !fUseExistingWeights) { // all the different alphas per particle // THE alpha per particle - std::unique_ptr> theAlphas(new std::vector(fPuppiContainer->puppiAlphas())); - std::unique_ptr> theAlphasMed(new std::vector(fPuppiContainer->puppiAlphasMed())); - std::unique_ptr> theAlphasRms(new std::vector(fPuppiContainer->puppiAlphasRMS())); - std::unique_ptr> alphas(new std::vector(fPuppiContainer->puppiRawAlphas())); - std::unique_ptr nalgos(new double(fPuppiContainer->puppiNAlgos())); + std::vector theAlphas(fPuppiContainer->puppiAlphas()); + std::vector theAlphasMed(fPuppiContainer->puppiAlphasMed()); + std::vector theAlphasRms(fPuppiContainer->puppiAlphasRMS()); + std::vector alphas(fPuppiContainer->puppiRawAlphas()); + double nalgos(fPuppiContainer->puppiNAlgos()); - iEvent.put(std::move(alphas), "PuppiRawAlphas"); - iEvent.put(std::move(nalgos), "PuppiNAlgos"); - iEvent.put(std::move(theAlphas), "PuppiAlphas"); - iEvent.put(std::move(theAlphasMed), "PuppiAlphasMed"); - iEvent.put(std::move(theAlphasRms), "PuppiAlphasRms"); + iEvent.emplace(ptokenRawAlphas_, alphas); + iEvent.emplace(ptokenNalgos_, nalgos); + iEvent.emplace(ptokenAlphas_, theAlphas); + iEvent.emplace(ptokenAlphasMed_, theAlphasMed); + iEvent.emplace(ptokenAlphasRms_, theAlphasRms); } } diff --git a/CommonTools/PileupAlgos/plugins/PuppiProducer.h b/CommonTools/PileupAlgos/plugins/PuppiProducer.h index 71380f3e90706..5f4c39425aa59 100644 --- a/CommonTools/PileupAlgos/plugins/PuppiProducer.h +++ b/CommonTools/PileupAlgos/plugins/PuppiProducer.h @@ -42,6 +42,19 @@ class PuppiProducer : public edm::stream::EDProducer<> { edm::EDGetTokenT tokenPFCandidates_; edm::EDGetTokenT tokenVertices_; + edm::EDGetTokenT tokenPuppiContainer_; + edm::EDGetTokenT tokenPuppiCandidates_; + edm::EDGetTokenT tokenPackedPuppiCandidates_; + edm::EDPutTokenT> ptokenPupOut_; + edm::EDPutTokenT> ptokenP4PupOut_; + edm::EDPutTokenT> ptokenValues_; + edm::EDPutTokenT ptokenPackedPuppiCandidates_; + edm::EDPutTokenT ptokenPuppiCandidates_; + edm::EDPutTokenT ptokenNalgos_; + edm::EDPutTokenT> ptokenRawAlphas_; + edm::EDPutTokenT> ptokenAlphas_; + edm::EDPutTokenT> ptokenAlphasMed_; + edm::EDPutTokenT> ptokenAlphasRms_; std::string fPuppiName; std::string fPFName; std::string fPVName; @@ -61,7 +74,5 @@ class PuppiProducer : public edm::stream::EDProducer<> { double fVtxZCut; std::unique_ptr fPuppiContainer; std::vector fRecoObjCollection; - std::unique_ptr fPuppiCandidates; - std::unique_ptr fPackedPuppiCandidates; }; #endif diff --git a/DQM/Physics/python/B2GDQM_cfi.py b/DQM/Physics/python/B2GDQM_cfi.py index 8c4b4564d25f6..3bdcc3b46523a 100755 --- a/DQM/Physics/python/B2GDQM_cfi.py +++ b/DQM/Physics/python/B2GDQM_cfi.py @@ -13,10 +13,9 @@ jetLabels = cms.VInputTag( 'ak4PFJets', - 'ak4PFJetsCHS', - 'ak8PFJetsCHS', - 'ak8PFJetsCHSSoftDrop', - 'cmsTopTagPFJetsCHS' + 'ak4PFJetsPuppi', + 'ak8PFJetsPuppi', + 'ak8PFJetsPuppiSoftDrop' ), jetPtMins = cms.vdouble( 50., @@ -27,11 +26,11 @@ ), pfMETCollection = cms.InputTag("pfMet"), - cmsTagLabel = cms.InputTag("cmsTopTagPFJetsCHS"), + sdjetLabel = cms.InputTag("ak8PFJetsPuppiSoftDrop"), muonSrc = cms.InputTag("muons"), electronSrc = cms.InputTag("gedGsfElectrons"), - allHadPtCut = cms.double(400.0), + allHadPtCut = cms.double(380.0), # Edit in 2019: Lower pt cut slightly because this now selects groomed jet pt allHadRapidityCut = cms.double(1.0), allHadDeltaPhiCut = cms.double( pi / 2.0), diff --git a/DQM/Physics/python/ExoticaDQM_cfi.py b/DQM/Physics/python/ExoticaDQM_cfi.py index abdc16355f51a..1978b7873ba5c 100644 --- a/DQM/Physics/python/ExoticaDQM_cfi.py +++ b/DQM/Physics/python/ExoticaDQM_cfi.py @@ -19,7 +19,7 @@ pfJetCollection = cms.InputTag('ak4PFJetsCHS'), jetCorrector = cms.InputTag('ak4PFL1FastL2L3Corrector'), - DiJetPFJetCollection = cms.VInputTag('ak4PFJetsCHS','ak8PFJetsCHS'), + DiJetPFJetCollection = cms.VInputTag('ak4PFJetsCHS','ak8PFJetsPuppi'), caloMETCollection = cms.InputTag("caloMetM"), pfMETCollection = cms.InputTag("pfMet"), diff --git a/DQM/Physics/src/B2GDQM.cc b/DQM/Physics/src/B2GDQM.cc index a30b29ffa9aaa..1b83fb5c6223c 100644 --- a/DQM/Physics/src/B2GDQM.cc +++ b/DQM/Physics/src/B2GDQM.cc @@ -55,10 +55,6 @@ // JetCorrection #include "JetMETCorrections/Objects/interface/JetCorrector.h" -// Substructure -#include "RecoJets/JetAlgorithms/interface/CATopJetHelper.h" -#include "DataFormats/BTauReco/interface/CATopJetTagInfo.h" - // ROOT #include "TLorentzVector.h" @@ -96,8 +92,8 @@ B2GDQM::B2GDQM(const edm::ParameterSet& ps) { ++jetlabel) { jetTokens_.push_back(consumes >(*jetlabel)); } - cmsTagLabel_ = ps.getParameter("cmsTagLabel"); - cmsTagToken_ = consumes >(cmsTagLabel_); + sdjetLabel_ = ps.getParameter("sdjetLabel"); + sdjetToken_ = consumes >(sdjetLabel_); muonToken_ = consumes >(ps.getParameter("muonSrc")); electronToken_ = consumes >(ps.getParameter("electronSrc")); @@ -168,8 +164,7 @@ void B2GDQM::bookHistograms(DQMStore::IBooker& bei, edm::Run const&, edm::EventS boostedJet_subjetM.push_back(bei.book1D("boostedJet_subjetM", "Mass of subjets (GeV)", 50, 0.0, 250.)); boostedJet_subjetN.push_back(bei.book1D("boostedJet_subjetN", "Number of subjets", 10, 0, 10)); boostedJet_massDrop.push_back(bei.book1D("boostedJet_massDrop", "Mass drop for W-like jets", 50, 0.0, 1.0)); - boostedJet_minMass.push_back( - bei.book1D("boostedJet_minMass", "Minimum Mass Pairing for top-like jets", 50, 0.0, 250.0)); + boostedJet_wMass.push_back(bei.book1D("boostedJet_wMass", "W Mass for top-like jets", 50, 0.0, 250.0)); } bei.setCurrentFolder("Physics/B2G/MET"); @@ -191,8 +186,8 @@ void B2GDQM::bookHistograms(DQMStore::IBooker& bei, edm::Run const&, edm::EventS "semiMu_hadJetPhi", "#phi of Leading Hadronic Jet in #mu+Jets Channel (radians)", 60, -3.14159, 3.14159); semiMu_hadJetMass = bei.book1D("semiMu_hadJetMass", "Mass of Leading Hadronic Jet in #mu+Jets Channel (GeV)", 50, 0.0, 500); - semiMu_hadJetMinMass = bei.book1D( - "semiMu_hadJetminMass", "Minimum Mass Pairing for Leading Hadronic Jet in #mu+Jets Channel (GeV)", 50, 0.0, 250.0); + semiMu_hadJetWMass = + bei.book1D("semiMu_hadJetwMass", "W Mass for Leading Hadronic Jet in #mu+Jets Channel (GeV)", 50, 0.0, 250.0); semiMu_mttbar = bei.book1D("semiMu_mttbar", "Mass of #mu+Jets ttbar Candidate", 100, 0., 5000.); //--- E+Jets @@ -209,8 +204,8 @@ void B2GDQM::bookHistograms(DQMStore::IBooker& bei, edm::Run const&, edm::EventS bei.book1D("semiE_hadJetPhi", "#phi of Leading Hadronic Jet in e+Jets Channel (radians)", 60, -3.14159, 3.14159); semiE_hadJetMass = bei.book1D("semiE_hadJetMass", "Mass of Leading Hadronic Jet in e+Jets Channel (GeV)", 50, 0.0, 500); - semiE_hadJetMinMass = bei.book1D( - "semiE_hadJetminMass", "Minimum Mass Pairing for Leading Hadronic Jet in e+Jets Channel (GeV)", 50, 0.0, 250.0); + semiE_hadJetWMass = + bei.book1D("semiE_hadJetwMass", "W Mass for Leading Hadronic Jet in e+Jets Channel (GeV)", 50, 0.0, 250.0); semiE_mttbar = bei.book1D("semiE_mttbar", "Mass of e+Jets ttbar Candidate", 100, 0., 5000.); //--- All-hadronic @@ -219,14 +214,12 @@ void B2GDQM::bookHistograms(DQMStore::IBooker& bei, edm::Run const&, edm::EventS allHad_y0 = bei.book1D("allHad_y0", "Rapidity of Leading All-Hadronic PFJet", 60, -6.0, 6.0); allHad_phi0 = bei.book1D("allHad_phi0", "#phi of Leading All-Hadronic PFJet (radians)", 60, -3.14159, 3.14159); allHad_mass0 = bei.book1D("allHad_mass0", "Mass of Leading All-Hadronic PFJet (GeV)", 50, 0.0, 500); - allHad_minMass0 = - bei.book1D("allHad_minMass0", "Minimum Mass Pairing for Leading All-Hadronic PFJet (GeV)", 50, 0.0, 250.0); + allHad_wMass0 = bei.book1D("allHad_wMass0", "W Mass for Leading All-Hadronic PFJet (GeV)", 50, 0.0, 250.0); allHad_pt1 = bei.book1D("allHad_pt1", "Pt of Subleading All-Hadronic PFJet (GeV)", 50, 0.0, 1000); allHad_y1 = bei.book1D("allHad_y1", "Rapidity of Subleading All-Hadronic PFJet", 60, -6.0, 6.0); allHad_phi1 = bei.book1D("allHad_phi1", "#phi of Subleading All-Hadronic PFJet (radians)", 60, -3.14159, 3.14159); allHad_mass1 = bei.book1D("allHad_mass1", "Mass of Subleading All-Hadronic PFJet (GeV)", 50, 0.0, 500); - allHad_minMass1 = - bei.book1D("allHad_minMass1", "Minimum Mass Pairing for Subleading All-Hadronic PFJet (GeV)", 50, 0.0, 250.0); + allHad_wMass1 = bei.book1D("allHad_wMass1", "W Mass for Subleading All-Hadronic PFJet (GeV)", 50, 0.0, 250.0); allHad_mttbar = bei.book1D("allHad_mttbar", "Mass of All-Hadronic ttbar Candidate", 100, 0., 5000.); } @@ -292,33 +285,23 @@ void B2GDQM::analyzeJets(const Event& iEvent, const edm::EventSetup& iSetup) { boostedJet_subjetM[icoll]->Fill(subjet->mass()); } // Check the various tagging algorithms - - // For top-tagging, check the minimum mass pairing - if (jetLabels_[icoll].label() == "cmsTopTagPFJetsCHS") { - CATopJetHelper helper(173., 80.4); - reco::CATopJetProperties properties = helper(*basicjet); - if (jet->numberOfDaughters() > 2) { - boostedJet_minMass[icoll]->Fill(properties.minMass); - } else { - boostedJet_minMass[icoll]->Fill(-1.0); - } - - // For W-tagging, check the mass drop - } else if ((jetLabels_[icoll].label() == "ak8PFJetsCHSPruned") || - (jetLabels_[icoll].label() == "ak8PFJetsCHSSoftdrop")) { + if ((jetLabels_[icoll].label() == "ak8PFJetsPuppiSoftdrop")) { if (jet->numberOfDaughters() > 1) { reco::Candidate const* da0 = jet->daughter(0); reco::Candidate const* da1 = jet->daughter(1); if (da0->mass() > da1->mass()) { + boostedJet_wMass[icoll]->Fill(da0->mass()); boostedJet_massDrop[icoll]->Fill(da0->mass() / jet->mass()); } else { + boostedJet_wMass[icoll]->Fill(da1->mass()); boostedJet_massDrop[icoll]->Fill(da1->mass() / jet->mass()); } + } else { boostedJet_massDrop[icoll]->Fill(-1.0); } - } // end if collection is AK8 PFJets CHS Pruned + } // end if collection is AK8 PFJets Puppi soft-drop } // end if basic jet != 0 countJet++; @@ -337,7 +320,7 @@ void B2GDQM::analyzeJets(const Event& iEvent, const edm::EventSetup& iSetup) { void B2GDQM::analyzeAllHad(const Event& iEvent, const edm::EventSetup& iSetup) { edm::Handle > jetCollection; - bool validJets = iEvent.getByToken(cmsTagToken_, jetCollection); + bool validJets = iEvent.getByToken(sdjetToken_, jetCollection); if (!validJets) return; @@ -355,28 +338,28 @@ void B2GDQM::analyzeAllHad(const Event& iEvent, const edm::EventSetup& iSetup) { if (std::abs(reco::deltaPhi(jet0->phi(), jet1->phi())) < M_PI * 0.5) return; - CATopJetHelper helper(173., 80.4); - allHad_pt0->Fill(jet0->pt()); allHad_y0->Fill(jet0->rapidity()); allHad_phi0->Fill(jet0->phi()); allHad_mass0->Fill(jet0->mass()); - reco::CATopJetProperties properties0 = helper(*jet0); if (jet0->numberOfDaughters() > 2) { - allHad_minMass0->Fill(properties0.minMass); + double wMass = + jet0->daughter(0)->mass() >= jet0->daughter(1)->mass() ? jet0->daughter(0)->mass() : jet0->daughter(1)->mass(); + allHad_wMass0->Fill(wMass); } else { - allHad_minMass0->Fill(-1.0); + allHad_wMass0->Fill(-1.0); } allHad_pt1->Fill(jet1->pt()); allHad_y1->Fill(jet1->rapidity()); allHad_phi1->Fill(jet1->phi()); allHad_mass1->Fill(jet1->mass()); - reco::CATopJetProperties properties1 = helper(*jet1); if (jet1->numberOfDaughters() > 2) { - allHad_minMass1->Fill(properties1.minMass); + double wMass = + jet1->daughter(0)->mass() >= jet1->daughter(1)->mass() ? jet1->daughter(0)->mass() : jet1->daughter(1)->mass(); + allHad_wMass1->Fill(wMass); } else { - allHad_minMass1->Fill(-1.0); + allHad_wMass1->Fill(-1.0); } auto p4cand = (jet0->p4() + jet1->p4()); @@ -396,7 +379,7 @@ void B2GDQM::analyzeSemiMu(const Event& iEvent, const edm::EventSetup& iSetup) { return; edm::Handle > jetCollection; - bool validJets = iEvent.getByToken(cmsTagToken_, jetCollection); + bool validJets = iEvent.getByToken(sdjetToken_, jetCollection); if (!validJets) return; if (jetCollection->size() < 2) @@ -443,8 +426,6 @@ void B2GDQM::analyzeSemiMu(const Event& iEvent, const edm::EventSetup& iSetup) { if (!pass2D) return; - CATopJetHelper helper(173., 80.4); - semiMu_muPt->Fill(muon.pt()); semiMu_muEta->Fill(muon.eta()); semiMu_muPhi->Fill(muon.phi()); @@ -458,11 +439,12 @@ void B2GDQM::analyzeSemiMu(const Event& iEvent, const edm::EventSetup& iSetup) { semiMu_hadJetY->Fill(hadJet->rapidity()); semiMu_hadJetPhi->Fill(hadJet->phi()); semiMu_hadJetMass->Fill(hadJet->mass()); - reco::CATopJetProperties properties0 = helper(*hadJet); if (hadJet->numberOfDaughters() > 2) { - semiMu_hadJetMinMass->Fill(properties0.minMass); + double wMass = hadJet->daughter(0)->mass() >= hadJet->daughter(1)->mass() ? hadJet->daughter(0)->mass() + : hadJet->daughter(1)->mass(); + semiMu_hadJetWMass->Fill(wMass); } else { - semiMu_hadJetMinMass->Fill(-1.0); + semiMu_hadJetWMass->Fill(-1.0); } } @@ -479,7 +461,7 @@ void B2GDQM::analyzeSemiE(const Event& iEvent, const edm::EventSetup& iSetup) { return; edm::Handle > jetCollection; - bool validJets = iEvent.getByToken(cmsTagToken_, jetCollection); + bool validJets = iEvent.getByToken(sdjetToken_, jetCollection); if (!validJets) return; if (jetCollection->size() < 2) @@ -526,8 +508,6 @@ void B2GDQM::analyzeSemiE(const Event& iEvent, const edm::EventSetup& iSetup) { if (!pass2D) return; - CATopJetHelper helper(173., 80.4); - semiE_ePt->Fill(electron.pt()); semiE_eEta->Fill(electron.eta()); semiE_ePhi->Fill(electron.phi()); @@ -541,10 +521,11 @@ void B2GDQM::analyzeSemiE(const Event& iEvent, const edm::EventSetup& iSetup) { semiE_hadJetY->Fill(hadJet->rapidity()); semiE_hadJetPhi->Fill(hadJet->phi()); semiE_hadJetMass->Fill(hadJet->mass()); - reco::CATopJetProperties properties0 = helper(*hadJet); if (hadJet->numberOfDaughters() > 2) { - semiE_hadJetMinMass->Fill(properties0.minMass); + double wMass = hadJet->daughter(0)->mass() >= hadJet->daughter(1)->mass() ? hadJet->daughter(0)->mass() + : hadJet->daughter(1)->mass(); + semiE_hadJetWMass->Fill(wMass); } else { - semiE_hadJetMinMass->Fill(-1.0); + semiE_hadJetWMass->Fill(-1.0); } } diff --git a/DQM/Physics/src/B2GDQM.h b/DQM/Physics/src/B2GDQM.h index cef24e5a1d182..7015ad0d6e68a 100644 --- a/DQM/Physics/src/B2GDQM.h +++ b/DQM/Physics/src/B2GDQM.h @@ -107,8 +107,10 @@ class B2GDQM : public DQMEDAnalyzer { edm::InputTag PFMETLabel_; edm::EDGetTokenT > PFMETToken_; - edm::InputTag cmsTagLabel_; - edm::EDGetTokenT > cmsTagToken_; + // EDIT from 2019 (S. Rappoccio): Change CMS top tagger algorithm from ancient Run 1 + // definition to modern soft-drop based tagger. + edm::InputTag sdjetLabel_; + edm::EDGetTokenT > sdjetToken_; edm::InputTag muonLabel_; edm::EDGetTokenT > muonToken_; @@ -160,7 +162,7 @@ class B2GDQM : public DQMEDAnalyzer { std::vector boostedJet_subjetM; std::vector boostedJet_subjetN; std::vector boostedJet_massDrop; - std::vector boostedJet_minMass; + std::vector boostedJet_wMass; MonitorElement* pfMet_pt; MonitorElement* pfMet_phi; @@ -174,7 +176,7 @@ class B2GDQM : public DQMEDAnalyzer { MonitorElement* semiMu_hadJetY; MonitorElement* semiMu_hadJetPhi; MonitorElement* semiMu_hadJetMass; - MonitorElement* semiMu_hadJetMinMass; + MonitorElement* semiMu_hadJetWMass; MonitorElement* semiMu_mttbar; MonitorElement* semiE_ePt; @@ -187,19 +189,19 @@ class B2GDQM : public DQMEDAnalyzer { MonitorElement* semiE_hadJetY; MonitorElement* semiE_hadJetPhi; MonitorElement* semiE_hadJetMass; - MonitorElement* semiE_hadJetMinMass; + MonitorElement* semiE_hadJetWMass; MonitorElement* semiE_mttbar; MonitorElement* allHad_pt0; MonitorElement* allHad_y0; MonitorElement* allHad_phi0; MonitorElement* allHad_mass0; - MonitorElement* allHad_minMass0; + MonitorElement* allHad_wMass0; MonitorElement* allHad_pt1; MonitorElement* allHad_y1; MonitorElement* allHad_phi1; MonitorElement* allHad_mass1; - MonitorElement* allHad_minMass1; + MonitorElement* allHad_wMass1; MonitorElement* allHad_mttbar; }; diff --git a/DQMOffline/JetMET/src/JetAnalyzer.cc b/DQMOffline/JetMET/src/JetAnalyzer.cc index d021ce1eccf48..48ad325d13c25 100644 --- a/DQMOffline/JetMET/src/JetAnalyzer.cc +++ b/DQMOffline/JetMET/src/JetAnalyzer.cc @@ -3760,9 +3760,6 @@ void JetAnalyzer::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetu (*patJets)[ijet].hasUserFloat("ak8PFJetsPuppiSoftDropMass")) mSoftDropMass->Fill((*patJets)[ijet].userFloat("ak8PFJetsPuppiSoftDropMass")); mPrunedMass = map_of_MEs[DirName + "/" + "PrunedMass"]; - if (mPrunedMass && mPrunedMass->getRootObject() && - (*patJets)[ijet].hasUserFloat("ak8PFJetsCHSValueMap:ak8PFJetsCHSPrunedMass")) - mPrunedMass->Fill((*patJets)[ijet].userFloat("ak8PFJetsCHSValueMap:ak8PFJetsCHSPrunedMass")); mtau2_over_tau1 = map_of_MEs[DirName + "/" + "tau2_over_tau1"]; if (mtau2_over_tau1 && mtau2_over_tau1->getRootObject() && ((*patJets)[ijet].hasUserFloat("NjettinessAK8Puppi:tau1") && @@ -3816,9 +3813,6 @@ void JetAnalyzer::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetu (*patJets)[ijet].hasUserFloat("ak8PFJetsPuppiSoftDropMass")) mSoftDropMass_boosted->Fill((*patJets)[ijet].userFloat("ak8PFJetsPuppiSoftDropMass")); mPrunedMass_boosted = map_of_MEs[DirName + "/" + "PrunedMass_boosted"]; - if (mPrunedMass_boosted && mPrunedMass_boosted->getRootObject() && - (*patJets)[ijet].hasUserFloat("ak8PFJetsCHSValueMap:ak8PFJetsCHSPrunedMass")) - mPrunedMass_boosted->Fill((*patJets)[ijet].userFloat("ak8PFJetsCHSValueMap:ak8PFJetsCHSPrunedMass")); mtau2_over_tau1_boosted = map_of_MEs[DirName + "/" + "tau2_over_tau1_boosted"]; if (mtau2_over_tau1_boosted && mtau2_over_tau1_boosted->getRootObject() && ((*patJets)[ijet].hasUserFloat("NjettinessAK8Puppi:tau1") && @@ -3912,10 +3906,6 @@ void JetAnalyzer::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetu mPhiVSEta->Fill(correctedJet.eta(), correctedJet.phi()); //if(!isJPTJet_){ float nConstituents = correctedJet.nConstituents(); - if (isMiniAODJet_) { - if ((*patJets)[ijet].hasUserFloat("patPuppiJetSpecificProducer:puppiMultiplicity")) - nConstituents = (*patJets)[ijet].userFloat("patPuppiJetSpecificProducer:puppiMultiplicity"); - } mConstituents = map_of_MEs[DirName + "/" + "Constituents"]; if (mConstituents && mConstituents->getRootObject()) mConstituents->Fill(nConstituents); diff --git a/DQMOffline/Trigger/python/B2GMonitoring_cff.py b/DQMOffline/Trigger/python/B2GMonitoring_cff.py index 59d1967a4c5c7..9a5ed80cb56d0 100644 --- a/DQMOffline/Trigger/python/B2GMonitoring_cff.py +++ b/DQMOffline/Trigger/python/B2GMonitoring_cff.py @@ -22,7 +22,7 @@ PFHT1050_Mjjmonitoring = hltMjjmonitoring.clone() PFHT1050_Mjjmonitoring.FolderName = cms.string('HLT/B2G/PFHT1050') PFHT1050_Mjjmonitoring.numGenericTriggerEventPSet.hltPaths = cms.vstring("HLT_PFHT1050_v*") -PFHT1050_Mjjmonitoring.jets = cms.InputTag("ak8PFJetsCHS") +PFHT1050_Mjjmonitoring.jets = cms.InputTag("ak8PFJetsPuppi") PFHT1050_Mjjmonitoring.jetSelection = cms.string("pt > 200 && eta < 2.4") PFHT1050_Softdropmonitoring = hltSoftdropmonitoring.clone() @@ -34,7 +34,7 @@ AK8PFJet500_Mjjmonitoring = hltMjjmonitoring.clone() AK8PFJet500_Mjjmonitoring.FolderName = cms.string('HLT/B2G/AK8PFJet500') AK8PFJet500_Mjjmonitoring.numGenericTriggerEventPSet.hltPaths = cms.vstring("HLT_AK8PFJet500_v*") -AK8PFJet500_Mjjmonitoring.jets = cms.InputTag("ak8PFJetsCHS") +AK8PFJet500_Mjjmonitoring.jets = cms.InputTag("ak8PFJetsPuppi") AK8PFJet500_Mjjmonitoring.jetSelection = cms.string("pt > 200 && eta < 2.4") AK8PFJet500_Softdropmonitoring = hltSoftdropmonitoring.clone() @@ -46,14 +46,14 @@ AK8PFHT750_TrimMass50_HTmonitoring = hltHTmonitoring.clone() AK8PFHT750_TrimMass50_HTmonitoring.FolderName = cms.string('HLT/B2G/AK8PFHT750_TrimMass50') AK8PFHT750_TrimMass50_HTmonitoring.numGenericTriggerEventPSet.hltPaths = cms.vstring("HLT_AK8PFHT750_TrimMass50_v*") -AK8PFHT750_TrimMass50_HTmonitoring.jets = cms.InputTag("ak8PFJetsCHS") +AK8PFHT750_TrimMass50_HTmonitoring.jets = cms.InputTag("ak8PFJetsPuppi") AK8PFHT750_TrimMass50_HTmonitoring.jetSelection = cms.string("pt > 0 && eta < 2.5") AK8PFHT750_TrimMass50_HTmonitoring.jetSelection_HT = cms.string("pt > 200 && eta < 2.5") AK8PFHT750_TrimMass50_Mjjmonitoring = hltMjjmonitoring.clone() AK8PFHT750_TrimMass50_Mjjmonitoring.FolderName = cms.string('HLT/B2G/AK8PFHT750_TrimMass50') AK8PFHT750_TrimMass50_Mjjmonitoring.numGenericTriggerEventPSet.hltPaths = cms.vstring("HLT_AK8PFHT750_TrimMass50_v*") -AK8PFHT750_TrimMass50_Mjjmonitoring.jets = cms.InputTag("ak8PFJetsCHS") +AK8PFHT750_TrimMass50_Mjjmonitoring.jets = cms.InputTag("ak8PFJetsPuppi") AK8PFHT750_TrimMass50_Mjjmonitoring.jetSelection = cms.string("pt > 200 && eta < 2.4") AK8PFHT750_TrimMass50_Softdropmonitoring = hltSoftdropmonitoring.clone() @@ -65,14 +65,14 @@ AK8PFHT800_TrimMass50_HTmonitoring = hltHTmonitoring.clone() AK8PFHT800_TrimMass50_HTmonitoring.FolderName = cms.string('HLT/B2G/AK8PFHT800_TrimMass50') AK8PFHT800_TrimMass50_HTmonitoring.numGenericTriggerEventPSet.hltPaths = cms.vstring("HLT_AK8PFHT800_TrimMass50_v*") -AK8PFHT800_TrimMass50_HTmonitoring.jets = cms.InputTag("ak8PFJetsCHS") +AK8PFHT800_TrimMass50_HTmonitoring.jets = cms.InputTag("ak8PFJetsPuppi") AK8PFHT800_TrimMass50_HTmonitoring.jetSelection = cms.string("pt > 0 && eta < 2.5") AK8PFHT800_TrimMass50_HTmonitoring.jetSelection_HT = cms.string("pt > 200 && eta < 2.5") AK8PFHT800_TrimMass50_Mjjmonitoring = hltMjjmonitoring.clone() AK8PFHT800_TrimMass50_Mjjmonitoring.FolderName = cms.string('HLT/B2G/AK8PFHT800_TrimMass50') AK8PFHT800_TrimMass50_Mjjmonitoring.numGenericTriggerEventPSet.hltPaths = cms.vstring("HLT_AK8PFHT800_TrimMass50_v*") -AK8PFHT800_TrimMass50_Mjjmonitoring.jets = cms.InputTag("ak8PFJetsCHS") +AK8PFHT800_TrimMass50_Mjjmonitoring.jets = cms.InputTag("ak8PFJetsPuppi") AK8PFHT800_TrimMass50_Mjjmonitoring.jetSelection = cms.string("pt > 200 && eta < 2.4") AK8PFHT800_TrimMass50_Softdropmonitoring = hltSoftdropmonitoring.clone() @@ -84,14 +84,14 @@ AK8PFHT850_TrimMass50_HTmonitoring = hltHTmonitoring.clone() AK8PFHT850_TrimMass50_HTmonitoring.FolderName = cms.string('HLT/B2G/AK8PFHT850_TrimMass50') AK8PFHT850_TrimMass50_HTmonitoring.numGenericTriggerEventPSet.hltPaths = cms.vstring("HLT_AK8PFHT850_TrimMass50_v*") -AK8PFHT850_TrimMass50_HTmonitoring.jets = cms.InputTag("ak8PFJetsCHS") +AK8PFHT850_TrimMass50_HTmonitoring.jets = cms.InputTag("ak8PFJetsPuppi") AK8PFHT850_TrimMass50_HTmonitoring.jetSelection = cms.string("pt > 0 && eta < 2.5") AK8PFHT850_TrimMass50_HTmonitoring.jetSelection_HT = cms.string("pt > 200 && eta < 2.5") AK8PFHT850_TrimMass50_Mjjmonitoring = hltMjjmonitoring.clone() AK8PFHT850_TrimMass50_Mjjmonitoring.FolderName = cms.string('HLT/B2G/AK8PFHT850_TrimMass50') AK8PFHT850_TrimMass50_Mjjmonitoring.numGenericTriggerEventPSet.hltPaths = cms.vstring("HLT_AK8PFHT850_TrimMass50_v*") -AK8PFHT850_TrimMass50_Mjjmonitoring.jets = cms.InputTag("ak8PFJetsCHS") +AK8PFHT850_TrimMass50_Mjjmonitoring.jets = cms.InputTag("ak8PFJetsPuppi") AK8PFHT850_TrimMass50_Mjjmonitoring.jetSelection = cms.string("pt > 200 && eta < 2.4") AK8PFHT850_TrimMass50_Softdropmonitoring = hltSoftdropmonitoring.clone() @@ -103,14 +103,14 @@ AK8PFHT900_TrimMass50_HTmonitoring = hltHTmonitoring.clone() AK8PFHT900_TrimMass50_HTmonitoring.FolderName = cms.string('HLT/B2G/AK8PFHT900_TrimMass50') AK8PFHT900_TrimMass50_HTmonitoring.numGenericTriggerEventPSet.hltPaths = cms.vstring("HLT_AK8PFHT900_TrimMass50_v*") -AK8PFHT900_TrimMass50_HTmonitoring.jets = cms.InputTag("ak8PFJetsCHS") +AK8PFHT900_TrimMass50_HTmonitoring.jets = cms.InputTag("ak8PFJetsPuppi") AK8PFHT900_TrimMass50_HTmonitoring.jetSelection = cms.string("pt > 0 && eta < 2.5") AK8PFHT900_TrimMass50_HTmonitoring.jetSelection_HT = cms.string("pt > 200 && eta < 2.5") AK8PFHT900_TrimMass50_Mjjmonitoring = hltMjjmonitoring.clone() AK8PFHT900_TrimMass50_Mjjmonitoring.FolderName = cms.string('HLT/B2G/AK8PFHT900_TrimMass50') AK8PFHT900_TrimMass50_Mjjmonitoring.numGenericTriggerEventPSet.hltPaths = cms.vstring("HLT_AK8PFHT900_TrimMass50_v*") -AK8PFHT900_TrimMass50_Mjjmonitoring.jets = cms.InputTag("ak8PFJetsCHS") +AK8PFHT900_TrimMass50_Mjjmonitoring.jets = cms.InputTag("ak8PFJetsPuppi") AK8PFHT900_TrimMass50_Mjjmonitoring.jetSelection = cms.string("pt > 200 && eta < 2.4") AK8PFHT900_TrimMass50_Softdropmonitoring = hltSoftdropmonitoring.clone() diff --git a/DQMOffline/Trigger/python/BTaggingMonitoring_cff.py b/DQMOffline/Trigger/python/BTaggingMonitoring_cff.py index bdfe0a916cd69..72c548bb7ddca 100644 --- a/DQMOffline/Trigger/python/BTaggingMonitoring_cff.py +++ b/DQMOffline/Trigger/python/BTaggingMonitoring_cff.py @@ -71,7 +71,7 @@ BTagMu_AK8DiJet170_Mu5.nmuons = cms.uint32(1) BTagMu_AK8DiJet170_Mu5.nelectrons = cms.uint32(0) BTagMu_AK8DiJet170_Mu5.njets = cms.uint32(2) -BTagMu_AK8DiJet170_Mu5.jets = cms.InputTag("ak8PFJetsCHS") +BTagMu_AK8DiJet170_Mu5.jets = cms.InputTag("ak8PFJetsPuppi") BTagMu_AK8DiJet170_Mu5.muoSelection = cms.string('pt>3 & abs(eta)<2.4 & isPFMuon & isGlobalMuon & innerTrack.hitPattern.trackerLayersWithMeasurement>5 & innerTrack.hitPattern.numberOfValidPixelHits>0 & globalTrack.hitPattern.numberOfValidMuonHits>0 & globalTrack.normalizedChi2<10') BTagMu_AK8DiJet170_Mu5.jetSelection = cms.string('pt>150 & abs(eta)<2.4') BTagMu_AK8DiJet170_Mu5.numGenericTriggerEventPSet.hltPaths = cms.vstring('HLT_BTagMu_AK8DiJet170_Mu5_v*') @@ -82,7 +82,7 @@ BTagMu_AK8Jet300_Mu5.nmuons = cms.uint32(1) BTagMu_AK8Jet300_Mu5.nelectrons = cms.uint32(0) BTagMu_AK8Jet300_Mu5.njets = cms.uint32(1) -BTagMu_AK8Jet300_Mu5.jets = cms.InputTag("ak8PFJetsCHS") +BTagMu_AK8Jet300_Mu5.jets = cms.InputTag("ak8PFJetsPuppi") BTagMu_AK8Jet300_Mu5.muoSelection = cms.string('pt>3 & abs(eta)<2.4 & isPFMuon & isGlobalMuon & innerTrack.hitPattern.trackerLayersWithMeasurement>5 & innerTrack.hitPattern.numberOfValidPixelHits>0 & globalTrack.hitPattern.numberOfValidMuonHits>0 & globalTrack.normalizedChi2<10') BTagMu_AK8Jet300_Mu5.jetSelection = cms.string('pt>250 & abs(eta)<2.4') BTagMu_AK8Jet300_Mu5.numGenericTriggerEventPSet.hltPaths = cms.vstring('HLT_BTagMu_AK8Jet300_Mu5_v*') @@ -93,7 +93,7 @@ BTagMu_AK8Jet170_DoubleMu5.nmuons = cms.uint32(2) BTagMu_AK8Jet170_DoubleMu5.nelectrons = cms.uint32(0) BTagMu_AK8Jet170_DoubleMu5.njets = cms.uint32(1) -BTagMu_AK8Jet170_DoubleMu5.jets = cms.InputTag("ak8PFJetsCHS") +BTagMu_AK8Jet170_DoubleMu5.jets = cms.InputTag("ak8PFJetsPuppi") BTagMu_AK8Jet170_DoubleMu5.muoSelection = cms.string('pt>7 & abs(eta)<2.4 & isPFMuon & isGlobalMuon & innerTrack.hitPattern.numberOfValidTrackerHits>7 & innerTrack.hitPattern.numberOfValidPixelHits>0 & globalTrack.hitPattern.numberOfValidMuonHits>0 & numberOfMatchedStations>1 &globalTrack.normalizedChi2<10') BTagMu_AK8Jet170_DoubleMu5.jetSelection = cms.string('pt>150 & abs(eta)<2.4') BTagMu_AK8Jet170_DoubleMu5.numGenericTriggerEventPSet.hltPaths = cms.vstring('HLT_BTagMu_AK8Jet170_DoubleMu5_v*') @@ -206,7 +206,7 @@ AK8PFJet40.nmuons = cms.uint32(0) AK8PFJet40.nelectrons = cms.uint32(0) AK8PFJet40.njets = cms.uint32(1) -AK8PFJet40.jets = cms.InputTag("ak8PFJetsCHS") +AK8PFJet40.jets = cms.InputTag("ak8PFJetsPuppi") AK8PFJet40.jetSelection = cms.string('pt>30 & abs(eta)<2.4') AK8PFJet40.bjetSelection = cms.string('pt>20 & abs(eta)<2.4') AK8PFJet40.numGenericTriggerEventPSet.hltPaths = cms.vstring('HLT_AK8PFJet40_v*') @@ -217,7 +217,7 @@ AK8PFJet60.nmuons = cms.uint32(0) AK8PFJet60.nelectrons = cms.uint32(0) AK8PFJet60.njets = cms.uint32(1) -AK8PFJet60.jets = cms.InputTag("ak8PFJetsCHS") +AK8PFJet60.jets = cms.InputTag("ak8PFJetsPuppi") AK8PFJet60.jetSelection = cms.string('pt>50 & abs(eta)<2.4') AK8PFJet60.numGenericTriggerEventPSet.hltPaths = cms.vstring('HLT_AK8PFJet60_v*') AK8PFJet60.histoPSet.jetPtBinning = cms.vdouble(0,50,55,60,65,70,80,90,100,120,150,200,400,700,1000,1500,3000) @@ -227,7 +227,7 @@ AK8PFJet80.nmuons = cms.uint32(0) AK8PFJet80.nelectrons = cms.uint32(0) AK8PFJet80.njets = cms.uint32(1) -AK8PFJet80.jets = cms.InputTag("ak8PFJetsCHS") +AK8PFJet80.jets = cms.InputTag("ak8PFJetsPuppi") AK8PFJet80.jetSelection = cms.string('pt>70 & abs(eta)<2.4') AK8PFJet80.numGenericTriggerEventPSet.hltPaths = cms.vstring('HLT_AK8PFJet80_v*') AK8PFJet80.histoPSet.jetPtBinning = cms.vdouble(0,70,75,80,85,90,100,120,150,200,400,700,1000,1500,3000) @@ -237,7 +237,7 @@ AK8PFJet140.nmuons = cms.uint32(0) AK8PFJet140.nelectrons = cms.uint32(0) AK8PFJet140.njets = cms.uint32(1) -AK8PFJet140.jets = cms.InputTag("ak8PFJetsCHS") +AK8PFJet140.jets = cms.InputTag("ak8PFJetsPuppi") AK8PFJet140.jetSelection = cms.string('pt>120 & abs(eta)<2.4') AK8PFJet140.numGenericTriggerEventPSet.hltPaths = cms.vstring('HLT_AK8PFJet140_v*') AK8PFJet140.histoPSet.jetPtBinning = cms.vdouble(0,120,130,140,150,160,170,200,400,700,1000,1500,3000) @@ -247,7 +247,7 @@ AK8PFJet200.nmuons = cms.uint32(0) AK8PFJet200.nelectrons = cms.uint32(0) AK8PFJet200.njets = cms.uint32(1) -AK8PFJet200.jets = cms.InputTag("ak8PFJetsCHS") +AK8PFJet200.jets = cms.InputTag("ak8PFJetsPuppi") AK8PFJet200.jetSelection = cms.string('pt>170 & abs(eta)<2.4') AK8PFJet200.numGenericTriggerEventPSet.hltPaths = cms.vstring('HLT_AK8PFJet200_v*') AK8PFJet200.histoPSet.jetPtBinning = cms.vdouble(0,170,180,190,200,210,220,250,300,400,700,1000,1500,3000) @@ -257,7 +257,7 @@ AK8PFJet260.nmuons = cms.uint32(0) AK8PFJet260.nelectrons = cms.uint32(0) AK8PFJet260.njets = cms.uint32(1) -AK8PFJet260.jets = cms.InputTag("ak8PFJetsCHS") +AK8PFJet260.jets = cms.InputTag("ak8PFJetsPuppi") AK8PFJet260.jetSelection = cms.string('pt>220 & abs(eta)<2.4') AK8PFJet260.numGenericTriggerEventPSet.hltPaths = cms.vstring('HLT_AK8PFJet260_v*') AK8PFJet260.histoPSet.jetPtBinning = cms.vdouble(0,220,240,260,280,300,350,400,700,1000,1500,3000) @@ -267,7 +267,7 @@ AK8PFJet320.nmuons = cms.uint32(0) AK8PFJet320.nelectrons = cms.uint32(0) AK8PFJet320.njets = cms.uint32(1) -AK8PFJet320.jets = cms.InputTag("ak8PFJetsCHS") +AK8PFJet320.jets = cms.InputTag("ak8PFJetsPuppi") AK8PFJet320.jetSelection = cms.string('pt>280 & abs(eta)<2.4') AK8PFJet320.numGenericTriggerEventPSet.hltPaths = cms.vstring('HLT_AK8PFJet320_v*') AK8PFJet320.histoPSet.jetPtBinning = cms.vdouble(0,280,300,320,340,360,400,500,700,1000,1500,3000) @@ -277,7 +277,7 @@ AK8PFJet400.nmuons = cms.uint32(0) AK8PFJet400.nelectrons = cms.uint32(0) AK8PFJet400.njets = cms.uint32(1) -AK8PFJet400.jets = cms.InputTag("ak8PFJetsCHS") +AK8PFJet400.jets = cms.InputTag("ak8PFJetsPuppi") AK8PFJet400.jetSelection = cms.string('pt>350 & abs(eta)<2.4') AK8PFJet400.numGenericTriggerEventPSet.hltPaths = cms.vstring('HLT_AK8PFJet400_v*') AK8PFJet400.histoPSet.jetPtBinning = cms.vdouble(0,350,380,400,420,450,500,700,1000,1500,3000) @@ -287,7 +287,7 @@ AK8PFJet450.nmuons = cms.uint32(0) AK8PFJet450.nelectrons = cms.uint32(0) AK8PFJet450.njets = cms.uint32(1) -AK8PFJet450.jets = cms.InputTag("ak8PFJetsCHS") +AK8PFJet450.jets = cms.InputTag("ak8PFJetsPuppi") AK8PFJet450.jetSelection = cms.string('pt>400 & abs(eta)<2.4') AK8PFJet450.numGenericTriggerEventPSet.hltPaths = cms.vstring('HLT_AK8PFJet450_v*') AK8PFJet450.histoPSet.jetPtBinning = cms.vdouble(0,400,430,450,470,500,700,1000,1500,3000) @@ -297,7 +297,7 @@ AK8PFJet500.nmuons = cms.uint32(0) AK8PFJet500.nelectrons = cms.uint32(0) AK8PFJet500.njets = cms.uint32(1) -AK8PFJet500.jets = cms.InputTag("ak8PFJetsCHS") +AK8PFJet500.jets = cms.InputTag("ak8PFJetsPuppi") AK8PFJet500.jetSelection = cms.string('pt>450 & abs(eta)<2.4') AK8PFJet500.numGenericTriggerEventPSet.hltPaths = cms.vstring('HLT_AK8PFJet500_v*') AK8PFJet500.histoPSet.jetPtBinning = cms.vdouble(0,450,480,500,520,550,600,700,1000,1500,3000) @@ -307,7 +307,7 @@ AK8PFJet550.nmuons = cms.uint32(0) AK8PFJet550.nelectrons = cms.uint32(0) AK8PFJet550.njets = cms.uint32(1) -AK8PFJet550.jets = cms.InputTag("ak8PFJetsCHS") +AK8PFJet550.jets = cms.InputTag("ak8PFJetsPuppi") AK8PFJet550.jetSelection = cms.string('pt>500 & abs(eta)<2.4') AK8PFJet550.numGenericTriggerEventPSet.hltPaths = cms.vstring('HLT_AK8PFJet550_v*') AK8PFJet550.histoPSet.jetPtBinning = cms.vdouble(0,500,520,550,600,700,1000,1500,3000) @@ -440,7 +440,7 @@ AK8PFJetFwd40.nmuons = cms.uint32(0) AK8PFJetFwd40.nelectrons = cms.uint32(0) AK8PFJetFwd40.njets = cms.uint32(1) -AK8PFJetFwd40.jets = cms.InputTag("ak8PFJetsCHS") +AK8PFJetFwd40.jets = cms.InputTag("ak8PFJetsPuppi") AK8PFJetFwd40.jetSelection = cms.string('pt>30 & abs(eta)>2.7 & abs(eta)<5.0') AK8PFJetFwd40.bjetSelection = cms.string('pt>20 & abs(eta)>2.7 & abs(eta)<5.0') AK8PFJetFwd40.numGenericTriggerEventPSet.hltPaths = cms.vstring('HLT_AK8PFJetFwd40_v*') @@ -454,7 +454,7 @@ AK8PFJetFwd60.nmuons = cms.uint32(0) AK8PFJetFwd60.nelectrons = cms.uint32(0) AK8PFJetFwd60.njets = cms.uint32(1) -AK8PFJetFwd60.jets = cms.InputTag("ak8PFJetsCHS") +AK8PFJetFwd60.jets = cms.InputTag("ak8PFJetsPuppi") AK8PFJetFwd60.jetSelection = cms.string('pt>50 & abs(eta)>2.7 & abs(eta)<5.0') AK8PFJetFwd60.numGenericTriggerEventPSet.hltPaths = cms.vstring('HLT_AK8PFJetFwd60_v*') AK8PFJetFwd60.histoPSet.jetPtBinning = cms.vdouble(0,50,55,60,65,70,80,90,100,120,150,200,400,700,1000,1500,3000) @@ -467,7 +467,7 @@ AK8PFJetFwd80.nmuons = cms.uint32(0) AK8PFJetFwd80.nelectrons = cms.uint32(0) AK8PFJetFwd80.njets = cms.uint32(1) -AK8PFJetFwd80.jets = cms.InputTag("ak8PFJetsCHS") +AK8PFJetFwd80.jets = cms.InputTag("ak8PFJetsPuppi") AK8PFJetFwd80.jetSelection = cms.string('pt>70 & abs(eta)>2.7 & abs(eta)<5.0') AK8PFJetFwd80.numGenericTriggerEventPSet.hltPaths = cms.vstring('HLT_AK8PFJetFwd80_v*') AK8PFJetFwd80.histoPSet.jetPtBinning = cms.vdouble(0,70,75,80,85,90,100,120,150,200,400,700,1000,1500,3000) @@ -480,7 +480,7 @@ AK8PFJetFwd140.nmuons = cms.uint32(0) AK8PFJetFwd140.nelectrons = cms.uint32(0) AK8PFJetFwd140.njets = cms.uint32(1) -AK8PFJetFwd140.jets = cms.InputTag("ak8PFJetsCHS") +AK8PFJetFwd140.jets = cms.InputTag("ak8PFJetsPuppi") AK8PFJetFwd140.jetSelection = cms.string('pt>120 & abs(eta)>2.7 & abs(eta)<5.0') AK8PFJetFwd140.numGenericTriggerEventPSet.hltPaths = cms.vstring('HLT_AK8PFJetFwd140_v*') AK8PFJetFwd140.histoPSet.jetPtBinning = cms.vdouble(0,120,130,140,150,160,170,200,400,700,1000,1500,3000) @@ -493,7 +493,7 @@ AK8PFJetFwd200.nmuons = cms.uint32(0) AK8PFJetFwd200.nelectrons = cms.uint32(0) AK8PFJetFwd200.njets = cms.uint32(1) -AK8PFJetFwd200.jets = cms.InputTag("ak8PFJetsCHS") +AK8PFJetFwd200.jets = cms.InputTag("ak8PFJetsPuppi") AK8PFJetFwd200.jetSelection = cms.string('pt>170 & abs(eta)>2.7 & abs(eta)<5.0') AK8PFJetFwd200.numGenericTriggerEventPSet.hltPaths = cms.vstring('HLT_AK8PFJetFwd200_v*') AK8PFJetFwd200.histoPSet.jetPtBinning = cms.vdouble(0,170,180,190,200,210,220,250,300,400,700,1000,1500,3000) @@ -506,7 +506,7 @@ AK8PFJetFwd260.nmuons = cms.uint32(0) AK8PFJetFwd260.nelectrons = cms.uint32(0) AK8PFJetFwd260.njets = cms.uint32(1) -AK8PFJetFwd260.jets = cms.InputTag("ak8PFJetsCHS") +AK8PFJetFwd260.jets = cms.InputTag("ak8PFJetsPuppi") AK8PFJetFwd260.jetSelection = cms.string('pt>220 & abs(eta)>2.7 & abs(eta)<5.0') AK8PFJetFwd260.numGenericTriggerEventPSet.hltPaths = cms.vstring('HLT_AK8PFJetFwd260_v*') AK8PFJetFwd260.histoPSet.jetPtBinning = cms.vdouble(0,220,240,260,280,300,350,400,700,1000,1500,3000) @@ -519,7 +519,7 @@ AK8PFJetFwd320.nmuons = cms.uint32(0) AK8PFJetFwd320.nelectrons = cms.uint32(0) AK8PFJetFwd320.njets = cms.uint32(1) -AK8PFJetFwd320.jets = cms.InputTag("ak8PFJetsCHS") +AK8PFJetFwd320.jets = cms.InputTag("ak8PFJetsPuppi") AK8PFJetFwd320.jetSelection = cms.string('pt>280 & abs(eta)>2.7 & abs(eta)<5.0') AK8PFJetFwd320.numGenericTriggerEventPSet.hltPaths = cms.vstring('HLT_AK8PFJetFwd320_v*') AK8PFJetFwd320.histoPSet.jetPtBinning = cms.vdouble(0,280,300,320,340,360,400,500,700,1000,1500,3000) @@ -532,7 +532,7 @@ AK8PFJetFwd400.nmuons = cms.uint32(0) AK8PFJetFwd400.nelectrons = cms.uint32(0) AK8PFJetFwd400.njets = cms.uint32(1) -AK8PFJetFwd400.jets = cms.InputTag("ak8PFJetsCHS") +AK8PFJetFwd400.jets = cms.InputTag("ak8PFJetsPuppi") AK8PFJetFwd400.jetSelection = cms.string('pt>350 & abs(eta)>2.7 & abs(eta)<5.0') AK8PFJetFwd400.numGenericTriggerEventPSet.hltPaths = cms.vstring('HLT_AK8PFJetFwd400_v*') AK8PFJetFwd400.histoPSet.jetPtBinning = cms.vdouble(0,350,380,400,420,450,500,700,1000,1500,3000) @@ -545,7 +545,7 @@ AK8PFJetFwd450.nmuons = cms.uint32(0) AK8PFJetFwd450.nelectrons = cms.uint32(0) AK8PFJetFwd450.njets = cms.uint32(1) -AK8PFJetFwd450.jets = cms.InputTag("ak8PFJetsCHS") +AK8PFJetFwd450.jets = cms.InputTag("ak8PFJetsPuppi") AK8PFJetFwd450.jetSelection = cms.string('pt>400 & abs(eta)>2.7 & abs(eta)<5.0') AK8PFJetFwd450.numGenericTriggerEventPSet.hltPaths = cms.vstring('HLT_AK8PFJetFwd450_v*') AK8PFJetFwd450.histoPSet.jetPtBinning = cms.vdouble(0,400,430,450,470,500,700,1000,1500,3000) @@ -558,7 +558,7 @@ AK8PFJetFwd500.nmuons = cms.uint32(0) AK8PFJetFwd500.nelectrons = cms.uint32(0) AK8PFJetFwd500.njets = cms.uint32(1) -AK8PFJetFwd500.jets = cms.InputTag("ak8PFJetsCHS") +AK8PFJetFwd500.jets = cms.InputTag("ak8PFJetsPuppi") AK8PFJetFwd500.jetSelection = cms.string('pt>450 & abs(eta)>2.7 & abs(eta)<5.0') AK8PFJetFwd500.numGenericTriggerEventPSet.hltPaths = cms.vstring('HLT_AK8PFJetFwd500_v*') AK8PFJetFwd500.histoPSet.jetPtBinning = cms.vdouble(0,450,480,500,520,550,600,700,1000,1500,3000) diff --git a/DQMOffline/Trigger/python/JetMETHLTOfflineSource_cfi.py b/DQMOffline/Trigger/python/JetMETHLTOfflineSource_cfi.py index 687fe82087e88..7d9ac6634a88b 100644 --- a/DQMOffline/Trigger/python/JetMETHLTOfflineSource_cfi.py +++ b/DQMOffline/Trigger/python/JetMETHLTOfflineSource_cfi.py @@ -103,7 +103,7 @@ jetMETHLTOfflineSourceAK8 = jetMETHLTOfflineSourceAK4.clone( dirname = cms.untracked.string('HLT/JME/Jets/AK8'), # CaloJetCollectionLabel = cms.InputTag("ak4CaloJets"), #ak8 not available in RECO anymore, so keep ak4... - # PFJetCollectionLabel = cms.InputTag("ak8PFJetsCHS"), # does not work in all matrix tests, yet + # PFJetCollectionLabel = cms.InputTag("ak8PFJetsPuppi"), # does not work in all matrix tests, yet # PFJetCorLabel = cms.InputTag("ak8PFCHSL1FastjetL2L3ResidualCorrector"), # does not work in all matrix tests, yet PFJetCollectionLabel = cms.InputTag("ak4PFJets"), PFJetCorLabel = cms.InputTag("ak4PFL1FastL2L3ResidualCorrector"), #dummy residual corrections now also provided for MC GTs diff --git a/DQMOffline/Trigger/python/JetMonitor_cff.py b/DQMOffline/Trigger/python/JetMonitor_cff.py index 753a3c41ab102..fa5289e2a8f23 100644 --- a/DQMOffline/Trigger/python/JetMonitor_cff.py +++ b/DQMOffline/Trigger/python/JetMonitor_cff.py @@ -208,7 +208,7 @@ # HLT_AK8PFJet40 AK8PFJet40_Prommonitoring = hltJetMETmonitoring.clone() AK8PFJet40_Prommonitoring.FolderName = cms.string('HLT/JME/Jets/AK8/PF/HLT_AK8PFJet40/') -AK8PFJet40_Prommonitoring.jetSrc = cms.InputTag("ak8PFJetsCHS") +AK8PFJet40_Prommonitoring.jetSrc = cms.InputTag("ak8PFJetsPuppi") AK8PFJet40_Prommonitoring.histoPSet.jetPtThrPSet = cms.PSet( nbins = cms.uint32 ( 50 ), xmin = cms.double( 0.), @@ -221,7 +221,7 @@ # HLT_AK8PFJet60 AK8PFJet60_Prommonitoring = hltJetMETmonitoring.clone() AK8PFJet60_Prommonitoring.FolderName = cms.string('HLT/JME/Jets/AK8/PF/HLT_AK8PFJet60/') -AK8PFJet60_Prommonitoring.jetSrc = cms.InputTag("ak8PFJetsCHS") +AK8PFJet60_Prommonitoring.jetSrc = cms.InputTag("ak8PFJetsPuppi") AK8PFJet60_Prommonitoring.histoPSet.jetPtThrPSet = cms.PSet( nbins = cms.uint32 ( 75 ), xmin = cms.double( 0.), @@ -234,7 +234,7 @@ # HLT_AK8PFJet80 AK8PFJet80_Prommonitoring = hltJetMETmonitoring.clone() AK8PFJet80_Prommonitoring.FolderName = cms.string('HLT/JME/Jets/AK8/PF/HLT_AK8PFJet80/') -AK8PFJet80_Prommonitoring.jetSrc = cms.InputTag("ak8PFJetsCHS") +AK8PFJet80_Prommonitoring.jetSrc = cms.InputTag("ak8PFJetsPuppi") AK8PFJet80_Prommonitoring.histoPSet.jetPtThrPSet = cms.PSet( nbins = cms.uint32 ( 100 ), xmin = cms.double( 0.), @@ -247,7 +247,7 @@ # HLT_AK8PFJet140 AK8PFJet140_Prommonitoring = hltJetMETmonitoring.clone() AK8PFJet140_Prommonitoring.FolderName = cms.string('HLT/JME/Jets/AK8/PF/HLT_AK8PFJet140/') -AK8PFJet140_Prommonitoring.jetSrc = cms.InputTag("ak8PFJetsCHS") +AK8PFJet140_Prommonitoring.jetSrc = cms.InputTag("ak8PFJetsPuppi") AK8PFJet140_Prommonitoring.histoPSet.jetPtThrPSet = cms.PSet( nbins = cms.uint32 ( 70 ), xmin = cms.double( 0.), @@ -260,7 +260,7 @@ # HLT_AK8PFJet200 AK8PFJet200_Prommonitoring = hltJetMETmonitoring.clone() AK8PFJet200_Prommonitoring.FolderName = cms.string('HLT/JME/Jets/AK8/PF/HLT_AK8PFJet200/') -AK8PFJet200_Prommonitoring.jetSrc = cms.InputTag("ak8PFJetsCHS") +AK8PFJet200_Prommonitoring.jetSrc = cms.InputTag("ak8PFJetsPuppi") AK8PFJet200_Prommonitoring.histoPSet.jetPtThrPSet = cms.PSet( nbins = cms.uint32 ( 50 ), xmin = cms.double( 0.), @@ -273,7 +273,7 @@ # HLT_AK8PFJet260 AK8PFJet260_Prommonitoring = hltJetMETmonitoring.clone() AK8PFJet260_Prommonitoring.FolderName = cms.string('HLT/JME/Jets/AK8/PF/HLT_AK8PFJet260/') -AK8PFJet260_Prommonitoring.jetSrc = cms.InputTag("ak8PFJetsCHS") +AK8PFJet260_Prommonitoring.jetSrc = cms.InputTag("ak8PFJetsPuppi") AK8PFJet260_Prommonitoring.histoPSet.jetPtThrPSet = cms.PSet( nbins = cms.uint32 ( 65 ), xmin = cms.double( 0.), @@ -286,7 +286,7 @@ # HLT_AK8PFJet320 AK8PFJet320_Prommonitoring = hltJetMETmonitoring.clone() AK8PFJet320_Prommonitoring.FolderName = cms.string('HLT/JME/Jets/AK8/PF/HLT_AK8PFJet320/') -AK8PFJet320_Prommonitoring.jetSrc = cms.InputTag("ak8PFJetsCHS") +AK8PFJet320_Prommonitoring.jetSrc = cms.InputTag("ak8PFJetsPuppi") AK8PFJet320_Prommonitoring.histoPSet.jetPtThrPSet = cms.PSet( nbins = cms.uint32 ( 80 ), xmin = cms.double( 0.), @@ -299,7 +299,7 @@ # HLT_AK8PFJet400 AK8PFJet400_Prommonitoring = hltJetMETmonitoring.clone() AK8PFJet400_Prommonitoring.FolderName = cms.string('HLT/JME/Jets/AK8/PF/HLT_AK8PFJet400/') -AK8PFJet400_Prommonitoring.jetSrc = cms.InputTag("ak8PFJetsCHS") +AK8PFJet400_Prommonitoring.jetSrc = cms.InputTag("ak8PFJetsPuppi") AK8PFJet400_Prommonitoring.histoPSet.jetPtThrPSet = cms.PSet( nbins = cms.uint32 ( 100 ), xmin = cms.double( 0.), @@ -312,7 +312,7 @@ # HLT_AK8PFJet450 AK8PFJet450_Prommonitoring = hltJetMETmonitoring.clone() AK8PFJet450_Prommonitoring.FolderName = cms.string('HLT/JME/Jets/AK8/PF/HLT_AK8PFJet450/') -AK8PFJet450_Prommonitoring.jetSrc = cms.InputTag("ak8PFJetsCHS") +AK8PFJet450_Prommonitoring.jetSrc = cms.InputTag("ak8PFJetsPuppi") AK8PFJet450_Prommonitoring.histoPSet.jetPtThrPSet = cms.PSet( nbins = cms.uint32 ( 112 ), xmin = cms.double( 0.), @@ -325,7 +325,7 @@ # HLT_AK8PFJet500 AK8PFJet500_Prommonitoring = hltJetMETmonitoring.clone() AK8PFJet500_Prommonitoring.FolderName = cms.string('HLT/JME/Jets/AK8/PF/HLT_AK8PFJet500/') -AK8PFJet500_Prommonitoring.jetSrc = cms.InputTag("ak8PFJetsCHS") +AK8PFJet500_Prommonitoring.jetSrc = cms.InputTag("ak8PFJetsPuppi") AK8PFJet500_Prommonitoring.histoPSet.jetPtThrPSet = cms.PSet( nbins = cms.uint32 ( 125), xmin = cms.double( 0.), @@ -339,7 +339,7 @@ # HLT_AK8PFJetFwd40 AK8PFJetFwd40_Prommonitoring = hltJetMETmonitoring.clone() AK8PFJetFwd40_Prommonitoring.FolderName = cms.string('HLT/JME/Jets/AK8Fwd/PF/HLT_AK8PFJetFwd40/') -AK8PFJetFwd40_Prommonitoring.jetSrc = cms.InputTag("ak8PFJetsCHS") +AK8PFJetFwd40_Prommonitoring.jetSrc = cms.InputTag("ak8PFJetsPuppi") AK8PFJetFwd40_Prommonitoring.histoPSet.jetPtThrPSet = cms.PSet( nbins = cms.uint32 ( 50 ), xmin = cms.double( 0.), @@ -352,7 +352,7 @@ # HLT_AK8PFJetFwd60 AK8PFJetFwd60_Prommonitoring = hltJetMETmonitoring.clone() AK8PFJetFwd60_Prommonitoring.FolderName = cms.string('HLT/JME/Jets/AK8Fwd/PF/HLT_AK8PFJetFwd60/') -AK8PFJetFwd60_Prommonitoring.jetSrc = cms.InputTag("ak8PFJetsCHS") +AK8PFJetFwd60_Prommonitoring.jetSrc = cms.InputTag("ak8PFJetsPuppi") AK8PFJetFwd60_Prommonitoring.histoPSet.jetPtThrPSet = cms.PSet( nbins = cms.uint32 ( 75 ), xmin = cms.double( 0.), @@ -365,7 +365,7 @@ # HLT_AK8PFJetFwd80 AK8PFJetFwd80_Prommonitoring = hltJetMETmonitoring.clone() AK8PFJetFwd80_Prommonitoring.FolderName = cms.string('HLT/JME/Jets/AK8Fwd/PF/HLT_AK8PFJetFwd80/') -AK8PFJetFwd80_Prommonitoring.jetSrc = cms.InputTag("ak8PFJetsCHS") +AK8PFJetFwd80_Prommonitoring.jetSrc = cms.InputTag("ak8PFJetsPuppi") AK8PFJetFwd80_Prommonitoring.histoPSet.jetPtThrPSet = cms.PSet( nbins = cms.uint32 ( 100 ), xmin = cms.double( 0.), @@ -378,7 +378,7 @@ # HLT_AK8PFJetFwd140 AK8PFJetFwd140_Prommonitoring = hltJetMETmonitoring.clone() AK8PFJetFwd140_Prommonitoring.FolderName = cms.string('HLT/JME/Jets/AK8Fwd/PF/HLT_AK8PFJetFwd140/') -AK8PFJetFwd140_Prommonitoring.jetSrc = cms.InputTag("ak8PFJetsCHS") +AK8PFJetFwd140_Prommonitoring.jetSrc = cms.InputTag("ak8PFJetsPuppi") AK8PFJetFwd140_Prommonitoring.histoPSet.jetPtThrPSet = cms.PSet( nbins = cms.uint32 ( 70 ), xmin = cms.double( 0.), @@ -391,7 +391,7 @@ # HLT_AK8PFJetFwd200 AK8PFJetFwd200_Prommonitoring = hltJetMETmonitoring.clone() AK8PFJetFwd200_Prommonitoring.FolderName = cms.string('HLT/JME/Jets/AK8Fwd/PF/HLT_AK8PFJetFwd200/') -AK8PFJetFwd200_Prommonitoring.jetSrc = cms.InputTag("ak8PFJetsCHS") +AK8PFJetFwd200_Prommonitoring.jetSrc = cms.InputTag("ak8PFJetsPuppi") AK8PFJetFwd200_Prommonitoring.histoPSet.jetPtThrPSet = cms.PSet( nbins = cms.uint32 ( 50 ), xmin = cms.double( 0.), @@ -404,7 +404,7 @@ # HLT_AK8PFJetFwd260 AK8PFJetFwd260_Prommonitoring = hltJetMETmonitoring.clone() AK8PFJetFwd260_Prommonitoring.FolderName = cms.string('HLT/JME/Jets/AK8Fwd/PF/HLT_AK8PFJetFwd260/') -AK8PFJetFwd260_Prommonitoring.jetSrc = cms.InputTag("ak8PFJetsCHS") +AK8PFJetFwd260_Prommonitoring.jetSrc = cms.InputTag("ak8PFJetsPuppi") AK8PFJetFwd260_Prommonitoring.histoPSet.jetPtThrPSet = cms.PSet( nbins = cms.uint32 ( 65 ), xmin = cms.double( 0.), @@ -417,7 +417,7 @@ # HLT_AK8PFJetFwd320 AK8PFJetFwd320_Prommonitoring = hltJetMETmonitoring.clone() AK8PFJetFwd320_Prommonitoring.FolderName = cms.string('HLT/JME/Jets/AK8Fwd/PF/HLT_AK8PFJetFwd320/') -AK8PFJetFwd320_Prommonitoring.jetSrc = cms.InputTag("ak8PFJetsCHS") +AK8PFJetFwd320_Prommonitoring.jetSrc = cms.InputTag("ak8PFJetsPuppi") AK8PFJetFwd320_Prommonitoring.histoPSet.jetPtThrPSet = cms.PSet( nbins = cms.uint32 ( 80 ), xmin = cms.double( 0.), @@ -430,7 +430,7 @@ # HLT_AK8PFJetFwd400 AK8PFJetFwd400_Prommonitoring = hltJetMETmonitoring.clone() AK8PFJetFwd400_Prommonitoring.FolderName = cms.string('HLT/JME/Jets/AK8Fwd/PF/HLT_AK8PFJetFwd400/') -AK8PFJetFwd400_Prommonitoring.jetSrc = cms.InputTag("ak8PFJetsCHS") +AK8PFJetFwd400_Prommonitoring.jetSrc = cms.InputTag("ak8PFJetsPuppi") AK8PFJetFwd400_Prommonitoring.histoPSet.jetPtThrPSet = cms.PSet( nbins = cms.uint32 ( 100 ), xmin = cms.double( 0.), @@ -443,7 +443,7 @@ # HLT_AK8PFJetFwd450 AK8PFJetFwd450_Prommonitoring = hltJetMETmonitoring.clone() AK8PFJetFwd450_Prommonitoring.FolderName = cms.string('HLT/JME/Jets/AK8Fwd/PF/HLT_AK8PFJetFwd450/') -AK8PFJetFwd450_Prommonitoring.jetSrc = cms.InputTag("ak8PFJetsCHS") +AK8PFJetFwd450_Prommonitoring.jetSrc = cms.InputTag("ak8PFJetsPuppi") AK8PFJetFwd450_Prommonitoring.histoPSet.jetPtThrPSet = cms.PSet( nbins = cms.uint32 ( 112 ), xmin = cms.double( 0.), @@ -456,7 +456,7 @@ # HLT_AK8PFJetFwd500 AK8PFJetFwd500_Prommonitoring = hltJetMETmonitoring.clone() AK8PFJetFwd500_Prommonitoring.FolderName = cms.string('HLT/JME/Jets/AK8Fwd/PF/HLT_AK8PFJetFwd500/') -AK8PFJetFwd500_Prommonitoring.jetSrc = cms.InputTag("ak8PFJetsCHS") +AK8PFJetFwd500_Prommonitoring.jetSrc = cms.InputTag("ak8PFJetsPuppi") AK8PFJetFwd500_Prommonitoring.histoPSet.jetPtThrPSet = cms.PSet( nbins = cms.uint32 ( 125), xmin = cms.double( 0.), diff --git a/DQMOffline/Trigger/python/MjjMonitor_cfi.py b/DQMOffline/Trigger/python/MjjMonitor_cfi.py index e0a5b4bb5a974..6b4eb32a24144 100644 --- a/DQMOffline/Trigger/python/MjjMonitor_cfi.py +++ b/DQMOffline/Trigger/python/MjjMonitor_cfi.py @@ -16,7 +16,7 @@ xmax = cms.double(19999.5), ) hltMjjmonitoring.met = cms.InputTag("pfMetEI") -hltMjjmonitoring.jets = cms.InputTag("ak8PFJetsCHS") +hltMjjmonitoring.jets = cms.InputTag("ak8PFJetsPuppi") hltMjjmonitoring.electrons = cms.InputTag("gedGsfElectrons") hltMjjmonitoring.muons = cms.InputTag("muons") diff --git a/DataFormats/JetReco/interface/Jet.h b/DataFormats/JetReco/interface/Jet.h index bc077321e910b..56081b3dcc756 100644 --- a/DataFormats/JetReco/interface/Jet.h +++ b/DataFormats/JetReco/interface/Jet.h @@ -33,7 +33,7 @@ namespace reco { }; /// Default constructor - Jet() : mJetArea(0), mPileupEnergy(0), mPassNumber(0) {} + Jet() : mJetArea(0), mPileupEnergy(0), mPassNumber(0), mIsWeighted(false) {} /// Initiator Jet(const LorentzVector& fP4, const Point& fVertex); Jet(const LorentzVector& fP4, const Point& fVertex, const Constituents& fConstituents); @@ -112,12 +112,18 @@ namespace reco { /// number of passes taken by algorithm virtual int nPasses() const { return mPassNumber; } + /// Set boolean if weights were applied by algorithm (e.g. PUPPI weights) + virtual void setIsWeighted(bool isWeighted) { mIsWeighted = isWeighted; } + /// boolean if weights were applied by algorithm (e.g. PUPPI weights) + virtual int isWeighted() const { return mIsWeighted; } + bool isJet() const override; private: float mJetArea; float mPileupEnergy; int mPassNumber; + bool mIsWeighted; }; } // namespace reco #endif diff --git a/DataFormats/JetReco/src/Jet.cc b/DataFormats/JetReco/src/Jet.cc index 16c5b8f78756f..d9a8da5520c15 100644 --- a/DataFormats/JetReco/src/Jet.cc +++ b/DataFormats/JetReco/src/Jet.cc @@ -160,14 +160,14 @@ namespace { } // namespace Jet::Jet(const LorentzVector &fP4, const Point &fVertex, const Constituents &fConstituents) - : CompositePtrCandidate(0, fP4, fVertex), mJetArea(0), mPileupEnergy(0), mPassNumber(0) { + : CompositePtrCandidate(0, fP4, fVertex), mJetArea(0), mPileupEnergy(0), mPassNumber(0), mIsWeighted(false) { for (unsigned i = 0; i < fConstituents.size(); i++) { addDaughter(fConstituents[i]); } } Jet::Jet(const LorentzVector &fP4, const Point &fVertex) - : CompositePtrCandidate(0, fP4, fVertex), mJetArea(0), mPileupEnergy(0), mPassNumber(0) {} + : CompositePtrCandidate(0, fP4, fVertex), mJetArea(0), mPileupEnergy(0), mPassNumber(0), mIsWeighted(false) {} /// eta-phi statistics Jet::EtaPhiMoments Jet::etaPhiStatistics() const { diff --git a/DataFormats/JetReco/src/classes_def_1.xml b/DataFormats/JetReco/src/classes_def_1.xml index f235bc4f88fbd..4665205c679bf 100644 --- a/DataFormats/JetReco/src/classes_def_1.xml +++ b/DataFormats/JetReco/src/classes_def_1.xml @@ -1,5 +1,6 @@ - + + @@ -8,7 +9,8 @@ - + + @@ -39,7 +41,8 @@ - + + @@ -60,7 +63,8 @@ - + + @@ -88,7 +92,8 @@ - + + @@ -112,7 +117,8 @@ - + + diff --git a/DataFormats/JetReco/src/classes_def_3.xml b/DataFormats/JetReco/src/classes_def_3.xml index 3984dba45a20c..b94e17febafc5 100644 --- a/DataFormats/JetReco/src/classes_def_3.xml +++ b/DataFormats/JetReco/src/classes_def_3.xml @@ -1,5 +1,6 @@ - + + @@ -19,7 +20,8 @@ - + + diff --git a/DataFormats/PatCandidates/src/classes_def_objects.xml b/DataFormats/PatCandidates/src/classes_def_objects.xml index e206506aa002a..dd988b5737005 100644 --- a/DataFormats/PatCandidates/src/classes_def_objects.xml +++ b/DataFormats/PatCandidates/src/classes_def_objects.xml @@ -248,7 +248,8 @@ newObj->setPflowIsolationVariables(pfIsoVar);]]> - + + diff --git a/HLTrigger/Configuration/python/customizeHLTforCMSSW.py b/HLTrigger/Configuration/python/customizeHLTforCMSSW.py index cafddd10560d7..d707cd33ebb83 100644 --- a/HLTrigger/Configuration/python/customizeHLTforCMSSW.py +++ b/HLTrigger/Configuration/python/customizeHLTforCMSSW.py @@ -164,6 +164,12 @@ def customiseFor2017DtUnpacking(process): return process +def customiseFor28936(process): + """ Adapt a misconfiguration in hltBoostedDBSVAK8TagInfosPF. Issue #29203 """ + if hasattr(process, 'hltBoostedDBSVAK8TagInfosPF'): + del process.hltBoostedDBSVAK8TagInfosPF.trackSelection.variableJTAParsi + return process + def customiseFor29049(process) : listHltPFRecHitHBHE=['hltParticleFlowRecHitHBHE', @@ -198,7 +204,7 @@ def customizeHLTforCMSSW(process, menuType="GRun"): # add call to action function in proper order: newest last! # process = customiseFor12718(process) - process = customiseFor29049(process) + process = customiseFor28936(process) return process diff --git a/HLTriggerOffline/B2G/python/b2gHadronicHLTEventValidation_cfi.py b/HLTriggerOffline/B2G/python/b2gHadronicHLTEventValidation_cfi.py index bf9df895d2aee..5cbea84a94d4b 100644 --- a/HLTriggerOffline/B2G/python/b2gHadronicHLTEventValidation_cfi.py +++ b/HLTriggerOffline/B2G/python/b2gHadronicHLTEventValidation_cfi.py @@ -6,7 +6,7 @@ # Directory sDir = cms.untracked.string('HLT/B2GHLTValidation/B2G/SingleJet/'), # Jets - sJets = cms.untracked.string('ak8PFJetsCHS'), + sJets = cms.untracked.string('ak8PFJetsPuppi'), ptJets0 = cms.untracked.double(400.), etaJets = cms.untracked.double(2.4), minJets = cms.untracked.uint32(1), @@ -30,7 +30,7 @@ # Directory sDir = cms.untracked.string('HLT/B2GHLTValidation/B2G/DiJet/'), # Jets - sJets = cms.untracked.string('ak8PFJetsCHS'), + sJets = cms.untracked.string('ak8PFJetsPuppi'), ptJets0 = cms.untracked.double(200.), ptJets1 = cms.untracked.double(200.), etaJets = cms.untracked.double(2.4), diff --git a/PhysicsTools/JetMCAlgos/plugins/JetFlavourClustering.cc b/PhysicsTools/JetMCAlgos/plugins/JetFlavourClustering.cc index 0aa938b4e25bc..cb25ebd0414a9 100644 --- a/PhysicsTools/JetMCAlgos/plugins/JetFlavourClustering.cc +++ b/PhysicsTools/JetMCAlgos/plugins/JetFlavourClustering.cc @@ -95,6 +95,7 @@ #include "DataFormats/HepMCCandidate/interface/GenParticleFwd.h" #include "DataFormats/Math/interface/deltaR.h" #include "PhysicsTools/JetMCUtils/interface/CandMCTag.h" +#include "DataFormats/ParticleFlowCandidate/interface/PFCandidate.h" #include "fastjet/JetDefinition.hh" #include "fastjet/ClusterSequence.hh" @@ -158,16 +159,16 @@ class JetFlavourClustering : public edm::stream::EDProducer<> { const bool isLepton, std::vector& constituents); - void matchReclusteredJets(const edm::Handle >& jets, + void matchReclusteredJets(const edm::Handle>& jets, const std::vector& matchedJets, std::vector& matchedIndices); - void matchGroomedJets(const edm::Handle >& jets, - const edm::Handle >& matchedJets, + void matchGroomedJets(const edm::Handle>& jets, + const edm::Handle>& matchedJets, std::vector& matchedIndices); void matchSubjets(const std::vector& groomedIndices, - const edm::Handle >& groomedJets, - const edm::Handle >& subjets, - std::vector >& matchedIndices); + const edm::Handle>& groomedJets, + const edm::Handle>& subjets, + std::vector>& matchedIndices); void setFlavours(const reco::GenParticleRefVector& clusteredbHadrons, const reco::GenParticleRefVector& clusteredcHadrons, @@ -176,17 +177,18 @@ class JetFlavourClustering : public edm::stream::EDProducer<> { int& partonFlavour); void assignToSubjets(const reco::GenParticleRefVector& clusteredParticles, - const edm::Handle >& subjets, + const edm::Handle>& subjets, const std::vector& subjetIndices, std::vector& assignedParticles); // ----------member data --------------------------- - const edm::EDGetTokenT > jetsToken_; // Input jet collection - edm::EDGetTokenT > groomedJetsToken_; // Input groomed jet collection - edm::EDGetTokenT > subjetsToken_; // Input subjet collection + const edm::EDGetTokenT> jetsToken_; // Input jet collection + edm::EDGetTokenT> groomedJetsToken_; // Input groomed jet collection + edm::EDGetTokenT> subjetsToken_; // Input subjet collection const edm::EDGetTokenT bHadronsToken_; // Input b hadron collection const edm::EDGetTokenT cHadronsToken_; // Input c hadron collection const edm::EDGetTokenT partonsToken_; // Input parton collection + edm::EDGetTokenT> weightsToken_; // Input weights collection edm::EDGetTokenT leptonsToken_; // Input lepton collection const std::string jetAlgorithm_; @@ -196,6 +198,7 @@ class JetFlavourClustering : public edm::stream::EDProducer<> { const double relPtTolerance_; const bool hadronFlavourHasPriority_; const bool useSubjets_; + const bool useLeptons_; ClusterSequencePtr fjClusterSeq_; @@ -210,14 +213,13 @@ class JetFlavourClustering : public edm::stream::EDProducer<> { // constructors and destructor // JetFlavourClustering::JetFlavourClustering(const edm::ParameterSet& iConfig) - : - - jetsToken_(consumes >(iConfig.getParameter("jets"))), + : jetsToken_(consumes>(iConfig.getParameter("jets"))), bHadronsToken_(consumes(iConfig.getParameter("bHadrons"))), cHadronsToken_(consumes(iConfig.getParameter("cHadrons"))), partonsToken_(consumes(iConfig.getParameter("partons"))), jetAlgorithm_(iConfig.getParameter("jetAlgorithm")), rParam_(iConfig.getParameter("rParam")), + jetPtMin_( 0.), // hardcoded to 0. since we simply want to recluster all input jets which already had some PtMin applied ghostRescaling_(iConfig.exists("ghostRescaling") ? iConfig.getParameter("ghostRescaling") : 1e-18), @@ -232,6 +234,9 @@ JetFlavourClustering::JetFlavourClustering(const edm::ParameterSet& iConfig) { // register your products produces(); + if (iConfig.existsAs("weights")) + weightsToken_ = consumes>(iConfig.getParameter("weights")); + if (useSubjets_) produces("SubJets"); @@ -247,8 +252,8 @@ JetFlavourClustering::JetFlavourClustering(const edm::ParameterSet& iConfig) << ", use CambridgeAachen | Kt | AntiKt" << std::endl; if (useSubjets_) { - groomedJetsToken_ = consumes >(iConfig.getParameter("groomedJets")); - subjetsToken_ = consumes >(iConfig.getParameter("subjets")); + groomedJetsToken_ = consumes>(iConfig.getParameter("groomedJets")); + subjetsToken_ = consumes>(iConfig.getParameter("subjets")); } if (useLeptons_) { leptonsToken_ = consumes(iConfig.getParameter("leptons")); @@ -266,11 +271,11 @@ JetFlavourClustering::~JetFlavourClustering() { // ------------ method called to produce the data ------------ void JetFlavourClustering::produce(edm::Event& iEvent, const edm::EventSetup& iSetup) { - edm::Handle > jets; + edm::Handle> jets; iEvent.getByToken(jetsToken_, jets); - edm::Handle > groomedJets; - edm::Handle > subjets; + edm::Handle> groomedJets; + edm::Handle> subjets; if (useSubjets_) { iEvent.getByToken(groomedJetsToken_, groomedJets); iEvent.getByToken(subjetsToken_, subjets); @@ -285,6 +290,10 @@ void JetFlavourClustering::produce(edm::Event& iEvent, const edm::EventSetup& iS edm::Handle partons; iEvent.getByToken(partonsToken_, partons); + edm::Handle> weights; + if (!weightsToken_.isUninitialized()) + iEvent.getByToken(weightsToken_, weights); + edm::Handle leptons; if (useLeptons_) iEvent.getByToken(leptonsToken_, leptons); @@ -302,8 +311,8 @@ void JetFlavourClustering::produce(edm::Event& iEvent, const edm::EventSetup& iS fjInputs.reserve(reserve); // loop over all input jets and collect all their constituents for (edm::View::const_iterator it = jets->begin(); it != jets->end(); ++it) { - std::vector > constituents = it->getJetConstituents(); - std::vector >::const_iterator m; + std::vector> constituents = it->getJetConstituents(); + std::vector>::const_iterator m; for (m = constituents.begin(); m != constituents.end(); ++m) { reco::CandidatePtr constit = *m; if (!constit.isNonnull() || !constit.isAvailable()) { @@ -315,7 +324,16 @@ void JetFlavourClustering::produce(edm::Event& iEvent, const edm::EventSetup& iS edm::LogWarning("NullTransverseMomentum") << "dropping input candidate with pt=0"; continue; } - fjInputs.push_back(fastjet::PseudoJet(constit->px(), constit->py(), constit->pz(), constit->energy())); + if (it->isWeighted()) { + if (weightsToken_.isUninitialized()) + throw cms::Exception("MissingConstituentWeight") + << "JetFlavourClustering: No weights (e.g. PUPPI) given for weighted jet collection" << std::endl; + float w = (*weights)[constit]; + fjInputs.push_back( + fastjet::PseudoJet(constit->px() * w, constit->py() * w, constit->pz() * w, constit->energy() * w)); + } else { + fjInputs.push_back(fastjet::PseudoJet(constit->px(), constit->py(), constit->pz(), constit->energy())); + } } } // insert "ghost" b hadrons in the vector of constituents @@ -354,7 +372,7 @@ void JetFlavourClustering::produce(edm::Event& iEvent, const edm::EventSetup& iS } // match subjets and original jets - std::vector > subjetIndices; + std::vector> subjetIndices; if (useSubjets_) { matchSubjets(groomedIndices, groomedJets, subjets, subjetIndices); } @@ -538,7 +556,7 @@ void JetFlavourClustering::insertGhosts(const edm::Handle >& jets, +void JetFlavourClustering::matchReclusteredJets(const edm::Handle>& jets, const std::vector& reclusteredJets, std::vector& matchedIndices) { std::vector matchedLocks(reclusteredJets.size(), false); @@ -579,8 +597,8 @@ void JetFlavourClustering::matchReclusteredJets(const edm::Handle >& jets, - const edm::Handle >& groomedJets, +void JetFlavourClustering::matchGroomedJets(const edm::Handle>& jets, + const edm::Handle>& groomedJets, std::vector& matchedIndices) { std::vector jetLocks(jets->size(), false); std::vector jetIndices; @@ -628,9 +646,9 @@ void JetFlavourClustering::matchGroomedJets(const edm::Handle& groomedIndices, - const edm::Handle >& groomedJets, - const edm::Handle >& subjets, - std::vector >& matchedIndices) { + const edm::Handle>& groomedJets, + const edm::Handle>& subjets, + std::vector>& matchedIndices) { for (size_t g = 0; g < groomedIndices.size(); ++g) { std::vector subjetIndices; @@ -711,7 +729,7 @@ void JetFlavourClustering::setFlavours(const reco::GenParticleRefVector& cluster // ------------ method that assigns clustered particles to subjets ------------ void JetFlavourClustering::assignToSubjets(const reco::GenParticleRefVector& clusteredParticles, - const edm::Handle >& subjets, + const edm::Handle>& subjets, const std::vector& subjetIndices, std::vector& assignedParticles) { // loop over clustered particles and assign them to different subjets based on smallest dR diff --git a/PhysicsTools/PatAlgos/plugins/PATPackedCandidateProducer.cc b/PhysicsTools/PatAlgos/plugins/PATPackedCandidateProducer.cc index 4f525b2021547..eee9380650d98 100644 --- a/PhysicsTools/PatAlgos/plugins/PATPackedCandidateProducer.cc +++ b/PhysicsTools/PatAlgos/plugins/PATPackedCandidateProducer.cc @@ -87,8 +87,6 @@ namespace pat { const edm::EDGetTokenT TKOrigs_; const edm::EDGetTokenT> PuppiWeight_; const edm::EDGetTokenT> PuppiWeightNoLep_; - const edm::EDGetTokenT> PuppiCandsMap_; - const edm::EDGetTokenT> PuppiCands_; const edm::EDGetTokenT> PuppiCandsNoLep_; std::vector>> SVWhiteLists_; const bool storeChargedHadronIsolation_; @@ -129,11 +127,6 @@ pat::PATPackedCandidateProducer::PATPackedCandidateProducer(const edm::Parameter : edm::EDGetTokenT>()), PuppiWeightNoLep_(usePuppi_ ? consumes>(iConfig.getParameter("PuppiNoLepSrc")) : edm::EDGetTokenT>()), - PuppiCandsMap_(usePuppi_ - ? consumes>(iConfig.getParameter("PuppiSrc")) - : edm::EDGetTokenT>()), - PuppiCands_(usePuppi_ ? consumes>(iConfig.getParameter("PuppiSrc")) - : edm::EDGetTokenT>()), PuppiCandsNoLep_( usePuppi_ ? consumes>(iConfig.getParameter("PuppiNoLepSrc")) : edm::EDGetTokenT>()), @@ -174,22 +167,17 @@ void pat::PATPackedCandidateProducer::produce(edm::StreamID, edm::Event &iEvent, iEvent.getByToken(Cands_, cands); edm::Handle> puppiWeight; - edm::Handle> puppiCandsMap; - edm::Handle> puppiCands; edm::Handle> puppiWeightNoLep; edm::Handle> puppiCandsNoLep; std::vector puppiCandsNoLepPtrs; if (usePuppi_) { iEvent.getByToken(PuppiWeight_, puppiWeight); - iEvent.getByToken(PuppiCandsMap_, puppiCandsMap); - iEvent.getByToken(PuppiCands_, puppiCands); iEvent.getByToken(PuppiWeightNoLep_, puppiWeightNoLep); iEvent.getByToken(PuppiCandsNoLep_, puppiCandsNoLep); for (auto pup : *puppiCandsNoLep) { puppiCandsNoLepPtrs.push_back(pup.sourceCandidatePtr(0)); } } - std::vector mappingPuppi(usePuppi_ ? puppiCands->size() : 0); edm::Handle PVOrigs; iEvent.getByToken(PVOrigs_, PVOrigs); @@ -412,7 +400,6 @@ void pat::PATPackedCandidateProducer::produce(edm::StreamID, edm::Event &iEvent, if (usePuppi_) { reco::PFCandidateRef pkref(cands, ic); - // outPtrP->back().setPuppiWeight( (*puppiWeight)[pkref]); float puppiWeightVal = (*puppiWeight)[pkref]; float puppiWeightNoLepVal = 0.0; @@ -437,8 +424,6 @@ void pat::PATPackedCandidateProducer::produce(edm::StreamID, edm::Event &iEvent, } } outPtrP->back().setPuppiWeight(puppiWeightVal, puppiWeightNoLepVal); - - mappingPuppi[((*puppiCandsMap)[pkref]).key()] = ic; } if (storeTiming_) { @@ -477,10 +462,6 @@ void pat::PATPackedCandidateProducer::produce(edm::StreamID, edm::Event &iEvent, mappingTk[i] = reverseOrder[mappingTk[i]]; } - for (size_t i = 0, ntk = mappingPuppi.size(); i < ntk; i++) { - mappingPuppi[i] = reverseOrder[mappingPuppi[i]]; - } - edm::OrphanHandle oh = iEvent.put(std::move(outPtrPSorted)); // now build the two maps @@ -492,8 +473,6 @@ void pat::PATPackedCandidateProducer::produce(edm::StreamID, edm::Event &iEvent, pc2pfFiller.insert(oh, order.begin(), order.end()); // include also the mapping track -> packed PFCand pf2pcFiller.insert(TKOrigs, mappingTk.begin(), mappingTk.end()); - if (usePuppi_) - pf2pcFiller.insert(puppiCands, mappingPuppi.begin(), mappingPuppi.end()); pf2pcFiller.fill(); pc2pfFiller.fill(); diff --git a/PhysicsTools/PatAlgos/python/slimming/applySubstructure_cff.py b/PhysicsTools/PatAlgos/python/slimming/applySubstructure_cff.py index f705622e5940a..06177003c789b 100644 --- a/PhysicsTools/PatAlgos/python/slimming/applySubstructure_cff.py +++ b/PhysicsTools/PatAlgos/python/slimming/applySubstructure_cff.py @@ -14,12 +14,11 @@ def applySubstructure( process, postfix="" ) : # Configure the RECO jets from RecoJets.JetProducers.ak4PFJets_cfi import ak4PFJetsPuppi - from RecoJets.JetProducers.ak8PFJets_cfi import ak8PFJetsPuppi, ak8PFJetsPuppiSoftDrop, ak8PFJetsPuppiConstituents, ak8PFJetsCHSConstituents + from RecoJets.JetProducers.ak8PFJets_cfi import ak8PFJetsPuppi, ak8PFJetsPuppiSoftDrop, ak8PFJetsPuppiConstituents from RecoJets.JetProducers.ak8GenJets_cfi import ak8GenJets, ak8GenJetsSoftDrop, ak8GenJetsConstituents addToProcessAndTask('ak4PFJetsPuppi'+postfix,ak4PFJetsPuppi.clone(), process, task) addToProcessAndTask('ak8PFJetsPuppi'+postfix,ak8PFJetsPuppi.clone(), process, task) addToProcessAndTask('ak8PFJetsPuppiConstituents', ak8PFJetsPuppiConstituents.clone(cut = cms.string('pt > 170.0 && abs(rapidity()) < 2.4') ), process, task ) - addToProcessAndTask('ak8PFJetsCHSConstituents', ak8PFJetsCHSConstituents.clone(), process, task ) addToProcessAndTask('ak8PFJetsPuppiSoftDrop'+postfix, ak8PFJetsPuppiSoftDrop.clone( src = cms.InputTag('ak8PFJetsPuppiConstituents', 'constituents') ), process, task) addToProcessAndTask('ak8GenJetsNoNuConstituents'+postfix, ak8GenJetsConstituents.clone(src='ak8GenJetsNoNu'), process, task ) addToProcessAndTask('ak8GenJetsNoNuSoftDrop'+postfix,ak8GenJetsSoftDrop.clone(src=cms.InputTag('ak8GenJetsNoNuConstituents'+postfix, 'constituents')),process,task) @@ -33,60 +32,6 @@ def applySubstructure( process, postfix="" ) : clearDaughters = cms.bool(False), #False means rekeying dropSpecific = cms.bool(True), # Save space ), process, task ) - - - #add AK8 CHS - addJetCollection(process, postfix=postfix, labelName = 'AK8', - jetSource = cms.InputTag('ak8PFJetsCHS'+postfix), - algo= 'AK', rParam = 0.8, - btagDiscriminators = ['None'], - jetCorrections = ('AK8PFchs', cms.vstring(['L1FastJet', 'L2Relative', 'L3Absolute']), 'None'), - genJetCollection = cms.InputTag('slimmedGenJetsAK8') - ) - getattr(process,"patJetsAK8"+postfix).userData.userFloats.src = [] # start with empty list of user floats - getattr(process,"selectedPatJetsAK8").cut = cms.string("pt > 170") - - - ## add AK8 groomed masses with CHS - from RecoJets.Configuration.RecoPFJets_cff import ak8PFJetsCHSPruned, ak8PFJetsCHSSoftDrop - addToProcessAndTask('ak8PFJetsCHSPruned'+postfix, ak8PFJetsCHSPruned.clone(), process, task) - addToProcessAndTask('ak8PFJetsCHSSoftDrop'+postfix, ak8PFJetsCHSSoftDrop.clone(), process, task) - from RecoJets.JetProducers.ak8PFJetsCHS_groomingValueMaps_cfi import ak8PFJetsCHSPrunedMass, ak8PFJetsCHSTrimmedMass, ak8PFJetsCHSFilteredMass, ak8PFJetsCHSSoftDropMass - addToProcessAndTask('ak8PFJetsCHSPrunedMass'+postfix, ak8PFJetsCHSPrunedMass.clone(), process, task) - addToProcessAndTask('ak8PFJetsCHSTrimmedMass'+postfix, ak8PFJetsCHSTrimmedMass.clone(), process, task) - addToProcessAndTask('ak8PFJetsCHSFilteredMass'+postfix, ak8PFJetsCHSFilteredMass.clone(), process, task) - addToProcessAndTask('ak8PFJetsCHSSoftDropMass'+postfix, ak8PFJetsCHSSoftDropMass.clone(), process, task) - - getattr(process,"patJetsAK8").userData.userFloats.src += ['ak8PFJetsCHSPrunedMass'+postfix,'ak8PFJetsCHSSoftDropMass'+postfix] - getattr(process,"patJetsAK8").addTagInfos = cms.bool(False) - - # add Njetiness for CHS - process.load('RecoJets.JetProducers.nJettinessAdder_cfi') - task.add(process.Njettiness) - addToProcessAndTask('NjettinessAK8'+postfix, process.Njettiness.clone(), process, task) - getattr(process,"NjettinessAK8").src = cms.InputTag("ak8PFJetsCHS"+postfix) - getattr(process,"NjettinessAK8").cone = cms.double(0.8) - getattr(process,"patJetsAK8").userData.userFloats.src += ['NjettinessAK8'+postfix+':tau1','NjettinessAK8'+postfix+':tau2','NjettinessAK8'+postfix+':tau3','NjettinessAK8'+postfix+':tau4'] - - # add Njetiness from CHS - addToProcessAndTask('NjettinessAK8Subjets'+postfix, process.Njettiness.clone(), process, task) - getattr(process,"NjettinessAK8Subjets"+postfix).src = cms.InputTag("ak8PFJetsPuppiSoftDrop"+postfix, "SubJets") - getattr(process,"NjettinessAK8Subjets").cone = cms.double(0.8) - - ## PATify CHS soft drop fat jets - addJetCollection( - process, - postfix=postfix, - labelName = 'AK8PFCHSSoftDrop', - jetSource = cms.InputTag('ak8PFJetsCHSSoftDrop'+postfix), - btagDiscriminators = ['None'], - jetCorrections = ('AK8PFchs', ['L1FastJet', 'L2Relative', 'L3Absolute'], 'None'), - getJetMCFlavour = False # jet flavor disabled - ) - - - - #add RECO AK8 from PUPPI and RECO AK8 PUPPI with soft drop... will be needed by ungroomed AK8 jets later ## PATify puppi soft drop fat jets @@ -131,7 +76,9 @@ def applySubstructure( process, postfix="" ) : e.toModify(getattr(process,'nb1AK8PuppiSoftDrop'+postfix), cuts = ['pt > 999999', 'pt > 999999', 'pt > 999999'] ) e.toModify(getattr(process,'nb2AK8PuppiSoftDrop'+postfix), cuts = ['pt > 999999', 'pt > 999999', 'pt > 999999'] ) - + from RecoJets.JetProducers.nJettinessAdder_cfi import Njettiness + addToProcessAndTask('NjettinessAK8Subjets'+postfix, Njettiness.clone(), process, task) + getattr(process,"NjettinessAK8Subjets"+postfix).src = cms.InputTag("ak8PFJetsPuppiSoftDrop"+postfix, "SubJets") getattr(process,"patJetsAK8PFPuppiSoftDrop").userData.userFloats.src += ['nb1AK8PuppiSoftDrop'+postfix+':ecfN2','nb1AK8PuppiSoftDrop'+postfix+':ecfN3'] getattr(process,"patJetsAK8PFPuppiSoftDrop").userData.userFloats.src += ['nb2AK8PuppiSoftDrop'+postfix+':ecfN2','nb2AK8PuppiSoftDrop'+postfix+':ecfN3'] addToProcessAndTask('nb1AK8PuppiSoftDropSubjets'+postfix, process.ecfNbeta1.clone(src = cms.InputTag("ak8PFJetsPuppiSoftDrop"+postfix, "SubJets")), process, task) @@ -211,56 +158,11 @@ def applySubstructure( process, postfix="" ) : ] - # add PUPPI Njetiness - addToProcessAndTask('NjettinessAK8Puppi'+postfix, process.Njettiness.clone(), process, task) + # add PUPPI Njetiness + addToProcessAndTask('NjettinessAK8Puppi'+postfix, Njettiness.clone(), process, task) getattr(process,"NjettinessAK8Puppi"+postfix).src = cms.InputTag("ak8PFJetsPuppi"+postfix) - getattr(process,"NjettinessAK8Puppi").cone = cms.double(0.8) getattr(process,"patJetsAK8Puppi").userData.userFloats.src += ['NjettinessAK8Puppi'+postfix+':tau1','NjettinessAK8Puppi'+postfix+':tau2','NjettinessAK8Puppi'+postfix+':tau3','NjettinessAK8Puppi'+postfix+':tau4'] - # Now combine the CHS and PUPPI information into the PUPPI jets via delta R value maps - addToProcessAndTask("ak8PFJetsCHSValueMap"+postfix, cms.EDProducer("RecoJetToPatJetDeltaRValueMapProducer", - src = cms.InputTag("ak8PFJetsPuppi"+postfix), - matched = cms.InputTag("patJetsAK8"+postfix), - distMax = cms.double(0.8), - values = cms.vstring([ - 'userFloat("ak8PFJetsCHSPrunedMass"'+postfix+')', - 'userFloat("ak8PFJetsCHSSoftDropMass"'+postfix+')', - 'userFloat("NjettinessAK8'+postfix+':tau1")', - 'userFloat("NjettinessAK8'+postfix+':tau2")', - 'userFloat("NjettinessAK8'+postfix+':tau3")', - 'userFloat("NjettinessAK8'+postfix+':tau4")', - 'pt','eta','phi','mass', 'jetArea', 'jecFactor(0)' - ]), - valueLabels = cms.vstring( [ - 'ak8PFJetsCHSPrunedMass', - 'ak8PFJetsCHSSoftDropMass', - 'NjettinessAK8CHSTau1', - 'NjettinessAK8CHSTau2', - 'NjettinessAK8CHSTau3', - 'NjettinessAK8CHSTau4', - 'pt','eta','phi','mass', 'jetArea', 'rawFactor' - ]) ), - process, task) - - - # Now set up the user floats - getattr(process,"patJetsAK8Puppi"+postfix).userData.userFloats.src += [ - cms.InputTag('ak8PFJetsCHSValueMap'+postfix,'ak8PFJetsCHSPrunedMass'), - cms.InputTag('ak8PFJetsCHSValueMap'+postfix,'ak8PFJetsCHSSoftDropMass'), - cms.InputTag('ak8PFJetsCHSValueMap'+postfix,'NjettinessAK8CHSTau1'), - cms.InputTag('ak8PFJetsCHSValueMap'+postfix,'NjettinessAK8CHSTau2'), - cms.InputTag('ak8PFJetsCHSValueMap'+postfix,'NjettinessAK8CHSTau3'), - cms.InputTag('ak8PFJetsCHSValueMap'+postfix,'NjettinessAK8CHSTau4'), - cms.InputTag('ak8PFJetsCHSValueMap'+postfix,'pt'), - cms.InputTag('ak8PFJetsCHSValueMap'+postfix,'eta'), - cms.InputTag('ak8PFJetsCHSValueMap'+postfix,'phi'), - cms.InputTag('ak8PFJetsCHSValueMap'+postfix,'mass'), - cms.InputTag('ak8PFJetsCHSValueMap'+postfix,'jetArea'), - cms.InputTag('ak8PFJetsCHSValueMap'+postfix,'rawFactor'), - ] - - - addToProcessAndTask("slimmedJetsAK8PFPuppiSoftDropSubjets"+postfix, cms.EDProducer("PATJetSlimmer", diff --git a/PhysicsTools/PatAlgos/python/slimming/miniAOD_tools.py b/PhysicsTools/PatAlgos/python/slimming/miniAOD_tools.py index 559d61e60142d..56b04f8aed5a6 100644 --- a/PhysicsTools/PatAlgos/python/slimming/miniAOD_tools.py +++ b/PhysicsTools/PatAlgos/python/slimming/miniAOD_tools.py @@ -371,12 +371,6 @@ def miniAOD_customizeCommon(process): process.makePatTausTask, _makePatTausTaskWithTauReReco ) - # Adding puppi jets - if not hasattr(process, 'ak4PFJetsPuppi'): #MM: avoid confilct with substructure call - process.load('RecoJets.JetProducers.ak4PFJetsPuppi_cfi') - task.add(process.ak4PFJets) - task.add(process.ak4PFJetsPuppi) - process.ak4PFJetsPuppi.doAreaFastjet = True # even for standard ak4PFJets this is overwritten in RecoJets/Configuration/python/RecoPFJets_cff from RecoJets.JetAssociationProducers.j2tParametersVX_cfi import j2tParametersVX process.ak4PFJetsPuppiTracksAssociatorAtVertex = cms.EDProducer("JetTracksAssociatorAtVertex", j2tParametersVX, @@ -406,24 +400,9 @@ def miniAOD_customizeCommon(process): from PhysicsTools.PatAlgos.slimming.applyDeepBtagging_cff import applyDeepBtagging applyDeepBtagging( process ) - addToProcessAndTask('slimmedJetsPuppiNoMultiplicities', process.slimmedJetsNoDeepFlavour.clone(), process, task) - process.slimmedJetsPuppiNoMultiplicities.src = cms.InputTag("selectedPatJetsPuppi") - process.slimmedJetsPuppiNoMultiplicities.packedPFCandidates = cms.InputTag("packedPFCandidates") - - from PhysicsTools.PatAlgos.patPuppiJetSpecificProducer_cfi import patPuppiJetSpecificProducer - from PhysicsTools.PatAlgos.tools.jetTools import updateJetCollection - process.patPuppiJetSpecificProducer = patPuppiJetSpecificProducer.clone( - src=cms.InputTag("slimmedJetsPuppiNoMultiplicities"), - ) - task.add(process.patPuppiJetSpecificProducer) - updateJetCollection( - process, - labelName = 'PuppiJetSpecific', - jetSource = cms.InputTag('slimmedJetsPuppiNoMultiplicities'), - ) - process.updatedPatJetsPuppiJetSpecific.userData.userFloats.src = ['patPuppiJetSpecificProducer:puppiMultiplicity', 'patPuppiJetSpecificProducer:neutralPuppiMultiplicity', 'patPuppiJetSpecificProducer:neutralHadronPuppiMultiplicity', 'patPuppiJetSpecificProducer:photonPuppiMultiplicity', 'patPuppiJetSpecificProducer:HFHadronPuppiMultiplicity', 'patPuppiJetSpecificProducer:HFEMPuppiMultiplicity' ] - process.slimmedJetsPuppi = process.selectedUpdatedPatJetsPuppiJetSpecific.clone() - delattr(process, 'selectedUpdatedPatJetsPuppiJetSpecific') + addToProcessAndTask('slimmedJetsPuppi', process.slimmedJetsNoDeepFlavour.clone( + src = "selectedPatJetsPuppi", packedPFCandidates = "packedPFCandidates"), + process, task) task.add(process.slimmedJetsPuppi) @@ -520,7 +499,7 @@ def miniAOD_customizeMC(process): process.patJetPartonMatch.matched = "prunedGenParticles" process.patJetPartonMatch.mcStatus = [ 3, 23 ] process.patJetGenJetMatch.matched = "slimmedGenJets" - process.patJetGenJetMatchAK8.matched = "slimmedGenJetsAK8" + process.patJetGenJetMatchAK8Puppi.matched = "slimmedGenJetsAK8" process.patMuons.embedGenMatch = False process.patElectrons.embedGenMatch = False process.patPhotons.embedGenMatch = False diff --git a/PhysicsTools/PatAlgos/python/tools/coreTools.py b/PhysicsTools/PatAlgos/python/tools/coreTools.py index db3eb4357ae42..3375ad836a9b1 100644 --- a/PhysicsTools/PatAlgos/python/tools/coreTools.py +++ b/PhysicsTools/PatAlgos/python/tools/coreTools.py @@ -71,8 +71,8 @@ class RemoveMCMatching(ConfigToolBase): def __init__(self): ConfigToolBase.__init__(self) self.addParameter(self._defaultParameters,'names',['All'], - "collection name; supported are 'Photons', 'OOTPhotons', 'Electrons', 'LowPtElectrons', 'Muons', 'Taus', 'TausBoosted', 'Jets', 'METs', 'All', 'PFAll', 'PFElectrons','PFTaus','PFMuons'", - allowedValues=['Photons', 'OOTPhotons' ,'Electrons', 'LowPtElectrons', 'Muons', 'Taus', 'TausBoosted', 'Jets', 'METs', 'All', 'PFAll', 'PFElectrons','PFTaus','PFMuons']) + "collection name; supported are 'Photons', 'OOTPhotons', 'Electrons', 'LowPtElectrons', 'Muons', 'Taus', 'TausBoosted', 'Jets', 'JetsAK8', 'METs', 'All', 'PFAll', 'PFElectrons','PFTaus','PFMuons'", + allowedValues=['Photons', 'OOTPhotons' ,'Electrons', 'LowPtElectrons', 'Muons', 'Taus', 'TausBoosted', 'Jets', 'JetsAK8', 'METs', 'All', 'PFAll', 'PFElectrons','PFTaus','PFMuons']) self.addParameter(self._defaultParameters,'postfix',"", "postfix of default sequence") self.addParameter(self._defaultParameters,'outputModules',['out'], "names of all output modules specified to be adapted (default is ['out'])") self._parameters=copy.deepcopy(self._defaultParameters) @@ -176,6 +176,10 @@ def toolCode(self, process): getattr(process,outMod).outputCommands.append("drop recoGenJets_*_*_*") else: raise KeyError("process has no OutModule named " + outMod) + + if ( names[obj] == 'JetsAK8' or names[obj] == 'All' ): + print("removing MC dependencies for AK8 jets") + attrsToDelete += ['slimmedGenJetsAK8' + postfix] if( names[obj] == 'METs' or names[obj] == 'All' ): for mod in process.producerNames().split(): diff --git a/PhysicsTools/PatAlgos/python/tools/jetCollectionTools.py b/PhysicsTools/PatAlgos/python/tools/jetCollectionTools.py index 0de2aeb5432b6..e1d9aca20c907 100644 --- a/PhysicsTools/PatAlgos/python/tools/jetCollectionTools.py +++ b/PhysicsTools/PatAlgos/python/tools/jetCollectionTools.py @@ -361,6 +361,11 @@ def addRecoJetCollection(self, useExplicitGhosts = recoJetInfo.doCS or recoJetInfo.jetPUMethod == "sk", ) ) + if recoJetInfo.jetPUMethod == "puppi": + _jets = getattr(proc, jetCollection) + _jets.src = self.pfLabel + _jets.srcWeights = pfCand + _jets.applyWeights = True currentTasks.append(jetCollection) else: jetCollection = inputCollection diff --git a/PhysicsTools/PatAlgos/python/tools/jetTools.py b/PhysicsTools/PatAlgos/python/tools/jetTools.py index 19bf211c46459..c93ec8d105b83 100644 --- a/PhysicsTools/PatAlgos/python/tools/jetTools.py +++ b/PhysicsTools/PatAlgos/python/tools/jetTools.py @@ -597,6 +597,11 @@ def setupBTagging(process, jetSource, pfCandidates, explicitJTA, pvSource, svSou btag.pixelClusterTagInfos.clone(jets = jetSource, vertices=pvSource), process, task) + if 'Puppi' in jetSource.value() and pfCandidates.value() == 'particleFlow' and\ + ('pfBoostedDouble' in btagInfo or 'SecondaryVertex' in btagInfo): + _btagInfo = getattr(process, btagPrefix+btagInfo+labelName+postfix) + _btagInfo.weights = cms.InputTag("puppi") + if 'DeepFlavourTagInfos' in btagInfo: svUsed = svSource if btagInfo == 'pfNegativeDeepFlavourTagInfos': @@ -1173,6 +1178,9 @@ def toolCode(self, process): process, task) knownModules.append('patJetFlavourAssociation'+_labelName+postfix) + if 'Puppi' in jetSource.value() and pfCandidates.value() == 'particleFlow': + _newPatJetFlavourAssociation=getattr(process, 'patJetFlavourAssociation'+_labelName+postfix) + _newPatJetFlavourAssociation.weights = cms.InputTag("puppi") ## modify new patJets collection accordingly _newPatJets.JetFlavourInfoSource.setModuleLabel('patJetFlavourAssociation'+_labelName+postfix) ## if the jets is actually a subjet @@ -1184,6 +1192,7 @@ def toolCode(self, process): _newPatJets.JetFlavourInfoSource=cms.InputTag('patJetFlavourAssociation'+_labelName+postfix,'SubJets') else: _newPatJets.getJetMCFlavour = False + _newPatJets.addJetFlavourInfo = False ## add jetTrackAssociation for legacy btagging (or jetTracksAssociation only) if required by user if (jetTrackAssociation or bTaggingLegacy): diff --git a/PhysicsTools/PatAlgos/test/patTuple_updateJets_fromMiniAOD_cfg.py b/PhysicsTools/PatAlgos/test/patTuple_updateJets_fromMiniAOD_cfg.py index 1081503e74e85..b4708e99456f6 100644 --- a/PhysicsTools/PatAlgos/test/patTuple_updateJets_fromMiniAOD_cfg.py +++ b/PhysicsTools/PatAlgos/test/patTuple_updateJets_fromMiniAOD_cfg.py @@ -13,8 +13,8 @@ ## An example where the jet energy correction are updated to the current GlobalTag ## and a userFloat containing the previous mass of the jet and an additional ## b-tag discriminator are added -from RecoJets.Configuration.RecoPFJets_cff import ak8PFJetsCHSSoftDropMass -process.oldJetMass = ak8PFJetsCHSSoftDropMass.clone( +from RecoJets.Configuration.RecoPFJets_cff import ak8PFJetsPuppiSoftDropMass +process.oldJetMass = ak8PFJetsPuppiSoftDropMass.clone( src = cms.InputTag("slimmedJets"), matched = cms.InputTag("slimmedJets") ) patAlgosToolsTask.add(process.oldJetMass) diff --git a/PhysicsTools/PatUtils/python/tools/runMETCorrectionsAndUncertainties.py b/PhysicsTools/PatUtils/python/tools/runMETCorrectionsAndUncertainties.py index 52d462fab801a..aef263b368e65 100644 --- a/PhysicsTools/PatUtils/python/tools/runMETCorrectionsAndUncertainties.py +++ b/PhysicsTools/PatUtils/python/tools/runMETCorrectionsAndUncertainties.py @@ -273,11 +273,6 @@ def __call__(self, process, if recoMetFromPFCs and reclusterJetsIsNone and not fixEE2017: self.setParameter('reclusterJets',True) - #ZD: puppi jet reclustering breaks the puppi jets - #overwriting of jet reclustering parameter for puppi - if self._parameters["Puppi"].value and not onMiniAOD: - self.setParameter('reclusterJets',False) - self.apply(process) @@ -614,9 +609,9 @@ def getCorrectedMET(self, process, metType, correctionLevel,produceIntermediateC if self._parameters["Puppi"].value: getattr(process, "pat"+metType+"Met"+postfix).srcPFCands = cms.InputTag('puppiForMET') getattr(process, "pat"+metType+"Met"+postfix).srcJets = cms.InputTag('cleanedPatJets'+postfix) - getattr(process, "pat"+metType+"Met"+postfix).srcJetSF = cms.string('AK4PFPuppi') - getattr(process, "pat"+metType+"Met"+postfix).srcJetResPt = cms.string('AK4PFPuppi_pt') - getattr(process, "pat"+metType+"Met"+postfix).srcJetResPhi = cms.string('AK4PFPuppi_phi') + getattr(process, "pat"+metType+"Met"+postfix).srcJetSF = 'AK4PFPuppi' + getattr(process, "pat"+metType+"Met"+postfix).srcJetResPt = 'AK4PFPuppi_pt' + getattr(process, "pat"+metType+"Met"+postfix).srcJetResPhi = 'AK4PFPuppi_phi' #MET significance bypass for the patMETs from AOD if not self._parameters["onMiniAOD"].value and not postfix=="NoHF": @@ -1340,6 +1335,10 @@ def createSmearedJetModule(self, process, jetCollection, smear, varyByNsigmas, v if self._parameters["onMiniAOD"].value: genJetsCollection=cms.InputTag("slimmedGenJets") + if self._parameters["Puppi"].value: + getattr(process, "patSmearedJets"+postfix).algo = 'AK4PFPuppi' + getattr(process, "patSmearedJets"+postfix).algopt = 'AK4PFPuppi_pt' + if "PF" == self._parameters["metType"].value: smearedJetModule = getattr(process, "patSmearedJets"+postfix).clone( src = jetCollection, @@ -1347,11 +1346,7 @@ def createSmearedJetModule(self, process, jetCollection, smear, varyByNsigmas, v variation = cms.int32( int(varyByNsigmas) ), genJets = genJetsCollection, ) - - if self._parameters["Puppi"].value: - smearedJetModule.algo = cms.string('AK4PFPuppi') - smearedJetModule.algopt = cms.string('AK4PFPuppi_pt') - + #MM: FIXME MVA #if "MVA" == self._parameters["metType"].value: # from RecoMET.METProducers.METSigParams_cfi import * @@ -1464,7 +1459,7 @@ def updateJECs(self,process,jetCollection, patMetModuleSequence, postfix): from PhysicsTools.PatAlgos.producersLayer1.jetUpdater_cff import updatedPatJetCorrFactors patJetCorrFactorsReapplyJEC = updatedPatJetCorrFactors.clone( - src = jetCollection if not self._parameters["Puppi"].value else cms.InputTag("slimmedJetsPuppi"), + src = jetCollection, levels = ['L1FastJet', 'L2Relative', 'L3Absolute'], @@ -1475,7 +1470,7 @@ def updateJECs(self,process,jetCollection, patMetModuleSequence, postfix): from PhysicsTools.PatAlgos.producersLayer1.jetUpdater_cff import updatedPatJets patJetsReapplyJEC = updatedPatJets.clone( - jetSource = jetCollection if not self._parameters["Puppi"].value else cms.InputTag("slimmedJetsPuppi"), + jetSource = jetCollection, jetCorrFactorsSource = cms.VInputTag(cms.InputTag("patJetCorrFactorsReapplyJEC"+postfix)) ) @@ -1569,7 +1564,8 @@ def ak4JetReclustering(self,process, pfCandCollection, patMetModuleSequence, pos #puppi if self._parameters["Puppi"].value: - getattr(process, jetColName).src = cms.InputTag("puppi") + getattr(process, jetColName).srcWeights = cms.InputTag("puppi") + getattr(process, jetColName).applyWeights = True patMetModuleSequence += getattr(process, jetColName) diff --git a/PhysicsTools/SelectorUtils/interface/PFJetIDSelectionFunctor.h b/PhysicsTools/SelectorUtils/interface/PFJetIDSelectionFunctor.h index 1a27140bc6e8d..daaf262bd999a 100644 --- a/PhysicsTools/SelectorUtils/interface/PFJetIDSelectionFunctor.h +++ b/PhysicsTools/SelectorUtils/interface/PFJetIDSelectionFunctor.h @@ -270,13 +270,8 @@ class PFJetIDSelectionFunctor : public Selector { nef = patJet->neutralEmEnergyFraction(); nch = patJet->chargedMultiplicity(); muf = patJet->muonEnergyFraction(); - nconstituents = patJet->numberOfDaughters(); + nconstituents = patJet->neutralMultiplicity() + patJet->chargedMultiplicity(); nneutrals = patJet->neutralMultiplicity(); - // Handle the special case of PUPPI jets with weighted multiplicities - if (patJet->hasUserFloat("patPuppiJetSpecificProducer:puppiMultiplicity")) - nconstituents = patJet->userFloat("patPuppiJetSpecificProducer:puppiMultiplicity"); - if (patJet->hasUserFloat("patPuppiJetSpecificProducer:neutralPuppiMultiplicity")) - nneutrals = patJet->userFloat("patPuppiJetSpecificProducer:neutralPuppiMultiplicity"); } // Handle the special case where this is a composed jet for // subjet analyses @@ -301,7 +296,7 @@ class PFJetIDSelectionFunctor : public Selector { e_nef += patsub->neutralEmEnergy(); e_muf += patsub->muonEnergy(); nch += patsub->chargedMultiplicity(); - nconstituents += patsub->numberOfDaughters(); + nconstituents += patsub->neutralMultiplicity() + patsub->chargedMultiplicity(); nneutrals += patsub->neutralMultiplicity(); } else if (pfsub) { e_chf += pfsub->chargedHadronEnergy(); @@ -310,7 +305,7 @@ class PFJetIDSelectionFunctor : public Selector { e_nef += pfsub->neutralEmEnergy(); e_muf += pfsub->muonEnergy(); nch += pfsub->chargedMultiplicity(); - nconstituents += pfsub->numberOfDaughters(); + nconstituents += pfsub->neutralMultiplicity() + pfsub->chargedMultiplicity(); nneutrals += pfsub->neutralMultiplicity(); } else assert(0); @@ -340,7 +335,7 @@ class PFJetIDSelectionFunctor : public Selector { muf = pfJet->muonEnergy() / jetEnergyUncorrected; } nch = pfJet->chargedMultiplicity(); - nconstituents = pfJet->numberOfDaughters(); + nconstituents = pfJet->neutralMultiplicity() + pfJet->chargedMultiplicity(); nneutrals = pfJet->neutralMultiplicity(); } // end if PF jet // Handle the special case where this is a composed jet for @@ -362,7 +357,7 @@ class PFJetIDSelectionFunctor : public Selector { e_nef += pfsub->neutralEmEnergy(); e_muf += pfsub->muonEnergy(); nch += pfsub->chargedMultiplicity(); - nconstituents += pfsub->numberOfDaughters(); + nconstituents += pfsub->neutralMultiplicity() + pfsub->chargedMultiplicity(); nneutrals += pfsub->neutralMultiplicity(); } double e = basicJet->energy(); diff --git a/RecoBTag/Combined/test/testDeepCSV_cfg.py b/RecoBTag/Combined/test/testDeepCSV_cfg.py index b828ccafb4e68..d3841b1182d6c 100644 --- a/RecoBTag/Combined/test/testDeepCSV_cfg.py +++ b/RecoBTag/Combined/test/testDeepCSV_cfg.py @@ -12,8 +12,8 @@ ## An example where the jet energy correction are updated to the current GlobalTag ## and a userFloat containing the previous mass of the jet and an additional ## b-tag discriminator are added -from RecoJets.Configuration.RecoPFJets_cff import ak8PFJetsCHSSoftDropMass -process.oldJetMass = ak8PFJetsCHSSoftDropMass.clone( +from RecoJets.Configuration.RecoPFJets_cff import ak8PFJetsPuppiSoftDropMass +process.oldJetMass = ak8PFJetsPuppiSoftDropMass.clone( src = cms.InputTag("slimmedJets"), matched = cms.InputTag("slimmedJets") ) patAlgosToolsTask.add(process.oldJetMass) diff --git a/RecoBTag/FeatureTools/plugins/DeepDoubleXTagInfoProducer.cc b/RecoBTag/FeatureTools/plugins/DeepDoubleXTagInfoProducer.cc index cdb278693fc21..83342dbcd67f0 100644 --- a/RecoBTag/FeatureTools/plugins/DeepDoubleXTagInfoProducer.cc +++ b/RecoBTag/FeatureTools/plugins/DeepDoubleXTagInfoProducer.cc @@ -84,7 +84,7 @@ void DeepDoubleXTagInfoProducer::fillDescriptions(edm::ConfigurationDescriptions 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")); + desc.add("jets", edm::InputTag("ak8PFJetsPuppi")); descriptions.add("pfDeepDoubleXTagInfos", desc); } diff --git a/RecoBTag/ImpactParameter/python/pfImpactParameterAK8TagInfos_cfi.py b/RecoBTag/ImpactParameter/python/pfImpactParameterAK8TagInfos_cfi.py index dfd219d5a5c0d..26fdd34acc0bb 100644 --- a/RecoBTag/ImpactParameter/python/pfImpactParameterAK8TagInfos_cfi.py +++ b/RecoBTag/ImpactParameter/python/pfImpactParameterAK8TagInfos_cfi.py @@ -5,6 +5,6 @@ pfImpactParameterAK8TagInfos = pfImpactParameterTagInfos.clone( computeProbabilities = cms.bool(False), computeGhostTrack = cms.bool(False), - jets = cms.InputTag("ak8PFJetsCHS"), + jets = cms.InputTag("ak8PFJetsPuppi"), maxDeltaR = cms.double(0.8) ) diff --git a/RecoBTag/ONNXRuntime/test/test_deep_doubleb_cfg_AOD.py b/RecoBTag/ONNXRuntime/test/test_deep_doubleb_cfg_AOD.py index 7ad0824949662..8c82f56a62006 100644 --- a/RecoBTag/ONNXRuntime/test/test_deep_doubleb_cfg_AOD.py +++ b/RecoBTag/ONNXRuntime/test/test_deep_doubleb_cfg_AOD.py @@ -62,7 +62,7 @@ process, #labelName = 'AK8PFCHS', labelName = 'AK8PFPuppi', - #jetSource = cms.InputTag('ak8PFJetsCHS'), + #jetSource = cms.InputTag('ak8PFJetsPuppi'), jetSource = cms.InputTag('ak8PFJetsPuppi'), #pvSource = cms.InputTag('offlinePrimaryVertices'), #svSource = cms.InputTag('inclusiveCandidateSecondaryVertices'), @@ -105,7 +105,7 @@ from Configuration.EventContent.EventContent_cff import MINIAODSIMEventContent #process.out.outputCommands = MINIAODSIMEventContent.outputCommands process.out.outputCommands = patEventContentNoCleaning -process.out.outputCommands.append('keep *_ak8PFJetsCHS*_*_*') +process.out.outputCommands.append('keep *_ak8PFJetsPuppi*_*_*') process.out.outputCommands.append('keep *_offlinePrimaryVertices*_*_*') process.out.outputCommands.append('keep *_inclusiveCandidateSecondaryVertices*_*_*') process.out.outputCommands.append('keep *_selectedPatJets*_*_*') diff --git a/RecoBTag/SecondaryVertex/plugins/BoostedDoubleSVProducer.cc b/RecoBTag/SecondaryVertex/plugins/BoostedDoubleSVProducer.cc index 80c6523ba7e2a..0511d8b9560c4 100644 --- a/RecoBTag/SecondaryVertex/plugins/BoostedDoubleSVProducer.cc +++ b/RecoBTag/SecondaryVertex/plugins/BoostedDoubleSVProducer.cc @@ -81,7 +81,7 @@ class BoostedDoubleSVProducer : public edm::stream::EDProducer<> { std::vector& tau_trackEtaRel) const; // ----------member data --------------------------- - const edm::EDGetTokenT > svTagInfos_; + const edm::EDGetTokenT> svTagInfos_; const double beta_; const double R0_; @@ -92,6 +92,9 @@ class BoostedDoubleSVProducer : public edm::stream::EDProducer<> { reco::V0Filter trackPairV0Filter; reco::TrackSelector trackSelector; + edm::EDGetTokenT> weightsToken_; + edm::Handle> weightsHandle_; + // static variables static constexpr float dummyZ_ratio = -3.0f; static constexpr float dummyTrackSip3dSig = -50.0f; @@ -119,7 +122,7 @@ class BoostedDoubleSVProducer : public edm::stream::EDProducer<> { // BoostedDoubleSVProducer::BoostedDoubleSVProducer(const edm::ParameterSet& iConfig) : svTagInfos_( - consumes >(iConfig.getParameter("svTagInfos"))), + consumes>(iConfig.getParameter("svTagInfos"))), beta_(iConfig.getParameter("beta")), R0_(iConfig.getParameter("R0")), maxSVDeltaRToJet_(iConfig.getParameter("maxSVDeltaRToJet")), @@ -127,7 +130,10 @@ BoostedDoubleSVProducer::BoostedDoubleSVProducer(const edm::ParameterSet& iConfi maxDecayLen_(iConfig.getParameter("trackSelection").getParameter("maxDecayLen")), trackPairV0Filter(iConfig.getParameter("trackPairV0Filter")), trackSelector(iConfig.getParameter("trackSelection")) { - produces >(); + edm::InputTag srcWeights = iConfig.getParameter("weights"); + if (srcWeights.label() != "") + weightsToken_ = consumes>(srcWeights); + produces>(); } BoostedDoubleSVProducer::~BoostedDoubleSVProducer() { @@ -146,11 +152,14 @@ void BoostedDoubleSVProducer::produce(edm::Event& iEvent, const edm::EventSetup& iSetup.get().get("TransientTrackBuilder", trackBuilder); // get input secondary vertex TagInfos - edm::Handle > svTagInfos; + edm::Handle> svTagInfos; iEvent.getByToken(svTagInfos_, svTagInfos); + if (!weightsToken_.isUninitialized()) + iEvent.getByToken(weightsToken_, weightsHandle_); + // create the output collection - auto tagInfos = std::make_unique >(); + auto tagInfos = std::make_unique>(); // loop over TagInfos for (std::vector::const_iterator iterTI = svTagInfos->begin(); @@ -627,7 +636,7 @@ void BoostedDoubleSVProducer::produce(edm::Event& iEvent, const edm::EventSetup& vars.finalize(); tagInfos->push_back(reco::BoostedDoubleSVTagInfo( - vars, edm::Ref >(svTagInfos, iterTI - svTagInfos->begin()))); + vars, edm::Ref>(svTagInfos, iterTI - svTagInfos->begin()))); } // put the output in the event @@ -648,9 +657,9 @@ void BoostedDoubleSVProducer::calcNsubjettiness(const reco::JetBaseRef& jet, if (subjet && daughter->numberOfDaughters() > 1) { // loop over subjet constituents and push them in the vector of FastJet constituents for (size_t i = 0; i < daughter->numberOfDaughters(); ++i) { - const reco::Candidate* constit = daughter->daughter(i); + const reco::CandidatePtr& constit = subjet->daughterPtr(i); - if (constit) { + if (constit.isNonnull()) { // Check if any values were nan or inf float valcheck = constit->px() + constit->py() + constit->pz() + constit->energy(); if (edm::isNotFinite(valcheck)) { @@ -658,7 +667,20 @@ void BoostedDoubleSVProducer::calcNsubjettiness(const reco::JetBaseRef& jet, << "Jet constituent required for N-subjettiness computation contains Nan/Inf values!"; continue; } - fjParticles.push_back(fastjet::PseudoJet(constit->px(), constit->py(), constit->pz(), constit->energy())); + if (subjet->isWeighted()) { + float w = 0.0; + if (!weightsToken_.isUninitialized()) + w = (*weightsHandle_)[constit]; + else { + w = 1.0; // For backward compatibility PUPPI weight is not applied to PackedCandidates. + //throw cms::Exception("MissingConstituentWeight") + // << "BoostedDoubleSVProducer: No weights (e.g. PUPPI) given for weighted jet collection" + // << std::endl; + } + fjParticles.push_back( + fastjet::PseudoJet(constit->px() * w, constit->py() * w, constit->pz() * w, constit->energy() * w)); + } else + fjParticles.push_back(fastjet::PseudoJet(constit->px(), constit->py(), constit->pz(), constit->energy())); } else edm::LogWarning("MissingJetConstituent") << "Jet constituent required for N-subjettiness computation is missing!"; @@ -671,7 +693,19 @@ void BoostedDoubleSVProducer::calcNsubjettiness(const reco::JetBaseRef& jet, << "Jet constituent required for N-subjettiness computation contains Nan/Inf values!"; continue; } - fjParticles.push_back(fastjet::PseudoJet(daughter->px(), daughter->py(), daughter->pz(), daughter->energy())); + if (jet->isWeighted()) { + float w = 0.0; + if (!weightsToken_.isUninitialized()) + w = (*weightsHandle_)[daughter]; + else { + w = 1.0; // For backward compatibility PUPPI weight is not applied to PackedCandidates. + //throw cms::Exception("MissingConstituentWeight") + // << "BoostedDoubleSVProducer: No weights (e.g. PUPPI) given for weighted jet collection" << std::endl; + } + fjParticles.push_back( + fastjet::PseudoJet(daughter->px() * w, daughter->py() * w, daughter->pz() * w, daughter->energy() * w)); + } else + fjParticles.push_back(fastjet::PseudoJet(daughter->px(), daughter->py(), daughter->pz(), daughter->energy())); } } else edm::LogWarning("MissingJetConstituent") << "Jet constituent required for N-subjettiness computation is missing!"; @@ -745,10 +779,22 @@ void BoostedDoubleSVProducer::endStream() {} // ------------ method fills 'descriptions' with the allowed parameters for the module ------------ void BoostedDoubleSVProducer::fillDescriptions(edm::ConfigurationDescriptions& descriptions) { - //The following says we do not know what parameters are allowed so do no validation - // Please change this to state exactly what you do use, even if it is no parameters edm::ParameterSetDescription desc; - desc.setUnknown(); + desc.add("beta", 1.0); + desc.add("R0", 0.8); + desc.add("maxSVDeltaRToJet", 0.7); + { + edm::ParameterSetDescription trackSelection; + trackSelection.setAllowAnything(); + desc.add("trackSelection", trackSelection); + } + { + edm::ParameterSetDescription trackPairV0Filter; + trackPairV0Filter.add("k0sMassWindow", 0.03); + desc.add("trackPairV0Filter", trackPairV0Filter); + } + desc.add("svTagInfos", edm::InputTag("pfInclusiveSecondaryVertexFinderAK8TagInfos")); + desc.add("weights", edm::InputTag("")); descriptions.addDefault(desc); } diff --git a/RecoBTag/SecondaryVertex/plugins/TemplatedSecondaryVertexProducer.cc b/RecoBTag/SecondaryVertex/plugins/TemplatedSecondaryVertexProducer.cc index 256aa4f270aa9..73547526a3355 100644 --- a/RecoBTag/SecondaryVertex/plugins/TemplatedSecondaryVertexProducer.cc +++ b/RecoBTag/SecondaryVertex/plugins/TemplatedSecondaryVertexProducer.cc @@ -22,6 +22,10 @@ #include "FWCore/MessageLogger/interface/MessageLogger.h" #include "FWCore/Utilities/interface/Exception.h" +#include "FWCore/ParameterSet/interface/Registry.h" +#include "FWCore/Common/interface/Provenance.h" +#include "DataFormats/Provenance/interface/ProductProvenance.h" + #include "DataFormats/PatCandidates/interface/Jet.h" #include "DataFormats/TrackReco/interface/Track.h" #include "DataFormats/TrackReco/interface/TrackFwd.h" @@ -162,6 +166,7 @@ class TemplatedSecondaryVertexProducer : public edm::stream::EDProducer<> { bool useGroomedFatJets; edm::EDGetTokenT > token_fatJets; edm::EDGetTokenT > token_groomedFatJets; + edm::EDGetTokenT > token_weights; ClusterSequencePtr fjClusterSeq; JetDefPtr fjJetDefinition; @@ -286,10 +291,15 @@ TemplatedSecondaryVertexProducer::TemplatedSecondaryVertexProducer(co throw cms::Exception("InvalidJetAlgorithm") << "Jet clustering algorithm is invalid: " << jetAlgorithm << ", use CambridgeAachen | Kt | AntiKt" << std::endl; } - if (useFatJets) + if (useFatJets) { token_fatJets = consumes >(params.getParameter("fatJets")); - if (useGroomedFatJets) + } + edm::InputTag srcWeights = params.getParameter("weights"); + if (srcWeights.label() != "") + token_weights = consumes >(srcWeights); + if (useGroomedFatJets) { token_groomedFatJets = consumes >(params.getParameter("groomedFatJets")); + } if (useFatJets && !useSVClustering) rParam = params.getParameter("rParam"); // will be used later as a dR cut @@ -320,7 +330,6 @@ void TemplatedSecondaryVertexProducer::produce(edm::Event &event, con edm::Handle > groomedFatJetsHandle; if (useFatJets) { event.getByToken(token_fatJets, fatJetsHandle); - if (useGroomedFatJets) { event.getByToken(token_groomedFatJets, groomedFatJetsHandle); @@ -330,6 +339,9 @@ void TemplatedSecondaryVertexProducer::produce(edm::Event &event, con << fatJetsHandle->size() << "). Please check that the two jet collections belong to each other."; } } + edm::Handle > weightsHandle; + if (!token_weights.isUninitialized()) + event.getByToken(token_weights, weightsHandle); edm::Handle beamSpot; unsigned int bsCovSrc[7] = { @@ -380,7 +392,17 @@ void TemplatedSecondaryVertexProducer::produce(edm::Event &event, con edm::LogWarning("NullTransverseMomentum") << "dropping input candidate with pt=0"; continue; } - fjInputs.push_back(fastjet::PseudoJet(constit->px(), constit->py(), constit->pz(), constit->energy())); + if (it->isWeighted()) { + if (token_weights.isUninitialized()) + throw cms::Exception("MissingConstituentWeight") + << "TemplatedSecondaryVertexProducer: No weights (e.g. PUPPI) given for weighted jet collection" + << std::endl; + float w = (*weightsHandle)[constit]; + fjInputs.push_back( + fastjet::PseudoJet(constit->px() * w, constit->py() * w, constit->pz() * w, constit->energy() * w)); + } else { + fjInputs.push_back(fastjet::PseudoJet(constit->px(), constit->py(), constit->pz(), constit->energy())); + } } } } else { @@ -394,7 +416,17 @@ void TemplatedSecondaryVertexProducer::produce(edm::Event &event, con edm::LogWarning("NullTransverseMomentum") << "dropping input candidate with pt=0"; continue; } - fjInputs.push_back(fastjet::PseudoJet(constit->px(), constit->py(), constit->pz(), constit->energy())); + if (it->jet()->isWeighted()) { + if (token_weights.isUninitialized()) + throw cms::Exception("MissingConstituentWeight") + << "TemplatedSecondaryVertexProducer: No weights (e.g. PUPPI) given for weighted jet collection" + << std::endl; + float w = (*weightsHandle)[constit]; + fjInputs.push_back( + fastjet::PseudoJet(constit->px() * w, constit->py() * w, constit->pz() * w, constit->energy() * w)); + } else { + fjInputs.push_back(fastjet::PseudoJet(constit->px(), constit->py(), constit->pz(), constit->energy())); + } } } } @@ -1272,6 +1304,7 @@ void TemplatedSecondaryVertexProducer::fillDescriptions(edm::Configur desc.addOptional("relPtTolerance", 1e-03); desc.addOptional("fatJets"); desc.addOptional("groomedFatJets"); + desc.add("weights", edm::InputTag("")); descriptions.addDefault(desc); } diff --git a/RecoBTag/SecondaryVertex/python/pfBoostedDoubleSVAK8TagInfos_cfi.py b/RecoBTag/SecondaryVertex/python/pfBoostedDoubleSVAK8TagInfos_cfi.py index 8a6174dd4bc3f..febfaf143f0b0 100644 --- a/RecoBTag/SecondaryVertex/python/pfBoostedDoubleSVAK8TagInfos_cfi.py +++ b/RecoBTag/SecondaryVertex/python/pfBoostedDoubleSVAK8TagInfos_cfi.py @@ -8,7 +8,8 @@ R0 = cms.double(0.8), maxSVDeltaRToJet = cms.double(0.7), trackPairV0Filter = cms.PSet(k0sMassWindow = cms.double(0.03)), - svTagInfos = cms.InputTag("pfInclusiveSecondaryVertexFinderAK8TagInfos") + svTagInfos = cms.InputTag("pfInclusiveSecondaryVertexFinderAK8TagInfos"), + weights = cms.InputTag("") ) pfBoostedDoubleSVAK8TagInfos.trackSelection.jetDeltaRMax = cms.double(0.8) diff --git a/RecoBTag/SecondaryVertex/python/pfBoostedDoubleSVCA15TagInfos_cfi.py b/RecoBTag/SecondaryVertex/python/pfBoostedDoubleSVCA15TagInfos_cfi.py index f5599446bd3d8..31f0c1e08bf78 100644 --- a/RecoBTag/SecondaryVertex/python/pfBoostedDoubleSVCA15TagInfos_cfi.py +++ b/RecoBTag/SecondaryVertex/python/pfBoostedDoubleSVCA15TagInfos_cfi.py @@ -8,7 +8,8 @@ R0 = cms.double(1.5), maxSVDeltaRToJet = cms.double(1.0), trackPairV0Filter = cms.PSet(k0sMassWindow = cms.double(0.03)), - svTagInfos = cms.InputTag("pfInclusiveSecondaryVertexFinderCA15TagInfos") + svTagInfos = cms.InputTag("pfInclusiveSecondaryVertexFinderCA15TagInfos"), + weights = cms.InputTag("") ) pfBoostedDoubleSVCA15TagInfos.trackSelection.jetDeltaRMax = cms.double(1.5) diff --git a/RecoJets/Configuration/python/RecoJets_EventContent_cff.py b/RecoJets/Configuration/python/RecoJets_EventContent_cff.py index a1744f1f464fa..c1bd0d76dec5b 100644 --- a/RecoJets/Configuration/python/RecoJets_EventContent_cff.py +++ b/RecoJets/Configuration/python/RecoJets_EventContent_cff.py @@ -6,9 +6,10 @@ 'keep *_ak4CaloJets_rho_*', 'keep *_ak4CaloJets_sigma_*', 'keep *_ak4PFJetsCHS_*_*', - 'keep *_ak8PFJetsCHS_*_*', - 'keep *_ak8PFJetsCHSSoftDrop_*_*', - 'keep *_cmsTopTagPFJetsCHS_*_*', + 'keep floatedmValueMap_puppi_*_*', + 'keep *_ak4PFJetsPuppi_*_*', + 'keep *_ak8PFJetsPuppi_*_*', + 'keep *_ak8PFJetsPuppiSoftDrop_*_*', 'keep recoPFJets_ak4PFJets_*_*', 'keep *_ak4PFJets_rho_*', 'keep *_ak4PFJets_sigma_*', @@ -36,7 +37,7 @@ 'keep *_fixedGridRhoFastjetCentralCalo_*_*', 'keep *_fixedGridRhoFastjetCentralChargedPileUp_*_*', 'keep *_fixedGridRhoFastjetCentralNeutral_*_*', - 'keep *_ak8PFJetsCHSSoftDropMass_*_*' + 'keep *_ak8PFJetsPuppiSoftDropMass_*_*' ) ) RecoGenJetsAOD = cms.PSet( diff --git a/RecoJets/Configuration/python/RecoPFJets_cff.py b/RecoJets/Configuration/python/RecoPFJets_cff.py index eed9d4e32b37d..afbabf0e44c1a 100644 --- a/RecoJets/Configuration/python/RecoPFJets_cff.py +++ b/RecoJets/Configuration/python/RecoPFJets_cff.py @@ -5,13 +5,12 @@ from RecoJets.JetProducers.kt4PFJets_cfi import * from RecoJets.JetProducers.kt6PFJets_cfi import * from RecoJets.JetProducers.ca15PFJets_cfi import * -from RecoJets.JetProducers.caTopTaggers_cff import cmsTopTagPFJetsCHS from CommonTools.ParticleFlow.pfNoPileUpJME_cff import * from CommonTools.PileupAlgos.Puppi_cff import puppi from CommonTools.PileupAlgos.softKiller_cfi import softKiller from RecoJets.JetProducers.fixedGridRhoProducer_cfi import fixedGridRhoAll from RecoJets.JetProducers.fixedGridRhoProducerFastjet_cfi import fixedGridRhoFastjetAll -from RecoJets.JetProducers.ak8PFJetsCHS_groomingValueMaps_cfi import ak8PFJetsCHSPrunedMass, ak8PFJetsCHSFilteredMass, ak8PFJetsCHSTrimmedMass, ak8PFJetsCHSSoftDropMass +from RecoJets.JetProducers.ak8PFJetsPuppi_groomingValueMaps_cfi import ak8PFJetsPuppiSoftDropMass fixedGridRhoFastjetCentral = fixedGridRhoFastjetAll.clone( @@ -34,13 +33,14 @@ fixedGridRhoFastjetCentralChargedPileUp, fixedGridRhoFastjetCentralNeutral, ak4PFJets, + pfNoPileUpJMETask, ak4PFJetsCHS, - ak8PFJetsCHS, - ak8PFJetsCHSConstituents, - ak8PFJetsCHSSoftDrop, - ak8PFJetsCHSSoftDropMass, - cmsTopTagPFJetsCHS, - pfNoPileUpJMETask + puppi, + ak4PFJetsPuppi, + ak8PFJetsPuppi, + ak8PFJetsPuppiConstituents, + ak8PFJetsPuppiSoftDrop, + ak8PFJetsPuppiSoftDropMass ) recoPFJets = cms.Sequence(recoPFJetsTask) @@ -49,25 +49,15 @@ fixedGridRhoFastjetCentral, fixedGridRhoFastjetCentralChargedPileUp, fixedGridRhoFastjetCentralNeutral, - ak4PFJets,ak8PFJets, + ak4PFJets, + ak8PFJets, pfNoPileUpJMETask, - ak8PFJetsCHS, - ak8PFJetsCHSPruned, - ak8PFJetsCHSFiltered, - ak8PFJetsCHSTrimmed, - ak8PFJetsCHSSoftDrop, - ak4PFJetsCHS, - ak8PFJetsCHS, - ak8PFJetsCHSPruned, - ak8PFJetsCHSFiltered, - ak8PFJetsCHSTrimmed, - ak8PFJetsCHSSoftDrop, - ak8PFJetsCHSPrunedMass, - ak8PFJetsCHSTrimmedMass, - ak8PFJetsCHSSoftDropMass, - ak8PFJetsCHSFilteredMass, - ca15PFJetsCHSMassDropFiltered, - ca15PFJetsCHSFiltered + ak4PFJetsCHS, + puppi, + ak4PFJetsPuppi, + ak8PFJetsPuppi, + ak8PFJetsPuppiSoftDrop, + ak8PFJetsPuppiSoftDropMass ) recoAllPFJets=cms.Sequence(recoAllPFJetsTask) @@ -77,30 +67,18 @@ fixedGridRhoFastjetCentral, fixedGridRhoFastjetCentralChargedPileUp, fixedGridRhoFastjetCentralNeutral, - ak4PFJets,ak8PFJets, + ak4PFJets, + ak8PFJets, pfNoPileUpJMETask, - ak8PFJetsCHS, - ak8PFJetsCHSPruned, - ak8PFJetsCHSFiltered, - ak8PFJetsCHSTrimmed, - ak8PFJetsCHSSoftDrop, - ak4PFJetsCHS, - ak8PFJetsCHS, - ak8PFJetsCHSPruned, - ak8PFJetsCHSFiltered, - ak8PFJetsCHSTrimmed, - ak8PFJetsCHSSoftDrop, - ak8PFJetsCHSConstituents, - ak8PFJetsCHSPrunedMass, - ak8PFJetsCHSTrimmedMass, - ak8PFJetsCHSSoftDropMass, - ak8PFJetsCHSFilteredMass, - ca15PFJetsCHSMassDropFiltered, - ca15PFJetsCHSFiltered, - ak8PFJetsCS, - ak8PFJetsCSConstituents, + ak4PFJetsCHS, puppi, ak4PFJetsPuppi, + ak8PFJetsPuppi, + ak8PFJetsPuppiSoftDrop, + ak8PFJetsPuppiConstituents, + ak8PFJetsPuppiSoftDropMass, + ak8PFJetsCS, + ak8PFJetsCSConstituents, softKiller, ak4PFJetsSK ) @@ -116,7 +94,6 @@ pfNoPileUpJMEHI, ak4PFJets, ak4PFJetsCHS, - ak8PFJetsCHS, PFTowers, akPu3PFJets, akPu4PFJets, diff --git a/RecoJets/JetProducers/interface/ECFAdder.h b/RecoJets/JetProducers/interface/ECFAdder.h index c26edecace1f9..239658cc1f2b7 100644 --- a/RecoJets/JetProducers/interface/ECFAdder.h +++ b/RecoJets/JetProducers/interface/ECFAdder.h @@ -33,6 +33,8 @@ class ECFAdder : public edm::stream::EDProducer<> { std::vector>> routine_; std::vector> selectors_; + edm::EDGetTokenT> input_weights_token_; + edm::ValueMap const* weightsHandle_; }; #endif diff --git a/RecoJets/JetProducers/interface/JetSpecific.h b/RecoJets/JetProducers/interface/JetSpecific.h index e7e2ec973f56c..16aa325650492 100644 --- a/RecoJets/JetProducers/interface/JetSpecific.h +++ b/RecoJets/JetProducers/interface/JetSpecific.h @@ -32,13 +32,16 @@ namespace reco { edm::EventSetup const& c); /// Make PFlowJet specifics. Assumes PseudoJet is made from ParticleFlowCandidates - bool makeSpecific(std::vector const& particles, reco::PFJet::Specific* pfJetSpecific); + bool makeSpecific(std::vector const& particles, + reco::PFJet::Specific* pfJetSpecific, + edm::ValueMap const* weights = nullptr); void writeSpecific(reco::PFJet& jet, reco::Particle::LorentzVector const& p4, reco::Particle::Point const& point, std::vector const& constituents, - edm::EventSetup const& c); + edm::EventSetup const& c, + edm::ValueMap const* weights = nullptr); /// Make GenJet specifics. Assumes PseudoJet is made from HepMCCandidate bool makeSpecific(std::vector const& mcparticles, reco::GenJet::Specific* genJetSpecific); diff --git a/RecoJets/JetProducers/interface/NjettinessAdder.h b/RecoJets/JetProducers/interface/NjettinessAdder.h index 199bceeedbe52..551746ce4d8aa 100644 --- a/RecoJets/JetProducers/interface/NjettinessAdder.h +++ b/RecoJets/JetProducers/interface/NjettinessAdder.h @@ -62,6 +62,9 @@ class NjettinessAdder : public edm::stream::EDProducer<> { int nPass_; double akAxesR0_; + edm::EDGetTokenT> input_weights_token_; + edm::ValueMap const* weightsHandle_; + std::unique_ptr routine_; }; diff --git a/RecoJets/JetProducers/plugins/ECFAdder.cc b/RecoJets/JetProducers/plugins/ECFAdder.cc index 506ae947a5de2..aa808d0ef42ee 100644 --- a/RecoJets/JetProducers/plugins/ECFAdder.cc +++ b/RecoJets/JetProducers/plugins/ECFAdder.cc @@ -18,6 +18,10 @@ ECFAdder::ECFAdder(const edm::ParameterSet& iConfig) throw cms::Exception("ConfigurationError") << "cuts and Njets must be the same size in ECFAdder" << std::endl; } + edm::InputTag srcWeights = iConfig.getParameter("srcWeights"); + if (srcWeights.label() != "") + input_weights_token_ = consumes>(srcWeights); + for (std::vector::const_iterator n = Njets_.begin(); n != Njets_.end(); ++n) { std::ostringstream ecfN_str; std::shared_ptr> pfunc; @@ -55,6 +59,10 @@ void ECFAdder::produce(edm::Event& iEvent, const edm::EventSetup& iSetup) { edm::Handle> jets; iEvent.getByToken(src_token_, jets); + // Get Weights Collection + if (!input_weights_token_.isUninitialized()) + weightsHandle_ = &iEvent.get(input_weights_token_); + unsigned i = 0; for (std::vector::const_iterator n = Njets_.begin(); n != Njets_.end(); ++n) { // prepare room for output @@ -82,19 +90,33 @@ void ECFAdder::produce(edm::Event& iEvent, const edm::EventSetup& iSetup) { } float ECFAdder::getECF(unsigned index, const edm::Ptr& object) const { - std::vector FJparticles; + std::vector fjParticles; for (unsigned k = 0; k < object->numberOfDaughters(); ++k) { const reco::CandidatePtr& dp = object->daughterPtr(k); if (dp.isNonnull() && dp.isAvailable()) { // Here, the daughters are the "end" node, so this is a PFJet if (dp->numberOfDaughters() == 0) { - FJparticles.push_back(fastjet::PseudoJet(dp->px(), dp->py(), dp->pz(), dp->energy())); + if (object->isWeighted()) { + if (input_weights_token_.isUninitialized()) + throw cms::Exception("MissingConstituentWeight") + << "ECFAdder: No weights (e.g. PUPPI) given for weighted jet collection" << std::endl; + float w = (*weightsHandle_)[dp]; + fjParticles.push_back(fastjet::PseudoJet(dp->px() * w, dp->py() * w, dp->pz() * w, dp->energy() * w)); + } else + fjParticles.push_back(fastjet::PseudoJet(dp->px(), dp->py(), dp->pz(), dp->energy())); } else { // Otherwise, this is a BasicJet, so you need to descend further. auto subjet = dynamic_cast(dp.get()); for (unsigned l = 0; l < subjet->numberOfDaughters(); ++l) { if (subjet != nullptr) { const reco::CandidatePtr& ddp = subjet->daughterPtr(l); - FJparticles.push_back(fastjet::PseudoJet(ddp->px(), ddp->py(), ddp->pz(), ddp->energy())); + if (subjet->isWeighted()) { + if (input_weights_token_.isUninitialized()) + throw cms::Exception("MissingConstituentWeight") + << "ECFAdder: No weights (e.g. PUPPI) given for weighted jet collection" << std::endl; + float w = (*weightsHandle_)[ddp]; + fjParticles.push_back(fastjet::PseudoJet(ddp->px() * w, ddp->py() * w, ddp->pz() * w, ddp->energy() * w)); + } else + fjParticles.push_back(fastjet::PseudoJet(ddp->px(), ddp->py(), ddp->pz(), ddp->energy())); } else { edm::LogWarning("MissingJetConstituent") << "BasicJet constituent required for ECF computation is missing!"; } @@ -104,8 +126,8 @@ float ECFAdder::getECF(unsigned index, const edm::Ptr& object) const else edm::LogWarning("MissingJetConstituent") << "Jet constituent required for ECF computation is missing!"; } - if (FJparticles.size() > Njets_[index]) { - return routine_[index]->result(join(FJparticles)); + if (fjParticles.size() > Njets_[index]) { + return routine_[index]->result(join(fjParticles)); } else { return -1.0; } @@ -123,6 +145,7 @@ void ECFAdder::fillDescriptions(edm::ConfigurationDescriptions& descriptions) { iDesc.add("alpha", 1.0)->setComment("alpha factor, only valid for N2"); iDesc.add("beta", 1.0)->setComment("angularity factor"); iDesc.add("ecftype", "")->setComment("ECF type: ECF or empty; C; D; N; M; U;"); + iDesc.add("srcWeights", edm::InputTag("puppi")); descriptions.add("ECFAdder", iDesc); } diff --git a/RecoJets/JetProducers/plugins/NjettinessAdder.cc b/RecoJets/JetProducers/plugins/NjettinessAdder.cc index 340ebc3dd0727..db8e6b23587a5 100644 --- a/RecoJets/JetProducers/plugins/NjettinessAdder.cc +++ b/RecoJets/JetProducers/plugins/NjettinessAdder.cc @@ -13,6 +13,10 @@ NjettinessAdder::NjettinessAdder(const edm::ParameterSet& iConfig) axesDefinition_(iConfig.getParameter("axesDefinition")), nPass_(iConfig.getParameter("nPass")), akAxesR0_(iConfig.getParameter("akAxesR0")) { + edm::InputTag srcWeights = iConfig.getParameter("srcWeights"); + if (srcWeights.label() != "") + input_weights_token_ = consumes>(srcWeights); + for (std::vector::const_iterator n = Njets_.begin(); n != Njets_.end(); ++n) { std::ostringstream tauN_str; tauN_str << "tau" << *n; @@ -108,6 +112,10 @@ void NjettinessAdder::produce(edm::Event& iEvent, const edm::EventSetup& iSetup) edm::Handle> jets; iEvent.getByToken(src_token_, jets); + // Get Weights Collection + if (!input_weights_token_.isUninitialized()) + weightsHandle_ = &iEvent.get(input_weights_token_); + for (std::vector::const_iterator n = Njets_.begin(); n != Njets_.end(); ++n) { std::ostringstream tauN_str; tauN_str << "tau" << *n; @@ -134,16 +142,45 @@ void NjettinessAdder::produce(edm::Event& iEvent, const edm::EventSetup& iSetup) } float NjettinessAdder::getTau(unsigned num, const edm::Ptr& object) const { - std::vector FJparticles; + std::vector fjParticles; for (unsigned k = 0; k < object->numberOfDaughters(); ++k) { const reco::CandidatePtr& dp = object->daughterPtr(k); - if (dp.isNonnull() && dp.isAvailable()) - FJparticles.push_back(fastjet::PseudoJet(dp->px(), dp->py(), dp->pz(), dp->energy())); + if (dp.isNonnull() && dp.isAvailable()) { + // Here, the daughters are the "end" node, so this is a PFJet + if (dp->numberOfDaughters() == 0) { + if (object->isWeighted()) { + if (input_weights_token_.isUninitialized()) + throw cms::Exception("MissingConstituentWeight") + << "ECFAdder: No weights (e.g. PUPPI) given for weighted jet collection" << std::endl; + float w = (*weightsHandle_)[dp]; + fjParticles.push_back(fastjet::PseudoJet(dp->px() * w, dp->py() * w, dp->pz() * w, dp->energy() * w)); + } else + fjParticles.push_back(fastjet::PseudoJet(dp->px(), dp->py(), dp->pz(), dp->energy())); + } else { // Otherwise, this is a BasicJet, so you need to descend further. + auto subjet = dynamic_cast(dp.get()); + for (unsigned l = 0; l < subjet->numberOfDaughters(); ++l) { + if (subjet != nullptr) { + const reco::CandidatePtr& ddp = subjet->daughterPtr(l); + if (subjet->isWeighted()) { + if (input_weights_token_.isUninitialized()) + throw cms::Exception("MissingConstituentWeight") + << "ECFAdder: No weights (e.g. PUPPI) given for weighted jet collection" << std::endl; + float w = (*weightsHandle_)[ddp]; + fjParticles.push_back(fastjet::PseudoJet(ddp->px() * w, ddp->py() * w, ddp->pz() * w, ddp->energy() * w)); + } else + fjParticles.push_back(fastjet::PseudoJet(ddp->px(), ddp->py(), ddp->pz(), ddp->energy())); + } else { + edm::LogWarning("MissingJetConstituent") + << "BasicJet constituent required for N-jettiness computation is missing!"; + } + } + } // end if basic jet + } // end if daughter pointer is nonnull and available else - edm::LogWarning("MissingJetConstituent") << "Jet constituent required for N-subjettiness computation is missing!"; + edm::LogWarning("MissingJetConstituent") << "Jet constituent required for N-jettiness computation is missing!"; } - return routine_->getTau(num, FJparticles); + return routine_->getTau(num, fjParticles); } DEFINE_FWK_MODULE(NjettinessAdder); diff --git a/RecoJets/JetProducers/plugins/VirtualJetProducer.cc b/RecoJets/JetProducers/plugins/VirtualJetProducer.cc index 52d908e23a2ab..6fb7a81916f0c 100644 --- a/RecoJets/JetProducers/plugins/VirtualJetProducer.cc +++ b/RecoJets/JetProducers/plugins/VirtualJetProducer.cc @@ -148,6 +148,15 @@ VirtualJetProducer::VirtualJetProducer(const edm::ParameterSet& iConfig) { useDeterministicSeed_ = iConfig.getParameter("useDeterministicSeed"); minSeed_ = iConfig.getParameter("minSeed"); verbosity_ = iConfig.getParameter("verbosity"); + applyWeight_ = iConfig.getParameter("applyWeight"); + if (applyWeight_) { + edm::InputTag srcWeights = iConfig.getParameter("srcWeights"); + if (srcWeights.label() == src_.label()) + LogWarning("VirtualJetProducer") + << "Particle and weights collection have the same label. You may be applying the same weights twice.\n"; + if (srcWeights.label() != "") + input_weights_token_ = consumes>(srcWeights); + } anomalousTowerDef_ = unique_ptr(new AnomalousTower(iConfig)); @@ -279,6 +288,10 @@ void VirtualJetProducer::produce(edm::Event& iEvent, const edm::EventSetup& iSet vertex_ = pvCollection->begin()->position(); } + // Get Weights Collection + if ((applyWeight_) && (!input_weights_token_.isUninitialized())) + weights_ = iEvent.get(input_weights_token_); + // For Pileup subtraction using offset correction: // set up geometry map if (doPUOffsetCorr_) { @@ -448,6 +461,7 @@ void VirtualJetProducer::inputTowers() { const CaloTower& tower = dynamic_cast(input); auto const& ct = tower.p4(vertex_); // very expensive as computed in eta/phi fjInputs_.emplace_back(ct.px(), ct.py(), ct.pz(), ct.energy()); + fjInputs_.back().set_user_index(i - inBegin); //std::cout << "tower:" << *tower << '\n'; } else { /* @@ -456,9 +470,20 @@ void VirtualJetProducer::inputTowers() { std::cout << "PF cand:" << pfc << '\n'; } */ - fjInputs_.emplace_back(input.px(), input.py(), input.pz(), input.energy()); + if (!applyWeight_) { + fjInputs_.emplace_back(input.px(), input.py(), input.pz(), input.energy()); + fjInputs_.back().set_user_index(i - inBegin); + } else { + if (input_weights_token_.isUninitialized()) + throw cms::Exception("InvalidInput") + << "applyWeight set to True, but no weights given in VirtualJetProducer\n"; + float w = weights_[*i]; + if (w > 0) { + fjInputs_.emplace_back(input.px() * w, input.py() * w, input.pz() * w, input.energy() * w); + fjInputs_.back().set_user_index(i - inBegin); + } + } } - fjInputs_.back().set_user_index(i - inBegin); } if (restrictInputs_ && fjInputs_.size() > maxInputs_) { @@ -666,6 +691,7 @@ void VirtualJetProducer::writeJets(edm::Event& iEvent, edm::EventSetup const& iS // fill jets for (unsigned int ijet = 0; ijet < fjJets_.size(); ++ijet) { auto& jet = (*jets)[ijet]; + // get the fastjet jet const fastjet::PseudoJet& fjJet = fjJets_[ijet]; // get the constituents from fastjet @@ -676,10 +702,19 @@ void VirtualJetProducer::writeJets(edm::Event& iEvent, edm::EventSetup const& iS // write the specifics to the jet (simultaneously sets 4-vector, vertex). // These are overridden functions that will call the appropriate // specific allocator. - writeSpecific( - jet, Particle::LorentzVector(fjJet.px(), fjJet.py(), fjJet.pz(), fjJet.E()), vertex_, constituents, iSetup); + if ((applyWeight_) && (makePFJet(jetTypeE))) + writeSpecific(dynamic_cast(jet), + Particle::LorentzVector(fjJet.px(), fjJet.py(), fjJet.pz(), fjJet.E()), + vertex_, + constituents, + iSetup, + &weights_); + else + writeSpecific( + jet, Particle::LorentzVector(fjJet.px(), fjJet.py(), fjJet.pz(), fjJet.E()), vertex_, constituents, iSetup); phiJ[ijet] = jet.phi(); etaJ[ijet] = jet.eta(); + jet.setIsWeighted(applyWeight_); } // calcuate the jet area @@ -823,14 +858,18 @@ void VirtualJetProducer::writeCompoundJets(edm::Event& iEvent, edm::EventSetup c indices[jetIndex].push_back(subjetCollection->size()); // Add the concrete subjet type to the subjet list to write to event record - T jet; - reco::writeSpecific(jet, p4Subjet, point, constituents, iSetup); + subjetCollection->push_back(*std::make_unique()); + auto& jet = subjetCollection->back(); + if ((applyWeight_) && (makePFJet(jetTypeE))) + reco::writeSpecific(dynamic_cast(jet), p4Subjet, point, constituents, iSetup, &weights_); + else + reco::writeSpecific(jet, p4Subjet, point, constituents, iSetup); + jet.setIsWeighted(applyWeight_); double subjetArea = 0.0; if (doAreaFastjet_ && itSubJet->has_area()) { subjetArea = itSubJet->area(); } jet.setJetArea(subjetArea); - subjetCollection->push_back(jet); } } @@ -1016,4 +1055,6 @@ void VirtualJetProducer::fillDescriptionsFromVirtualJetProducer(edm::ParameterSe desc.add("maxRecoveredHcalCells", 9999999); vector puCentersDefault; desc.add>("puCenters", puCentersDefault); + desc.add("applyWeight", false); + desc.add("srcWeights", edm::InputTag("")); } diff --git a/RecoJets/JetProducers/plugins/VirtualJetProducer.h b/RecoJets/JetProducers/plugins/VirtualJetProducer.h index 9057c23951ee2..570eaea1b5682 100644 --- a/RecoJets/JetProducers/plugins/VirtualJetProducer.h +++ b/RecoJets/JetProducers/plugins/VirtualJetProducer.h @@ -179,7 +179,7 @@ class dso_hidden VirtualJetProducer : public edm::stream::EDProducer<> { bool doPUOffsetCorr_; // add the pileup calculation from offset correction? std::string puSubtractorName_; - std::vector > + std::vector> inputs_; // input candidates [View, PtrVector and CandCollection have limitations] reco::Particle::Point vertex_; // Primary vertex ClusterSequencePtr fjClusterSeq_; // fastjet cluster sequence @@ -206,19 +206,22 @@ class dso_hidden VirtualJetProducer : public edm::stream::EDProducer<> { int verbosity_; // flag to enable/disable debug output bool fromHTTTopJetProducer_ = false; // for running the v2.0 HEPTopTagger + bool applyWeight_; // Apply weights stored in a value map or inside PackedCandidate (e.g. from PUPPI) + edm::ValueMap weights_; // weights per particle (e.g. from PUPPI) private: std::unique_ptr anomalousTowerDef_; // anomalous tower definition // tokens for the data access edm::EDGetTokenT input_candidateview_token_; - edm::EDGetTokenT > > input_candidatefwdptr_token_; - edm::EDGetTokenT > > input_packedcandidatefwdptr_token_; - edm::EDGetTokenT > > input_gencandidatefwdptr_token_; - edm::EDGetTokenT > > input_packedgencandidatefwdptr_token_; + edm::EDGetTokenT>> input_candidatefwdptr_token_; + edm::EDGetTokenT>> input_packedcandidatefwdptr_token_; + edm::EDGetTokenT>> input_gencandidatefwdptr_token_; + edm::EDGetTokenT>> input_packedgencandidatefwdptr_token_; protected: edm::EDGetTokenT input_vertex_token_; + edm::EDGetTokenT> input_weights_token_; }; #endif diff --git a/RecoJets/JetProducers/python/CaloJetParameters_cfi.py b/RecoJets/JetProducers/python/CaloJetParameters_cfi.py index 319bcb8067bdb..1a112d0ded616 100644 --- a/RecoJets/JetProducers/python/CaloJetParameters_cfi.py +++ b/RecoJets/JetProducers/python/CaloJetParameters_cfi.py @@ -29,5 +29,6 @@ Rho_EtaMax = cms.double( 4.4), voronoiRfact = cms.double(-0.9), useDeterministicSeed= cms.bool( True ), - minSeed = cms.uint32( 14327 ) + minSeed = cms.uint32( 14327 ), + applyWeight = cms.bool( False ) ) diff --git a/RecoJets/JetProducers/python/ECF_cff.py b/RecoJets/JetProducers/python/ECF_cff.py index 4db5213bb74bb..375e2fd089fb0 100644 --- a/RecoJets/JetProducers/python/ECF_cff.py +++ b/RecoJets/JetProducers/python/ECF_cff.py @@ -3,69 +3,53 @@ from RecoJets.JetProducers.ECFAdder_cfi import ECFAdder ecf = ECFAdder.clone( - src = cms.InputTag("ak8CHSJets"), + src = cms.InputTag("ak8PFJetsPuppi"), ecftype = cms.string("ECF") ) -ecfCbeta1 = ECFAdder.clone( - src = cms.InputTag("ak8CHSJets"), +ecfCbeta1 = ecf.clone( ecftype = cms.string("C") ) -ecfCbeta2 = ECFAdder.clone( - src = cms.InputTag("ak8CHSJets"), - ecftype = cms.string("C"), +ecfCbeta2 = ecfCbeta1.clone( alpha = cms.double(2.0), beta = cms.double(2.0) ) -ecfDbeta1 = ECFAdder.clone( - src = cms.InputTag("ak8CHSJets"), +ecfDbeta1 = ecf.clone( ecftype = cms.string("D"), Njets = cms.vuint32(2) ) -ecfDbeta2 = ECFAdder.clone( - src = cms.InputTag("ak8CHSJets"), - ecftype = cms.string("D"), - Njets = cms.vuint32(2), +ecfDbeta2 = ecfDbeta1.clone( alpha = cms.double(2.0), beta = cms.double(2.0) ) -ecfMbeta1 = ECFAdder.clone( - src = cms.InputTag("ak8CHSJets"), +ecfMbeta1 = ecf.clone( ecftype = cms.string("M") ) -ecfMbeta2 = ECFAdder.clone( - src = cms.InputTag("ak8CHSJets"), - ecftype = cms.string("M"), +ecfMbeta2 = ecfMbeta1.clone( alpha = cms.double(2.0), beta = cms.double(2.0) ) -ecfNbeta1 = ECFAdder.clone( - src = cms.InputTag("ak8CHSJets"), +ecfNbeta1 = ecf.clone( ecftype = cms.string("N") ) -ecfNbeta2 = ECFAdder.clone( - src = cms.InputTag("ak8CHSJets"), - ecftype = cms.string("N"), +ecfNbeta2 = ecfNbeta1.clone( alpha = cms.double(2.0), beta = cms.double(2.0) ) -ecfUbeta1 = ECFAdder.clone( - src = cms.InputTag("ak8CHSJets"), +ecfUbeta1 = ecf.clone( ecftype = cms.string("U") ) -ecfUbeta2 = ECFAdder.clone( - src = cms.InputTag("ak8CHSJets"), - ecftype = cms.string("U"), +ecfUbeta2 = ecfUbeta1.clone( alpha = cms.double(2.0), beta = cms.double(2.0) ) diff --git a/RecoJets/JetProducers/python/GenJetParameters_cfi.py b/RecoJets/JetProducers/python/GenJetParameters_cfi.py index ac8636c0da005..637d8a3bcbb5e 100644 --- a/RecoJets/JetProducers/python/GenJetParameters_cfi.py +++ b/RecoJets/JetProducers/python/GenJetParameters_cfi.py @@ -22,6 +22,7 @@ Ghost_EtaMax = cms.double(6.0), Rho_EtaMax = cms.double(4.5), useDeterministicSeed= cms.bool( True ), - minSeed = cms.uint32( 14327 ) + minSeed = cms.uint32( 14327 ), + applyWeight = cms.bool(False) ) diff --git a/RecoJets/JetProducers/python/PFClusterJetParameters_cfi.py b/RecoJets/JetProducers/python/PFClusterJetParameters_cfi.py index a9356f5f99dd9..75b68c0bce9ee 100644 --- a/RecoJets/JetProducers/python/PFClusterJetParameters_cfi.py +++ b/RecoJets/JetProducers/python/PFClusterJetParameters_cfi.py @@ -27,6 +27,7 @@ Rho_EtaMax = cms.double( 4.4), voronoiRfact = cms.double(-0.9), useDeterministicSeed= cms.bool( True ), - minSeed = cms.uint32( 14327 ) + minSeed = cms.uint32( 14327 ), + applyWeight = cms.bool( False ) ) diff --git a/RecoJets/JetProducers/python/PFJetParameters_cfi.py b/RecoJets/JetProducers/python/PFJetParameters_cfi.py index cd1eef517b385..ebd65e631be80 100644 --- a/RecoJets/JetProducers/python/PFJetParameters_cfi.py +++ b/RecoJets/JetProducers/python/PFJetParameters_cfi.py @@ -23,5 +23,6 @@ Rho_EtaMax = cms.double( 4.4), voronoiRfact = cms.double(-0.9), useDeterministicSeed= cms.bool( True ), - minSeed = cms.uint32( 14327 ) + minSeed = cms.uint32( 14327 ), + applyWeight = cms.bool( False ) ) diff --git a/RecoJets/JetProducers/python/TrackJetParameters_cfi.py b/RecoJets/JetProducers/python/TrackJetParameters_cfi.py index 17cb5a4627e13..4c36ec1263c29 100644 --- a/RecoJets/JetProducers/python/TrackJetParameters_cfi.py +++ b/RecoJets/JetProducers/python/TrackJetParameters_cfi.py @@ -35,5 +35,6 @@ # maximum z distance to origin to call a PV a good vertex MaxVtxZ = cms.double(15.), useDeterministicSeed= cms.bool( True ), - minSeed = cms.uint32( 14327 ) + minSeed = cms.uint32( 14327 ), + applyWeight = cms.bool( False ) ) diff --git a/RecoJets/JetProducers/python/ak4PFJets_cfi.py b/RecoJets/JetProducers/python/ak4PFJets_cfi.py index 2538fda84479d..f4f518dd099f5 100644 --- a/RecoJets/JetProducers/python/ak4PFJets_cfi.py +++ b/RecoJets/JetProducers/python/ak4PFJets_cfi.py @@ -17,7 +17,9 @@ ) ak4PFJetsPuppi = ak4PFJets.clone( - src = cms.InputTag("puppi") + src = cms.InputTag("particleFlow"), + applyWeight = True, + srcWeights = cms.InputTag("puppi") ) ak4PFJetsSK = ak4PFJets.clone( diff --git a/RecoJets/JetProducers/python/ak8PFJets_cfi.py b/RecoJets/JetProducers/python/ak8PFJets_cfi.py index 038669d6b02b7..797822987f9a4 100644 --- a/RecoJets/JetProducers/python/ak8PFJets_cfi.py +++ b/RecoJets/JetProducers/python/ak8PFJets_cfi.py @@ -16,7 +16,9 @@ # AK8 jets with various pileup subtraction schemes ############################################################################## ak8PFJetsPuppi = ak8PFJets.clone( - src = cms.InputTag("puppi") + src = cms.InputTag("particleFlow"), + applyWeight = True, + srcWeights = cms.InputTag("puppi") ) ak8PFJetsCHS = ak8PFJets.clone( @@ -114,5 +116,7 @@ ) ak8PFJetsPuppiSoftDrop = ak8PFJetsCHSSoftDrop.clone( - src = cms.InputTag("ak8PFJetsPuppiConstituents", "constituents") + src = cms.InputTag("ak8PFJetsPuppiConstituents", "constituents"), + applyWeight = True, + srcWeights = cms.InputTag("puppi") ) diff --git a/RecoJets/JetProducers/python/nJettinessAdder_cfi.py b/RecoJets/JetProducers/python/nJettinessAdder_cfi.py index b61829c6d2029..5b74dc0f7099b 100644 --- a/RecoJets/JetProducers/python/nJettinessAdder_cfi.py +++ b/RecoJets/JetProducers/python/nJettinessAdder_cfi.py @@ -1,7 +1,8 @@ + import FWCore.ParameterSet.Config as cms Njettiness = cms.EDProducer("NjettinessAdder", - src=cms.InputTag("ak8PFJetsCHS"), + src=cms.InputTag("ak8PFJetsPuppi"), Njets=cms.vuint32(1,2,3,4), # compute 1-, 2-, 3-, 4- subjettiness # variables for measure definition : measureDefinition = cms.uint32( 0 ), # CMS default is normalized measure @@ -10,6 +11,7 @@ Rcutoff = cms.double( 999.0), # not used by default # variables for axes definition : axesDefinition = cms.uint32( 6 ), # CMS default is 1-pass KT axes - nPass = cms.int32(999), # not used by default - akAxesR0 = cms.double(999.0) # not used by default + nPass = cms.int32(999), # not used by default + akAxesR0 = cms.double(999.0), # not used by default + srcWeights = cms.InputTag("puppi") ) diff --git a/RecoJets/JetProducers/src/JetSpecific.cc b/RecoJets/JetProducers/src/JetSpecific.cc index 358c5c22b332d..c9ff5cb5c1345 100644 --- a/RecoJets/JetProducers/src/JetSpecific.cc +++ b/RecoJets/JetProducers/src/JetSpecific.cc @@ -79,16 +79,18 @@ void reco::writeSpecific(reco::PFJet& jet, reco::Particle::LorentzVector const& p4, reco::Particle::Point const& point, std::vector const& constituents, - edm::EventSetup const& c) { + edm::EventSetup const& c, + edm::ValueMap const* weights) { // Make the specific reco::PFJet::Specific specific; - makeSpecific(constituents, &specific); + makeSpecific(constituents, &specific, weights); // now make jet charge int charge = 0.; for (std::vector::const_iterator ic = constituents.begin(), icend = constituents.end(); ic != icend; ++ic) { - charge += (*ic)->charge(); + float weight = (weights != nullptr) ? (*weights)[*ic] : 1.0; + charge += (*ic)->charge() * weight; } jet = reco::PFJet(p4, point, specific, constituents); jet.setCharge(charge); @@ -216,7 +218,9 @@ bool reco::makeSpecific(std::vector const& towers, } //______________________________________________________________________________ -bool reco::makeSpecific(std::vector const& particles, PFJet::Specific* pfJetSpecific) { +bool reco::makeSpecific(std::vector const& particles, + PFJet::Specific* pfJetSpecific, + edm::ValueMap const* weights) { if (nullptr == pfJetSpecific) return false; @@ -231,19 +235,19 @@ bool reco::makeSpecific(std::vector const& particles, PFJet: float muonEnergy = 0.; float HFHadronEnergy = 0.; float HFEMEnergy = 0.; - int chargedHadronMultiplicity = 0; - int neutralHadronMultiplicity = 0; - int photonMultiplicity = 0; - int electronMultiplicity = 0; - int muonMultiplicity = 0; - int HFHadronMultiplicity = 0; - int HFEMMultiplicity = 0; + float chargedHadronMultiplicity = 0; + float neutralHadronMultiplicity = 0; + float photonMultiplicity = 0; + float electronMultiplicity = 0; + float muonMultiplicity = 0; + float HFHadronMultiplicity = 0; + float HFEMMultiplicity = 0; float chargedEmEnergy = 0.; float neutralEmEnergy = 0.; float chargedMuEnergy = 0.; - int chargedMultiplicity = 0; - int neutralMultiplicity = 0; + float chargedMultiplicity = 0; + float neutralMultiplicity = 0; float HOEnergy = 0.; @@ -256,55 +260,56 @@ bool reco::makeSpecific(std::vector const& particles, PFJet: const Candidate* pfCand = itParticle->get(); if (pfCand) { const PFCandidate* pfCandCast = dynamic_cast(pfCand); + float weight = (weights != nullptr) ? (*weights)[*itParticle] : 1.0; if (pfCandCast) - HOEnergy += pfCandCast->hoEnergy(); + HOEnergy += pfCandCast->hoEnergy() * weight; switch (std::abs(pfCand->pdgId())) { case 211: //PFCandidate::h: // charged hadron - chargedHadronEnergy += pfCand->energy(); - chargedHadronMultiplicity++; - chargedMultiplicity++; + chargedHadronEnergy += pfCand->energy() * weight; + chargedHadronMultiplicity += weight; + chargedMultiplicity += weight; break; case 130: //PFCandidate::h0 : // neutral hadron - neutralHadronEnergy += pfCand->energy(); - neutralHadronMultiplicity++; - neutralMultiplicity++; + neutralHadronEnergy += pfCand->energy() * weight; + neutralHadronMultiplicity += weight; + neutralMultiplicity += weight; break; case 22: //PFCandidate::gamma: // photon - photonEnergy += pfCand->energy(); - photonMultiplicity++; - neutralEmEnergy += pfCand->energy(); - neutralMultiplicity++; + photonEnergy += pfCand->energy() * weight; + photonMultiplicity += weight; + neutralEmEnergy += pfCand->energy() * weight; + neutralMultiplicity += weight; break; case 11: // PFCandidate::e: // electron - electronEnergy += pfCand->energy(); - electronMultiplicity++; - chargedEmEnergy += pfCand->energy(); - chargedMultiplicity++; + electronEnergy += pfCand->energy() * weight; + electronMultiplicity += weight; + chargedEmEnergy += pfCand->energy() * weight; + chargedMultiplicity += weight; break; case 13: //PFCandidate::mu: // muon - muonEnergy += pfCand->energy(); - muonMultiplicity++; - chargedMuEnergy += pfCand->energy(); - chargedMultiplicity++; + muonEnergy += pfCand->energy() * weight; + muonMultiplicity += weight; + chargedMuEnergy += pfCand->energy() * weight; + chargedMultiplicity += weight; break; case 1: // PFCandidate::h_HF : // hadron in HF - HFHadronEnergy += pfCand->energy(); - HFHadronMultiplicity++; - neutralHadronEnergy += pfCand->energy(); - neutralMultiplicity++; + HFHadronEnergy += pfCand->energy() * weight; + HFHadronMultiplicity += weight; + neutralHadronEnergy += pfCand->energy() * weight; + neutralMultiplicity += weight; break; case 2: //PFCandidate::egamma_HF : // electromagnetic in HF - HFEMEnergy += pfCand->energy(); - HFEMMultiplicity++; - neutralEmEnergy += pfCand->energy(); - neutralMultiplicity++; + HFEMEnergy += pfCand->energy() * weight; + HFEMMultiplicity += weight; + neutralEmEnergy += pfCand->energy() * weight; + neutralMultiplicity += weight; break; default: @@ -326,19 +331,19 @@ bool reco::makeSpecific(std::vector const& particles, PFJet: pfJetSpecific->mHFHadronEnergy = HFHadronEnergy; pfJetSpecific->mHFEMEnergy = HFEMEnergy; - pfJetSpecific->mChargedHadronMultiplicity = chargedHadronMultiplicity; - pfJetSpecific->mNeutralHadronMultiplicity = neutralHadronMultiplicity; - pfJetSpecific->mPhotonMultiplicity = photonMultiplicity; - pfJetSpecific->mElectronMultiplicity = electronMultiplicity; - pfJetSpecific->mMuonMultiplicity = muonMultiplicity; - pfJetSpecific->mHFHadronMultiplicity = HFHadronMultiplicity; - pfJetSpecific->mHFEMMultiplicity = HFEMMultiplicity; + pfJetSpecific->mChargedHadronMultiplicity = std::round(chargedHadronMultiplicity); + pfJetSpecific->mNeutralHadronMultiplicity = std::round(neutralHadronMultiplicity); + pfJetSpecific->mPhotonMultiplicity = std::round(photonMultiplicity); + pfJetSpecific->mElectronMultiplicity = std::round(electronMultiplicity); + pfJetSpecific->mMuonMultiplicity = std::round(muonMultiplicity); + pfJetSpecific->mHFHadronMultiplicity = std::round(HFHadronMultiplicity); + pfJetSpecific->mHFEMMultiplicity = std::round(HFEMMultiplicity); pfJetSpecific->mChargedEmEnergy = chargedEmEnergy; pfJetSpecific->mChargedMuEnergy = chargedMuEnergy; pfJetSpecific->mNeutralEmEnergy = neutralEmEnergy; - pfJetSpecific->mChargedMultiplicity = chargedMultiplicity; - pfJetSpecific->mNeutralMultiplicity = neutralMultiplicity; + pfJetSpecific->mChargedMultiplicity = std::round(chargedMultiplicity); + pfJetSpecific->mNeutralMultiplicity = std::round(neutralMultiplicity); pfJetSpecific->mHOEnergy = HOEnergy; diff --git a/TauAnalysis/MCEmbeddingTools/python/customisers.py b/TauAnalysis/MCEmbeddingTools/python/customisers.py index 1f683b7ee7d11..136f5394c14a6 100644 --- a/TauAnalysis/MCEmbeddingTools/python/customisers.py +++ b/TauAnalysis/MCEmbeddingTools/python/customisers.py @@ -305,6 +305,7 @@ def customiseKeepPrunedGenParticles(process,reselect=False): process.patJetPartonMatch.mcStatus = [ 3, 23 ] process.patJetGenJetMatch.matched = "slimmedGenJets" process.patJetGenJetMatchAK8.matched = "slimmedGenJetsAK8" + process.patJetGenJetMatchAK8Puppi.matched = "slimmedGenJetsAK8" process.patMuons.embedGenMatch = False process.patElectrons.embedGenMatch = False process.patPhotons.embedGenMatch = False