diff --git a/CommonTools/PileupAlgos/plugins/PuppiProducer.cc b/CommonTools/PileupAlgos/plugins/PuppiProducer.cc index d9d3e51553d61..20295c7725d7a 100644 --- a/CommonTools/PileupAlgos/plugins/PuppiProducer.cc +++ b/CommonTools/PileupAlgos/plugins/PuppiProducer.cc @@ -42,21 +42,23 @@ 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(); + ptokenPuppiCandidatesWeighted_ = produces("p4scaled"); + } 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"); } } // ------------------------------------------------------------------------------------------ @@ -235,8 +237,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(); @@ -249,9 +251,11 @@ 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; + PFOutputCollection fPuppiCandidatesWeighted; + PackedOutputCollection fPackedPuppiCandidates; + + edm::ValueMap p4PupOut; LorentzVectorCollection puppiP4s; std::vector values(hPFProduct->size()); @@ -260,6 +264,8 @@ void PuppiProducer::produce(edm::Event& iEvent, const edm::EventSetup& iSetup) { ++iCand; std::unique_ptr pCand; std::unique_ptr pfCand; + std::unique_ptr pfCandWeighted; + if (fUseExistingWeights || fClonePackedCands) { const pat::PackedCandidate* cand = dynamic_cast(&aCand); if (!cand) @@ -269,8 +275,10 @@ void PuppiProducer::produce(edm::Event& iEvent, const edm::EventSetup& iSetup) { auto id = dummySinceTranslateIsNotStatic.translatePdgIdToType(aCand.pdgId()); const reco::PFCandidate* cand = dynamic_cast(&aCand); pfCand.reset(new reco::PFCandidate(cand ? *cand : reco::PFCandidate(aCand.charge(), aCand.p4(), id))); + pfCandWeighted.reset(new reco::PFCandidate(*pfCand)); } + // 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]); @@ -283,58 +291,81 @@ 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()); + // Here, we are not using packed candidates. That is, this is RECO + // and we are computing puppi for the PFCandidates themselves. + // We have TWO collections to write here. The first is the "weighted" + // version that weights the p4 by the puppi weight. The second + // is the standard version, where we just set the internal weight + // and do not adjust the p4. Only the second is persistified in + // AOD. The other can be used by user modules to have their own + // PFCandidate collection, and as a check for the weighting procedure. + pfCandWeighted->setP4(puppiP4s.back()); + pfCandWeighted->setSourceCandidatePtr(aCand.sourceCandidatePtr(0)); + pfCand->setP4(aCand.p4()); pfCand->setSourceCandidatePtr(aCand.sourceCandidatePtr(0)); - fPuppiCandidates->push_back(*pfCand); + if (fPuppiForLeptons) { + pfCandWeighted->setPuppiWeight(1.0, lWeights[iCand]); + pfCand->setPuppiWeight(1.0, lWeights[iCand]); + } else { + pfCandWeighted->setPuppiWeight(lWeights[iCand]); + pfCand->setPuppiWeight(lWeights[iCand]); + } + fPuppiCandidates.push_back(*pfCand); + fPuppiCandidatesWeighted.push_back(*pfCandWeighted); } } //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)); + iEvent.emplace(ptokenPuppiCandidatesWeighted_, fPuppiCandidatesWeighted); + 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 efb57765c87c9..67f6616307fd0 100644 --- a/CommonTools/PileupAlgos/plugins/PuppiProducer.h +++ b/CommonTools/PileupAlgos/plugins/PuppiProducer.h @@ -42,6 +42,21 @@ class PuppiProducer : public edm::stream::EDProducer<> { edm::EDGetTokenT tokenPFCandidates_; edm::EDGetTokenT tokenVertices_; + edm::EDGetTokenT tokenPuppiContainer_; + edm::EDGetTokenT tokenPuppiCandidates_; + edm::EDGetTokenT tokenPuppiCandidatesWeighted_; + edm::EDGetTokenT tokenPackedPuppiCandidates_; + edm::EDPutTokenT> ptokenPupOut_; + edm::EDPutTokenT> ptokenP4PupOut_; + edm::EDPutTokenT> ptokenValues_; + edm::EDPutTokenT ptokenPackedPuppiCandidates_; + edm::EDPutTokenT ptokenPuppiCandidates_; + edm::EDPutTokenT ptokenPuppiCandidatesWeighted_; + edm::EDPutTokenT ptokenNalgos_; + edm::EDPutTokenT> ptokenRawAlphas_; + edm::EDPutTokenT> ptokenAlphas_; + edm::EDPutTokenT> ptokenAlphasMed_; + edm::EDPutTokenT> ptokenAlphasRms_; std::string fPuppiName; std::string fPFName; std::string fPVName; @@ -62,7 +77,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..041fa6edbc603 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") && 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/ParticleFlowCandidate/interface/PFCandidate.h b/DataFormats/ParticleFlowCandidate/interface/PFCandidate.h index ee7b7301f6b46..82d16fe819047 100644 --- a/DataFormats/ParticleFlowCandidate/interface/PFCandidate.h +++ b/DataFormats/ParticleFlowCandidate/interface/PFCandidate.h @@ -429,6 +429,14 @@ namespace reco { /// set the fraction of hcal energy as function of depth (index 0..6 for depth 1..7) void setHcalDepthEnergyFractions(const std::array& fracs) { hcalDepthEnergyFractions_ = fracs; } + /// puppi weights + void setPuppiWeight(float p, float p_nolep = 0.0) { + puppiWeight_ = p; + puppiWeightNoLep_ = p_nolep; + } + float puppiWeight() const { return puppiWeight_; } /// Weight from full PUPPI + float puppiWeightNoLep() const { return puppiWeightNoLep_; } /// Weight from PUPPI removing leptons + private: /// Polymorphic overlap bool overlap(const Candidate&) const override; @@ -530,6 +538,10 @@ namespace reco { float timeError_; std::array hcalDepthEnergyFractions_; + + /// puppi weight + float puppiWeight_; + float puppiWeightNoLep_; }; /// particle ID component tag diff --git a/DataFormats/ParticleFlowCandidate/src/PFCandidate.cc b/DataFormats/ParticleFlowCandidate/src/PFCandidate.cc index 55b799ccd20f1..202fbe24c2aff 100644 --- a/DataFormats/ParticleFlowCandidate/src/PFCandidate.cc +++ b/DataFormats/ParticleFlowCandidate/src/PFCandidate.cc @@ -45,7 +45,9 @@ PFCandidate::PFCandidate() getter_(nullptr), storedRefsBitPattern_(0), time_(0.f), - timeError_(-1.f) { + timeError_(-1.f), + puppiWeight_(0.f), + puppiWeightNoLep_(0.f) { muonTrackType_ = reco::Muon::None; setPdgId(translateTypeToPdgId(X)); @@ -84,7 +86,9 @@ PFCandidate::PFCandidate(Charge charge, const LorentzVector& p4, ParticleType pa getter_(nullptr), storedRefsBitPattern_(0), time_(0.f), - timeError_(-1.f) { + timeError_(-1.f), + puppiWeight_(0.f), + puppiWeightNoLep_(0.f) { refsInfo_.reserve(3); blocksStorage_.reserve(10); elementsStorage_.reserve(10); @@ -144,7 +148,9 @@ PFCandidate::PFCandidate(PFCandidate const& iOther) refsCollectionCache_(iOther.refsCollectionCache_), time_(iOther.time_), timeError_(iOther.timeError_), - hcalDepthEnergyFractions_(iOther.hcalDepthEnergyFractions_) { + hcalDepthEnergyFractions_(iOther.hcalDepthEnergyFractions_), + puppiWeight_(iOther.puppiWeight_), + puppiWeightNoLep_(iOther.puppiWeightNoLep_) { auto tmp = iOther.elementsInBlocks_.load(std::memory_order_acquire); if (nullptr != tmp) { elementsInBlocks_.store(new ElementsInBlocks{*tmp}, std::memory_order_release); @@ -189,6 +195,8 @@ PFCandidate& PFCandidate::operator=(PFCandidate const& iOther) { time_ = iOther.time_; timeError_ = iOther.timeError_; hcalDepthEnergyFractions_ = iOther.hcalDepthEnergyFractions_; + puppiWeight_ = iOther.puppiWeight_; + puppiWeightNoLep_ = iOther.puppiWeightNoLep_; return *this; } diff --git a/DataFormats/ParticleFlowCandidate/src/classes_def.xml b/DataFormats/ParticleFlowCandidate/src/classes_def.xml index eca906716f5bc..1382353093232 100644 --- a/DataFormats/ParticleFlowCandidate/src/classes_def.xml +++ b/DataFormats/ParticleFlowCandidate/src/classes_def.xml @@ -1,6 +1,7 @@ - + + @@ -52,7 +53,8 @@ - + + @@ -67,7 +69,8 @@ - + + diff --git a/DataFormats/PatCandidates/src/classes_def_objects.xml b/DataFormats/PatCandidates/src/classes_def_objects.xml index e206506aa002a..be0a78fe4a63e 100644 --- a/DataFormats/PatCandidates/src/classes_def_objects.xml +++ b/DataFormats/PatCandidates/src/classes_def_objects.xml @@ -312,7 +312,8 @@ - + + 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..7451b5c4a9ad8 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" @@ -196,6 +197,8 @@ class JetFlavourClustering : public edm::stream::EDProducer<> { const double relPtTolerance_; const bool hadronFlavourHasPriority_; const bool useSubjets_; + bool usePuppi_; + const bool useLeptons_; ClusterSequencePtr fjClusterSeq_; @@ -218,6 +221,7 @@ JetFlavourClustering::JetFlavourClustering(const edm::ParameterSet& iConfig) 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 +236,13 @@ JetFlavourClustering::JetFlavourClustering(const edm::ParameterSet& iConfig) { // register your products produces(); + std::string label = iConfig.getParameter("jets").label(); + usePuppi_ = false; + if (label.find("Puppi") != std::string::npos) { + usePuppi_ = true; + // This check will not fire on updatedPatJetsSlimmedDeepFlavour, updatedPatJetsSlimmedAK8DeepTags. Is that what we want? + } + if (useSubjets_) produces("SubJets"); @@ -315,7 +326,14 @@ 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 (usePuppi_) { + const auto pf_constit = dynamic_cast(&*constit); + double w = pf_constit->puppiWeight(); + double E_w = std::sqrt(pf_constit->p() * w * pf_constit->p() * w + pf_constit->mass() * pf_constit->mass()); + fjInputs.push_back(fastjet::PseudoJet(pf_constit->px() * w, pf_constit->py() * w, pf_constit->pz() * w, E_w)); + } else { + fjInputs.push_back(fastjet::PseudoJet(constit->px(), constit->py(), constit->pz(), constit->energy())); + } } } // insert "ghost" b hadrons in the vector of constituents diff --git a/PhysicsTools/NanoAOD/python/jets_cff.py b/PhysicsTools/NanoAOD/python/jets_cff.py index 0a3a7d2a6e37c..bc40fa2a5932d 100644 --- a/PhysicsTools/NanoAOD/python/jets_cff.py +++ b/PhysicsTools/NanoAOD/python/jets_cff.py @@ -401,7 +401,6 @@ ) ### Era dependent customization run2_miniAOD_80XLegacy.toModify( bjetNN,outputFormulas = cms.vstring(["at(0)*0.31628304719924927+1.0454729795455933","0.5*(at(2)-at(1))*0.31628304719924927"])) -run2_miniAOD_80XLegacy.toModify( fatJetTable.variables, msoftdrop_chs = Var("userFloat('ak8PFJetsCHSSoftDropMass')",float, doc="Legacy uncorrected soft drop mass with CHS",precision=10)) run2_miniAOD_80XLegacy.toModify( fatJetTable.variables.tau1, expr = cms.string("userFloat(\'ak8PFJetsPuppiValueMap:NjettinessAK8PuppiTau1\')"),) run2_miniAOD_80XLegacy.toModify( fatJetTable.variables.tau2, expr = cms.string("userFloat(\'ak8PFJetsPuppiValueMap:NjettinessAK8PuppiTau2\')"),) run2_miniAOD_80XLegacy.toModify( fatJetTable.variables.tau3, expr = cms.string("userFloat(\'ak8PFJetsPuppiValueMap:NjettinessAK8PuppiTau3\')"),) 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 0f2074fce9149..832ab22e45f9a 100644 --- a/PhysicsTools/PatAlgos/python/slimming/miniAOD_tools.py +++ b/PhysicsTools/PatAlgos/python/slimming/miniAOD_tools.py @@ -371,7 +371,8 @@ def miniAOD_customizeCommon(process): process.makePatTausTask, _makePatTausTaskWithTauReReco ) - # Adding puppi jets + # puppi jets : Updated 2019 by S. Rappoccio. PUPPI now being placed into RECO. + # If this is a RE-MINIAOD or otherwise, this will pick up the later PUPPI, including tunes. if not hasattr(process, 'ak4PFJetsPuppi'): #MM: avoid confilct with substructure call process.load('RecoJets.JetProducers.ak4PFJetsPuppi_cfi') task.add(process.ak4PFJets) @@ -520,7 +521,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/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/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/TemplatedSecondaryVertexProducer.cc b/RecoBTag/SecondaryVertex/plugins/TemplatedSecondaryVertexProducer.cc index 256aa4f270aa9..f0d14a837a666 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" @@ -159,6 +163,7 @@ class TemplatedSecondaryVertexProducer : public edm::stream::EDProducer<> { double ghostRescaling; double relPtTolerance; bool useFatJets; + bool usePuppi; bool useGroomedFatJets; edm::EDGetTokenT > token_fatJets; edm::EDGetTokenT > token_groomedFatJets; @@ -261,6 +266,7 @@ TemplatedSecondaryVertexProducer::TemplatedSecondaryVertexProducer(co } useSVClustering = (params.existsAs("useSVClustering") ? params.getParameter("useSVClustering") : false); useSVMomentum = (params.existsAs("useSVMomentum") ? params.getParameter("useSVMomentum") : false); + usePuppi = false; useFatJets = (useExternalSV && params.exists("fatJets")); useGroomedFatJets = (useExternalSV && params.exists("groomedFatJets")); if (useSVClustering) { @@ -286,10 +292,16 @@ 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) + std::string label = params.getParameter("fatJets").label(); + if (label.find("Puppi") != std::string::npos) { + usePuppi = true; + } + } + if (useGroomedFatJets) { token_groomedFatJets = consumes >(params.getParameter("groomedFatJets")); + } if (useFatJets && !useSVClustering) rParam = params.getParameter("rParam"); // will be used later as a dR cut @@ -310,6 +322,19 @@ void TemplatedSecondaryVertexProducer::produce(edm::Event &event, con edm::Handle > trackIPTagInfos; event.getByToken(token_trackIPTagInfo, trackIPTagInfos); + if (!useFatJets) { + if constexpr (std::is_same_v) { + const edm::Provenance *prov = trackIPTagInfos.provenance(); + const edm::ParameterSet &psetFromProvenance = edm::parameterSet(*prov, event.processHistory()); + std::string label; + label = psetFromProvenance.getParameter("jets").label(); + if (label.find("Puppi") != std::string::npos) { + usePuppi = true; + } + } else { + usePuppi = false; + } + } // External Sec Vertex collection (e.g. for IVF usage) edm::Handle > extSecVertex; @@ -320,7 +345,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); @@ -380,7 +404,15 @@ 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 (usePuppi) { + const reco::PFCandidate *pf_constit = dynamic_cast(&*constit); + auto w = pf_constit->puppiWeight(); + double E_w = std::sqrt(pf_constit->p() * w * pf_constit->p() * w + pf_constit->mass() * pf_constit->mass()); + fjInputs.push_back( + fastjet::PseudoJet(pf_constit->px() * w, pf_constit->py() * w, pf_constit->pz() * w, E_w)); + } else { + fjInputs.push_back(fastjet::PseudoJet(constit->px(), constit->py(), constit->pz(), constit->energy())); + } } } } else { @@ -394,7 +426,15 @@ 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 (usePuppi) { + const auto *pf_constit = dynamic_cast(&*constit); + auto w = pf_constit->puppiWeight(); + double E_w = std::sqrt(pf_constit->p() * w * pf_constit->p() * w + pf_constit->mass() * pf_constit->mass()); + fjInputs.push_back( + fastjet::PseudoJet(pf_constit->px() * w, pf_constit->py() * w, pf_constit->pz() * w, E_w)); + } else { + fjInputs.push_back(fastjet::PseudoJet(constit->px(), constit->py(), constit->pz(), constit->energy())); + } } } } diff --git a/RecoHI/Configuration/python/Reconstruction_hiPF_cff.py b/RecoHI/Configuration/python/Reconstruction_hiPF_cff.py index 7ed44c64a5e93..9b161182cdec6 100644 --- a/RecoHI/Configuration/python/Reconstruction_hiPF_cff.py +++ b/RecoHI/Configuration/python/Reconstruction_hiPF_cff.py @@ -87,7 +87,9 @@ pfPileUpIso.Enable = False pfNoPileUp.enable = False pfPileUp.Enable = False -particleFlow.Muons = cms.InputTag("muons","hiMuons1stStep2muonsMap") +# Note: HI is not going to urn puppi so the "PrePuppi" module +# becomes the "particleFlow" module. +particleFlow = particleFlowPrePuppi.clone(Muons = cms.InputTag("muons","hiMuons1stStep2muonsMap")) # local reco must run before electrons (RecoHI/HiEgammaAlgos), due to PF integration diff --git a/RecoJets/Configuration/python/RecoJets_EventContent_cff.py b/RecoJets/Configuration/python/RecoJets_EventContent_cff.py index 104488b4b00f5..b0503d50ada13 100644 --- a/RecoJets/Configuration/python/RecoJets_EventContent_cff.py +++ b/RecoJets/Configuration/python/RecoJets_EventContent_cff.py @@ -54,10 +54,10 @@ outputCommands = cms.untracked.vstring('keep *_ak4CaloJets_*_*', 'keep *_ak4PFJets_*_*', 'keep *_ak4PFJetsCHS_*_*', - 'keep *_ak8PFJetsCHS_*_*', - 'keep *_ak8PFJetsCHSSoftDrop_*_*', - 'keep *_cmsTopTagPFJetsCHS_*_*', - 'keep *_JetPlusTrackZSPCorJetAntiKt4_*_*', + 'keep *_ak4PFJetsPuppi_*_*', + 'keep *_ak8PFJetsPuppi_*_*', + 'keep *_ak8PFJetsPuppiSoftDrop_*_*', + 'keep *_JetPlusTrackZSPCorJetAntiKt4_*_*', 'keep *_ak4TrackJets_*_*', 'keep recoRecoChargedRefCandidates_trackRefsForJets_*_*', 'keep *_caloTowers_*_*', @@ -82,7 +82,7 @@ 'keep *_fixedGridRhoFastjetCentralCalo_*_*', 'keep *_fixedGridRhoFastjetCentralChargedPileUp_*_*', 'keep *_fixedGridRhoFastjetCentralNeutral_*_*', - 'keep *_ak8PFJetsCHSSoftDropMass_*_*' + 'keep *_ak8PFJetsPuppiSoftDropMass_*_*' ) ) RecoGenJetsRECO = cms.PSet( @@ -96,9 +96,9 @@ RecoJetsAOD = cms.PSet( outputCommands = cms.untracked.vstring('keep *_ak4CaloJets_*_*', 'keep *_ak4PFJetsCHS_*_*', - 'keep *_ak8PFJetsCHS_*_*', - 'keep *_ak8PFJetsCHSSoftDrop_*_*', - 'keep *_cmsTopTagPFJetsCHS_*_*', + 'keep *_ak4PFJetsPuppi_*_*', + 'keep *_ak8PFJetsPuppi_*_*', + 'keep *_ak8PFJetsPuppiSoftDrop_*_*', 'keep *_ak4PFJets_*_*', 'keep *_JetPlusTrackZSPCorJetAntiKt4_*_*', 'keep *_caloTowers_*_*', @@ -123,7 +123,7 @@ 'keep *_fixedGridRhoFastjetCentralNeutral_*_*', 'drop doubles_*Jets_rhos_*', 'drop doubles_*Jets_sigmas_*', - '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..735becd5f0895 100644 --- a/RecoJets/Configuration/python/RecoPFJets_cff.py +++ b/RecoJets/Configuration/python/RecoPFJets_cff.py @@ -5,13 +5,11 @@ 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( @@ -35,11 +33,11 @@ fixedGridRhoFastjetCentralNeutral, ak4PFJets, ak4PFJetsCHS, - ak8PFJetsCHS, - ak8PFJetsCHSConstituents, - ak8PFJetsCHSSoftDrop, - ak8PFJetsCHSSoftDropMass, - cmsTopTagPFJetsCHS, + ak4PFJetsPuppi, + ak8PFJetsPuppi, + ak8PFJetsPuppiConstituents, + ak8PFJetsPuppiSoftDrop, + ak8PFJetsPuppiSoftDropMass, pfNoPileUpJMETask ) recoPFJets = cms.Sequence(recoPFJetsTask) @@ -51,23 +49,13 @@ fixedGridRhoFastjetCentralNeutral, ak4PFJets,ak8PFJets, pfNoPileUpJMETask, - ak8PFJetsCHS, - ak8PFJetsCHSPruned, - ak8PFJetsCHSFiltered, - ak8PFJetsCHSTrimmed, - ak8PFJetsCHSSoftDrop, - ak4PFJetsCHS, - ak8PFJetsCHS, - ak8PFJetsCHSPruned, - ak8PFJetsCHSFiltered, - ak8PFJetsCHSTrimmed, - ak8PFJetsCHSSoftDrop, - ak8PFJetsCHSPrunedMass, - ak8PFJetsCHSTrimmedMass, - ak8PFJetsCHSSoftDropMass, - ak8PFJetsCHSFilteredMass, - ca15PFJetsCHSMassDropFiltered, - ca15PFJetsCHSFiltered + ak8PFJetsPuppi, + ak8PFJetsPuppiSoftDrop, + ak4PFJetsCHS, + ak4PFJetsPuppi, + ak8PFJetsPuppi, + ak8PFJetsPuppiSoftDrop, + ak8PFJetsPuppiSoftDropMass ) recoAllPFJets=cms.Sequence(recoAllPFJetsTask) @@ -79,27 +67,16 @@ fixedGridRhoFastjetCentralNeutral, ak4PFJets,ak8PFJets, pfNoPileUpJMETask, - ak8PFJetsCHS, - ak8PFJetsCHSPruned, - ak8PFJetsCHSFiltered, - ak8PFJetsCHSTrimmed, - ak8PFJetsCHSSoftDrop, - ak4PFJetsCHS, - ak8PFJetsCHS, - ak8PFJetsCHSPruned, - ak8PFJetsCHSFiltered, - ak8PFJetsCHSTrimmed, - ak8PFJetsCHSSoftDrop, - ak8PFJetsCHSConstituents, - ak8PFJetsCHSPrunedMass, - ak8PFJetsCHSTrimmedMass, - ak8PFJetsCHSSoftDropMass, - ak8PFJetsCHSFilteredMass, - ca15PFJetsCHSMassDropFiltered, - ca15PFJetsCHSFiltered, + ak8PFJetsPuppi, + ak8PFJetsPuppiSoftDrop, + ak4PFJetsCHS, + ak4PFJetsPuppi, + ak8PFJetsPuppi, + ak8PFJetsPuppiSoftDrop, + ak8PFJetsPuppiConstituents, + ak8PFJetsPuppiSoftDropMass, ak8PFJetsCS, - ak8PFJetsCSConstituents, - puppi, + ak8PFJetsCSConstituents, ak4PFJetsPuppi, softKiller, ak4PFJetsSK diff --git a/RecoJets/JetProducers/plugins/VirtualJetProducer.cc b/RecoJets/JetProducers/plugins/VirtualJetProducer.cc index 52d908e23a2ab..ea97c3c8e4064 100644 --- a/RecoJets/JetProducers/plugins/VirtualJetProducer.cc +++ b/RecoJets/JetProducers/plugins/VirtualJetProducer.cc @@ -148,6 +148,7 @@ VirtualJetProducer::VirtualJetProducer(const edm::ParameterSet& iConfig) { useDeterministicSeed_ = iConfig.getParameter("useDeterministicSeed"); minSeed_ = iConfig.getParameter("minSeed"); verbosity_ = iConfig.getParameter("verbosity"); + applyPuppiWeight_ = iConfig.getParameter("applyPuppiWeight"); anomalousTowerDef_ = unique_ptr(new AnomalousTower(iConfig)); @@ -448,6 +449,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 +458,26 @@ void VirtualJetProducer::inputTowers() { std::cout << "PF cand:" << pfc << '\n'; } */ - fjInputs_.emplace_back(input.px(), input.py(), input.pz(), input.energy()); + if (!applyPuppiWeight_) { + fjInputs_.emplace_back(input.px(), input.py(), input.pz(), input.energy()); + fjInputs_.back().set_user_index(i - inBegin); + } else { + // To apply puppi weight, first check if this is a PFCandidate. + // If not, then check if it is a PackedCandidate + reco::PFCandidate const* pPF = dynamic_cast(i->get()); + auto w = pPF ? pPF->puppiWeight() : 0.0; + + if (!pPF) { + pat::PackedCandidate const* pPC = dynamic_cast(i->get()); + w = pPC ? pPC->puppiWeight() : 0.0; + } + + 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_) { @@ -1016,4 +1035,5 @@ void VirtualJetProducer::fillDescriptionsFromVirtualJetProducer(edm::ParameterSe desc.add("maxRecoveredHcalCells", 9999999); vector puCentersDefault; desc.add>("puCenters", puCentersDefault); + desc.add("applyPuppiWeight", false); } diff --git a/RecoJets/JetProducers/plugins/VirtualJetProducer.h b/RecoJets/JetProducers/plugins/VirtualJetProducer.h index 9057c23951ee2..8f078591bfda4 100644 --- a/RecoJets/JetProducers/plugins/VirtualJetProducer.h +++ b/RecoJets/JetProducers/plugins/VirtualJetProducer.h @@ -206,6 +206,7 @@ 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 applyPuppiWeight_; // Apply puppi weights stored in PFCandidate private: std::unique_ptr anomalousTowerDef_; // anomalous tower definition diff --git a/RecoJets/JetProducers/python/CaloJetParameters_cfi.py b/RecoJets/JetProducers/python/CaloJetParameters_cfi.py index 319bcb8067bdb..a098c3f9361ce 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 ), + applyPuppiWeight = cms.bool( False ) ) diff --git a/RecoJets/JetProducers/python/GenJetParameters_cfi.py b/RecoJets/JetProducers/python/GenJetParameters_cfi.py index ac8636c0da005..fb8970b8fcbe1 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 ), + applyPuppiWeight = cms.bool(False) ) diff --git a/RecoJets/JetProducers/python/PFClusterJetParameters_cfi.py b/RecoJets/JetProducers/python/PFClusterJetParameters_cfi.py index a9356f5f99dd9..92651f873e012 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 ), + applyPuppiWeight = cms.bool( False ) ) diff --git a/RecoJets/JetProducers/python/PFJetParameters_cfi.py b/RecoJets/JetProducers/python/PFJetParameters_cfi.py index cd1eef517b385..88e425a65f380 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 ), + applyPuppiWeight = cms.bool( False ) ) diff --git a/RecoJets/JetProducers/python/TrackJetParameters_cfi.py b/RecoJets/JetProducers/python/TrackJetParameters_cfi.py index 17cb5a4627e13..3e4b97f778b9c 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 ), + applyPuppiWeight = cms.bool( False ) ) diff --git a/RecoJets/JetProducers/python/ak4PFJets_cfi.py b/RecoJets/JetProducers/python/ak4PFJets_cfi.py index 2538fda84479d..59f1c2cd11b36 100644 --- a/RecoJets/JetProducers/python/ak4PFJets_cfi.py +++ b/RecoJets/JetProducers/python/ak4PFJets_cfi.py @@ -17,7 +17,8 @@ ) ak4PFJetsPuppi = ak4PFJets.clone( - src = cms.InputTag("puppi") + src = cms.InputTag("particleFlow"), + applyPuppiWeight = True ) ak4PFJetsSK = ak4PFJets.clone( diff --git a/RecoJets/JetProducers/python/ak8PFJets_cfi.py b/RecoJets/JetProducers/python/ak8PFJets_cfi.py index 038669d6b02b7..9c82f99bb94d4 100644 --- a/RecoJets/JetProducers/python/ak8PFJets_cfi.py +++ b/RecoJets/JetProducers/python/ak8PFJets_cfi.py @@ -16,7 +16,8 @@ # AK8 jets with various pileup subtraction schemes ############################################################################## ak8PFJetsPuppi = ak8PFJets.clone( - src = cms.InputTag("puppi") + src = cms.InputTag("particleFlow"), + applyPuppiWeight = True ) ak8PFJetsCHS = ak8PFJets.clone( diff --git a/RecoParticleFlow/Configuration/python/RecoParticleFlow_cff.py b/RecoParticleFlow/Configuration/python/RecoParticleFlow_cff.py index e2f79a7db9468..357e73f71d946 100644 --- a/RecoParticleFlow/Configuration/python/RecoParticleFlow_cff.py +++ b/RecoParticleFlow/Configuration/python/RecoParticleFlow_cff.py @@ -22,6 +22,9 @@ from RecoParticleFlow.PFProducer.chargedHadronPFTrackIsolation_cfi import * from RecoJets.JetProducers.fixedGridRhoProducerFastjet_cfi import * + +from CommonTools.PileupAlgos.Puppi_cff import puppi + fixedGridRhoFastjetAllTmp = fixedGridRhoFastjetAll.clone(pfCandidatesTag = cms.InputTag("particleFlowTmp")) particleFlowTmpTask = cms.Task(particleFlowTmp) @@ -39,7 +42,10 @@ pfParticleSelectionTask ) particleFlowReco = cms.Sequence(particleFlowRecoTask) -particleFlowLinksTask = cms.Task( particleFlow, particleFlowPtrs, chargedHadronPFTrackIsolation, particleBasedIsolationTask) +# SRR 17-Dec-2019: Add puppi weights by default to PF +particleFlow = puppi.clone(candName='particleFlowPrePuppi') + +particleFlowLinksTask = cms.Task( particleFlowPrePuppi, particleFlow, particleFlowPtrs, chargedHadronPFTrackIsolation, particleBasedIsolationTask) particleFlowLinks = cms.Sequence(particleFlowLinksTask) from RecoParticleFlow.PFTracking.hgcalTrackCollection_cfi import * diff --git a/RecoParticleFlow/PFProducer/python/pfLinker_cff.py b/RecoParticleFlow/PFProducer/python/pfLinker_cff.py index 3b9a9464ff3b3..6ab4dad7980ae 100644 --- a/RecoParticleFlow/PFProducer/python/pfLinker_cff.py +++ b/RecoParticleFlow/PFProducer/python/pfLinker_cff.py @@ -2,10 +2,10 @@ import RecoParticleFlow.PFProducer.pfLinker_cfi import RecoParticleFlow.PFProducer.particleFlowTmpPtrs_cfi -particleFlow = RecoParticleFlow.PFProducer.pfLinker_cfi.pfLinker.clone() -particleFlow.PFCandidate = [cms.InputTag("particleFlowTmp")] +particleFlowPrePuppi = RecoParticleFlow.PFProducer.pfLinker_cfi.pfLinker.clone() +particleFlowPrePuppi.PFCandidate = [cms.InputTag("particleFlowTmp")] particleFlowPtrs = RecoParticleFlow.PFProducer.particleFlowTmpPtrs_cfi.particleFlowTmpPtrs.clone() -particleFlowPtrs.src = "particleFlow" +particleFlowPtrs.src = "particleFlow" # SRR 17-Dec-2019: 'particleFlow' will be post-puppi now. from Configuration.Eras.Modifier_phase2_hgcal_cff import phase2_hgcal -phase2_hgcal.toModify(particleFlow, forceElectronsInHGCAL = True) +phase2_hgcal.toModify(particleFlowPrePuppi, forceElectronsInHGCAL = True) 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