forked from Expander/FlexibleSUSY
/
run.cpp.in
113 lines (93 loc) · 3.7 KB
/
run.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
// ====================================================================
// 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@_input_parameters.hpp"
#include "@ModelName@_slha_io.hpp"
#include "@ModelName@_spectrum_generator.hpp"
#include "spectrum_generator_settings.hpp"
#include "lowe.h"
#include "command_line_options.hpp"
#include <iostream>
#include <cstdlib>
int main(int argc, const char* argv[])
{
using namespace flexiblesusy;
using namespace softsusy;
typedef Two_scale algorithm_type;
Command_line_options options(argc, argv);
if (options.must_print_model_info())
@ModelName@_info::print(std::cout);
if (options.must_exit())
return options.status();
const std::string rgflow_file(options.get_rgflow_file());
const std::string slha_input_file(options.get_slha_input_file());
const std::string slha_output_file(options.get_slha_output_file());
const std::string spectrum_file(options.get_spectrum_file());
@ModelName@_slha_io slha_io;
Spectrum_generator_settings spectrum_generator_settings;
QedQcd oneset;
@ModelName@_input_parameters input;
if (slha_input_file.empty()) {
ERROR("No SLHA input file given!\n"
" Please provide one via the option --slha-input-file=");
return EXIT_FAILURE;
}
try {
slha_io.read_from_file(slha_input_file);
slha_io.fill(oneset);
slha_io.fill(input);
slha_io.fill(spectrum_generator_settings);
} catch (const Error& error) {
ERROR(error.what());
return EXIT_FAILURE;
}
oneset.toMz(); // run SM fermion masses to MZ
@ModelName@_spectrum_generator<algorithm_type> spectrum_generator;
spectrum_generator.set_settings(spectrum_generator_settings);
spectrum_generator.set_parameter_output_scale(
slha_io.get_parameter_output_scale());
spectrum_generator.run(oneset, input);
const @ModelName@_slha<algorithm_type> model(spectrum_generator.get_model());
const Problems<@ModelName@_info::NUMBER_OF_PARTICLES>& problems
= spectrum_generator.get_problems();
@ModelName@_scales scales;
scales.HighScale = spectrum_generator.get_high_scale();
scales.SUSYScale = spectrum_generator.get_susy_scale();
scales.LowScale = spectrum_generator.get_low_scale();
// output
slha_io.set_spinfo(problems);
slha_io.set_sminputs(oneset);
slha_io.set_minpar(input);
slha_io.set_extpar(input);
if (!problems.have_problem() ||
spectrum_generator_settings.get(Spectrum_generator_settings::force_output)) {
slha_io.set_spectrum(model);
slha_io.set_extra(model, scales);
}
if (slha_output_file.empty()) {
slha_io.write_to_stream(std::cout);
} else {
slha_io.write_to_file(slha_output_file);
}
if (!spectrum_file.empty())
spectrum_generator.write_spectrum(spectrum_file);
if (!rgflow_file.empty())
spectrum_generator.write_running_couplings(rgflow_file);
const int exit_code = spectrum_generator.get_exit_code();
return exit_code;
}