flexiblesusy is hosted by Hepforge, IPPP Durham
FlexibleSUSY
slha_io.cpp
Go to the documentation of this file.
1// ====================================================================
2// This file is part of FlexibleSUSY.
3//
4// FlexibleSUSY is free software: you can redistribute it and/or modify
5// it under the terms of the GNU General Public License as published
6// by the Free Software Foundation, either version 3 of the License,
7// or (at your option) any later version.
8//
9// FlexibleSUSY is distributed in the hope that it will be useful, but
10// WITHOUT ANY WARRANTY; without even the implied warranty of
11// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12// General Public License for more details.
13//
14// You should have received a copy of the GNU General Public License
15// along with FlexibleSUSY. If not, see
16// <http://www.gnu.org/licenses/>.
17// ====================================================================
18
19#include "slha_io.hpp"
20#include "error.hpp"
21#include "ew_input.hpp"
22#include "logger.hpp"
23#include "lowe.h"
24#include "numerics2.hpp"
25#include "physical_input.hpp"
26#include "pmns.hpp"
27#include "slhaea.h"
31#include "string_conversion.hpp"
32#include "string_format.hpp"
33
34#include <algorithm>
35#include <cmath>
36#include <complex>
37#include <fstream>
38#include <iostream>
39#include <sstream>
40#include <string>
41
42namespace flexiblesusy {
43
44namespace {
45
46int round(double a) noexcept
47{
48 return static_cast<int>(a >= 0. ? a + 0.5 : a - 0.5);
49}
50
58void process_modsel_tuple(SLHA_io::Modsel& modsel, int key, double value)
59{
60 switch (key) {
61 case 1: // SUSY breaking model (defined in FlexibleSUSY model file)
62 case 3: // SUSY model (defined in SARAH model file)
63 case 4: // R-parity violation (defined in SARAH model file)
64 case 5: // CP-parity violation (defined in SARAH model file)
65 case 11:
66 case 21:
67 WARNING("Key " << key << " in Block MODSEL currently not supported");
68 break;
69 case 6: // Flavour violation (defined in SARAH model file)
70 {
71 const int ivalue = flexiblesusy::round(value);
72
73 if (ivalue < 0 || ivalue > 3) {
74 WARNING("Value " << ivalue << " in MODSEL block entry 6 out of range");
75 } else {
76 const auto uvalue = static_cast<unsigned>(ivalue);
77 modsel.quark_flavour_violated = ((uvalue & 0x1u) != 0);
78 modsel.lepton_flavour_violated = ((uvalue & 0x2u) != 0);
79 }
80 }
81 break;
82 case 12:
83 modsel.parameter_output_scale = value;
84 break;
85 default:
86 WARNING("Unrecognized entry in block MODSEL: " << key);
87 break;
88 }
89}
90
98void process_sminputs_tuple(softsusy::QedQcd& qedqcd, int key, double value)
99{
100 switch (key) {
101 case 1:
102 qedqcd.setAlpha(softsusy::ALPHA, 1.0 / value);
103 qedqcd.setAlphaEmInput(1.0 / value);
104 break;
105 case 2:
106 qedqcd.setFermiConstant(value);
107 break;
108 case 3:
109 qedqcd.setAlpha(softsusy::ALPHAS, value);
110 qedqcd.setAlphaSInput(value);
111 break;
112 case 4:
113 qedqcd.setPoleMZ(value);
114 qedqcd.set_scale(value);
115 break;
116 case 5:
117 qedqcd.setMass(softsusy::mBottom, value);
118 qedqcd.setMbMb(value);
119 break;
120 case 6:
121 qedqcd.setPoleMt(value);
122 break;
123 case 7:
124 qedqcd.setMass(softsusy::mTau, value);
125 qedqcd.setPoleMtau(value);
126 break;
127 case 8:
128 qedqcd.setNeutrinoPoleMass(3, value);
129 break;
130 case 9:
131 qedqcd.setPoleMW(value);
132 break;
133 case 11:
134 qedqcd.setMass(softsusy::mElectron, value);
135 qedqcd.setPoleMel(value);
136 break;
137 case 12:
138 qedqcd.setNeutrinoPoleMass(1, value);
139 break;
140 case 13:
141 qedqcd.setMass(softsusy::mMuon, value);
142 qedqcd.setPoleMmuon(value);
143 break;
144 case 14:
145 qedqcd.setNeutrinoPoleMass(2, value);
146 break;
147 case 21:
148 qedqcd.setMass(softsusy::mDown, value);
149 qedqcd.setMd2GeV(value);
150 break;
151 case 22:
152 qedqcd.setMass(softsusy::mUp, value);
153 qedqcd.setMu2GeV(value);
154 break;
155 case 23:
156 qedqcd.setMass(softsusy::mStrange, value);
157 qedqcd.setMs2GeV(value);
158 break;
159 case 24:
160 qedqcd.setMass(softsusy::mCharm, value);
161 qedqcd.setMcMc(value);
162 break;
163 default:
164 WARNING("Unrecognized entry in block SMINPUTS: " << key);
165 break;
166 }
167}
168
170 int key, double value)
171{
172 if (0 <= key && key < static_cast<int>(Spectrum_generator_settings::NUMBER_OF_OPTIONS)) {
173 settings.set(static_cast<Spectrum_generator_settings::Settings>(key), value);
174 } else {
175 WARNING("Unrecognized entry in block FlexibleSUSY: " << key);
176 }
177}
178
180 int key, double value)
181{
182 if (0 <= key && key < static_cast<int>(LToLConversion_settings::NUMBER_OF_OPTIONS)) {
183 settings.set(static_cast<LToLConversion_settings::Settings>(key), value);
184 } else {
185 WARNING("Unrecognized entry in block LToLConversion: " << key);
186 }
187}
188
190 int key, double value)
191{
192 if (0 <= key && key < static_cast<int>(FlexibleDecay_settings::NUMBER_OF_OPTIONS)) {
193 settings.set(static_cast<FlexibleDecay_settings::Settings>(key), value);
194 } else {
195 WARNING("Unrecognized entry in block FlexibleDecay: " << key);
196 }
197}
198
200 Physical_input& input,
201 int key, double value)
202{
203 if (0 <= key && key < static_cast<int>(Physical_input::NUMBER_OF_INPUT_PARAMETERS)) {
204 input.set(static_cast<Physical_input::Input>(key), value);
205 } else {
206 WARNING("Unrecognized entry in block FlexibleSUSYInput: " << key);
207 }
208}
209
217void process_vckmin_tuple(SLHA_io::CKM_wolfenstein& ckm_wolfenstein, int key, double value)
218{
219 switch (key) {
220 case 1:
221 ckm_wolfenstein.lambdaW = value;
222 break;
223 case 2:
224 ckm_wolfenstein.aCkm = value;
225 break;
226 case 3:
227 ckm_wolfenstein.rhobar = value;
228 break;
229 case 4:
230 ckm_wolfenstein.etabar = value;
231 break;
232 default:
233 WARNING("Unrecognized entry in block VCKMIN: " << key);
234 break;
235 }
236}
237
245void process_upmnsin_tuple(PMNS_parameters& pmns_parameters, int key, double value)
246{
247 switch (key) {
248 case 1:
249 pmns_parameters.theta_12 = value;
250 break;
251 case 2:
252 pmns_parameters.theta_23 = value;
253 break;
254 case 3:
255 pmns_parameters.theta_13 = value;
256 break;
257 case 4:
258 pmns_parameters.delta = value;
259 break;
260 case 5:
261 pmns_parameters.alpha_1 = value;
262 break;
263 case 6:
264 pmns_parameters.alpha_2 = value;
265 break;
266 default:
267 WARNING("Unrecognized entry in block UPMNSIN: " << key);
268 break;
269 }
270}
271
272int column_major_index(int r, int c, int /* rows */ , int cols)
273{
274 return c*cols + r;
275}
276
277template <typename T>
279 constexpr static const char* const value = "Re(";
280};
281
282template <>
283struct real_prefix<double> {
284 constexpr static const char* const value = "";
285};
286
287template <typename T>
289 constexpr static const char* const value = ")";
290};
291
292template <>
293struct real_suffix<double> {
294 constexpr static const char* const value = "";
295};
296
297} // anonymous namespace
298
299namespace detail {
300
301bool read_scale(const SLHAea::Line& line, double& scale)
302{
303 if (line.is_block_def() && line.size() > 3 && line[2] == "Q=") {
304 scale = to_double(line[3].c_str());
305 return true;
306 }
307 return false;
308}
309
310template <typename T>
311double read_matrix_(const SLHAea::Coll& data, const std::string& block_name, T* a, int rows, int cols)
312{
313 auto block = SLHAea::Coll::find(data.cbegin(), data.cend(), block_name);
314
315 double scale = 0.;
316
317 while (block != data.cend()) {
318 for (const auto& line: *block) {
319 detail::read_scale(line, scale);
320
321 if (line.is_data_line() && line.size() >= 3) {
322 const int i = to_int(line[0].c_str()) - 1;
323 const int k = to_int(line[1].c_str()) - 1;
324 if (0 <= i && i < rows && 0 <= k && k < cols) {
325 a[k*cols + i] = to_double(line[2].c_str());
326 }
327 }
328 }
329
330 ++block;
331 block = SLHAea::Coll::find(block, data.cend(), block_name);
332 }
333
334 return scale;
335}
336
337template <typename T>
338double read_vector_(const SLHAea::Coll& data, const std::string& block_name, T* a, int len)
339{
340 auto block = SLHAea::Coll::find(data.cbegin(), data.cend(), block_name);
341
342 double scale = 0.;
343
344 while (block != data.cend()) {
345 for (const auto& line: *block) {
346 detail::read_scale(line, scale);
347
348 if (line.is_data_line() && line.size() >= 2) {
349 const int i = to_int(line[0].c_str()) - 1;
350 if (0 <= i && i < len) {
351 a[i] = to_double(line[1].c_str());
352 }
353 }
354 }
355
356 ++block;
357 block = SLHAea::Coll::find(block, data.cend(), block_name);
358 }
359
360 return scale;
361}
362
363
364template <typename T>
365std::string format_vector(const std::string& name, const T* a, const std::string& symbol, int rows)
366{
367 constexpr const char* const prefix = real_prefix<T>::value;
368 constexpr const char* const suffix = real_suffix<T>::value;
369
370 std::ostringstream ss;
371 ss << name;
372
373 for (int i = 1; i <= rows; ++i) {
374 ss << FORMAT_VECTOR(i, std::real(a[i-1]), (prefix + symbol + "(" + flexiblesusy::to_string(i) + ")" + suffix));
375 }
376
377 return ss.str();
378}
379
380
381template <typename T>
382std::string format_matrix(const std::string& name, const T* a, const std::string& symbol, int rows, int cols)
383{
384 constexpr const char* const prefix = real_prefix<T>::value;
385 constexpr const char* const suffix = real_suffix<T>::value;
386
387 std::ostringstream ss;
388 ss << name;
389
390 for (int i = 1; i <= rows; ++i) {
391 for (int k = 1; k <= cols; ++k) {
392 const int idx = column_major_index(i-1, k-1, rows, cols);
393 ss << FORMAT_MIXING_MATRIX(i, k, std::real(a[idx]),
394 (prefix + symbol + "(" + flexiblesusy::to_string(i) + "," + flexiblesusy::to_string(k) + ")" + suffix));
395 }
396 }
397
398 return ss.str();
399}
400
401
402template <typename T>
403std::string format_vector_imag(const std::string& name, const T* a, const std::string& symbol, int rows)
404{
405 std::ostringstream ss;
406 ss << name;
407
408 for (int i = 1; i <= rows; ++i) {
409 ss << FORMAT_VECTOR(i, std::imag(a[i-1]), ("Im(" + symbol + "(" + flexiblesusy::to_string(i) + "))"));
410 }
411
412 return ss.str();
413}
414
415
416template <typename T>
417std::string format_matrix_imag(const std::string& name, const T* a, const std::string& symbol, int rows, int cols)
418{
419 std::ostringstream ss;
420 ss << name;
421
422 for (int i = 1; i <= rows; ++i) {
423 for (int k = 1; k <= cols; ++k) {
424 const int idx = column_major_index(i-1, k-1, rows, cols);
425 ss << FORMAT_MIXING_MATRIX(i, k, std::imag(a[idx]),
426 ("Im(" + symbol + "(" + flexiblesusy::to_string(i) + "," + flexiblesusy::to_string(k) + "))"));
427 }
428 }
429
430 return ss.str();
431}
432
433
434} // namespace detail
435
436
438 : data(std::make_unique<SLHAea::Coll>())
439{
440}
441
442
444 : data(std::make_unique<SLHAea::Coll>(*other.data))
445 , modsel(other.modsel)
446{
447}
448
449
450SLHA_io::SLHA_io(SLHA_io&& other) noexcept
451 : data(std::move(other.data))
452 , modsel(std::move(other.modsel))
453{
454}
455
456
457SLHA_io::~SLHA_io() = default;
458
459
461{
462 return *this = SLHA_io(other);
463}
464
465
467{
468 data = std::move(other.data);
469 modsel = std::move(other.modsel);
470 return *this;
471}
472
473
475{
476 data->clear();
477 modsel.clear();
478}
479
480
482{
483 return *data;
484}
485
486
488{
489 data.reset(new SLHAea::Coll(data_));
490}
491
492
493std::string SLHA_io::block_head(const std::string& name, double scale)
494{
495 const double eps = std::numeric_limits<double>::epsilon();
496
497 std::string result("Block " + name);
498
499 if (!is_zero(scale, eps)) {
500 result += " Q= " + FORMAT_SCALE(scale);
501 }
502
503 result += '\n';
504
505 return result;
506}
507
508bool SLHA_io::block_exists(const std::string& block_name) const
509{
510 return data->find(block_name) != data->cend();
511}
512
521void SLHA_io::read_from_source(const std::string& source)
522{
523 if (source == "-") {
524 read_from_stream(std::cin);
525 } else {
526 read_from_file(source);
527 }
528}
529
534void SLHA_io::read_from_file(const std::string& file_name)
535{
536 std::ifstream ifs(file_name);
537 if (ifs.good()) {
538 read_from_stream(ifs);
539 } else {
540 throw ReadError(R"(cannot read SLHA file: ")" + file_name + R"(")");
541 }
542}
543
548void SLHA_io::read_from_stream(std::istream& istr)
549{
550 data->clear();
551 data->read(istr);
552 read_modsel();
553}
554
564bool SLHA_io::read_scale(const SLHAea::Line& line, double& scale)
565{
566 return detail::read_scale(line, scale);
567}
568
570{
571 Tuple_processor modsel_processor = [this] (int key, double value) {
572 return process_modsel_tuple(modsel, key, value);
573 };
574
575 read_block("MODSEL", modsel_processor);
576}
577
579{
580 CKM_wolfenstein ckm_wolfenstein;
581 PMNS_parameters pmns_parameters;
582
583 Tuple_processor sminputs_processor = [&qedqcd] (int key, double value) {
584 return process_sminputs_tuple(qedqcd, key, value);
585 };
586
587 read_block("SMINPUTS", sminputs_processor);
588
590 Tuple_processor vckmin_processor = [&ckm_wolfenstein] (int key, double value) {
591 return process_vckmin_tuple(ckm_wolfenstein, key, value);
592 };
593
594 read_block("VCKMIN", vckmin_processor);
595 }
596
598 Tuple_processor upmnsin_processor = [&pmns_parameters] (int key, double value) {
599 return process_upmnsin_tuple(pmns_parameters, key, value);
600 };
601
602 read_block("UPMNSIN", upmnsin_processor);
603 }
604
605 // fill CKM parameters in qedqcd
606 CKM_parameters ckm_parameters;
607 ckm_parameters.set_from_wolfenstein(
608 ckm_wolfenstein.lambdaW,
609 ckm_wolfenstein.aCkm,
610 ckm_wolfenstein.rhobar,
611 ckm_wolfenstein.etabar);
612 qedqcd.setCKM(ckm_parameters);
613
614 // fill PMNS parameters in qedqcd
615 qedqcd.setPMNS(pmns_parameters);
616}
617
625{
626 Tuple_processor processor = [&input] (int key, double value) {
627 return process_flexiblesusyinput_tuple(input, key, value);
628 };
629
630 read_block("FlexibleSUSYInput", processor);
631}
632
640{
641 Tuple_processor processor = [&settings] (int key, double value) {
642 return process_ltolconversion_tuple(settings, key, value);
643 };
644
645 read_block("LToLConversion", processor);
646}
647
655{
656 Tuple_processor flexibledecay_processor = [&settings] (int key, double value) {
657 return process_flexibledecay_tuple(settings, key, value);
658 };
659
660 read_block("FlexibleDecay", flexibledecay_processor);
661}
662
670{
671 Tuple_processor flexiblesusy_processor = [&settings] (int key, double value) {
672 return process_flexiblesusy_tuple(settings, key, value);
673 };
674
675 read_block("FlexibleSUSY", flexiblesusy_processor);
676}
677
687double SLHA_io::read_block(const std::string& block_name, const Tuple_processor& processor) const
688{
689 auto block = SLHAea::Coll::find(data->cbegin(), data->cend(), block_name);
690 double scale = 0.;
691
692 while (block != data->cend()) {
693 for (const auto& line: *block) {
694 read_scale(line, scale);
695
696 if (line.is_data_line() && line.size() >= 2) {
697 const auto key = to_int(line[0].c_str());
698 const auto value = to_double(line[1].c_str());
699 processor(key, value);
700 }
701 }
702
703 ++block;
704 block = SLHAea::Coll::find(block, data->cend(), block_name);
705 }
706
707 return scale;
708}
709
718double SLHA_io::read_block(const std::string& block_name, double& entry) const
719{
720 auto block = SLHAea::Coll::find(data->cbegin(), data->cend(), block_name);
721 double scale = 0.;
722
723 while (block != data->cend()) {
724 for (const auto& line: *block) {
725 read_scale(line, scale);
726
727 if (line.is_data_line()) {
728 entry = to_double(line[0].c_str());
729 }
730 }
731
732 ++block;
733 block = SLHAea::Coll::find(block, data->cend(), block_name);
734 }
735
736 return scale;
737}
738
739double SLHA_io::read_entry(const std::string& block_name, int key) const
740{
741 auto block = SLHAea::Coll::find(data->cbegin(), data->cend(), block_name);
742 double entry = 0.;
744
745 while (block != data->cend()) {
746 auto line = block->find(keys);
747
748 while (line != block->end()) {
749 if (line->is_data_line() && line->size() > 1) {
750 entry = to_double(line->at(1).c_str());
751 }
752
753 ++line;
754 line = block->find(line, block->end(), keys);
755 }
756
757 ++block;
758 block = SLHAea::Coll::find(block, data->cend(), block_name);
759 }
760
761 return entry;
762}
763
771double SLHA_io::read_scale(const std::string& block_name) const
772{
773 double scale = 0.;
774 auto block = SLHAea::Coll::find(data->cbegin(), data->cend(), block_name);
775
776 while (block != data->cend()) {
777 for (const auto& line: *block) {
778 read_scale(line, scale);
779 }
780
781 ++block;
782 block = SLHAea::Coll::find(block, data->cend(), block_name);
783 }
784
785 return scale;
786}
787
788void SLHA_io::set_block(const std::ostringstream& lines, Position position)
789{
790 set_block(lines.str(), position);
791}
792
793void SLHA_io::set_block(const std::string& lines, Position position)
794{
795 SLHAea::Block block;
796 block.str(lines);
797
798 data->erase(block.name());
799
800 if (position == front) {
801 data->push_front(std::move(block));
802 } else {
803 data->push_back(std::move(block));
804 }
805}
806
807void SLHA_io::set_blocks(const std::vector<std::string>& blocks, Position position)
808{
809 for (const auto& block: blocks) {
810 set_block(block, position);
811 }
812}
813
819void SLHA_io::set_block(const std::string& name, double value,
820 const std::string& symbol, double scale)
821{
822 std::ostringstream ss;
823 ss << block_head(name, scale);
824 ss << FORMAT_MIXING_MATRIX(1, 1, value, symbol);
825
826 set_block(ss);
827}
828
829void SLHA_io::set_modsel(const Modsel& modsel_)
830{
831 modsel = modsel_;
832 const auto qfv = static_cast<unsigned>(modsel.quark_flavour_violated);
833 const auto lfv = 2u * static_cast<unsigned>(modsel.lepton_flavour_violated);
834
835 std::ostringstream ss;
836 ss << block_head("MODSEL", 0.0);
837 ss << FORMAT_ELEMENT(6 , qfv | lfv, "quark/lepton flavour violation");
838 ss << FORMAT_ELEMENT(12, modsel.parameter_output_scale, "running parameter output scale (GeV)");
839
840 set_block(ss);
841}
842
844{
845 const auto& names = flexiblesusy::Physical_input::get_names();
846
847 std::ostringstream ss;
848 ss << block_head("FlexibleSUSYInput", 0.0);
849
850 for (std::size_t i = 0; i < names.size(); i++) {
851 ss << FORMAT_ELEMENT(i, input.get(static_cast<Physical_input::Input>(i)),
852 names[i]);
853 }
854
855 set_block(ss);
856}
857
859{
860 std::ostringstream ss;
861 ss << block_head("FlexibleSUSY", 0.0);
862
863 for (int i = 0; i < Spectrum_generator_settings::NUMBER_OF_OPTIONS; i++) {
865 settings.get_description(static_cast<Spectrum_generator_settings::Settings>(i)));
866 }
867
868 set_block(ss);
869}
870
872{
873 std::ostringstream ss;
874 ss << block_head("LToLConversion", 0.0);
875
876 for (int i = 0; i < LToLConversion_settings::NUMBER_OF_OPTIONS; i++) {
877 ss << FORMAT_ELEMENT(i, settings.get(static_cast<LToLConversion_settings::Settings>(i)),
878 settings.get_description(static_cast<LToLConversion_settings::Settings>(i)));
879 }
880
881 set_block(ss);
882}
883
885{
886 std::ostringstream ss;
887 ss << block_head("FlexibleDecay", 0.0);
888
889 for (int i = 0; i < FlexibleDecay_settings::NUMBER_OF_OPTIONS; i++) {
890 ss << FORMAT_ELEMENT(i, settings.get(static_cast<FlexibleDecay_settings::Settings>(i)),
891 settings.get_description(static_cast<FlexibleDecay_settings::Settings>(i)));
892 }
893
894 set_block(ss);
895}
896
898{
899 std::ostringstream ss;
900
901 ss << block_head("SMINPUTS", 0.0);
902 ss << FORMAT_ELEMENT( 1, 1./qedqcd.displayAlphaEmInput() , "alpha_em^(-1)(MZ) SM(5) MSbar");
903 ss << FORMAT_ELEMENT( 2, qedqcd.displayFermiConstant() , "G_Fermi");
904 ss << FORMAT_ELEMENT( 3, qedqcd.displayAlphaSInput() , "alpha_s(MZ) SM(5) MSbar");
905 ss << FORMAT_ELEMENT( 4, qedqcd.displayPoleMZ() , "MZ(pole)");
906 ss << FORMAT_ELEMENT( 5, qedqcd.displayMbMb() , "mb(mb) SM(5) MSbar");
907 ss << FORMAT_ELEMENT( 6, qedqcd.displayPoleMt() , "Mtop(pole)");
908 ss << FORMAT_ELEMENT( 7, qedqcd.displayPoleMtau() , "Mtau(pole)");
909 ss << FORMAT_ELEMENT( 8, qedqcd.displayNeutrinoPoleMass(3), "Mv3(pole)");
910 ss << FORMAT_ELEMENT( 9, qedqcd.displayPoleMW() , "MW(pole)");
911 ss << FORMAT_ELEMENT(11, qedqcd.displayPoleMel() , "Melectron(pole)");
912 ss << FORMAT_ELEMENT(12, qedqcd.displayNeutrinoPoleMass(1), "Mv1(pole)");
913 ss << FORMAT_ELEMENT(13, qedqcd.displayPoleMmuon() , "Mmuon(pole)");
914 ss << FORMAT_ELEMENT(14, qedqcd.displayNeutrinoPoleMass(2), "Mv2(pole)");
915 ss << FORMAT_ELEMENT(21, qedqcd.displayMd2GeV() , "md(2GeV)");
916 ss << FORMAT_ELEMENT(22, qedqcd.displayMu2GeV() , "mu(2GeV)");
917 ss << FORMAT_ELEMENT(23, qedqcd.displayMs2GeV() , "ms(2GeV)");
918 ss << FORMAT_ELEMENT(24, qedqcd.displayMcMc() , "mc(mc) SM(4) MSbar");
919
920 set_block(ss);
921}
922
924 Spectrum_generator_settings const& spectrum_generator_settings, UnitarityInfiniteS const& unitarity)
925{
926 if (spectrum_generator_settings.get(Spectrum_generator_settings::calculate_observables)) {
927 std::ostringstream block;
928 block << "Block FlexibleSUSYUnitarity Q= " << FORMAT_SCALE(unitarity.renScale) << '\n'
929 << FORMAT_ELEMENT(0, unitarity.allowed, "Tree-level unitarity limits fulfilled or not")
930 << FORMAT_ELEMENT(1, unitarity.maxAbsReEigenval, "max(|re(eigenvalues(a0))|)");
931 set_block(block);
932 }
933}
934
935void SLHA_io::write_to_file(const std::string& file_name) const
936{
937 std::ofstream ofs(file_name);
938 write_to_stream(ofs);
939}
940
941void SLHA_io::write_to_stream(std::ostream& ostr) const
942{
943 if (ostr.good()) {
944 ostr << *data;
945 } else {
946 ERROR("cannot write SLHA file");
947 }
948}
949
950
952{
953 write_to_stream(std::cerr);
954}
955
956
957double SLHA_io::read_vector(const std::string& block_name, double* a, int len) const
958{
959 return detail::read_vector_(*data, block_name, a, len);
960}
961
962
963double SLHA_io::read_vector(const std::string& block_name, std::complex<double>* a, int len) const
964{
965 return detail::read_vector_(*data, block_name, a, len);
966}
967
968
969double SLHA_io::read_matrix(const std::string& block_name, double* a, int rows, int cols) const
970{
971 return detail::read_matrix_(*data, block_name, a, rows, cols);
972}
973
974
975double SLHA_io::read_matrix(const std::string& block_name, std::complex<double>* a, int rows, int cols) const
976{
977 return detail::read_matrix_(*data, block_name, a, rows, cols);
978}
979
980
981void SLHA_io::set_vector(const std::string& name, const double* a, const std::string& symbol, double scale, int rows)
982{
983 set_block(detail::format_vector(block_head(name, scale), a, symbol, rows));
984}
985
986
987void SLHA_io::set_vector(const std::string& name, const std::complex<double>* a, const std::string& symbol, double scale, int rows)
988{
989 set_block(detail::format_vector(block_head(name, scale), a, symbol, rows));
990}
991
992
993void SLHA_io::set_matrix(const std::string& name, const double* a, const std::string& symbol, double scale, int rows, int cols)
994{
995 set_block(detail::format_matrix(block_head(name, scale), a, symbol, rows, cols));
996}
997
998
999void SLHA_io::set_matrix(const std::string& name, const std::complex<double>* a, const std::string& symbol, double scale, int rows, int cols)
1000{
1001 set_block(detail::format_matrix(block_head(name, scale), a, symbol, rows, cols));
1002}
1003
1004
1005void SLHA_io::set_vector_imag(const std::string& name, const double* a, const std::string& symbol, double scale, int rows)
1006{
1007 set_block(detail::format_vector_imag(block_head(name, scale), a, symbol, rows));
1008}
1009
1010
1011void SLHA_io::set_vector_imag(const std::string& name, const std::complex<double>* a, const std::string& symbol, double scale, int rows)
1012{
1013 set_block(detail::format_vector_imag(block_head(name, scale), a, symbol, rows));
1014}
1015
1016
1017void SLHA_io::set_matrix_imag(const std::string& name, const double* a, const std::string& symbol, double scale, int rows, int cols)
1018{
1019 set_block(detail::format_matrix_imag(block_head(name, scale), a, symbol, rows, cols));
1020}
1021
1022
1023void SLHA_io::set_matrix_imag(const std::string& name, const std::complex<double>* a, const std::string& symbol, double scale, int rows, int cols)
1024{
1025 set_block(detail::format_matrix_imag(block_head(name, scale), a, symbol, rows, cols));
1026}
1027
1028void SLHA_io::set_effectivecouplings_block(const std::vector<std::tuple<int, int, int, double, std::string>>& effCouplings)
1029{
1030 std::ostringstream decay;
1031 decay << "Block EFFHIGGSCOUPLINGS\n";
1032
1033 for (auto const& effC : effCouplings) {
1034 decay << FORMAT_EFFECTIVECOUPLINGS(std::get<0>(effC), std::get<1>(effC), std::get<2>(effC), std::get<3>(effC), std::get<4>(effC));
1035 }
1036
1037 set_block(decay);
1038}
1039} // namespace flexiblesusy
std::vector< std::string > key_type
Definition: slhaea.h:736
Block & str(const std::string &block)
Assigns content from a string to the Block.
Definition: slhaea.h:868
void name(const std::string &newName)
Sets the name of the Block.
Definition: slhaea.h:788
iterator find(const key_type &blockName)
Tries to locate a Block in the Coll.
Definition: slhaea.h:2024
size_type size() const
Definition: slhaea.h:536
bool is_block_def() const
Definition: slhaea.h:512
@ NUMBER_OF_OPTIONS
number of possible options
Settings
LToLConversion settings.
Definition: settings.hpp:30
@ NUMBER_OF_OPTIONS
number of possible options
Definition: settings.hpp:41
stores physical input parameters
double get(Input) const
get value of input parameter
void set(Input, double)
set value of input parameter
Input
available physical input parameters
@ NUMBER_OF_INPUT_PARAMETERS
number of possible input parameters
static const std::array< std::string, NUMBER_OF_INPUT_PARAMETERS > & get_names()
get names of input parameters
Handles reading and writing of SLHA files.
Definition: slha_io.hpp:95
void set_vector_imag(const std::string &, const double *, const std::string &, double, int)
Definition: slha_io.cpp:1005
double read_vector(const std::string &, double *, int) const
Definition: slha_io.cpp:957
void set_modsel(const Modsel &)
Definition: slha_io.cpp:829
void set_blocks(const std::vector< std::string > &, Position position=back)
Definition: slha_io.cpp:807
void set_matrix(const std::string &, const double *, const std::string &, double, int, int)
Definition: slha_io.cpp:993
void set_FlexibleDecay_settings(const FlexibleDecay_settings &)
Definition: slha_io.cpp:884
void set_vector(const std::string &, const double *, const std::string &, double, int)
Definition: slha_io.cpp:981
void set_effectivecouplings_block(const std::vector< std::tuple< int, int, int, double, std::string > > &)
Definition: slha_io.cpp:1028
double read_block(const std::string &, const Tuple_processor &) const
Definition: slha_io.cpp:687
void set_settings(const Spectrum_generator_settings &)
Definition: slha_io.cpp:858
void read_from_file(const std::string &)
opens SLHA input file and reads the content
Definition: slha_io.cpp:534
bool block_exists(const std::string &) const
Definition: slha_io.cpp:508
double read_entry(const std::string &, int) const
Definition: slha_io.cpp:739
void read_from_stream(std::istream &)
clears stored data and reads SLHA data from a stream
Definition: slha_io.cpp:548
void set_unitarity_infinite_s(Spectrum_generator_settings const &, UnitarityInfiniteS const &)
Definition: slha_io.cpp:923
std::unique_ptr< SLHAea::Coll > data
SHLA data.
Definition: slha_io.hpp:163
void read_from_source(const std::string &)
reads from source
Definition: slha_io.cpp:521
void set_block(const std::ostringstream &, Position position=back)
Definition: slha_io.cpp:788
void set_LToLConversion_settings(const LToLConversion_settings &)
Definition: slha_io.cpp:871
void set_matrix_imag(const std::string &, const double *, const std::string &, double, int, int)
Definition: slha_io.cpp:1017
static std::string block_head(const std::string &name, double scale)
Definition: slha_io.cpp:493
double read_scale(const std::string &) const
Definition: slha_io.cpp:771
std::function< void(int, double)> Tuple_processor
Definition: slha_io.hpp:97
void set_sminputs(const softsusy::QedQcd &)
Definition: slha_io.cpp:897
const SLHAea::Coll & get_data() const
Definition: slha_io.cpp:481
Modsel modsel
data from block MODSEL
Definition: slha_io.hpp:164
void fill(softsusy::QedQcd &) const
Definition: slha_io.cpp:578
SLHA_io & operator=(const SLHA_io &)
Definition: slha_io.cpp:460
double read_matrix(const std::string &, double *, int, int) const
Definition: slha_io.cpp:969
void set_data(const SLHAea::Coll &)
Definition: slha_io.cpp:487
void write_to_file(const std::string &) const
Definition: slha_io.cpp:935
void write_to_stream() const
Definition: slha_io.cpp:951
void set_physical_input(const Physical_input &)
Definition: slha_io.cpp:843
stores the spectrum generator settings
double get(Settings) const
get value of spectrum generator setting
Quark and lepton masses and gauge couplings in QEDxQCD effective theory.
Definition: lowe.h:64
void setPMNS(const flexiblesusy::PMNS_parameters &)
sets PMNS parameters (in the MS-bar scheme at MZ)
Definition: lowe.cpp:181
double displayAlphaSInput() const
Returns input value alpha_s(MZ)
Definition: lowe.h:169
void setPoleMmuon(double m)
set pole muon mass
Definition: lowe.h:100
void setPoleMZ(double mz)
Definition: lowe.h:108
void setMs2GeV(double ms)
set ms(2 GeV)
Definition: lowe.h:106
void setMcMc(double mc)
set mc(mc)
Definition: lowe.h:103
void setMbMb(double mb)
set mb(mb)
Definition: lowe.h:102
void setPoleMel(double m)
set pole electron mass
Definition: lowe.h:101
double displayPoleMt() const
Display pole top mass.
Definition: lowe.h:135
double displayFermiConstant() const
Returns Fermi constant.
Definition: lowe.h:171
double displayMu2GeV() const
Returns mu(2 GeV)
Definition: lowe.h:181
void setNeutrinoPoleMass(int i, double m)
sets a neutrino pole mass
Definition: lowe.h:114
void setMd2GeV(double md)
set md(2 GeV)
Definition: lowe.h:105
double displayMbMb() const
Returns mb(mb) MSbar.
Definition: lowe.h:177
void setPoleMW(double mw)
set W boson pole mass
Definition: lowe.h:107
double displayMs2GeV() const
Returns ms(2 GeV)
Definition: lowe.h:185
void setCKM(const flexiblesusy::CKM_parameters &)
sets CKM parameters (in the MS-bar scheme at MZ)
Definition: lowe.cpp:173
void setAlphaEmInput(double a)
set input value of alpha_em(MZ)
Definition: lowe.h:120
double displayNeutrinoPoleMass(int i) const
Returns a single neutrino pole mass.
Definition: lowe.h:157
void setMass(EMass mno, double m)
sets a running quark mass
Definition: lowe.h:112
double displayPoleMel() const
Display pole electron mass.
Definition: lowe.h:141
double displayPoleMmuon() const
Display pole muon mass.
Definition: lowe.h:139
void setAlphaSInput(double a)
set input value of alpha_s(MZ)
Definition: lowe.h:122
double displayPoleMtau() const
Display pole tau mass.
Definition: lowe.h:137
void setFermiConstant(double gf)
sets Fermi constant
Definition: lowe.h:128
void setMu2GeV(double mu)
set mu(2 GeV)
Definition: lowe.h:104
double displayMcMc() const
Returns mc(mc) MSbar.
Definition: lowe.h:179
double displayPoleMZ() const
Returns Z boson pole mass.
Definition: lowe.h:147
void setPoleMt(double mt)
set pole top mass
Definition: lowe.h:97
void setPoleMtau(double mtau)
set pole tau mass
Definition: lowe.h:99
double displayPoleMW() const
Returns W boson pole mass.
Definition: lowe.h:145
double displayMd2GeV() const
Returns md(2 GeV)
Definition: lowe.h:183
double displayAlphaEmInput() const
Returns input value alpha_em(MZ)
Definition: lowe.h:167
void setAlpha(EGauge ai, double ap)
sets QED or QCD structure constant
Definition: lowe.h:118
#define ERROR(msg)
Definition: logger.hpp:65
#define WARNING(msg)
Definition: logger.hpp:63
QedQcd object contains Standard Model quark and lepton masses. It integrates them using 3 loop qcd x ...
void process_sminputs_tuple(softsusy::QedQcd &qedqcd, int key, double value)
Definition: slha_io.cpp:98
void process_flexibledecay_tuple(FlexibleDecay_settings &settings, int key, double value)
Definition: slha_io.cpp:189
int column_major_index(int r, int c, int, int cols)
Definition: slha_io.cpp:272
void process_modsel_tuple(SLHA_io::Modsel &modsel, int key, double value)
Definition: slha_io.cpp:58
void process_ltolconversion_tuple(LToLConversion_settings &settings, int key, double value)
Definition: slha_io.cpp:179
void process_upmnsin_tuple(PMNS_parameters &pmns_parameters, int key, double value)
Definition: slha_io.cpp:245
void process_flexiblesusyinput_tuple(Physical_input &input, int key, double value)
Definition: slha_io.cpp:199
void process_flexiblesusy_tuple(Spectrum_generator_settings &settings, int key, double value)
Definition: slha_io.cpp:169
void process_vckmin_tuple(SLHA_io::CKM_wolfenstein &ckm_wolfenstein, int key, double value)
Definition: slha_io.cpp:217
double read_matrix_(const SLHAea::Coll &data, const std::string &block_name, T *a, int rows, int cols)
Definition: slha_io.cpp:311
std::string format_matrix_imag(const std::string &name, const T *a, const std::string &symbol, int rows, int cols)
Definition: slha_io.cpp:417
std::string format_vector_imag(const std::string &name, const T *a, const std::string &symbol, int rows)
Definition: slha_io.cpp:403
std::string format_matrix(const std::string &name, const T *a, const std::string &symbol, int rows, int cols)
Definition: slha_io.cpp:382
std::string format_vector(const std::string &name, const T *a, const std::string &symbol, int rows)
Definition: slha_io.cpp:365
double read_vector_(const SLHAea::Coll &data, const std::string &block_name, T *a, int len)
Definition: slha_io.cpp:338
bool read_scale(const SLHAea::Line &line, double &scale)
Definition: slha_io.cpp:301
const Real epsilon
Definition: mathdefs.hpp:18
std::enable_if_t< std::is_unsigned< T >::value, bool > is_zero(T a, T prec=std::numeric_limits< T >::epsilon()) noexcept
compares a number for being close to zero
Definition: numerics2.hpp:46
std::string to_string(char a)
double to_double(const char *s)
int to_int(const char *s)
@ ALPHA
Definition: lowe.h:44
@ ALPHAS
Definition: lowe.h:44
@ mDown
Definition: lowe.h:41
@ mTau
Definition: lowe.h:42
@ mStrange
Definition: lowe.h:41
@ mUp
Definition: lowe.h:41
@ mBottom
Definition: lowe.h:41
@ mElectron
Definition: lowe.h:41
@ mMuon
Definition: lowe.h:42
@ mCharm
Definition: lowe.h:41
data
Definition: scan_HSSUSY.m:46
#define FORMAT_ELEMENT(pdg, value, name)
#define FORMAT_VECTOR(i, entry, name)
Definition: slha_format.hpp:96
#define FORMAT_SCALE(n)
#define FORMAT_MIXING_MATRIX(i, k, entry, name)
Definition: slha_format.hpp:84
void set_from_wolfenstein(double, double, double, double)
Definition: ckm.cpp:65
bool quark_flavour_violated
MODSEL[6].
Definition: slha_io.hpp:100
bool lepton_flavour_violated
MODSEL[6].
Definition: slha_io.hpp:101
double parameter_output_scale
MODSEL[12].
Definition: slha_io.hpp:102