Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
patscott committed May 23, 2017
2 parents fbf719c + d746777 commit cb15123
Show file tree
Hide file tree
Showing 8 changed files with 235 additions and 15 deletions.
17 changes: 9 additions & 8 deletions Elements/src/mssm_slhahelp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@

#include "gambit/Elements/mssm_slhahelp.hpp"
#include "gambit/Elements/ini_functions.hpp"
#include "gambit/Utils/util_functions.hpp"

namespace Gambit
{
Expand Down Expand Up @@ -775,14 +776,14 @@ namespace Gambit
// Make sure to overwrite all entries if they exist already (from say a "hurriedly" copied SM subspectrum + unknown extra MSSM junk)

//SPINFO block should be added separately.
// MINPAR block //TODO: don't add MINPAR block? We don't in general know what these were anymore.
//SLHAea_check_block(slha, "MINPAR");
//if (mssmspec.has(Par::dimensionless,"TanBeta_input"))
//{
// SLHAea_add_from_subspec(slha,LOCAL_INFO,mssmspec,Par::dimensionless,"TanBeta_input","MINPAR",3,"# tanbeta(mZ)^DRbar");
//}
//int sgnmu = sign(mssmspec.get(Par::mass1,"Mu")); // Wait, this is at some different scale to input. Don't want this.
//SLHAea_add(slha,"MINPAR",4,sgnmu,"# sign(mu(Q_input))", true);
// MINPAR block; some programs need tanbeta(mZ), so we should output it here if possible
SLHAea_check_block(slha, "MINPAR");
if(mssmspec.has(Par::dimensionless,"tanbeta(mZ)"))
{
SLHAea_add_from_subspec(slha,LOCAL_INFO,mssmspec,Par::dimensionless,"tanbeta(mZ)","MINPAR",3,"# tanbeta(mZ)^DRbar");
}
int sgnmu = sgn(mssmspec.get(Par::mass1,"Mu")); // Mu isn't at the input scale anymore, but sign(mu) doesn't change with running.
SLHAea_add(slha,"MINPAR",4,sgnmu,"# sign(mu)", true);

// HMIX block
SLHAea_delete_block(slha, "HMIX");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ namespace Gambit
double get_vd() const;
double get_vu() const;
double get_tanbeta() const;
double get_tanbeta_mZ() const;

double get_MassB () const;
double get_MassWB() const;
Expand Down
2 changes: 2 additions & 0 deletions Models/src/SimpleSpectra/MSSMSimpleSpec.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,7 @@ namespace Gambit
/// @{ Getters for MSSM information
double MSSMea::get_Mu() const{ return getdata("HMIX",1); } // mu(Q) DRbar
double MSSMea::get_tanbeta() const{ return getdata("HMIX",2); } // tan beta(Q) DRbar ( = vu/vd)
double MSSMea::get_tanbeta_mZ() const{ return getdata("MINPAR",3); } // tan beta(mZ) DRbar
double MSSMea::get_v() const{ return getdata("HMIX",3); } // v = sqrt(vd^2 + vu^2) DRbar
double MSSMea::get_mA2() const{ return getdata("HMIX",4); } // m^2_A=[m3^2/cosBsinB](Q) DRbar, tree
////// THESE ARE NOT SLHA! Therefore cannot rely on them being in the SLHAea object.
Expand Down Expand Up @@ -509,6 +510,7 @@ namespace Gambit
tmp_map["g2"]= &Model::get_g2;
tmp_map["g3"]= &Model::get_g3;
tmp_map["tanbeta"]= &Model::get_tanbeta;
tmp_map["tanbeta(mZ)"]= &Model::get_tanbeta_mZ; // Special entry for reproducing MINPAR entry in SLHA
tmp_map["sinW2"]= &Model::get_sinthW2_DRbar;
map_collection[Par::dimensionless].map0 = tmp_map;
}
Expand Down
1 change: 1 addition & 0 deletions Models/src/SpectrumContents/MSSM.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ namespace Gambit {

// EXTRAS! Kind of logical to always include these, without forcing users to calculate them themselves
addParameter(Par::dimensionless, "tanbeta", scalar);
//addParameter(Par::dimensionless, "tanbeta(mZ)", scalar); // i.e. the SLHA MINPAR value of tanbeta(mZ). Not yet a strict requirement, but highly recommended for wrappers to add it via override setters.
addParameter(Par::mass2, "mA2" , scalar);
//

Expand Down
4 changes: 1 addition & 3 deletions ScannerBit/src/scanners/great/great.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,7 @@ scanner_plugin(great, version(1, 0, 0))
// Tell CMake to search for the GreAT library.
reqd_libraries("great");
reqd_headers("fparser.hh", "TGreatModel.h", "TGreatManager.h", "TGreatMCMCAlgorithmCovariance.h");
#ifdef ROOT_6_OR_LATER_FOUND
cxx_flags("-std=c++14");
#endif

// Code to execute when the plugin is loaded.
plugin_constructor
{
Expand Down
2 changes: 1 addition & 1 deletion SpecBit/include/gambit/SpecBit/MSSMSpec.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ namespace Gambit
// TODO: This needs to become more sophisticated to deal with data potentially
// produced by different LE and HE spectrum sources. For now whichever subspectrum
// adds this block first will "win".
if(not SLHAea_check_block(slha, "SPINFO", 1, false))
if(not SLHAea_block_exists(slha, "SPINFO"))
{
SLHAea_add_block(slha, "SPINFO");
SLHAea_add(slha, "SPINFO", 1, "GAMBIT, using "+backend_name);
Expand Down
5 changes: 3 additions & 2 deletions SpecBit/src/SpecBit_MSSM.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -209,9 +209,10 @@ namespace Gambit
mssmspec.set_override(Par::Pole_Mass_1srd_low, rd_mW, "W+", true);

// Save the input value of TanBeta
if (input_Param.find("TanBeta") != input_Param.end())
// Probably need to make it a full requirement of the MSSM SpectrumContents
if(input_Param.find("TanBeta") != input_Param.end())
{
mssmspec.set_override(Par::dimensionless, *input_Param.at("TanBeta"), "TanBeta_input", true);
mssmspec.set_override(Par::dimensionless, *input_Param.at("TanBeta"), "tanbeta(mZ)", true);
}

// Create a second SubSpectrum object to wrap the qedqcd object used to initialise the spectrum generator
Expand Down
218 changes: 217 additions & 1 deletion doc/Adding_FlexibleSUSY_Models.txt
Original file line number Diff line number Diff line change
@@ -1 +1,217 @@
Ben to write!
---------------------------------------------------------------------
How to connect FlexibleSUSY spectrum generators to GAMBIT
---------------------------------------------------------------------

This is an advanced usage of GAMBIT. A good understanding of the
basic structure of GAMBIT (in terms of module functions, backends,
etc.) is required to understand these instructions, as well as an
understanding of the workings of Spectrum and SubSpectrum wrapper
objects as are explained in detail in the SpecBit/DecayBit/
PrecisionBit manual paper. See in particular section 2.4, "Adding
support for new models and/or codes".

---
0. Checklist
---

Before getting into details, we provide here a quick list of the
required steps, with zero explanation of them. The details will
be explained in sections I, II, and III.

1. Create new spectrum generator with FlexibleSUSY
2. Move/export spectrum generator code to GAMBIT directories
3. Add spectrum generator name to SpecBit auto-include header
"SpecBit/include/gambit/SpecBit/model_files_and_boxes.hpp"
4. Create a SubSpectrum wrapper class to carry the spectrum generator
output information, or re-use an existing one.
5. Create GAMBIT module function to
a) Run the spectrum generator
b) Wrap the output in your SubSpectrum wrapper
c) Package the SubSpectrum wrapper in a Spectrum object
d) Return the Spectrum object from the module function
6. Modify "cmake/contrib.cmake" to link GAMBIT to the FlexibleSUSY
libraries for the new spectrum generator during compilation.

Steps 1 and 2 are described in section I.
Steps 3,4, and 5 are described in section II.
Step 6 is described in section III.

---
I. Generating the FlexibleSUSY spectrum generator
---

FlexibleSUSY is a spectrum generator generator that creates fast and
precise C++ spectrum generators in a user specified model. The
FlexibleSUSY code can be found at https://flexiblesusy.hepforge.org/
or obtained via github https://github.com/FlexibleSUSY/FlexibleSUSY.

Since FlexibleSUSY cannot curently be BOSSed for backending, adding
new FlexibleSUSY created spectrum generators is more involved
than for regular backends. GAMBIT is distributed with several
spectrum generators created with FlexibleSUSY-1.5.1 and the user has
the option to both update the FlexibleSUSY version and to add new
FlexibleSUSY models for a given version. To update the FlexibleSUSY
version one should delete the directory gambit/contrib/flexiblesusy
and replace it with new FlexibleSUSY code. To do this obtain the
desired version of FlexibleSUSY and follow the FlexibleSUSY
documentation to create a spectrum generator for the models currently
implemented in gambit (GAMBIT-1.0 comes with CMSSM, MSSMatMGUT, MSSM,
SingletDM & SingletDMZ3 ) and export the generated code to
gambit/contrib/flexiblesusy/.

In the process of generating the code you can also create additional
spectrum generators for a new model <modelname> if you
wish. Alternatively you can simply generate a new spectrum generator
with FlexibleSUSY-1.5.1 and add the <modelname> directory from
FlexibleSUSY-1.5.1/models/ to gambit/contrib/flexiblesusy/models/.

The following description provides details on how to interface the
generated FlexibleSUSY models, assuming the new FlexibleSUSY spectrum
generators have been installed in contrib/MassSpectra/flexiblesusy/.

---
II. Required code additions to GAMBIT
---

As of GAMBIT v1.0.0, FlexibleSUSY spectrum generators cannot be
turned into full GAMBIT backends via BOSS, due to technical
restrictions in BOSS associated with parsing C++ template code. These
spectrum generators therefore need to be directly linked into SpecBit
(or a new user-created module) at compile time. The steps required to
do this are as follows, assuming the new FlexibleSUSY spectrum
generators have been installed in contrib/MassSpectra/flexiblesusy/
as described above.

1. Add the spectrum generator to

SpecBit/include/gambit/SpecBit/model_files_and_boxes.hpp

This header contains macros that will automatically include all the
FlexibleSUSY headers required to use the spectrum generator within
GAMBIT. These macros also define a special interface class
"<mymodel>_interface" that defines aliases for all the important
objects associated with the spectrum generator in question.

Specifically, to add the spectrum generator for <mymodel>
at the end of the above header add:

#define MODELNAME <mymodel>
#include "gambit/SpecBit/flexiblesusy_include_automater.hpp"
MAKE_INTERFACE
#undef MODELNAME

2. Create a GAMBIT module function in which to run the spectrum
generator.

See the main GAMBIT manual for details on adding module functions.
For example, the scalar singlet dark matter spectrum generators
shipped with GAMBIT are run via module functions defined in

SpecBit/src/SpecBit_SingletDM.cpp

which includes the header "gambit/SpecBit/model_files_and_boxes.hpp"
(which should be modified as in step 1).

One such module function is "get_SingletDM_spectrum_pole". Let us look
at this function as an example of how to run the spectrum generator.

1 void get_SingletDM_spectrum_pole(Spectrum& result)
2 {
3 using namespace softsusy;
4 namespace myPipe = Pipes::get_SingletDM_spectrum_pole;
5 const SMInputs& sminputs = *myPipe::Dep::SMINPUTS;
6 const Options& runOptions=*myPipe::runOptions;
7 double scale = runOptions.getValueOrDef<double>(173.34,
8 "FS_high_scale");
9 SingletDM_input_parameters input;
10 fill_SingletDM_input(input,myPipe::Param,sminputs,scale);
11 result = run_FS_spectrum_generator<
12 SingletDM_interface<ALGORITHM1>,
13 SingletDMSpec<SingletDM_interface<ALGORITHM1>>>(
14 input,sminputs,*myPipe::runOptions,myPipe::Param);
15 // **extra code cut**
16 }

This module returns a Spectrum object, which is an abstract wrapper
class used for transporting all spectrum information in GAMBIT. The
purpose of the module function is to run the spectrum generator, wrap
it in a Spectrum object, and return this wrapper object to GAMBIT.

First, a dependency on SMINPUTS is retrieved (line 5). This is Standard Model information required to run the spectrum generator (see SpecBit manual for
details on SMINPUTS).

Next, a helper function "fill_SingletDM_input" is run (line 10), which fills a
FlexibleSUSY parameter structure "SingletDM_input_parameters" with the
appropriate parameters supplied by the GAMBIT model hierarchy. If your
spectrum generator operates with a model outside those shipped with
GAMBIT then you will need to add appropriate model parameters for it
to the GAMBIT model hierarchy (see the main GAMBIT manual for details).
The SingletDM_input_parameters struct is accessible via the
FlexibleSUSY headers which are included in step 1.

Next, the input parameters are supplied to a GAMBIT template helper
function (line 11) that we use to automate the running of FlexibleSUSY
spectrum generators. This function performs the actual running of the
spectrum generator, and wraps it into a Spectrum object. For details
of how to run a spectrum generator see the FlexibleSUSY documentation.

In this example the template parameters are given as (lines 12 & 13):

SingletDM_interface<ALGORITHM1> and
SingletDMSpec<SingletDM_interface<ALGORITHM1>>

The first is the interface class defined by the macro MAKE_INTERFACE,
seen in step 1. This provides access to the required FlexibleSUSY
objects. The second argument is the name of the specialized wrapper
class for the SingletDM spectrum information. Writing this wrapper
class is a major part of the work of interfacing to a new FlexibleSUSY
spectrum generator. The process of writing a wrapper class is
described in the SpecBit manual, for example in appendix G "Worked
example of writing a SubSpectrum wrapper" (which describes in detail a
wrapper for FlexibleSUSY spectrum output). We will therefore not
discuss it again here.

Sometimes a new spectrum generators may generate the same particle and
parameter content asn an existing spectrum generator, but using
different boundary conditions. In this case the existing Spectrum
wrapper may be re-used. For example, suppose one wants to add the
FlexibleSUSY model "lowMSSM", which generates an MSSM spectrum from
boundary conditions defined at the scale "MSUSY". This results in MSSM
spectrum data, as can be also obtained using different boundary
conditions via the "MSSMatMGUT" and "MSSM" spectrum generators (which
are included with GAMBIT). Because of this, one may re-use the
"MSSMSpec" wrapper that is used in SpecBit_MSSM.cpp, in particular
the following all connect their corresponding FlexibleSUSY spectrum
generators to the MSSMSpec wrapper.

get_CMSSM_spectrum
get_MSSMatQ_spectrum and
get_MSSMatMGUT_spectrum


---
III. Required changes to GAMBIT cmake build system
---

Once sections I and II have been followed, one then needs to make some
changes to the GAMBIT CMake build system. This should require very
little modification. One should only modify the line

set(BUILT_FS_MODELS CMSSM MSSMatMGUT MSSM SingletDMZ3 SingletDM)

in the file cmake/contrib.cmake, adding the name of the new
FlexibleSUSY spectrum generator. The rest of the required linking
should occur automatically.

If the module functions which run the new spectrum generator (as
discussed in section II) are added to a module other than SpecBit,
then one should also modify the following lines in the same file,

if(";${GAMBIT_BITS};" MATCHES ";SpecBit;")
set (EXCLUDE_FLEXIBLESUSY FALSE)

by adding the name of the new module to the 'if' statement. If this is
not done then FlexibleSUSY will be automatically -Ditch'ed by GAMBIT
if SpecBit is -Ditch'ed, and will therefore fail to link to the new
user-defined module.

0 comments on commit cb15123

Please sign in to comment.