forked from Expander/FlexibleSUSY
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add initial semi-analytic spectrum generator template
for experimenting with
- Loading branch information
Dylan Harries
committed
Dec 23, 2016
1 parent
cad7a37
commit 5db069f
Showing
4 changed files
with
236 additions
and
0 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
159 changes: 159 additions & 0 deletions
159
templates/semi_analytic_high_scale_spectrum_generator.cpp.in
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 |
---|---|---|
@@ -0,0 +1,159 @@ | ||
// ==================================================================== | ||
// This file is part of FlexibleSUSY. | ||
// | ||
// FlexibleSUSY is free software: you can redistribute it and/or modify | ||
// it under the terms of the GNU General Public License as published | ||
// by the Free Software Foundation, either version 3 of the License, | ||
// or (at your option) any later version. | ||
// | ||
// FlexibleSUSY is distributed in the hope that it will be useful, but | ||
// WITHOUT ANY WARRANTY; without even the implied warranty of | ||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
// General Public License for more details. | ||
// | ||
// You should have received a copy of the GNU General Public License | ||
// along with FlexibleSUSY. If not, see | ||
// <http://www.gnu.org/licenses/>. | ||
// ==================================================================== | ||
|
||
// File generated at @DateAndTime@ | ||
|
||
#include "@ModelName@_semi_analytic_spectrum_generator.hpp" | ||
#include "@ModelName@_semi_analytic_susy_convergence_tester.hpp" | ||
#include "@ModelName@_semi_analytic_convergence_tester.hpp" | ||
|
||
#include "error.hpp" | ||
#include "lowe.h" | ||
#include "numerics2.hpp" | ||
#include "two_scale_running_precision.hpp" | ||
#include "semi_analytic_solver.hpp" | ||
|
||
#include <limits> | ||
|
||
namespace flexiblesusy { | ||
|
||
double @ModelName@_spectrum_generator<Semi_analytic>::get_pole_mass_scale() const | ||
{ | ||
return | ||
this->settings.get(Spectrum_generator_settings::pole_mass_scale) != 0. ? | ||
this->settings.get(Spectrum_generator_settings::pole_mass_scale) : get_susy_scale(); | ||
} | ||
|
||
/** | ||
* @brief Run's the RG solver with the given input parameters | ||
* | ||
* This function sets up the RG solver using a high-scale, susy-scale, | ||
* low-scale and soft parameters constraint. Afterwards the solver | ||
* is run until convergence is reached or an error occours. Finally | ||
* the particle spectrum (pole masses) is calculated. | ||
* | ||
* @param qedqcd Standard Model input parameters | ||
* @param input model input parameters | ||
*/ | ||
void @ModelName@_spectrum_generator<Semi_analytic>::run_except(const softsusy::QedQcd& qedqcd, | ||
const @ModelName@_input_parameters& input) | ||
{ | ||
@ModelName@<Semi_analytic>& model = this->model; | ||
model.clear(); | ||
model.set_input_parameters(input); | ||
model.do_calculate_sm_pole_masses(this->settings.get(Spectrum_generator_settings::calculate_sm_masses)); | ||
model.do_calculate_bsm_pole_masses(this->settings.get(Spectrum_generator_settings::calculate_bsm_masses)); | ||
model.do_force_output(this->settings.get(Spectrum_generator_settings::force_output)); | ||
model.set_loops(this->settings.get(Spectrum_generator_settings::beta_loop_order)); | ||
model.set_thresholds(this->settings.get(Spectrum_generator_settings::threshold_corrections_loop_order)); | ||
model.set_zero_threshold(this->settings.get(Spectrum_generator_settings::beta_zero_threshold)); | ||
|
||
high_scale_constraint.clear(); | ||
susy_scale_constraint.clear(); | ||
low_scale_constraint .clear(); | ||
soft_constraint.clear(); | ||
|
||
// needed for constraint::initialize() | ||
high_scale_constraint.set_model(&model); | ||
susy_scale_constraint.set_model(&model); | ||
low_scale_constraint .set_model(&model); | ||
|
||
susy_scale_constraint.set_sm_parameters(qedqcd); | ||
low_scale_constraint .set_sm_parameters(qedqcd); | ||
|
||
high_scale_constraint.initialize(); | ||
susy_scale_constraint.initialize(); | ||
low_scale_constraint .initialize(); | ||
|
||
@ModelName@_susy_convergence_tester<Semi_analytic> inner_ct( | ||
&model, this->settings.get(Spectrum_generator_settings::precision)); | ||
@ModelName@_convergence_tester<Semi_analytic> outer_ct( | ||
&model, this->settings.get(Spectrum_generator_settings::precision)); | ||
|
||
if (this->settings.get(Spectrum_generator_settings::pole_mass_scale) != 0.) | ||
outer_ct.set_scale_getter( | ||
[this](){ return settings.get(Spectrum_generator_settings::pole_mass_scale); }); | ||
|
||
if (this->settings.get(Spectrum_generator_settings::max_iterations) > 0) { | ||
inner_ct.set_max_iterations( | ||
this->settings.get(Spectrum_generator_settings::max_iterations)); | ||
outer_ct.set_max_iterations( | ||
this->settings.get(Spectrum_generator_settings::max_iterations)); | ||
} | ||
|
||
@ModelName@_initial_guesser<Semi_analytic> initial_guesser(&model, qedqcd, | ||
low_scale_constraint, | ||
susy_scale_constraint, | ||
high_scale_constraint); | ||
|
||
Two_scale_increasing_precision precision( | ||
10.0, this->settings.get(Spectrum_generator_settings::precision)); | ||
|
||
RGFlow<Semi_analytic> solver; | ||
solver.set_inner_convergence_tester(&inner_ct); | ||
solver.set_outer_convergence_tester(&outer_ct); | ||
solver.set_running_precision(&precision); | ||
solver.set_initial_guesser(&initial_guesser); | ||
solver.add_inner(&low_scale_constraint, &model); | ||
solver.add_inner(&high_scale_constraint, &model); | ||
solver.add_inner(&susy_scale_constraint, &model); | ||
solver.add_outer(&soft_constraint, &model); | ||
|
||
this->reached_precision = std::numeric_limits<double>::infinity(); | ||
|
||
solver.solve(); | ||
|
||
// impose low-scale constraint one last time | ||
model.run_to(low_scale_constraint.get_scale()); | ||
low_scale_constraint.apply(); | ||
|
||
this->reached_precision = outer_ct.get_current_accuracy(); | ||
|
||
calculate_spectrum(); | ||
|
||
// copy calculated W pole mass | ||
model.get_physical().M@VectorW@ | ||
= low_scale_constraint.get_sm_parameters().displayPoleMW(); | ||
|
||
// run to output scale (if scale > 0) | ||
if (!is_zero(this->parameter_output_scale)) | ||
model.run_to(this->parameter_output_scale); | ||
} | ||
|
||
/** | ||
* Create a text file which contains the values of all model | ||
* parameters at all scales between the low-scale and the high-scale. | ||
* | ||
* @param filename name of output file | ||
*/ | ||
void @ModelName@_spectrum_generator<Semi_analytic>::write_running_couplings( | ||
const std::string& filename) const | ||
{ | ||
@ModelName@_spectrum_generator_interface<Semi_analytic>::write_running_couplings( | ||
filename, get_low_scale(), get_high_scale()); | ||
} | ||
|
||
void @ModelName@_spectrum_generator<Semi_analytic>::calculate_spectrum() | ||
{ | ||
this->model.run_to(get_pole_mass_scale()); | ||
this->model.calculate_coefficients(); | ||
this->model.solve_ewsb(); | ||
this->model.calculate_spectrum(); | ||
} | ||
|
||
} // namespace flexiblesusy |
73 changes: 73 additions & 0 deletions
73
templates/semi_analytic_high_scale_spectrum_generator.hpp.in
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 |
---|---|---|
@@ -0,0 +1,73 @@ | ||
// ==================================================================== | ||
// This file is part of FlexibleSUSY. | ||
// | ||
// FlexibleSUSY is free software: you can redistribute it and/or modify | ||
// it under the terms of the GNU General Public License as published | ||
// by the Free Software Foundation, either version 3 of the License, | ||
// or (at your option) any later version. | ||
// | ||
// FlexibleSUSY is distributed in the hope that it will be useful, but | ||
// WITHOUT ANY WARRANTY; without even the implied warranty of | ||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
// General Public License for more details. | ||
// | ||
// You should have received a copy of the GNU General Public License | ||
// along with FlexibleSUSY. If not, see | ||
// <http://www.gnu.org/licenses/>. | ||
// ==================================================================== | ||
|
||
// File generated at @DateAndTime@ | ||
|
||
#ifndef @ModelName@_SEMI_ANALYTIC_SPECTRUM_GENERATOR_H | ||
#define @ModelName@_SEMI_ANALYTIC_SPECTRUM_GENERATOR_H | ||
|
||
#include "@ModelName@_input_parameters.hpp" | ||
#include "@ModelName@_spectrum_generator_interface.hpp" | ||
#include "@ModelName@_spectrum_generator.hpp" | ||
#include "@ModelName@_semi_analytic_high_scale_constraint.hpp" | ||
#include "@ModelName@_semi_analytic_susy_scale_constraint.hpp" | ||
#include "@ModelName@_semi_analytic_low_scale_constraint.hpp" | ||
#include "@ModelName@_semi_analytic_soft_parameters_constraint.hpp" | ||
#include "@ModelName@_semi_analytic_model.hpp" | ||
#include "@ModelName@_model_slha.hpp" | ||
|
||
#include <tuple> | ||
|
||
namespace softsusy { class QedQcd; } | ||
|
||
namespace flexiblesusy { | ||
|
||
class Semi_analytic; | ||
|
||
template<> | ||
class @ModelName@_spectrum_generator<Semi_analytic> | ||
: public @ModelName@_spectrum_generator_interface<Semi_analytic> { | ||
public: | ||
@ModelName@_spectrum_generator() = default; | ||
virtual ~@ModelName@_spectrum_generator() {} | ||
|
||
std::tuple<@ModelName@<Semi_analytic> > get_models() const { return std::make_tuple(this->get_model()); } | ||
std::tuple<@ModelName@_slha<@ModelName@<Semi_analytic> > > get_models_slha() const { return std::make_tuple(this->get_model_slha()); } | ||
|
||
double get_high_scale() const { return high_scale_constraint.get_scale(); } | ||
double get_susy_scale() const { return susy_scale_constraint.get_scale(); } | ||
double get_low_scale() const { return low_scale_constraint.get_scale(); } | ||
double get_pole_mass_scale() const; | ||
|
||
void write_running_couplings(const std::string& filename = "@ModelName@_rgflow.dat") const; | ||
|
||
protected: | ||
virtual void run_except(const softsusy::QedQcd&, const @ModelName@_input_parameters&) override; | ||
|
||
private: | ||
@ModelName@_high_scale_constraint<Semi_analytic> high_scale_constraint{}; | ||
@ModelName@_susy_scale_constraint<Semi_analytic> susy_scale_constraint{}; | ||
@ModelName@_low_scale_constraint<Semi_analytic> low_scale_constraint{}; | ||
@ModelName@_soft_parameters_constraint<Semi_analytic> soft_constraint{}; | ||
|
||
void calculate_spectrum(); | ||
}; | ||
|
||
} // namespace flexiblesusy | ||
|
||
#endif |