forked from Expander/FlexibleSUSY
/
low_scale_spectrum_generator.hpp.in
177 lines (147 loc) · 6.5 KB
/
low_scale_spectrum_generator.hpp.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
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
// ====================================================================
// 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@_SPECTRUM_GENERATOR_H
#define @ModelName@_SPECTRUM_GENERATOR_H
#include "@ModelName@_spectrum_generator_interface.hpp"
#include "@ModelName@_two_scale_susy_scale_constraint.hpp"
#include "@ModelName@_two_scale_low_scale_constraint.hpp"
#include "@ModelName@_two_scale_convergence_tester.hpp"
#include "@ModelName@_two_scale_initial_guesser.hpp"
#include "@ModelName@_input_parameters.hpp"
#include "@ModelName@_info.hpp"
#include "lowe.h"
#include "error.hpp"
#include "numerics2.hpp"
#include "two_scale_running_precision.hpp"
#include "two_scale_solver.hpp"
#include <limits>
namespace flexiblesusy {
template <class T>
class @ModelName@_spectrum_generator
: public @ModelName@_spectrum_generator_interface<T> {
public:
@ModelName@_spectrum_generator()
: @ModelName@_spectrum_generator_interface<T>()
, susy_scale(0.)
, low_scale(0.)
{}
virtual ~@ModelName@_spectrum_generator() {}
double get_high_scale() const { return 0.; }
double get_susy_scale() const { return susy_scale; }
double get_low_scale() const { return low_scale; }
virtual void run(const softsusy::QedQcd&, const @ModelName@_input_parameters&);
void write_running_couplings(const std::string& filename = "@ModelName@_rgflow.dat") const;
private:
double susy_scale, low_scale;
};
/**
* @brief Run's the RG solver with the given input parameters
*
* This function sets up the RG solver using a susy-scale
* and low-scale 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
*/
template <class T>
void @ModelName@_spectrum_generator<T>::run(const softsusy::QedQcd& qedqcd,
const @ModelName@_input_parameters& input)
{
@ModelName@<T>& 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));
@ModelName@_susy_scale_constraint<T> susy_scale_constraint;
@ModelName@_low_scale_constraint<T> low_scale_constraint;
susy_scale_constraint.clear();
low_scale_constraint .clear();
// needed for constraint::initialize()
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);
susy_scale_constraint.initialize();
low_scale_constraint .initialize();
std::vector<Constraint<T>*> upward_constraints(2);
upward_constraints[0] = &low_scale_constraint;
upward_constraints[1] = &susy_scale_constraint;
std::vector<Constraint<T>*> downward_constraints(2);
downward_constraints[0] = &susy_scale_constraint;
downward_constraints[1] = &low_scale_constraint;
@ModelName@_convergence_tester<T> convergence_tester(
&model, this->settings.get(Spectrum_generator_settings::precision));
if (this->settings.get(Spectrum_generator_settings::max_iterations) > 0)
convergence_tester.set_max_iterations(
this->settings.get(Spectrum_generator_settings::max_iterations));
@ModelName@_initial_guesser<T> initial_guesser(&model, qedqcd,
low_scale_constraint,
susy_scale_constraint);
Two_scale_increasing_precision precision(
10.0, this->settings.get(Spectrum_generator_settings::precision));
RGFlow<T> solver;
solver.reset();
solver.set_convergence_tester(&convergence_tester);
solver.set_running_precision(&precision);
solver.set_initial_guesser(&initial_guesser);
solver.add_model(&model, upward_constraints, downward_constraints);
susy_scale = low_scale = 0.;
this->reached_precision = std::numeric_limits<double>::infinity();
try {
solver.solve();
susy_scale = susy_scale_constraint.get_scale();
low_scale = low_scale_constraint.get_scale();
this->reached_precision = convergence_tester.get_current_accuracy();
const double mass_scale =
this->settings.get(Spectrum_generator_settings::pole_mass_scale) != 0. ?
this->settings.get(Spectrum_generator_settings::pole_mass_scale) : susy_scale;
model.run_to(mass_scale);
model.solve_ewsb();
model.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);
}
} catch (...) {
this->translate_exception_to_problem(model);
}
}
/**
* 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
*/
template <class T>
void @ModelName@_spectrum_generator<T>::write_running_couplings(
const std::string& filename) const
{
@ModelName@_spectrum_generator_interface<T>::write_running_couplings(filename, low_scale, susy_scale);
}
} // namespace flexiblesusy
#endif