forked from Expander/FlexibleSUSY
/
semi_analytic_high_scale_spectrum_generator.cpp.in
160 lines (133 loc) · 6.24 KB
/
semi_analytic_high_scale_spectrum_generator.cpp.in
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
// ====================================================================
// 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_convergence_tester.hpp"
#include "@ModelName@_semi_analytic_initial_guesser.hpp"
#include "@ModelName@_semi_analytic_susy_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_semi_analytic_solutions(get_high_scale());
this->model.solve_ewsb();
this->model.calculate_spectrum();
}
} // namespace flexiblesusy