a Code for the Combination of Indirect and Direct Constraints on High Energy Physics Models Logo
LeftRightSymmetricModel.cpp
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2016 HEPfit Collaboration
3  *
4  *
5  * For the licensing terms see doc/COPYING.
6  */
7 
9 #include "LRSMquantities.h"
10 
11 const std::string LeftRightSymmetricModel::LeftRightSymmetricModelvars[NLeftRightSymmetricModelvars] =
12  {"mH1p_2", "mH2p_2", "mdeltappR_2", "xi_LRSM", "mWR",
13  "lambda1_LRSM", "lambda2_LRSM", "lambda3_LRSM", "lambda4_LRSM",
14  "rho1_LRSM", "rho4_LRSM", "alpha1_LRSM", "alpha2_LRSM",
15  "alpha_LRSM", "delta2_LRSM",
16  "thetaR12_LRSM","thetaR13_LRSM","thetaR23_LRSM",
17  "phiR1_LRSM","phiR2_LRSM","phiR3_LRSM","phiR4_LRSM","phiR5_LRSM","phiR6_LRSM",
18  "Q_LRSM"};
19 
21 U(5, 5, 0.), LRSMM(*this)
22 {
24  ModelParamMap.insert(std::make_pair("mH1p_2", std::cref(mH1p_2)));
25  ModelParamMap.insert(std::make_pair("mH2p_2", std::cref(mH2p_2)));
26  ModelParamMap.insert(std::make_pair("mdeltappR_2", std::cref(mdeltappR_2)));
27  ModelParamMap.insert(std::make_pair("xi_LRSM", std::cref(xi_LRSM)));
28  ModelParamMap.insert(std::make_pair("mWR", std::cref(mWR)));
29  ModelParamMap.insert(std::make_pair("lambda1_LRSM", std::cref(lambda1_LRSM)));
30  ModelParamMap.insert(std::make_pair("lambda2_LRSM", std::cref(lambda2_LRSM)));
31  ModelParamMap.insert(std::make_pair("lambda3_LRSM", std::cref(lambda3_LRSM)));
32  ModelParamMap.insert(std::make_pair("lambda4_LRSM", std::cref(lambda4_LRSM)));
33  ModelParamMap.insert(std::make_pair("rho1_LRSM", std::cref(rho1_LRSM)));
34  ModelParamMap.insert(std::make_pair("rho4_LRSM", std::cref(rho4_LRSM)));
35  ModelParamMap.insert(std::make_pair("alpha1_LRSM", std::cref(alpha1_LRSM)));
36  ModelParamMap.insert(std::make_pair("alpha2_LRSM", std::cref(alpha2_LRSM)));
37  ModelParamMap.insert(std::make_pair("alpha_LRSM", std::cref(alpha_LRSM)));
38  ModelParamMap.insert(std::make_pair("delta2_LRSM", std::cref(delta2_LRSM)));
39  ModelParamMap.insert(std::make_pair("thetaR12_LRSM", std::cref(thetaR12_LRSM)));
40  ModelParamMap.insert(std::make_pair("thetaR13_LRSM", std::cref(thetaR13_LRSM)));
41  ModelParamMap.insert(std::make_pair("thetaR23_LRSM", std::cref(thetaR23_LRSM)));
42  ModelParamMap.insert(std::make_pair("phiR1_LRSM", std::cref(phiR1_LRSM)));
43  ModelParamMap.insert(std::make_pair("phiR2_LRSM", std::cref(phiR2_LRSM)));
44  ModelParamMap.insert(std::make_pair("phiR3_LRSM", std::cref(phiR3_LRSM)));
45  ModelParamMap.insert(std::make_pair("phiR4_LRSM", std::cref(phiR4_LRSM)));
46  ModelParamMap.insert(std::make_pair("phiR5_LRSM", std::cref(phiR5_LRSM)));
47  ModelParamMap.insert(std::make_pair("phiR6_LRSM", std::cref(phiR6_LRSM)));
48  ModelParamMap.insert(std::make_pair("Q_LRSM", std::cref(Q_LRSM)));
49 }
50 
52  if (myLRSMquantities != NULL) delete(myLRSMquantities);
53 // if (IsModelInitialized()) {
54 // }
55 }
56 
57 /*----------------------------------------------------------------------------*/
58 // Initialization
59 
61 {
62  myLRSMquantities = new LRSMquantities(*this);
65  return(true);
66 }
67 
68 bool LeftRightSymmetricModel::Init(const std::map<std::string, double>& DPars) {
69  return(StandardModel::Init(DPars));
70 }
71 
73 {
74  if(!StandardModel::PreUpdate()) return (false);
75 
76  return (true);
77 }
78 
79 bool LeftRightSymmetricModel::Update(const std::map<std::string, double>& DPars) {
80 
81  if(!PreUpdate()) return (false);
82  UpdateError = false;
83  for (std::map<std::string, double>::const_iterator it = DPars.begin(); it != DPars.end(); it++)
84  setParameter(it->first, it->second);
85  if (UpdateError) return (false);
86  if(!PostUpdate()) return (false);
87 
88  return (true);
89 }
90 
92 {
93  if(!StandardModel::PostUpdate()) return (false);
94  if(!myLRSMquantities->CalcNeutralMasses(U,mH0sq)) return (false);
95  if(!myLRSMquantities->CalcNeutralMasses_app(mH0sq_app)) return (false);
96 
98 
99  return (true);
100 }
101 
102 void LeftRightSymmetricModel::setParameter(const std::string name, const double& value)
103 {
104 
105  if (name.compare("mH1p_2") == 0) {
106  if (mH1p_2 >= 0.) mH1p_2 = value;
107  else throw std::runtime_error("error in LeftRightSymmetricModel::SetParameter, mH1p_2 < 0!");
108  } else if (name.compare("mH2p_2") == 0) {
109  if (mH2p_2 >= 0.) mH2p_2 = value;
110  else throw std::runtime_error("error in LeftRightSymmetricModel::SetParameter, mH2p_2 < 0!");
111  } else if (name.compare("mdeltappR_2") == 0) {
112  if (mdeltappR_2 >= 0.) mdeltappR_2 = value;
113  else throw std::runtime_error("error in LeftRightSymmetricModel::SetParameter, mdeltappR_2 < 0!");
114  } else if (name.compare("xi_LRSM") == 0) {
115  if (xi_LRSM >= 0. && xi_LRSM < 1.) xi_LRSM = value;
116  else throw std::runtime_error("error in LeftRightSymmetricModel::SetParameter, xi_LRSM < 0!");
117  } else if (name.compare("mWR") == 0) {
118  if (mWR >= 0.) mWR = value;
119  else throw std::runtime_error("error in LeftRightSymmetricModel::SetParameter, mWR < 0!");
120  } else if (name.compare("lambda1_LRSM") == 0)
121  lambda1_LRSM = value;
122  else if (name.compare("lambda2_LRSM") == 0)
123  lambda2_LRSM = value;
124  else if (name.compare("lambda3_LRSM") == 0)
125  lambda3_LRSM = value;
126  else if (name.compare("lambda4_LRSM") == 0)
127  lambda4_LRSM = value;
128  else if (name.compare("rho1_LRSM") == 0)
129  rho1_LRSM = value;
130  else if (name.compare("rho4_LRSM") == 0)
131  rho4_LRSM = value;
132  else if (name.compare("alpha1_LRSM") == 0)
133  alpha1_LRSM = value;
134  else if (name.compare("alpha2_LRSM") == 0)
135  alpha2_LRSM = value;
136  else if (name.compare("alpha_LRSM") == 0)
137  alpha_LRSM = value;
138  else if (name.compare("delta2_LRSM") == 0)
139  delta2_LRSM = value;
140  else if (name.compare("thetaR12_LRSM") == 0)
141  thetaR12_LRSM = value;
142  else if (name.compare("thetaR13_LRSM") == 0)
143  thetaR13_LRSM = value;
144  else if (name.compare("thetaR23_LRSM") == 0)
145  thetaR23_LRSM = value;
146  else if (name.compare("phiR1_LRSM") == 0)
147  phiR1_LRSM = value;
148  else if (name.compare("phiR2_LRSM") == 0)
149  phiR2_LRSM = value;
150  else if (name.compare("phiR3_LRSM") == 0)
151  phiR3_LRSM = value;
152  else if (name.compare("phiR4_LRSM") == 0)
153  phiR4_LRSM = value;
154  else if (name.compare("phiR5_LRSM") == 0)
155  phiR5_LRSM = value;
156  else if (name.compare("phiR6_LRSM") == 0)
157  phiR6_LRSM = value;
158  else if (name.compare("Q_LRSM") == 0) {
159  if (Q_LRSM >= 0.) Q_LRSM = value;
160  else throw std::runtime_error("error in LeftRightSymmetricModel::SetParameter, Q_LRSM < 0!");
161  } else
163 }
164 
165 bool LeftRightSymmetricModel::CheckParameters(const std::map<std::string, double>& DPars)
166 {
167  for (int i = 0; i < NLeftRightSymmetricModelvars; i++) {
168  if (DPars.find(LeftRightSymmetricModelvars[i]) == DPars.end()) {
169  std::cout << "missing mandatory GeneralTHDM parameter " << LeftRightSymmetricModelvars[i] << std::endl;
172  }
173  }
174  return(StandardModel::CheckParameters(DPars));
175 }
176 
177 /*----------------------------------------------------------------------------*/
178 /* Flags */
179 
180 bool LeftRightSymmetricModel::setFlagStr(const std::string name, const std::string value)
181 {
182  bool res = false;
183 // if (name.compare("modelTypeflag") == 0) {
184 // if (checkmodelType(value)) {
185 // flag_model = value;
186 // res = true;
187 // } else {
188 // throw std::runtime_error("LeftRightSymmetricModel::setFlagStr(): Invalid flag "
189 // + name + "=" + value);
190 // }
191 // } else {
192  res = StandardModel::setFlagStr(name, value);
193 // }
194 
195  return (res);
196 }
197 
198 bool LeftRightSymmetricModel::setFlag(const std::string name, const bool value)
199 {
200  bool res = false;
201  if (name.compare("CPviolation") == 0) {
202  flag_CPV = value;
203  res = true;
204  } else
205  res = StandardModel::setFlag(name, value);
206 
207  return (res);
208 }
LeftRightSymmetricModel::CheckParameters
virtual bool CheckParameters(const std::map< std::string, double > &DPars)
Definition: LeftRightSymmetricModel.cpp:165
LeftRightSymmetricModel::setFlagStr
virtual bool setFlagStr(const std::string name, const std::string value)
Definition: LeftRightSymmetricModel.cpp:180
StandardModel::setParameter
virtual void setParameter(const std::string name, const double &value)
A method to set the value of a parameter of StandardModel.
Definition: StandardModel.cpp:257
LeftRightSymmetricModel::phiR5_LRSM
double phiR5_LRSM
Definition: LeftRightSymmetricModel.h:401
LeftRightSymmetricModelMatching::updateLeftRightSymmetricModelParameters
void updateLeftRightSymmetricModelParameters()
Updates to new LeftRightSymmetricModel parameter sets.
Definition: LeftRightSymmetricModelMatching.cpp:24
LeftRightSymmetricModel::alpha_LRSM
double alpha_LRSM
Definition: LeftRightSymmetricModel.h:400
LeftRightSymmetricModel::lambda3_LRSM
double lambda3_LRSM
Definition: LeftRightSymmetricModel.h:400
LRSMquantities::CalcNeutralMasses
bool CalcNeutralMasses(gslpp::matrix< gslpp::complex > &U_i, double mH0sq[5])
Computes the exact neutral spectrum at tree level.
Definition: LRSMquantities.cpp:25
LeftRightSymmetricModel::setFlag
virtual bool setFlag(const std::string, const bool)
Definition: LeftRightSymmetricModel.cpp:198
LeftRightSymmetricModel::delta2_LRSM
double delta2_LRSM
Definition: LeftRightSymmetricModel.h:400
LeftRightSymmetricModel::Init
virtual bool Init(const std::map< std::string, double > &DPars)
Definition: LeftRightSymmetricModel.cpp:68
LeftRightSymmetricModel::thetaR13_LRSM
double thetaR13_LRSM
Definition: LeftRightSymmetricModel.h:401
LeftRightSymmetricModel::mH0sq_app
double mH0sq_app[4]
Definition: LeftRightSymmetricModel.h:392
LeftRightSymmetricModel::InitializeModel
virtual bool InitializeModel()
Definition: LeftRightSymmetricModel.cpp:60
LeftRightSymmetricModel::alpha2_LRSM
double alpha2_LRSM
Definition: LeftRightSymmetricModel.h:400
Matching::getObj
T & getObj()
Definition: Matching.h:14
LeftRightSymmetricModel::mdeltappR_2
double mdeltappR_2
Definition: LeftRightSymmetricModel.h:399
LeftRightSymmetricModel::flag_CPV
bool flag_CPV
Definition: LeftRightSymmetricModel.h:403
LeftRightSymmetricModel::setParameter
virtual void setParameter(const std::string, const double &)
Definition: LeftRightSymmetricModel.cpp:102
LeftRightSymmetricModel::rho4_LRSM
double rho4_LRSM
Definition: LeftRightSymmetricModel.h:400
Model::addMissingModelParameter
void addMissingModelParameter(const std::string &missingParameterName)
Definition: Model.h:240
LeftRightSymmetricModel::mH0sq
double mH0sq[5]
Definition: LeftRightSymmetricModel.h:391
StandardModel::CheckParameters
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...
Definition: StandardModel.cpp:339
LeftRightSymmetricModel::~LeftRightSymmetricModel
~LeftRightSymmetricModel()
LeftRightSymmetricModel destructor.
Definition: LeftRightSymmetricModel.cpp:51
LeftRightSymmetricModel::lambda2_LRSM
double lambda2_LRSM
Definition: LeftRightSymmetricModel.h:400
LeftRightSymmetricModel::lambda1_LRSM
double lambda1_LRSM
Definition: LeftRightSymmetricModel.h:400
LeftRightSymmetricModel::U
gslpp::matrix< gslpp::complex > U
Definition: LeftRightSymmetricModel.h:393
Matching::setObj
void setObj(T &obji)
Definition: Matching.h:15
LeftRightSymmetricModel::NLeftRightSymmetricModelvars
static const int NLeftRightSymmetricModelvars
Definition: LeftRightSymmetricModel.h:34
StandardModel
A model class for the Standard Model.
Definition: StandardModel.h:477
Model::UpdateError
bool UpdateError
A boolean set to false if update is successful.
Definition: Model.h:262
StandardModel::SMM
Matching< StandardModelMatching, StandardModel > SMM
An object of type Matching.
Definition: StandardModel.h:2550
LeftRightSymmetricModel::LRSMM
Matching< LeftRightSymmetricModelMatching, LeftRightSymmetricModel > LRSMM
An object of type Matching.
Definition: LeftRightSymmetricModel.h:395
LeftRightSymmetricModel::alpha1_LRSM
double alpha1_LRSM
Definition: LeftRightSymmetricModel.h:400
StandardModel::setFlag
virtual bool setFlag(const std::string name, const bool value)
A method to set a flag of StandardModel.
Definition: StandardModel.cpp:404
Model::ModelParamMap
std::map< std::string, std::reference_wrapper< const double > > ModelParamMap
Definition: Model.h:270
StandardModel::Init
virtual bool Init(const std::map< std::string, double > &DPars)
A method to initialize the model parameters.
Definition: StandardModel.cpp:185
StandardModelMatching
A class for the matching in the Standard Model.
Definition: StandardModelMatching.h:26
LeftRightSymmetricModel::Q_LRSM
double Q_LRSM
Definition: LeftRightSymmetricModel.h:400
LeftRightSymmetricModel::mH2p_2
double mH2p_2
Definition: LeftRightSymmetricModel.h:399
StandardModel::PreUpdate
virtual bool PreUpdate()
The pre-update method for StandardModel.
Definition: StandardModel.cpp:198
LeftRightSymmetricModel::setModelLeftRightSymmetricModel
void setModelLeftRightSymmetricModel()
Definition: LeftRightSymmetricModel.h:59
LeftRightSymmetricModel::phiR2_LRSM
double phiR2_LRSM
Definition: LeftRightSymmetricModel.h:401
Model::raiseMissingModelParameterCount
void raiseMissingModelParameterCount()
Definition: Model.h:250
LeftRightSymmetricModel::LeftRightSymmetricModelvars
static const std::string LeftRightSymmetricModelvars[NLeftRightSymmetricModelvars]
Definition: LeftRightSymmetricModel.h:35
LeftRightSymmetricModel::rho1_LRSM
double rho1_LRSM
Definition: LeftRightSymmetricModel.h:400
LeftRightSymmetricModel::myLRSMquantities
LRSMquantities * myLRSMquantities
Definition: LeftRightSymmetricModel.h:389
StandardModel::PostUpdate
virtual bool PostUpdate()
The post-update method for StandardModel.
Definition: StandardModel.cpp:225
StandardModel::setFlagStr
virtual bool setFlagStr(const std::string name, const std::string value)
A method to set a flag of StandardModel.
Definition: StandardModel.cpp:444
LeftRightSymmetricModel::phiR3_LRSM
double phiR3_LRSM
Definition: LeftRightSymmetricModel.h:401
LeftRightSymmetricModel::phiR6_LRSM
double phiR6_LRSM
Definition: LeftRightSymmetricModel.h:401
StandardModel::InitializeModel
virtual bool InitializeModel()
A method to initialize the model.
Definition: StandardModel.cpp:163
LeftRightSymmetricModel::lambda4_LRSM
double lambda4_LRSM
Definition: LeftRightSymmetricModel.h:400
LeftRightSymmetricModel::LRSMquantities
friend class LRSMquantities
Definition: LeftRightSymmetricModel.h:32
LeftRightSymmetricModel::Update
virtual bool Update(const std::map< std::string, double > &DPars)
Definition: LeftRightSymmetricModel.cpp:79
LRSMquantities::CalcNeutralMasses_app
bool CalcNeutralMasses_app(double mH0sq_app[4])
Computes the approximate neutral spectrum at tree level.
Definition: LRSMquantities.cpp:87
LeftRightSymmetricModel::phiR1_LRSM
double phiR1_LRSM
Definition: LeftRightSymmetricModel.h:401
LeftRightSymmetricModel::PostUpdate
virtual bool PostUpdate()
Definition: LeftRightSymmetricModel.cpp:91
LeftRightSymmetricModel::phiR4_LRSM
double phiR4_LRSM
Definition: LeftRightSymmetricModel.h:401
LeftRightSymmetricModel::mH1p_2
double mH1p_2
Definition: LeftRightSymmetricModel.h:399
Model::name
std::string name
The name of the model.
Definition: Model.h:275
LeftRightSymmetricModel::thetaR23_LRSM
double thetaR23_LRSM
Definition: LeftRightSymmetricModel.h:401
LeftRightSymmetricModel::xi_LRSM
double xi_LRSM
Definition: LeftRightSymmetricModel.h:399
LeftRightSymmetricModel::thetaR12_LRSM
double thetaR12_LRSM
Definition: LeftRightSymmetricModel.h:401
LeftRightSymmetricModel::PreUpdate
virtual bool PreUpdate()
Definition: LeftRightSymmetricModel.cpp:72
LeftRightSymmetricModel::mWR
double mWR
Definition: LeftRightSymmetricModel.h:399
LRSMquantities.h
LeftRightSymmetricModel::LeftRightSymmetricModel
LeftRightSymmetricModel()
LeftRightSymmetricModel constructor.
Definition: LeftRightSymmetricModel.cpp:20
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
LeftRightSymmetricModel.h