diff --git a/v2.5/toolkit/fastnlotoolkit/fastNLOCreate.cc b/v2.5/toolkit/fastnlotoolkit/fastNLOCreate.cc index 44fdb147dc3370d0d57bed42c906923eeef01f3b..da8b5dadf03be4ecbbfc772e0b3d139165f80220 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());