gambit is hosted by Hepforge, IPPP Durham
GAMBIT  v1.5.0-2191-ga4742ac
a Global And Modular Bsm Inference Tool
decay_table.cpp
Go to the documentation of this file.
1 // GAMBIT: Global and Modular BSM Inference Tool
2 // *********************************************
16 
17 #include <fstream>
18 
22 #include "gambit/Utils/version.hpp"
24 
25 #include <boost/lexical_cast.hpp>
26 #include <boost/assign.hpp>
27 
28 namespace Gambit
29 {
30 
31  // Local helper functions
32 
33  void get_calculator_info(const SLHAstruct& slha, str& calculator, str& calculator_version)
34  {
35  auto dcinfo = slha.find("DCINFO");
36  if (dcinfo != slha.end())
37  {
38  if (dcinfo->size() > 1)
39  {
40  for (unsigned int i = 1; i < dcinfo->at(1).size(); ++i)
41  {
42  str s(dcinfo->at(1).at(i));
43  if (s[0] != '#') calculator += s;
44  }
45  }
46  if (dcinfo->size() > 2)
47  {
48  for (unsigned int i = 1; i < dcinfo->at(2).size(); ++i)
49  {
50  str s(dcinfo->at(2).at(i));
51  if (s[0] != '#') calculator_version += s;
52  }
53  }
54  }
55  }
56 
57 
58  // DecayTable methods
59 
61  DecayTable::DecayTable(str slha, int context, bool force_SM_fermion_gauge_eigenstates)
62  : DecayTable(read_SLHA(slha), context, force_SM_fermion_gauge_eigenstates)
63  {}
64 
66  DecayTable::DecayTable(str slha, const std::map<int, int>& PDG_map, int context, bool force_SM_fermion_gauge_eigenstates)
67  : DecayTable(read_SLHA(slha), PDG_map, context, force_SM_fermion_gauge_eigenstates)
68  {}
69 
71  DecayTable::DecayTable(const SLHAstruct& slha, int context, bool force_SM_fermion_gauge_eigenstates)
72  {
73  // Extract the calculator info if it exists
74  str calculator, calculator_version;
75  get_calculator_info(slha, calculator, calculator_version);
76 
77  // Iterate over all blocks in the file, ignoring everything except DECAY blocks
78  for (auto block = slha.begin(); block != slha.end(); ++block)
79  {
80  auto block_def = block->find_block_def();
81  if (block_def != block->end())
82  {
83  if(block_def->at(0) == "DECAY")
84  {
85  // Make sure the block definition has the particle's width and PDG code
86  if (block_def->size() < 3) utils_error().raise(LOCAL_INFO,
87  "SLHAea object has DECAY block with < 3 entries in its block definition.");
88  int pdg = SLHAea::to<int>(block_def->at(1));
89  // Add an entry containing the info in this block
90  int local_context = context;
91  if (force_SM_fermion_gauge_eigenstates)
92  {
93  int abspdg = std::abs(pdg);
94  // Select SM fermions, including 4th gen, and force gauge eigenstates (context = 1).
95  if (abspdg < 19 and abspdg != 9 and abspdg != 10) local_context = 1;
96  }
97  operator()(std::pair<int,int>(pdg,local_context)) = Entry(*block, block_def, context,
98  force_SM_fermion_gauge_eigenstates, calculator, calculator_version);
99  }
100  }
101  }
102  }
103 
105  DecayTable::DecayTable(const SLHAstruct& slha_in, const std::map<int, int>& PDG_map, int context, bool force_SM_fermion_gauge_eigenstates)
106  {
107  // Make a local copy so we can mess with it
108  SLHAstruct slha(slha_in);
109 
110  // Extract the calculator info if it exists
111  str calculator, calculator_version;
112  get_calculator_info(slha, calculator, calculator_version);
113 
114  // Iterate over all blocks in the file, ignoring everything except DECAY blocks
115  for (auto block = slha.begin(); block != slha.end(); ++block)
116  {
117  auto block_def = block->find_block_def();
118  if (block_def != block->end())
119  {
120  if(block_def->at(0) == "DECAY")
121  {
122  // Make sure the block definition has the particle's width and PDG code
123  if (block_def->size() < 3) utils_error().raise(LOCAL_INFO, "SLHAea object has DECAY block with < 3 entries in its block definition.");
124  int pdg = SLHAea::to<int>(block_def->at(1));
125  if (PDG_map.find(pdg) != PDG_map.end())
126  {
127  pdg = PDG_map.at(pdg);
128  (*block_def)[1] = boost::lexical_cast<str>(pdg);
129  }
130  // Step through the block and convert any final state PDG codes that need to be remapped
131  for (auto line = block->begin() + 1; line != block->end(); ++line)
132  {
133  if (not line->is_comment_line())
134  {
135  for (int i = 2; i < 2 + SLHAea::to<int>(line->at(1)); i++)
136  {
137  int local_pdg = SLHAea::to<int>(line->at(i));
138  if (PDG_map.find(local_pdg) != PDG_map.end()) (*line)[i] = boost::lexical_cast<str>(PDG_map.at(local_pdg));
139  }
140  }
141  }
142  // Add an entry containing the info in this block
143  operator()(std::pair<int,int>(pdg,context)) = Entry(*block, block_def, context,
144  force_SM_fermion_gauge_eigenstates, calculator, calculator_version);
145  }
146  }
147  }
148  }
149 
151  void DecayTable::writeSLHAfile(int SLHA_version, const str& filename, bool include_zero_bfs, const mass_es_pseudonyms& psn) const
152  {
153  Utils::FileLock mylock(filename);
154  mylock.get_lock();
155  std::ofstream ofs(filename);
156  ofs << getSLHAea(SLHA_version, include_zero_bfs, psn);
157  ofs.close();
158  mylock.release_lock();
159  }
160 
162  SLHAstruct DecayTable::getSLHAea(int SLHA_version, bool include_zero_bfs, const mass_es_pseudonyms& psn) const
163  {
164  SLHAstruct slha;
165  std::map<str, std::set<str> > calculator_map;
166  str calculators = "GAMBIT, using: ";
167  str versions = gambit_version() + ": ";
168 
169  // Add the decay info
170  for (auto particle = particles.begin(); particle != particles.end(); ++particle)
171  {
172  auto entry = particle->second;
173  if (entry.calculator != "") calculator_map[entry.calculator].insert(entry.calculator_version);
174  slha.push_back(entry.getSLHAea_block(SLHA_version, particle->first, include_zero_bfs, psn));
175  }
176 
177  // Construct the calculator info
178  for (auto be = calculator_map.begin(); be != calculator_map.end(); ++be)
179  {
180  if (be != calculator_map.begin())
181  {
182  calculators += " | ";
183  versions += " | ";
184  }
185  calculators += be->first;
186  for (auto ver = be->second.begin(); ver != be->second.end(); ++ver)
187  {
188  if (*ver != "")
189  {
190  if (ver != be->second.begin()) versions += ", ";
191  versions += *ver;
192  }
193  }
194  }
195 
196  // Add the calculator info
197  SLHAea::Block DCblock("DCINFO");
198  DCblock.push_back("BLOCK DCINFO # Decay Program information");
199  SLHAea::Line line1, line2;
200  line1 << 1 << calculators << "# Decay calculators";
201  line2 << 2 << versions << "# Version numbers";
202  DCblock.push_back(line1);
203  DCblock.push_back(line2);
204  slha.push_front(DCblock);
205 
206  // Add a disclaimer about the absence of a MODSEL block
207  slhahelp::add_MODSEL_disclaimer(slha, "DecayTable");
208 
209  return slha;
210  }
211 
214  SLHAea::Block DecayTable::getSLHAea_block(int v, std::pair<int,int> p, bool z, const mass_es_pseudonyms& psn) const
215  { return particles.at(p).getSLHAea_block(v, Models::ParticleDB().long_name(p), z, psn); }
216  SLHAea::Block DecayTable::getSLHAea_block(int v, str p, bool z, const mass_es_pseudonyms& psn) const
217  { return particles.at(Models::ParticleDB().pdg_pair(p)).getSLHAea_block(v, p, z, psn); }
218  SLHAea::Block DecayTable::getSLHAea_block(int v, str p, int i, bool z, const mass_es_pseudonyms& psn) const
219  { return particles.at(Models::ParticleDB().pdg_pair(p,i)).getSLHAea_block(v, Models::ParticleDB().long_name(p,i), z, psn); }
221 
222 
223  // DecayTable::Entry subclass methods
224 
226  DecayTable::Entry::Entry(const SLHAea::Block& block, int context,
227  bool force_SM_fermion_gauge_eigenstates, str calc, str calc_ver) :
228  positive_error(0.0),
229  negative_error(0.0),
230  calculator(calc),
231  calculator_version(calc_ver),
232  warnings(""),
233  errors("")
234  {
235  auto block_def = block.find_block_def();
236  if (block_def->at(0) != "DECAY" or block_def->size() < 3)
237  utils_error().raise(LOCAL_INFO, "SLHAea block is not DECAY or has < 3 entries in its block definition.");
238  width_in_GeV = SLHAea::to<double>(block_def->at(2));
239  init(block, context, force_SM_fermion_gauge_eigenstates);
240  }
241 
244  DecayTable::Entry::Entry(const SLHAea::Block& block, SLHAea::Block::const_iterator block_def,
245  int context, bool force_SM_fermion_gauge_eigenstates, str calc, str calc_ver) :
246  width_in_GeV (SLHAea::to<double>(block_def->at(2))),
247  positive_error(0.0),
248  negative_error(0.0),
249  calculator(calc),
250  calculator_version(calc_ver),
251  warnings(""),
252  errors("")
253  {
254  init(block, context, force_SM_fermion_gauge_eigenstates);
255  }
256 
258  void DecayTable::Entry::init(const SLHAea::Block& block, int context, bool force_SM_fermion_gauge_eigenstates)
259  {
260  for (auto channel = block.begin(); channel != block.end(); ++channel)
261  {
262  str first_entry(channel->at(0));
263  if (first_entry != "DECAY" and first_entry[0] != '#')
264  {
265  if (channel->size() < 4) utils_error().raise(LOCAL_INFO, "SLHAea DECAY block line has < 4 entries!");
266  double BF = SLHAea::to<double>(first_entry);
267  int n_daughters = SLHAea::to<int>(channel->at(1));
268  std::vector<std::pair<int,int> > daughter_pdg_codes;
269  for (int i = 2; i < n_daughters+2; ++i)
270  {
271  int pdg = SLHAea::to<int>(channel->at(i));
272  int context_local = context;
273  if (force_SM_fermion_gauge_eigenstates)
274  {
275  int abspdg = std::abs(pdg);
276  // Select SM fermions, including 4th gen, and force gauge eigenstates (context = 1).
277  if (abspdg < 19 and abspdg != 9 and abspdg != 10) context_local = 1;
278  }
279  std::pair<int,int> pdg_pair(pdg, context_local);
280  daughter_pdg_codes.push_back(pdg_pair);
281  }
282  set_BF(BF, 0.0, daughter_pdg_codes);
283  }
284  }
285  }
286 
288  void DecayTable::Entry::check_particles_exist(std::multiset< std::pair<int,int> >& particles) const
289  {
290  for (auto final_state = particles.begin(); final_state != particles.end(); ++final_state)
291  {
292  if (not Models::ParticleDB().has_particle(*final_state))
293  {
294  std::ostringstream err;
295  err << "Particle with PDG code" << final_state->first << " and context integer " << endl
296  << final_state->second << " is not in the in GAMBIT particle database." << endl
297  << "Please add such a particle to Models/src/particle_database.cpp and recompile.";
298  model_error().raise(LOCAL_INFO,err.str());
299  }
300  }
301  }
302 
304  void DecayTable::Entry::check_BF_validity(double BF, double error, std::multiset< std::pair<int,int> >& key) const
305  {
306  if (Utils::isnan(BF) or Utils::isnan(error))
307  {
308  std::ostringstream msg;
309  msg << "NaN detected in attempt to set decay table branching fraction. " << endl
310  << "Final states are: " << endl;
311  for(auto it = key.begin(); it !=key.end(); ++it)
312  {
313  msg << " " << Models::ParticleDB().long_name(*it) << endl;
314  }
315  msg << "BF: " << BF << endl << "error: " << error << endl;
316  msg << "Total width (GeV): " << width_in_GeV << " +" << positive_error << " -" << negative_error << endl;
317  msg << "Decay calculator: " << calculator << " " << calculator_version;
318  utils_error().raise(LOCAL_INFO, msg.str());
319  }
320  }
321 
323  void DecayTable::Entry::set_BF(double BF, double error, const std::vector<std::pair<int,int> >& daughters)
324  {
325  std::multiset< std::pair<int,int> > key(daughters.begin(), daughters.end());
327  check_BF_validity(BF, error, key);
328  channels[key] = std::pair<double, double>(BF, error);
329  }
330 
332  void DecayTable::Entry::set_BF(double BF, double error, const std::vector<str>& daughters)
333  {
334  std::multiset< std::pair<int,int> > key;
335  for (auto p = daughters.begin(); p != daughters.end(); ++p) key.insert(Models::ParticleDB().pdg_pair(*p));
337  check_BF_validity(BF, error, key);
338  channels[key] = std::pair<double, double>(BF, error);
339  }
340 
342  bool DecayTable::Entry::has_channel(const std::vector<std::pair<int,int> >& daughters) const
343  {
344  std::multiset< std::pair<int,int> > key(daughters.begin(), daughters.end());
346  return channels.find(key) != channels.end();
347  }
348 
350  bool DecayTable::Entry::has_channel(const std::vector<str>& daughters) const
351  {
352  std::multiset< std::pair<int,int> > key;
353  for (auto p = daughters.begin(); p != daughters.end(); ++p) key.insert(Models::ParticleDB().pdg_pair(*p));
355  return channels.find(key) != channels.end();
356  }
357 
359  double DecayTable::Entry::BF(const std::vector<std::pair<int, int> >& daughters) const
360  {
361  std::multiset< std::pair<int,int> > key(daughters.begin(), daughters.end());
363  return channels.at(key).first;
364  }
365 
367  double DecayTable::Entry::BF(const std::vector<str>& daughters) const
368  {
369  std::multiset< std::pair<int,int> > key;
370  for (auto p = daughters.begin(); p != daughters.end(); ++p) key.insert(Models::ParticleDB().pdg_pair(*p));
372  return channels.at(key).first;
373  }
374 
375 
378  SLHAea::Block DecayTable::Entry::getSLHAea_block(int v, str p, bool z, const mass_es_pseudonyms& psn) const
379  { return getSLHAea_block(v, Models::ParticleDB().pdg_pair(p), z, psn); }
380  SLHAea::Block DecayTable::Entry::getSLHAea_block(int v, str p, int i, bool z, const mass_es_pseudonyms& psn) const
381  { return getSLHAea_block(v, Models::ParticleDB().pdg_pair(p,i), z, psn); }
382  SLHAea::Block DecayTable::Entry::getSLHAea_block(int v, std::pair<int,int> p, bool include_zero_bfs, const mass_es_pseudonyms& psn) const
383  {
384  const std::map<str, int> slha1_pdgs = boost::assign::map_list_of
385  ("~t_1" , 1000006)
386  ("~t_2" , 2000006)
387  ("~b_1" , 1000005)
388  ("~b_2" , 2000005)
389  ("~tau_1" , 1000015)
390  ("~tau_2" , 2000015)
391  ("~nu_e_L" , 1000012)
392  ("~nu_mu_L" , 1000014)
393  ("~nu_tau_L", 1000016)
394  ("~d_L" , 1000001)
395  ("~s_L" , 1000003)
396  ("~d_R" , 2000001)
397  ("~s_R" , 2000003)
398  ("~e_L" , 1000011)
399  ("~mu_L" , 1000013)
400  ("~e_R" , 2000011)
401  ("~mu_R" , 2000013)
402  ("~u_L" , 1000002)
403  ("~c_L" , 1000004)
404  ("~u_R" , 2000002)
405  ("~c_R" , 2000004)
406  ("~tbar_1" , -1000006)
407  ("~tbar_2" , -2000006)
408  ("~bbar_1" , -1000005)
409  ("~bbar_2" , -2000005)
410  ("~taubar_1" , -1000015)
411  ("~taubar_2" , -2000015)
412  ("~nu_ebar_L" , -1000012)
413  ("~nu_mubar_L" , -1000014)
414  ("~nu_taubar_L", -1000016)
415  ("~dbar_L" , -1000001)
416  ("~sbar_L" , -1000003)
417  ("~dbar_R" , -2000001)
418  ("~sbar_R" , -2000003)
419  ("~ebar_L" , -1000011)
420  ("~mubar_L" , -1000013)
421  ("~ebar_R" , -2000011)
422  ("~mubar_R" , -2000013)
423  ("~ubar_L" , -1000002)
424  ("~cbar_L" , -1000004)
425  ("~ubar_R" , -2000002)
426  ("~cbar_R" , -2000004);
427 
428  // Make sure the particle actually exists in the database
429  if (not Models::ParticleDB().has_particle(p))
430  {
431  std::stringstream ss;
432  ss << "GAMBIT particle database does not have particle with (PDG,context) codes (" << p.first << "," << p.second << ").";
433  utils_error().raise(LOCAL_INFO, ss.str());
434  }
435 
436  // Add the info about the decay in general
437  int pdg = p.first;
438  str long_name = Models::ParticleDB().long_name(p);
439  SLHAea::Line line;
440  if (v == 1)
441  {
442  if (not psn.filled) utils_error().raise(LOCAL_INFO, "Non-empty mass_es_pseudonyms must be provided for SLHA1 DecayTable output.");
443  if (psn.gauge_family_eigenstates.find(long_name) != psn.gauge_family_eigenstates.end())
444  {
445  long_name = psn.gauge_family_eigenstates.at(long_name);
446 
447  pdg = slha1_pdgs.at(long_name);
448  }
449  }
450  else if (v != 2) utils_error().raise(LOCAL_INFO, "Unrecognised SLHA version requested. Expected 1 or 2.");
451  line << "DECAY" << pdg << this->width_in_GeV << "# " + long_name + " decays";
452  SLHAea::Block block(std::to_string(p.first));
453  block.push_back(line);
454  block.insert(block.begin(),SLHAea::Line("# PDG Width (GeV)"));
455  block.push_back("# BF NDA Daughter PDG codes");
456 
457  // Add the branching fraction and daughter particle PDG codes for each decay channel
458  for (auto channel = channels.begin(); channel != channels.end(); ++channel)
459  {
460  // Skip this channel if its BF is NaN (undefined) or zero (on request)
461  double BF = (channel->second).first;
462  if (not Utils::isnan(BF))
463  {
464  if (BF > 0.0 or include_zero_bfs)
465  {
466  auto daughters = channel->first;
467  str comment = "# BF(" + long_name + " --> ";
468  line.clear();
469  // Get the branching fraction and number of particles in the final state
470  line << BF << daughters.size();
471  // Get the PDG code for each daughter particle
472  for (auto daughter = daughters.begin(); daughter != daughters.end(); ++daughter)
473  {
474  int daughter_pdg = daughter->first;
475  str daughter_long_name = Models::ParticleDB().long_name(*daughter);
476  if (v == 1)
477  {
478  if (psn.gauge_family_eigenstates.find(daughter_long_name) != psn.gauge_family_eigenstates.end())
479  {
480  daughter_long_name = psn.gauge_family_eigenstates.at(daughter_long_name);
481  daughter_pdg = slha1_pdgs.at(daughter_long_name);
482  }
483  }
484  line << daughter_pdg;
485  comment += daughter_long_name + " ";
486  }
487  comment[comment.size()-1] = ')';
488  line << comment;
489  block.push_back(line);
490  }
491  }
492  }
493 
494  return block;
495 
496  }
498 
502  DecayTable::Entry& DecayTable::operator()(std::pair<int,int> p) { return particles[p]; }
505  const DecayTable::Entry& DecayTable::operator()(std::pair<int,int> p) const { return particles.at(p); }
506  const DecayTable::Entry& DecayTable::operator()(str p) const { return particles.at(Models::ParticleDB().pdg_pair(p)); }
507  const DecayTable::Entry& DecayTable::operator()(str p, int i) const { return particles.at(Models::ParticleDB().pdg_pair(p,i)); }
509 
513  DecayTable::Entry& DecayTable::at(std::pair<int,int> p) { return particles.at(p); }
515  DecayTable::Entry& DecayTable::at(str p, int i) { return particles.at(Models::ParticleDB().pdg_pair(p,i)); }
516  const DecayTable::Entry& DecayTable::at(std::pair<int,int> p) const { return particles.at(p); }
517  const DecayTable::Entry& DecayTable::at(str p) const { return particles.at(Models::ParticleDB().pdg_pair(p)); }
518  const DecayTable::Entry& DecayTable::at(str p, int i) const { return particles.at(Models::ParticleDB().pdg_pair(p,i)); }
520 
521 
524  {
525  double sum = 0.0;
526  for (auto channel = channels.begin(); channel != channels.end(); ++channel)
527  {
528  sum += (channel->second).first;
529  }
530  return sum;
531  }
532 
533 }
534 
DecayTable::Entry DecayTable::Entry DecayTable::Entry DecayTable::Entry DecayTable::Entry DecayTable::Entry DecayTable::Entry DecayTable::Entry DecayTable::Entry DecayTable::Entry DecayTable::Entry DecayTable::Entry DecayTable::Entry DecayTable::Entry DecayTable::Entry DecayTable::Entry DecayTable::Entry DecayTable::Entry DecayTable::Entry DecayTable::Entry DecayTable::Entry DecayTable::Entry DecayTable::Entry DecayTable::Entry DecayTable::Entry DecayTable::Entry DecayTable::Entry DecayTable::Entry DecayTable::Entry DecayTable::Entry DecayTable::Entry DecayTable::Entry DecayTable::Entry DecayTable::Entry DecayTable::Entry DecayTable::Entry DecayTable::Entry DecayTable::Entry DecayTable::Entry DecayTable::Entry DecayTable::Entry DecayTable::Entry DecayTable::Entry DecayTable::Entry DecayTable::Entry DecayTable::Entry DecayTable::Entry DecayTable::Entry DecayTable::Entry DecayTable::Entry DecayTable::Entry DecayTable::Entry DecayTable::Entry DecayTable::Entry DecayTable::Entry DecayTable::Entry DecayTable::Entry double
DecayTable entry class. Holds the info on all decays of a given particle.
Definition: decay_table.hpp:96
double BF(const std::vector< std::pair< int, int > > &) const
Retrieve branching fraction for decay to a given final state.
SLHAea::Block getSLHAea_block(int, std::pair< int, int >, bool include_zero_bfs=false, const mass_es_pseudonyms &psn=mass_es_pseudonyms()) const
Output a decay table entry as an SLHAea DECAY block, using input parameter to identify the entry...
EXPORT_SYMBOLS error & utils_error()
Utility errors.
double positive_error
Positive error on width.
void add_MODSEL_disclaimer(SLHAstruct &slha, const str &object)
Add a disclaimer about the absence of a MODSEL block in a generated SLHAea object.
Entry & at(std::pair< int, int >)
Get entry in decay table for a give particle, throwing an error if particle is absent.
DecayTable()
ConstructorsDefault constructor.
Definition: decay_table.hpp:45
double sum_BF() const
Sum up the partial widths and return the result.
Decay table class declarations.
void writeSLHAfile(int SLHA_version, const str &filename, bool include_zero_bfs=false, const mass_es_pseudonyms &psn=mass_es_pseudonyms()) const
Output entire decay table as an SLHA file full of DECAY blocks.
#define LOCAL_INFO
Definition: local_info.hpp:34
GAMBIT file locking functions Use these to block access to sensitive parts of the code by other proce...
Entry & operator()(std::pair< int, int >)
Get entry in decay table for a given particle, adding the particle to the table if it is absent...
str long_name(str, int) const
Retrieve the long name, from the short name and index.
Definition: partmap.cpp:124
SMslha_SLHAstruct SLHAstruct read_SLHA(str slha)
Read an SLHA file in to an SLHAea object with some error-checking.
void init(const SLHAea::Block &, int, bool force_SM_fermion_gauge_eigenstates=false)
Initialise a DecayTable Entry using an SLHAea DECAY block.
std::map< std::pair< int, int >, Entry > particles
The actual underlying map. Just iterate over this directly if you need to iterate over all particles ...
Definition: decay_table.hpp:92
SLHAea::Block getSLHAea_block(int, str, bool include_zero_bfs=false, const mass_es_pseudonyms &psn=mass_es_pseudonyms()) const
Output this entry as an SLHAea DECAY block, using input parameter to identify the mother particle...
Routines to help translate between SLHA2 sfermions and SLHA1 (or similar) sfermions.
General small utility functions.
std::pair< int, int > pdg_pair(str) const
Retrieve the PDG code and context integer, from the long name.
Definition: partmap.cpp:95
SLHAea::Coll SLHAstruct
Less confusing name for SLHAea container class.
GAMBIT error class.
Definition: exceptions.hpp:136
void get_calculator_info(const SLHAstruct &slha, str &calculator, str &calculator_version)
Definition: decay_table.cpp:33
bool has_particle(str) const
Check if a particle is in the database, using the long name.
Definition: partmap.cpp:205
void check_particles_exist(std::multiset< std::pair< int, int > > &) const
Make sure all particles listed in a set are actually known to the GAMBIT particle database...
double width_in_GeV
Total particle width (in GeV)
str calculator_version
Version of the code used for calculating this entry.
bool has_channel(const std::vector< std::pair< int, int > > &) const
Check if a given final state exists in this DecayTable::Entry.
partmap & ParticleDB()
Database accessor function.
Definition: partmap.cpp:36
str calculator
Name of the code (backend or otherwise) used for calculating this entry.
str & gambit_version()
Statically construct a string containing the full GAMBIT version information and return a reference t...
Definition: version.cpp:32
std::string str
Shorthand for a standard string.
Definition: Analysis.hpp:35
str errors
Errors from the calculator.
double negative_error
Negative error on width.
str warnings
Warnings from the calculator.
GAMBIT native decay table class.
Definition: decay_table.hpp:35
std::map< std::multiset< std::pair< int, int > >, std::pair< double, double > > channels
The actual underlying map of channels to their BFs.
void check_BF_validity(double, double, std::multiset< std::pair< int, int > > &) const
Make sure no NaNs have been passed to the DecayTable by nefarious backends.
SLHAstruct getSLHAea(int SLHA_version, bool include_zero_bfs=false, const mass_es_pseudonyms &psn=mass_es_pseudonyms()) const
Output entire decay table as an SLHAea file full of DECAY blocks.
error & model_error()
Model errors.
Version numbering.
TODO: see if we can use this one:
Definition: Analysis.hpp:33
void set_BF(double, double, const std::vector< std::pair< int, int > > &)
Set branching fraction for decay to a given final state.
Entry()
Default constructor.