From bb272431b6012c494901644b1ccbebd424b4b401 Mon Sep 17 00:00:00 2001 From: Klaus Rabbertz <klaus.rabbertz@cern.ch> Date: Fri, 27 Sep 2024 00:25:43 +0200 Subject: [PATCH] Writing ref. cross sections works; reading produced grids not yet --- .../fastnlotoolkit/fastNLOCoeffBase.cc | 2 +- v2.5/toolkit/fastnlotoolkit/fastNLOTools.cc | 36 +- .../include/fastnlotk/fastNLOTools.h | 6 +- v2.5/toolkit/src/fnlo-tk-modify.cc | 389 ++++++++++-------- 4 files changed, 230 insertions(+), 203 deletions(-) diff --git a/v2.5/toolkit/fastnlotoolkit/fastNLOCoeffBase.cc b/v2.5/toolkit/fastnlotoolkit/fastNLOCoeffBase.cc index b9d3951b..9d4c0e3e 100644 --- a/v2.5/toolkit/fastnlotoolkit/fastNLOCoeffBase.cc +++ b/v2.5/toolkit/fastnlotoolkit/fastNLOCoeffBase.cc @@ -301,7 +301,7 @@ void fastNLOCoeffBase::AddCoeffInfoBlock(int fICoeffInfoBlockFlag1, int fICoeffI void fastNLOCoeffBase::AddCoeffInfoBlock(int fICoeffInfoBlockFlag1, int fICoeffInfoBlockFlag2, std::vector<std::string> Description, std::string filename, unsigned int icola, unsigned int icolb) { info["AddCoeffInfoBlocks"]<<"Adding additional InfoBlock reading data from file "<<filename<<endl; - std::vector<double> Content = fastNLOTools::ReadUncertaintyFromFile(filename, icola, icolb); + std::vector<double> Content = fastNLOTools::ReadContentFromFile(filename, icola, icolb); AddCoeffInfoBlock(fICoeffInfoBlockFlag1, fICoeffInfoBlockFlag2, Description, Content); } diff --git a/v2.5/toolkit/fastnlotoolkit/fastNLOTools.cc b/v2.5/toolkit/fastnlotoolkit/fastNLOTools.cc index 37560241..07a7f16d 100644 --- a/v2.5/toolkit/fastnlotoolkit/fastNLOTools.cc +++ b/v2.5/toolkit/fastnlotoolkit/fastNLOTools.cc @@ -393,11 +393,11 @@ namespace fastNLOTools { } //______________________________________________________________________________ - std::vector <double> ReadUncertaintyFromFile(std::string filename, unsigned int icola, unsigned int icolb) { + std::vector <double> ReadContentFromFile(std::string filename, unsigned int icola, unsigned int icolb) { std::string extension = ""; std::ifstream infile; std::string line; - std::vector <double> Uncertainty; + std::vector <double> Content; //! Determine extension to differentiate for parsing //! - fnlo-tk-statunc: 'log' file extension; column numbers not needed, rel. stat. uncertainty = col #4 @@ -408,16 +408,16 @@ namespace fastNLOTools { extension = filename.substr(filename.find_last_of(".")+1); } if ( extension != "dat" && extension != "log" && extension != "txt" ) { - error["ReadUncertaintyFromFile"]<<"Unknown filename extension, aborted! filename = " << filename <<endl; + error["ReadContentFromFile"]<<"Unknown filename extension, aborted! filename = " << filename <<endl; exit(34); } else if ( extension == "txt" && icola == 0) { - error["ReadUncertaintyFromFile"]<<"'txt' file found, but column specification is missing, aborted! icola " << icola <<endl; + error["ReadContentFromFile"]<<"'txt' file found, but column specification is missing, aborted! icola " << icola <<endl; exit(35); } else if ( extension == "txt" && (icola > 10 || icolb > 10) ) { - error["ReadUncertaintyFromFile"]<<"'txt' file found, but column specification is too large, aborted! icola, icolb = " << icola << ", " << icolb <<endl; + error["ReadContentFromFile"]<<"'txt' file found, but column specification is too large, aborted! icola, icolb = " << icola << ", " << icolb <<endl; exit(35); } else { - info["ReadUncertaintyFromFile"]<<"Reading additional uncertainty content from file: " << filename <<endl; + info["ReadContentFromFile"]<<"Reading additional uncertainty content from file: " << filename <<endl; } infile.open(filename); @@ -441,13 +441,15 @@ namespace fastNLOTools { double xs, dxs; iss >> xs; iss >> dxs; - if ( fabs(xs) > DBL_MIN ) { + if (icola != 0 && icolb == 0) { + Content.push_back(xs); + } else if ( fabs(xs) > DBL_MIN ) { // Is negative, if NLO_only or NNLO_only x section at production was < 0; keep this as additional information. - Uncertainty.push_back(dxs/xs); + Content.push_back(dxs/xs); // Only allow positive numbers with maximum value of 1, i.e. = 100% uncertainty maximum - // Uncertainty.push_back(std::min(fabs(dxs/xs),1.0)); + // Content.push_back(std::min(fabs(dxs/xs),1.0)); } else { - Uncertainty.push_back(0.); + Content.push_back(0.); } iline += 1; } @@ -465,7 +467,7 @@ namespace fastNLOTools { iss >> word; double dxsrel; iss >> dxsrel; - Uncertainty.push_back(dxsrel); + Content.push_back(dxsrel); iline += 1; } } @@ -479,24 +481,24 @@ namespace fastNLOTools { iss >> word; } if ( icolb == 0 ) { - Uncertainty.push_back(a); + Content.push_back(a); } else { if ( fabs(a) > DBL_MIN ) { - Uncertainty.push_back(b/a); + Content.push_back(b/a); } else { - Uncertainty.push_back(0); + Content.push_back(0); } } } else { - error["ReadUncertaintyFromFile"]<<"Unknown filename extension, aborted! filename = " << filename <<endl; + error["ReadContentFromFile"]<<"Unknown filename extension, aborted! filename = " << filename <<endl; exit(34); } } } else { - error["ReadUncertaintyFromFile"]<<"Cannot read from file, aborted! filename is: " << filename <<endl; + error["ReadContentFromFile"]<<"Cannot read from file, aborted! filename is: " << filename <<endl; exit(33); } - return Uncertainty; + return Content; } //______________________________________________________________________________ diff --git a/v2.5/toolkit/fastnlotoolkit/include/fastnlotk/fastNLOTools.h b/v2.5/toolkit/fastnlotoolkit/include/fastnlotk/fastNLOTools.h index 30717407..be0fc137 100644 --- a/v2.5/toolkit/fastnlotoolkit/include/fastnlotk/fastNLOTools.h +++ b/v2.5/toolkit/fastnlotoolkit/include/fastnlotk/fastNLOTools.h @@ -84,12 +84,12 @@ namespace fastNLOTools { bool ReadMagicNo(std::istream& table); //!< Read and check magic number from table. void PutBackMagicNo(std::istream& table); //!< Reset magic number, such that it can be recognized by other reading routines - //! Parse filename for uncertainties + //! Parse filename for additional information (uncertainties, reference cross sections, ...) //! - fnlo-tk-statunc: 'log' file extension; column numbers not needed, rel. stat. uncertainty = col #4 - //! - NNLOJET dat file: 'dat' file extension; column numbers not needed, rel. stat. uncertainty = (col #5 / col #4) + //! - NNLOJET dat file: 'dat' file extension; column numbers either two (rel. stat. uncertainty = [col #5 / col #4]) or one (ref. cross section = col #4) //! - Generic txt file: 'txt' file extension; only icola --> rel. stat. uncertainty = col #icola //! - icol a & b --> rel. stat. uncertainty = col #icolb / #icola - std::vector <double> ReadUncertaintyFromFile(std::string filename, unsigned int icola = 0, unsigned int icolb = 0); + std::vector <double> ReadContentFromFile(std::string filename, unsigned int icola = 0, unsigned int icolb = 0); //! Function prototype for string to enum conversion of central scale choice fastNLO::EScaleFunctionalForm GetScaleEnum(const std::string); diff --git a/v2.5/toolkit/src/fnlo-tk-modify.cc b/v2.5/toolkit/src/fnlo-tk-modify.cc index a7e52b02..b702a554 100644 --- a/v2.5/toolkit/src/fnlo-tk-modify.cc +++ b/v2.5/toolkit/src/fnlo-tk-modify.cc @@ -347,205 +347,230 @@ int main(int argc, char** argv) { } } - //! Add InfoBlocks with statistical uncertainty from steering file - //! Default flag1=0: Statistical/numerical uncertainty - int IBFlag1 = 0; - //! Default flag2=1: Quadratic addition, alternative: 0: linear addition - int IBFlag2 = 1; + //! Add InfoBlocks with additional information from steering file + cout << "AAAAAAAAAA" << endl; //! Default description line std::string Default = "Please provide description!"; - if ( EXIST(InfoBlockStatUnc) ) { - if ( !INT_ARR(RemoveBins).empty() ) { - info["fnlo-tk-modify"]<<"Do NOT erase bins while adding InfoBlocks or vice versa! Aborted."<<endl; - exit(25); - } else { - info["fnlo-tk-modify"]<<"Adding InfoBlocks to contributions."<<endl; - } - static vector<double> dstrel_LO = DOUBLE_COL(InfoBlockStatUnc,dstrel_LO); - static vector<double> dstrel_NLO = DOUBLE_COL(InfoBlockStatUnc,dstrel_NLO); - static vector<double> dstrel_NNLO = DOUBLE_COL(InfoBlockStatUnc,dstrel_NNLO); - unsigned int NDescr = STRING_ARR(InfoBlockDescr).size(); - if ( NDescr > 1 ) { - error["fnlo-tk-modify"]<<"Only one description line allowed for all blocks, aborted! NDescr = " << NDescr << endl; - exit(39); + //! Default key + std::string KeyBase = "InfoBlock"; + std::vector<std::string> KeyMods; + KeyMods.push_back("StatUnc"); + KeyMods.push_back("RefXs"); + for (unsigned int k=0; k<KeyMods.size(); k++) { + std::string Key = KeyBase + KeyMods[k]; + std::string KeyFlag1 = Key + "Flag1"; + std::string KeyFlag2 = Key + "Flag2"; + std::string KeyDescr = Key + "Descr"; + std::string KeyValuesLO = Key + "ValuesLO"; + std::string KeyValuesNLO = Key + "ValuesNLO"; + std::string KeyValuesNNLO = Key + "ValuesNNLO"; + std::string KeyOrders = Key + "Orders"; + std::string KeyFiles = Key + "Files"; + std::string KeyColumns = Key + "Columns"; + cout << "AAAAAAAAAA: Key = " << Key << endl; + if ( !read_steer::getexist(KeyFlag1) || !read_steer::getexist(KeyFlag2) ){ + info["fnlo-tk-modify"]<<"No InfoBlock information found for key " << Key << " Skipped."<<endl; + continue; } - int Ncontrib = table.GetNcontrib(); - int ic = 0; - for ( int i = 0; i < Ncontrib; i++ ) { - fastNLOCoeffBase* c = table.GetCoeffTable(i); - if ( fastNLOCoeffAddBase::CheckCoeffConstants(c,true) ) { - int iFlag1 = IBFlag1; - int iFlag2 = IBFlag2; - if ( EXIST(InfoBlockFlag1) ) { iFlag1 = INT(InfoBlockFlag1); } - if ( EXIST(InfoBlockFlag2) ) { iFlag2 = INT(InfoBlockFlag2); } - if ( c->IsLO() ) { - info["fnlo-tk-modify"]<<"Found LO contribution " << i << endl; - std::vector<std::string> Description; - if ( NDescr > 0 ) { - Description.push_back(STRING_ARR(InfoBlockDescr)[0]); - } else { - Description.push_back(Default); - } - if ( dstrel_LO.size() == 0 ) { - warn["fnlo-tk-modify"]<<"Found LO contribution, but no uncertainties! Nothing added." << endl; - } else if ( dstrel_LO.size() != nobs ) { - error["fnlo-tk-modify"]<<"You need the same number of uncertainties, dstrel_LO = " << dstrel_LO.size() << - ", than bins in the table, nobsbin = " << nobs << ". Aborted!" << endl; - exit(1); - } else { - c->AddCoeffInfoBlock(iFlag1,iFlag2,Description,dstrel_LO); - } - ic += 1; - } else if ( c->IsNLO() ) { - info["fnlo-tk-modify"]<<"Found NLO contribution " << i << endl; - std::vector <std:: string> Description; - if ( NDescr > 0 ) { - Description.push_back(STRING_ARR(InfoBlockDescr)[0]); - } else { - Description.push_back(Default); - } - if ( dstrel_NLO.size() == 0 ) { - warn["fnlo-tk-modify"]<<"Found NLO contribution, but no uncertainties! Nothing added." << endl; - } else if ( dstrel_NLO.size() != nobs ) { - error["fnlo-tk-modify"]<<"You need the same number of uncertainties, dstrel_NLO = " << dstrel_NLO.size() << - ", than bins in the table, nobsbin = " << nobs << ". Aborted!" << endl; - exit(1); - } else { - c->AddCoeffInfoBlock(iFlag1,iFlag2,Description,dstrel_NLO); - } - ic += 1; - } else if ( c->IsNNLO() ) { - info["fnlo-tk-modify"]<<"Found NNLO contribution " << i << endl; - std::vector <std:: string> Description; - if ( NDescr > 0 ) { - Description.push_back(STRING_ARR(InfoBlockDescr)[0]); - } else { - Description.push_back(Default); - } - if ( dstrel_NNLO.size() == 0 ) { - warn["fnlo-tk-modify"]<<"Found NNLO contribution, but no uncertainties! Nothing added." << endl; - } else if ( dstrel_NNLO.size() != nobs ) { - error["fnlo-tk-modify"]<<"You need the same number of uncertainties, dstrel_NNLO = " << dstrel_NNLO.size() << - ", than bins in the table, nobsbin = " << nobs << ". Aborted!" << endl; - exit(1); + // For adding a single value, array or table, the shorthand notations are respectively: + // ADD(K,Y); + // ADDARRAY(K,Y); + // ADDTABLE(K,H,Y); + // For instance to add a value "76" for the key "age" + // ADD("age",76); + // The full notation woule be: + // read_steer::Steering()->AddLabel("age",76); + // To access the arrays use e.g.: + // static vector<string> musicians = read_steer::getstringarray("FamousMusicians"); + // static vector<double> nums = read_steer::getdoublearray("Array1"); + // static vector<int> ints = read_steer::getintarray("Array1"); + // or equivalently + // static vector<string> musicians = STRING_ARR(FamousMusicians); + // static vector<double> nums = DOUBLE_ARR(Array1); + // static vector<int> ints = INT_ARR(Array1); + // + // read_steer::addvalue(KeyFlag1,7); + // read_steer::addvalue(KeyFlag2,13); + // read_steer::printall(); + // if ( read_steer::getexist(KeyFlag1) ) { + // int ikey = read_steer::getint(KeyFlag1); + // cout << "AAAAAAAAAA1: exists = " << ikey << endl; + // } else { + // cout << "Aetsch1" << endl; + // } + // if ( read_steer::getexist(KeyFlag2) ) { + // int ikey = read_steer::getint(KeyFlag2); + // cout << "AAAAAAAAAA2: exists = " << ikey << endl; + // } else { + // cout << "Aetsch2" << endl; + // } + // // + + if ( read_steer::getexist(KeyValuesLO) ) { + cout << "BBBBBBBBBB" << endl; + if ( !INT_ARR(RemoveBins).empty() ) { + info["fnlo-tk-modify"]<<"Do NOT erase bins while adding InfoBlocks or vice versa! Aborted."<<endl; + exit(25); + } else { + info["fnlo-tk-modify"]<<"Adding InfoBlocks to contributions."<<endl; + } + unsigned int NDescr = read_steer::getstringarray(KeyDescr).size(); + std::vector<std::string> Description; + if ( NDescr > 0 ) { + for ( unsigned int j = 0; j < NDescr; j++ ) { + Description.push_back(read_steer::getstringarray(KeyDescr)[j]); + } + } else { + Description.push_back(Default); + } + static vector<double> cont_LO = read_steer::getdoublecolumn(KeyValuesLO,"A"); + static vector<double> cont_NLO = read_steer::getdoublecolumn(KeyValuesNLO,"A"); + static vector<double> cont_NNLO = read_steer::getdoublecolumn(KeyValuesNNLO,"A"); + int Ncontrib = table.GetNcontrib(); + int ic = 0; + for ( int i = 0; i < Ncontrib; i++ ) { + fastNLOCoeffBase* c = table.GetCoeffTable(i); + if ( fastNLOCoeffAddBase::CheckCoeffConstants(c,true) ) { + int iFlag1 = read_steer::getint(KeyFlag1); + int iFlag2 = read_steer::getint(KeyFlag2); + if ( c->IsLO() ) { + info["fnlo-tk-modify"]<<"Found LO contribution " << i << endl; + if ( cont_LO.size() == 0 ) { + warn["fnlo-tk-modify"]<<"Found LO contribution, but no additional values! Nothing added." << endl; + } else if ( cont_LO.size() != nobs ) { + error["fnlo-tk-modify"]<<"You need the same number of values, cont_LO = " << cont_LO.size() << + ", than bins in the table, nobsbin = " << nobs << ". Aborted!" << endl; + exit(1); + } else { + c->AddCoeffInfoBlock(iFlag1,iFlag2,Description,cont_LO); + } + ic += 1; + } else if ( c->IsNLO() ) { + info["fnlo-tk-modify"]<<"Found NLO contribution " << i << endl; + std::vector <std:: string> Description; + if ( cont_NLO.size() == 0 ) { + warn["fnlo-tk-modify"]<<"Found NLO contribution, but no additional values! Nothing added." << endl; + } else if ( cont_NLO.size() != nobs ) { + error["fnlo-tk-modify"]<<"You need the same number of values, cont_NLO = " << cont_NLO.size() << + ", than bins in the table, nobsbin = " << nobs << ". Aborted!" << endl; + exit(1); + } else { + c->AddCoeffInfoBlock(iFlag1,iFlag2,Description,cont_NLO); + } + ic += 1; + } else if ( c->IsNNLO() ) { + info["fnlo-tk-modify"]<<"Found NNLO contribution " << i << endl; + std::vector <std:: string> Description; + if ( cont_NNLO.size() == 0 ) { + warn["fnlo-tk-modify"]<<"Found NNLO contribution, but no additional values! Nothing added." << endl; + } else if ( cont_NNLO.size() != nobs ) { + error["fnlo-tk-modify"]<<"You need the same number of values, cont_NNLO = " << cont_NNLO.size() << + ", than bins in the table, nobsbin = " << nobs << ". Aborted!" << endl; + exit(1); + } else { + c->AddCoeffInfoBlock(iFlag1,iFlag2,Description,cont_NNLO); + } + ic += 1; } else { - c->AddCoeffInfoBlock(iFlag1,iFlag2,Description,dstrel_NNLO); + info["fnlo-tk-modify"]<<"Unknown contribution " << i << endl; + info["fnlo-tk-modify"]<<"Nothing changed." << endl; } - ic += 1; - } else { - info["fnlo-tk-modify"]<<"Unknown contribution " << i << endl; - info["fnlo-tk-modify"]<<"Nothing changed." << endl; } } } - } - //! Add InfoBlocks with statistical uncertainty from file (NNLOJET .dat, fnlo-tk-statunc .log, or .txt) - else if ( !STRING_ARR(InfoBlockFiles).empty() && - !STRING_ARR(InfoBlockOrders).empty() ) { - if ( !INT_ARR(RemoveBins).empty() ) { - info["fnlo-tk-modify"]<<"Do NOT erase bins while adding InfoBlocks or vice versa! Aborted."<<endl; - exit(25); - } else { - info["fnlo-tk-modify"]<<"Adding InfoBlocks to contributions."<<endl; - } - unsigned int NFiles = STRING_ARR(InfoBlockFiles).size(); - unsigned int NCols = INT_ARR(InfoBlockFileColumns).size(); - unsigned int NOrders = STRING_ARR(InfoBlockOrders).size(); - unsigned int NDescr = STRING_ARR(InfoBlockDescr).size(); - if ( NFiles != NOrders ) { - error["fnlo-tk-modify"]<<"Need one order specification per file, aborted! Found NFiles = " << NFiles << ", and NOrders = " << NOrders <<endl; - exit(37); - } - unsigned int icola = 0; - unsigned int icolb = 0; - if ( NCols == 0 ) { - } else if ( NCols == 1 ) { - icola = INT_ARR(InfoBlockFileColumns)[0]; - } else if ( NCols == 2 ) { - icola = INT_ARR(InfoBlockFileColumns)[0]; - icolb = INT_ARR(InfoBlockFileColumns)[1]; - } else { - error["fnlo-tk-modify"]<<"Up to two column numbers allowed, but found more. Aborted! NCols = " << NCols <<endl; - exit(38); - } - if ( NDescr > 1 ) { - error["fnlo-tk-modify"]<<"Only one description line allowed for all blocks, aborted! NDescr = " << NDescr << endl; - exit(39); - } - for ( unsigned int i = 0; i < NFiles; i++ ){ - info["fnlo-tk-modify"]<<"InfoBlock file no. " << i << " is: " << STRING_ARR(InfoBlockFiles)[i] << endl; - } - for ( unsigned int i = 0; i < NOrders; i++ ){ - info["fnlo-tk-modify"]<<"InfoBlock order no. " << i << " is: " << STRING_ARR(InfoBlockOrders)[i] << endl; - } - int Ncontrib = table.GetNcontrib(); - int ic = 0; - std::string Default = "Please provide description!"; - for ( int i = 0; i < Ncontrib; i++ ) { - fastNLOCoeffBase* c = table.GetCoeffTable(i); - if ( fastNLOCoeffAddBase::CheckCoeffConstants(c,true) ) { - int iFlag1 = IBFlag1; - int iFlag2 = IBFlag2; - if ( EXIST(InfoBlockFlag1) ) { iFlag1 = INT(InfoBlockFlag1); } - if ( EXIST(InfoBlockFlag2) ) { iFlag2 = INT(InfoBlockFlag2); } - if ( c->IsLO() ) { - info["fnlo-tk-modify"]<<"Found LO contribution " << i << endl; - int ilo = 0; - if ( NOrders > 1 ) { - for ( unsigned int j = 0; j < NFiles; j++ ) { - if (STRING_ARR(InfoBlockOrders)[j] == "LO") { - ilo = j; + //! Add InfoBlocks with statistical uncertainty from file (NNLOJET .dat, fnlo-tk-statunc .log, or .txt) + else if ( !read_steer::getstringarray(KeyFiles).empty() && + !read_steer::getstringarray(KeyOrders).empty() ) { + if ( !INT_ARR(RemoveBins).empty() ) { + info["fnlo-tk-modify"]<<"Do NOT erase bins while adding InfoBlocks or vice versa! Aborted."<<endl; + exit(25); + } else { + info["fnlo-tk-modify"]<<"Adding InfoBlocks to contributions."<<endl; + } + cout << "CCCCCCCCCC" << endl; + unsigned int NDescr = read_steer::getstringarray(KeyDescr).size(); + unsigned int NOrders = read_steer::getstringarray(KeyOrders).size(); + unsigned int NFiles = read_steer::getstringarray(KeyFiles).size(); + unsigned int NCols = read_steer::getintarray(KeyColumns).size(); + if ( NFiles != NOrders ) { + error["fnlo-tk-modify"]<<"Need one order specification per file, aborted! Found NFiles = " << NFiles << ", and NOrders = " << NOrders <<endl; + exit(37); + } + unsigned int icola = 0; + unsigned int icolb = 0; + if ( NCols == 0 ) { + } else if ( NCols == 1 ) { + icola = read_steer::getintarray(KeyColumns)[0]; + } else if ( NCols == 2 ) { + icola = read_steer::getintarray(KeyColumns)[0]; + icolb = read_steer::getintarray(KeyColumns)[1]; + } else { + error["fnlo-tk-modify"]<<"Up to two column numbers allowed, but found more. Aborted! NCols = " << NCols <<endl; + exit(38); + } + cout << "ZZZZZZZZZZZ icola, icolb = " << icola << ", " << icolb << endl; + for ( unsigned int i = 0; i < NFiles; i++ ){ + info["fnlo-tk-modify"]<<"InfoBlock file no. " << i << " is: " << read_steer::getstringarray(KeyFiles)[i] << endl; + } + for ( unsigned int i = 0; i < NOrders; i++ ){ + info["fnlo-tk-modify"]<<"InfoBlock order no. " << i << " is: " << read_steer::getstringarray(KeyOrders)[i] << endl; + } + std::vector<std::string> Description; + if ( NDescr > 0 ) { + for ( unsigned int j = 0; j < NDescr; j++ ) { + Description.push_back(read_steer::getstringarray(KeyDescr)[j]); + } + } else { + Description.push_back(Default); + } + int Ncontrib = table.GetNcontrib(); + int ic = 0; + for ( int i = 0; i < Ncontrib; i++ ) { + fastNLOCoeffBase* c = table.GetCoeffTable(i); + if ( fastNLOCoeffAddBase::CheckCoeffConstants(c,true) ) { + int iFlag1 = read_steer::getint(KeyFlag1); + int iFlag2 = read_steer::getint(KeyFlag2); + if ( c->IsLO() ) { + info["fnlo-tk-modify"]<<"Found LO contribution " << i << endl; + int ilo = 0; + if ( NOrders > 1 ) { + for ( unsigned int j = 0; j < NFiles; j++ ) { + if (read_steer::getstringarray(KeyOrders)[j] == "LO") { + ilo = j; + } } } - } - std::vector<std::string> Description; - if ( NDescr > 0 ) { - Description.push_back(STRING_ARR(InfoBlockDescr)[0]); - } else { - Description.push_back(Default); - } - c->AddCoeffInfoBlock(iFlag1,iFlag2,Description,STRING_ARR(InfoBlockFiles)[ilo],icola,icolb); - ic += 1; - } else if ( c->IsNLO() ) { - info["fnlo-tk-modify"]<<"Found NLO contribution " << i << endl; - int inlo = 0; - if ( NOrders > 1 ) { - for ( unsigned int j = 0; j < NFiles; j++ ) { - if (STRING_ARR(InfoBlockOrders)[j] == "NLO") { - inlo = j; + c->AddCoeffInfoBlock(iFlag1,iFlag2,Description,read_steer::getstringarray(KeyFiles)[ilo],icola,icolb); + ic += 1; + } else if ( c->IsNLO() ) { + info["fnlo-tk-modify"]<<"Found NLO contribution " << i << endl; + int inlo = 0; + if ( NOrders > 1 ) { + for ( unsigned int j = 0; j < NFiles; j++ ) { + if (read_steer::getstringarray(KeyOrders)[j] == "NLO") { + inlo = j; + } } } - } - std::vector <std:: string> Description; - if ( NDescr > 0 ) { - Description.push_back(STRING_ARR(InfoBlockDescr)[0]); - } else { - Description.push_back(Default); - } - c->AddCoeffInfoBlock(iFlag1,iFlag2,Description,STRING_ARR(InfoBlockFiles)[inlo],icola,icolb); - ic += 1; - } else if ( c->IsNNLO() ) { - info["fnlo-tk-modify"]<<"Found NNLO contribution " << i << endl; - int innlo = 0; - if ( NOrders > 1 ) { - for ( unsigned int j = 0; j < NFiles; j++ ) { - if (STRING_ARR(InfoBlockOrders)[j] == "NNLO") { - innlo = j; + c->AddCoeffInfoBlock(iFlag1,iFlag2,Description,read_steer::getstringarray(KeyFiles)[inlo],icola,icolb); + ic += 1; + } else if ( c->IsNNLO() ) { + info["fnlo-tk-modify"]<<"Found NNLO contribution " << i << endl; + int innlo = 0; + if ( NOrders > 1 ) { + for ( unsigned int j = 0; j < NFiles; j++ ) { + if (read_steer::getstringarray(KeyOrders)[j] == "NNLO") { + innlo = j; + } } } - } - std::vector <std:: string> Description; - if ( NDescr > 0 ) { - Description.push_back(STRING_ARR(InfoBlockDescr)[0]); + c->AddCoeffInfoBlock(iFlag1,iFlag2,Description,read_steer::getstringarray(KeyFiles)[innlo],icola,icolb); + ic += 1; } else { - Description.push_back(Default); + info["fnlo-tk-modify"]<<"Unknown contribution " << i << endl; + info["fnlo-tk-modify"]<<"Nothing changed." << endl; } - c->AddCoeffInfoBlock(iFlag1,iFlag2,Description,STRING_ARR(InfoBlockFiles)[innlo],icola,icolb); - ic += 1; - } else { - info["fnlo-tk-modify"]<<"Unknown contribution " << i << endl; - info["fnlo-tk-modify"]<<"Nothing changed." << endl; } } } -- GitLab