a Code for the Combination of Indirect and Direct Constraints on High Energy Physics Models Logo
THDM.cpp
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#include "THDM.h"
9#include "THDMcache.h"
10#include <algorithm>
11
12std::string THDM::THDMvars[NTHDMvars] = {"logtb","bma",/*"mHh1","mA1","mHp1",*/"mHh2","mA2","mHp2","m12_2",
13 "BDtaunu_SM","BDtaunu_A","BDtaunu_B","BDstartaunu_SM","BDstartaunu_A","BDstartaunu_B",
14 "bsgamma_theoryerror","Q_THDM","Rpeps","NLOuniscale"};
15
16THDM::THDM() : StandardModel(), THDMM(*this) {
17 SMM.setObj((StandardModelMatching&) THDMM.getObj());
18 ModelParamMap.insert(std::make_pair("logtb", std::cref(logtb)));
19 ModelParamMap.insert(std::make_pair("bma", std::cref(bma)));
20 ModelParamMap.insert(std::make_pair("mHh1", std::cref(mHh1)));
21 ModelParamMap.insert(std::make_pair("mA1", std::cref(mA1)));
22 ModelParamMap.insert(std::make_pair("mHp1", std::cref(mHp1)));
23 ModelParamMap.insert(std::make_pair("mHh2", std::cref(mHh2)));
24 ModelParamMap.insert(std::make_pair("mA2", std::cref(mA2)));
25 ModelParamMap.insert(std::make_pair("mHp2", std::cref(mHp2)));
26 ModelParamMap.insert(std::make_pair("m12_2", std::cref(m12_2)));
27 ModelParamMap.insert(std::make_pair("BDtaunu_SM", std::cref(BDtaunu_SM)));
28 ModelParamMap.insert(std::make_pair("BDtaunu_A", std::cref(BDtaunu_A)));
29 ModelParamMap.insert(std::make_pair("BDtaunu_B", std::cref(BDtaunu_B)));
30 ModelParamMap.insert(std::make_pair("BDstartaunu_SM", std::cref(BDstartaunu_SM)));
31 ModelParamMap.insert(std::make_pair("BDstartaunu_A", std::cref(BDstartaunu_A)));
32 ModelParamMap.insert(std::make_pair("BDstartaunu_B", std::cref(BDstartaunu_B)));
33 ModelParamMap.insert(std::make_pair("bsgamma_theoryerror", std::cref(bsgamma_theoryerror)));
34 ModelParamMap.insert(std::make_pair("Q_THDM", std::cref(Q_THDM)));
35 ModelParamMap.insert(std::make_pair("Rpeps", std::cref(Rpeps)));
36 ModelParamMap.insert(std::make_pair("NLOuniscale", std::cref(NLOuniscale)));
38 flag_wfr = false;
39}
40
42 if (IsModelInitialized()) {
43 if (myTHDMcache != NULL) delete(myTHDMcache);
44 }
45}
46
48// Initialization
49
51{
52 myTHDMcache = new THDMcache(*this);
55 return(true);
56}
57
58bool THDM::Init(const std::map<std::string, double>& DPars) {
60}
61
63{
64 if(!StandardModel::PreUpdate()) return (false);
65
66 return (true);
67}
68
69bool THDM::Update(const std::map<std::string, double>& DPars) {
70
71 if(!PreUpdate()) return (false);
72
73 UpdateError = false;
74
75 for (std::map<std::string, double>::const_iterator it = DPars.begin(); it != DPars.end(); it++)
76 setParameter(it->first, it->second);
77
78 if (UpdateError) return (false);
79
80 if(!PostUpdate()) return (false);
81
82 return (true);
83}
84
86{
87 if(!StandardModel::PostUpdate()) return (false);
88
90
91 return (true);
92}
93
94void THDM::setParameter(const std::string name, const double& value){
95
96 if(name.compare("logtb") == 0) {
97 logtb = value;
98 tanb = pow(10.,logtb);
99 if(tanb > 0.) {
100 sinb = tanb / sqrt(1. + tanb*tanb);
101 cosb = 1. / sqrt(1. + tanb*tanb);
102 }
103 else {
104 throw std::runtime_error("error in THDM::SetParameter, tanb < 0!");
105 }
106 }
107 else if(name.compare("bma") == 0) {
108 bma = value;
109 sin_ba = sin(bma);
110 }
111 else if(name.compare("mHh1") == 0){
113 mHh1 = value;
114 }
115 else{
116 mHh1=sqrt(mHh2);
117 }
118 }
119 else if(name.compare("mA1") == 0){
121 mA1 = value;
122 }
123 else{
124 mA1=sqrt(mA2);
125 }
126 }
127 else if(name.compare("mHp1") == 0){
129 mHp1 = value;
130 }
131 else{
132 mHp1=sqrt(mHp2);
133 }
134 }
135 else if(name.compare("mHh2") == 0){
137 mHh2 = value;
138 }
139 else{
140 mHh2=mHh1*mHh1;
141 }
142 }
143 else if(name.compare("mA2") == 0){
145 mA2 = value;
146 }
147 else{
148 mA2=mA1*mA1;
149 }
150 }
151 else if(name.compare("mHp2") == 0){
153 mHp2 = value;
154 }
155 else{
156 mHp2=mHp1*mHp1;
157 }
158 }
159 else if(name.compare("m12_2") == 0)
160 m12_2 = value;
161 else if(name.compare("BDtaunu_SM") == 0)
162 BDtaunu_SM = value;
163 else if(name.compare("BDtaunu_A") == 0)
164 BDtaunu_A = value;
165 else if(name.compare("BDtaunu_B") == 0)
166 BDtaunu_B = value;
167 else if(name.compare("BDstartaunu_SM") == 0)
168 BDstartaunu_SM = value;
169 else if(name.compare("BDstartaunu_A") == 0)
170 BDstartaunu_A = value;
171 else if(name.compare("BDstartaunu_B") == 0)
172 BDstartaunu_B = value;
173 else if(name.compare("bsgamma_theoryerror") == 0)
174 bsgamma_theoryerror = value;
175 else if(name.compare("Q_THDM") == 0)
176 Q_THDM = value;
177 else if(name.compare("Rpeps") == 0)
178 Rpeps = value;
179 else if(name.compare("NLOuniscale") == 0)
180 NLOuniscale = value;
181 else
183}
184
185bool THDM::CheckParameters(const std::map<std::string, double>& DPars) {
186 for (int i = 0; i < NTHDMvars; i++) {
187 if (DPars.find(THDMvars[i]) == DPars.end()) {
188 std::cout << "ERROR: missing mandatory THDM parameter " << THDMvars[i] << std::endl;
191 }
192 }
194}
195
197// Flags
198
199bool THDM::setFlagStr(const std::string name, const std::string value)
200{
201 bool res = false;
202 if(name.compare("modelTypeflag") == 0)
203 {
204 if (checkmodelType(value))
205 {
206 flag_model = value;
207 res = true;
208 }
209 else
210 {
211 throw std::runtime_error("THDM::setFlagStr(): Invalid flag "
212 + name + "=" + value);
213 }
214 }
215 else if(name.compare("RGEorder") == 0) {
216 if (checkRGEorder(value))
217 {
218 flag_RGEorder = value;
219 res = true;
220 }
221 else
222 {
223 throw std::runtime_error("THDM::setFlagStr(): Invalid flag "
224 + name + "=" + value);
225 }
226 }
227 else
228 {
229 res = StandardModel::setFlagStr(name,value);
230 }
231
232 return(res);
233}
234
235bool THDM::setFlag(const std::string name, const bool value)
236{
237 bool res = false;
238 if(name.compare("use_sq_masses") == 0) {
239 flag_use_sq_masses = value;
240 res = true;
241 if (!flag_use_sq_masses) {
242 THDMvars[std::distance(THDMvars,std::find(THDMvars,THDMvars+NTHDMvars,"mHh2"))] = "mHh1";
243 THDMvars[std::distance(THDMvars,std::find(THDMvars,THDMvars+NTHDMvars,"mA2"))] = "mA1";
244 THDMvars[std::distance(THDMvars,std::find(THDMvars,THDMvars+NTHDMvars,"mHp2"))] = "mHp1";
245
246 ModelParamMap.insert(std::make_pair("mHh1", std::cref(mHh1)));
247 ModelParamMap.insert(std::make_pair("mA1", std::cref(mA1)));
248 ModelParamMap.insert(std::make_pair("mHp1", std::cref(mHp1)));
249 }
250 }
251 else if(name.compare("wavefunctionrenormalization") == 0) {
252 flag_wfr = value;
253 res = true;
254 }
255 else
256 res = StandardModel::setFlag(name,value);
257
258 return(res);
259}
std::map< std::string, double > DPars
Definition: Minimal.cpp:11
void addMissingModelParameter(const std::string &missingParameterName)
Definition: Model.h:250
void setModelTHDM()
Definition: Model.h:194
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 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 UpdateError
A boolean set to false if update is successful.
Definition: Model.h:272
void raiseMissingModelParameterCount()
Definition: Model.h:260
A model class for the Standard Model.
virtual bool PreUpdate()
The pre-update method for StandardModel.
virtual bool CheckParameters(const std::map< std::string, double > &DPars)
A method to check if all the mandatory parameters for StandardModel have been provided in model initi...
virtual bool Init(const std::map< std::string, double > &DPars)
A method to initialize the model parameters.
virtual bool setFlagStr(const std::string name, const std::string value)
A method to set a flag of StandardModel.
Matching< StandardModelMatching, StandardModel > SMM
An object of type Matching.
virtual bool setFlag(const std::string name, const bool value)
A method to set a flag of StandardModel.
virtual bool PostUpdate()
The post-update method for StandardModel.
virtual void setParameter(const std::string name, const double &value)
A method to set the value of a parameter of StandardModel.
virtual bool InitializeModel()
A method to initialize the model.
A class for the matching in the Standard Model.
double tanb
Definition: THDM.h:622
double mHh1
Definition: THDM.h:622
std::string flag_model
Definition: THDM.h:625
Matching< THDMMatching, THDM > THDMM
An object of type THDMMatching.
Definition: THDM.h:616
double mHp1
Definition: THDM.h:622
THDMcache * myTHDMcache
An object of type THDMCache.
Definition: THDM.h:620
double BDtaunu_A
Definition: THDM.h:624
double Q_THDM
Definition: THDM.h:622
double sin_ba
Definition: THDM.h:622
double BDtaunu_B
Definition: THDM.h:624
double cosb
Definition: THDM.h:622
virtual bool setFlag(const std::string name, const bool value)
A method to set a flag of THDM.
Definition: THDM.cpp:235
~THDM()
THDM destructor.
Definition: THDM.cpp:41
static const int NTHDMvars
Definition: THDM.h:123
double BDstartaunu_SM
Definition: THDM.h:624
virtual bool InitializeModel()
A method to initialize the model.
Definition: THDM.cpp:50
double bma
Definition: THDM.h:622
virtual bool Init(const std::map< std::string, double > &DPars)
Initializes the THDM parameters found in the argument.
Definition: THDM.cpp:58
bool checkmodelType(const std::string modeltype) const
A method to check if the model type name in string form is valid.
Definition: THDM.h:590
double m12_2
Definition: THDM.h:622
double BDstartaunu_A
Definition: THDM.h:624
static std::string THDMvars[NTHDMvars]
Definition: THDM.h:124
virtual bool PreUpdate()
The pre-update method for THDM.
Definition: THDM.cpp:62
double BDtaunu_SM
Definition: THDM.h:624
double sinb
Definition: THDM.h:622
virtual bool Update(const std::map< std::string, double > &DPars)
The update method for THDM.
Definition: THDM.cpp:69
bool checkRGEorder(const std::string RGEorder) const
A method to check if the RGE order name in string form is valid.
Definition: THDM.h:606
virtual bool CheckParameters(const std::map< std::string, double > &DPars)
A method to check if all the mandatory parameters for THDM have been provided in model initialization...
Definition: THDM.cpp:185
double mHp2
Definition: THDM.h:622
double BDstartaunu_B
Definition: THDM.h:624
bool flag_wfr
Definition: THDM.h:626
double mHl2
Definition: THDM.h:623
double bsgamma_theoryerror
Definition: THDM.h:622
bool flag_use_sq_masses
Definition: THDM.h:626
virtual bool PostUpdate()
The post-update method for THDM.
Definition: THDM.cpp:85
double logtb
Definition: THDM.h:622
virtual bool setFlagStr(const std::string name, const std::string value)
A method to set a string flag of THDM.
Definition: THDM.cpp:199
double mHh2
Definition: THDM.h:622
double Rpeps
Definition: THDM.h:622
std::string flag_RGEorder
Definition: THDM.h:625
double NLOuniscale
Definition: THDM.h:622
double mA1
Definition: THDM.h:622
virtual void setParameter(const std::string name, const double &value)
A method to set the value of a parameter of THDM.
Definition: THDM.cpp:94
double mA2
Definition: THDM.h:622
THDM()
THDM constructor.
Definition: THDM.cpp:16
A class for the caching of some THDM objects.
Definition: THDMcache.h:29
double updateCache()