-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of https://gambit.hepforge.org/git-private/gambit
- Loading branch information
Showing
8 changed files
with
235 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. | ||
|