From d63bba971d3457dd787f4c5399b81fd0ac072365 Mon Sep 17 00:00:00 2001 From: Klaus Rabbertz <klaus.rabbertz@cern.ch> Date: Fri, 7 Mar 2025 17:12:01 +0100 Subject: [PATCH] Fix inconsistency in YODA precompiler usage --- v2.6/toolkit/src/fnlo-tk-yodaout.cc | 20 +++++--------------- 1 file changed, 5 insertions(+), 15 deletions(-) diff --git a/v2.6/toolkit/src/fnlo-tk-yodaout.cc b/v2.6/toolkit/src/fnlo-tk-yodaout.cc index de438157..d8548e05 100644 --- a/v2.6/toolkit/src/fnlo-tk-yodaout.cc +++ b/v2.6/toolkit/src/fnlo-tk-yodaout.cc @@ -542,6 +542,10 @@ int main(int argc, char** argv) { UncName = UncName + " (" + chunc + " " + PDFFile + " " + sOrder + ")"; fastNLOTools::PrintXSUncertainty(XsUnc, UncName, HeadLine); + //! Without YODA we can stop here +#ifndef WITH_YODA + return 0; +#else //! --- Get RivetID //! For 2+-dimensions determine running number in Rivet plot name by spotting the capital letter in "RIVET_ID=" in the fnlo table //! For inverted order, the Id starts with "-" after "/". @@ -590,10 +594,8 @@ int main(int argc, char** argv) { LineName = chord + "_" + PDFName + LineName; //! --- YODA analysis object creation and storage -#ifdef WITH_YODA YODA::Writer & writer = YODA::WriterYODA::create(); //! Create the writer for the yoda file vector< YODA::AnalysisObject * > aos; //! Vector of pointers to each of multiple analysis objects -#endif size_t counter = atoi(RivetId.substr(capital_pos +1, 2).c_str()); //! --- Initialize dimension bin and continuous observable bin counter @@ -601,9 +603,7 @@ int main(int argc, char** argv) { NDimBins[0] = fnlo->GetNDim0Bins(); unsigned int iobs = 0; //! Vector of 2D scatter plots -#ifdef WITH_YODA vector<YODA::Scatter2D> plots; -#endif //! --- 1D if (NDim == 1) { @@ -621,12 +621,10 @@ int main(int argc, char** argv) { ); iobs++; } -#ifdef WITH_YODA /// Pointer in order not to be deleted after we exit the loop, so we can then save them into the yoda file YODA::Scatter2D * plot = new YODA::Scatter2D(points, "/" + RivetId, LineName); /// Insert the plot pointer into the vector of analysis object pointers aos.push_back(plot); -#endif } //! --- 2D else if (NDim == 2) { @@ -661,12 +659,10 @@ int main(int argc, char** argv) { histno << ihist; /// Replace counter part in RivetId by histno RivetId.replace(capital_pos +3 - histno.str().size(), histno.str().size(), histno.str()); -#ifdef WITH_YODA /// Pointer in order not to be deleted after we exit the loop, so we can then save the plots into the yoda file YODA::Scatter2D * plot = new YODA::Scatter2D(points, "/" + RivetId, LineName); /// Insert the plot pointer into the vector of analysis object pointers aos.push_back(plot); -#endif } } //! --- 3D @@ -705,29 +701,23 @@ int main(int argc, char** argv) { histno << ihist; /// Replace counter part in RivetId by histno RivetId.replace(capital_pos +3 - histno.str().size(), histno.str().size(), histno.str()); -#ifdef WITH_YODA /// Pointer in order not to be deleted after we exit the loop, so we can then save the plots into the yoda file YODA::Scatter2D * plot = new YODA::Scatter2D(points, "/" + RivetId, LineName); /// Insert the plot pointer into the vector of analysis object pointers aos.push_back(plot); -#endif } } } //! --- Output //! Save histograms into the yoda file -#ifdef WITH_YODA writer.write( FileName + ".yoda", aos ); -#endif yell << "" << endl; yell << _CSEPSC << endl; yell << " #" << endl; -#ifdef WITH_YODA shout << FileName + ".yoda was successfully produced" << endl; -#else shout << "Compiled without YODA support ==> No YODA file produced!" << endl; -#endif yell << " #" << endl; yell << _CSEPSC << endl << endl; +#endif } -- GitLab