gambit is hosted by Hepforge, IPPP Durham
GAMBIT  v1.5.0-2191-ga4742ac
a Global And Modular Bsm Inference Tool
spectrum.hpp
Go to the documentation of this file.
1 // GAMBIT: Global and Modular BSM Inference Tool
2 // *********************************************
36 
37 #ifndef __Spectrum_hpp__
38 #define __Spectrum_hpp__
39 
40 #include <complex>
41 
48 
49 
51 namespace YAML
52 {
53 
54  typedef std::pair<std::string, std::pair<double, double> > sdd;
55  typedef std::pair<std::pair<std::string,std::string>, std::pair<double, double> > ssdd;
56 
57  template<>
58  struct convert<sdd>
59  {
60  static Node encode(const sdd& rhs)
61  {
62  Node node;
63  node.push_back(rhs.first);
64  node.push_back(rhs.second.first);
65  node.push_back(rhs.second.second);
66  return node;
67  }
68 
69  static bool decode(const Node& node, sdd& rhs)
70  {
71  if(!node.IsSequence() || node.size() != 3) return false;
72  rhs.first = node[0].as<std::string>();
73  rhs.second.first = node[1].as<double>();
74  rhs.second.second = node[2].as<double>();
75  return true;
76  }
77  };
78 
79  template<>
80  struct convert<ssdd>
81  {
82  static Node encode(const ssdd& rhs)
83  {
84  Node node;
85  node.push_back(rhs.first.first);
86  node.push_back(rhs.first.second);
87  node.push_back(rhs.second.first);
88  node.push_back(rhs.second.second);
89  return node;
90  }
91 
92  static bool decode(const Node& node, ssdd& rhs)
93  {
94  if(!node.IsSequence() || node.size() != 4) return false;
95  rhs.first.first = node[0].as<std::string>();
96  rhs.first.second = node[1].as<std::string>();
97  rhs.second.first = node[2].as<double>();
98  rhs.second.second = node[3].as<double>();
99  return true;
100  }
101  };
102 
103 }
104 
105 
106 namespace Gambit
107 {
108 
110  class Spectrum
111  {
113  friend void swap(Spectrum& first, Spectrum& second);
114 
115  public:
116 
119  typedef std::vector<YAML::sdd> mc_info;
120  typedef std::vector<YAML::ssdd> mr_info;
122 
123  private:
124 
127  std::unique_ptr<SubSpectrum> LE_new; // low energy model
128  std::unique_ptr<SubSpectrum> HE_new; // high energy model
132  const std::map<str, safe_ptr<const double> >* input_Param;
133  const mc_info* mass_cuts;
134  const mr_info* mass_ratio_cuts;
137 
139  void check_init() const;
140 
142  static std::complex<double> rhoplusieta(double, double, double, double);
143 
144  public:
145 
149 
151  Spectrum();
153  Spectrum(const SubSpectrum& le, const SubSpectrum& he, const SMInputs& smi, const std::map<str, safe_ptr<const double> >* input_Param, const mc_info&, const mr_info&);
156  Spectrum(SubSpectrum* const le, SubSpectrum* const he, const SMInputs& smi, const std::map<str, safe_ptr<const double> >* input_Param, const mc_info&, const mr_info&);
157 
160  Spectrum(const SubSpectrum& he, const SMInputs& smi, const std::map<str, safe_ptr<const double> >* input_Param, const mc_info&, const mr_info&);
161 
164  Spectrum(const Spectrum& other);
167  Spectrum& operator=(const Spectrum& other);
169  Spectrum(Spectrum&& other);
170 
172 
175  void RunBothToScale(double scale);
176 
178  void check_mass_cuts();
179 
183  SubSpectrum& get_LE();
184  SubSpectrum& get_HE();
185  SMInputs& get_SMInputs();
186  // const versions
187  const SubSpectrum& get_LE() const;
188  const SubSpectrum& get_HE() const;
189  const SMInputs& get_SMInputs() const;
191 
194  std::unique_ptr<SubSpectrum> clone_LE() const;
195  std::unique_ptr<SubSpectrum> clone_HE() const;
197 
202  bool has(const Par::Tags partype, const std::string& mass) const;
203  double get(const Par::Tags partype, const std::string& mass) const;
204  bool has(const Par::Tags partype, const std::string& mass, const int index) const;
205  double get(const Par::Tags partype, const std::string& mass, const int index) const;
206  bool has(const Par::Tags partype, const std::string& mass, const int index1, const int index2) const;
207  double get(const Par::Tags partype, const std::string& mass, const int index1, const int index2) const;
208 
210  bool has(const Par::Tags partype, const int pdg_code, const int context) const;
211  double get(const Par::Tags partype, const int pdg_code, const int context) const;
212  bool has(const Par::Tags partype, const std::pair<int,int> pdgpr) const;
213  double get(const Par::Tags partype, const std::pair<int,int> pdgpr) const;
214  bool has(const Par::Tags partype, const std::pair<str,int> shortpr) const;
215  double get(const Par::Tags partype, const std::pair<str,int> shortpr) const;
217 
219  double safeget(const Par::Tags partype, const std::string& mass) const;
220  double safeget(const Par::Tags partype, const std::string& mass, const int index) const;
221  double safeget(const Par::Tags partype, const int pdg_code, const int context) const;
222  double safeget(const Par::Tags partype, const std::pair<int,int> pdgpr) const;
223  double safeget(const Par::Tags partype, const std::pair<str,int> shortpr) const;
225 
227 
233  SLHAstruct getSLHAea(int) const;
234 
236  void writeSLHAfile(int, const str&) const;
237 
239  void drop_SLHAs_if_requested(const safe_ptr<Options>&, const str&);
240 
242  const std::map<int, int>& PDG_translator() const;
243 
246  static double Wolf2V_ud(double, double, double, double);
247  static double Wolf2V_us(double, double, double, double);
248  static std::complex<double> Wolf2V_ub(double, double, double, double);
249  static std::complex<double> Wolf2V_cd(double, double, double, double);
250  static std::complex<double> Wolf2V_cs(double, double, double, double);
251  static double Wolf2V_cb(double, double, double, double);
252  static std::complex<double> Wolf2V_td(double, double, double, double);
253  static std::complex<double> Wolf2V_ts(double, double, double, double);
254  static double Wolf2V_tb(double, double, double, double);
256  };
257 
258 } // end namespace Gambit
259 
260 
261 #endif
SubSpectrum * LE
Definition: spectrum.hpp:129
const std::map< str, safe_ptr< const double > > * input_Param
Definition: spectrum.hpp:132
const mc_info * mass_cuts
Definition: spectrum.hpp:133
Parameters used to define the Standard Model, in SLHA2 format.
void swap(Spectrum &first, Spectrum &second)
Swap resources of two Spectrum objects Note: Not a member function! This is an external function whic...
Definition: spectrum.cpp:57
std::unique_ptr< SubSpectrum > HE_new
Definition: spectrum.hpp:128
std::pair< std::string, std::pair< double, double > > sdd
Definition: spectrum.hpp:54
Declarations for the YAML options class.
General small utility functions.
std::pair< std::pair< std::string, std::string >, std::pair< double, double > > ssdd
Definition: spectrum.hpp:55
static Node encode(const ssdd &rhs)
Definition: spectrum.hpp:82
SLHAea::Coll SLHAstruct
Less confusing name for SLHAea container class.
static Node encode(const sdd &rhs)
Definition: spectrum.hpp:60
YAML overloads for mass cut and mass cut ratio constituents.
static bool decode(const Node &node, ssdd &rhs)
Definition: spectrum.hpp:92
std::string str
Shorthand for a standard string.
Definition: Analysis.hpp:35
Abstract class for accessing general spectrum information.
Virtual base class for interacting with spectrum generator output.
Definition: subspectrum.hpp:87
SMInputs SMINPUTS
Definition: spectrum.hpp:131
static bool decode(const Node &node, sdd &rhs)
Definition: spectrum.hpp:69
SLHAea helper functions using spectrum objects.
Class definitions for GAMBIT particle database.
std::vector< YAML::sdd > mc_info
Typedefs for making it easier to manipulate mass cut and mass ratio cut info.
Definition: spectrum.hpp:119
SubSpectrum * HE
Definition: spectrum.hpp:130
std::vector< YAML::ssdd > mr_info
Definition: spectrum.hpp:120
TODO: see if we can use this one:
Definition: Analysis.hpp:33
const mr_info * mass_ratio_cuts
Definition: spectrum.hpp:134
"Standard Model" (low-energy) plus high-energy model container class
Definition: spectrum.hpp:110
std::unique_ptr< SubSpectrum > LE_new
Variables.
Definition: spectrum.hpp:127
Container class for Standard Model input information (defined as in SLHA2)
Definition: sminputs.hpp:29