|
Go to the documentation of this file.
56template < typename Container>
57std::string format_decay( double br, const Container& pids, const std::string& name)
59 const int nda = pids.size();
60 char buf[SLHA_MAX_LINE_LENGTH] = { 0 };
62 written += std::snprintf(buf + written, SLHA_MAX_LINE_LENGTH - written,
63 " %16.8E %2d ", br, nda);
64 for ( int i = 0; i < nda; i++) {
65 written += std::snprintf(buf + written, SLHA_MAX_LINE_LENGTH - written,
68 written += std::snprintf(buf + written, SLHA_MAX_LINE_LENGTH - written,
69 " # %s\n", name.c_str());
70 return std::string(buf);
73#define FORMAT_MASS(pdg, mass, name) \
75 char buf[SLHA_MAX_LINE_LENGTH]; \
76 const int pdg_ = (pdg); \
77 const double mass_ = (mass); \
78 const std::string name_ = (name); \
79 std::snprintf(buf, SLHA_MAX_LINE_LENGTH, mass_formatter, pdg_, mass_, \
81 return std::string(buf); \
84#define FORMAT_MIXING_MATRIX(i, k, entry, name) \
86 char buf[SLHA_MAX_LINE_LENGTH]; \
89 const double entry_ = (entry); \
90 const std::string name_ = (name); \
91 std::snprintf(buf, SLHA_MAX_LINE_LENGTH, mixing_matrix_formatter, i_, \
92 k_, entry_, name_.c_str()); \
93 return std::string(buf); \
96#define FORMAT_VECTOR(i, entry, name) \
98 char buf[SLHA_MAX_LINE_LENGTH]; \
100 const double entry_ = (entry); \
101 const std::string name_ = (name); \
102 std::snprintf(buf, SLHA_MAX_LINE_LENGTH, vector_formatter, i_, entry_, \
104 return std::string(buf); \
107#define FORMAT_ELEMENT(pdg, value, name) \
109 char buf[SLHA_MAX_LINE_LENGTH]; \
110 const int pdg_ = (pdg); \
111 const double value_ = (value); \
112 const std::string name_ = (name); \
113 std::snprintf(buf, SLHA_MAX_LINE_LENGTH, single_element_formatter, pdg_, \
114 value_, name_.c_str()); \
115 return std::string(buf); \
118#define FORMAT_SCALE(n) \
120 char buf[SLHA_MAX_LINE_LENGTH]; \
121 const double n_ = (n); \
122 std::snprintf(buf, SLHA_MAX_LINE_LENGTH, scale_formatter, n_); \
123 return std::string(buf); \
126#define FORMAT_NUMBER(n, str) \
128 char buf[SLHA_MAX_LINE_LENGTH]; \
129 const double n_ = (n); \
130 const std::string str_ = (str); \
131 std::snprintf(buf, SLHA_MAX_LINE_LENGTH, number_formatter, n_, \
133 return std::string(buf); \
136#define FORMAT_SPINFO(n, str) \
138 char buf[SLHA_MAX_LINE_LENGTH]; \
139 const int n_ = (n); \
140 const std::string str_ = (str); \
141 std::snprintf(buf, SLHA_MAX_LINE_LENGTH, spinfo_formatter, n_, \
143 return std::string(buf); \
146#define FORMAT_OBSINFO(i, j, str) \
148 char buf[SLHA_MAX_LINE_LENGTH]; \
149 const int i_ = (i); \
150 const int j_ = (j); \
151 const std::string str_ = (str); \
152 std::snprintf(buf, SLHA_MAX_LINE_LENGTH, obsinfo_formatter, i_, j_, \
154 return std::string(buf); \
157#define FORMAT_RANK_THREE_TENSOR(i, j, k, entry, name) \
159 char buf[SLHA_MAX_LINE_LENGTH]; \
160 const int i_ = (i); \
161 const int j_ = (j); \
162 const int k_ = (k); \
163 const double entry_ = (entry); \
164 const std::string name_ = (name); \
165 std::snprintf(buf, SLHA_MAX_LINE_LENGTH, tensor_formatter, i_, j_, k_, \
166 entry_, name_.c_str()); \
167 return std::string(buf); \
170#define FORMAT_WILSON_COEFFICIENTS(f, m, x, y, ph, entry, name) \
172 char buf[SLHA_MAX_LINE_LENGTH]; \
173 const std::string f_ = (f); \
174 const std::string m_ = (m); \
175 const int x_ = (x); \
176 const int y_ = (y); \
177 const int ph_ = (ph); \
178 const double entry_ = (entry); \
179 const std::string name_ = (name); \
180 std::snprintf(buf, SLHA_MAX_LINE_LENGTH, wilson_formatter, f_.c_str(), \
181 m_.c_str(), x_, y_, ph_, entry_, name_.c_str()); \
182 return std::string(buf); \
185#define FORMAT_TOTAL_WIDTH(pdg, width, name) \
187 char buf[SLHA_MAX_LINE_LENGTH]; \
188 const int pdg_ = (pdg); \
189 const double width_ = (width); \
190 const std::string name_ = (name); \
191 std::snprintf(buf, SLHA_MAX_LINE_LENGTH, format_total_width, \
192 pdg_, width_, name_.c_str()); \
193 return std::string(buf); \
196#define FORMAT_EFFECTIVECOUPLINGS(pdg1, pdg2, pdg3, width, comment) \
198 char buf[SLHA_MAX_LINE_LENGTH]; \
199 const int pdg1_ = (pdg1); \
200 const int pdg2_ = (pdg2); \
201 const int pdg3_ = (pdg3); \
202 const double width_ = (width); \
203 const std::string comment_ = (comment); \
204 std::snprintf(buf, SLHA_MAX_LINE_LENGTH, format_effectivecouplings, \
205 pdg1_, pdg2_, pdg3_, width_, comment_.c_str()); \
206 return std::string(buf); \
const char *const mixing_matrix_formatter SLHA line formatter for the mixing matrix entries = NMIX, UMIX, VMIX, ...
const char *const format_total_width SLHA line formatter for the DECAY block.
const char *const number_formatter SLHA number formatter.
const char *const wilson_formatter FLHA line formatter for FWCOEF, IMFCOEF block entries.
const char *const tensor_formatter SLHA line formatter for entries with three indices.
const char *const format_effectivecouplings SLHA line formatter for the EFFECTIVECOUPLINGS block.
const char *const vector_formatter SLHA line formatter for vector entries.
const char *const mass_formatter SLHA line formatter for the MASS block entries.
const char *const spinfo_formatter SLHA line formatter for the SPINFO block entries.
const char *const single_element_formatter SLHA line formatter for the one-element entries = HMIX, GAUGE, MSOFT, ...
const char *const scale_formatter SLHA scale formatter.
const char *const obsinfo_formatter SLHA line formatter for the OBSINFO block entries.
std::string format_decay(double br, const Container &pids, const std::string &name)
|