diff --git a/v2.5/toolkit/fastnlotoolkit/fastNLOCoeffAddFix.cc b/v2.5/toolkit/fastnlotoolkit/fastNLOCoeffAddFix.cc index 93a67f9213a3d28b2f73c6a46d314e8bd2db4014..6d3ee3dec03cf29c1952071d8844d4f544e49dc5 100644 --- a/v2.5/toolkit/fastnlotoolkit/fastNLOCoeffAddFix.cc +++ b/v2.5/toolkit/fastnlotoolkit/fastNLOCoeffAddFix.cc @@ -195,35 +195,37 @@ void fastNLOCoeffAddFix::Add(const fastNLOCoeffAddBase& other, fastNLO::EMerge m return; } const fastNLOCoeffAddFix& othfix = (const fastNLOCoeffAddFix&)other; - if ( moption==fastNLO::kMerge ) { - fastNLO::v5d otherSigmaTilde = othfix.SigmaTilde; - for(int obsBin=0 ; obsBin<fNObsBins ; obsBin++){ - for(int scalevar=0 ; scalevar<GetTotalScalevars() ; scalevar++){ - for(int scalenode=0 ; scalenode<GetTotalScalenodes() ; scalenode++){ - fastNLO::v2d& thisX = SigmaTilde[obsBin][scalevar][scalenode]; - fastNLO::v2d& otherX = otherSigmaTilde[obsBin][scalevar][scalenode]; - int thisNxtot1 = GetNxtot1(obsBin); - int thisNxtot2 = GetNxtot2(obsBin); - int otherNxtot1 = othfix.GetNxtot1(obsBin); - int otherNxtot2 = othfix.GetNxtot2(obsBin); - if (thisNxtot1 < otherNxtot1) { - fastNLOTools::ExtendSigmaTildeX(thisX, thisNxtot1, otherNxtot1, - thisNxtot2, thisNxtot2, NPDFDim, fastNLO::v1d(NSubproc)); - } else if (thisNxtot1 > otherNxtot1) { - fastNLOTools::ExtendSigmaTildeX(otherX, otherNxtot1, thisNxtot1, - otherNxtot2, otherNxtot2, NPDFDim, fastNLO::v1d(NSubproc)); - } - int maxNxtot1 = max(thisNxtot1, otherNxtot1); - if (thisNxtot2 < otherNxtot2) { - fastNLOTools::ExtendSigmaTildeX(thisX, maxNxtot1, maxNxtot1, - thisNxtot2, otherNxtot2, NPDFDim, fastNLO::v1d(NSubproc)); - } else if (thisNxtot2 > otherNxtot2) { - fastNLOTools::ExtendSigmaTildeX(otherX, maxNxtot1, maxNxtot1, - otherNxtot2, thisNxtot2, NPDFDim, fastNLO::v1d(NSubproc)); - } + + fastNLO::v5d otherSigmaTilde = othfix.SigmaTilde; + for(int obsBin=0 ; obsBin<fNObsBins ; obsBin++){ + for(int scalevar=0 ; scalevar<GetTotalScalevars() ; scalevar++){ + for(int scalenode=0 ; scalenode<GetTotalScalenodes() ; scalenode++){ + fastNLO::v2d& thisX = SigmaTilde[obsBin][scalevar][scalenode]; + fastNLO::v2d& otherX = otherSigmaTilde[obsBin][scalevar][scalenode]; + int thisNxtot1 = GetNxtot1(obsBin); + int thisNxtot2 = GetNxtot2(obsBin); + int otherNxtot1 = othfix.GetNxtot1(obsBin); + int otherNxtot2 = othfix.GetNxtot2(obsBin); + if (thisNxtot1 < otherNxtot1) { + fastNLOTools::ExtendSigmaTildeX(thisX, thisNxtot1, otherNxtot1, + thisNxtot2, thisNxtot2, NPDFDim, fastNLO::v1d(NSubproc)); + } else if (thisNxtot1 > otherNxtot1) { + fastNLOTools::ExtendSigmaTildeX(otherX, otherNxtot1, thisNxtot1, + otherNxtot2, otherNxtot2, NPDFDim, fastNLO::v1d(NSubproc)); + } + int maxNxtot1 = max(thisNxtot1, otherNxtot1); + if (thisNxtot2 < otherNxtot2) { + fastNLOTools::ExtendSigmaTildeX(thisX, maxNxtot1, maxNxtot1, + thisNxtot2, otherNxtot2, NPDFDim, fastNLO::v1d(NSubproc)); + } else if (thisNxtot2 > otherNxtot2) { + fastNLOTools::ExtendSigmaTildeX(otherX, maxNxtot1, maxNxtot1, + otherNxtot2, thisNxtot2, NPDFDim, fastNLO::v1d(NSubproc)); } } } + } + + if ( moption==fastNLO::kMerge ) { fastNLOTools::AddVectors(SigmaTilde, otherSigmaTilde); } else if ( moption==fastNLO::kAttach ) { for( int i=0 ; i<fNObsBins ; i++ ){ @@ -232,7 +234,7 @@ void fastNLOCoeffAddFix::Add(const fastNLOCoeffAddBase& other, fastNLO::EMerge m for( int l=0 ; l<GetTotalScalenodes() ; l++ ){ for( int m=0 ; m<nxmax ; m++ ){ for( int n=0 ; n<other.GetNSubproc() ; n++ ){ // attach all other subprocesses - double s2 = othfix.SigmaTilde[i][k][l][m][n]; + double s2 = otherSigmaTilde[i][k][l][m][n]; s2 *= this->Nevt/other.GetNevt(); this->SigmaTilde[i][k][l][m].push_back(s2); } @@ -251,7 +253,7 @@ void fastNLOCoeffAddFix::Add(const fastNLOCoeffAddBase& other, fastNLO::EMerge m double w1 = this->GetMergeWeight(moption,n,i); double w2 = other.GetMergeWeight(moption,n,i); double& s1 = this->SigmaTilde[i][k][l][m][n]; - double s2 = othfix.SigmaTilde[i][k][l][m][n]; + double s2 = otherSigmaTilde[i][k][l][m][n]; if ( s1!=0 || s2!=0 ) { if ( w1==0 || w2==0 ) { error["fastNLOCoeffAddFix"]<<"Mergeing weight is 0, but sigma tilde is non-zero. Cannot proceed!"<<endl; diff --git a/v2.5/toolkit/fastnlotoolkit/fastNLOCoeffAddFlex.cc b/v2.5/toolkit/fastnlotoolkit/fastNLOCoeffAddFlex.cc index 54d248f0bb1a5d8661d3315b23270f5483224524..fea21182b224a8c7cff75747b4114f9b3e665326 100644 --- a/v2.5/toolkit/fastnlotoolkit/fastNLOCoeffAddFlex.cc +++ b/v2.5/toolkit/fastnlotoolkit/fastNLOCoeffAddFlex.cc @@ -219,13 +219,17 @@ void fastNLOCoeffAddFlex::Add(const fastNLOCoeffAddBase& other, fastNLO::EMerge } const fastNLOCoeffAddFlex& othflex = (const fastNLOCoeffAddFlex&) other; if ( moption==fastNLO::kMerge ) { - ExtendAndAddSigmaTilde(othflex, SigmaTildeMuIndep, othflex.SigmaTildeMuIndep); + ExtendSigmaTilde(othflex, SigmaTildeMuIndep, othflex.SigmaTildeMuIndep); + fastNLOTools::AddVectors(SigmaTildeMuIndep, othflex.SigmaTildeMuIndep); if ( NScaleDep==3 || NScaleDep>=5 ) { - ExtendAndAddSigmaTilde(othflex, SigmaTildeMuFDep, othflex.SigmaTildeMuFDep); - ExtendAndAddSigmaTilde(othflex, SigmaTildeMuRDep, othflex.SigmaTildeMuRDep); + ExtendSigmaTilde(othflex, SigmaTildeMuFDep, othflex.SigmaTildeMuFDep); + fastNLOTools::AddVectors(SigmaTildeMuFDep, othflex.SigmaTildeMuFDep); + ExtendSigmaTilde(othflex, SigmaTildeMuRDep, othflex.SigmaTildeMuRDep); + fastNLOTools::AddVectors(SigmaTildeMuRDep, othflex.SigmaTildeMuRDep); if (( NScaleDep>=6 || !SigmaTildeMuRRDep.empty()) // both tables contain log^2 contributions (default case) && (othflex.NScaleDep>=6 || !othflex.SigmaTildeMuRRDep.empty()) ) { - ExtendAndAddSigmaTilde(othflex, SigmaTildeMuRRDep, othflex.SigmaTildeMuRRDep); + ExtendSigmaTilde(othflex, SigmaTildeMuRRDep, othflex.SigmaTildeMuRRDep); + fastNLOTools::AddVectors(SigmaTildeMuRRDep, othflex.SigmaTildeMuRRDep); } else if ( NScaleDep==6 && othflex.NScaleDep==5 ) { // this tables contains log^2 contributions, but the other does not // nothing todo. @@ -235,8 +239,10 @@ void fastNLOCoeffAddFlex::Add(const fastNLOCoeffAddBase& other, fastNLO::EMerge NScaleDep = 6; } if ( NScaleDep>=7 || !SigmaTildeMuFFDep.empty()) { - ExtendAndAddSigmaTilde(othflex, SigmaTildeMuFFDep, othflex.SigmaTildeMuFFDep); - ExtendAndAddSigmaTilde(othflex, SigmaTildeMuRFDep, othflex.SigmaTildeMuRFDep); + ExtendSigmaTilde(othflex, SigmaTildeMuFFDep, othflex.SigmaTildeMuFFDep); + fastNLOTools::AddVectors(SigmaTildeMuFFDep, othflex.SigmaTildeMuFFDep); + ExtendSigmaTilde(othflex, SigmaTildeMuRFDep, othflex.SigmaTildeMuRFDep); + fastNLOTools::AddVectors(SigmaTildeMuRFDep, othflex.SigmaTildeMuRFDep); } } fastNLOTools::AddVectors( SigmaRefMixed , othflex.SigmaRefMixed ); @@ -254,6 +260,9 @@ void fastNLOCoeffAddFlex::Add(const fastNLOCoeffAddBase& other, fastNLO::EMerge exit(1); } } + for ( int im = 0 ; im<cMax ; im++ ) { // mu-indep, mur, muf, ... + ExtendSigmaTilde(othflex, *st1[im], *st2[im]); + } for ( int iObs = 0 ; iObs<GetNObsBin(); iObs++ ) { for (unsigned int jS1=0; jS1<GetNScaleNode1(iObs); jS1++) { for (unsigned int kS2=0; kS2<GetNScaleNode2(iObs); kS2++) { @@ -308,6 +317,9 @@ void fastNLOCoeffAddFlex::Add(const fastNLOCoeffAddBase& other, fastNLO::EMerge } } } + for ( int im = 0 ; im<cMax ; im++ ) { // mu-indep, mur, muf, ... + ExtendSigmaTilde(othflex, *st1[im], *st2[im]); + } for ( int iObs = 0 ; iObs<GetNObsBin(); iObs++ ) { for (unsigned int jS1=0; jS1<GetNScaleNode1(iObs); jS1++) { for (unsigned int kS2=0; kS2<GetNScaleNode2(iObs); kS2++) { @@ -355,7 +367,7 @@ void fastNLOCoeffAddFlex::Add(const fastNLOCoeffAddBase& other, fastNLO::EMerge //________________________________________________________________________________________________________________ // -void fastNLOCoeffAddFlex::ExtendAndAddSigmaTilde( +void fastNLOCoeffAddFlex::ExtendSigmaTilde( const fastNLOCoeffAddFlex& othflex, fastNLO::v5d& ThisSigmaTilde, fastNLO::v5d OtherSigmaTilde) { for(int obsBin=0 ; obsBin<fNObsBins ; obsBin++){ fastNLO::v3d insertValue = fastNLO::v3d( @@ -382,7 +394,6 @@ void fastNLOCoeffAddFlex::ExtendAndAddSigmaTilde( otherNxtot2, thisNxtot2, NPDFDim, insertValue); } } - fastNLOTools::AddVectors(ThisSigmaTilde, OtherSigmaTilde); } diff --git a/v2.5/toolkit/fastnlotoolkit/include/fastnlotk/fastNLOCoeffAddFlex.h b/v2.5/toolkit/fastnlotoolkit/include/fastnlotk/fastNLOCoeffAddFlex.h index 4544b963c1a6af08ec9482ea9463274a89103d14..be8e61da97048dee7e68c3e49962b88df5c8aaf0 100644 --- a/v2.5/toolkit/fastnlotoolkit/include/fastnlotk/fastNLOCoeffAddFlex.h +++ b/v2.5/toolkit/fastnlotoolkit/include/fastnlotk/fastNLOCoeffAddFlex.h @@ -58,7 +58,7 @@ public: protected: void ReadCoeffAddFlex(std::istream& table, int ITabVersionRead); - void ExtendAndAddSigmaTilde(const fastNLOCoeffAddFlex& othflex, fastNLO::v5d& ThisSigmaTilde, fastNLO::v5d OtherSigmaTilde); + void ExtendSigmaTilde(const fastNLOCoeffAddFlex& othflex, fastNLO::v5d& ThisSigmaTilde, fastNLO::v5d OtherSigmaTilde); int fILOord; // obtained from Scenario int fSTildeDISFormat = 1; // format of sigma-tilde coefficients (0: log(mu2/q2), 1: log(mu2))