Skip to content

Commit

Permalink
generate the documentation for the LSP functions by the meta code
Browse files Browse the repository at this point in the history
In the C++ template files the structure of the LSP functions is not
known.  Therefore it has to be generated by the meta code, which also
generates the LSP functions.
  • Loading branch information
Expander authored and Expander committed Aug 6, 2014
1 parent 4dd21fb commit 095dc53
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 5 deletions.
21 changes: 19 additions & 2 deletions meta/LoopMasses.m
Expand Up @@ -821,7 +821,8 @@
CreateLSPFunctions[{}] := {"", ""};

CreateLSPFunctions[masses_List] :=
Module[{prototype, function, mass, info, particleType, m},
Module[{prototype, function, mass, info, particleType, m,
comment},
info = FlexibleSUSY`FSModelName <> "_info";
particleType = info <> "::Particles";
body = "double lsp_mass = std::numeric_limits<double>::max();
Expand All @@ -848,7 +849,23 @@
];
body = body <> "return lsp_mass;\n";
prototype = "double get_lsp(" <> particleType <> "&) const;\n";
function = "double CLASSNAME::get_lsp(" <> particleType <>
comment = "\
/**
* @brief finds the LSP and returns it's mass
*
* This function finds the lightest supersymmetric particle (LSP) and
* returns it's mass. The corresponding particle type is retured in
* the reference parameter. The list of potential LSPs is set in the
* model file varible PotentialLSPParticles. For this model it is set
* to:
* " <> ToString[masses] <> "
*
* @param particle_type particle type
* @return mass of LSP
*/
";
function = comment <>
"double CLASSNAME::get_lsp(" <> particleType <>
"& particle_type) const\n{\n" <> IndentText[body] <> "}\n";
Return[{prototype, function}];
];
Expand Down
4 changes: 1 addition & 3 deletions templates/two_scale_model.cpp.in
Expand Up @@ -488,9 +488,7 @@ void CLASSNAME::run_to(double scale, double eps)
eps = precision;
@ModelName@_soft_parameters::run_to(scale, eps);
}
/**
* finds the lsp and returns it's mass
*/

@lspFunctions@

@massCalculationFunctions@
Expand Down

0 comments on commit 095dc53

Please sign in to comment.