Skip to content

Commit

Permalink
Merge pull request #243 from blinkseb/pdf_fix
Browse files Browse the repository at this point in the history
Switch to workaround mode for PDF weight only if all weights are invalid
  • Loading branch information
swertz authored Feb 14, 2017
2 parents 81c1ac4 + 38e3c68 commit 550df5c
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/EventProducer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -359,17 +359,20 @@ void EventProducer::produce(edm::Event& event_, const edm::EventSetup& eventSetu
if (isLO && !scalup_decision_taken) {
scalup_decision_taken = true;

// Compute all PDF weights. If one is crazy, then switch to workaround mode
// Compute all PDF weights. If all of them are crazy, then switch to workaround mode
size_t n_invalid = 0;
if (!m_pdf_weights_matching.empty()) {
for (auto& w: m_pdf_weights_matching) {
float weight = lhe_info->weights()[w.second].wgt / lhe_originalXWGTUP;
if (!weight_is_valid(weight)) {
use_scalup_for_lo_weights = true;
break;
n_invalid++;
}
}
}

if (n_invalid == m_pdf_weights_matching.size())
use_scalup_for_lo_weights = true;

#ifdef DEBUG_PDF
std::cout << "Workaround for LO LHE weights:";
if (use_scalup_for_lo_weights)
Expand Down

0 comments on commit 550df5c

Please sign in to comment.