diff --git a/v2.5/toolkit/fastnlotoolkit/fastNLOCoeffAddFix.cc b/v2.5/toolkit/fastnlotoolkit/fastNLOCoeffAddFix.cc index 42deea421e610eedda4756e0c2de27b86ad26b0e..705198640a9e2d1823deb4b26e8d5f0820899df0 100644 --- a/v2.5/toolkit/fastnlotoolkit/fastNLOCoeffAddFix.cc +++ b/v2.5/toolkit/fastnlotoolkit/fastNLOCoeffAddFix.cc @@ -411,9 +411,35 @@ bool fastNLOCoeffAddFix::IsEquivalent(const fastNLOCoeffBase& other, double rtol for (unsigned int scaleNode = 0; scaleNode < tst3.size(); scaleNode++) { fastNLO::v2d tst2 = tst3[scaleNode]; fastNLO::v2d ost2 = ost3[scaleNode]; - int xIt2Max = NPDFDim > 1 ? x2Max : x1Max; + int xIt2Max; + switch (NPDFDim) { + case 0: + xIt2Max = 1; + break; + case 1: + xIt2Max = x1Max; + break; + case 2: + xIt2Max = x2Max; + break; + default: + error["IsEquivalent"] << "Unsupported NPDFDim: " << NPDFDim << endl; + exit(1); + } for (int xIt2 = 0; xIt2 < xIt2Max; xIt2++) { - int xIt1Max = NPDFDim > 1 ? x1Max : xIt2 + 1; + int xIt1Max; + switch (NPDFDim) { + case 0: + case 2: + xIt1Max = x1Max; + break; + case 1: + xIt1Max = xIt2 + 1; + break; + default: + error["IsEquivalent"] << "Unsupported NPDFDim: " << NPDFDim << endl; + exit(1); + } for (int xIt1 = 0; xIt1 < xIt1Max; xIt1++) { fastNLO::v1d tst1 = tst2[GetXIndex(obsBin, xIt1 + tOffsetXN1, xIt2 + tOffsetXN2)]; fastNLO::v1d ost1 = ost2[op->GetXIndex(obsBin, xIt1 + oOffsetXN1, xIt2 + oOffsetXN2)]; diff --git a/v2.5/toolkit/fastnlotoolkit/fastNLOCreate.cc b/v2.5/toolkit/fastnlotoolkit/fastNLOCreate.cc index e2673e7f5e0f6838086780992ffcd118bdda9683..0043383f1586350e45fd93386f19a0ad4fdeed39 100644 --- a/v2.5/toolkit/fastnlotoolkit/fastNLOCreate.cc +++ b/v2.5/toolkit/fastnlotoolkit/fastNLOCreate.cc @@ -749,15 +749,15 @@ void fastNLOCreate::SetScenConstsFromSteering() { if (EXIST_NS(CheckScaleLimitsAgainstBins,fSteerfile)) fScenConsts.CheckScaleLimitsAgainstBins = BOOL_NS(CheckScaleLimitsAgainstBins,fSteerfile); if (EXIST_NS(X_Kernel,fSteerfile)) fScenConsts.X_Kernel = STRING_NS(X_Kernel,fSteerfile); if (EXIST_NS(X_DistanceMeasure,fSteerfile)) fScenConsts.X_DistanceMeasure = STRING_NS(X_DistanceMeasure,fSteerfile); - if (EXIST_NS(X_NNodes,fSteerfile)) fScenConsts.X_NNodes = INT_NS(X_NNodes,fSteerfile); + if (EXIST_NS(X_NNodes,fSteerfile)) fScenConsts.X_NNodes = DOUBLE_NS(X_NNodes,fSteerfile); if (EXIST_NS(X_NNodeCounting,fSteerfile)) fScenConsts.X_NNodeCounting = STRING_NS(X_NNodeCounting,fSteerfile); if (EXIST_NS(Mu1_Kernel,fSteerfile)) fScenConsts.Mu1_Kernel = STRING_NS(Mu1_Kernel,fSteerfile); if (EXIST_NS(Mu1_DistanceMeasure,fSteerfile)) fScenConsts.Mu1_DistanceMeasure = STRING_NS(Mu1_DistanceMeasure,fSteerfile); - if (EXIST_NS(Mu1_NNodes,fSteerfile)) fScenConsts.Mu1_NNodes = INT_NS(Mu1_NNodes,fSteerfile); + if (EXIST_NS(Mu1_NNodes,fSteerfile)) fScenConsts.Mu1_NNodes = DOUBLE_NS(Mu1_NNodes,fSteerfile); if (EXIST_NS(Mu1_NNodeCounting,fSteerfile)) fScenConsts.Mu1_NNodeCounting = STRING_NS(Mu1_NNodeCounting,fSteerfile); if (EXIST_NS(Mu2_Kernel,fSteerfile)) fScenConsts.Mu2_Kernel = STRING_NS(Mu2_Kernel,fSteerfile); if (EXIST_NS(Mu2_DistanceMeasure,fSteerfile)) fScenConsts.Mu2_DistanceMeasure = STRING_NS(Mu2_DistanceMeasure,fSteerfile); - if (EXIST_NS(Mu2_NNodes,fSteerfile)) fScenConsts.Mu2_NNodes = INT_NS(Mu2_NNodes,fSteerfile); + if (EXIST_NS(Mu2_NNodes,fSteerfile)) fScenConsts.Mu2_NNodes = DOUBLE_NS(Mu2_NNodes,fSteerfile); if (EXIST_NS(Mu2_NNodeCounting,fSteerfile)) fScenConsts.Mu2_NNodeCounting = STRING_NS(Mu2_NNodeCounting,fSteerfile); if (EXIST_NS(GeneratorName,fSteerfile)) fGenConsts.Name = STRING_NS(GeneratorName,fSteerfile); @@ -2472,20 +2472,29 @@ void fastNLOCreate::FillAllSubprocesses(const vector<vector<fnloEvent> >& events // do interpolation 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; unsigned int oldNxtot1 = c->XNode1[ObsBin].size(); unsigned int oldNxtot2 = 0, newNxtot2 = 0; - if (NPDFDim > 1) { + if (NPDFDim == 0) { + if (xmin < xmax) { + nxlo = fKernX1[ObsBin]->GetNodeValues(xmin); + nxup = fKernX1[ObsBin]->GetNodeValues(xmax); + } else { + nxup = fKernX1[ObsBin]->GetNodeValues(xmax); + nxlo = fKernX1[ObsBin]->GetNodeValues(xmin); + } + } else if (NPDFDim == 1) { + nxlo = fKernX1[ObsBin]->GetNodeValues(xmin); + nxup = fKernX1[ObsBin]->GetNodeValues(xmax); + } else { + nxlo = fKernX1[ObsBin]->GetNodeValues(xmin); nxup = fKernX2[ObsBin]->GetNodeValues(xmax); - fastNLOTools::ExtendHead(c->XNode1[ObsBin], fKernX1[ObsBin]->fgrid); oldNxtot2 = c->XNode2[ObsBin].size(); fastNLOTools::ExtendHead(c->XNode2[ObsBin], fKernX2[ObsBin]->fgrid); newNxtot2 = c->XNode2[ObsBin].size(); - } else { - nxup = fKernX1[ObsBin]->GetNodeValues(xmax); - fastNLOTools::ExtendHead(c->XNode1[ObsBin], fKernX1[ObsBin]->fgrid); } + fastNLOTools::ExtendHead(c->XNode1[ObsBin], fKernX1[ObsBin]->fgrid); unsigned int newNxtot1 = c->XNode1[ObsBin].size(); fastNLO::v4d& st = c->SigmaTilde[ObsBin]; if (newNxtot1 > oldNxtot1 || (NPDFDim > 1 && newNxtot2 > oldNxtot2)) { @@ -4569,7 +4578,7 @@ void fastNLOCreate::InitInterpolationKernels() { // Create x grids with X_NNodes+1 nodes up to x_max = 1. // The additional last node will be removed again below. - int nxtot = fScenConsts.X_NNodes; + double nxtot = fScenConsts.X_NNodes; if (fScenConsts.X_NNodeCounting != "NodeDensity") { nxtot += 1; } diff --git a/v2.5/toolkit/fastnlotoolkit/fastNLOTools.cc b/v2.5/toolkit/fastnlotoolkit/fastNLOTools.cc index 633578ea509d65723a1733b3ce067f6cd1c69025..dae18d978c3191390f77e7a49c47515796fd9adb 100644 --- a/v2.5/toolkit/fastnlotoolkit/fastNLOTools.cc +++ b/v2.5/toolkit/fastnlotoolkit/fastNLOTools.cc @@ -583,7 +583,11 @@ namespace fastNLOTools { template <typename T> void ExtendSigmaTildeX( std::vector<T>& SigmaTildeX, unsigned int OldDimSize1, unsigned int NewDimSize1, unsigned int OldDimSize2, unsigned int NewDimSize2, int NPDFDim, T InsertValue) { - if (NPDFDim == 1) { + if (NPDFDim == 0) { + for (unsigned int i = OldDimSize1; i < NewDimSize1; i++) { + SigmaTildeX.insert(SigmaTildeX.begin(), InsertValue); + } + } else if (NPDFDim == 1) { for (unsigned int i = OldDimSize1; i < NewDimSize1; i++) { for (unsigned int j = 0; j <= i; j++) { SigmaTildeX.insert(SigmaTildeX.begin() + (j * (j + 1) / 2), InsertValue); diff --git a/v2.5/toolkit/fastnlotoolkit/include/fastnlotk/fastNLOTableConstants.h b/v2.5/toolkit/fastnlotoolkit/include/fastnlotk/fastNLOTableConstants.h index be5ed6f8db3c0d9dc2486f62403f139b4b168e2b..55e2b876482f60dbc1a62efb4509216d3ec7f04b 100644 --- a/v2.5/toolkit/fastnlotoolkit/include/fastnlotk/fastNLOTableConstants.h +++ b/v2.5/toolkit/fastnlotoolkit/include/fastnlotk/fastNLOTableConstants.h @@ -133,18 +133,18 @@ namespace fastNLO { */ std::string X_Kernel{"Lagrange"}; //!< "Lagrange" std::string X_DistanceMeasure{"sqrtlog10"}; //!< "sqrtlog10" - int X_NNodes{15}; //!< 15 + double X_NNodes{15}; //!< 15 std::string X_NNodeCounting{"NodesPerBin"}; //!< "NodesPerBin" ("NodesMax", "NodesPerMagnitude") std::string Mu1_Kernel{"Lagrange"}; //!< "Lagrange" std::string Mu1_DistanceMeasure{"loglog025"}; //!< "loglog025" - int Mu1_NNodes{6}; //!< 6 - std::string Mu1_NNodeCounting{"NodesPerWarmupRange"}; + double Mu1_NNodes{6}; //!< 6 + std::string Mu1_NNodeCounting{"NodesPerBin"}; std::string Mu2_Kernel{"Lagrange"}; //!< "Lagrange"; Scale2 not used for fixed-scale tables std::string Mu2_DistanceMeasure{"loglog025"}; //!< "loglog025" - int Mu2_NNodes{6}; //!< 6 - std::string Mu2_NNodeCounting{"NodesPerWarmupRange"}; + double Mu2_NNodes{6}; //!< 6 + std::string Mu2_NNodeCounting{"NodesPerBin"}; // KR: Defaults can be set using SetScenConstsDefaults(). // If the struct is directly created within another project,