From daf6a4fa025340d7def760a77841d47775a617e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20G=C3=A4=C3=9Fler?= <Johannes Gäßler> Date: Mon, 13 Mar 2023 12:47:36 +0100 Subject: [PATCH] Fix DIS fill code --- v2.5/toolkit/fastnlotoolkit/fastNLOCreate.cc | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/v2.5/toolkit/fastnlotoolkit/fastNLOCreate.cc b/v2.5/toolkit/fastnlotoolkit/fastNLOCreate.cc index 44fdb147..da8b5dad 100644 --- a/v2.5/toolkit/fastnlotoolkit/fastNLOCreate.cc +++ b/v2.5/toolkit/fastnlotoolkit/fastNLOCreate.cc @@ -2945,12 +2945,22 @@ void fastNLOCreate::FillContribution(int scalevar, const double wgtfac) { //cout<<"try to interpol. ObsBin="<<ObsBin<<" ,x1="<<fEvent._x1<<", x2="<<fEvent._x2<<", mu1="<<Scenario._m1<<", mu2="<<Scenario._m2<<endl; double xmin = NPDFDim == 1 ? std::min(fEvent._x1,fEvent._x2) : fEvent._x1; double xmax = NPDFDim == 1 ? std::max(fEvent._x1,fEvent._x2) : fEvent._x2; - vector<pair<int,double> > nxlo = fKernX1[ObsBin]->GetNodeValues(xmin); + vector<pair<int,double> > nxlo; vector<pair<int,double> > nxup; - if (c->NPDFDim > 1) { + if (NPDFDim == 1) { + nxlo = fKernX1[ObsBin]->GetNodeValues(xmin); + nxup = fKernX1[ObsBin]->GetNodeValues(xmax); + } else if (NPDFDim > 1) { + nxlo = fKernX1[ObsBin]->GetNodeValues(xmin); nxup = fKernX2[ObsBin]->GetNodeValues(xmax); } else { - nxup = fKernX1[ObsBin]->GetNodeValues(xmax); + if (xmin < xmax) { + nxlo = fKernX1[ObsBin]->GetNodeValues(xmin); + nxup = fKernX1[ObsBin]->GetNodeValues(xmax); + } else { + nxup = fKernX1[ObsBin]->GetNodeValues(xmax); + nxlo = fKernX1[ObsBin]->GetNodeValues(xmin); + } } c->ExtendX(ObsBin, fKernX1, fKernX2); @@ -2967,7 +2977,7 @@ void fastNLOCreate::FillContribution(int scalevar, const double wgtfac) { fKernX1[ObsBin]->CheckX(xmin); fKernX2[ObsBin]->CheckX(xmax); ApplyPDFWeight(nxlo,xmin,fKernX1[ObsBin]->GetGridPtr()); - if (c->NPDFDim > 1) { + if (NPDFDim > 1) { ApplyPDFWeight(nxup,xmax,fKernX2[ObsBin]->GetGridPtr()); } else { ApplyPDFWeight(nxup,xmax,fKernX1[ObsBin]->GetGridPtr()); -- GitLab