From d788d3a1538fd7108b663f9d5d0830bc76973d24 Mon Sep 17 00:00:00 2001 From: Kenneth Long Date: Thu, 22 Oct 2020 23:33:27 +0200 Subject: [PATCH 1/3] Catch EW parameter weights for mW sample --- .../plugins/GenWeightsTableProducer.cc | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/PhysicsTools/NanoAOD/plugins/GenWeightsTableProducer.cc b/PhysicsTools/NanoAOD/plugins/GenWeightsTableProducer.cc index 4728bca56d2bc..95d496ceedb15 100644 --- a/PhysicsTools/NanoAOD/plugins/GenWeightsTableProducer.cc +++ b/PhysicsTools/NanoAOD/plugins/GenWeightsTableProducer.cc @@ -742,6 +742,25 @@ class GenWeightsTableProducer : public edm::global::EDProducer>> LHE reweighting weight: " << rwgtID << std::endl; + if (std::find(lheReweighingIDs.begin(), lheReweighingIDs.end(), rwgtID) == lheReweighingIDs.end()) { + // we're only interested in the beggining of the block + lheReweighingIDs.emplace_back(rwgtID); + } + } else if (std::regex_search(lines[iLine], endweightgroup)) { + if (lheDebug) + std::cout << ">>> Looks like the end of a weight group" << std::endl; + } + } } else { for (++iLine; iLine < nLines; ++iLine) { if (lheDebug) From 06989b904dd3c7353efd810ea2b96343f7415a63 Mon Sep 17 00:00:00 2001 From: Kenneth Long Date: Fri, 23 Oct 2020 00:59:09 +0200 Subject: [PATCH 2/3] Restore import print statement --- PhysicsTools/NanoAOD/plugins/GenWeightsTableProducer.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/PhysicsTools/NanoAOD/plugins/GenWeightsTableProducer.cc b/PhysicsTools/NanoAOD/plugins/GenWeightsTableProducer.cc index 95d496ceedb15..0e266028228dc 100644 --- a/PhysicsTools/NanoAOD/plugins/GenWeightsTableProducer.cc +++ b/PhysicsTools/NanoAOD/plugins/GenWeightsTableProducer.cc @@ -745,6 +745,7 @@ class GenWeightsTableProducer : public edm::global::EDProducer>> Looks like an EW parameter weight" << std::endl; for (++iLine; iLine < nLines; ++iLine) { if (lheDebug) std::cout << " " << lines[iLine]; From 6b03d69290a9ae24ac1568dbd619ca53d647dc59 Mon Sep 17 00:00:00 2001 From: Kenneth Long Date: Mon, 26 Oct 2020 20:34:17 +0100 Subject: [PATCH 3/3] Clang format --- PhysicsTools/NanoAOD/plugins/GenWeightsTableProducer.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/PhysicsTools/NanoAOD/plugins/GenWeightsTableProducer.cc b/PhysicsTools/NanoAOD/plugins/GenWeightsTableProducer.cc index 0e266028228dc..0cc12dd7d94e4 100644 --- a/PhysicsTools/NanoAOD/plugins/GenWeightsTableProducer.cc +++ b/PhysicsTools/NanoAOD/plugins/GenWeightsTableProducer.cc @@ -742,8 +742,8 @@ class GenWeightsTableProducer : public edm::global::EDProducer>> Looks like an EW parameter weight" << std::endl; for (++iLine; iLine < nLines; ++iLine) { @@ -760,7 +760,7 @@ class GenWeightsTableProducer : public edm::global::EDProducer>> Looks like the end of a weight group" << std::endl; - } + } } } else { for (++iLine; iLine < nLines; ++iLine) {