From 75eca7a61d42f8eb5172881b9fe8163d824e1160 Mon Sep 17 00:00:00 2001 From: ChrisJChang Date: Wed, 3 Jun 2026 15:18:34 +0200 Subject: [PATCH] Reapply "Move printable types out of printer code, and create dedicated observables for printable versions of:" This reverts commit 5c5b618f3f0840b18b5615aed14ef3e3236f811d. --- .../gambit/CosmoBit/CosmoBit_rollcall.hpp | 8 +++ CosmoBit/src/BBN.cpp | 28 +++++++++ .../gambit/DarkBit/DarkBit_rollcall.hpp | 4 ++ DarkBit/src/DirectDetection.cpp | 11 ++++ .../gambit/Elements/printable_types.hpp | 6 +- .../gambit/FlavBit/FlavBit_rollcall.hpp | 49 +++++++++++++++ FlavBit/src/FlavBit.cpp | 60 +++++++++++++++++++ .../include/gambit/Printers/baseprinter.hpp | 5 ++ .../gambit/Printers/printers/asciiprinter.hpp | 3 - .../gambit/Printers/printers/asciireader.hpp | 3 - .../gambit/Printers/printers/asciitypes.hpp | 5 -- .../printers/common_print_overloads.hpp | 38 ------------ .../gambit/Printers/printers/coutprinter.hpp | 3 - .../gambit/Printers/printers/hdf5printer.hpp | 3 - .../Printers/printers/hdf5printer_v2.hpp | 3 - .../gambit/Printers/printers/hdf5reader.hpp | 3 - .../gambit/Printers/printers/hdf5types.hpp | 5 -- .../gambit/Printers/printers/noneprinter.hpp | 3 - .../Printers/printers/sqliteprinter.hpp | 3 - .../gambit/Printers/printers/sqlitereader.hpp | 3 - .../gambit/Printers/printers/sqlitetypes.hpp | 3 - .../printers/asciiprinter/print_overloads.cpp | 6 -- .../asciiprinter/retrieve_overloads.cpp | 11 ---- .../printers/coutprinter/print_overloads.cpp | 6 -- .../printers/hdf5printer/print_overloads.cpp | 6 -- .../hdf5printer/retrieve_overloads.cpp | 7 --- .../hdf5printer_v2/print_overloads.cpp | 6 -- .../sqliteprinter/print_overloads.cpp | 5 -- .../sqliteprinter/retrieve_overloads.cpp | 8 --- 29 files changed, 166 insertions(+), 138 deletions(-) diff --git a/CosmoBit/include/gambit/CosmoBit/CosmoBit_rollcall.hpp b/CosmoBit/include/gambit/CosmoBit/CosmoBit_rollcall.hpp index 22ac491805..7c24eb9186 100644 --- a/CosmoBit/include/gambit/CosmoBit/CosmoBit_rollcall.hpp +++ b/CosmoBit/include/gambit/CosmoBit/CosmoBit_rollcall.hpp @@ -974,6 +974,14 @@ START_MODULE #undef FUNCTION #undef CAPABILITY + // Printable forms of BBN_container capabilities: convert to map_str_dbl + QUICK_FUNCTION(CosmoBit, printable_primordial_abundances_BBN, NEW_CAPABILITY, + printable_primordial_abundances_BBN_impl, map_str_dbl, (), + (primordial_abundances_BBN, BBN_container)) + QUICK_FUNCTION(CosmoBit, printable_primordial_abundances, NEW_CAPABILITY, + printable_primordial_abundances_impl, map_str_dbl, (), + (primordial_abundances, BBN_container)) + /// compute primordial helium abundance #define CAPABILITY helium_abundance START_CAPABILITY diff --git a/CosmoBit/src/BBN.cpp b/CosmoBit/src/BBN.cpp index 9f585d8c76..c7531c8770 100644 --- a/CosmoBit/src/BBN.cpp +++ b/CosmoBit/src/BBN.cpp @@ -786,6 +786,34 @@ namespace Gambit gsl_permutation_free(p); } + namespace + { + // Shared conversion logic for BBN_container -> map_str_dbl + map_str_dbl bbn_container_to_map(const BBN_container& bbn) + { + map_str_dbl m; + for (const str& i : bbn.get_active_isotopes()) + { + int idx = bbn.get_abund_map().at(i); + m[i] = bbn.get_BBN_abund(idx); + m[i + "::1sigma_err"] = sqrt(bbn.get_BBN_covmat(idx, idx)); + } + return m; + } + } + + void printable_primordial_abundances_BBN_impl(map_str_dbl& result) + { + using namespace Pipes::printable_primordial_abundances_BBN_impl; + result = bbn_container_to_map(*Dep::primordial_abundances_BBN); + } + + void printable_primordial_abundances_impl(map_str_dbl& result) + { + using namespace Pipes::printable_primordial_abundances_impl; + result = bbn_container_to_map(*Dep::primordial_abundances); + } + } // namespace CosmoBit } // namespace Gambit diff --git a/DarkBit/include/gambit/DarkBit/DarkBit_rollcall.hpp b/DarkBit/include/gambit/DarkBit/DarkBit_rollcall.hpp index 2313e61528..d9188f32a3 100644 --- a/DarkBit/include/gambit/DarkBit/DarkBit_rollcall.hpp +++ b/DarkBit/include/gambit/DarkBit/DarkBit_rollcall.hpp @@ -1472,6 +1472,10 @@ START_MODULE #undef CAPABILITY + // Printable form of DD_couplings: converts DM_nucleon_couplings to map_str_dbl + QUICK_FUNCTION(DarkBit, printable_DD_couplings, NEW_CAPABILITY, printable_DD_couplings_impl, map_str_dbl, (), + (DD_couplings, DM_nucleon_couplings)) + // Relativistic Wilson coefficients defined in the 5(or 4 or 3) flavscheme #define CAPABILITY DD_rel_WCs_flavscheme diff --git a/DarkBit/src/DirectDetection.cpp b/DarkBit/src/DirectDetection.cpp index d853740788..5c504cdc40 100644 --- a/DarkBit/src/DirectDetection.cpp +++ b/DarkBit/src/DirectDetection.cpp @@ -821,5 +821,16 @@ namespace Gambit } */ + void printable_DD_couplings_impl(map_str_dbl& result) + { + using namespace Pipes::printable_DD_couplings_impl; + result.clear(); + result["Gp_SI"] = Dep::DD_couplings->gps; + result["Gn_SI"] = Dep::DD_couplings->gns; + result["Gp_SD"] = Dep::DD_couplings->gpa; + result["Gn_SD"] = Dep::DD_couplings->gna; + } + } + } diff --git a/Elements/include/gambit/Elements/printable_types.hpp b/Elements/include/gambit/Elements/printable_types.hpp index fc14714973..9debdf9d40 100644 --- a/Elements/include/gambit/Elements/printable_types.hpp +++ b/Elements/include/gambit/Elements/printable_types.hpp @@ -19,7 +19,6 @@ #ifndef __printable_types_hpp__ #define __printable_types_hpp__ -#include "gambit/Elements/types_rollcall.hpp" #include "gambit/ScannerBit/printable_types.hpp" // Types that Gambit printers can output (if printer plugin is properly equipped) @@ -29,10 +28,7 @@ (map_str_map_str_dbl) \ (map_const_str_map_const_str_dbl) \ (map_intpair_dbl) \ - (triplet) \ - (flav_prediction) \ - (DM_nucleon_couplings) \ - (BBN_container) + (triplet) // Types that can be retrieved from Gambit printer output (if printer plugin is properly equipped) // Generally needs to be the same as the printable types, i.e. should be able to retrieve everything. diff --git a/FlavBit/include/gambit/FlavBit/FlavBit_rollcall.hpp b/FlavBit/include/gambit/FlavBit/FlavBit_rollcall.hpp index 92926ae072..0195c6b1eb 100644 --- a/FlavBit/include/gambit/FlavBit/FlavBit_rollcall.hpp +++ b/FlavBit/include/gambit/FlavBit/FlavBit_rollcall.hpp @@ -1544,6 +1544,55 @@ START_MODULE #undef CAPABILITY + // Printable forms of flav_prediction capabilities: central values as map_const_str_dbl + QUICK_FUNCTION(FlavBit, printable_prediction_B2mumu, NEW_CAPABILITY, printable_prediction_B2mumu_impl, map_str_dbl, (), (prediction_B2mumu, flav_prediction)) + QUICK_FUNCTION(FlavBit, printable_prediction_B2taunu, NEW_CAPABILITY, printable_prediction_B2taunu_impl, map_str_dbl, (), (prediction_B2taunu, flav_prediction)) + QUICK_FUNCTION(FlavBit, printable_prediction_RDRDstar, NEW_CAPABILITY, printable_prediction_RDRDstar_impl, map_str_dbl, (), (prediction_RDRDstar, flav_prediction)) + QUICK_FUNCTION(FlavBit, printable_prediction_b2sgamma, NEW_CAPABILITY, printable_prediction_b2sgamma_impl, map_str_dbl, (), (prediction_b2sgamma, flav_prediction)) + QUICK_FUNCTION(FlavBit, printable_prediction_B2Kstargamma, NEW_CAPABILITY, printable_prediction_B2Kstargamma_impl, map_str_dbl, (), (prediction_B2Kstargamma, flav_prediction)) + QUICK_FUNCTION(FlavBit, printable_prediction_BRBXsmumu_lowq2, NEW_CAPABILITY, printable_prediction_BRBXsmumu_lowq2_impl, map_str_dbl, (), (prediction_BRBXsmumu_lowq2, flav_prediction)) + QUICK_FUNCTION(FlavBit, printable_prediction_BRBXsmumu_highq2, NEW_CAPABILITY, printable_prediction_BRBXsmumu_highq2_impl, map_str_dbl, (), (prediction_BRBXsmumu_highq2, flav_prediction)) + QUICK_FUNCTION(FlavBit, printable_prediction_AFBBXsmumu_lowq2, NEW_CAPABILITY, printable_prediction_AFBBXsmumu_lowq2_impl, map_str_dbl, (), (prediction_AFBBXsmumu_lowq2, flav_prediction)) + QUICK_FUNCTION(FlavBit, printable_prediction_AFBBXsmumu_highq2, NEW_CAPABILITY, printable_prediction_AFBBXsmumu_highq2_impl, map_str_dbl, (), (prediction_AFBBXsmumu_highq2, flav_prediction)) + QUICK_FUNCTION(FlavBit, printable_prediction_B2KstarmumuBr_0p1_0p98, NEW_CAPABILITY, printable_prediction_B2KstarmumuBr_0p1_0p98_impl, map_str_dbl, (), (prediction_B2KstarmumuBr_0p1_0p98, flav_prediction)) + QUICK_FUNCTION(FlavBit, printable_prediction_B2KstarmumuBr_1p1_2p5, NEW_CAPABILITY, printable_prediction_B2KstarmumuBr_1p1_2p5_impl, map_str_dbl, (), (prediction_B2KstarmumuBr_1p1_2p5, flav_prediction)) + QUICK_FUNCTION(FlavBit, printable_prediction_B2KstarmumuBr_2p5_4, NEW_CAPABILITY, printable_prediction_B2KstarmumuBr_2p5_4_impl, map_str_dbl, (), (prediction_B2KstarmumuBr_2p5_4, flav_prediction)) + QUICK_FUNCTION(FlavBit, printable_prediction_B2KstarmumuBr_4_6, NEW_CAPABILITY, printable_prediction_B2KstarmumuBr_4_6_impl, map_str_dbl, (), (prediction_B2KstarmumuBr_4_6, flav_prediction)) + QUICK_FUNCTION(FlavBit, printable_prediction_B2KstarmumuBr_6_8, NEW_CAPABILITY, printable_prediction_B2KstarmumuBr_6_8_impl, map_str_dbl, (), (prediction_B2KstarmumuBr_6_8, flav_prediction)) + QUICK_FUNCTION(FlavBit, printable_prediction_B2KstarmumuBr_15_19, NEW_CAPABILITY, printable_prediction_B2KstarmumuBr_15_19_impl, map_str_dbl, (), (prediction_B2KstarmumuBr_15_19, flav_prediction)) + QUICK_FUNCTION(FlavBit, printable_prediction_B2KmumuBr_0p05_2, NEW_CAPABILITY, printable_prediction_B2KmumuBr_0p05_2_impl, map_str_dbl, (), (prediction_B2KmumuBr_0p05_2, flav_prediction)) + QUICK_FUNCTION(FlavBit, printable_prediction_B2KmumuBr_2_4p3, NEW_CAPABILITY, printable_prediction_B2KmumuBr_2_4p3_impl, map_str_dbl, (), (prediction_B2KmumuBr_2_4p3, flav_prediction)) + QUICK_FUNCTION(FlavBit, printable_prediction_B2KmumuBr_4p3_8p68, NEW_CAPABILITY, printable_prediction_B2KmumuBr_4p3_8p68_impl, map_str_dbl, (), (prediction_B2KmumuBr_4p3_8p68, flav_prediction)) + QUICK_FUNCTION(FlavBit, printable_prediction_B2KmumuBr_14p18_16, NEW_CAPABILITY, printable_prediction_B2KmumuBr_14p18_16_impl, map_str_dbl, (), (prediction_B2KmumuBr_14p18_16, flav_prediction)) + QUICK_FUNCTION(FlavBit, printable_prediction_B2KmumuBr_16_18, NEW_CAPABILITY, printable_prediction_B2KmumuBr_16_18_impl, map_str_dbl, (), (prediction_B2KmumuBr_16_18, flav_prediction)) + QUICK_FUNCTION(FlavBit, printable_prediction_B2KmumuBr_18_22, NEW_CAPABILITY, printable_prediction_B2KmumuBr_18_22_impl, map_str_dbl, (), (prediction_B2KmumuBr_18_22, flav_prediction)) + QUICK_FUNCTION(FlavBit, printable_prediction_Bs2phimumuBr_1_6, NEW_CAPABILITY, printable_prediction_Bs2phimumuBr_1_6_impl, map_str_dbl, (), (prediction_Bs2phimumuBr_1_6, flav_prediction)) + QUICK_FUNCTION(FlavBit, printable_prediction_Bs2phimumuBr_15_19, NEW_CAPABILITY, printable_prediction_Bs2phimumuBr_15_19_impl, map_str_dbl, (), (prediction_Bs2phimumuBr_15_19, flav_prediction)) + QUICK_FUNCTION(FlavBit, printable_prediction_B2KstarmumuAng_0p1_2_Atlas, NEW_CAPABILITY, printable_prediction_B2KstarmumuAng_0p1_2_Atlas_impl, map_str_dbl, (), (prediction_B2KstarmumuAng_0p1_2_Atlas, flav_prediction)) + QUICK_FUNCTION(FlavBit, printable_prediction_B2KstarmumuAng_2_4_Atlas, NEW_CAPABILITY, printable_prediction_B2KstarmumuAng_2_4_Atlas_impl, map_str_dbl, (), (prediction_B2KstarmumuAng_2_4_Atlas, flav_prediction)) + QUICK_FUNCTION(FlavBit, printable_prediction_B2KstarmumuAng_4_8_Atlas, NEW_CAPABILITY, printable_prediction_B2KstarmumuAng_4_8_Atlas_impl, map_str_dbl, (), (prediction_B2KstarmumuAng_4_8_Atlas, flav_prediction)) + QUICK_FUNCTION(FlavBit, printable_prediction_B2KstarmumuAng_1_2_CMS, NEW_CAPABILITY, printable_prediction_B2KstarmumuAng_1_2_CMS_impl, map_str_dbl, (), (prediction_B2KstarmumuAng_1_2_CMS, flav_prediction)) + QUICK_FUNCTION(FlavBit, printable_prediction_B2KstarmumuAng_2_4p3_CMS, NEW_CAPABILITY, printable_prediction_B2KstarmumuAng_2_4p3_CMS_impl, map_str_dbl, (), (prediction_B2KstarmumuAng_2_4p3_CMS, flav_prediction)) + QUICK_FUNCTION(FlavBit, printable_prediction_B2KstarmumuAng_4p3_6_CMS, NEW_CAPABILITY, printable_prediction_B2KstarmumuAng_4p3_6_CMS_impl, map_str_dbl, (), (prediction_B2KstarmumuAng_4p3_6_CMS, flav_prediction)) + QUICK_FUNCTION(FlavBit, printable_prediction_B2KstarmumuAng_6_8p68_CMS, NEW_CAPABILITY, printable_prediction_B2KstarmumuAng_6_8p68_CMS_impl, map_str_dbl, (), (prediction_B2KstarmumuAng_6_8p68_CMS, flav_prediction)) + QUICK_FUNCTION(FlavBit, printable_prediction_B2KstarmumuAng_10p09_12p86_CMS, NEW_CAPABILITY, printable_prediction_B2KstarmumuAng_10p09_12p86_CMS_impl, map_str_dbl, (), (prediction_B2KstarmumuAng_10p09_12p86_CMS, flav_prediction)) + QUICK_FUNCTION(FlavBit, printable_prediction_B2KstarmumuAng_14p18_16_CMS, NEW_CAPABILITY, printable_prediction_B2KstarmumuAng_14p18_16_CMS_impl, map_str_dbl, (), (prediction_B2KstarmumuAng_14p18_16_CMS, flav_prediction)) + QUICK_FUNCTION(FlavBit, printable_prediction_B2KstarmumuAng_16_19_CMS, NEW_CAPABILITY, printable_prediction_B2KstarmumuAng_16_19_CMS_impl, map_str_dbl, (), (prediction_B2KstarmumuAng_16_19_CMS, flav_prediction)) + QUICK_FUNCTION(FlavBit, printable_prediction_B2KstarmumuAng_0p1_4_Belle, NEW_CAPABILITY, printable_prediction_B2KstarmumuAng_0p1_4_Belle_impl, map_str_dbl, (), (prediction_B2KstarmumuAng_0p1_4_Belle, flav_prediction)) + QUICK_FUNCTION(FlavBit, printable_prediction_B2KstarmumuAng_4_8_Belle, NEW_CAPABILITY, printable_prediction_B2KstarmumuAng_4_8_Belle_impl, map_str_dbl, (), (prediction_B2KstarmumuAng_4_8_Belle, flav_prediction)) + QUICK_FUNCTION(FlavBit, printable_prediction_B2KstarmumuAng_10p9_12p9_Belle, NEW_CAPABILITY, printable_prediction_B2KstarmumuAng_10p9_12p9_Belle_impl, map_str_dbl, (), (prediction_B2KstarmumuAng_10p9_12p9_Belle, flav_prediction)) + QUICK_FUNCTION(FlavBit, printable_prediction_B2KstarmumuAng_14p18_19_Belle, NEW_CAPABILITY, printable_prediction_B2KstarmumuAng_14p18_19_Belle_impl, map_str_dbl, (), (prediction_B2KstarmumuAng_14p18_19_Belle, flav_prediction)) + QUICK_FUNCTION(FlavBit, printable_prediction_B2KstarmumuAng_0p1_0p98_LHCb, NEW_CAPABILITY, printable_prediction_B2KstarmumuAng_0p1_0p98_LHCb_impl, map_str_dbl, (), (prediction_B2KstarmumuAng_0p1_0p98_LHCb, flav_prediction)) + QUICK_FUNCTION(FlavBit, printable_prediction_B2KstarmumuAng_1p1_2p5_LHCb, NEW_CAPABILITY, printable_prediction_B2KstarmumuAng_1p1_2p5_LHCb_impl, map_str_dbl, (), (prediction_B2KstarmumuAng_1p1_2p5_LHCb, flav_prediction)) + QUICK_FUNCTION(FlavBit, printable_prediction_B2KstarmumuAng_2p5_4_LHCb, NEW_CAPABILITY, printable_prediction_B2KstarmumuAng_2p5_4_LHCb_impl, map_str_dbl, (), (prediction_B2KstarmumuAng_2p5_4_LHCb, flav_prediction)) + QUICK_FUNCTION(FlavBit, printable_prediction_B2KstarmumuAng_4_6_LHCb, NEW_CAPABILITY, printable_prediction_B2KstarmumuAng_4_6_LHCb_impl, map_str_dbl, (), (prediction_B2KstarmumuAng_4_6_LHCb, flav_prediction)) + QUICK_FUNCTION(FlavBit, printable_prediction_B2KstarmumuAng_6_8_LHCb, NEW_CAPABILITY, printable_prediction_B2KstarmumuAng_6_8_LHCb_impl, map_str_dbl, (), (prediction_B2KstarmumuAng_6_8_LHCb, flav_prediction)) + QUICK_FUNCTION(FlavBit, printable_prediction_B2KstarmumuAng_15_19_LHCb, NEW_CAPABILITY, printable_prediction_B2KstarmumuAng_15_19_LHCb_impl, map_str_dbl, (), (prediction_B2KstarmumuAng_15_19_LHCb, flav_prediction)) + QUICK_FUNCTION(FlavBit, printable_prediction_B2KstareeAng_0p0008_0p257_LHCb, NEW_CAPABILITY, printable_prediction_B2KstareeAng_0p0008_0p257_LHCb_impl, map_str_dbl, (), (prediction_B2KstareeAng_0p0008_0p257_LHCb, flav_prediction)) + QUICK_FUNCTION(FlavBit, printable_prediction_RK_LHCb_1p1_6, NEW_CAPABILITY, printable_prediction_RK_LHCb_1p1_6_impl, map_str_dbl, (), (prediction_RK_LHCb_1p1_6, flav_prediction)) + QUICK_FUNCTION(FlavBit, printable_prediction_RKstar_LHCb_0p045_1p1, NEW_CAPABILITY, printable_prediction_RKstar_LHCb_0p045_1p1_impl, map_str_dbl, (), (prediction_RKstar_LHCb_0p045_1p1, flav_prediction)) + QUICK_FUNCTION(FlavBit, printable_prediction_RKstar_LHCb_1p1_6, NEW_CAPABILITY, printable_prediction_RKstar_LHCb_1p1_6_impl, map_str_dbl, (), (prediction_RKstar_LHCb_1p1_6, flav_prediction)) + #undef REFERENCE #undef MODULE diff --git a/FlavBit/src/FlavBit.cpp b/FlavBit/src/FlavBit.cpp index da0fd2a0c9..c9b91bacd7 100644 --- a/FlavBit/src/FlavBit.cpp +++ b/FlavBit/src/FlavBit.cpp @@ -3093,5 +3093,65 @@ namespace Gambit } + // Shared conversion logic: flav_prediction central values -> map_str_dbl + #define FLAV_PRINTABLE_IMPL(cap) \ + void printable_##cap##_impl(map_str_dbl& result) \ + { \ + using namespace Pipes::printable_##cap##_impl; \ + result.clear(); \ + for (const auto& kv : Dep::cap->central_values) result[kv.first] = kv.second; \ + } + + FLAV_PRINTABLE_IMPL(prediction_B2mumu) + FLAV_PRINTABLE_IMPL(prediction_B2taunu) + FLAV_PRINTABLE_IMPL(prediction_RDRDstar) + FLAV_PRINTABLE_IMPL(prediction_b2sgamma) + FLAV_PRINTABLE_IMPL(prediction_B2Kstargamma) + FLAV_PRINTABLE_IMPL(prediction_BRBXsmumu_lowq2) + FLAV_PRINTABLE_IMPL(prediction_BRBXsmumu_highq2) + FLAV_PRINTABLE_IMPL(prediction_AFBBXsmumu_lowq2) + FLAV_PRINTABLE_IMPL(prediction_AFBBXsmumu_highq2) + FLAV_PRINTABLE_IMPL(prediction_B2KstarmumuBr_0p1_0p98) + FLAV_PRINTABLE_IMPL(prediction_B2KstarmumuBr_1p1_2p5) + FLAV_PRINTABLE_IMPL(prediction_B2KstarmumuBr_2p5_4) + FLAV_PRINTABLE_IMPL(prediction_B2KstarmumuBr_4_6) + FLAV_PRINTABLE_IMPL(prediction_B2KstarmumuBr_6_8) + FLAV_PRINTABLE_IMPL(prediction_B2KstarmumuBr_15_19) + FLAV_PRINTABLE_IMPL(prediction_B2KmumuBr_0p05_2) + FLAV_PRINTABLE_IMPL(prediction_B2KmumuBr_2_4p3) + FLAV_PRINTABLE_IMPL(prediction_B2KmumuBr_4p3_8p68) + FLAV_PRINTABLE_IMPL(prediction_B2KmumuBr_14p18_16) + FLAV_PRINTABLE_IMPL(prediction_B2KmumuBr_16_18) + FLAV_PRINTABLE_IMPL(prediction_B2KmumuBr_18_22) + FLAV_PRINTABLE_IMPL(prediction_Bs2phimumuBr_1_6) + FLAV_PRINTABLE_IMPL(prediction_Bs2phimumuBr_15_19) + FLAV_PRINTABLE_IMPL(prediction_B2KstarmumuAng_0p1_2_Atlas) + FLAV_PRINTABLE_IMPL(prediction_B2KstarmumuAng_2_4_Atlas) + FLAV_PRINTABLE_IMPL(prediction_B2KstarmumuAng_4_8_Atlas) + FLAV_PRINTABLE_IMPL(prediction_B2KstarmumuAng_1_2_CMS) + FLAV_PRINTABLE_IMPL(prediction_B2KstarmumuAng_2_4p3_CMS) + FLAV_PRINTABLE_IMPL(prediction_B2KstarmumuAng_4p3_6_CMS) + FLAV_PRINTABLE_IMPL(prediction_B2KstarmumuAng_6_8p68_CMS) + FLAV_PRINTABLE_IMPL(prediction_B2KstarmumuAng_10p09_12p86_CMS) + FLAV_PRINTABLE_IMPL(prediction_B2KstarmumuAng_14p18_16_CMS) + FLAV_PRINTABLE_IMPL(prediction_B2KstarmumuAng_16_19_CMS) + FLAV_PRINTABLE_IMPL(prediction_B2KstarmumuAng_0p1_4_Belle) + FLAV_PRINTABLE_IMPL(prediction_B2KstarmumuAng_4_8_Belle) + FLAV_PRINTABLE_IMPL(prediction_B2KstarmumuAng_10p9_12p9_Belle) + FLAV_PRINTABLE_IMPL(prediction_B2KstarmumuAng_14p18_19_Belle) + FLAV_PRINTABLE_IMPL(prediction_B2KstarmumuAng_0p1_0p98_LHCb) + FLAV_PRINTABLE_IMPL(prediction_B2KstarmumuAng_1p1_2p5_LHCb) + FLAV_PRINTABLE_IMPL(prediction_B2KstarmumuAng_2p5_4_LHCb) + FLAV_PRINTABLE_IMPL(prediction_B2KstarmumuAng_4_6_LHCb) + FLAV_PRINTABLE_IMPL(prediction_B2KstarmumuAng_6_8_LHCb) + FLAV_PRINTABLE_IMPL(prediction_B2KstarmumuAng_15_19_LHCb) + FLAV_PRINTABLE_IMPL(prediction_B2KstareeAng_0p0008_0p257_LHCb) + FLAV_PRINTABLE_IMPL(prediction_RK_LHCb_1p1_6) + FLAV_PRINTABLE_IMPL(prediction_RKstar_LHCb_0p045_1p1) + FLAV_PRINTABLE_IMPL(prediction_RKstar_LHCb_1p1_6) + + #undef FLAV_PRINTABLE_IMPL + } + } diff --git a/Printers/include/gambit/Printers/baseprinter.hpp b/Printers/include/gambit/Printers/baseprinter.hpp index 0cafe56f20..c7a230f338 100644 --- a/Printers/include/gambit/Printers/baseprinter.hpp +++ b/Printers/include/gambit/Printers/baseprinter.hpp @@ -39,6 +39,11 @@ // Boost #include +// MSSM_SLHAstruct and SMslha_SLHAstruct are in RETRIEVABLE_TYPES and need their definitions here +#ifndef SCANNER_STANDALONE + #include "gambit/Utils/slhaea_helpers.hpp" +#endif + // Printable types #ifndef SCANNER_STANDALONE // If we are in a main gambit executable, we need to know all the GAMBIT printable types diff --git a/Printers/include/gambit/Printers/printers/asciiprinter.hpp b/Printers/include/gambit/Printers/printers/asciiprinter.hpp index d99acd74ac..ee80006d81 100644 --- a/Printers/include/gambit/Printers/printers/asciiprinter.hpp +++ b/Printers/include/gambit/Printers/printers/asciiprinter.hpp @@ -155,9 +155,6 @@ namespace Gambit using BasePrinter::_print; // Tell compiler we are using some of the base class overloads of this on purpose. #define DECLARE_PRINT(r,data,i,elem) void _print(elem const&, const std::string&, const int, const uint, const ulong); BOOST_PP_SEQ_FOR_EACH_I(DECLARE_PRINT, , ASCII_TYPES) - #ifndef SCANNER_STANDALONE - BOOST_PP_SEQ_FOR_EACH_I(DECLARE_PRINT, , ASCII_BACKEND_TYPES) - #endif #undef DECLARE_PRINT // Print metadata info to file diff --git a/Printers/include/gambit/Printers/printers/asciireader.hpp b/Printers/include/gambit/Printers/printers/asciireader.hpp index cac26ee669..1a7e595338 100644 --- a/Printers/include/gambit/Printers/printers/asciireader.hpp +++ b/Printers/include/gambit/Printers/printers/asciireader.hpp @@ -53,9 +53,6 @@ namespace Gambit using BaseReader::_retrieve; // Tell compiler we are using some of the base class overloads of this on purpose. #define DECLARE_RETRIEVE(r,data,i,elem) bool _retrieve(elem&, const std::string&, const uint, const ulong); BOOST_PP_SEQ_FOR_EACH_I(DECLARE_RETRIEVE, , ASCII_TYPES) - #ifndef SCANNER_STANDALONE - BOOST_PP_SEQ_FOR_EACH_I(DECLARE_RETRIEVE, , ASCII_BACKEND_TYPES) - #endif #undef DECLARE_RETRIEVE ///@} diff --git a/Printers/include/gambit/Printers/printers/asciitypes.hpp b/Printers/include/gambit/Printers/printers/asciitypes.hpp index 463038d904..1d390b001a 100644 --- a/Printers/include/gambit/Printers/printers/asciitypes.hpp +++ b/Printers/include/gambit/Printers/printers/asciitypes.hpp @@ -29,12 +29,7 @@ (map_intpair_dbl) \ (map_const_str_dbl) \ (map_const_str_map_const_str_dbl) \ - (flav_prediction) \ -#define ASCII_BACKEND_TYPES \ - (DM_nucleon_couplings) \ - (BBN_container) \ - #else #define ASCII_TYPES \ diff --git a/Printers/include/gambit/Printers/printers/common_print_overloads.hpp b/Printers/include/gambit/Printers/printers/common_print_overloads.hpp index 41d5bcbae7..f3dd2df288 100644 --- a/Printers/include/gambit/Printers/printers/common_print_overloads.hpp +++ b/Printers/include/gambit/Printers/printers/common_print_overloads.hpp @@ -143,44 +143,6 @@ namespace Gambit printer._print(m, label, vID, mpirank, pointID); } - #ifndef SCANNER_STANDALONE - - /// DM-nucleon coupling print overload - template - void _common_print(P& printer, DM_nucleon_couplings const& value, const std::string& label, const int vID, const unsigned int mpirank, const unsigned long pointID) - { - std::map m; - m["Gp_SI"] = value.gps; - m["Gn_SI"] = value.gns; - m["Gp_SD"] = value.gpa; - m["Gn_SD"] = value.gna; - printer._print(m, label, vID, mpirank, pointID); - } - - /// Generic flavour prediction print overload - template - void _common_print(P& printer, flav_prediction const& value, const std::string& label, const int vID, const unsigned int mpirank, const unsigned long pointID) - { - printer._print(value.central_values, label + "::central", vID, mpirank, pointID); - printer._print(value.covariance, label + "::covariance", vID, mpirank, pointID); - } - - /// BBN observables print overload - template - void _common_print(P& printer, BBN_container const& value, const std::string& label, const int vID, const unsigned int mpirank, const unsigned long pointID) - { - std::map m; - for (const str& i : value.get_active_isotopes()) - { - int index = value.get_abund_map().at(i); - m[i] = value.get_BBN_abund(index); - m[i+"::1sigma_err"] = sqrt(value.get_BBN_covmat(index, index)); - } - printer._print(m, label, vID, mpirank, pointID); - } - - #endif - } } diff --git a/Printers/include/gambit/Printers/printers/coutprinter.hpp b/Printers/include/gambit/Printers/printers/coutprinter.hpp index ee1a32b727..3f00b2ebe2 100644 --- a/Printers/include/gambit/Printers/printers/coutprinter.hpp +++ b/Printers/include/gambit/Printers/printers/coutprinter.hpp @@ -85,9 +85,6 @@ namespace Gambit using BasePrinter::_print; // Tell compiler we are using some of the base class overloads of this on purpose. #define DECLARE_PRINT(r,data,i,elem) void _print(elem const&, const std::string&, const int, const uint, const ulong); BOOST_PP_SEQ_FOR_EACH_I(DECLARE_PRINT, , ASCII_TYPES) - #ifndef SCANNER_STANDALONE - BOOST_PP_SEQ_FOR_EACH_I(DECLARE_PRINT, , ASCII_BACKEND_TYPES) - #endif #undef DECLARE_PRINT // Print metadata info to file diff --git a/Printers/include/gambit/Printers/printers/hdf5printer.hpp b/Printers/include/gambit/Printers/printers/hdf5printer.hpp index 613b2761ea..205f7770f7 100644 --- a/Printers/include/gambit/Printers/printers/hdf5printer.hpp +++ b/Printers/include/gambit/Printers/printers/hdf5printer.hpp @@ -166,9 +166,6 @@ namespace Gambit using BasePrinter::_print; // Tell compiler we are using some of the base class overloads of this on purpose. #define DECLARE_PRINT(r,data,i,elem) void _print(elem const&, const std::string&, const int, const uint, const ulong); BOOST_PP_SEQ_FOR_EACH_I(DECLARE_PRINT, , HDF5_TYPES) - #ifndef SCANNER_STANDALONE - BOOST_PP_SEQ_FOR_EACH_I(DECLARE_PRINT, , HDF5_BACKEND_TYPES) - #endif #undef DECLARE_PRINT // Print metadata info to file diff --git a/Printers/include/gambit/Printers/printers/hdf5printer_v2.hpp b/Printers/include/gambit/Printers/printers/hdf5printer_v2.hpp index 14d2be3d61..e5a918b6fe 100644 --- a/Printers/include/gambit/Printers/printers/hdf5printer_v2.hpp +++ b/Printers/include/gambit/Printers/printers/hdf5printer_v2.hpp @@ -1383,9 +1383,6 @@ namespace Gambit using BasePrinter::_print; // Tell compiler we are using some of the base class overloads of this on purpose. #define DECLARE_PRINT(r,data,i,elem) void _print(elem const&, const std::string&, const int, const uint, const ulong); BOOST_PP_SEQ_FOR_EACH_I(DECLARE_PRINT, , HDF5_TYPES) - #ifndef SCANNER_STANDALONE - BOOST_PP_SEQ_FOR_EACH_I(DECLARE_PRINT, , HDF5_BACKEND_TYPES) - #endif #undef DECLARE_PRINT // Print metadata info to file diff --git a/Printers/include/gambit/Printers/printers/hdf5reader.hpp b/Printers/include/gambit/Printers/printers/hdf5reader.hpp index e6dfd5e5aa..b28a5623e5 100644 --- a/Printers/include/gambit/Printers/printers/hdf5reader.hpp +++ b/Printers/include/gambit/Printers/printers/hdf5reader.hpp @@ -133,9 +133,6 @@ namespace Gambit using BaseReader::_retrieve; // Tell compiler we are using some of the base class overloads of this on purpose. #define DECLARE_RETRIEVE(r,data,i,elem) bool _retrieve(elem&, const std::string&, const uint, const ulong); BOOST_PP_SEQ_FOR_EACH_I(DECLARE_RETRIEVE, , HDF5_RETRIEVABLE_TYPES) - #ifndef SCANNER_STANDALONE - BOOST_PP_SEQ_FOR_EACH_I(DECLARE_RETRIEVE, , HDF5_BACKEND_TYPES) - #endif #undef DECLARE_RETRIEVE private: diff --git a/Printers/include/gambit/Printers/printers/hdf5types.hpp b/Printers/include/gambit/Printers/printers/hdf5types.hpp index f801e1eae7..d86796daf4 100644 --- a/Printers/include/gambit/Printers/printers/hdf5types.hpp +++ b/Printers/include/gambit/Printers/printers/hdf5types.hpp @@ -45,17 +45,12 @@ (ModelParameters) \ (triplet) \ (map_intpair_dbl) \ - (flav_prediction) \ #define HDF5_RETRIEVABLE_TYPES \ HDF5_TYPES \ (MSSM_SLHAstruct) \ (SMslha_SLHAstruct) \ -#define HDF5_BACKEND_TYPES \ - (DM_nucleon_couplings) \ - (BBN_container) \ - #else #define HDF5_TYPES \ diff --git a/Printers/include/gambit/Printers/printers/noneprinter.hpp b/Printers/include/gambit/Printers/printers/noneprinter.hpp index 47891eca37..b07fa4e855 100644 --- a/Printers/include/gambit/Printers/printers/noneprinter.hpp +++ b/Printers/include/gambit/Printers/printers/noneprinter.hpp @@ -128,9 +128,6 @@ namespace Gambit using BasePrinter::_print; // Tell compiler we are using some of the base class overloads of this on purpose. #define DECLARE_PRINT(r,data,i,elem) void _print(elem const&, const std::string&, const int, const uint, const ulong) { /* do nothing */} BOOST_PP_SEQ_FOR_EACH_I(DECLARE_PRINT, , ASCII_TYPES) - #ifndef SCANNER_STANDALONE - BOOST_PP_SEQ_FOR_EACH_I(DECLARE_PRINT, , ASCII_BACKEND_TYPES) - #endif #undef DECLARE_PRINT // Print metadata info to file diff --git a/Printers/include/gambit/Printers/printers/sqliteprinter.hpp b/Printers/include/gambit/Printers/printers/sqliteprinter.hpp index 311082771b..c7a2e37de0 100644 --- a/Printers/include/gambit/Printers/printers/sqliteprinter.hpp +++ b/Printers/include/gambit/Printers/printers/sqliteprinter.hpp @@ -67,9 +67,6 @@ namespace Gambit using BasePrinter::_print; // Tell compiler we are using some of the base class overloads of this on purpose. #define DECLARE_PRINT(r,data,i,elem) void _print(elem const&, const std::string&, const int, const unsigned int, const unsigned long); BOOST_PP_SEQ_FOR_EACH_I(DECLARE_PRINT, , SQL_TYPES) - #ifndef SCANNER_STANDALONE - BOOST_PP_SEQ_FOR_EACH_I(DECLARE_PRINT, , SQL_BACKEND_TYPES) - #endif #undef DECLARE_PRINT // Print metadata info to file diff --git a/Printers/include/gambit/Printers/printers/sqlitereader.hpp b/Printers/include/gambit/Printers/printers/sqlitereader.hpp index 5b0a4c890d..c0314bfb6a 100644 --- a/Printers/include/gambit/Printers/printers/sqlitereader.hpp +++ b/Printers/include/gambit/Printers/printers/sqlitereader.hpp @@ -56,9 +56,6 @@ namespace Gambit using BaseReader::_retrieve; // Tell compiler we are using some of the base class overloads of this on purpose. #define DECLARE_RETRIEVE(r,data,i,elem) bool _retrieve(elem&, const std::string&, const uint, const ulong); BOOST_PP_SEQ_FOR_EACH_I(DECLARE_RETRIEVE, , SQL_TYPES) - #ifndef SCANNER_STANDALONE - BOOST_PP_SEQ_FOR_EACH_I(DECLARE_RETRIEVE, , SQL_BACKEND_TYPES) - #endif #undef DECLARE_RETRIEVE private: diff --git a/Printers/include/gambit/Printers/printers/sqlitetypes.hpp b/Printers/include/gambit/Printers/printers/sqlitetypes.hpp index a040810f69..91c1ad4251 100644 --- a/Printers/include/gambit/Printers/printers/sqlitetypes.hpp +++ b/Printers/include/gambit/Printers/printers/sqlitetypes.hpp @@ -36,9 +36,6 @@ (map_intpair_dbl) \ -#define SQL_BACKEND_TYPES \ - (DM_nucleon_couplings) \ - (BBN_container) \ #endif diff --git a/Printers/src/printers/asciiprinter/print_overloads.cpp b/Printers/src/printers/asciiprinter/print_overloads.cpp index 546711f3f7..d273fea946 100644 --- a/Printers/src/printers/asciiprinter/print_overloads.cpp +++ b/Printers/src/printers/asciiprinter/print_overloads.cpp @@ -138,12 +138,6 @@ namespace Gambit USE_COMMON_PRINT_OVERLOAD(asciiPrinter, triplet) USE_COMMON_PRINT_OVERLOAD(asciiPrinter, map_const_str_dbl) USE_COMMON_PRINT_OVERLOAD(asciiPrinter, map_const_str_map_const_str_dbl) - #ifndef SCANNER_STANDALONE - USE_COMMON_PRINT_OVERLOAD(asciiPrinter, flav_prediction) - USE_COMMON_PRINT_OVERLOAD(asciiPrinter, DM_nucleon_couplings) - USE_COMMON_PRINT_OVERLOAD(asciiPrinter, BBN_container) - #endif - /// @} } diff --git a/Printers/src/printers/asciiprinter/retrieve_overloads.cpp b/Printers/src/printers/asciiprinter/retrieve_overloads.cpp index c4b60dffd1..816a6f2000 100644 --- a/Printers/src/printers/asciiprinter/retrieve_overloads.cpp +++ b/Printers/src/printers/asciiprinter/retrieve_overloads.cpp @@ -262,17 +262,6 @@ namespace Gambit bool asciiReader::_retrieve(map_const_str_map_const_str_dbl& /*out*/, const std::string& /*label*/, const uint /*rank*/, const ulong /*pointID*/) { printer_error().raise(LOCAL_INFO,"NOT YET IMPLEMENTED"); return false; } - #ifndef SCANNER_STANDALONE // All the types inside ASCII_BACKEND_TYPES need to go inside this def guard. - bool asciiReader::_retrieve(flav_prediction& /*out*/, const std::string& /*label*/, const uint /*rank*/, const ulong /*pointID*/) - { printer_error().raise(LOCAL_INFO,"NOT YET IMPLEMENTED"); return false; } - - bool asciiReader::_retrieve(DM_nucleon_couplings& /*out*/, const std::string& /*label*/, const uint /*rank*/, const ulong /*pointID*/) - { printer_error().raise(LOCAL_INFO,"NOT YET IMPLEMENTED"); return false; } - bool asciiReader::_retrieve(BBN_container& /*out*/, const std::string& /*label*/, const uint /*rank*/, const ulong /*pointID*/) - { printer_error().raise(LOCAL_INFO,"NOT YET IMPLEMENTED"); return false; } - - #endif - /// @} } diff --git a/Printers/src/printers/coutprinter/print_overloads.cpp b/Printers/src/printers/coutprinter/print_overloads.cpp index e557eac304..8869920cf8 100644 --- a/Printers/src/printers/coutprinter/print_overloads.cpp +++ b/Printers/src/printers/coutprinter/print_overloads.cpp @@ -65,12 +65,6 @@ namespace Gambit USE_COMMON_PRINT_OVERLOAD(coutPrinter, triplet) USE_COMMON_PRINT_OVERLOAD(coutPrinter, map_const_str_dbl) USE_COMMON_PRINT_OVERLOAD(coutPrinter, map_const_str_map_const_str_dbl) - #ifndef SCANNER_STANDALONE - USE_COMMON_PRINT_OVERLOAD(coutPrinter, flav_prediction) - USE_COMMON_PRINT_OVERLOAD(coutPrinter, DM_nucleon_couplings) - USE_COMMON_PRINT_OVERLOAD(coutPrinter, BBN_container) - #endif - /// @} } diff --git a/Printers/src/printers/hdf5printer/print_overloads.cpp b/Printers/src/printers/hdf5printer/print_overloads.cpp index 11b1b751ca..dd2a6e4678 100644 --- a/Printers/src/printers/hdf5printer/print_overloads.cpp +++ b/Printers/src/printers/hdf5printer/print_overloads.cpp @@ -227,12 +227,6 @@ namespace Gambit USE_COMMON_PRINT_OVERLOAD(HDF5Printer, triplet) USE_COMMON_PRINT_OVERLOAD(HDF5Printer, map_const_str_dbl) USE_COMMON_PRINT_OVERLOAD(HDF5Printer, map_const_str_map_const_str_dbl) - #ifndef SCANNER_STANDALONE - USE_COMMON_PRINT_OVERLOAD(HDF5Printer, flav_prediction) - USE_COMMON_PRINT_OVERLOAD(HDF5Printer, DM_nucleon_couplings) - USE_COMMON_PRINT_OVERLOAD(HDF5Printer, BBN_container) - #endif - /// @} } diff --git a/Printers/src/printers/hdf5printer/retrieve_overloads.cpp b/Printers/src/printers/hdf5printer/retrieve_overloads.cpp index 64605b9f33..c91a930235 100644 --- a/Printers/src/printers/hdf5printer/retrieve_overloads.cpp +++ b/Printers/src/printers/hdf5printer/retrieve_overloads.cpp @@ -548,13 +548,6 @@ namespace Gambit return is_valid; } - bool HDF5Reader::_retrieve(flav_prediction& /*out*/, const std::string& /*label*/, const uint /*rank*/, const ulong /*pointID*/) - { printer_error().raise(LOCAL_INFO,"NOT YET IMPLEMENTED"); return false; } - bool HDF5Reader::_retrieve(DM_nucleon_couplings& /*out*/, const std::string& /*label*/, const uint /*rank*/, const ulong /*pointID*/) - { printer_error().raise(LOCAL_INFO,"NOT YET IMPLEMENTED"); return false; } - bool HDF5Reader::_retrieve(BBN_container& /*out*/, const std::string& /*label*/, const uint /*rank*/, const ulong /*pointID*/) - { printer_error().raise(LOCAL_INFO,"NOT YET IMPLEMENTED"); return false; } - #endif /// Helper function to parse a capability name to a dataset name diff --git a/Printers/src/printers/hdf5printer_v2/print_overloads.cpp b/Printers/src/printers/hdf5printer_v2/print_overloads.cpp index 7e49a0da4c..58bed2012b 100644 --- a/Printers/src/printers/hdf5printer_v2/print_overloads.cpp +++ b/Printers/src/printers/hdf5printer_v2/print_overloads.cpp @@ -71,12 +71,6 @@ namespace Gambit USE_COMMON_PRINT_OVERLOAD(HDF5Printer2, ModelParameters) USE_COMMON_PRINT_OVERLOAD(HDF5Printer2, triplet) - #ifndef SCANNER_STANDALONE - USE_COMMON_PRINT_OVERLOAD(HDF5Printer2, flav_prediction) - USE_COMMON_PRINT_OVERLOAD(HDF5Printer2, DM_nucleon_couplings) - USE_COMMON_PRINT_OVERLOAD(HDF5Printer2, BBN_container) - #endif - /// @} } diff --git a/Printers/src/printers/sqliteprinter/print_overloads.cpp b/Printers/src/printers/sqliteprinter/print_overloads.cpp index a4fb5f4ac1..d5e6594ae8 100644 --- a/Printers/src/printers/sqliteprinter/print_overloads.cpp +++ b/Printers/src/printers/sqliteprinter/print_overloads.cpp @@ -50,11 +50,6 @@ namespace Gambit USE_COMMON_PRINT_OVERLOAD(SQLitePrinter, map_intpair_dbl) USE_COMMON_PRINT_OVERLOAD(SQLitePrinter, ModelParameters) USE_COMMON_PRINT_OVERLOAD(SQLitePrinter, triplet) - #ifndef SCANNER_STANDALONE - USE_COMMON_PRINT_OVERLOAD(SQLitePrinter, DM_nucleon_couplings) - USE_COMMON_PRINT_OVERLOAD(SQLitePrinter, BBN_container) - #endif - /// @} } diff --git a/Printers/src/printers/sqliteprinter/retrieve_overloads.cpp b/Printers/src/printers/sqliteprinter/retrieve_overloads.cpp index 2be129399f..044e79e6e3 100644 --- a/Printers/src/printers/sqliteprinter/retrieve_overloads.cpp +++ b/Printers/src/printers/sqliteprinter/retrieve_overloads.cpp @@ -144,14 +144,6 @@ namespace Gambit bool SQLiteReader::_retrieve(map_intpair_dbl& /*out*/, const std::string& /*label*/, const uint /*rank*/, const ulong /*pointID*/) { printer_error().raise(LOCAL_INFO,"NOT YET IMPLEMENTED"); return false; } - #ifndef SCANNER_STANDALONE // All the types inside SQL_BACKEND_TYPES need to go inside this def guard. - - bool SQLiteReader::_retrieve(DM_nucleon_couplings& /*out*/, const std::string& /*label*/, const uint /*rank*/, const ulong /*pointID*/) - { printer_error().raise(LOCAL_INFO,"NOT YET IMPLEMENTED"); return false; } - bool SQLiteReader::_retrieve(BBN_container& /*out*/, const std::string& /*label*/, const uint /*rank*/, const ulong /*pointID*/) - { printer_error().raise(LOCAL_INFO,"NOT YET IMPLEMENTED"); return false; } - - #endif /// @}