diff --git a/PhysicsTools/NanoAOD/plugins/GenWeightsTableProducer.cc b/PhysicsTools/NanoAOD/plugins/GenWeightsTableProducer.cc index c684096b0ee40..44c24a8f0cb11 100644 --- a/PhysicsTools/NanoAOD/plugins/GenWeightsTableProducer.cc +++ b/PhysicsTools/NanoAOD/plugins/GenWeightsTableProducer.cc @@ -519,7 +519,9 @@ class GenWeightsTableProducer : public edm::global::EDProducerpsWeightIDs.size() == vectorSize) + ? genWeightChoice->psWeightsDoc + : "All PS weights (w_var / w_nominal)"; } else { if (!psWeightWarning_.exchange(true)) edm::LogWarning("LHETablesProducer") @@ -530,8 +532,8 @@ class GenWeightsTableProducer : public edm::global::EDProducerweightNames(); std::unordered_map knownPDFSetsFromGenInfo_; @@ -1017,7 +1019,8 @@ class GenWeightsTableProducer : public edm::global::EDProducerpsBaselineID = weightIter; } else if (line.find("isr") != std::string::npos || line.find("fsr") != std::string::npos) { - weightChoice->matchPS_alt = line.find("sr:") != std::string::npos; // (f/i)sr: for new weights + weightChoice->matchPS_alt = line.find("sr:") != std::string::npos || + line.find("sr.") != std::string::npos; // (f/i)sr: for new weights if (keepAllPSWeights_) { weightChoice->psWeightIDs.push_back(weightIter); // PS variations } else if (std::regex_search(line, groups, mainPSw)) { @@ -1031,11 +1034,9 @@ class GenWeightsTableProducer : public edm::global::EDProducerpsWeightsDoc = "All PS weights (w_var / w_nominal)"; + weightChoice->psWeightsDoc = "All PS weights (w_var / w_nominal) "; } else if (weightChoice->psWeightIDs.size() == 4) { - weightChoice->psWeightsDoc = - "PS weights (w_var / w_nominal); [0] is ISR=2 FSR=1; [1] is ISR=1 FSR=2" - "[2] is ISR=0.5 FSR=1; [3] is ISR=1 FSR=0.5;"; + weightChoice->psWeightsDoc = "PS weights (w_var / w_nominal) "; for (int i = 0; i < 4; i++) { if (static_cast(weightChoice->psWeightIDs[i]) == -1) weightChoice->setMissingWeight(i); @@ -1043,6 +1044,10 @@ class GenWeightsTableProducer : public edm::global::EDProducerpsWeightsDoc = "dummy PS weight (1.0) "; } + for (unsigned i = 0; i < weightChoice->psWeightIDs.size(); ++i) { + weightChoice->psWeightsDoc += + "[" + std::to_string(i) + "] " + weightNames.at(weightChoice->psWeightIDs.at(i)) + "; "; + } weightChoice->scaleWeightIDs.clear(); weightChoice->pdfWeightIDs.clear();