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
26class Model {
27public:
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
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
179 flagSUSYmodel = true;
180 }
181
182 bool isModelSUSY() const{
183 return flagSUSYmodel;
184 }
185
187 flagFWCDF2model = true;
188 }
189
190 bool isModelFWC_DF2() const{
191 return flagFWCDF2model;
192 }
193
195 flagTHDMmodel = true;
196 }
197
198 bool isModelTHDM() const{
199 return flagTHDMmodel;
200 }
201
203 flagGTHDMmodel = true;
204 }
205
206 bool isModelGeneralTHDM() const{
207 return flagGTHDMmodel;
208 }
209
211 flagTHDMWmodel = true;
212 }
213
214 bool isModelTHDMW() const{
215 return flagTHDMWmodel;
216 }
217
219 flagGMmodel = true;
220 }
221
223 return flagGMmodel;
224 }
225
226
227 bool isModelLinearized() const{
228 return flagLinearized;
229 }
230
231 void setModelLinearized(bool linearized = true){
232 flagLinearized = linearized;
233 }
234
235 //AG:begin
236 bool isModelNPquadratic() const{
237 return flagNPquadratic;
238 }
239
240 void setModelNPquadratic(bool NPquadratic = true){
241 flagNPquadratic = NPquadratic;
242 }
243 //AG:end
244
245 void setSliced(bool Sliced)
246 {
247 isSliced = Sliced;
248 }
249
250 void addMissingModelParameter(const std::string& missingParameterName)
251 {
252 missingModelParameters.push_back(missingParameterName);
253 }
254
255 std::vector<std::string> getmissingModelParameters()
256 {
258 }
259
261 {
263 }
264
266 {
268 }
269
270protected:
271
272 bool UpdateError = false;
273
279 virtual void setParameter(const std::string name, const double& value) = 0;
280 mutable std::map< std::string, std::reference_wrapper<const double> > ModelParamMap;
281
282 bool isSliced = false;
283
284private:
285 std::string name;
286 bool ModelInitialized = false;
287 bool flagSUSYmodel = false;
288 bool flagFWCDF2model = false;
289 bool flagTHDMmodel = false;
290 bool flagGTHDMmodel = false;
291 bool flagTHDMWmodel = false;
292 bool flagGMmodel = false;
293 bool flagLinearized = false;
294 bool flagNPquadratic = false; //AG:added
296 std::vector<std::string> missingModelParameters;
297
298};
299
300#endif /* MODEL_H */
301
std::map< std::string, double > DPars
Definition: Minimal.cpp:11
A class for the template of models.
Definition: Model.h:26
virtual bool PostUpdate()=0
The post-update method for the model.
virtual bool Init(const std::map< std::string, double > &DPars)=0
A method to initialize the model parameters.
bool flagGMmodel
A flag identifying the model as a GeorgiMachacek model.
Definition: Model.h:292
void addMissingModelParameter(const std::string &missingParameterName)
Definition: Model.h:250
bool isModelLinearized() const
Definition: Model.h:227
void setModelGeneralTHDM()
Definition: Model.h:202
void setModelLinearized(bool linearized=true)
Definition: Model.h:231
bool isModelTHDMW() const
Definition: Model.h:214
virtual bool Update(const std::map< std::string, double > &DPars)=0
The update method for the model.
void setSliced(bool Sliced)
Definition: Model.h:245
bool isModelSUSY() const
Definition: Model.h:182
void setModelGeorgiMachacek()
Definition: Model.h:218
bool flagLinearized
A flag to identify models where the NP contribution to Higgs observables is linearized.
Definition: Model.h:293
unsigned int missingModelParametersCount
Definition: Model.h:295
void setModelTHDM()
Definition: Model.h:194
void setModelTHDMW()
Definition: Model.h:210
bool flagNPquadratic
Definition: Model.h:294
void setModelFWC_DF2()
Definition: Model.h:186
bool flagSUSYmodel
A flag identifying the model as a SUSY model.
Definition: Model.h:287
void setModelNPquadratic(bool NPquadratic=true)
Definition: Model.h:240
std::map< std::string, std::reference_wrapper< const double > > ModelParamMap
Definition: Model.h:280
void setModelInitialized(bool ModelInitialized)
A set method to fix the failure or success of the initialization of the model.
Definition: Model.h:145
bool isModelParam(std::string name) const
Definition: Model.h:173
void setUpdateError(bool UpdateError)
A set method to fix the update status as success or failure.
Definition: Model.h:163
virtual void setParameter(const std::string name, const double &value)=0
A method to set the value of a parameter of the model.
bool IsModelInitialized() const
A method to check if the model is initialized.
Definition: Model.h:136
std::string name
The name of the model.
Definition: Model.h:285
bool isModelNPquadratic() const
Definition: Model.h:236
void setModelName(const std::string name)
A method to set the name of the model.
Definition: Model.h:50
bool isSliced
A boolean set to true if the current istance is a slice of an extended object.
Definition: Model.h:282
bool isModelFWC_DF2() const
Definition: Model.h:190
bool UpdateError
A boolean set to false if update is successful.
Definition: Model.h:272
virtual bool PreUpdate()=0
The pre-update method for the model.
const double & getModelParam(std::string name) const
Definition: Model.h:168
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...
bool flagGTHDMmodel
A flag identifying the model as a GeneralTHDM model.
Definition: Model.h:290
virtual bool setFlag(const std::string name, const bool value)=0
A method to set a flag of the model.
std::vector< std::string > getmissingModelParameters()
Definition: Model.h:255
bool flagFWCDF2model
A flag identifying the model as a FlavourWilsonCoefficient_DF2 model.
Definition: Model.h:288
std::string getModelName() const
A method to fetch the name of the model.
Definition: Model.h:59
virtual bool CheckFlags() const =0
A method to check the sanity of the set of model flags.
void raiseMissingModelParameterCount()
Definition: Model.h:260
bool flagTHDMWmodel
A flag identifying the model as a THDMW model.
Definition: Model.h:291
bool ModelInitialized
A boolean set to true if the model is successfully initialized.
Definition: Model.h:286
bool isModelGeneralTHDM() const
Definition: Model.h:206
Model()
The default constructor.
Definition: Model.h:32
bool flagTHDMmodel
A flag identifying the model as a THDM model.
Definition: Model.h:289
void setModelSUSY()
Definition: Model.h:178
bool IsUpdateError() const
A method to check if there was any error in the model update process.
Definition: Model.h:154
virtual bool setFlagStr(const std::string name, const std::string value)=0
A method to set a flag of the model.
unsigned int getMissingModelParametersCount()
Definition: Model.h:265
virtual ~Model()
The default destructor.
Definition: Model.h:42
bool isModelGeorgiMachacek() const
Definition: Model.h:222
bool isModelTHDM() const
Definition: Model.h:198
std::vector< std::string > missingModelParameters
Definition: Model.h:296