Skip to content

Commit

Permalink
Merge pull request #18 from NNPDF/skip_empty_channels
Browse files Browse the repository at this point in the history
skip flavours not contained in the PDF
  • Loading branch information
scarlehoff authored Jun 24, 2022
2 parents 707f03e + cc4f356 commit 94f1d0b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/configure.ac
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
AC_INIT([Vrap], [1.1], [[email protected]])
AC_INIT([Vrap], [1.2], [[email protected]])
AM_INIT_AUTOMAKE([-Wall -Werror foreign])
AC_PROG_CXX

Expand Down
16 changes: 12 additions & 4 deletions src/pineappl_interface.C
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,27 @@ void pinerap::reconstruct_lumi(LuminosityFunction lumi, collider c,
std::vector<double> &factors) {
pdfArray f1;
pdfArray f2;
pdfArray sampler;

// TODO: add missing partons
std::vector<std::pair<double pdfArray::*, int32_t>> partons = {
{&pdfArray::tbar, -6}, {&pdfArray::bbar, -5}, {&pdfArray::cbar, -4},
{&pdfArray::sbar, -3}, {&pdfArray::ubar, -2}, {&pdfArray::dbar, -1},
{&pdfArray::gluon, 21}, {&pdfArray::d, 1}, {&pdfArray::u, 2},
{&pdfArray::s, 3}, {&pdfArray::c, 4}, {&pdfArray::b, 5},
{&pdfArray::t, 6}, {&pdfArray::x, 9999}, // TODO: what is `x`?
{&pdfArray::t, 6}, {&pdfArray::x, 9999},
};

// Create a sampler to automatically skip partons that the PDF does not include
LHAComputePdf(0.1, 10.0, sampler);

// loop over partons of the first initial state
for (auto const a : partons) {
if (sampler.*a.first == 0.0) continue;

// loop over partons of the second initial state
for (auto const b : partons) {
// TODO: check that this zero-initializes
if (sampler.*b.first == 0.0) continue;

f1 = pdfArray();
f2 = pdfArray();

Expand Down Expand Up @@ -71,7 +77,9 @@ void CheffPanopoulos::create_grid(int max_orders, double q2, collider coll) {
// Take the collider type from the runcard
for (auto lumi_function: luminosities) {
reconstruct_lumi(lumi_function, coll, pdg_ids, factors);
pineappl_lumi_add(lumi, factors.size(), pdg_ids.data(), factors.data());
if (!pdg_ids.empty()) {
pineappl_lumi_add(lumi, factors.size(), pdg_ids.data(), factors.data());
}
pdg_ids.clear();
factors.clear();
}
Expand Down

0 comments on commit 94f1d0b

Please sign in to comment.