gambit is hosted by Hepforge, IPPP Durham
GAMBIT  v1.5.0-252-gf9a3f78
a Global And Modular Bsm Inference Tool
spectrum_factories.hpp
Go to the documentation of this file.
1 // GAMBIT: Global and Modular BSM Inference Tool
2 // *********************************************
15 
16 #include <sstream>
17 
22 
23 namespace Gambit
24 {
26  template <typename HE, typename HEmod>
27  Spectrum spectrum_from_SLHAea(HEmod hemod, SLHAstruct slhaea, const Spectrum::mc_info& mci, const Spectrum::mr_info& mri)
28  {
29  // Start by stripping out any DECAY and DCINFO blocks, as we're only
30  // interested in holding spectrum information internally in the
31  // spectrum object, not decay info.
32  SLHAstruct::key_matches is_dcinfo("DCINFO");
33  for (SLHAstruct::iterator block = slhaea.begin(); block != slhaea.end();)
34  {
35  bool delete_block = false;
36  if (is_dcinfo(*block)) delete_block = true;
37  else
38  {
39  auto block_def = block->find_block_def();
40  if (block_def != block->end())
41  {
42  if (block_def->at(0) == "DECAY") delete_block = true;
43  }
44  }
45  if (delete_block) slhaea.erase(block);
46  else ++block;
47  }
48 
49  // Create HE simple SubSpectrum object from the SLHAea object
50  // (interacts with MSSM blocks in MSSM case)
51  HE he(hemod);
52 
53  // Create SMInputs object from the SLHAea object
54  SMInputs sminputs(slhaea);
55 
56  // Create SMSimpleSpec SubSpectrum object from the SLHAea object
57  // (basically just interacts with SMINPUTS block)
58  SMSimpleSpec sm(slhaea);
59 
60  // Create full Spectrum object from components above
61  // Note subtlety! There are TWO constructors for the Spectrum object:
62  // If pointers to SubSpectrum objects are passed, it is assumed that
63  // these objects are managed EXTERNALLY! So if we were to do this:
64  // matched_spectra = Spectrum(&smskel,&mssmskel,sminputs);
65  // then the SubSpectrum objects would end up DELETED at the end of
66  // this scope, and we will get a segfault if we try to access them
67  // later. INSTEAD, we should just pass the objects themselves, and
68  // then they will be CLONED and the Spectrum object will take
69  // possession of them:
70  return Spectrum(sm,he,sminputs,NULL,mci,mri);
71  }
72 
74  template <typename HE>
76  {
77  // Read the SLHA file in to an SLHAea object
78  SLHAstruct slhaea = read_SLHA(slha);
79  // Create the final object from the SLHAea object
80  return spectrum_from_SLHAea<HE, SLHAstruct>(slhaea, slhaea, mci, mri);
81  }
82 }
This class is used to deliver both information defined in the Standard Model (or potentially just QED...
A simple SubSpectrum wrapper for the scalar singlet dark matter model.
Spectrum spectrum_from_SLHA(str slha, const Spectrum::mc_info &mci, const Spectrum::mr_info &mri)
Create a simple spectrum object from an SLHA file.
SLHAstruct read_SLHA(str slha)
Read an SLHA file in to an SLHAea object with some error-checking.
Parameters used to define the Standard Model, in SLHA2 format.
SLHAea::Coll SLHAstruct
Less confusing name for SLHAea container class.
Spectrum spectrum_from_SLHAea(HEmod hemod, SLHAstruct slhaea, const Spectrum::mc_info &mci, const Spectrum::mr_info &mri)
Create a simple spectrum object from an SLHAea object.
SM specialisation of SLHAea object wrapper version of SubSpectrum class.
Spectrum Spectrum
std::string str
Shorthand for a standard string.
Definition: Analysis.hpp:35
std::vector< YAML::sdd > mc_info
Typedefs for making it easier to manipulate mass cut and mass ratio cut info.
Definition: spectrum.hpp:119
std::vector< YAML::ssdd > mr_info
Definition: spectrum.hpp:120
TODO: see if we can use this one:
Definition: Analysis.hpp:33
"Standard Model" (low-energy) plus high-energy model container class
Definition: spectrum.hpp:110
Container class for Standard Model input information (defined as in SLHA2)
Definition: sminputs.hpp:29