gambit is hosted by Hepforge, IPPP Durham
GAMBIT  v1.5.0-2191-ga4742ac
a Global And Modular Bsm Inference Tool
ScalarSingletDM_Z2Spec_head.hpp
Go to the documentation of this file.
1 // GAMBIT: Global and Modular BSM Inference Tool
2 // *********************************************
27 
28 #ifndef ScalarSingletDM_Z2SPEC_HEAD_H
29 #define ScalarSingletDM_Z2SPEC_HEAD_H
30 
31 #include "gambit/Elements/spec.hpp"
34 
35 // Flexible SUSY stuff (should not be needed by the rest of gambit)
36 #include "flexiblesusy/config/config.h"
37 
38 namespace Gambit
39 {
40  namespace SpecBit
41  {
42  template <class MI> // "MI" for "Model_interface"
44  }
45 
46  // For example of what kind of class MI needs to be, see
47  // SpecBit/include/model_files_and_boxes.hpp,
48  // MODELNAME_interface class
49 
52  template <class MI>
53  struct SpecTraits<SpecBit::ScalarSingletDM_Z2Spec<MI>>
54  {
55  static std::string name() { return "ScalarSingletDM_Z2Spec"; }
57  typedef typename MI::Model Model;
58  typedef DummyInput Input;
59  };
60 
61  namespace SpecBit
62  {
63  template <class MI>
64  class ScalarSingletDM_Z2Spec : public Spec<ScalarSingletDM_Z2Spec<MI>>
65  {
66  private:
69  static const int _index_offset;
70 
71  public:
75  typedef typename Self::MTget MTget;
76  typedef typename Self::MTset MTset;
77  typedef typename Self::GetterMaps GetterMaps;
78  typedef typename Self::SetterMaps SetterMaps;
79  typedef typename SpecTraits<Self>::Model Model;
80  typedef typename SpecTraits<Self>::Input Input;
81 
83  static int index_offset() {return _index_offset;}
84  virtual double GetScale() const;
85  virtual void SetScale(double scale);
86  virtual void RunToScaleOverride(double scale);
87 
88  //constructors
90  ScalarSingletDM_Z2Spec(MI, str backend_name, str backend_version);
91 
92  //Could more constructors to interface with other generators
93 
94  // These are public for now so that SpecBit_tests.cpp can access them
96 
97  // Dummy placeholder for potential Inputs object
99 
100  //Destructor
101  virtual ~ScalarSingletDM_Z2Spec();
102 
103  // Functions to interface Model and Input objects with the base 'Spec' class
104  Model& get_Model() { return model_interface.model; }
105  Input& get_Input() { return dummyinput; /*unused here, but needs to be defined for the interface*/ }
106  const Model& get_Model() const { return model_interface.model; }
107  const Input& get_Input() const { return dummyinput; /*unused here, but needs to be defined for the interface*/ }
108 
109 
110 
111  virtual std::string AccessError(std::string state) const;
112 
113 
114  template<class ScalarSingletDM_Z2like>
115  void get_lowe_data_from(ScalarSingletDM_Z2like &othermodel)
116  {
117 
118  typename MI::Model& model = model_interface.model;
119 
120  model.set_scale( othermodel.get_scale() );
121  model.set_Yu( othermodel.get_Yu() );
122 
123 
124  return;
125  }
126 
127  // Overload of this function to just easily copy the othermodel object
128  // if it is of type Model
129  void get_external_spectrum(typename MI::Model& othermodel)
130  {
131  model_interface.model = othermodel;
132  return;
133  }
134 
136  static GetterMaps fill_getter_maps();
137  static SetterMaps fill_setter_maps();
138 
139  };
140 
141 
142  } // end SpecBit namespace
143 } // end Gambit namespace
144 
145 #undef MAPS
146 #undef MAPS1
147 #endif
Need to forward declare Spec class.
Definition: spec_head.hpp:39
ScalarSingletDM_Z2Spec< MI > Self
These typedefs are inherited, but the name lookup doesn&#39;t work so smoothly in templated wrapper class...
Register the definitions of SubSpectrum contents here.
void get_external_spectrum(typename MI::Model &othermodel)
Some member function definitions from classes in spec_head.hpp.
void get_lowe_data_from(ScalarSingletDM_Z2like &othermodel)
General small utility functions.
std::string str
Shorthand for a standard string.
Definition: Analysis.hpp:35
Forward declare base traits class which communicates Model and Input typedefs from the wrapper class ...
Definition: spec_head.hpp:59
TODO: see if we can use this one:
Definition: Analysis.hpp:33
static int index_offset()
Interface function overrides.