diff --git a/doc/tableformat/fastNLOTableFormatv26.ods b/doc/tableformat/fastNLOTableFormatv26.ods new file mode 100644 index 0000000000000000000000000000000000000000..952fd1dc6a1c61300cebc9d697e8cdfcb6f374bd Binary files /dev/null and b/doc/tableformat/fastNLOTableFormatv26.ods differ diff --git a/v2.5/toolkit/configure.ac b/v2.5/toolkit/configure.ac index 70994ebaca2f8fa691b9cb513b86ff3af1a63526..8249354156c93df78d43d1a6d4174e6e7a938473 100644 --- a/v2.5/toolkit/configure.ac +++ b/v2.5/toolkit/configure.ac @@ -10,7 +10,7 @@ # Require minimal autoconf version, 2.71 is from 2021 AC_PREREQ([2.71]) # Define subproject fastNLO_toolkit -AC_INIT([fastNLO_toolkit],[2.5.1],[Daniel.Britzger@desy.de, Klaus.Rabbertz@kit.edu, Georg Sieber, Fred Stober, wobisch@latech.edu]) +AC_INIT([fastNLO_toolkit],[2.6.0],[Daniel.Britzger@desy.de, Klaus.Rabbertz@kit.edu, Georg Sieber, Fred Stober, wobisch@latech.edu]) #Suppress verbose output when compiling (use make V=99 for verbose output) m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) # Properly include subprojects diff --git a/v2.5/toolkit/fastnlotoolkit/fastNLOCoeffAddBase.cc b/v2.5/toolkit/fastnlotoolkit/fastNLOCoeffAddBase.cc index e5830e1a18e1ed2f4f3c88edfffaf2bbea6d3254..dfa4f3f1fe1358441f0aad9e77d35e4fe28500c7 100644 --- a/v2.5/toolkit/fastnlotoolkit/fastNLOCoeffAddBase.cc +++ b/v2.5/toolkit/fastnlotoolkit/fastNLOCoeffAddBase.cc @@ -70,41 +70,23 @@ void fastNLOCoeffAddBase::ReadCoeffAddBase(istream& table, int ITabVersionRead){ debug["ReadCoeffAddBase::ReadCoeffAddBase"]<<"Start reading coefficients for table version "<<ITabVersionRead<<endl; CheckCoeffConstants(this); char buffer[5257]; - // string stest; - // if ( fVersionRead>=24000 ) table >> stest; //"fastNLO_CoeffAddBase" - // if ( fVersionRead>=24000 ) fastNLOTools::ReadUnused(table); table >> IRef; table >> IScaleDep; - // if ( fVersionRead >= 24000 ) { - // table >> Nevt; - // table >> fWgt.WgtNevt; - // table >> fWgt.NumTable; - // table >> fWgt.WgtNumEv; - // table >> fWgt.WgtSumW2; - // table >> fWgt.SigSumW2; - // table >> fWgt.SigSum; - // fastNLOTools::ReadFlexibleVector ( fWgt.WgtObsSumW2, table ); - // fastNLOTools::ReadFlexibleVector ( fWgt.SigObsSumW2, table ); - // fastNLOTools::ReadFlexibleVector ( fWgt.SigObsSum, table ); - // fastNLOTools::ReadFlexibleVector ( fWgt.WgtObsNumEv, table ); - // } - // else { + table >> Nevt; + double readNevt = Nevt; + if ( Nevt <= 0 ) { // v2300 table >> Nevt; - double readNevt = Nevt; - if ( Nevt <= 0 ) { // v2300 - table >> Nevt; - table >> fWgt.WgtNevt; - if ( readNevt<=-2 ) table >> fWgt.NumTable; - table >> fWgt.WgtNumEv; - table >> fWgt.WgtSumW2; - table >> fWgt.SigSumW2; - table >> fWgt.SigSum; - fastNLOTools::ReadFlexibleVector ( fWgt.WgtObsSumW2, table ); - fastNLOTools::ReadFlexibleVector ( fWgt.SigObsSumW2, table ); - fastNLOTools::ReadFlexibleVector ( fWgt.SigObsSum, table ); - fastNLOTools::ReadFlexibleVector ( fWgt.WgtObsNumEv, table ); - } - // } + table >> fWgt.WgtNevt; + if ( readNevt<=-2 ) table >> fWgt.NumTable; + table >> fWgt.WgtNumEv; + table >> fWgt.WgtSumW2; + table >> fWgt.SigSumW2; + table >> fWgt.SigSum; + fastNLOTools::ReadFlexibleVector ( fWgt.WgtObsSumW2, table ); + fastNLOTools::ReadFlexibleVector ( fWgt.SigObsSumW2, table ); + fastNLOTools::ReadFlexibleVector ( fWgt.SigObsSum, table ); + fastNLOTools::ReadFlexibleVector ( fWgt.WgtObsNumEv, table ); + } table >> Npow; int NPDF; table >> NPDF; @@ -229,9 +211,6 @@ void fastNLOCoeffAddBase::ReadCoeffAddBase(istream& table, int ITabVersionRead){ // StripWhitespace(ScaleDescript[i][j]); } } - - // if ( fVersionRead>=24000 ) fastNLOTools::ReadUnused(table); - // if ( fVersionRead>=24000 ) fastNLOTools::ReadUnused(table); } @@ -240,11 +219,9 @@ void fastNLOCoeffAddBase::Write(ostream& table, int itabversion) { debug["Write"]<<"Calling fastNLOCoeffBase::Write()"<<endl; fastNLOCoeffBase::Write(table,itabversion); CheckCoeffConstants(this); - // if ( itabversion >= 24000 ) table << "fastNLO_CoeffAddBase" << sep; - // if ( itabversion >= 24000 ) table << 0 << sep; // v2.4, but yet unused table << IRef << sep; table << IScaleDep << sep; - if ( itabversion==23000 || itabversion==23500 || itabversion==23600 || itabversion==25000 ) { // detailed storage of weights + if ( itabversion==23000 || itabversion==23500 || itabversion==23600 || itabversion==25000 || itabversion==26000) { // detailed storage of weights if ( itabversion==23000 || itabversion==23500 ) table << -1 << sep; // -1: read the values below else table << -2 << sep; // -1: read the values below table << Nevt << sep; @@ -258,21 +235,7 @@ void fastNLOCoeffAddBase::Write(ostream& table, int itabversion) { fastNLOTools::WriteFlexibleVector ( fWgt.SigObsSumW2, table ); fastNLOTools::WriteFlexibleVector ( fWgt.SigObsSum, table ); fastNLOTools::WriteFlexibleVector ( fWgt.WgtObsNumEv, table ); - } - // else if ( itabversion>=24000 ) { // detailed storage of weights - // table << Nevt << sep; - // table << fWgt.WgtNevt << sep; - // table << fWgt.NumTable << sep; - // table << fWgt.WgtNumEv << sep; - // table << fWgt.WgtSumW2 << sep; - // table << fWgt.SigSumW2 << sep; - // table << fWgt.SigSum << sep; - // fastNLOTools::WriteFlexibleVector ( fWgt.WgtObsSumW2, table ); - // fastNLOTools::WriteFlexibleVector ( fWgt.SigObsSumW2, table ); - // fastNLOTools::WriteFlexibleVector ( fWgt.SigObsSum, table ); - // fastNLOTools::WriteFlexibleVector ( fWgt.WgtObsNumEv, table ); - // } - else { + } else { table << Nevt << sep; } table << Npow << sep; @@ -360,9 +323,6 @@ void fastNLOCoeffAddBase::Write(ostream& table, int itabversion) { table << ScaleDescript[i][j] << sep; } } - // if ( itabversion>=24000 ) table << 0 << sep; // v2.4, but yet unused - // if ( itabversion>=24000 ) table << 0 << sep; // v2.4, but yet unused - } diff --git a/v2.5/toolkit/fastnlotoolkit/fastNLOReader.cc b/v2.5/toolkit/fastnlotoolkit/fastNLOReader.cc index 0adbe39b32afcdd2ae6ebc629da0daa5e8b55820..d80cbc9d418ae056da86d891eec4ed729b2065af 100644 --- a/v2.5/toolkit/fastnlotoolkit/fastNLOReader.cc +++ b/v2.5/toolkit/fastnlotoolkit/fastNLOReader.cc @@ -434,7 +434,7 @@ #include "fastnlotk/fastNLOTools.h" #include "fastnlotk/fastNLOCoeffAddFix.h" #include "fastnlotk/fastNLOCoeffAddFlex.h" -//#include "fastnlotk/fastNLOLHAPDF.h" +#include "fastnlotk/fastNLOLHAPDF.h" #ifdef WITH_HOPPET #include "fastnlotk/HoppetInterface.h" #endif @@ -1248,18 +1248,12 @@ void fastNLOReader::CalcReferenceCrossSection() { void fastNLOReader::CalcRefCrossSection() { //! //! Initialize the internal arrays for the reference cross - //! sections from the InfoBlocks of the fastNLO file (v2.7 upwards) + //! sections from the InfoBlocks of the fastNLO file (v2.6 upwards) //! logger.debug["CalcRefCrossSection"]<<"Starting CalcRefCrossSection ..."<<endl; XSectionRef.clear(); XSectionRef.resize(NObsBin); - XSectionRefMixed.clear(); - XSectionRef_s1.clear(); - XSectionRef_s2.clear(); - XSectionRefMixed.resize(NObsBin); - XSectionRef_s1.resize(NObsBin); - XSectionRef_s2.resize(NObsBin); if (!GetIsFlexibleScaleTable()) { fastNLOCoeffAddBase* Coeff_LO_Ref = GetReferenceTable(kLeading); @@ -3624,36 +3618,57 @@ XsUncertainty fastNLOReader::GetXsUncertainty(const ENumUncertaintyStyle eNumUnc // XsUncertainty XsUnc; vector < double > MyXSection; + vector < double > MyRefXSection; vector < double > MydXSection; unsigned int NObsBin = GetNObsBin(); - //! For approximation bias get reference PDF & member and cross section - std::vector < std::string > dCIBDescr; - std::vector < double > dCIBCont; - std::string PDFset; - std::string PDFmember; + //! For interpolation bias get reference PDF & member and values if (eNumUnc == kApproxBias) { + std::vector < std::string > dCIBDescr; + std::string PDFset; + std::string PDFmem; + std::vector < double > dCIBCont; + //! Loop over contributions and evaluate InfoBlocks with reference values for (unsigned int i=0; i<fCoeff.size() ; i++) { fastNLOCoeffBase* c = GetCoeffTable(i); - if ( ! c->HasCoeffInfoBlock(1) ) { - logger.error["GetNumUncertainty"]<<"ERROR! No InfoBlock found for reference cross sections, exiting."<<endl; - exit(35); - } - cout << "EEEEE i = " << i << ", Has 0, 1 (0,1), (1,0) = " << c->HasCoeffInfoBlock(0) << c->HasCoeffInfoBlock(1) << c->HasCoeffInfoBlock(0,1) << c->HasCoeffInfoBlock(1,0) << endl; - int iCIBIndex = c->GetCoeffInfoBlockIndex(1); - logger.debug["GetNumUncertainty"]<<"Found CoeffInfoBlock "<<iCIBIndex<<" with reference cross sections."<<endl; - dCIBDescr = c->GetCoeffInfoBlockDescription(iCIBIndex); - dCIBCont = c->GetCoeffInfoBlockContent(iCIBIndex); - } - if ( dCIBDescr.size() < 3 ) { - logger.error["GetNumUncertainty"]<<"ERROR! InfoBlock description too short for reference cross sections, exiting."<<endl; - logger.error["GetNumUncertainty"]<<" Line two and three should contain the used PDF set and member."<<endl; - exit(36); - } else { - PDFset = dCIBDescr[1]; - PDFmember = dCIBDescr[2]; + logger.debug["GetNumUncertainty"]<<"Check whether contribution " << i << " is enabled, " << c->IsEnabled() << ", and additive (0), " << c->GetIAddMultFlag() << endl; + if ( c->IsEnabled() && c->GetIAddMultFlag() == 0 ) { + logger.info["GetNumUncertainty"]<<"Checking contribution " << i << " for reference values in InfoBlock." << endl; + if ( ! c->HasCoeffInfoBlock(1) ) { + logger.error["GetNumUncertainty"]<<"ERROR! No InfoBlock found for reference values, exiting."<<endl; + exit(35); + } + int iCIBIndex = c->GetCoeffInfoBlockIndex(1); + logger.debug["GetNumUncertainty"]<<"Found CoeffInfoBlock "<<iCIBIndex<<" with reference cross sections."<<endl; + dCIBDescr = c->GetCoeffInfoBlockDescription(iCIBIndex); + dCIBCont = c->GetCoeffInfoBlockContent(iCIBIndex); + if ( dCIBDescr.size() < 3 ) { + logger.error["GetNumUncertainty"]<<"ERROR! InfoBlock description too short for reference cross sections, exiting."<<endl; + logger.error["GetNumUncertainty"]<<" Line two and three should contain the used PDF set and member."<<endl; + exit(36); + } else { + PDFset = dCIBDescr[1]; + PDFmem = dCIBDescr[2]; + } + if ( MyRefXSection.size() == 0 ) { + MyRefXSection = dCIBCont; + } else { + if ( MyRefXSection.size() != dCIBCont.size() ) { + logger.error["GetNumUncertainty"]<<"ERROR! Unequal number of reference values in contributions, exiting."<<endl; + exit(39); + } + for (unsigned int j=0; j<MyRefXSection.size(); j++ ) { + MyRefXSection[j] += dCIBCont[j]; + } + } + } + } + if ( PDFset.empty() || PDFmem.empty() ) { // Corresponds to values from last active contribution + logger.error["GetNumUncertainty"]<<"ERROR! PDF set and/or PDF member used for reference values not found, aborted!" << endl; + exit(37); } - cout << "PDF set: " << PDFset << ", PDF member = " << PDFmember << endl; + logger.warn["GetNumUncertainty"]<<"The reference calculation used member " << PDFmem << " from PDF set " << PDFset << "." << endl; + logger.warn["GetNumUncertainty"]<<"To test the interpolation quality exactly the same PDF set and member must be used!" << endl; } //! Cross section and absolute uncertainties @@ -3680,9 +3695,8 @@ XsUncertainty fastNLOReader::GetXsUncertainty(const ENumUncertaintyStyle eNumUnc logger.info["GetNumUncertainty"]<<"Interpolation bias selected."<<endl; for (unsigned int iobs = 0; iobs < NObsBin; iobs++) { XsUnc.xs.push_back(MyXSection[iobs]); - XsUnc.dxsu.push_back(dCIBCont[iobs]); - XsUnc.dxsl.push_back(MyXSection[iobs]-dCIBCont[iobs]); - cout << "XXX XS = " << MyXSection[iobs] << ", XSREF = " << dCIBCont[iobs] << ", delta = " << MyXSection[iobs]-dCIBCont[iobs] << endl; + XsUnc.dxsu.push_back(MyXSection[iobs]-MyRefXSection[iobs]); + XsUnc.dxsl.push_back(MyRefXSection[iobs]); } } else { logger.error["GetNumUncertainty"]<<"ERROR! No valid numerical uncertainty style selected, exiting."<<endl; @@ -3693,10 +3707,10 @@ XsUncertainty fastNLOReader::GetXsUncertainty(const ENumUncertaintyStyle eNumUnc //! Divide by cross section != 0 to give relative uncertainties for (unsigned int iobs = 0; iobs < NObsBin; iobs++) { if (eNumUnc == kApproxBias) { - if (fabs(dCIBCont[iobs]) > DBL_MIN) { - XsUnc.dxsl[iobs] = XsUnc.dxsl[iobs] / fabs(dCIBCont[iobs]); + if (fabs(MyRefXSection[iobs]) > DBL_MIN) { + XsUnc.dxsu[iobs] = XsUnc.dxsu[iobs] / fabs(MyRefXSection[iobs]); } else { - XsUnc.dxsl[iobs] = 0.; + XsUnc.dxsu[iobs] = 0.; } } else { if (fabs(XsUnc.xs[iobs]) > DBL_MIN) { diff --git a/v2.5/toolkit/fastnlotoolkit/fastNLOTools.cc b/v2.5/toolkit/fastnlotoolkit/fastNLOTools.cc index 07a7f16d069ac3118a6a905f1368c1cb2e5e49ee..418b4488c4a46386c05b01be0111a9a2d746d252 100644 --- a/v2.5/toolkit/fastnlotoolkit/fastNLOTools.cc +++ b/v2.5/toolkit/fastnlotoolkit/fastNLOTools.cc @@ -621,21 +621,21 @@ namespace fastNLOTools { //______________________________________________________________________________ - void PrintXSUncertainty(XsUncertainty XsUnc, string UncName) { + void PrintXSUncertainty(XsUncertainty XsUnc, string UncName, string HeadLine) { // // Print evaluated cross section and relative uncertainty stored in // struct XsUncertainty of fastNLOReader.h // if ( XsUnc.xs.size() ) { - cout << _CSEPSC << endl; + cout << _CSEPSC << endl; cout << " # fastNLOReader: Evaluating uncertainties" << endl; - cout << _CSEPSC << endl; - cout << _DSEPSC << endl; - cout << UncName << endl; - cout << _SSEPSC << endl; - cout << " # bin cross_section lower_uncertainty upper_uncertainty" << endl; - cout << _TSEPSC << endl; + cout << _CSEPSC << endl; + cout << _DSEPSC << endl; + cout << UncName << endl; + cout << _SSEPSC << endl; + cout << HeadLine << endl; + cout << _TSEPSC << endl; for ( unsigned int iobs=0;iobs<XsUnc.xs.size();iobs++ ) { printf("%5.i %#18.11E %#18.11E %#18.11E\n",iobs+1,XsUnc.xs[iobs],XsUnc.dxsl[iobs],XsUnc.dxsu[iobs]); } @@ -645,7 +645,7 @@ namespace fastNLOTools { //______________________________________________________________________________ - void PrintXSUncertaintyVec(std::vector< std::vector<double> > xsUncVec, string UncName) { + void PrintXSUncertaintyVec(std::vector< std::vector<double> > xsUncVec, string UncName, string HeadLine) { // // Print evaluated cross section and relative uncertainty stored in // Tri-vector XsUncertaintyVec of fastNLOReader.h @@ -654,7 +654,7 @@ namespace fastNLOTools { xsUnc.xs = xsUncVec[0]; xsUnc.dxsu = xsUncVec[1]; xsUnc.dxsl = xsUncVec[2]; - PrintXSUncertainty(xsUnc, UncName); + PrintXSUncertainty(xsUnc, UncName, HeadLine); } } // end namespace fastNLO diff --git a/v2.5/toolkit/fastnlotoolkit/include/fastnlotk/fastNLOConstants.h.in b/v2.5/toolkit/fastnlotoolkit/include/fastnlotk/fastNLOConstants.h.in index 4a3496a2a5ad0e4607c7e3f7008f5d6242efd1d2..5a1a9beab5bea763d2159dfd057b6a59276e0c2b 100644 --- a/v2.5/toolkit/fastnlotoolkit/include/fastnlotk/fastNLOConstants.h.in +++ b/v2.5/toolkit/fastnlotoolkit/include/fastnlotk/fastNLOConstants.h.in @@ -52,8 +52,8 @@ namespace fastNLO { typedef std::vector<std::vector<std::vector<std::vector<std::vector<std::vector<std::vector<double > > > > > > > v7d; // ---- constants ---- // - static const std::set<int> CompatibleVersions{20000,21000,22000,23000,23500,23600,25000}; - const int tabversion = 23600; + static const std::set<int> CompatibleVersions{20000,21000,22000,23000,23500,23600,25000,26000}; + const int tabversion = 26000; const int tablemagicno = 1234567890; // separating character between entries in table const char sep[] = "\n"; diff --git a/v2.5/toolkit/fastnlotoolkit/include/fastnlotk/fastNLOTools.h b/v2.5/toolkit/fastnlotoolkit/include/fastnlotk/fastNLOTools.h index be0fc13798c14ca652a1e55c6a0f18496b236ca2..b66340e4fb9d5338d9715bdacc6cd8d23249c30f 100644 --- a/v2.5/toolkit/fastnlotoolkit/include/fastnlotk/fastNLOTools.h +++ b/v2.5/toolkit/fastnlotoolkit/include/fastnlotk/fastNLOTools.h @@ -74,8 +74,10 @@ namespace fastNLOTools { template<typename T> void PrintVector( const std::vector<T>& v, std::string name, std::string prefix=""); //! - Printout of x section with uncertainty - void PrintXSUncertainty(XsUncertainty XsUnc, std::string UncName); - void PrintXSUncertaintyVec(std::vector< std::vector<double> > XsUncVec, std::string UncName); + void PrintXSUncertainty(XsUncertainty XsUnc, std::string UncName, + std::string HeadLine = " # bin cross_section lower_uncertainty upper_uncertainty"); + void PrintXSUncertaintyVec(std::vector< std::vector<double> > XsUncVec, std::string UncName, + std::string HeadLine = " # bin cross_section lower_uncertainty upper_uncertainty"); //! - useful i/o void PrintFastnloVersion(); //!< Print out fastNLO version diff --git a/v2.5/toolkit/src/fnlo-tk-modify.cc b/v2.5/toolkit/src/fnlo-tk-modify.cc index e20c56a41ac008b5cc0722a37b2fe959af024297..ee6fff1c7bc2752ece4b337e3e32948eda489d1d 100644 --- a/v2.5/toolkit/src/fnlo-tk-modify.cc +++ b/v2.5/toolkit/src/fnlo-tk-modify.cc @@ -205,14 +205,14 @@ int main(int argc, char** argv) { table.SetIpublunits(INT(Ipublunits)); } - if ( !STRING_ARR(ScDescript).empty() ){ + if ( EXIST(ScDescript) && !STRING_ARR(ScDescript).empty() ){ vector <string> ScDescr = table.GetScDescr(); size_t NScSize = ScDescr.size(); info["fnlo-tk-modify"]<<"Modifying existing scenario description:" << endl; for ( size_t i = 0; i < NScSize; i++ ) { shout << "Line no. " << i << ": " << ScDescr[i] << endl; } - if ( BOOL(AttachScDescription) ){ + if ( EXIST(AttachScDescription) && BOOL(AttachScDescription) ){ info["fnlo-tk-modify"]<<"Attaching to scenario description:" << endl; size_t NewNScSize = NScSize + STRING_ARR(ScDescript).size(); ScDescr.resize(NewNScSize); @@ -242,7 +242,7 @@ int main(int argc, char** argv) { table.SetLoOrder(INT(ILOord)); } - if ( !STRING_ARR(DimLabels).empty() ){ + if ( EXIST(DimLabels) && !STRING_ARR(DimLabels).empty() ){ unsigned int ndim = table.GetNumDiffBin(); if ( ndim != STRING_ARR(DimLabels).size() ) { error["fnlo-tk-modify"]<<"You need the same number of dimension labels than bin dimensions in the table, ndim = " << ndim << ". Aborted!" << endl; @@ -347,8 +347,7 @@ int main(int argc, char** argv) { } } - //! Add InfoBlocks with additional information from steering file - cout << "AAAAAAAAAA" << endl; + //! Add InfoBlocks //! Default description line std::string Default = "Please provide description!"; //! Default key @@ -368,54 +367,31 @@ int main(int argc, char** argv) { std::string KeyFiles = Key + "Files"; std::string KeyColumns = Key + "Columns"; std::string KeyFacs = Key + "Facs"; - 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; } - // 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; - // } - // // - + //! Add InfoBlocks with additional information from steering file 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(); + unsigned int NDescr = read_steer::getstringarray(KeyDescr).size(); + unsigned int NValsLO = read_steer::getdoublearray(KeyValuesLO).size(); + unsigned int NValsNLO = read_steer::getdoublearray(KeyValuesNLO).size(); + unsigned int NValsNNLO = read_steer::getdoublearray(KeyValuesNNLO).size(); + unsigned int NFacs = read_steer::getdoublearray(KeyFacs).size(); + double relfac = 1.; + if ( NFacs == 0 ) { + } else if ( NFacs == 1 ) { + relfac = read_steer::getdoublearray(KeyFacs)[0]; + } else { + error["fnlo-tk-modify"]<<"Only one multiplicative factor allowed, but found more. Aborted! NFacs = " << NFacs <<endl; + exit(39); + } std::vector<std::string> Description; if ( NDescr > 0 ) { for ( unsigned int j = 0; j < NDescr; j++ ) { @@ -424,9 +400,12 @@ int main(int argc, char** argv) { } 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"); + vector<double> cont_LO = read_steer::getdoublearray(KeyValuesLO); + vector<double> cont_NLO = read_steer::getdoublearray(KeyValuesNLO); + vector<double> cont_NNLO = read_steer::getdoublearray(KeyValuesNNLO); + for ( unsigned int i = 0; i < NValsLO; i++ ) cont_LO[i] = relfac*cont_LO[i]; + for ( unsigned int i = 0; i < NValsNLO; i++ ) cont_NLO[i] = relfac*cont_NLO[i]; + for ( unsigned int i = 0; i < NValsNNLO; i++ ) cont_NNLO[i] = relfac*cont_NNLO[i]; int Ncontrib = table.GetNcontrib(); int ic = 0; for ( int i = 0; i < Ncontrib; i++ ) { @@ -434,7 +413,7 @@ int main(int argc, char** argv) { if ( fastNLOCoeffAddBase::CheckCoeffConstants(c,true) ) { int iFlag1 = read_steer::getint(KeyFlag1); int iFlag2 = read_steer::getint(KeyFlag2); - if ( c->IsLO() ) { + if ( c->IsLO() && NValsLO > 0 ) { 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; @@ -446,9 +425,8 @@ int main(int argc, char** argv) { c->AddCoeffInfoBlock(iFlag1,iFlag2,Description,cont_LO); } ic += 1; - } else if ( c->IsNLO() ) { + } else if ( c->IsNLO() && NValsNLO > 0) { 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 ) { @@ -459,9 +437,8 @@ int main(int argc, char** argv) { c->AddCoeffInfoBlock(iFlag1,iFlag2,Description,cont_NLO); } ic += 1; - } else if ( c->IsNNLO() ) { + } else if ( c->IsNNLO() && NValsNNLO > 0) { 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 ) { @@ -480,7 +457,7 @@ int main(int argc, char** argv) { } } - //! Add InfoBlocks with statistical uncertainty from file (NNLOJET .dat, fnlo-tk-statunc .log, or .txt) + //! Add InfoBlocks with additonal information 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() ) { @@ -489,12 +466,11 @@ int main(int argc, char** argv) { } 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(); - unsigned int NFacs = read_steer::getintarray(KeyFacs).size(); + unsigned int NFacs = read_steer::getdoublearray(KeyFacs).size(); if ( NFiles != NOrders ) { error["fnlo-tk-modify"]<<"Need one order specification per file, aborted! Found NFiles = " << NFiles << ", and NOrders = " << NOrders <<endl; exit(37); @@ -511,7 +487,6 @@ int main(int argc, char** argv) { 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; double relfac = 1.; if ( NFacs == 0 ) { } else if ( NFacs == 1 ) { diff --git a/v2.5/toolkit/src/fnlo-tk-rootout.cc b/v2.5/toolkit/src/fnlo-tk-rootout.cc index fd19705be7831f6045544915bb90c6eb582cf2c4..17b2388be3dcd07be411998889f6c2df7ae46bf1 100644 --- a/v2.5/toolkit/src/fnlo-tk-rootout.cc +++ b/v2.5/toolkit/src/fnlo-tk-rootout.cc @@ -108,7 +108,7 @@ int main(int argc, char** argv) { infosep << _SSEPSC << endl; infosep << " #" << endl; info["fnlo-tk-rootout"] << "This program evaluates a fastNLO table and" << endl; - info["fnlo-tk-rootout"] << "prints out cross sections with statistical (if available), " << endl; + info["fnlo-tk-rootout"] << "prints out cross sections with numerical (if available), " << endl; info["fnlo-tk-rootout"] << "scale, or PDF uncertainties in ROOT format." << endl; info["fnlo-tk-rootout"] << "" << endl; info["fnlo-tk-rootout"] << "TODO: Provide more info on ROOT histogram numbering/labelling ..." << endl; @@ -360,7 +360,7 @@ int main(int argc, char** argv) { if ( fnlo->IsNorm() ) { lNorm = true; } else { - error["fnlo-read"] << "Normalization requested but not defined for this table, aborted!" << endl; + error["fnlo-tk-rootout"] << "Normalization requested but not defined for this table, aborted!" << endl; exit(1); } } diff --git a/v2.5/toolkit/src/fnlo-tk-yodaout.cc b/v2.5/toolkit/src/fnlo-tk-yodaout.cc index cf0340c08d56406685f80b2a1e46303c11be4696..23b6d571c36a979609e2ae66883afe2f00d92b31 100644 --- a/v2.5/toolkit/src/fnlo-tk-yodaout.cc +++ b/v2.5/toolkit/src/fnlo-tk-yodaout.cc @@ -100,7 +100,7 @@ int main(int argc, char** argv) { infosep << _SSEPSC << endl; infosep << " #" << endl; info["fnlo-tk-yodaout"] << "This program evaluates a fastNLO table and" << endl; - info["fnlo-tk-yodaout"] << "prints out cross sections with statistical (if available), " << endl; + info["fnlo-tk-yodaout"] << "prints out cross sections with numerical (if available), " << endl; info["fnlo-tk-yodaout"] << "scale, or PDF uncertainties in YODA format for use with Rivet." << endl; info["fnlo-tk-yodaout"] << "For this to work, the scenario description must contain" << endl; info["fnlo-tk-yodaout"] << "the Rivet ID in the form 'RIVET_ID=EXP_YYYY_INSPIREID/Dii-xjj-ykk'," << endl; @@ -503,6 +503,7 @@ int main(int argc, char** argv) { XsUncertainty XsUnc; string LineName; string UncName; + string HeadLine = " # bin cross_section lower_uncertainty upper_uncertainty"; if ( chunc == "2P" || chunc == "6P" || chunc == "30") { XsUnc = fnlo->GetXsUncertainty(eScaleUnc, lNorm, sclfac); UncName = " # Relative scale uncertainties"; @@ -517,8 +518,9 @@ int main(int argc, char** argv) { LineName += "_dxst"; } else if ( chunc == "AB" ) { XsUnc = fnlo->GetXsUncertainty(eNumUnc, lNorm); - UncName = " # Relative approximation bias"; + UncName = " # Relative interpolation bias"; LineName += "_dxab"; + HeadLine = " # bin cross_section reference_value relative_deviation"; } else if ( chunc != "none" ) { XsUnc = fnlo->GetXsUncertainty(ePDFUnc, lNorm); UncName = " # Relative PDF uncertainties"; @@ -529,7 +531,7 @@ int main(int argc, char** argv) { LineName += "_dxnone"; } UncName = UncName + " (" + chunc + " " + PDFFile + " " + sOrder + ")"; - fastNLOTools::PrintXSUncertainty(XsUnc, UncName); + fastNLOTools::PrintXSUncertainty(XsUnc, UncName, HeadLine); //! --- Get RivetID //! For 2+-dimensions determine running number in Rivet plot name by spotting the capital letter in "RIVET_ID=" in the fnlo table