a Code for the Combination of Indirect and Direct Constraints on High Energy Physics Models Logo
Model.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2012 HEPfit Collaboration
3  *
4  *
5  * For the licensing terms see doc/COPYING.
6  */
7 
8 #ifndef MODEL_H
9 #define MODEL_H
10 
11 #include <map>
12 #include <functional>
13 #include <string>
14 #include <vector>
15 
26 class Model {
27 public:
28 
33  {
34  ModelInitialized = false;
35  flagSUSYmodel = false;
36  flagLinearized = false;
37  };
38 
42  virtual ~Model()
43  {
44  };
45 
50  void setModelName(const std::string name)
51  {
52  this->name = name;
53  }
54 
59  std::string getModelName() const
60  {
61  return name;
62  }
63 
70  virtual bool Init(const std::map<std::string, double>& DPars) = 0;
71 
80  virtual bool PreUpdate() = 0;
81 
89  virtual bool Update(const std::map<std::string, double>& DPars) = 0;
90 
99  virtual bool PostUpdate() = 0;
100 
108  virtual bool CheckParameters(const std::map<std::string, double>& DPars) = 0;
109 
116  virtual bool setFlag(const std::string name, const bool value) = 0;
117 
124  virtual bool setFlagStr(const std::string name, const std::string value) = 0;
125 
130  virtual bool CheckFlags() const = 0;
131 
136  bool IsModelInitialized() const
137  {
138  return ModelInitialized;
139  }
140 
146  {
147  this->ModelInitialized = ModelInitialized;
148  }
149 
154  bool IsUpdateError() const
155  {
156  return UpdateError;
157  }
158 
164  {
165  this->UpdateError = UpdateError;
166  }
167 
168  const double& getModelParam(std::string name) const
169  {
170  return ModelParamMap.at(name);
171  }
172 
173  bool isModelParam(std::string name) const
174  {
175  return (ModelParamMap.find(name) != ModelParamMap.end());
176  }
177 
178  void setModelSUSY(){
179  flagSUSYmodel = true;
180  }
181 
182  bool isModelSUSY() const{
183  return flagSUSYmodel;
184  }
185 
186  void setModelTHDM(){
187  flagTHDMmodel = true;
188  }
189 
190  bool isModelTHDM() const{
191  return flagTHDMmodel;
192  }
193 
195  flagGTHDMmodel = true;
196  }
197 
198  bool isModelGeneralTHDM() const{
199  return flagGTHDMmodel;
200  }
201 
203  flagTHDMWmodel = true;
204  }
205 
206  bool isModelTHDMW() const{
207  return flagTHDMWmodel;
208  }
209 
211  flagGMmodel = true;
212  }
213 
214  bool isModelGeorgiMachacek() const{
215  return flagGMmodel;
216  }
217 
218 
219  bool isModelLinearized() const{
220  return flagLinearized;
221  }
222 
223  void setModelLinearized(bool linearized = true){
224  flagLinearized = linearized;
225  }
226 
227  void setSliced(bool Sliced)
228  {
229  isSliced = Sliced;
230  }
231 
232  void addMissingModelParameter(const std::string& missingParameterName)
233  {
234  missingModelParameters.push_back(missingParameterName);
235  }
236 
237  std::vector<std::string> getmissingModelParameters()
238  {
239  return missingModelParameters;
240  }
241 
243  {
245  }
246 
248  {
250  }
251 
252 protected:
253 
254  bool UpdateError;
255 
261  virtual void setParameter(const std::string name, const double& value) = 0;
262  mutable std::map< std::string, std::reference_wrapper<const double> > ModelParamMap;
263 
264  bool isSliced;
265 
266 private:
267  std::string name;
275  unsigned int missingModelParametersCount = 0;
276  std::vector<std::string> missingModelParameters;
277 
278 };
279 
280 #endif /* MODEL_H */
281 
Model::setUpdateError
void setUpdateError(bool UpdateError)
A set method to fix the update status as success or failure.
Definition: Model.h:163
Model::IsUpdateError
bool IsUpdateError() const
A method to check if there was any error in the model update process.
Definition: Model.h:154
Model::setFlagStr
virtual bool setFlagStr(const std::string name, const std::string value)=0
A method to set a flag of the model.
Model::ModelInitialized
bool ModelInitialized
A boolean set to true if the model is successfully initialized.
Definition: Model.h:268
Model::setModelGeorgiMachacek
void setModelGeorgiMachacek()
Definition: Model.h:210
Model::missingModelParameters
std::vector< std::string > missingModelParameters
Definition: Model.h:276
Model::setModelTHDM
void setModelTHDM()
Definition: Model.h:186
Model::isModelParam
bool isModelParam(std::string name) const
Definition: Model.h:173
Model::getmissingModelParameters
std::vector< std::string > getmissingModelParameters()
Definition: Model.h:237
Model::setParameter
virtual void setParameter(const std::string name, const double &value)=0
A method to set the value of a parameter of the model.
Model::addMissingModelParameter
void addMissingModelParameter(const std::string &missingParameterName)
Definition: Model.h:232
Model::Update
virtual bool Update(const std::map< std::string, double > &DPars)=0
The update method for the model.
Model::Init
virtual bool Init(const std::map< std::string, double > &DPars)=0
A method to initialize the model parameters.
Model::getModelParam
const double & getModelParam(std::string name) const
Definition: Model.h:168
Model::setModelGeneralTHDM
void setModelGeneralTHDM()
Definition: Model.h:194
Model::flagGTHDMmodel
bool flagGTHDMmodel
A flag identifying the model as a GeneralTHDM model.
Definition: Model.h:271
Model::flagTHDMWmodel
bool flagTHDMWmodel
A flag identifying the model as a THDMW model.
Definition: Model.h:272
Model::isModelGeorgiMachacek
bool isModelGeorgiMachacek() const
Definition: Model.h:214
Model::CheckParameters
virtual bool CheckParameters(const std::map< std::string, double > &DPars)=0
A method to check if all the mandatory parameters for the model have been provided in model initializ...
Model::UpdateError
bool UpdateError
A boolean set to false if update is successful.
Definition: Model.h:254
Model::flagGMmodel
bool flagGMmodel
A flag identifying the model as a GeorgiMachacek model.
Definition: Model.h:273
Model::ModelParamMap
std::map< std::string, std::reference_wrapper< const double > > ModelParamMap
Definition: Model.h:262
Model::isModelLinearized
bool isModelLinearized() const
Definition: Model.h:219
Model::isModelTHDM
bool isModelTHDM() const
Definition: Model.h:190
Model::PostUpdate
virtual bool PostUpdate()=0
The post-update method for the model.
Model::setFlag
virtual bool setFlag(const std::string name, const bool value)=0
A method to set a flag of the model.
Model::getMissingModelParametersCount
unsigned int getMissingModelParametersCount()
Definition: Model.h:247
Model::raiseMissingModelParameterCount
void raiseMissingModelParameterCount()
Definition: Model.h:242
Model::isSliced
bool isSliced
A boolean set to true if the current istance is a slice of an extended object.
Definition: Model.h:264
Model::isModelTHDMW
bool isModelTHDMW() const
Definition: Model.h:206
Model::flagSUSYmodel
bool flagSUSYmodel
A flag identifying the model as a SUSY model.
Definition: Model.h:269
Model
A class for the template of models.
Definition: Model.h:26
Model::IsModelInitialized
bool IsModelInitialized() const
A method to check if the model is initialized.
Definition: Model.h:136
Model::isModelGeneralTHDM
bool isModelGeneralTHDM() const
Definition: Model.h:198
Model::setModelName
void setModelName(const std::string name)
A method to set the name of the model.
Definition: Model.h:50
Model::missingModelParametersCount
unsigned int missingModelParametersCount
Definition: Model.h:275
Model::Model
Model()
The default constructor.
Definition: Model.h:32
Model::getModelName
std::string getModelName() const
A method to fetch the name of the model.
Definition: Model.h:59
Model::setModelTHDMW
void setModelTHDMW()
Definition: Model.h:202
Model::isModelSUSY
bool isModelSUSY() const
Definition: Model.h:182
Model::name
std::string name
The name of the model.
Definition: Model.h:267
Model::setModelLinearized
void setModelLinearized(bool linearized=true)
Definition: Model.h:223
Model::setModelSUSY
void setModelSUSY()
Definition: Model.h:178
Model::PreUpdate
virtual bool PreUpdate()=0
The pre-update method for the model.
Model::setSliced
void setSliced(bool Sliced)
Definition: Model.h:227
Model::flagTHDMmodel
bool flagTHDMmodel
A flag identifying the model as a THDM model.
Definition: Model.h:270
Model::CheckFlags
virtual bool CheckFlags() const =0
A method to check the sanity of the set of model flags.
Model::setModelInitialized
void setModelInitialized(bool ModelInitialized)
A set method to fix the failure or success of the initialization of the model.
Definition: Model.h:145
Model::~Model
virtual ~Model()
The default destructor.
Definition: Model.h:42
Model::flagLinearized
bool flagLinearized
A flag to identify models where the NP contribution to Higgs observables is linearized.
Definition: Model.h:274