diff --git a/v2.5/toolkit/fastnlotoolkit/fastNLOCoeffAddBase.cc b/v2.5/toolkit/fastnlotoolkit/fastNLOCoeffAddBase.cc index f6680dc2055658b4d57f6374a6e24974f180f8b0..3d236b21cd104822bd92b3ebcf5dd9072fc7acf3 100644 --- a/v2.5/toolkit/fastnlotoolkit/fastNLOCoeffAddBase.cc +++ b/v2.5/toolkit/fastnlotoolkit/fastNLOCoeffAddBase.cc @@ -4,6 +4,9 @@ #include "fastnlotk/fastNLOCoeffAddBase.h" #include "fastnlotk/fastNLOTools.h" +#include "fastnlotk/fastNLOEvent.h" +#include "fastnlotk/fastNLOInterpolBase.h" +#include "fastnlotk/fastNLOTools.h" using namespace std; using namespace fastNLO; @@ -844,3 +847,37 @@ void fastNLOCoeffAddBase::CatBin(const fastNLOCoeffAddBase& other, unsigned int } fastNLOCoeffBase::CatBin(other, iObsIdx); } + + +//________________________________________________________________________________________________________________ // +void fastNLOCoeffAddBase::ExtendX(int ObsBin, std::vector<fastNLOInterpolBase*>& KernX1, std::vector<fastNLOInterpolBase*>& KernX2) { + unsigned int oldXSize1 = GetNxtot1(ObsBin); + unsigned int oldXSize2 = GetNxtot2(ObsBin); + bool x1Extended = fastNLOTools::ExtendHead(XNode1[ObsBin], KernX1[ObsBin]->fgrid); + if (NPDFDim > 1) { + bool x2Extended = fastNLOTools::ExtendHead(XNode2[ObsBin], KernX2[ObsBin]->fgrid); + if (!x1Extended && !x2Extended) { + return; + } + } else { + if (!x1Extended) { + return; + } + } + ExtendSigmaTildeX(ObsBin, oldXSize1, oldXSize2); +} + + +//________________________________________________________________________________________________________________ // +void fastNLOCoeffAddBase::ExtendSigmaTildeX(int ObsBin, unsigned int OldXSize1, unsigned int OldXSize2) { + error["ExtendSigmaTildeX"] << "Method not implemented for fastNLOCoeffAddBase subclass. Exiting." << endl; + exit(1); +} + + +//________________________________________________________________________________________________________________ // +void fastNLOCoeffAddBase::Fill(fnloEvent& Event, int ObsBin, int X, int scalevar, + const std::vector<std::pair<int, double>>& nmu1, const std::vector<std::pair<int, double>>& nmu2, int SubProcess, double w) { + error["Fill"] << "Method not implemented for fastNLOCoeffAddBase subclass. Exiting." << endl; + exit(1); +} diff --git a/v2.5/toolkit/fastnlotoolkit/fastNLOCoeffAddFix.cc b/v2.5/toolkit/fastnlotoolkit/fastNLOCoeffAddFix.cc index 705198640a9e2d1823deb4b26e8d5f0820899df0..7347157e0ca3ea40f6b187c6945df315750a1ac1 100644 --- a/v2.5/toolkit/fastnlotoolkit/fastNLOCoeffAddFix.cc +++ b/v2.5/toolkit/fastnlotoolkit/fastNLOCoeffAddFix.cc @@ -1,4 +1,5 @@ #include <cstdlib> +#include <fastnlotk/fastNLOEvent.h> #include <iostream> #include <cmath> #include <algorithm> @@ -598,3 +599,28 @@ void fastNLOCoeffAddFix::CatBin(const fastNLOCoeffAddFix& other, unsigned int iO } fastNLOCoeffAddBase::CatBin(other, iObsIdx, ITabVersionRead); } + + +//________________________________________________________________________________________________________________ // +void fastNLOCoeffAddFix::ExtendSigmaTildeX(int ObsBin, unsigned int OldXSize1, unsigned int OldXSize2) { + int nScalevar = GetNScalevar(); + int nScaleNode = GetNScaleNode(); + int newXSize1 = GetNxtot1(ObsBin); + int newXSize2 = GetNxtot2(ObsBin); + for (int scaleVar = 0; scaleVar < nScalevar; scaleVar++) { + for (int scaleNode = 0; scaleNode < nScaleNode; scaleNode++) { + fastNLOTools::ExtendSigmaTildeX( + SigmaTilde[ObsBin][scaleVar][scaleNode], OldXSize1, newXSize1, OldXSize2, newXSize2, + NPDFDim, fastNLO::v1d(NSubproc)); + } + } +} + + +//________________________________________________________________________________________________________________ // +void fastNLOCoeffAddFix::Fill(fnloEvent& Event, int ObsBin, int X, int scalevar, const vector<pair<int, double>>& nmu1, + const vector<pair<int, double>>& nmu2, int SubProcess, double w) { + for (unsigned int m1 = 0 ; m1<nmu1.size() ; m1++) { + SigmaTilde[ObsBin][scalevar][nmu1[m1].first][X][SubProcess] += Event._w * nmu1[m1].second * w; + } +} diff --git a/v2.5/toolkit/fastnlotoolkit/fastNLOCoeffAddFlex.cc b/v2.5/toolkit/fastnlotoolkit/fastNLOCoeffAddFlex.cc index 7c4717d57656d832d204a6cc78789a3ce3fe52d9..0f24af1c451884bc611155648596e7a375a8b876 100644 --- a/v2.5/toolkit/fastnlotoolkit/fastNLOCoeffAddFlex.cc +++ b/v2.5/toolkit/fastnlotoolkit/fastNLOCoeffAddFlex.cc @@ -5,6 +5,7 @@ #include "fastnlotk/fastNLOTable.h" #include "fastnlotk/fastNLOTools.h" #include "fastnlotk/fastNLOCoeffAddFlex.h" +#include "fastnlotk/fastNLOEvent.h" using namespace std; @@ -688,3 +689,45 @@ bool fastNLOCoeffAddFlex::IsSigmaTildeEquivalent(const fastNLOCoeffAddFlex* op, } return true; } + + +//________________________________________________________________________________________________________________ // +void fastNLOCoeffAddFlex::ExtendSigmaTildeX(int ObsBin, unsigned int OldXSize1, unsigned int OldXSize2) { + fastNLO::v3d insertValue = fastNLO::v3d( + GetNScaleNode1(ObsBin), fastNLO::v2d(GetNScaleNode2(ObsBin), fastNLO::v1d(GetNSubproc()))); + unsigned int newXSize1 = GetNxtot1(ObsBin); + unsigned int newXSize2 = GetNxtot2(ObsBin); + fastNLOTools::ExtendSigmaTildeX( + SigmaTildeMuIndep[ObsBin], OldXSize1, newXSize1, OldXSize2, newXSize2, NPDFDim, insertValue); + fastNLOTools::ExtendSigmaTildeX( + SigmaTildeMuRDep[ObsBin], OldXSize1, newXSize1, OldXSize2, newXSize2, NPDFDim, insertValue); + fastNLOTools::ExtendSigmaTildeX( + SigmaTildeMuFDep[ObsBin], OldXSize1, newXSize1, OldXSize2, newXSize2, NPDFDim, insertValue); + fastNLOTools::ExtendSigmaTildeX( + SigmaTildeMuRRDep[ObsBin], OldXSize1, newXSize1, OldXSize2, newXSize2, NPDFDim, insertValue); + fastNLOTools::ExtendSigmaTildeX( + SigmaTildeMuFFDep[ObsBin], OldXSize1, newXSize1, OldXSize2, newXSize2, NPDFDim, insertValue); + fastNLOTools::ExtendSigmaTildeX( + SigmaTildeMuRFDep[ObsBin], OldXSize1, newXSize1, OldXSize2, newXSize2, NPDFDim, insertValue); +} + + +//________________________________________________________________________________________________________________ // +void fastNLOCoeffAddFlex::Fill(fnloEvent& Event, int ObsBin, int X, int scalevar, const vector<pair<int, double>>& nmu1, + const vector<pair<int, double>>& nmu2, int SubProcess, double w) { + for (unsigned int m1 = 0 ; m1<nmu1.size() ; m1++) { + for (unsigned int mu2 = 0 ; mu2<nmu2.size() ; mu2++) { + double wfnlo = nmu1[m1].second * nmu2[mu2].second * w; + SigmaTildeMuIndep[ObsBin][X][nmu1[m1].first][nmu2[mu2].first][SubProcess] += Event._w * wfnlo; + if (Event._wf != 0 || Event._wr != 0) { + SigmaTildeMuFDep[ObsBin][X][nmu1[m1].first][nmu2[mu2].first][SubProcess] += Event._wf * wfnlo; + SigmaTildeMuRDep[ObsBin][X][nmu1[m1].first][nmu2[mu2].first][SubProcess] += Event._wr * wfnlo; + } + if (Event._wrr != 0 || Event._wff != 0 || Event._wrf != 0) { + SigmaTildeMuRRDep[ObsBin][X][nmu1[m1].first][nmu2[mu2].first][SubProcess] += Event._wrr * wfnlo; + SigmaTildeMuFFDep[ObsBin][X][nmu1[m1].first][nmu2[mu2].first][SubProcess] += Event._wff * wfnlo; + SigmaTildeMuRFDep[ObsBin][X][nmu1[m1].first][nmu2[mu2].first][SubProcess] += Event._wrf * wfnlo; + } + } + } +} diff --git a/v2.5/toolkit/fastnlotoolkit/fastNLOCreate.cc b/v2.5/toolkit/fastnlotoolkit/fastNLOCreate.cc index 0043383f1586350e45fd93386f19a0ad4fdeed39..44fdb147dc3370d0d57bed42c906923eeef01f3b 100644 --- a/v2.5/toolkit/fastnlotoolkit/fastNLOCreate.cc +++ b/v2.5/toolkit/fastnlotoolkit/fastNLOCreate.cc @@ -2448,7 +2448,7 @@ void fastNLOCreate::FillAllSubprocesses(const vector<vector<fnloEvent> >& events // KR TODO Check to replace wgtfac by _wo // cout << "WWW: wgtfac = " << wgtfac << "_wo = " << scen._wo << endl; - const bool bFasterCode = true; // experimental developement: try to make code faster + const bool bFasterCode = false; // experimental developement: try to make code faster if (bFasterCode && !fIsWarmup && !fIsFlexibleScale) { // make filling code a little bit faster ... ~40% // if filling step "+=" is commented, then code is a factor ~6 faster @@ -2928,25 +2928,67 @@ void fastNLOCreate::FillContribution(int scalevar, const double wgtfac) { //logger.debug["FillContributionFixHHC"]<<"The process Id is p = "<<p<<endl; - // ---- DIS ---- // - if (c->GetNPDF() == 1 && fastNLOCoeffAddFlex::CheckCoeffConstants(c,true)) { - // todo - FillContributionFlexDIS((fastNLOCoeffAddFlex*)GetTheCoeffTable(), ObsBin, wgtfac); - //{logger.error["FillContribution"]<<"Don't know how to fill this table. Exiting."<<endl; exit(1); } - } else if (c->GetNPDF() == 1 && fastNLOCoeffAddFix::CheckCoeffConstants(c,true)) { - // todo - FillContributionFixDIS((fastNLOCoeffAddFix*)GetTheCoeffTable(), ObsBin, scalevar, wgtfac); - //{logger.error["FillContribution"]<<"Don't know how to fill this table (DIS: fix-scale tables!). Exiting."<<endl; exit(1); } - } - // ---- pp/ppbar ---- // - else if (c->GetNPDF() == 2 && fastNLOCoeffAddFlex::CheckCoeffConstants(c,true)) - FillContributionFlexHHC((fastNLOCoeffAddFlex*)GetTheCoeffTable(), ObsBin, wgtfac); - else if (c->GetNPDF() == 2 && fastNLOCoeffAddFix::CheckCoeffConstants(c,true)) - FillContributionFixHHC((fastNLOCoeffAddFix*)GetTheCoeffTable(), ObsBin, scalevar, wgtfac); - else { - logger.error["FillContribution"]<<"Don't know how to fill this table. Exiting."<<endl; + //! read informatio from 'Event' and 'Scenario' + //! do the interpolation + //! and fill into the tables. + //logger.debug["FillContributionFlexHHC"]<<endl; + + if ( wgtfac != 1.0 ) { + logger.error["FillContributionFlexHHC"]<<"Additional weight factor wgtfac = " << wgtfac << "not yet implemented for flex-scale tables, aborted!"<<endl; exit(1); } + + if (fEvent._w == 0 && fEvent._wf==0 && fEvent._wr==0 && fEvent._wrr==0 && fEvent._wff==0 && fEvent._wrf==0) return; // nothing todo. + int NPDFDim = c->GetNPDFDim(); + + // do interpolation + //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> > nxup; + if (c->NPDFDim > 1) { + nxup = fKernX2[ObsBin]->GetNodeValues(xmax); + } else { + nxup = fKernX1[ObsBin]->GetNodeValues(xmax); + } + c->ExtendX(ObsBin, fKernX1, fKernX2); + + vector<pair<int,double>> nmu1; + vector<pair<int,double>> nmu2; + if (fIsFlexibleScale) { + nmu1 = fKernMu1[ObsBin]->GetNodeValues(fScenario._m1); + nmu2 = fKernMu2[ObsBin]->GetNodeValues(fScenario._m2); + } else { + nmu1 = fKernMuS[ObsBin][scalevar]->GetNodeValues(fScenario._m1 * fScaleFac[scalevar]); + } + + if (fApplyPDFReweight) { + fKernX1[ObsBin]->CheckX(xmin); + fKernX2[ObsBin]->CheckX(xmax); + ApplyPDFWeight(nxlo,xmin,fKernX1[ObsBin]->GetGridPtr()); + if (c->NPDFDim > 1) { + ApplyPDFWeight(nxup,xmax,fKernX2[ObsBin]->GetGridPtr()); + } else { + ApplyPDFWeight(nxup,xmax,fKernX1[ObsBin]->GetGridPtr()); + } + } + + // fill grid + //if (!CheckWeightIsFinite()) return; + for (unsigned int x1 = 0 ; x1<nxlo.size() ; x1++) { + for (unsigned int x2 = 0 ; x2<nxup.size() ; x2++) { + int xminbin = nxlo[x1].first; + int xmaxbin = nxup[x2].first; + int p = fEvent._p; + HalfMatrixCheck(fEvent._x1,fEvent._x2,xminbin,xmaxbin,p); + //HalfMatrixCheck(xminbin,xmaxbin,p); + int ixHM = GetXIndex(ObsBin,xminbin,xmaxbin); + double wfnlo = wgtfac * nxlo[x1].second * nxup[x2].second / BinSize[ObsBin]; + c->Fill(fEvent, ObsBin, ixHM, scalevar, nmu1, nmu2, p, wfnlo); + } + } + //cout<<" * wSumW = "<<wsum<<endl; } @@ -2993,18 +3035,8 @@ void fastNLOCreate::FillContributionFixHHC(fastNLOCoeffAddFix* c, int ObsBin, in HalfMatrixCheck(fEvent._x1,fEvent._x2,xminbin,xmaxbin,p); //HalfMatrixCheck(xminbin,xmaxbin,p); int ixHM = GetXIndex(ObsBin,xminbin,xmaxbin); - - for (unsigned int m1 = 0 ; m1<nmu.size() ; m1++) { - double w = wgt * nxlo[x1].second * nxup[x2].second * nmu[m1].second ; - if (! std::isfinite(w)) { - logger.error["FillContributionFixHHC"]<<"Weight w is not finite, w = " << w << "!"<<endl; - logger.error["FillContributionFixHHC"]<<"This should have been captured before, aborting ..."<<endl; - exit(1); - } - // cout<<" Fill * : i="<<ObsBin<<" svar="<<scalevar<<" imu="<<m1<<" ix="<<ixHM<<", im1="<<nmu[m1].first<<", p="<<p<<", w="<<nxup[x1].second * nxlo[x2].second * nmu[m1].second / BinSize[ObsBin] - // <<",\tfEvent._w="<<fEvent._w<<",\twx="<<nxup[x1].second * nxlo[x2].second<<",\tws="<<nmu[m1].second<<endl; - c->SigmaTilde[ObsBin][scalevar][nmu[m1].first][ixHM][p] += w; - } + double w = wgt * nxlo[x1].second * nxup[x2].second; + c->Fill(fEvent, ObsBin, ixHM, scalevar, nmu, nmu, p, w); } } } @@ -3069,51 +3101,10 @@ void fastNLOCreate::FillContributionFlexHHC(fastNLOCoeffAddFlex* c, int ObsBin, HalfMatrixCheck(fEvent._x1,fEvent._x2,xminbin,xmaxbin,p); //HalfMatrixCheck(xminbin,xmaxbin,p); int ixHM = GetXIndex(ObsBin,xminbin,xmaxbin); - - for (unsigned int m1 = 0 ; m1<nmu1.size() ; m1++) { - for (unsigned int mu2 = 0 ; mu2<nmu2.size() ; mu2++) { - double wfnlo = nxlo[x1].second * nxup[x2].second * nmu1[m1].second * nmu2[mu2].second / BinSize[ObsBin]; - if ( wfnlo == 0 ) continue; - if (! std::isfinite(wfnlo)) { - logger.error["FillContributionFlexHHC"]<<"Weight wfnlo is not finite, wfnlo = " << wfnlo << "!"<<endl; - logger.error["FillContributionFlexHHC"]<<"This should have been captured before, aborting ..."<<endl; - fKernX1[ObsBin]->PrintGrid(); - fKernX2[ObsBin]->PrintGrid(); - fKernMu1[ObsBin]->PrintGrid(); - fKernMu2[ObsBin]->PrintGrid(); - cout<<"ix1="<<x1<<", ix2="<<x2<<", im1="<<m1<<", im2="<<mu2<<endl; - cout<<"x1="<<nxlo[x1].second<<", x1="<<x1<<", xval="<<xmin<<endl; - cout<<"x2="<<nxup[x2].second<<", x2="<<x2<<", xval="<<xmax<<endl; - cout<<"m1="<< nmu1[m1].second<<", m1="<<m1<<", mu1val="<<fScenario._m1<<endl; - cout<<"m2="<<nmu2[mu2].second<<", m2="<<mu2<<", mu2val="<<fScenario._m2<<endl; - exit(1); - } - if (fEvent._w != 0) { - c->SigmaTildeMuIndep[ObsBin][ixHM][nmu1[m1].first][nmu2[mu2].first][p] += fEvent._w * wfnlo; - //wsum+= fEvent._w * wfnlo; - } - if (fEvent._wf != 0) { - //cout<<" Fill F : ix="<<ixHM<<", im1="<<nmu1[m1].first<<", im2="<<nmu2[mu2].first<<", p="<<p<<", w="<<fEvent._wf * wfnlo<<endl; - c->SigmaTildeMuFDep [ObsBin][ixHM][nmu1[m1].first][nmu2[mu2].first][p] += fEvent._wf * wfnlo; - } - if (fEvent._wr != 0) { - //cout<<" Fill R : ix="<<ixHM<<", im1="<<nmu1[m1].first<<", im2="<<nmu2[mu2].first<<", p="<<p<<", w="<<fEvent._wr * wfnlo<<endl; - c->SigmaTildeMuRDep [ObsBin][ixHM][nmu1[m1].first][nmu2[mu2].first][p] += fEvent._wr * wfnlo; - } - if (fEvent._wrr != 0) { - c->SigmaTildeMuRRDep [ObsBin][ixHM][nmu1[m1].first][nmu2[mu2].first][p] += fEvent._wrr * wfnlo; - } - if (fEvent._wff != 0) { - c->SigmaTildeMuFFDep [ObsBin][ixHM][nmu1[m1].first][nmu2[mu2].first][p] += fEvent._wff * wfnlo; - } - if (fEvent._wrf != 0) { - c->SigmaTildeMuRFDep [ObsBin][ixHM][nmu1[m1].first][nmu2[mu2].first][p] += fEvent._wrf * wfnlo; - } - } - } + double wfnlo = nxlo[x1].second * nxup[x2].second / BinSize[ObsBin]; + c->Fill(fEvent, ObsBin, ixHM, 0, nmu1, nmu2, p, wfnlo); } } - //cout<<" * wSumW = "<<wsum<<endl; } diff --git a/v2.5/toolkit/fastnlotoolkit/fastNLOTools.cc b/v2.5/toolkit/fastnlotoolkit/fastNLOTools.cc index dae18d978c3191390f77e7a49c47515796fd9adb..ac382d06c839dd6c02ebdd63aee69ab93f9d5121 100644 --- a/v2.5/toolkit/fastnlotoolkit/fastNLOTools.cc +++ b/v2.5/toolkit/fastnlotoolkit/fastNLOTools.cc @@ -573,10 +573,12 @@ namespace fastNLOTools { } //______________________________________________________________________________ - void ExtendHead(fastNLO::v1d& vector1, fastNLO::v1d& vector2) { + bool ExtendHead(fastNLO::v1d& vector1, fastNLO::v1d& vector2) { if (vector1.size() < vector2.size()) { vector1.insert(vector1.begin(), vector2.begin(), vector2.begin() + (vector2.size() - vector1.size())); + return true; } + return false; } //______________________________________________________________________________ diff --git a/v2.5/toolkit/fastnlotoolkit/include/fastnlotk/fastNLOCoeffAddBase.h b/v2.5/toolkit/fastnlotoolkit/include/fastnlotk/fastNLOCoeffAddBase.h index 2746cd464aa8cf1d9e05b45540ad41a7f5c51d25..9023a4089c290d42e6f4ecab8407d669aebecd3f 100644 --- a/v2.5/toolkit/fastnlotoolkit/include/fastnlotk/fastNLOCoeffAddBase.h +++ b/v2.5/toolkit/fastnlotoolkit/include/fastnlotk/fastNLOCoeffAddBase.h @@ -4,6 +4,8 @@ #include "fastNLOCoeffBase.h" #include "fastNLOConstants.h" +#include "fastNLOInterpolBase.h" +#include "fastNLOEvent.h" namespace fastNLO { struct WgtStat { @@ -176,6 +178,11 @@ public: fastNLO::WgtStat& AccessWgtStat() { return fWgt;} //!< Get weight and event counts double GetMergeWeight(fastNLO::EMerge moption, int proc, int bin) const ; //!< Get merge weight for a given bin and subprocess + void ExtendX(int ObsBin, std::vector<fastNLOInterpolBase*>& KernX1, std::vector<fastNLOInterpolBase*>& KernX2); + virtual void ExtendSigmaTildeX(int ObsBin, unsigned int OldXSize1, unsigned int OldXSize2); + virtual void Fill(fnloEvent& Event, int ObsBin, int X, int scalevar, const std::vector<std::pair<int, double>>& nmu1, + const std::vector<std::pair<int, double>>& nmu2, int SubProcess, double w); + protected: void ReadCoeffAddBase(std::istream& table, int ITabVersionRead); int GetScaledimfromvar(int scalevar) const; diff --git a/v2.5/toolkit/fastnlotoolkit/include/fastnlotk/fastNLOCoeffAddFix.h b/v2.5/toolkit/fastnlotoolkit/include/fastnlotk/fastNLOCoeffAddFix.h index 19bd90c636dcdbd1bd2e2d6639e5816643ec3987..6c97460ec1c0bed1585b5734d447cb95a80c7c60 100644 --- a/v2.5/toolkit/fastnlotoolkit/include/fastnlotk/fastNLOCoeffAddFix.h +++ b/v2.5/toolkit/fastnlotoolkit/include/fastnlotk/fastNLOCoeffAddFix.h @@ -3,6 +3,7 @@ #include "fastNLOCoeffAddBase.h" #include "fastNLOConstants.h" +#include "fastNLOEvent.h" class fastNLOCoeffAddFix : public fastNLOCoeffAddBase { @@ -58,6 +59,10 @@ public: bool IsCatenable(const fastNLOCoeffAddFix& other) const; //!< Check for compatibility of two contributions for merging/adding bool IsEquivalent(const fastNLOCoeffBase& other, double rtol) const; + void ExtendSigmaTildeX(int ObsBin, unsigned int OldXSize1, unsigned int OldXSize2); + void Fill(fnloEvent& Event, int ObsBin, int X, int scalevar, const std::vector<std::pair<int, double>>& nmu1, + const std::vector<std::pair<int, double>>& nmu2, int SubProcess, double w); + protected: void ReadCoeffAddFix(std::istream& table, int ITabVersionRead); diff --git a/v2.5/toolkit/fastnlotoolkit/include/fastnlotk/fastNLOCoeffAddFlex.h b/v2.5/toolkit/fastnlotoolkit/include/fastnlotk/fastNLOCoeffAddFlex.h index d3b2e88dc6fa8fa6d483fcc5345871da685e9705..2c463ef48a686d47a7ca9ea43cb6d6a0134730e2 100644 --- a/v2.5/toolkit/fastnlotoolkit/include/fastnlotk/fastNLOCoeffAddFlex.h +++ b/v2.5/toolkit/fastnlotoolkit/include/fastnlotk/fastNLOCoeffAddFlex.h @@ -51,6 +51,10 @@ public: bool IsEquivalent(const fastNLOCoeffBase& other, double rtol) const; bool IsSigmaTildeEquivalent(const fastNLOCoeffAddFlex* op, const fastNLO::v5d *tst5, const fastNLO::v5d *ost5, double rtol, std::string name) const; + void ExtendSigmaTildeX(int ObsBin, unsigned int OldXSize1, unsigned int OldXSize2); + void Fill(fnloEvent& Event, int ObsBin, int X, int scalevar, const std::vector<std::pair<int, double>>& nmu1, + const std::vector<std::pair<int, double>>& nmu2, int SubProcess, double w); + protected: void ReadCoeffAddFlex(std::istream& table, int ITabVersionRead); diff --git a/v2.5/toolkit/fastnlotoolkit/include/fastnlotk/fastNLOEvent.h b/v2.5/toolkit/fastnlotoolkit/include/fastnlotk/fastNLOEvent.h index 0955c84a10a938cc9cfcffda37957d27157bc703..9f4176810923034a7a4229f80de67ed12ae5c089 100644 --- a/v2.5/toolkit/fastnlotoolkit/include/fastnlotk/fastNLOEvent.h +++ b/v2.5/toolkit/fastnlotoolkit/include/fastnlotk/fastNLOEvent.h @@ -54,6 +54,8 @@ class fnloEvent { //! Useful class to keep all process related variables. //! e.g x-values, weights, process identifiers, etc. friend class fastNLOCreate; + friend class fastNLOCoeffAddFix; + friend class fastNLOCoeffAddFlex; public: fnloEvent(){Reset();} diff --git a/v2.5/toolkit/fastnlotoolkit/include/fastnlotk/fastNLOTools.h b/v2.5/toolkit/fastnlotoolkit/include/fastnlotk/fastNLOTools.h index 5ffab5b7dab66930d8f2ac3bd77e13daa199ebcf..434ace17d77446d6ddfc972e34d9196702fb0002 100644 --- a/v2.5/toolkit/fastnlotoolkit/include/fastnlotk/fastNLOTools.h +++ b/v2.5/toolkit/fastnlotoolkit/include/fastnlotk/fastNLOTools.h @@ -93,7 +93,7 @@ namespace fastNLOTools { std::pair<fastNLO::v1d, fastNLO::v1d> GetTails(fastNLO::v1d& vector1, fastNLO::v1d& vector2); bool SameTails(fastNLO::v1d vector1, fastNLO::v1d vector2, double rtol=0.0); bool SameTails(fastNLO::v2d vector1, fastNLO::v2d vector2, double rtol=0.0); - void ExtendHead(fastNLO::v1d& vector1, fastNLO::v1d& vector2); + bool ExtendHead(fastNLO::v1d& vector1, fastNLO::v1d& vector2); 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);