From ca42d892bf745c8647dc40ed334e2b871f2d9c1c Mon Sep 17 00:00:00 2001 From: Kenneth Long Date: Sun, 28 Nov 2021 23:57:39 +0100 Subject: [PATCH] Manually port Markus' commit, avoiding rivet version changes copy of commit 1ec4f0829ac2841a18f16c3ab5ec4589e1e9abc1 Clang format Fix typo Fix merge mistake --- .../RivetInterface/interface/RivetAnalysis.h | 8 ++++++-- .../RivetInterface/python/particleLevel_cfi.py | 1 + PhysicsTools/NanoAOD/plugins/GenJetGenPartMerger.cc | 6 +++--- PhysicsTools/NanoAOD/python/electrons_cff.py | 1 - 4 files changed, 10 insertions(+), 6 deletions(-) diff --git a/GeneratorInterface/RivetInterface/interface/RivetAnalysis.h b/GeneratorInterface/RivetInterface/interface/RivetAnalysis.h index 6c6b5cc8e0352..b8957d3c13710 100644 --- a/GeneratorInterface/RivetInterface/interface/RivetAnalysis.h +++ b/GeneratorInterface/RivetInterface/interface/RivetAnalysis.h @@ -34,6 +34,7 @@ namespace Rivet { bool _usePromptFinalStates; bool _excludePromptLeptonsFromJetClustering; bool _excludeNeutrinosFromJetClustering; + bool _doJetClustering; double _particleMinPt, _particleMaxEta; double _lepConeSize, _lepMinPt, _lepMaxEta; @@ -51,6 +52,7 @@ namespace Rivet { _usePromptFinalStates(pset.getParameter("usePromptFinalStates")), _excludePromptLeptonsFromJetClustering(pset.getParameter("excludePromptLeptonsFromJetClustering")), _excludeNeutrinosFromJetClustering(pset.getParameter("excludeNeutrinosFromJetClustering")), + _doJetClustering(pset.getParameter("doJetClustering")), _particleMinPt (pset.getParameter("particleMinPt")), _particleMaxEta (pset.getParameter("particleMaxEta")), @@ -201,8 +203,10 @@ namespace Rivet { } - _jets = applyProjection(event, "Jets").jetsByPt(jet_cut); - _fatjets = applyProjection(event, "FatJets").jetsByPt(fatjet_cut); + if (_doJetClustering) { + _jets = apply(event, "Jets").jetsByPt(jet_cut); + _fatjets = apply(event, "FatJets").jetsByPt(fatjet_cut); + } _neutrinos = applyProjection(event, "Neutrinos").particlesByPt(); _met = applyProjection(event, "MET").missingMomentum().p3(); diff --git a/GeneratorInterface/RivetInterface/python/particleLevel_cfi.py b/GeneratorInterface/RivetInterface/python/particleLevel_cfi.py index 7d441f009e909..587c10417ff7b 100644 --- a/GeneratorInterface/RivetInterface/python/particleLevel_cfi.py +++ b/GeneratorInterface/RivetInterface/python/particleLevel_cfi.py @@ -6,6 +6,7 @@ usePromptFinalStates = cms.bool(True), # for leptons, photons, neutrinos excludePromptLeptonsFromJetClustering = cms.bool(True), excludeNeutrinosFromJetClustering = cms.bool(True), + doJetClustering = cms.bool(True), particleMinPt = cms.double(0.), particleMaxEta = cms.double(5.), # HF range. Maximum 6.0 on MiniAOD diff --git a/PhysicsTools/NanoAOD/plugins/GenJetGenPartMerger.cc b/PhysicsTools/NanoAOD/plugins/GenJetGenPartMerger.cc index 917987c1b0ab2..35a532433d754 100644 --- a/PhysicsTools/NanoAOD/plugins/GenJetGenPartMerger.cc +++ b/PhysicsTools/NanoAOD/plugins/GenJetGenPartMerger.cc @@ -84,9 +84,9 @@ void GenJetGenPartMerger::produce(edm::Event& iEvent, const edm::EventSetup& iSe for (unsigned int ijet = 0; ijet < jetHandle->size(); ++ijet) { auto jet = jetHandle->at(ijet); if (cut_(jet)) { - merged->push_back(reco::GenJet(jet)); - reco::GenJetRef jetRef(jetHandle, ijet); - hasTauAncValues.push_back((*tauAncHandle)[jetRef]); + merged->push_back(reco::GenJet(jet)); + reco::GenJetRef jetRef(jetHandle, ijet); + hasTauAncValues.push_back((*tauAncHandle)[jetRef]); } } diff --git a/PhysicsTools/NanoAOD/python/electrons_cff.py b/PhysicsTools/NanoAOD/python/electrons_cff.py index 983fa820b1923..1a848b3f60594 100644 --- a/PhysicsTools/NanoAOD/python/electrons_cff.py +++ b/PhysicsTools/NanoAOD/python/electrons_cff.py @@ -532,7 +532,6 @@ def _get_bitmapVIDForEle_docstring(modules,WorkingPoints): electronSequence = cms.Sequence(bitmapVIDForEle + bitmapVIDForEleHEEP + isoForEle + ptRatioRelForEle + seedGainEle + slimmedElectronsWithUserData + finalElectrons) electronTables = cms.Sequence (electronMVATTH + electronTable) -<<<<<<< HEAD electronMCold = cms.Sequence(electronsMCMatchForTable + electronMCTable) electronMC = cms.Sequence(tautaggerForMatching + matchingElecPhoton + electronsMCMatchForTable + electronsMCMatchForTableAlt + electronMCTable) ( run2_nanoAOD_106Xv1 & ~run2_nanoAOD_devel).toModify( electronMCTable,