diff --git a/Backends/include/gambit/Backends/backend_types/smoking.hpp b/Backends/include/gambit/Backends/backend_types/smoking.hpp new file mode 100644 index 0000000000..7fd7544b61 --- /dev/null +++ b/Backends/include/gambit/Backends/backend_types/smoking.hpp @@ -0,0 +1,239 @@ +// GAMBIT: Global and Modular BSM Inference Tool +// ********************************************* +/// \file +/// +/// GAMBIT-side type definitions for the smoking backend. +/// +/// These structs mirror the definitions in smoking's +/// include/smoking/settings.h and include/smoking/input_parser.h. +/// Both sides must remain in sync so that the binary layout matches +/// when a smoking_variables reference is passed across the dlopen +/// boundary into init_SMOKING / Calculate_cross_section. +/// +/// ********************************************* +/// +/// Authors (add name and date if you modify): +/// +/// \author Christopher Chang +/// \date 2026 Apr +/// +/// ********************************************* + +#ifndef __smoking_types_hpp__ +#define __smoking_types_hpp__ + +#include +#include +#include +#include + +// --------------------------------------------------------------------------- +// Types from smoking's include/smoking/settings.h +// --------------------------------------------------------------------------- + +struct IntegratorConfig +{ + std::string backend = "GSL"; + std::string strategy = "VEGAS"; + bool use_GPU_integrator = false; + int chunksize = 8192; + double err_tol_rel = 5e-2; + size_t max_iters = 10; + size_t n_call = 0; +}; + +struct VegasParams { double alpha = 1.5; }; +struct SuaveParams {}; +struct DivonneParams {}; +struct CuhreParams {}; + +// --------------------------------------------------------------------------- +// Types from smoking's include/smoking/input_parser.h +// --------------------------------------------------------------------------- + +struct smoking_variables +{ + double sqrt_s = 13600.0; + int ipid1 = 2212; + int ipid2 = 2212; + std::vector pid1; + std::vector pid2; + + int order = 1; + bool dm = false; + bool dt = false; + std::vector diff_name; + std::vector diff_val; + int default_scheme = 0; + + int scale_scheme = 0; + std::vector central_scale; + double central_scale_F, central_scale_R; + std::vector scale_ratio; + double scale_ratio_F, scale_ratio_R; + bool scale_error = false; + int scale_strategy = 3; + + bool alphas_error = false; + bool pdf_error = false; + std::string pdf_set = "PDF4LHC15_nnlo_100"; + bool model_alphas; // intentionally uninitialised, matching smoking + std::string slha_file = "example/sps1a.slha"; + SLHAea::Coll slhaea; + bool output = false; + std::string output_file; + + bool diffname_flag = false; + bool diffval_flag = false; + bool scale_flag = false; + bool central_scale_flag = false; + bool scale_ratio_flag = false; + bool output_file_name = false; + + double xmin = 0; + bool PDFxmin = false; + bool invMellin_force_physical = false; + + double NLP = 1; + double NLL = 1; + double NNLL = 0; + double H_1loop = 0; + double H_2loop = 0; + + IntegratorConfig int_config; + VegasParams vegas_params; + SuaveParams suave_params; + DivonneParams divonne_params; + CuhreParams cuhre_params; +}; + +// +// Structures for keeping track of results +// + + +// Struct for single cross section calculations with numerical errors +// Errors propagate under addition, subtraction and multiplication by constant +// The struct has a simple printing << operator +struct xsec{ + double central; + double upper; + double lower; + + // Status flag, not used to store fatal errors + int status; + + // Constructor + xsec(double central=0, double upper=0, double lower=0, int status=0): central(central), upper(upper), lower(lower), status(status) {} + + // Addition of cross sections, does not modify object therefore const + xsec operator+(const xsec& a) const { + // If an error occurred, return the first error + int combined_status = 0; + if (status < 0) {combined_status = status;} + else if (a.status < 0) {combined_status = a.status;} + else {combined_status = std::max(status, a.status);} + + return xsec(central+a.central, sqrt(upper*upper+a.upper*a.upper), sqrt(lower*lower+a.lower*a.lower), combined_status); + } + + // Subtraction of cross sections, does not modify object therefore const + xsec operator-(const xsec& a) const { + // If an error occurred, return the first error + int combined_status = 0; + if (status < 0) {combined_status = status;} + else if (a.status < 0) {combined_status = a.status;} + else {combined_status = std::max(status, a.status);} + + return xsec(central-a.central, sqrt(upper*upper+a.upper*a.upper), sqrt(lower*lower+a.lower*a.lower), combined_status); + } + + // Scalar multiplication, does modify object + xsec operator*(const double a) { + return xsec(a*central, a*upper, a*lower, status); + } + +}; + +xsec operator*(const double k, const xsec& a); +std::ostream& operator<<(std::ostream& os, const xsec& a); + + +// Struct for bookkeeping results of a complete calculation +struct Result{ + xsec cross_section {0,0,0}; + xsec upper_sca_err {0,0,0}; + xsec lower_sca_err {0,0,0}; + std::vector sca_err; // Contains cross-section for other scales: For strategy 3 (mu_F,mu_R)/mu_0 = [(0.5,0.5), (2,2)] + // For strategy 7 (mu_F,mu_R)/mu_0 = [(0.5,0.5), (0.5,1), (1,0.5), (1,2), (2,1), (2,2)] + std::vector pdf_err; + double upper_pdf_err; + double lower_pdf_err; + double upper_alphas_err; + double lower_alphas_err; + + // Used to indicate success/failure. Anything other than zero is a failure. + int status; + + // Constructor + Result() = default; + Result(xsec cross_section, std::vector sca_err, std::vector pdf_err): cross_section(cross_section), sca_err(sca_err), pdf_err(pdf_err) {} + + // Addition of results, does not modify object therefore const + Result operator+(const Result& a) const { + std::vector total_pdferr; + for(size_t i=0; i < pdf_err.size(); i++){ + total_pdferr.push_back(pdf_err[i]+a.pdf_err[i]); + } + std::vector total_scaerr; + for(size_t i=0; i < sca_err.size(); i++){ + total_scaerr.push_back(sca_err[i]+a.sca_err[i]); + } + Result res = Result(cross_section+a.cross_section, total_scaerr, total_pdferr); + res.status = std::min(status, a.status); + + return res; + } + + // Subtraction of results, does not modify object therefore const + Result operator-(const Result& a) const { + std::vector total_pdferr; + for(size_t i=0; i < pdf_err.size(); i++){ + total_pdferr.push_back(pdf_err[i]-a.pdf_err[i]); + } + std::vector total_scaerr; + for(size_t i=0; i < sca_err.size(); i++){ + total_scaerr.push_back(sca_err[i]-a.sca_err[i]); + } + Result res = Result(cross_section-a.cross_section, total_scaerr, total_pdferr); + res.status = std::min(status, a.status); + return res; + } + + // Scalar multiplication, does modify object + Result operator*(const double a) { + std::vector total_pdferr; + for(size_t i=0; i < pdf_err.size(); i++){ + total_pdferr.push_back(a*pdf_err[i]); + } + std::vector total_scaerr; + for(size_t i=0; i < pdf_err.size(); i++){ + total_scaerr.push_back(a*sca_err[i]); + } + Result res = Result(a*cross_section, total_scaerr, total_pdferr); + return res; + } + + // Set values equal to a xsec struct (cross section result) + Result& operator=(const xsec& a) { + cross_section = a; + return *this; + } + + +}; + +Result operator*(const double k, const Result& a); + + +#endif /* defined __smoking_types_hpp__ */ diff --git a/Backends/include/gambit/Backends/frontends/smoking_1_0_0.hpp b/Backends/include/gambit/Backends/frontends/smoking_1_0_0.hpp new file mode 100644 index 0000000000..7b4fdaf865 --- /dev/null +++ b/Backends/include/gambit/Backends/frontends/smoking_1_0_0.hpp @@ -0,0 +1,58 @@ +// GAMBIT: Global and Modular BSM Inference Tool +// ********************************************* +/// \file +/// +/// Frontend header for the smoking backend v1.0.0. +/// +/// smoking computes NLO+NLL hadronic cross-sections for +/// slepton and electroweakino pair production. +/// +/// The backend exposes three extern "C" functions from +/// libsmoking_gambit.so: +/// +/// init_SMOKING -- initialise integrators, PDFs, processes +/// Calculate_cross_section -- run the calculation for one SLHA point +/// finalise_SMOKING -- clean up all resources +/// +/// ********************************************* +/// +/// Authors (add name and date if you modify): +/// +/// \author Christopher Chang +/// (c.j.chang@fys.uio.no) +/// \date 2026 Apr +/// +/// ********************************************* + +#define BACKENDNAME smoking +#define BACKENDLANG CXX +#define VERSION 1.0.0 +#define SAFE_VERSION 1_0_0 +#define REFERENCE TODO + +// Load the shared library +LOAD_LIBRARY + +// Pull in the GAMBIT-side mirror of smoking's types +#include "gambit/Backends/backend_types/smoking.hpp" + +/* Syntax: + * BE_FUNCTION(gambit_name, return_type, (arg_types), "symbol_name", "capability_name") + * + * The symbol names are unmangled because the functions are declared extern "C" + * in smoking's gambit_interface.cpp. + */ + +BE_FUNCTION(smoking_init, int, (smoking_variables&), "init_SMOKING", "smoking_init") +BE_FUNCTION(smoking_calc, std::vector, (smoking_variables&), "Calculate_cross_section", "smoking_calc") +BE_FUNCTION(smoking_finalise, int, (), "finalise_SMOKING", "smoking_finalise") + +// Initialisation function +BE_INI_FUNCTION +{ +} +END_BE_INI_FUNCTION + + +// Undefine macros to avoid conflict with other backends +#include "gambit/Backends/backend_undefs.hpp" diff --git a/ColliderBit/include/gambit/ColliderBit/ColliderBit_MC_rollcall.hpp b/ColliderBit/include/gambit/ColliderBit/ColliderBit_MC_rollcall.hpp index 1b4419041f..cf82cd5b10 100644 --- a/ColliderBit/include/gambit/ColliderBit/ColliderBit_MC_rollcall.hpp +++ b/ColliderBit/include/gambit/ColliderBit/ColliderBit_MC_rollcall.hpp @@ -154,6 +154,13 @@ NEEDS_MANAGER(RunMC, MCLoopInfo) ALLOW_MODELS(ColliderBit_SLHA_scan_model) #undef FUNCTION + + /// Get the Total CrossSection by copying the Initial Cross Section (useful when evaluating with an xsec calculator other than Pythia) + #define FUNCTION useInitialCrossSectionasFinalTotalCrossSection + START_FUNCTION(xsec_container) + NEEDS_MANAGER(RunMC, MCLoopInfo) + DEPENDENCY(PerformInitialCrossSection, initialxsec_container) + #undef FUNCTION #undef CAPABILITY /// Output info on TotalCrossSection as @@ -207,7 +214,7 @@ /// Process-level cross-sections /// @{ - /// A map between Pythia process codes and cross-sections + /// A map between process codes and cross-sections #define CAPABILITY ProcessCrossSectionsMap START_CAPABILITY #define FUNCTION getProcessCrossSectionsMap @@ -217,6 +224,13 @@ DEPENDENCY(ActiveProcessCodeToPIDPairsMap, multimap_int_PID_pair) DEPENDENCY(PIDPairCrossSectionsMap, map_PID_pair_PID_pair_xsec) #undef FUNCTION + + // Copy the initial ProcessCrossSectionMap. Useful when calculating xsecs with an external calculator + #define FUNCTION useInitialProcessCrossSectionsMapasFinal + START_FUNCTION(map_int_process_xsec) + NEEDS_MANAGER(RunMC, MCLoopInfo) + DEPENDENCY(InitialProcessCrossSections, map_str_map_int_process_xsec) + #undef FUNCTION #undef CAPABILITY /// A map between PID pairs and cross-sections @@ -227,6 +241,7 @@ NEEDS_MANAGER(RunMC, MCLoopInfo) DEPENDENCY(ActivePIDPairs, vec_PID_pair) #undef FUNCTION + #undef CAPABILITY /// Output PID pair cross-sections as a diff --git a/ColliderBit/include/gambit/ColliderBit/getPy8Collider.hpp b/ColliderBit/include/gambit/ColliderBit/getPy8Collider.hpp index 840320f049..fc2f6b4a3e 100644 --- a/ColliderBit/include/gambit/ColliderBit/getPy8Collider.hpp +++ b/ColliderBit/include/gambit/ColliderBit/getPy8Collider.hpp @@ -294,6 +294,9 @@ namespace Gambit SLHAea::Line line; \ line << 1 << 0 << "# Tell Pythia that this is a SUSY model."; \ block.push_back(line); \ + SLHAea::Line line2; \ + line2 << 6 << 3 << "# Flavour Violation in the Quark and Lepton sector."; \ + block.push_back(line2); \ result.push_front(block); \ } \ \ diff --git a/ColliderBit/include/gambit/ColliderBit/models/SUSY.hpp b/ColliderBit/include/gambit/ColliderBit/models/SUSY.hpp index b00c97d140..26ab160966 100644 --- a/ColliderBit/include/gambit/ColliderBit/models/SUSY.hpp +++ b/ColliderBit/include/gambit/ColliderBit/models/SUSY.hpp @@ -41,6 +41,7 @@ #pragma once #include "gambit/ColliderBit/models/SUSY_extras.hpp" +#include "gambit/Backends/backend_types/smoking.hpp" #define MODULE ColliderBit @@ -52,6 +53,14 @@ DEPENDENCY(SpectrumAndDecaysForPythia, SLHAstruct) #undef FUNCTION + #define FUNCTION PerformInitialCrossSection_smoking + START_FUNCTION(initialxsec_container) + DEPENDENCY(SpectrumAndDecaysForPythia, SLHAstruct) + BACKEND_REQ(smoking_init, (), int, (smoking_variables&)) + BACKEND_REQ(smoking_calc, (), std::vector, (smoking_variables&)) + BACKEND_REQ(smoking_finalise, (), int, ()) + #undef FUNCTION + #undef CAPABILITY // Construct an SLHAea object with spectrum and decays for Pythia diff --git a/ColliderBit/src/ColliderBit_smoking.cpp b/ColliderBit/src/ColliderBit_smoking.cpp new file mode 100644 index 0000000000..4100ba655d --- /dev/null +++ b/ColliderBit/src/ColliderBit_smoking.cpp @@ -0,0 +1,115 @@ +// GAMBIT: Global and Modular BSM Inference Tool +// ********************************************* +/// \file +/// +/// ColliderBit module functions for the smoking backend. +/// +/// ********************************************* +/// +/// Authors (add name and date if you modify): +/// +/// \author Christopher Chang +/// \date 2026 Apr +/// +/// ********************************************* + +#include "gambit/Elements/gambit_module_headers.hpp" +#include "gambit/ColliderBit/ColliderBit_rollcall.hpp" +#include "gambit/Backends/backend_types/smoking.hpp" +#include "gambit/ColliderBit/complete_process_PID_pair_multimaps.hpp" + +#include "gambit/Utils/slhaea_helpers.hpp" + +namespace Gambit +{ + namespace ColliderBit + { + + /// Run the smoking NLO+NLL cross-section calculation using the SLHAea object + /// already constructed by ColliderBit (normally passed to Pythia). + void PerformInitialCrossSection_smoking(initialxsec_container& result) + { + using namespace Pipes::PerformInitialCrossSection_smoking; + + SLHAstruct slhaea = *Dep::SpectrumAndDecaysForPythia; + + // Add MODSEL block if it is missing + if(slhaea.find("MODSEL") == slhaea.end()) \ + { \ + SLHAea::Block block("MODSEL"); \ + block.push_back("BLOCK MODSEL # Model selection"); \ + SLHAea::Line line; \ + line << 1 << 0 << "# Tell smoking that this is a SUSY model."; \ + block.push_back(line); \ + SLHAea::Line line2; \ + line2 << 6 << 3 << "# There is Flavour violations in squark and slepton sectors"; \ + block.push_back(line2); \ + slhaea.push_front(block); \ + } + + smoking_variables vars; + vars.slhaea = slhaea; + + BEreq::smoking_init(vars); + std::vector res = BEreq::smoking_calc(vars); // TODO: This needs to be renamed in smoking, as Result is far too generic a term + BEreq::smoking_finalise(); + + std::cout << "LO xsec from smoking: " << res[0].cross_section.central << std::endl; + + // Forming the output... + // Calculating the total cross-section as the sum of the process cross sections + std::string collider = runOptions->getValueOrDef("LHC_13TeV", "Collider"); // TODO: Support multiple Colliders (just loop through a list) + map_str_xsec_container TotalXsecContainer; + map_int_process_xsec int_proc_xsec_map; + map_str_map_int_process_xsec ProcessXsecContainer; + xsec total_xsec; + for (size_t i = 0; i < vars.pid1.size(); i++) + { + xsec cross_section = res[i].cross_section; + total_xsec = total_xsec + cross_section; + double process_xsec = cross_section.central; + double process_xsecErr = cross_section.upper - cross_section.central; + + // Look up all Pythia process codes for this (pid1, pid2) pair. + // PID_pair sorts its arguments so ordering in smoking's output doesn't matter. + PID_pair pp(vars.pid1[i], vars.pid2[i]); + auto range = all_PID_pairs_to_process_codes().equal_range(pp); + + if (range.first == range.second) + { + ColliderBit_warning().raise(LOCAL_INFO, + "smoking returned a cross-section for PID pair (" + + std::to_string(vars.pid1[i]) + ", " + std::to_string(vars.pid2[i]) + + ") that has no entry in all_PID_pairs_to_process_codes. Skipping."); + continue; + } + + std::vector codes_for_pair; + for (auto it = range.first; it != range.second; ++it) + codes_for_pair.push_back(it->second); + + // Register all Pythia codes for this PID pair, noting codes that share the xsec. + for (int code : codes_for_pair) + { + process_xsec_container newprocess; + newprocess.set_xsec(process_xsec, process_xsecErr); + newprocess.set_process_code(code); + for (int other : codes_for_pair) + if (other != code) newprocess.register_process_sharing_xsec(other); + int_proc_xsec_map[code] = newprocess; + } + } + ProcessXsecContainer[collider] = int_proc_xsec_map; + xsec_container xsContainer; + xsContainer.set_xsec(total_xsec.central, total_xsec.upper - total_xsec.central); // NOTE: Assuming symmetric uncertainty, but smoking can in theory return assymetric uncertainty + TotalXsecContainer[collider] = xsContainer; + + + result = initialxsec_container(); + result.first = TotalXsecContainer; + result.second = ProcessXsecContainer; + } + + + } +} diff --git a/ColliderBit/src/collider_event_weights.cpp b/ColliderBit/src/collider_event_weights.cpp index 43bb6e63a9..891e1f99ff 100644 --- a/ColliderBit/src/collider_event_weights.cpp +++ b/ColliderBit/src/collider_event_weights.cpp @@ -62,7 +62,20 @@ namespace Gambit #endif // Get the process_xsec_container instance that holds the externally provided cross-section for this process - process_xsec_container xs = ProcessCrossSectionsMap.at(process_code); + auto it = ProcessCrossSectionsMap.find(process_code); + if (it == ProcessCrossSectionsMap.end()) + { + std::stringstream errmsg_ss; + errmsg_ss << "setEventWeight_fromCrossSection: Pythia generated an event with process code " + << process_code << ", but no external cross-section is available for this process. " + << "Your collider settings are generating processes that your cross-section provider " + << "does not cover. Either restrict the Pythia process settings to only the processes " + << "your cross-section provider computes (e.g. replace 'SUSY:all = on' with explicit " + << "process switches), or use setEventWeight_unity instead."; + piped_errors.request(LOCAL_INFO, errmsg_ss.str()); + return; + } + process_xsec_container xs = it->second; // Get the generator cross-section for this process double process_xsec_generator = HardScatteringSim_ptr->xsec_fb(process_code); diff --git a/ColliderBit/src/getxsec.cpp b/ColliderBit/src/getxsec.cpp index 816687c95c..d185725ecb 100644 --- a/ColliderBit/src/getxsec.cpp +++ b/ColliderBit/src/getxsec.cpp @@ -1912,5 +1912,26 @@ namespace Gambit } // end InitialTotalCrossSection_YAMLSLHA + /// Copy the Initial CrossSection estimate into the Final as the Total CrossSection + /// This is useful when evalutating both using e.g. NLO xsec calculators + void useInitialCrossSectionasFinalTotalCrossSection(xsec_container& result) + { + using namespace Pipes::useInitialCrossSectionasFinalTotalCrossSection; + std::string collider = Dep::RunMC->current_collider(); + + initialxsec_container initial_xsec = *Dep::PerformInitialCrossSection; + result = initial_xsec.first[collider]; + } + + // Same but for process xsecs + void useInitialProcessCrossSectionsMapasFinal(map_int_process_xsec& result) + { + using namespace Pipes::useInitialProcessCrossSectionsMapasFinal; + std::string collider = Dep::RunMC->current_collider(); + + map_str_map_int_process_xsec initial_process_xsecs = *Dep::InitialProcessCrossSections; + result = initial_process_xsecs[collider]; + } + } } diff --git a/Elements/include/gambit/Elements/sminputs.hpp b/Elements/include/gambit/Elements/sminputs.hpp index 582fdefa95..916f092f34 100644 --- a/Elements/include/gambit/Elements/sminputs.hpp +++ b/Elements/include/gambit/Elements/sminputs.hpp @@ -21,6 +21,8 @@ #include "gambit/Utils/slhaea_helpers.hpp" #include "gambit/Utils/numerical_constants.hpp" +#include +#include namespace Gambit { @@ -87,6 +89,10 @@ namespace Gambit double delta13; // the Dirac CP-violating phase double alpha1; // the first Majorana CP-violating phase double alpha2; // the second CP-violating Majorana phase + + // Returns the full 3x3 complex UPMNS matrix using the standard PDG parameterisation. + // Indices are zero-based: U[i][j]. + std::array,3>,3> get_matrix() const; }; PMNSdef PMNS; diff --git a/Elements/src/sminputs.cpp b/Elements/src/sminputs.cpp index a93683fbdc..4e15002a9b 100644 --- a/Elements/src/sminputs.cpp +++ b/Elements/src/sminputs.cpp @@ -18,10 +18,35 @@ #include "gambit/Utils/standalone_error_handlers.hpp" #include "gambit/Elements/sminputs.hpp" #include "gambit/Elements/mssm_slhahelp.hpp" +#include +#include namespace Gambit { + std::array,3>,3> SMInputs::PMNSdef::get_matrix() const + { + using std::sin; using std::cos; using std::polar; + const double s12 = sin(theta12), c12 = cos(theta12); + const double s13 = sin(theta13), c13 = cos(theta13); + const double s23 = sin(theta23), c23 = cos(theta23); + const std::complex eid = polar(1.0, delta13); + const std::complex eia1 = polar(1.0, 0.5 * alpha1); + const std::complex eia2 = polar(1.0, 0.5 * alpha2); + + std::array,3>,3> U; + U[0][0] = c12 * c13 * eia1; + U[0][1] = s12 * c13 * eia2; + U[0][2] = s13 / eid; + U[1][0] = (-s12 * c23 - c12 * s23 * s13 * eid) * eia1; + U[1][1] = ( c12 * c23 - s12 * s23 * s13 * eid) * eia2; + U[1][2] = s23 * c13; + U[2][0] = ( s12 * s23 - c12 * c23 * s13 * eid) * eia1; + U[2][1] = (-c12 * s23 - s12 * c23 * s13 * eid) * eia2; + U[2][2] = c23 * c13; + return U; + } + // Create an SMInputs struct from an SLHAea object SMInputs::SMInputs(SLHAea::Coll& data) { @@ -128,6 +153,17 @@ namespace Gambit SLHAea_add(data,"UPMNSIN",5, PMNS.alpha1 , "alpha1 (first Majorana CP-violating phase)" ); SLHAea_add(data,"UPMNSIN",6, PMNS.alpha2 , "alpha2 (second CP-violating Majorana phase)"); + // UPMNS and IMUPMNS blocks (real and imaginary parts of the full mixing matrix) + SLHAea_add_block(data,"UPMNS"); + SLHAea_add_block(data,"IMUPMNS"); + auto U = PMNS.get_matrix(); + for (int i = 1; i <= 3; i++) + for (int j = 1; j <= 3; j++) + { + SLHAea_add(data,"UPMNS", i, j, U[i-1][j-1].real(), "Re(UPMNS_"+std::to_string(i)+std::to_string(j)+")"); + SLHAea_add(data,"IMUPMNS",i, j, U[i-1][j-1].imag(), "Im(UPMNS_"+std::to_string(i)+std::to_string(j)+")"); + } + // MASS block SLHAea_add(data,"MASS", 24, mW, "mW(pole)"); diff --git a/cmake/backends.cmake b/cmake/backends.cmake index cd447dae61..3877c4df84 100644 --- a/cmake/backends.cmake +++ b/cmake/backends.cmake @@ -664,6 +664,40 @@ if(NOT ditched_${name}_${ver}) set_as_default_version("backend" ${name} ${ver}) endif() +# smoking +# Builds libsmoking_gambit.so via the smoking cmake build system. +# The shared library exposes three extern "C" functions: +# init_SMOKING, Calculate_cross_section, finalise_SMOKING +set(name "smoking") +set(ver "1.0.0") +set(lib "libsmoking_gambit") +set(dl "https://github.com/ahye/smoking/archive/refs/heads/gambit_interface.zip") +set(md5 "a7f0eafbeae04b9935dacf0f0dbf5c7f") +set(dir "${PROJECT_SOURCE_DIR}/Backends/installed/${name}/${ver}") + +set(smoking_CXX_FLAGS "${BACKEND_CXX_FLAGS}") + +check_ditch_status(${name} ${ver} ${dir}) +if(NOT ditched_${name}_${ver}) + ExternalProject_Add(${name}_${ver} + DOWNLOAD_COMMAND echo "WARNING: This is a WIP backend until Smoking is publicly released. Please provide a tarball to use this backend. Look forward to updates from the Oslo group :)" && ${DL_BACKEND} ${dl} ${md5} ${dir} ${name} ${ver} # TODO: Delete this line when smoking is publicly released + #DOWNLOAD_COMMAND ${DL_BACKEND} ${dl} ${md5} ${dir} ${name} ${ver} + SOURCE_DIR ${dir} + PATCH_COMMAND "" + CMAKE_ARGS + -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} + -DCMAKE_CXX_FLAGS=${smoking_CXX_FLAGS} + -DCMAKE_C_FLAGS=${BACKEND_C_FLAGS} + -DCMAKE_Fortran_COMPILER=${CMAKE_Fortran_COMPILER} + -DCMAKE_BUILD_TYPE=Debug # TODO: Change to Release + -DPYTHON_EXECUTABLE=${PYTHON_EXECUTABLE} + -DWITH_GAMBIT_INTERFACE=ON + BUILD_COMMAND ${MAKE_PARALLEL} smoking_gambit + INSTALL_COMMAND "" + ) + add_extra_targets("backend" ${name} ${ver} ${dir} ${dl} clean) + set_as_default_version("backend" ${name} ${ver}) +endif() # DDCalc set(name "ddcalc") diff --git a/cmake/contrib.cmake b/cmake/contrib.cmake index 1585d1d7e8..867a99de36 100644 --- a/cmake/contrib.cmake +++ b/cmake/contrib.cmake @@ -103,7 +103,7 @@ add_dependencies(contrib mkpath) #contrib/yaml-cpp-0.6.2 set(yaml_INCLUDE_DIR ${PROJECT_SOURCE_DIR}/contrib/yaml-cpp-0.6.2/include) -include_directories("${yaml_INCLUDE_DIR}") +include_directories(SYSTEM "${yaml_INCLUDE_DIR}") add_definitions(-DYAML_CPP_DLL) add_subdirectory(${PROJECT_SOURCE_DIR}/contrib/yaml-cpp-0.6.2 EXCLUDE_FROM_ALL) diff --git a/config/backend_locations.yaml.default b/config/backend_locations.yaml.default index dc564a98c0..c337abb141 100644 --- a/config/backend_locations.yaml.default +++ b/config/backend_locations.yaml.default @@ -133,6 +133,9 @@ obscura: pbarlike: 1.0: ./Backends/installed/pbarlike/1.0/pbarlike-gambit-interface.py +smoking: + 1.0.0: ./Backends/installed/smoking/1.0.0/lib/libsmoking_gambit.so + Rivet: 3.1.5: ./Backends/installed/rivet/3.1.5/local/lib/libRivet.so diff --git a/config/bibtex_entries.bib b/config/bibtex_entries.bib index 92df7f6058..32aec7abd2 100644 --- a/config/bibtex_entries.bib +++ b/config/bibtex_entries.bib @@ -1,3 +1,20 @@ +@article{TODO, + author = "TODO", + collaboration = "TODO", + title = "TODO", + eprint = "TODO", + archivePrefix = "TODO", + primaryClass = "TODO", + reportNumber = "TODO", + doi = "TODO", + journal = "TODO", + volume = "TODO", + number = "TODO", + pages = "TODO", + year = "TODO", + note = "TODO" +} + # GAMBIT @article{GAMBIT:2017yxo, author = "Athron, Peter and others",