Skip to content

Commit

Permalink
Merge pull request #31939 from kdlong/NanoWmassEWWeights
Browse files Browse the repository at this point in the history
Store EW parameter weights in NanoAOD of W mass samples
  • Loading branch information
cmsbuild committed Oct 28, 2020
2 parents 9d390e8 + 6b03d69 commit 1fc8b7d
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions PhysicsTools/NanoAOD/plugins/GenWeightsTableProducer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -742,6 +742,26 @@ class GenWeightsTableProducer : public edm::global::EDProducer<edm::StreamCache<
break;
}
}
} else if (groupname == "mass_variation" || groupname == "sthw2_variation" ||
groupname == "width_variation") {
if (lheDebug)
std::cout << ">>> Looks like an EW parameter weight" << std::endl;
for (++iLine; iLine < nLines; ++iLine) {
if (lheDebug)
std::cout << " " << lines[iLine];
if (std::regex_search(lines[iLine], groups, rwgt)) {
std::string rwgtID = groups.str(1);
if (lheDebug)
std::cout << " >>> 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)
Expand Down

0 comments on commit 1fc8b7d

Please sign in to comment.