gambit is hosted by Hepforge, IPPP Durham
GAMBIT  v1.5.0-2191-ga4742ac
a Global And Modular Bsm Inference Tool
ScalarSingletDM_Z3Spec_head.hpp
Go to the documentation of this file.
1 // GAMBIT: Global and Modular BSM Inference Tool
2 // *********************************************
25 
26 #ifndef ScalarSingletDM_Z3SPEC_HEAD_H
27 #define ScalarSingletDM_Z3SPEC_HEAD_H
28 
29 #include "gambit/Elements/spec.hpp"
32 
33 // Flexible SUSY stuff (should not be needed by the rest of gambit)
34 #include "flexiblesusy/config/config.h"
35 
36 namespace Gambit
37 {
38  namespace SpecBit
39  {
40  template <class MI> // "MI" for "Model_interface"
42  }
43 
44  // For example of what kind of class MI needs to be, see
45  // SpecBit/include/model_files_and_boxes.hpp,
46  // MODELNAME_interface class
47 
50  template <class MI>
51  struct SpecTraits<SpecBit::ScalarSingletDM_Z3Spec<MI>>
52  {
53  static std::string name() { return "ScalarSingletDM_Z3Spec"; }
55  typedef typename MI::Model Model;
56  typedef DummyInput Input;
57  };
58 
59  namespace SpecBit
60  {
61  template <class MI>
62  class ScalarSingletDM_Z3Spec : public Spec<ScalarSingletDM_Z3Spec<MI>>
63  {
64  private:
67  static const int _index_offset;
68 
69  public:
73  typedef typename Self::MTget MTget;
74  typedef typename Self::MTset MTset;
75  typedef typename Self::GetterMaps GetterMaps;
76  typedef typename Self::SetterMaps SetterMaps;
77  typedef typename SpecTraits<Self>::Model Model;
78  typedef typename SpecTraits<Self>::Input Input;
79 
81  static int index_offset() {return _index_offset;}
82  virtual double GetScale() const;
83  virtual void SetScale(double scale);
84  virtual void RunToScaleOverride(double scale);
85 
86  //constructors
88  ScalarSingletDM_Z3Spec(MI, str backend_name, str backend_version);
89 
90  //Could more constructors to interface with other generators
91 
92  // These are public for now so that SpecBit_tests.cpp can access them
94 
95  // Dummy placeholder for potential Inputs object
97 
98  //Destructor
99  virtual ~ScalarSingletDM_Z3Spec();
100 
101  // Functions to interface Model and Input objects with the base 'Spec' class
102  Model& get_Model() { return model_interface.model; }
103  Input& get_Input() { return dummyinput; /*unused here, but needs to be defined for the interface*/ }
104  const Model& get_Model() const { return model_interface.model; }
105  const Input& get_Input() const { return dummyinput; /*unused here, but needs to be defined for the interface*/ }
106 
107  //some model independent stuff
108  //may use something like this to pass error to Gambit
109  virtual std::string AccessError(std::string state) const;
110 
111 
112 
113 
114  template<class ScalarSingletDM_Z3like>
115  void get_lowe_data_from(ScalarSingletDM_Z3like &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 
143  } // end SpecBit namespace
144 } // end Gambit namespace
145 
146 #undef MAPS
147 #undef MAPS1
148 #endif
Need to forward declare Spec class.
Definition: spec_head.hpp:39
Register the definitions of SubSpectrum contents here.
Some member function definitions from classes in spec_head.hpp.
void get_lowe_data_from(ScalarSingletDM_Z3like &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
static int index_offset()
Interface function overrides.
void get_external_spectrum(typename MI::Model &othermodel)
TODO: see if we can use this one:
Definition: Analysis.hpp:33
ScalarSingletDM_Z3Spec< MI > Self
These typedefs are inherited, but the name lookup doesn&#39;t work so smoothly in templated wrapper class...