diff --git a/doc/tableformat/fastNLOTableFormatv25.ods b/doc/tableformat/fastNLOTableFormatv25.ods new file mode 100644 index 0000000000000000000000000000000000000000..6cc3fa9ed593b2ccf1a8855c9e500902e665ab2c Binary files /dev/null and b/doc/tableformat/fastNLOTableFormatv25.ods differ diff --git a/v2.3/toolkit/AUTHORS b/v2.3/toolkit/AUTHORS index 4798eb2138c8e3928293afc104b2be2121280ee5..f6ab37e95b0545eccbd75a640c12ca4bd8392a96 100644 --- a/v2.3/toolkit/AUTHORS +++ b/v2.3/toolkit/AUTHORS @@ -1,8 +1,9 @@ fastNLO is written by ---------------------- +===================== Daniel Britzger [daniel.britzger@desy.de], -Thomas Kluge, Klaus Rabbertz [klaus.rabbertz@cern.ch], -Georg Sieber [g.sieber@cern.ch], -Fred Stober [stober@cern.ch], and -Markus Wobisch [wobisch@fnal.gov] +Markus Wobisch [wobisch@latech.edu] + +Former contributors are: +------------------------ +Thomas Kluge, Georg Sieber, Jakob Stark, Fred Stober diff --git a/v2.3/toolkit/configure.ac b/v2.3/toolkit/configure.ac index 7057fccee707b958b9cbb2245e7e9ad16409e31d..c263bdf4c81b996d67684f6c9120506451fa3bb3 100644 --- a/v2.3/toolkit/configure.ac +++ b/v2.3/toolkit/configure.ac @@ -10,7 +10,7 @@ # Require minimal autoconf version, 2.69 is from 2012 AC_PREREQ([2.69]) # Define subproject fastNLO_toolkit -AC_INIT([fastNLO_toolkit], [2.3.1], [daniel.britzger@desy.de,klaus.rabbertz@cern.ch,g.sieber@cern.ch,stober@cern.ch,wobisch@fnal.gov]) +AC_INIT([fastNLO_toolkit], [2.5.0], [daniel.britzger@desy.de,klaus.rabbertz@cern.ch,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 @@ -733,9 +733,9 @@ AM_CONDITIONAL(DX_COND_pdf, [test "x$DOXYGEN" != "x"]) # Define project substitution variables (to be replaced e.g. in config files below) AC_SUBST([AUTHORS],["D. Britzger, T. Kluge, K. Rabbertz, F. Stober, G. Sieber, M. Wobisch"]) AC_SUBST([AUTHORSv14],["T. Kluge, K. Rabbertz, M. Wobisch"]) -AC_SUBST([AUTHORSv2],["D. Britzger, T. Kluge, K. Rabbertz, F. Stober, M. Wobisch"]) -AC_SUBST([QUOTEv14],["hep-ph/0609285"]) -AC_SUBST([QUOTEv2],["arXiv:1109.1310"]) +AC_SUBST([AUTHORSv2],["D. Britzger, K. Rabbertz, F. Stober, M. Wobisch"]) +AC_SUBST([QUOTEv14],["Proc. DIS 2006, 483 (2006), hep-ph/0609285."]) +AC_SUBST([QUOTEv2],["Proc. DIS 2012, 217 (2012), arXiv:1208.3641."]) AC_SUBST([SUBPROJECT],["toolkit"]) AC_SUBST([WEBPAGE],["http://projects.hepforge.org/fastnlo"]) AC_SUBST([YEARS],["2005-`date +%Y`"]) diff --git a/v2.3/toolkit/data/modify/SteerModify.str b/v2.3/toolkit/data/modify/SteerModify.str index b321e0c5b6faa4ac7667a247f46f0ba812b25155..a059e7ff3d36b9d11020d697ade98b3db083f1ef 100644 --- a/v2.3/toolkit/data/modify/SteerModify.str +++ b/v2.3/toolkit/data/modify/SteerModify.str @@ -24,7 +24,7 @@ # ScDescript { # "First line to add" # "Second line of add" -# "etc" +# "etc." # } # ################################################################################## @@ -38,6 +38,7 @@ OutTable ModifiedTable.tab #-------------------- # Info print out #-------------------- +Verbosity INFO # Set print out verbosity PrintSteeringCard true # Print steering provided on command line or within this file PrintInputA1 true # Print table header of input table PrintInputA2 true # Print table scenario of input table @@ -48,8 +49,8 @@ PrintOutputA2 true # Print table scenario of output table # Modify parameters of the table header # Leave value empty for no modification #------------------------------------------- -#Itabversion # Change table version (Expert option!) -#ScenName # Change scenario name +#Itabversion 25000 # Change table version (Expert option!) +#ScenName fnlabcd # Change scenario name # -------------------------------------------- # Modify parameters of the table scenario @@ -68,21 +69,25 @@ ScDescript { # Example of final scenario description for CMS inclu "RIVET_ID=CMS_2011_S9086218/D01-x01-y01,SPIRES_ID=9086218,INSPIRE_RECORD=902309" "THEORY_LABEL=NLOJet++" "provided by:" - "fastNLO_2.1.0" + "fastNLO_2.5.0" "If you use this table, please cite:" - " D. Britzger, T. Kluge, K. Rabbertz, F. Stober, M. Wobisch, arXiv:1109.1310" + " D. Britzger, K. Rabbertz, F. Stober, M. Wobisch, Proc. DIS 2012, 217 (2012), arXiv:1208.3641." } #------------------------------------------------------ -# Modify bin sizes +# Modify bin sizes set in table scenario # (Does not change differential cross sections, # which are stored already in differential form!) #------------------------------------------------------ -BinSizeFactor 1. # Overall factor for bin sizes +#BinSizeFactor 1. # Overall factor for bin sizes #BinSize { # Individual bin size factors for each observable bin; one no. per bin! # #} +# -------------------------------------------- +# Modify the table contributions +# -------------------------------------------- + #-------------------------------------------------------------------- # Modify tabulated coefficients # (Changes the differential cross sections, which can be adapted @@ -92,11 +97,41 @@ BinSizeFactor 1. # Overall factor for bin sizes # #} +#-------------------------------------------------------------------- +# Modify code description +# (Same description for all perturbative contributions!) +#-------------------------------------------------------------------- +#CodeDescript { +# "NNLOJET_rev5918, please cite: T. Gehrmann et al., PoS RADCOR2017, 074 (2018), arXiv:1801.06415." +# "APPLfast interface, please cite: D. Britzger et al., Eur. Phys. J. C79, 845 (2019), arXiv:1906.05303." +#} + +#-------------------------------------------------------------------- +# Add InfoBlocks with statistical/numerical uncertainty +# (For now only works with NNLOJET dat files!) +#-------------------------------------------------------------------- +#InfoBlockFiles { # NNLOJET dat files for each order separately +# 2jet.LO.fnl3832_yb0_ys0_ptavgj12.dat +# 2jet.NLO_only.fnl3832_yb0_ys0_ptavgj12.dat +# 2jet.NNLO_only.fnl3832_yb0_ys0_ptavgj12.dat +#} + +#InfoBlockDescr { # Same description for each contribution +# "Default statistical uncertainties from NNLOJET." +#} + +#InfoBlockOrders { # Attribution of dat files to respective orders +# "LO" +# "NLO" +# "NNLO" +#} + #------------------------------------------------------------------------- # Cut out unused observable bins or split table into multiples pieces # Specify bin numbers to be removed within curly brackets. # First bin is bin 1, last bin is NObsBin. # An ordered numbering with INCREASING bin numbers must be used! +# Do NOT erase bins while adding InfoBlocks or vice versa! #-------------------------------------------------------------------------- #RemoveBins { # Gaps are fine, BUT an increasing bin numbering must be used! # 1 2 3 diff --git a/v2.3/toolkit/fastnlotoolkit/fastNLOCoeffAddBase.cc b/v2.3/toolkit/fastnlotoolkit/fastNLOCoeffAddBase.cc index 7132e52ebd1a06b8e2a7c38a4a1a21ae9e734933..19aac25463065297717b8da7db3a612d930f72bb 100644 --- a/v2.3/toolkit/fastnlotoolkit/fastNLOCoeffAddBase.cc +++ b/v2.3/toolkit/fastnlotoolkit/fastNLOCoeffAddBase.cc @@ -36,10 +36,9 @@ bool fastNLOCoeffAddBase::CheckCoeffConstants(const fastNLOCoeffBase* c, bool qu return false; } else { // Unknown contribution - say::error["fastNLOCoeffAddBase::CheckCoeffConstants"] - << "Unknown contribution type, aborting! " - << "IAddMultFlag = " << c->GetIAddMultFlag() - << ", IDataFlag =" << c->GetIDataFlag() <<endl; + say::error["fastNLOCoeffAddBase::CheckCoeffConstants"] << "Unknown contribution type, aborting! " + << "IAddMultFlag = " << c->GetIAddMultFlag() + << ", IDataFlag =" << c->GetIDataFlag() <<endl; exit(1); } } @@ -53,13 +52,13 @@ fastNLOCoeffAddBase* fastNLOCoeffAddBase::Clone() const { ///________________________________________________________________________________________________________________ // void fastNLOCoeffAddBase::Read(istream& table, int ITabVersionRead){ - debug["ReadCoeffAddBase::Read"]<<"Start reading table ..."<<endl; + debug["Read"]<<"Start reading table ..."<<endl; fastNLOCoeffBase::ReadBase(table, ITabVersionRead); CheckCoeffConstants(this); ReadCoeffAddBase(table, ITabVersionRead); fastNLOCoeffBase::ReadCoeffInfoBlocks(table, ITabVersionRead); EndReadCoeff(table, ITabVersionRead); - debug["ReadCoeffAddBase::Read"]<<"Finished reading table ..."<<endl; + debug["Read"]<<"Finished reading table ..."<<endl; } @@ -292,7 +291,7 @@ void fastNLOCoeffAddBase::Write(ostream& table, int itabversion) { table << IPDFdef3 << sep; if(IPDFdef2==0){ // PDF linear combinations are stored herewith - cout<<"Writing PDF coefficients into table."<<endl; + info["Write"]<<"Writing PDF coefficients into table."<<endl; if ( IPDFdef3 != NSubproc ){ error["Write"]<<"IPDFdef3 must be equal to NSubproc. (IPDFdef3="<<IPDFdef3<<", NSubproc="<<NSubproc<<"). Exiting."<<endl; exit(1); @@ -788,44 +787,67 @@ void fastNLOCoeffAddBase::Print(int iprint) const { //________________________________________________________________________________________________________________ // // Erase observable bin -void fastNLOCoeffAddBase::EraseBin(unsigned int iObsIdx) { - debug["EraseBin"]<<"Erasing table entries in CoeffAddBase for bin index " << iObsIdx << endl; +void fastNLOCoeffAddBase::EraseBin(unsigned int iObsIdx, int ITabVersionRead) { + debug["EraseBin"]<<"Erasing observable bin in CoeffAddBase with bin index " << iObsIdx << endl; if ( XNode1.size() == 0 ) { error["EraseBin"]<<"All additive contribution bins deleted already. Aborted!" << endl; exit(1); } if ( XNode1.size() != 0 ) XNode1.erase(XNode1.begin()+iObsIdx); if ( NPDFDim==2 && XNode2.size() != 0 ) XNode2.erase(XNode2.begin()+iObsIdx); - for ( unsigned int ip = 0 ; ip<fWgt.WgtObsSumW2.size() ; ip++ ) { - fWgt.WgtObsSumW2[ip].erase(fWgt.WgtObsSumW2[ip].begin()+iObsIdx); - fWgt.SigObsSumW2[ip].erase(fWgt.SigObsSumW2[ip].begin()+iObsIdx); - fWgt.SigObsSum[ip]. erase(fWgt.SigObsSum [ip].begin()+iObsIdx); - fWgt.WgtObsNumEv[ip].erase(fWgt.WgtObsNumEv[ip].begin()+iObsIdx); + for ( unsigned int i = 0 ; i<fWgt.WgtObsSumW2.size() ; i++ ) { + fWgt.WgtObsSumW2[i].erase(fWgt.WgtObsSumW2[i].begin()+iObsIdx); + fWgt.SigObsSumW2[i].erase(fWgt.SigObsSumW2[i].begin()+iObsIdx); + fWgt.SigObsSum[i]. erase(fWgt.SigObsSum [i].begin()+iObsIdx); + fWgt.WgtObsNumEv[i].erase(fWgt.WgtObsNumEv[i].begin()+iObsIdx); + } + if ( ! ( ITabVersionRead < 25000 ) ) { + if ( NCoeffInfoBlocks > 0 ) { + debug["EraseBin"]<<"Found " << NCoeffInfoBlocks << " InfoBlocks with bins to be erased, too." << endl; + for ( int i=0; i < NCoeffInfoBlocks; i++ ) { + if ( ICoeffInfoBlockFlag1[i] == 0 && ICoeffInfoBlockFlag2[i] == 0 ) { + CoeffInfoBlockContent[i].erase(CoeffInfoBlockContent[i].begin()+iObsIdx); + NCoeffInfoBlockCont[i] = NCoeffInfoBlockCont[i] - 1; + } else { + error["EraseBin"]<<"Erase bin not yet implemented for InfoBlocks other than with flags 1,2 = 0, 0:" << + ICoeffInfoBlockFlag1[i] << ", " << ICoeffInfoBlockFlag2[i] << ", aborted!" << endl; + exit(567); + } + } + } } fastNLOCoeffBase::EraseBin(iObsIdx); } // Catenate observable bin -void fastNLOCoeffAddBase::CatBin(const fastNLOCoeffAddBase& other, unsigned int iObsIdx) { - debug["CatBin"]<<"Catenating observable bin in CoeffAddBase corresponding to bin index " << iObsIdx << endl; +void fastNLOCoeffAddBase::CatBin(const fastNLOCoeffAddBase& other, unsigned int iObsIdx, int ITabVersionRead) { + debug["CatBin"]<<"Catenating observable bin to CoeffAddBase with bin index " << iObsIdx << endl; if ( XNode1.size() == 0 ) { error["CatBin"]<<"Initial additive table is empty. Aborted!" << endl; exit(1); } - //unsigned int nold = XNode1.size(); - if ( XNode1.size() != 0 ) { - XNode1.push_back(other.XNode1[iObsIdx]); - // XNode1.resize(nold+1); - // XNode1[nold] = other.XNode1[iObsIdx]; - } - if ( NPDFDim==2 && XNode2.size() != 0 ) { - XNode2.push_back(other.XNode2[iObsIdx]); - } - for ( unsigned int ip = 0 ; ip<fWgt.WgtObsSumW2.size() ; ip++ ) { - fWgt.WgtObsSumW2[ip].push_back(other.fWgt.WgtObsSumW2[ip][iObsIdx]); - fWgt.SigObsSumW2[ip].push_back(other.fWgt.SigObsSumW2[ip][iObsIdx]); - fWgt.SigObsSum[ip]. push_back(other.fWgt.SigObsSum [ip][iObsIdx]); - fWgt.WgtObsNumEv[ip].push_back(other.fWgt.WgtObsNumEv[ip][iObsIdx]); + if ( XNode1.size() != 0 ) XNode1.push_back(other.XNode1[iObsIdx]); + if ( NPDFDim==2 && XNode2.size() != 0 ) XNode2.push_back(other.XNode2[iObsIdx]); + for ( unsigned int i = 0 ; i<fWgt.WgtObsSumW2.size() ; i++ ) { + fWgt.WgtObsSumW2[i].push_back(other.fWgt.WgtObsSumW2[i][iObsIdx]); + fWgt.SigObsSumW2[i].push_back(other.fWgt.SigObsSumW2[i][iObsIdx]); + fWgt.SigObsSum[i]. push_back(other.fWgt.SigObsSum [i][iObsIdx]); + fWgt.WgtObsNumEv[i].push_back(other.fWgt.WgtObsNumEv[i][iObsIdx]); + } + if ( ! ( ITabVersionRead < 25000 ) ) { + if ( NCoeffInfoBlocks > 0 ) { + debug["CatBin"]<<"Found " << NCoeffInfoBlocks << " InfoBlocks with bins to be catenated, too." << endl; + for ( int i=0; i < NCoeffInfoBlocks; i++ ) { + if ( ICoeffInfoBlockFlag1[i] == 0 && ICoeffInfoBlockFlag2[i] == 0 ) { + CoeffInfoBlockContent[i].push_back(other.CoeffInfoBlockContent[i][iObsIdx]); + NCoeffInfoBlockCont[i] = NCoeffInfoBlockCont[i] + 1; + } else { + error["CatBin"]<<"Catenate bins not yet implemented for InfoBlocks other than with flags 1,2 = 0, 0:" << + ICoeffInfoBlockFlag1[i] << ", " << ICoeffInfoBlockFlag2[i] << ", aborted!" << endl; + exit(678); + } + } + } } fastNLOCoeffBase::CatBin(other, iObsIdx); } diff --git a/v2.3/toolkit/fastnlotoolkit/fastNLOCoeffAddFix.cc b/v2.3/toolkit/fastnlotoolkit/fastNLOCoeffAddFix.cc index 5f2b13992da66c161019a9f66a352a7e8e490dbb..bb92b49048a73be109c1ad42c6e7262383fc8277 100644 --- a/v2.3/toolkit/fastnlotoolkit/fastNLOCoeffAddFix.cc +++ b/v2.3/toolkit/fastnlotoolkit/fastNLOCoeffAddFix.cc @@ -428,7 +428,7 @@ void fastNLOCoeffAddFix::Print(int iprint) const { //________________________________________________________________________________________________________________ // -void fastNLOCoeffAddFix::EraseBin(unsigned int iObsIdx) { +void fastNLOCoeffAddFix::EraseBin(unsigned int iObsIdx, int ITabVersionRead) { //! Erase observable bin debug["fastNLOCoeffAddFix::EraseBin"]<<"Erasing table entries in CoeffAddFix for bin index " << iObsIdx << endl; if ( ScaleNode.size() == 0 ) { @@ -437,11 +437,11 @@ void fastNLOCoeffAddFix::EraseBin(unsigned int iObsIdx) { } if ( ScaleNode.size() != 0 ) ScaleNode.erase(ScaleNode.begin()+iObsIdx); if ( SigmaTilde.size() != 0 ) SigmaTilde.erase(SigmaTilde.begin()+iObsIdx); - fastNLOCoeffAddBase::EraseBin(iObsIdx); + fastNLOCoeffAddBase::EraseBin(iObsIdx,ITabVersionRead); } // Catenate observable bin -void fastNLOCoeffAddFix::CatBin(const fastNLOCoeffAddFix& other, unsigned int iObsIdx) { +void fastNLOCoeffAddFix::CatBin(const fastNLOCoeffAddFix& other, unsigned int iObsIdx, int ITabVersionRead) { debug["fastNLOCoeffAddFix::CatBin"]<<"Catenating observable bin in CoeffAddFix corresponding to bin index " << iObsIdx << endl; if ( ScaleNode.size() == 0 ) { say::error["CatBin"]<<"Initial fix-scale table is empty. Aborted!" << endl; @@ -456,5 +456,5 @@ void fastNLOCoeffAddFix::CatBin(const fastNLOCoeffAddFix& other, unsigned int iO SigmaTilde.resize(nold+1); SigmaTilde[nold] = other.SigmaTilde[iObsIdx]; } - fastNLOCoeffAddBase::CatBin(other, iObsIdx); + fastNLOCoeffAddBase::CatBin(other, iObsIdx, ITabVersionRead); } diff --git a/v2.3/toolkit/fastnlotoolkit/fastNLOCoeffAddFlex.cc b/v2.3/toolkit/fastnlotoolkit/fastNLOCoeffAddFlex.cc index 6912570771fca0eb528c25b458ccfea80f8947f1..758b8cb11334842b38352e322de9a10e561b17ff 100644 --- a/v2.3/toolkit/fastnlotoolkit/fastNLOCoeffAddFlex.cc +++ b/v2.3/toolkit/fastnlotoolkit/fastNLOCoeffAddFlex.cc @@ -518,7 +518,7 @@ void fastNLOCoeffAddFlex::Print(int iprint) const { //________________________________________________________________________________________________________________ // // Erase observable bin -void fastNLOCoeffAddFlex::EraseBin(unsigned int iObsIdx) { +void fastNLOCoeffAddFlex::EraseBin(unsigned int iObsIdx, int ITabVersionRead) { debug["fastNLOCoeffAddFlex::EraseBin"]<<"Erasing table entries in CoeffAddFlex for bin index " << iObsIdx << endl; if ( ScaleNode1.size() == 0 ) { say::error["EraseBin"]<<"All bins deleted already. Aborted!" << endl; @@ -532,11 +532,11 @@ void fastNLOCoeffAddFlex::EraseBin(unsigned int iObsIdx) { if ( SigmaTildeMuRRDep.size() != 0 ) SigmaTildeMuRRDep.erase(SigmaTildeMuRRDep.begin()+iObsIdx); if ( SigmaTildeMuFFDep.size() != 0 ) SigmaTildeMuFFDep.erase(SigmaTildeMuFFDep.begin()+iObsIdx); if ( SigmaTildeMuRFDep.size() != 0 ) SigmaTildeMuRFDep.erase(SigmaTildeMuRFDep.begin()+iObsIdx); - fastNLOCoeffAddBase::EraseBin(iObsIdx); + fastNLOCoeffAddBase::EraseBin(iObsIdx,ITabVersionRead); } // Catenate observable bin -void fastNLOCoeffAddFlex::CatBin(const fastNLOCoeffAddFlex& other, unsigned int iObsIdx) { +void fastNLOCoeffAddFlex::CatBin(const fastNLOCoeffAddFlex& other, unsigned int iObsIdx, int ITabVersionRead) { debug["fastNLOCoeffAddFlex::CatBin"]<<"Catenating observable bin in CoeffAddFlex corresponding to bin index " << iObsIdx << endl; if ( ScaleNode1.size() == 0 ) { say::error["CatBin"]<<"Initial flex-scale table is empty. Aborted!" << endl; @@ -575,5 +575,5 @@ void fastNLOCoeffAddFlex::CatBin(const fastNLOCoeffAddFlex& other, unsigned int SigmaTildeMuRFDep.resize(nold+1); SigmaTildeMuRFDep[nold] = other.SigmaTildeMuRFDep[iObsIdx]; } - fastNLOCoeffAddBase::CatBin(other, iObsIdx); + fastNLOCoeffAddBase::CatBin(other, iObsIdx, ITabVersionRead); } diff --git a/v2.3/toolkit/fastnlotoolkit/fastNLOCoeffBase.cc b/v2.3/toolkit/fastnlotoolkit/fastNLOCoeffBase.cc index 54b108a15722f52c4b783f9cc34bdcc513c21161..d7b54af53b84e1f709b6849b906f22fefd31bde0 100644 --- a/v2.3/toolkit/fastnlotoolkit/fastNLOCoeffBase.cc +++ b/v2.3/toolkit/fastnlotoolkit/fastNLOCoeffBase.cc @@ -26,17 +26,17 @@ fastNLOCoeffBase* fastNLOCoeffBase::Clone() const { void fastNLOCoeffBase::Read(istream& table, int ITabVersionRead){ // basic read function. // reads in only 'base'-variables. - debug["ReadCoeffBase::Read"]<<"Start reading table ..."<<endl; + debug["Read"]<<"Start reading table ..."<<endl; ReadBase(table, ITabVersionRead); ReadCoeffInfoBlocks(table, ITabVersionRead); EndReadCoeff(table, ITabVersionRead); - debug["ReadCoeffBase::Read"]<<"Finished reading table."<<endl; + debug["Read"]<<"Finished reading table."<<endl; } //________________________________________________________________________________________________________________ // void fastNLOCoeffBase::ReadBase(istream& table, int ITabVersionRead){ - debug["ReadCoeffBase::ReadBase"]<<"Start reading base coefficient table ..."<<endl; + debug["ReadBase"]<<"Start reading base coefficient table ..."<<endl; fastNLOTools::ReadMagicNo(table); table >> IXsectUnits; table >> IDataFlag; @@ -46,16 +46,16 @@ void fastNLOCoeffBase::ReadBase(istream& table, int ITabVersionRead){ table >> NScaleDep; fastNLOTools::ReadFlexibleVector(CtrbDescript,table); fastNLOTools::ReadFlexibleVector(CodeDescript,table); - debug["ReadCoeffBase::ReadBase"]<<"Finished reading base coefficient table."<<endl; + debug["ReadBase"]<<"Finished reading base coefficient table."<<endl; } //________________________________________________________________________________________________________________ // void fastNLOCoeffBase::EndReadCoeff(istream& table, int ITabVersionRead){ - debug["fastNLOCoeffBase::EndReadCoeff"]<<"Should have reached end of coefficient table for table version "<<ITabVersionRead<<endl; + debug["EndReadCoeff"]<<"Should have reached end of coefficient table for table version "<<ITabVersionRead<<endl; fastNLOTools::ReadMagicNo(table); fastNLOTools::PutBackMagicNo(table); - debug["fastNLOCoeffBase::EndReadCoeff"]<<"Finished reading coefficient table for table version "<<ITabVersionRead<<endl; + debug["EndReadCoeff"]<<"Finished reading coefficient table for table version "<<ITabVersionRead<<endl; } @@ -126,30 +126,36 @@ bool fastNLOCoeffBase::IsCompatible(const fastNLOCoeffBase& other) const { //________________________________________________________________________________________________________________ // bool fastNLOCoeffBase::IsCatenable(const fastNLOCoeffBase& other) const { - if( IXsectUnits != other.GetIXsectUnits() ){ + if ( IXsectUnits != other.GetIXsectUnits() ){ debug["IsCatenable"]<<"IXsectUnits != other.GetIXsectUnits(). Skipped."<<endl; return false; } - if( IDataFlag != other.GetIDataFlag() ){ + if ( IDataFlag != other.GetIDataFlag() ){ debug["IsCatenable"]<<"IDataFlag != other.GetIDataFlag(). Skipped."<<endl; return false; } - if( IAddMultFlag != other.GetIAddMultFlag() ){ + if ( IAddMultFlag != other.GetIAddMultFlag() ){ debug["IsCatenable"]<<"IAddMultFlag != other.GetIAddMultFlag(). Skipped."<<endl; return false; } - if( IContrFlag1 != other.GetIContrFlag1() ){ + if ( IContrFlag1 != other.GetIContrFlag1() ){ debug["IsCatenable"]<<"IContrFlag1 != other.GetIContrFlag1(). Skipped."<<endl; return false; } - if( IContrFlag2 != other.GetIContrFlag2() ){ + if ( IContrFlag2 != other.GetIContrFlag2() ){ debug["IsCatenable"]<<"IContrFlag2 != other.GetIContrFlag2(). Skipped."<<endl; return false; } - if( NScaleDep != other.GetNScaleDep() ){ - debug["IsCatenable"]<<"NScaleDep != other.GetNScaleDep(). Skipped."<<endl; + if ( NScaleDep != other.GetNScaleDep() ){ return false; } + if ( ! (fVersionRead < 25000) ) { + if ( (HasCoeffInfoBlock(0,0) && ! other.HasCoeffInfoBlock(0,0)) || + (! HasCoeffInfoBlock(0,0) && other.HasCoeffInfoBlock(0,0)) ) { + debug["IsCatenable"]<<"Missing InfoBlock in either of the two tables. Skipped."<<endl; + return false; + } + } info["IsCatenable"]<<"Base parameters of contribution allow catenation"<<endl; // check descripts here ?! //bool potentialcompatible = true; @@ -200,25 +206,25 @@ void fastNLOCoeffBase::Print(int iprint) const { // Erase observable bin void fastNLOCoeffBase::EraseBin(unsigned int iObsIdx) { - debug["fastNLOCoeffBase::EraseBin"]<<"Erasing table entries in CoeffBase for bin index " << iObsIdx << endl; + debug["EraseBin"]<<"Erasing table entries in CoeffBase for bin index " << iObsIdx << endl; SetNObsBin(GetNObsBin()-1); } // Catenate observable bin void fastNLOCoeffBase::CatBin(const fastNLOCoeffBase& other, unsigned int iObsIdx) { - debug["fastNLOCoeffBase::CatBin"]<<"Catenating observable bin in CoeffBase corresponding to bin index " << iObsIdx << endl; + debug["CatBin"]<<"Catenating observable bin in CoeffBase corresponding to bin index " << iObsIdx << endl; SetNObsBin(GetNObsBin()+1); } // Multiply observable bin void fastNLOCoeffBase::MultiplyBin(unsigned int iObsIdx, double nfact) { - debug["fastNLOCoeffBase::MultiplyBin"]<<"Multiplying table entries. Nothing to be done in CoeffBase." << endl; + debug["MultiplyBin"]<<"Multiplying table entries. Nothing to be done in CoeffBase." << endl; } // //________________________________________________________________________________________________________________ // Added to include CoeffInfoBlocks -bool fastNLOCoeffBase::HasCoeffInfoBlock(int fICoeffInfoBlockFlag1) { +bool fastNLOCoeffBase::HasCoeffInfoBlock(int fICoeffInfoBlockFlag1) const { bool result = false; for (int i=0; i<NCoeffInfoBlocks; i++) { if ( ICoeffInfoBlockFlag1[i] == fICoeffInfoBlockFlag1 ) result = true; @@ -226,7 +232,7 @@ bool fastNLOCoeffBase::HasCoeffInfoBlock(int fICoeffInfoBlockFlag1) { return result; } -bool fastNLOCoeffBase::HasCoeffInfoBlock(int fICoeffInfoBlockFlag1, int fICoeffInfoBlockFlag2) { +bool fastNLOCoeffBase::HasCoeffInfoBlock(int fICoeffInfoBlockFlag1, int fICoeffInfoBlockFlag2) const { bool result = false; for (int i=0; i<NCoeffInfoBlocks; i++) { if ( ICoeffInfoBlockFlag1[i] == fICoeffInfoBlockFlag1 && ICoeffInfoBlockFlag2[i] == fICoeffInfoBlockFlag2 ) result = true; @@ -248,41 +254,56 @@ int fastNLOCoeffBase::GetCoeffInfoBlockIndex(int fICoeffInfoBlockFlag1, int fICo return -1; } +void fastNLOCoeffBase::AddCoeffInfoBlock(int fICoeffInfoBlockFlag1, int fICoeffInfoBlockFlag2, + std::vector<std::string> Description, std::string datfile) { + info["AddCoeffInfoBlocks"]<<"Adding additional InfoBlock with flags "<<fICoeffInfoBlockFlag1<<" and "<<fICoeffInfoBlockFlag2<<" to table contribution."<<endl; + NCoeffInfoBlocks += 1; + ICoeffInfoBlockFlag1.push_back(fICoeffInfoBlockFlag1); + ICoeffInfoBlockFlag2.push_back(fICoeffInfoBlockFlag2); + NCoeffInfoBlockDescr.push_back(Description.size()); + CoeffInfoBlockDescript.push_back(Description); + std::vector<double> Uncertainty = fastNLOTools::ReadInfoBlockContent(datfile); + CoeffInfoBlockContent.push_back(Uncertainty); +} + void fastNLOCoeffBase::ReadCoeffInfoBlocks(istream& table, int ITabVersionRead) { if (ITabVersionRead < 25000) { - debug["fastNLOCoeffBase::ReadCoeffInfoBlocks"]<<"No additional info blocks allowed for table versions < 25000"<<endl; + debug["ReadCoeffInfoBlocks"]<<"No additional info blocks allowed for table versions < 25000"<<endl; } else { table >> NCoeffInfoBlocks; - debug["fastNLOCoeffBase::ReadCoeffInfoBlocks"]<<"Found "<<NCoeffInfoBlocks<<" additional info blocks for coefficient table."<<endl; + debug["ReadCoeffInfoBlocks"]<<"Found "<<NCoeffInfoBlocks<<" additional info blocks for coefficient table."<<endl; for (int i=0; i<NCoeffInfoBlocks; i++) { int iflag; table >> iflag; ICoeffInfoBlockFlag1.push_back(iflag); if (ICoeffInfoBlockFlag1[i] == 0) { - debug["fastNLOCoeffBase::ReadCoeffInfoBlocks"]<<"Found info block of type ICoeffInfoBlockFlag1 = "<<ICoeffInfoBlockFlag1[i]<<endl; + debug["ReadCoeffInfoBlocks"]<<"Found info block of type ICoeffInfoBlockFlag1 = "<<ICoeffInfoBlockFlag1[i]<<endl; } else { - error["fastNLOCoeffBase::ReadCoeffInfoBlocks"]<<"Found info block of unknown type ICoeffInfoBlockFlag1 = "<<ICoeffInfoBlockFlag1[i]<<endl; + error["ReadCoeffInfoBlocks"]<<"Found info block of unknown type ICoeffInfoBlockFlag1 = "<<ICoeffInfoBlockFlag1[i]<<endl; exit(111); } table >> iflag; ICoeffInfoBlockFlag2.push_back(iflag); if (ICoeffInfoBlockFlag2[i] == 0) { - debug["fastNLOCoeffBase::ReadCoeffInfoBlocks"]<<"Found info block of type ICoeffInfoBlockFlag2 = "<<ICoeffInfoBlockFlag2[i]<<endl; + debug["ReadCoeffInfoBlocks"]<<"Found info block of type ICoeffInfoBlockFlag2 = "<<ICoeffInfoBlockFlag2[i]<<endl; } else { - error["fastNLOCoeffBase::ReadCoeffInfoBlocks"]<<"Found info block of unknown type ICoeffInfoBlockFlag2 = "<<ICoeffInfoBlockFlag2[i]<<endl; + error["ReadCoeffInfoBlocks"]<<"Found info block of unknown type ICoeffInfoBlockFlag2 = "<<ICoeffInfoBlockFlag2[i]<<endl; exit(222); } std::vector < std::string > Description; - fastNLOTools::ReadFlexibleVector(Description,table); + NCoeffInfoBlockDescr.push_back(fastNLOTools::ReadFlexibleVector(Description,table)-1); CoeffInfoBlockDescript.push_back(Description); + for (unsigned int j=0; j<Description.size(); j++) { + debug["ReadCoeffInfoBlocks"]<<"Read info block description line "<<j<<" : "<< Description[j] <<endl; + } if ( ICoeffInfoBlockFlag1[i] == 0 ) { // Entry per ObsBin std::vector < double > Content; - int nlines = fastNLOTools::ReadFlexibleVector(Content,table); - if ( nlines-1 != fNObsBins ) { - error["fastNLOCoeffBase::ReadCoeffInfoBlocks"]<<"Found info block of type ICoeffInfoBlockFlag1 = "<<ICoeffInfoBlockFlag1[i]<<" , but # of content lines = "<<nlines-1<<" differs from fNObsBins = "<<fNObsBins<<"! Aborted."<<endl; + NCoeffInfoBlockCont.push_back(fastNLOTools::ReadFlexibleVector(Content,table)); + if ( NCoeffInfoBlockCont[i]-1 != fNObsBins ) { + error["ReadCoeffInfoBlocks"]<<"Found info block of type ICoeffInfoBlockFlag1 = "<<ICoeffInfoBlockFlag1[i]<<" , but # of content lines = "<<NCoeffInfoBlockCont[i]-1<<" differs from fNObsBins = "<<fNObsBins<<"! Aborted."<<endl; exit(223); } else { - debug["fastNLOCoeffBase::ReadCoeffInfoBlocks"]<<"Read "<<nlines-1<<" lines into InfoBlock content vector."<<endl; + debug["ReadCoeffInfoBlocks"]<<"Read "<<NCoeffInfoBlockCont[i]-1<<" lines into InfoBlock content vector."<<endl; } CoeffInfoBlockContent.push_back(Content); } @@ -292,19 +313,39 @@ void fastNLOCoeffBase::ReadCoeffInfoBlocks(istream& table, int ITabVersionRead) void fastNLOCoeffBase::WriteCoeffInfoBlocks(ostream& table, int ITabVersionWrite) { if (ITabVersionWrite < 25000) { - debug["fastNLOCoeffBase::WriteCoeffInfoBlocks"]<<"No additional info blocks allowed for table versions < 25000"<<endl; + debug["WriteCoeffInfoBlocks"]<<"No additional InfoBlocks allowed for table versions < 25000"<<endl; } else { - // Test with zero InfoBlocks - debug["fastNLOCoeffBase::WriteCoeffInfoBlocks"]<<"Writing additional line "<<NCoeffInfoBlocks<<endl; + debug["WriteCoeffInfoBlocks"]<<"Writing additional InfoBlocks; NCoeffInfoBlocks = "<<NCoeffInfoBlocks<<endl; table << NCoeffInfoBlocks << sep; for (int i=0; i<NCoeffInfoBlocks; i++) { - table << ICoeffInfoBlockFlag1[i]; - table << ICoeffInfoBlockFlag2[i]; - table << NCoeffInfoBlockDescr[i]; - for (int j=0; j<NCoeffInfoBlockDescr[i];j++) { - table << CoeffInfoBlockDescript[i][j]; + debug["WriteCoeffInfoBlocks"]<<"ICoeffInfoBlockFlags1,2 = "<<ICoeffInfoBlockFlag1[i]<<", "<<ICoeffInfoBlockFlag1[i]<<endl; + table << ICoeffInfoBlockFlag1[i] << sep; + table << ICoeffInfoBlockFlag2[i] << sep; + table << NCoeffInfoBlockDescr[i] << sep; + for (int j=0; j<NCoeffInfoBlockDescr[i]; j++) { + debug["WriteCoeffInfoBlocks"]<<"CoeffInfoBlockDecsript[.][.] = "<<CoeffInfoBlockDescript[i][j]<<endl; + table << CoeffInfoBlockDescript[i][j] << sep; } int nlines = fastNLOTools::WriteFlexibleVector(CoeffInfoBlockContent[i],table); + debug["WriteCoeffInfoBlocks"]<<"Wrote "<<nlines-1<<" content lines to additional InfoBlock no. "<<i<<endl; } } } + +void fastNLOCoeffBase::SetContributionDescription(std::vector <std::string> CtrbDescr) { + debug["SetContributionDescription"]<<"Setting contribution description."<<endl; + size_t NCtrbDescript = CtrbDescr.size(); + fastNLOCoeffBase::CtrbDescript.resize(NCtrbDescript); + for (size_t i=0; i < NCtrbDescript; ++i) { + fastNLOCoeffBase::CtrbDescript[i] = CtrbDescr[i]; + } +} + +void fastNLOCoeffBase::SetCodeDescription(std::vector <std::string> CodeDescr) { + debug["SetCodeDescription"]<<"Setting code description."<<endl; + size_t NCodeDescript = CodeDescr.size(); + fastNLOCoeffBase::CodeDescript.resize(NCodeDescript); + for (size_t i=0; i < NCodeDescript; ++i) { + fastNLOCoeffBase::CodeDescript[i] = CodeDescr[i]; + } +} diff --git a/v2.3/toolkit/fastnlotoolkit/fastNLOReader.cc b/v2.3/toolkit/fastnlotoolkit/fastNLOReader.cc index 20b2cc33b2980173d4f7b83e94c9f76e4c8b19d3..ba1e7aa6a3d922bf6ffdfe3b73d9cc6840880b01 100644 --- a/v2.3/toolkit/fastnlotoolkit/fastNLOReader.cc +++ b/v2.3/toolkit/fastnlotoolkit/fastNLOReader.cc @@ -1399,6 +1399,13 @@ void fastNLOReader::CalcCrossSection() { for (unsigned int i=0; i<NObsBin; i++) { QScale[i] = QScale[i]/XSection[i]; } + + // ---- Square root for statistical uncertainty combinaton ---- // + logger.debug["CalcCrossSection"]<<"Calculate stat. uncertainty from quadratic addition: sqrt(dXS)"<<endl; + for (unsigned int i=0; i<NObsBin; i++) { + dXSection[i] = sqrt(dXSection[i]); + } + logger.debug["CalcCrossSection"]<<"... leaving CalcCrossSection."<<endl; } @@ -1506,13 +1513,15 @@ void fastNLOReader::CalcCrossSectionv21(fastNLOCoeffAddFlex* c) { int xUnits = c->GetIXsectUnits(); logger.debug["CalcCrossSectionv21"]<<"Ipublunits = " << Ipublunits << ", xUnits = " << xUnits << endl; - // Check whether CoeffInfoBlock for relative stat. uncertainties (0,0) exists - logger.debug["CalcCrossSectionv21"]<<"Checking on presence of statistical uncertainties ..."<<endl; + // Check whether CoeffInfoBlock for relative statistical/numerical uncertainties (0,0) exists + logger.debug["CalcCrossSectionv21"]<<"Checking on presence of statistical/numerical uncertainties ..."<<endl; int iCIBIndex = c->GetCoeffInfoBlockIndex(0,0); std::vector < double > dCIBCont; if ( iCIBIndex > -1 ) { - logger.debug["CalcCrossSectionv21"]<<"Found CoeffInfoBlock "<<iCIBIndex<<" with statistical uncertainties."<<endl; + logger.debug["CalcCrossSectionv21"]<<"Found CoeffInfoBlock "<<iCIBIndex<<" with statistical/numerical uncertainties."<<endl; dCIBCont = c->GetCoeffInfoContent(iCIBIndex); + } else { + logger.info["CalcCrossSectionv21"]<<"No CoeffInfoBlock found; uncertainties are initialised to zero."<<endl; } for (unsigned int i=0; i<NObsBin; i++) { @@ -1566,7 +1575,10 @@ void fastNLOReader::CalcCrossSectionv21(fastNLOCoeffAddFlex* c) { if ( dCIBCont.empty() ) { dXS->at(i) += 0.; } else { - dXS->at(i) += fabs(XStmp)*dCIBCont[i]; // XStmp may be negative, but dCIBCont as statistical uncertainty should not! + // Quadratical addition of independent statistical uncertainties + dXS->at(i) += XStmp*XStmp*dCIBCont[i]*dCIBCont[i]; + // Linear absolut addition of uncertainties (useful?) + // dXS->at(i) += fabs(XStmp)*dCIBCont[i]; } } logger.debug["CalcCrossSectionv21"]<<"... leaving CalcCrossSectionv21."<<endl; @@ -1608,13 +1620,15 @@ void fastNLOReader::CalcCrossSectionv20(fastNLOCoeffAddFix* c) { int xUnits = c->GetIXsectUnits(); logger.debug["CalcCrossSectionv20"]<<"Ipublunits = " << Ipublunits << ", xUnits = " << xUnits << endl; - // Check whether CoeffInfoBlock for relative stat. uncertainties (0,0) exists - logger.debug["CalcCrossSectionv20"]<<"Checking on presence of statistical uncertainties ..."<<endl; + // Check whether CoeffInfoBlock for relative statistical/numerical uncertainties (0,0) exists + logger.debug["CalcCrossSectionv20"]<<"Checking on presence of statistical/numerical uncertainties ..."<<endl; int iCIBIndex = c->GetCoeffInfoBlockIndex(0,0); std::vector < double > dCIBCont; if ( iCIBIndex > -1 ) { - logger.debug["CalcCrossSectionv20"]<<"Found CoeffInfoBlock "<<iCIBIndex<<" with statistical uncertainties."<<endl; + logger.debug["CalcCrossSectionv20"]<<"Found CoeffInfoBlock "<<iCIBIndex<<" with statistical/numerical uncertainties."<<endl; dCIBCont = c->GetCoeffInfoContent(iCIBIndex); + } else { + logger.info["CalcCrossSectionv20"]<<"No CoeffInfoBlock found; uncertainties are initialised to zero."<<endl; } int scaleVar = c->GetNpow() == ILOord ? 0 : fScalevar; @@ -1642,7 +1656,10 @@ void fastNLOReader::CalcCrossSectionv20(fastNLOCoeffAddFix* c) { if ( dCIBCont.empty() ) { dXS->at(i) += 0.; } else { - dXS->at(i) += fabs(XStmp)*dCIBCont[i]; // XStmp may be negative, but dCIBCont as statistical uncertainty should not! + // Quadratical addition of independent statistical uncertainties + dXS->at(i) += XStmp*XStmp*dCIBCont[i]*dCIBCont[i]; + // Linear absolut addition of uncertainties (useful?) + // dXS->at(i) += fabs(XStmp)*dCIBCont[i]; } } logger.debug["CalcCrossSectionv20"]<<"... leaving CalcCrossSectionv20."<<endl; diff --git a/v2.3/toolkit/fastnlotoolkit/fastNLOTable.cc b/v2.3/toolkit/fastnlotoolkit/fastNLOTable.cc index 4938559126f41f8291ba5e7ee8fa15c55cc8b7c3..0dc9e7edd241624916d0b56b2cbd1aec903a2e96 100644 --- a/v2.3/toolkit/fastnlotoolkit/fastNLOTable.cc +++ b/v2.3/toolkit/fastnlotoolkit/fastNLOTable.cc @@ -1758,10 +1758,6 @@ string fastNLOTable::GetXSDescr() const { return "Undefined"; } -vector <string> fastNLOTable::GetScDescr() const { - return ScDescript; -} - void fastNLOTable::SetScDescr(std::vector <std::string> ScDescr) { size_t NScDescript = ScDescr.size(); fastNLOTable::ScDescript.resize(NScDescript); @@ -2210,11 +2206,11 @@ void fastNLOTable::EraseBinFromTable(unsigned int iObsIdx) { } else if ( fastNLOCoeffAddFix::CheckCoeffConstants(ctmp,quiet) ) { logger.info["EraseBinFromTable"]<<"Found additive fix-table contribution. Now erasing index no. " << iObsIdx << endl; fastNLOCoeffAddFix* cfix = (fastNLOCoeffAddFix*)fCoeff[ic]; - cfix->EraseBin(iObsIdx); + cfix->EraseBin(iObsIdx,ITabVersionRead); } else if ( fastNLOCoeffAddFlex::CheckCoeffConstants(ctmp,quiet) ) { logger.info["EraseBinFromTable"]<<"Found additive flex-table contribution. Now erasing index no. " << iObsIdx << endl; fastNLOCoeffAddFlex* cflex = (fastNLOCoeffAddFlex*)fCoeff[ic]; - cflex->EraseBin(iObsIdx); + cflex->EraseBin(iObsIdx,ITabVersionRead); } else { logger.error["EraseBinFromTable"]<<"Could not identify contribution. Print and abort!" << endl; ctmp->Print(-1); @@ -2301,7 +2297,7 @@ void fastNLOTable::CatBinToTable(const fastNLOTable& other, unsigned int iObsIdx fastNLOCoeffAddFix* crhs = (fastNLOCoeffAddFix*)other.GetCoeffTable(ic); if ( clhs->IsCatenable(*crhs) ) { logger.info["CatBinToTable"]<<"Found fix-scale additive contribution. Now catenating index no. " << iObsIdx << endl; - clhs->CatBin(*crhs,iObsIdx); + clhs->CatBin(*crhs,iObsIdx,ITabVersionRead); continue; } } @@ -2310,7 +2306,7 @@ void fastNLOTable::CatBinToTable(const fastNLOTable& other, unsigned int iObsIdx fastNLOCoeffAddFlex* crhs = (fastNLOCoeffAddFlex*)other.GetCoeffTable(ic); if ( clhs->IsCatenable(*crhs) ) { logger.info["CatBinToTable"]<<"Found flex-scale additive contribution. Now catenating index no. " << iObsIdx << endl; - clhs->CatBin(*crhs,iObsIdx); + clhs->CatBin(*crhs,iObsIdx,ITabVersionRead); continue; } } diff --git a/v2.3/toolkit/fastnlotoolkit/fastNLOTools.cc b/v2.3/toolkit/fastnlotoolkit/fastNLOTools.cc index 017218464323d1550b9ee9ae23a77b6f7fb5ad5a..667b74f7854cc327bca7c494bad56c51f6f841c4 100644 --- a/v2.3/toolkit/fastnlotoolkit/fastNLOTools.cc +++ b/v2.3/toolkit/fastnlotoolkit/fastNLOTools.cc @@ -1,7 +1,10 @@ +#include <cfloat> #include <cstdlib> -#include <string> +#include <fstream> #include <iostream> #include <cmath> +#include <sstream> +#include <string> #include "fastnlotk/fastNLOTools.h" using namespace std; @@ -388,5 +391,44 @@ namespace fastNLOTools { return true; } + //______________________________________________________________________________ + std::vector <double> ReadInfoBlockContent(std::string filename) { + std::ifstream infile; + std::string line; + std::vector <double> Uncertainty; + info["ReadInfoBlockContent"]<<"Reading additional InfoBlock content from file: " << filename <<endl; + infile.open(filename); + if (infile.is_open()) { + int iline = 0; + // Read line-by-line + while(std::getline(infile, line)) { + // Put line into stringstream and read word-by-word + std::istringstream iss(line); + std::string word; + iss >> word; + // For now assume NNLOJET dat file format: + // - Skip all lines starting with comment symbol '#' + // - Read cross section and absolute statistical uncertainty from 4th and 5th columns + if ( word.at(0) != '#' ) { + // Skip first three words of each line + iss >> word; + iss >> word; + double xs, dxs; + iss >> xs; + iss >> dxs; + if ( fabs(xs) > DBL_MIN ) { + Uncertainty.push_back(dxs/xs); + } else { + Uncertainty.push_back(0.); + } + iline += 1; + } + } + } else { + error["ReadInfoBlockContent"]<<"Cannot read InfoBlock content, aborted! Filename is: " << filename <<endl; + exit(33); + } + return Uncertainty; + } } // end namespace fastNLO diff --git a/v2.3/toolkit/fastnlotoolkit/include/fastnlotk/fastNLOCoeffAddBase.h b/v2.3/toolkit/fastnlotoolkit/include/fastnlotk/fastNLOCoeffAddBase.h index cb9033caaf784539b75419e1849a14b903dcd9e5..63543b94630ec045e8901462f217bbdabbce02c0 100644 --- a/v2.3/toolkit/fastnlotoolkit/include/fastnlotk/fastNLOCoeffAddBase.h +++ b/v2.3/toolkit/fastnlotoolkit/include/fastnlotk/fastNLOCoeffAddBase.h @@ -119,8 +119,8 @@ public: virtual void MultiplyCoefficientsByConstant(double fact) {};//!< Multiply all coefficients of all bins by a constant factor virtual void MultiplyBin(unsigned int iObsIdx, double fact) {}; //!< Multiply coefficients of one observable bin a factor virtual void MultiplyBinProc(unsigned int iObsIdx, unsigned int iProc, double fact) {}; //!< Multiply coefficients of one observable bin a factor (idx starting from 0) - virtual void EraseBin(unsigned int iObsIdx);//!< Erase observable bin from table - virtual void CatBin(const fastNLOCoeffAddBase& other, unsigned int iObsIdx); //!< Catenate observable to table + virtual void EraseBin(unsigned int iObsIdx, int ITabVersionRead);//!< Erase observable bin from table + virtual void CatBin(const fastNLOCoeffAddBase& other, unsigned int iObsIdx, int ITabVersionRead); //!< Catenate observable to table int GetIRef() const {return IRef;} void SetIRef(int iref=1) {IRef=iref;} diff --git a/v2.3/toolkit/fastnlotoolkit/include/fastnlotk/fastNLOCoeffAddFix.h b/v2.3/toolkit/fastnlotoolkit/include/fastnlotk/fastNLOCoeffAddFix.h index 282bf0681a3b4ee1b2c50bcc3c986b79ac0c05e7..19b8e8844b1e6688efdf40d60a2ced1dad5b720b 100644 --- a/v2.3/toolkit/fastnlotoolkit/include/fastnlotk/fastNLOCoeffAddFix.h +++ b/v2.3/toolkit/fastnlotoolkit/include/fastnlotk/fastNLOCoeffAddFix.h @@ -32,9 +32,9 @@ public: virtual void MultiplyBin(unsigned int iObsIdx, double fact); //!< Multiply coefficients of one bin a factor virtual void MultiplyBinProc(unsigned int iObsIdx, unsigned int iProc, double fact); //!< Multiply coefficients of one bin and subprocess by a factor // Erase observable bin from table - virtual void EraseBin(unsigned int iObsIdx); + virtual void EraseBin(unsigned int iObsIdx, int ITabVersionRead); // Catenate observable to table - virtual void CatBin(const fastNLOCoeffAddFix& other, unsigned int iObsIdx); + virtual void CatBin(const fastNLOCoeffAddFix& other, unsigned int iObsIdx, int ITabVersionRead); int GetTotalScalevars() const ; int GetTotalScalenodes() const ; diff --git a/v2.3/toolkit/fastnlotoolkit/include/fastnlotk/fastNLOCoeffAddFlex.h b/v2.3/toolkit/fastnlotoolkit/include/fastnlotk/fastNLOCoeffAddFlex.h index e55b4b563e5c26d735b4455eb31a7d31def1a2af..51f8cd6c669b78347f070eb173ef6fc3da529116 100644 --- a/v2.3/toolkit/fastnlotoolkit/include/fastnlotk/fastNLOCoeffAddFlex.h +++ b/v2.3/toolkit/fastnlotoolkit/include/fastnlotk/fastNLOCoeffAddFlex.h @@ -31,8 +31,8 @@ public: virtual void MultiplyCoefficientsByConstant(double fact); //!< Multiply all coefficients of all bins by a constant factor virtual void MultiplyBin(unsigned int iObsIdx, double fact); //!< Multiply coefficients of one bin a factor (iObsIdx starting with index 0) virtual void MultiplyBinProc(unsigned int iObsIdx, unsigned int iProc, double fact); //!< Multiply coefficients of one bin and subprocess a factor - virtual void EraseBin(unsigned int iObsIdx); //!< Erase observable bin from table - virtual void CatBin(const fastNLOCoeffAddFlex& other, unsigned int iObsIdx); //!< Catenate observable to table + virtual void EraseBin(unsigned int iObsIdx, int ITabVersionRead); //!< Erase observable bin from table + virtual void CatBin(const fastNLOCoeffAddFlex& other, unsigned int iObsIdx, int ITabVersionRead); //!< Catenate observable to table unsigned int GetNScaleNode1(int iObsBin) const { return ScaleNode1[iObsBin].size(); }; unsigned int GetNScaleNode2(int iObsBin) const { return ScaleNode2[iObsBin].size(); }; diff --git a/v2.3/toolkit/fastnlotoolkit/include/fastnlotk/fastNLOCoeffBase.h b/v2.3/toolkit/fastnlotoolkit/include/fastnlotk/fastNLOCoeffBase.h index 91f9e718ead028ee6ba8218f3d268f0abf93f282..9ac3f2490f9996d00c36d57f005ac7b63e4eb764 100644 --- a/v2.3/toolkit/fastnlotoolkit/include/fastnlotk/fastNLOCoeffBase.h +++ b/v2.3/toolkit/fastnlotoolkit/include/fastnlotk/fastNLOCoeffBase.h @@ -38,6 +38,10 @@ public: void SetCoeffAddDefaults(); + /// ___________________________________________________________________________________________________ + /// Some info getters & setters for contribution modifications + /// ___________________________________________________________________________________________________ + int GetIDataFlag() const {return IDataFlag;} void SetIDataFlag(int n){IDataFlag = n;} @@ -61,9 +65,11 @@ public: bool GetIsFlexibleScale() const { return (NScaleDep>=3) && (IAddMultFlag==0); } + /// get/set contribution and code description std::vector<std::string > GetContributionDescription() const { return CtrbDescript; } - void SetContributionDescription(std::vector<std::string > descr ) { CtrbDescript = descr; }; //! Set contribution description + void SetContributionDescription(std::vector<std::string > descr ); std::vector<std::string > GetCodeDescription() const { return CodeDescript; } + void SetCodeDescription(std::vector<std::string > descr ); bool IsLO() const {return IContrFlag1==1 && IContrFlag2==1;} bool IsNLO() const {return IContrFlag1==1 && IContrFlag2==2;} @@ -75,12 +81,13 @@ public: // Added to include CoeffInfoBlocks bool HasCoeffInfoBlock() const {return NCoeffInfoBlocks>0;} - bool HasCoeffInfoBlock(int ICoeffInfoBlockFlag1); - bool HasCoeffInfoBlock(int ICoeffInfoBlockFlag1, int ICoeffInfoBlockFlag2); + bool HasCoeffInfoBlock(int ICoeffInfoBlockFlag1) const; + bool HasCoeffInfoBlock(int ICoeffInfoBlockFlag1, int ICoeffInfoBlockFlag2) const; int GetCoeffInfoBlockIndex(int ICoeffInfoBlockFlag1); int GetCoeffInfoBlockIndex(int ICoeffInfoBlockFlag1, int ICoeffInfoBlockFlag2); std::vector < double > GetCoeffInfoContent(int Index) const { return CoeffInfoBlockContent[Index]; }; int GetNCoeffInfoBlocks() const {return NCoeffInfoBlocks;} + void AddCoeffInfoBlock(int ICoeffInfoBlockFlag1, int ICoeffInfoBlockFlag2, std::vector<std::string> Description, std::string datfile); protected: void ReadBase(std::istream& table, int ITabVersionRead); @@ -108,6 +115,7 @@ protected: std::vector < int > ICoeffInfoBlockFlag2; std::vector < int > NCoeffInfoBlockDescr; std::vector < std::vector < std::string > > CoeffInfoBlockDescript; + std::vector < int > NCoeffInfoBlockCont; fastNLO::v2d CoeffInfoBlockContent; }; diff --git a/v2.3/toolkit/fastnlotoolkit/include/fastnlotk/fastNLOTable.h b/v2.3/toolkit/fastnlotoolkit/include/fastnlotk/fastNLOTable.h index 799320f38a2284b7c294001b3097ae484c7a9450..bde76acde18a6c213c738605de8ca079d59488cc 100644 --- a/v2.3/toolkit/fastnlotoolkit/include/fastnlotk/fastNLOTable.h +++ b/v2.3/toolkit/fastnlotoolkit/include/fastnlotk/fastNLOTable.h @@ -158,7 +158,7 @@ class fastNLOTable { /// ___________________________________________________________________________________________________ /// get/set scenario description - std::vector <std::string> GetScDescr() const; + std::vector <std::string> GetScDescr() const { return ScDescript; } void SetScDescr(std::vector <std::string> ScDescr); /// get/set cross section units of published results (pb = 12, fb = 15, ...) diff --git a/v2.3/toolkit/fastnlotoolkit/include/fastnlotk/fastNLOTools.h b/v2.3/toolkit/fastnlotoolkit/include/fastnlotk/fastNLOTools.h index 99461c2ca0254cfc894b3471cdb5b1a1e5fe033a..39e528fd0117ba048e848709c3865f29a66c57dc 100644 --- a/v2.3/toolkit/fastnlotoolkit/include/fastnlotk/fastNLOTools.h +++ b/v2.3/toolkit/fastnlotoolkit/include/fastnlotk/fastNLOTools.h @@ -80,6 +80,8 @@ 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 + std::vector <double> ReadInfoBlockContent(std::string filename); + }; diff --git a/v2.3/toolkit/fastnlotoolkit/include/fastnlotk/speaker.h b/v2.3/toolkit/fastnlotoolkit/include/fastnlotk/speaker.h index 8671927ddb6ec66eb84ffaf0101523da036981cc..7fdea3a7b57f1c9587a39605ab45ea6a7b6c7609 100644 --- a/v2.3/toolkit/fastnlotoolkit/include/fastnlotk/speaker.h +++ b/v2.3/toolkit/fastnlotoolkit/include/fastnlotk/speaker.h @@ -10,6 +10,22 @@ namespace say { enum Verbosity {DEBUG=-1000, MANUAL=2, INFO=0, WARNING=1, ERROR=2, SILENT=1000}; + + // String to enum + struct toVerbosity : public std::map<std::string, Verbosity> + { + toVerbosity() + { + this->operator[]("DEBUG") = DEBUG; + this->operator[]("MANUAL") = MANUAL; + this->operator[]("INFO") = INFO; + this->operator[]("WARNING") = WARNING; + this->operator[]("ERROR") = ERROR; + this->operator[]("SILENT") = SILENT; + }; + ~toVerbosity(){} + }; + } class speaker { @@ -17,7 +33,6 @@ public: speaker(std::string prefix="",say::Verbosity volume=say::INFO,bool err=false,bool quiet=false); speaker(const speaker& spk); ~speaker(); - //speaker(const speaker& spk) : weg(0) {;}; const speaker& operator= (const speaker& other); std::ostream& operator[](const std::string& fct) const ; const speaker& operator+ (const std::string& fct) const { @@ -67,7 +82,6 @@ public: }; protected: - //std::ostream weg; static std::ostream* weg; bool fquiet; std::string pref; @@ -83,7 +97,7 @@ protected: namespace say { extern speaker debug; - extern speaker man; // + extern speaker man; extern speaker info; extern speaker warn; extern speaker error; @@ -95,7 +109,7 @@ namespace say { class PrimalScream { public: - PrimalScream(std::string classname);//,std::string prefix=""); + PrimalScream(std::string classname); void SetClassName(const std::string classname ); void SetVerbosity(say::Verbosity volume); speaker debug; diff --git a/v2.3/toolkit/src/fnlo-tk-append.cc b/v2.3/toolkit/src/fnlo-tk-append.cc index fa86db5d1e91f27f671ca1b014b6e6637f8751f3..9b000430f79c0e7b37fd500829b8aa2fe90e9b69 100644 --- a/v2.3/toolkit/src/fnlo-tk-append.cc +++ b/v2.3/toolkit/src/fnlo-tk-append.cc @@ -28,7 +28,7 @@ int main(int argc, char** argv) { using namespace say; //! namespace for 'speaker.h'-verbosity levels using namespace fastNLO; //! namespace for fastNLO constants - //! --- Set verbosity level + //! --- Set initial verbosity level SetGlobalVerbosity(INFO); //! --- Print program purpose diff --git a/v2.3/toolkit/src/fnlo-tk-cat.cc b/v2.3/toolkit/src/fnlo-tk-cat.cc index 514069c3c8179fac39d9f875b81efb42970c868f..4216af821898c23b5e8022b6cc6c3152ac2d778c 100644 --- a/v2.3/toolkit/src/fnlo-tk-cat.cc +++ b/v2.3/toolkit/src/fnlo-tk-cat.cc @@ -26,7 +26,7 @@ int main(int argc, char** argv) { using namespace say; //! namespace for 'speaker.h'-verbosity levels using namespace fastNLO; //! namespace for fastNLO constants - //! --- Set verbosity level + //! --- Set initial verbosity level SetGlobalVerbosity(INFO); //! --- Print program purpose diff --git a/v2.3/toolkit/src/fnlo-tk-cppread.cc b/v2.3/toolkit/src/fnlo-tk-cppread.cc index b0ad40e20c89aab27c5f541d5607387473ac10fc..a7fd626b02a7c17c97cb27a8432ce4b16734dc12 100644 --- a/v2.3/toolkit/src/fnlo-tk-cppread.cc +++ b/v2.3/toolkit/src/fnlo-tk-cppread.cc @@ -55,10 +55,10 @@ int main(int argc, char** argv) { using namespace say; //! namespace for 'speaker.h'-verbosity levels using namespace fastNLO; //! namespace for fastNLO constants - //! --- Set verbosity level + //! --- Set initial verbosity level SetGlobalVerbosity(INFO); - //! --- Parse command line + //! --- Parse command line char buffer[1024]; // TODO: Use PATH_MAX instead? string tablename; if (argc <= 1) { @@ -228,8 +228,7 @@ int main(int argc, char** argv) { } if (argc <= 4 || AsEvolCode == "_") { AsEvolCode = "GRV"; - shout["fnlo-tk-cppread"] << "No request given for alpha_s evolution code," << endl; - shout << " using GRV default." << endl; + shout["fnlo-tk-cppread"] << "No request given for alpha_s evolution code, using GRV default." << endl; } else { shout["fnlo-tk-cppread"] << "Using alpha_s evolution code: " << AsEvolCode << endl; } @@ -251,7 +250,7 @@ int main(int argc, char** argv) { chflex = (const char*) argv[6]; } if (argc <= 6 || chflex == "_") { - chflex = "scale1"; + chflex = "kScale1"; shout["fnlo-tk-cppread"] << "Using default mur=muf=scale 1." << endl; } else { shout["fnlo-tk-cppread"] << "Using scale definition "+chflex << endl; @@ -264,7 +263,7 @@ int main(int argc, char** argv) { } if (argc <= 7 || chtmp == "_") { shout["fnlo-tk-cppread"] << "No request given for no. of flavours," << endl; - shout << " using default value for LHAPDF or Nf = " << Nf << "." << endl; + shout << " using default value for LHAPDF or Nf = " << Nf << "." << endl; } else { Nf = atoi(argv[7]); if ( AsEvolCode == "LHAPDF" ) { @@ -287,7 +286,7 @@ int main(int argc, char** argv) { } if (argc <= 8 || chtmp == "_") { shout["fnlo-tk-cppread"] << "No request given for no. of loops," << endl; - shout << " using default value for LHAPDF or NLoop = " << NLoop << "." << endl; + shout << " using default value for LHAPDF or NLoop = " << NLoop << "." << endl; } else { NLoop = atoi(argv[8]); if ( AsEvolCode == "LHAPDF" ) { @@ -310,7 +309,7 @@ int main(int argc, char** argv) { } if (argc <= 9 || chtmp == "_") { shout["fnlo-tk-cppread"] << "No request given for value of alpha_s(M_Z)," << endl; - shout << " using default value for LHAPDF or asMz = " << asMz << "." << endl; + shout << " using default value for LHAPDF or asMz = " << asMz << "." << endl; } else { asMz = atof(argv[9]); if ( AsEvolCode == "LHAPDF" ) { @@ -333,7 +332,7 @@ int main(int argc, char** argv) { } if (argc <= 10 || chtmp == "_") { shout["fnlo-tk-cppread"] << "No request given for value of M_Z," << endl; - shout << " using default value for LHAPDF or Mz = " << Mz << "." << endl; + shout << " using default value for LHAPDF or Mz = " << Mz << "." << endl; } else { Mz = atof(argv[10]); if ( AsEvolCode == "LHAPDF" ) { @@ -356,8 +355,7 @@ int main(int argc, char** argv) { } if (argc <= 11 || VerbosityLevel == "_") { VerbosityLevel = "WARNING"; - shout["fnlo-tk-cppread"] << "No request given for verbosity level," << endl; - shout << " using WARNING default." << endl; + shout["fnlo-tk-cppread"] << "No request given for verbosity level, using WARNING default." << endl; } else { shout["fnlo-tk-cppread"] << "Using verbosity level: " << VerbosityLevel << endl; } @@ -370,17 +368,8 @@ int main(int argc, char** argv) { yell << _CSEPSC << endl; //--- End of parsing arguments - //! --- Reset verbosity level to warning only from here on - // TODO: KR: A string to enum map or similar could come in handy here - if ( VerbosityLevel == "DEBUG" ) { - SetGlobalVerbosity(DEBUG); - } else if ( VerbosityLevel == "INFO" ) { - SetGlobalVerbosity(INFO); - } else if ( VerbosityLevel == "ERROR" ) { - SetGlobalVerbosity(ERROR); - } else { - SetGlobalVerbosity(WARNING); - } + //! --- Reset verbosity level from here on + SetGlobalVerbosity(toVerbosity()[VerbosityLevel]); // ************************** fastNLO and example documentation starts here **************************** // --- fastNLO user: Hello! diff --git a/v2.3/toolkit/src/fnlo-tk-example.cc b/v2.3/toolkit/src/fnlo-tk-example.cc index 8ccb78f5459ec2e683ee6cddddd0b1fde1baedef..dd37b9eb1452b879f5a7feb764b2559ae4c303a7 100644 --- a/v2.3/toolkit/src/fnlo-tk-example.cc +++ b/v2.3/toolkit/src/fnlo-tk-example.cc @@ -42,7 +42,7 @@ int main(int argc, char** argv) { using namespace say; //! namespace for 'speaker.h'-verbosity levels using namespace fastNLO; //! namespace for fastNLO constants - //! --- Set verbosity level + //! --- Set initial verbosity level SetGlobalVerbosity(INFO); //! --- Print program purpose diff --git a/v2.3/toolkit/src/fnlo-tk-merge.cc b/v2.3/toolkit/src/fnlo-tk-merge.cc index 45466ccada77d1b8dd5c160839f29735de14b0ca..13104ab4eaef61b10207d7a8f6e89733e97b9dc4 100644 --- a/v2.3/toolkit/src/fnlo-tk-merge.cc +++ b/v2.3/toolkit/src/fnlo-tk-merge.cc @@ -29,7 +29,7 @@ int main(int argc, char** argv) { using namespace say; //! namespace for 'speaker.h'-verbosity levels using namespace fastNLO; //! namespace for fastNLO constants - //! --- Set verbosity level + //! --- Set initial verbosity level SetGlobalVerbosity(INFO); //! --- Print program purpose diff --git a/v2.3/toolkit/src/fnlo-tk-merge2.cc b/v2.3/toolkit/src/fnlo-tk-merge2.cc index fcf87011fbca5757354db069686dee1b82b63deb..b0e54786bd2b5e54475143f5cd5f7e78a2b29a8b 100644 --- a/v2.3/toolkit/src/fnlo-tk-merge2.cc +++ b/v2.3/toolkit/src/fnlo-tk-merge2.cc @@ -108,7 +108,7 @@ int main(int argc, char** argv) { using namespace say; //! namespace for 'speaker.h'-verbosity levels using namespace fastNLO; //! namespace for fastNLO constants - //! --- Set verbosity level + //! --- Set initial verbosity level SetGlobalVerbosity(INFO); //! --- Print program purpose diff --git a/v2.3/toolkit/src/fnlo-tk-modify.cc b/v2.3/toolkit/src/fnlo-tk-modify.cc index ae19d1ab645d87e39e55bee2b4ad5b04fbf9f0ef..19699965b45ba4de66c15f569f4cfaf0673e0577 100644 --- a/v2.3/toolkit/src/fnlo-tk-modify.cc +++ b/v2.3/toolkit/src/fnlo-tk-modify.cc @@ -15,6 +15,7 @@ #include <iostream> #include <vector> #include "fastnlotk/fastNLOTable.h" +#include "fastnlotk/fastNLOTools.h" #include "fastnlotk/read_steer.h" #include "fastnlotk/speaker.h" @@ -26,46 +27,57 @@ int main(int argc, char** argv) { using namespace say; //! namespace for 'speaker.h'-verbosity levels using namespace fastNLO; //! namespace for fastNLO constants - //! --- Set verbosity level + //! --- Set initial verbosity level SetGlobalVerbosity(INFO); - //! --- Print program purpose - yell << _CSEPSC << endl; - info["fnlo-tk-modify"] << "Tool to manipulate a fastNLO table" << endl; - yell << _SSEPSC << endl; - info["fnlo-tk-modify"] << "For more explanations type:" << endl; - info["fnlo-tk-modify"] << "./fnlo-tk-modify -h" << endl; - info["fnlo-tk-modify"] << "and consult the provided default steering file 'SteerModify.str'." << endl; - yell << _CSEPSC << endl; - - //! --- Parse commmand line - yell << "" << endl; - yell << _CSEPSC << endl; - shout["fnlo-tk-modify"] << "fastNLO Table Manipulator"<<endl; - yell << _SSEPSC << endl; - //! Test for default steering file "SteerModify.str" - string steername = "SteerModify.str"; + //! --- Parse command line + string steername = "SteerModify.str"; //! Default steering file "SteerModify.str" + string intable; + string outtable; + string testname; if (argc <= 1) { - ifstream ffile; - ffile.open(steername.c_str()); - if (!ffile) { - error["fnlo-tk-modify"] << "Neither mandatory parameters specified in command line " << endl; - error["fnlo-tk-modify"] << "nor default steering file 'SteerModify.str' found. Aborted!" << endl; - shout["fnlo-tk-modify"] << "For more explanations type:" << endl; - shout["fnlo-tk-modify"] << "./fnlo-tk-modify -h" << endl; - yell << _CSEPSC << endl; - exit(1); - } + yell << "" << endl; + yell << _CSEPSC << endl; + shout["fnlo-tk-modify"] << "fastNLO Table Manipulator" << endl; + yell << _SSEPSC << endl; + shout["fnlo-tk-modify"] << "Since no argument is given, all settings must be provided via" << endl; + shout["fnlo-tk-modify"] << " the default steering file 'SteerModify.str'," << endl; + shout["fnlo-tk-modify"] << " which can be consulted for further information as well." << endl; + shout["fnlo-tk-modify"] << "For more explanations type:" << endl; + shout["fnlo-tk-modify"] << "./fnlo-tk-modify -h" << endl; + shout["fnlo-tk-modify"] << "For version number printout type:" << endl; + shout["fnlo-tk-modify"] << "./fnlo-tk-modify -v" << endl; + yell << _CSEPSC << endl; } else { - steername = (const char*) argv[1]; + testname = (const char*) argv[1]; + if (testname == "-v") { + fastNLOTools::PrintFastnloVersion(); + return 0; + } + //! --- Print program purpose + yell << _CSEPSC << endl; + shout["fnlo-tk-modify"] << "Tool to manipulate a fastNLO table" << endl; + yell << _SSEPSC << endl; + shout["fnlo-tk-modify"] << "For more explanations type:" << endl; + shout["fnlo-tk-modify"] << "./fnlo-tk-modify -h" << endl; + shout["fnlo-tk-modify"] << "and consult the default steering file 'SteerModify.str'." << endl; + shout["fnlo-tk-modify"] << "For version number printout type:" << endl; + shout["fnlo-tk-modify"] << "./fnlo-tk-modify -v" << endl; + yell << _CSEPSC << endl; + yell << "" << endl; //! --- Usage info - if (steername == "-h") { + if (testname == "-h") { + yell << _CSEPSC << endl; + shout["fnlo-tk-modify"] << "fastNLO Table Manipulator" << endl; + yell << _SSEPSC << endl; yell << " #" << endl; info["fnlo-tk-modify"] << "The purpose of this tool is to allow the user to perform a number of" << endl; info["fnlo-tk-modify"] << "modifications on a fastNLO table, e.g. the adaptation of the scenario description." << endl; info["fnlo-tk-modify"] << "Most importantly, superfluous observable bins can be removed or additional factors" << endl; - info["fnlo-tk-modify"] << "can be applied to each bin." << endl; - info["fnlo-tk-modify"] << "It is assumed that the desired changes are set up in a steering file." << endl; + info["fnlo-tk-modify"] << "can be applied to each bin. Moreover, additional uncertainties like from numerical" << endl; + info["fnlo-tk-modify"] << "integrations can be added to each perturbative contribution." << endl; + info["fnlo-tk-modify"] << "Because simple command line arguments or options would not be flexible enough," << endl; + info["fnlo-tk-modify"] << "it is assumed that the desired changes are set up in a steering file." << endl; info["fnlo-tk-modify"] << "By default the steering file is named 'SteerModify.str'." << endl; info["fnlo-tk-modify"] << "A template for such a file is contained in the release and" << endl; info["fnlo-tk-modify"] << "usually should have been installed under share/fastnlo_toolkit/Modify/." << endl; @@ -74,69 +86,101 @@ int main(int argc, char** argv) { info["fnlo-tk-modify"] << "e.g. fnlo-tk-modify steerfile=AnotherFileName.str" << endl; info["fnlo-tk-modify"] << endl; man << "" << endl; - man << "Usage: ./fnlo-tk-modify [steerfile=SteerFile.str] <InTable=fastNLOtableIn.tab> <OutTable=fastNLOtableOut.tab> [OptArg=option]" << endl; + man << "Usage: ./fnlo-tk-modify [steerfile=SteerFile.str] [InTable=fastNLOtableIn.tab.gz] [OutTable=fastNLOtableOut.tab.gz] [OptArg=option]" << endl; man << " Specification: <> mandatory; [] optional." << endl; - man << " All desired table modifications like" << endl; - man << " - changing the scenario name" << endl; - man << " - changing or complementing the scenario description" << endl; - man << " - adapting the cross section output units" << endl; - man << " - correcting the power of the LO process" << endl; - man << " - correcting the cms energy" << endl; - man << " - cutting out unused bins or" << endl; - man << " - multiplying bins by a set of factors" << endl; - man << " are assumed to be controlled via steering parameters " << endl; - man << " similar to the ones that may be used in table creation." << endl; - man << " By default it is expected that at least the mandatory ones are" << endl; - man << " specified in the steering file 'SteerModify.str' or" << endl; - man << " are given via command line arguments:" << endl; - man << "[steerfile=SteerFile.str]: Alternative steering filename" << endl; - man << "<InTable=fastNLOtableIn.tab>: Table input filename, if not specified in steering file" << endl; - man << "<OutTable=fastNLOtableOut.tab>: Table output filename, if not specified in steering file" << endl; - man << " For more steering options please check the default steering file delivered" << endl; - man << " by the fastNLO Tolkit (usually in $prefix/share/fastnlo_toolkit/steerfiles)." << endl; + man << "[steerfile=SteerFile.str]: Alternative steering filename." << endl; + man << "[InTable=fastNLOtableIn.tab.gz]: Table input filename, if not specified in steering file." << endl; + man << "[OutTable=fastNLOtableOut.tab.gz]: Table output filename, if not specified in steering file." << endl; + man << " All desired table modifications like" << endl; + man << " - changing the scenario name," << endl; + man << " - changing or complementing the scenario description," << endl; + man << " - cutting out unused bins," << endl; + man << " - multiplying bins by a set of factors," << endl; + man << " - adding uncertainty information," << endl; + man << " - adapting the cross section output units," << endl; + man << " - correcting the power of the LO process, or" << endl; + man << " - correcting the cms energy" << endl; + man << " are assumed to be controlled via steering parameters" << endl; + man << " similar to the ones that may be used in table creation." << endl; + man << " By default it is expected that at least the mandatory ones are" << endl; + man << " either given via command line arguments or are specified" << endl; + man << " in a steering file by default named 'SteerModify.str'." << endl; + man << " For more steering options please check the default steering file delivered" << endl; + man << " by the fastNLO Tolkit (usually in $prefix/share/fastnlo_toolkit/steerfiles)." << endl; yell << " #" << endl; yell << _CSEPSC << endl; return 0; - } else { - shout["fnlo-tk-modify"] << "Parsing requested modifications ..." << endl; } - } - - if ( !PARSE(argc,argv) ) { - if ( ! (EXIST(InTable) && EXIST(OutTable)) ) { - shout["fnlo-tk-modify"] << "Mandatory parameters not specified in command line," << endl; - shout["fnlo-tk-modify"] << "trying to read from default steering file 'SteerModify.str'" << endl; - int retcode = READ("SteerModify.str"); - if ( retcode != 0 ) { - error["fnlo-tk-modify"] << "Reading of mandatory parameters from default steering file 'SteerModify.str' unsuccessful. Aborted!" << endl; - exit(retcode); + yell << _CSEPSC << endl; + info["fnlo-tk-modify"] << "Parsing command line ..." << endl; + for ( int i = 1; i < argc; i++ ) { + std::string test = argv[i]; + size_t ipos = test.find("steerfile="); + if ( ipos == 0 ) { + ipos = test.find("="); + steername = test.substr(ipos+1,std::string::npos); + info["fnlo-tk-modify"] << "Found argument for steerfile: " << steername << endl; + } + ipos = test.find("InTable="); + if ( ipos == 0 ) { + ipos = test.find("="); + intable = test.substr(ipos+1,std::string::npos); + info["fnlo-tk-modify"] << "Found argument for InTable: " << intable << endl; } - if ( ! (EXIST(InTable) && EXIST(OutTable)) ) { - error["fnlo-tk-modify"] << "Mandatory parameters also not specified in default steering file 'SteerModify.str'. Aborted!" << endl; - shout["fnlo-tk-modify"] << "For more explanations type:" << endl; - shout["fnlo-tk-modify"] << "./fnlo-tk-modify -h" << endl; - PRINTALL(); - exit(1); + ipos = test.find("OutTable="); + if ( ipos == 0 ) { + ipos = test.find("="); + outtable = test.substr(ipos+1,std::string::npos); + info["fnlo-tk-modify"] << "Found argument for OutTable: " << outtable << endl; } } - } else { - shout["fnlo-tk-modify"] << "Parsing alternative steering file ..." << endl; } - if ( ! (EXIST(InTable) && EXIST(OutTable)) ) { - error["fnlo-tk-modify"] << "Input and/or output table not specified. Aborted!" << endl; - PRINTALL(); - exit(1); + // Reading all settings from command line; success means provided steering file could be read! + if ( PARSE(argc,argv) ) { + info["fnlo-tk-modify"] << "Read all settings from command line and provided steering file." << endl; + if ( ! (EXIST(InTable) && EXIST(OutTable)) ) { + error["fnlo-tk-modify"] << "Mandatory parameters InTable and OutTable are not defined," << endl; + error["fnlo-tk-modify"] << "neither on command line nor in steering file. Aborted!" << endl; + error["fnlo-tk-modify"] << "For more explanations type:" << endl; + error["fnlo-tk-modify"] << "./fnlo-tk-modify -h" << endl; + PRINTALL(); + exit(1); + } + } else { // Steering file could not be read, try default one! + info["fnlo-tk-modify"] << "Provided steering file, if any, could not be read." << endl; + info["fnlo-tk-modify"] << "Trying default steering file 'SteerModify.str' instead ..." << endl; + int retcode = READ("SteerModify.str"); + if ( retcode != 0 ) { + warn["fnlo-tk-modify"] << "No steering file found!" << endl; + warn["fnlo-tk-modify"] << "All manipulations must have been defined by" << endl; + warn["fnlo-tk-modify"] << "command line options!" << endl; + } + if ( ! (EXIST(InTable) && EXIST(OutTable)) ) { + error["fnlo-tk-modify"] << "Mandatory parameters InTable and OutTable not defined," << endl; + error["fnlo-tk-modify"] << "neither on command line nor in any steering file. Aborted!" << endl; + error["fnlo-tk-modify"] << "For more explanations type:" << endl; + error["fnlo-tk-modify"] << "./fnlo-tk-modify -h" << endl; + PRINTALL(); + exit(1); + } } + //! --- If desired print all steering information if ( EXIST(PrintSteeringCard) ) { + info["fnlo-tk-modify"] << "Print all steering information ..." << endl; if ( BOOL(PrintSteeringCard) ) PRINTALL(); } - shout["fnlo-tk-modify"] << "Trying to read input table " << STRING(InTable) << endl; + //! --- Reset verbosity level + if ( EXIST(Verbosity) ) { + info["fnlo-tk-modify"] << "Resetting verbosity to: " << STRING(Verbosity) << endl; + SetGlobalVerbosity(toVerbosity()[STRING(Verbosity)]); + } + //! --- Print input table information + info["fnlo-tk-modify"] << "Trying to read input table " << STRING(InTable) << endl; fastNLOTable table(CHAR(InTable)); - table.ReadTable(); if ( EXIST(PrintInputA1) ) { if ( BOOL(PrintInputA1) ) table.PrintHeader(1); } @@ -144,7 +188,7 @@ int main(int argc, char** argv) { if ( BOOL(PrintInputA2) ) table.PrintScenario(1); } - // Block A1 + // Block A1: Table header if ( EXIST(Itabversion) ) { info["fnlo-tk-modify"]<<"Modifying table version: from "<< table.GetITabVersionRead() << " to " << INT(Itabversion) << endl; table.SetITabVersionWrite(INT(Itabversion)); @@ -153,7 +197,8 @@ int main(int argc, char** argv) { info["fnlo-tk-modify"]<<"Modifying scenario name: from "<< table.GetScenName() << " to " << STRING(ScenName) << endl; table.SetScenName(STRING(ScenName)); } - // Block A2 + + // Block A2: Table scenario if ( EXIST(Ipublunits) ) { info["fnlo-tk-modify"]<<"Modifying publication units: from "<< table.GetIpublunits() << " to " << INT(Ipublunits) << endl; table.SetIpublunits(INT(Ipublunits)); @@ -167,7 +212,7 @@ int main(int argc, char** argv) { shout << "Line no. " << i << ": " << ScDescr[i] << endl; } if ( BOOL(AttachScDescription) ){ - info["fnlo-tk-modify"]<<"Attaching lines:" << endl; + info["fnlo-tk-modify"]<<"Attaching to scenario description:" << endl; size_t NewNScSize = NScSize + STRING_ARR(ScDescript).size(); ScDescr.resize(NewNScSize); for ( size_t i = NScSize; i < NewNScSize; i++ ) { @@ -175,7 +220,7 @@ int main(int argc, char** argv) { shout << "Line no. " << i << ": " << ScDescr[i] << endl; } } else { - info["fnlo-tk-modify"]<<"Replacing lines with:" << endl; + info["fnlo-tk-modify"]<<"Replacing scenario description by:" << endl; size_t NewNScSize = STRING_ARR(ScDescript).size(); ScDescr.resize(NewNScSize); for ( size_t i = 0; i < NewNScSize; i++ ) { @@ -219,6 +264,7 @@ int main(int argc, char** argv) { } } + // Block B's: Scenario contributions if ( !DOUBLE_ARR(MultCoeff).empty() ) { vector<double> fac = DOUBLE_ARR(MultCoeff); info["fnlo-tk-modify"]<<"Multiplying by provided factors all coefficients of additive contributions to observable bins!"<<endl; @@ -233,6 +279,7 @@ int main(int argc, char** argv) { } } + //! Erase observable bins from table (Do NOT simultaneously to adding InfoBlocks!) if ( !INT_ARR(RemoveBins).empty() ) { info["fnlo-tk-modify"]<<"Removing observable bins from interpolation table!"<<endl; unsigned int nobs = table.GetNObsBin(); @@ -250,6 +297,121 @@ int main(int argc, char** argv) { } } + //! Replace CodeDescription in each perturbative contribution + if ( !STRING_ARR(CodeDescript).empty() ){ + int Ncontrib = table.GetNcontrib(); + size_t NCodeDescript = STRING_ARR(CodeDescript).size(); + std::vector<std::string> Description; + info["fnlo-tk-modify"]<<"Replacing code description by:" << endl; + for ( size_t i = 0; i < NCodeDescript; i++ ) { + info["fnlo-tk-modify"]<<"Line no. " << i << ": " << STRING_ARR(CodeDescript)[i] << endl; + Description.push_back(STRING_ARR(CodeDescript)[i]); + } + for ( int i = 0; i < Ncontrib; i++ ) { + fastNLOCoeffBase* c = table.GetCoeffTable(i); + if ( fastNLOCoeffAddBase::CheckCoeffConstants(c,true) ) { + c->SetCodeDescription(Description); + } + } + } + + //! Add InfoBlocks with statistical uncertainty from NNLOJET + if ( !STRING_ARR(InfoBlockFiles).empty() && + !STRING_ARR(InfoBlockDescr).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 NDescr = STRING_ARR(InfoBlockDescr).size(); + unsigned int NOrders = STRING_ARR(InfoBlockOrders).size(); + 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 < NDescr; i++ ){ + info["fnlo-tk-modify"]<<"InfoBlock description no. " << i << " is: " << STRING_ARR(InfoBlockDescr)[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) ) { + 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; + } + } + } + std::vector<std::string> Description; + if ( NDescr > 1 ) { + Description.push_back(STRING_ARR(InfoBlockDescr)[ilo]); + } else if ( NDescr > 0 ) { + Description.push_back(STRING_ARR(InfoBlockDescr)[0]); + } else { + Description.push_back(Default); + } + c->AddCoeffInfoBlock(0,0,Description,STRING_ARR(InfoBlockFiles)[ilo]); + 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; + } + } + } + std::vector <std:: string> Description; + if ( NDescr > 1 ) { + Description.push_back(STRING_ARR(InfoBlockDescr)[inlo]); + } else if ( NDescr > 0 ) { + Description.push_back(STRING_ARR(InfoBlockDescr)[0]); + } else { + Description.push_back(Default); + } + c->AddCoeffInfoBlock(0,0,Description,STRING_ARR(InfoBlockFiles)[inlo]); + 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; + } + } + } + std::vector <std:: string> Description; + if ( NDescr > 1 ) { + Description.push_back(STRING_ARR(InfoBlockDescr)[innlo]); + } else if ( NDescr > 0 ) { + Description.push_back(STRING_ARR(InfoBlockDescr)[0]); + } else { + Description.push_back(Default); + } + c->AddCoeffInfoBlock(0,0,Description,STRING_ARR(InfoBlockFiles)[innlo]); + ic += 1; + } else { + info["fnlo-tk-modify"]<<"Unknown contribution " << i << endl; + info["fnlo-tk-modify"]<<"Nothing changed." << endl; + } + } + } + } + + //! --- Print output table information if ( EXIST(PrintOutputA1) ) { if ( BOOL(PrintOutputA1) ) table.PrintHeader(0); } @@ -258,7 +420,7 @@ int main(int argc, char** argv) { if ( BOOL(PrintOutputA2) ) table.PrintScenario(0); } - // writing modified table + //! Writing modified table table.SetFilename(CHAR(OutTable)); table.WriteTable(); diff --git a/v2.3/toolkit/src/fnlo-tk-rootout.cc b/v2.3/toolkit/src/fnlo-tk-rootout.cc index f74747f8a305f68ac20d3c28ae3d5b398c39417c..b29aad49fe0cf4a8ebe95fa55c27ec06de1a9690 100644 --- a/v2.3/toolkit/src/fnlo-tk-rootout.cc +++ b/v2.3/toolkit/src/fnlo-tk-rootout.cc @@ -40,7 +40,7 @@ int main(int argc, char** argv) { using namespace say; //! namespace for 'speaker.h'-verbosity levels using namespace fastNLO; //! namespace for fastNLO constants - //! --- Set verbosity level + //! --- Set initial verbosity level SetGlobalVerbosity(INFO); //! --- Parse commmand line @@ -83,8 +83,8 @@ int main(int argc, char** argv) { yell << _SSEPSC << endl; yell << " #" << endl; info["fnlo-tk-rootout"] << "This program evaluates a fastNLO table and" << endl; - info["fnlo-tk-rootout"] << "writes histograms with cross sections and scale or" << endl; - info["fnlo-tk-rootout"] << "PDF uncertainties into ROOT." << endl; + info["fnlo-tk-rootout"] << "writes histograms with cross sections and PDF, statistical or" << endl; + info["fnlo-tk-rootout"] << "scale uncertainties into ROOT." << endl; info["fnlo-tk-rootout"] << "" << endl; info["fnlo-tk-rootout"] << "TODO: Provide more info on histogram numbering/labelling ..." << endl; man << "" << endl; @@ -119,6 +119,7 @@ int main(int argc, char** argv) { man << " \"scale21\", i.e. mur=scale2, muf=scale1," << endl; man << " \"kProd\", i.e. mur=muf=scale1*scale2," << endl; man << " \"kQuadraticSum\", i.e. mur=muf=sqrt(scale1^2+scale2^2)." << endl; + man << "[Verbosity]: Set verbosity level of table evaluation [DEBUG,INFO,WARNING,ERROR], def. = WARNING" << endl; yell << " #" << endl; man << "Use \"_\" to skip changing a default argument." << endl; yell << " #" << endl; @@ -142,8 +143,9 @@ int main(int argc, char** argv) { } //! --- Uncertainty choice - EScaleUncertaintyStyle eScaleUnc = kScaleNone; EPDFUncertaintyStyle ePDFUnc = kPDFNone; + EAddUncertaintyStyle eAddUnc = kAddNone; + EScaleUncertaintyStyle eScaleUnc = kScaleNone; string chunc = "none"; if (argc > 3) { chunc = (const char*) argv[3]; @@ -228,12 +230,28 @@ int main(int argc, char** argv) { shout["fnlo-tk-rootout"] << "Using scale definition "+chflex+"." << endl; } - //! --- Too many arguments + //--- Set verbosity level of table evaluation + string VerbosityLevel = "WARNING"; if (argc > 7) { + VerbosityLevel = (const char*) argv[7]; + } + if (argc <= 7 || VerbosityLevel == "_") { + VerbosityLevel = "WARNING"; + shout["fnlo-tk-rootout"] << "No request given for verbosity level, using WARNING default." << endl; + } else { + shout["fnlo-tk-rootout"] << "Using verbosity level: " << VerbosityLevel << endl; + } + + //! --- Too many arguments + if (argc > 8) { error["fnlo-tk-rootout"] << "Too many arguments, aborting!" << endl; exit(1); } yell << _CSEPSC << endl; + //--- End of parsing arguments + + //! --- Reset verbosity level from here on + SetGlobalVerbosity(toVerbosity()[VerbosityLevel]); //! --- Prepare loop over PDF sets const int nsets = 4; @@ -258,13 +276,17 @@ int main(int argc, char** argv) { //! --- fastNLO initialisation, attach table fastNLOTable table = fastNLOTable(tablename); + //! Print essential table information table.PrintContributionSummary(0); + table.Print(0); //! Initialise a fastNLO reader instance with interface to LHAPDF //! Note: This also initializes the cross section to the LO/NLO one! fastNLOLHAPDF* fnlo = NULL; fnlo = new fastNLOLHAPDF(table,PDFFiles[0],0); + //! Store table version number + int ITabVersion = fnlo->GetITabVersionRead(); //! Check on existence of LO (Id = -1 if not existing) int ilo = fnlo->ContrId(kFixedOrder, kLeading); @@ -441,9 +463,9 @@ int main(int argc, char** argv) { //! Re-calculate cross sections for new settings fnlo->CalcCrossSection(); - //! Do PDF and scale uncertainties - unsigned int iOffs[3] = {1,6,8}; - for (unsigned int iUnc = 0; iUnc<3; iUnc++) { + //! Do PDF, statistical/numerical, and scale uncertainties + unsigned int iOffs[4] = {1,3,6,8}; + for (unsigned int iUnc = 0; iUnc<4; iUnc++) { //! Get cross section & uncertainties (only for additive perturbative contributions) XsUncertainty XsUnc; @@ -458,8 +480,19 @@ int main(int argc, char** argv) { snprintf(titlel, sizeof(titlel), "-dsigma_%s/sigma",PDFFiles[iPDF].c_str()); snprintf(titleu, sizeof(titleu), "+dsigma_%s/sigma",PDFFiles[iPDF].c_str()); } - //! 2P scale uncertainties + //! Statistical/numerical uncertainties else if ( iUnc==1 ) { + if (ITabVersion < 25000) { + info["fnlo-tk-rootout"] << "Table version " << ITabVersion << "too small; statistical uncertainties not available." << endl; + } + eAddUnc = kAddStat; + XsUnc = fnlo->GetAddUncertainty(eAddUnc, lNorm); + snprintf(buffer, sizeof(buffer), " # Relative Statistical Uncertainties (%s %s)",sOrder.c_str(),PDFFiles[iPDF].c_str()); + snprintf(titlel, sizeof(titlel), "-dsigma_stat/sigma"); + snprintf(titleu, sizeof(titleu), "+dsigma_stat/sigma"); + } + //! 2P scale uncertainties + else if ( iUnc==2 ) { eScaleUnc = kSymmetricTwoPoint; XsUnc = fnlo->GetScaleUncertainty(eScaleUnc, lNorm); snprintf(buffer, sizeof(buffer), " # 2P Relative Scale Uncertainties (%s %s)",sOrder.c_str(),PDFFiles[iPDF].c_str()); @@ -467,7 +500,7 @@ int main(int argc, char** argv) { snprintf(titleu, sizeof(titleu), "+dsigma_2P/sigma"); } //! 6P scale uncertainties - else if ( iUnc==2 ) { + else if ( iUnc==3 ) { eScaleUnc = kAsymmetricSixPoint; XsUnc = fnlo->GetScaleUncertainty(eScaleUnc, lNorm); snprintf(buffer, sizeof(buffer), " # 6P Relative Scale Uncertainties (%s %s)",sOrder.c_str(),PDFFiles[iPDF].c_str()); diff --git a/v2.3/toolkit/src/fnlo-tk-statunc.cc b/v2.3/toolkit/src/fnlo-tk-statunc.cc index 7d74f178575117fe7af1b8f274896f6d2f71ee01..77ea052339ca8692ba981f3e7d4a62e86654342d 100644 --- a/v2.3/toolkit/src/fnlo-tk-statunc.cc +++ b/v2.3/toolkit/src/fnlo-tk-statunc.cc @@ -42,7 +42,7 @@ int main(int argc, char** argv) { using namespace say; //! namespace for 'speaker.h'-verbosity levels using namespace fastNLO; //! namespace for fastNLO constants - //! --- Set verbosity level + //! --- Set initial verbosity level SetGlobalVerbosity(INFO); //! --- Parse command line @@ -212,8 +212,7 @@ int main(int argc, char** argv) { } if (argc <= 6 || VerbosityLevel == "_") { VerbosityLevel = "WARNING"; - shout["fnlo-tk-statunc"] << "No request given for verbosity level," << endl; - shout << " using WARNING default." << endl; + shout["fnlo-tk-statunc"] << "No request given for verbosity level, using WARNING default." << endl; } else { shout["fnlo-tk-statunc"] << "Using verbosity level: " << VerbosityLevel << endl; } @@ -226,17 +225,8 @@ int main(int argc, char** argv) { yell << _CSEPSC << endl; //--- End of parsing arguments - //! --- Reset verbosity level to warning only from here on - // TODO: KR: A string to enum map or similar could come in handy here - if ( VerbosityLevel == "DEBUG" ) { - SetGlobalVerbosity(DEBUG); - } else if ( VerbosityLevel == "INFO" ) { - SetGlobalVerbosity(INFO); - } else if ( VerbosityLevel == "ERROR" ) { - SetGlobalVerbosity(ERROR); - } else { - SetGlobalVerbosity(WARNING); - } + //! --- Reset verbosity level from here on + SetGlobalVerbosity(toVerbosity()[VerbosityLevel]); //! --- Loop over selected table sample //! Initialise fastNLO instances with interface to LHAPDF diff --git a/v2.3/toolkit/src/fnlo-tk-yodaout.cc b/v2.3/toolkit/src/fnlo-tk-yodaout.cc index 497af9189ed55167260e93693bf38b405e50738a..9aa8ac36bb17b0ca4e2b3b95e0e80d5396367b8c 100644 --- a/v2.3/toolkit/src/fnlo-tk-yodaout.cc +++ b/v2.3/toolkit/src/fnlo-tk-yodaout.cc @@ -37,7 +37,7 @@ int main(int argc, char** argv) { using namespace say; //! namespace for 'speaker.h'-verbosity levels using namespace fastNLO; //! namespace for fastNLO constants - //! --- Set verbosity level + //! --- Set initial verbosity level SetGlobalVerbosity(INFO); //! --- Parse commmand line @@ -256,7 +256,6 @@ int main(int argc, char** argv) { chflex = (const char*) argv[6]; } if (argc <= 6 || chflex == "_") { - chflex = "scale1"; shout["fnlo-tk-yodaout"] << "Using default mur=muf=scale 1." << endl; } else { shout["fnlo-tk-yodaout"] << "Using scale definition "+chflex+"." << endl; @@ -281,8 +280,7 @@ int main(int argc, char** argv) { } if (argc <= 8 || VerbosityLevel == "_") { VerbosityLevel = "WARNING"; - shout["fnlo-tk-yodaout"] << "No request given for verbosity level," << endl; - shout << " using WARNING default." << endl; + shout["fnlo-tk-yodaout"] << "No request given for verbosity level, using WARNING default." << endl; } else { shout["fnlo-tk-yodaout"] << "Using verbosity level: " << VerbosityLevel << endl; } @@ -295,22 +293,15 @@ int main(int argc, char** argv) { yell << _CSEPSC << endl; //--- End of parsing arguments - //! --- Reset verbosity level to warning only from here on - // TODO: KR: A string to enum map or similar could come in handy here - if ( VerbosityLevel == "DEBUG" ) { - SetGlobalVerbosity(DEBUG); - } else if ( VerbosityLevel == "INFO" ) { - SetGlobalVerbosity(INFO); - } else if ( VerbosityLevel == "ERROR" ) { - SetGlobalVerbosity(ERROR); - } else { - SetGlobalVerbosity(WARNING); - } + //! --- Reset verbosity level from here on + SetGlobalVerbosity(toVerbosity()[VerbosityLevel]); //! --- fastNLO initialisation, attach table fastNLOTable table = fastNLOTable(tablename); + //! Print essential table information table.PrintContributionSummary(0); + table.Print(0); //! Initialise a fastNLO reader instance //! Note: This also initializes the cross section to the LO/NLO one!