a Code for the Combination of Indirect and Direct Constraints on High Energy Physics Models Logo
Meson.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 "Meson.h"
9 #include "std_make_vector.h"
10 
11 Meson::Meson(double mass, double lifetime = 5.e29, double decayconst = 0.,
12  double lambdaM = 0., double gegenalpha1 = 0., double gegenalpha2 = 0.)
13 {
14  this->mass = mass;
15  this->lifetime = lifetime;
16  this->decayconst = decayconst;
17  this->lambdaM = lambdaM;
18  gegenalpha[0] = gegenalpha1;
19  gegenalpha[1] = gegenalpha2;
20 }
21 
23 {
24  mass = 0.;
25  lifetime = 5.e29;
26  decayconst = 0.;
27  lambdaM = 0.;
28  gegenalpha[0] = 0.;
29  gegenalpha[1] = 0.;
30  name = "";
31 }
32 
34 {}
35 
36 void Meson::ModelParameterMapInsert(std::map< std::string, std::reference_wrapper<const double> >& ModelParamMap)
37 {
38  if (name.compare("P_0") == 0) {
39  ModelParamMap.insert(std::make_pair("MP0", std::cref(mass)));
40  ModelParamMap.insert(std::make_pair("tP0", std::cref(lifetime)));
41  ModelParamMap.insert(std::make_pair("FP0", std::cref(decayconst)));
42  return;
43  }
44  if (name.compare("P_P") == 0) {
45  ModelParamMap.insert(std::make_pair("MPp", std::cref(mass)));
46  ModelParamMap.insert(std::make_pair("tPp", std::cref(lifetime)));
47  ModelParamMap.insert(std::make_pair("FPp", std::cref(decayconst)));
48  return;
49  }
50  if (name.compare("K_0") == 0) {
51  ModelParamMap.insert(std::make_pair("MK0", std::cref(mass)));
52  ModelParamMap.insert(std::make_pair("tKl", std::cref(lifetime)));
53  ModelParamMap.insert(std::make_pair("FK", std::cref(decayconst)));
54  return;
55  }
56  if (name.compare("K_P") == 0) {
57  ModelParamMap.insert(std::make_pair("MKp", std::cref(mass)));
58  ModelParamMap.insert(std::make_pair("tKp", std::cref(lifetime)));
59  ModelParamMap.insert(std::make_pair("FK", std::cref(decayconst)));
60  ModelParamMap.insert(std::make_pair("alpha1kp", std::cref(gegenalpha[0])));
61  ModelParamMap.insert(std::make_pair("alpha2kp", std::cref(gegenalpha[1])));
62  return;
63  }
64  if (name.compare("D_0") == 0) {
65  ModelParamMap.insert(std::make_pair("MD0", std::cref(mass)));
66  ModelParamMap.insert(std::make_pair("tD0", std::cref(lifetime)));
67  ModelParamMap.insert(std::make_pair("FD", std::cref(decayconst)));
68  return;
69  }
70  if (name.compare("D_P") == 0) {
71  ModelParamMap.insert(std::make_pair("MDP", std::cref(mass)));
72  ModelParamMap.insert(std::make_pair("tDP", std::cref(lifetime)));
73  ModelParamMap.insert(std::make_pair("FDP", std::cref(decayconst)));
74  return;
75  }
76  if (name.compare("B_D") == 0) {
77  ModelParamMap.insert(std::make_pair("MBd", std::cref(mass)));
78  ModelParamMap.insert(std::make_pair("tBd", std::cref(lifetime)));
79  ModelParamMap.insert(std::make_pair("FBd", std::cref(decayconst)));
80  ModelParamMap.insert(std::make_pair("FBsoFBd", std::cref(FBsoFBd)));
81  ModelParamMap.insert(std::make_pair("lambdaB", std::cref(lambdaM)));
82  return;
83  }
84  if (name.compare("B_P") == 0) {
85  ModelParamMap.insert(std::make_pair("MBp", std::cref(mass)));
86  ModelParamMap.insert(std::make_pair("tBp", std::cref(lifetime)));
87  ModelParamMap.insert(std::make_pair("FBp", std::cref(decayconst)));
88  ModelParamMap.insert(std::make_pair("FBsoFBd", std::cref(FBsoFBd)));
89  ModelParamMap.insert(std::make_pair("lambdaB", std::cref(lambdaM)));
90  return;
91  }
92  if (name.compare("B_S") == 0) {
93  ModelParamMap.insert(std::make_pair("MBs", std::cref(mass)));
94  ModelParamMap.insert(std::make_pair("tBs", std::cref(lifetime)));
95  ModelParamMap.insert(std::make_pair("FBs", std::cref(decayconst)));
96  ModelParamMap.insert(std::make_pair("lambdaB", std::cref(lambdaM)));
97  ModelParamMap.insert(std::make_pair("DGs_Gs", std::cref(Dgamma_gamma)));
98  return;
99  }
100  if (name.compare("B_C") == 0) {
101  ModelParamMap.insert(std::make_pair("MBc", std::cref(mass)));
102  ModelParamMap.insert(std::make_pair("tBc", std::cref(lifetime)));
103  ModelParamMap.insert(std::make_pair("FBc", std::cref(decayconst)));
104  return;
105  }
106  if (name.compare("PHI") == 0) {
107  ModelParamMap.insert(std::make_pair("Mphi", std::cref(mass)));
108  ModelParamMap.insert(std::make_pair("tphi", std::cref(lifetime)));
109  ModelParamMap.insert(std::make_pair("Fphi", std::cref(decayconst)));
110  ModelParamMap.insert(std::make_pair("Fphip", std::cref(decayconst_p)));
111  ModelParamMap.insert(std::make_pair("alpha2phi", std::cref(gegenalpha[1])));
112  return;
113  }
114  if (name.compare("K_star") == 0) {
115  ModelParamMap.insert(std::make_pair("MKstar", std::cref(mass)));
116  ModelParamMap.insert(std::make_pair("tKstar", std::cref(lifetime)));
117  ModelParamMap.insert(std::make_pair("FKstar", std::cref(decayconst)));
118  ModelParamMap.insert(std::make_pair("FKstarp", std::cref(decayconst_p)));
119  ModelParamMap.insert(std::make_pair("alpha1kst", std::cref(gegenalpha[0])));
120  ModelParamMap.insert(std::make_pair("alpha2kst", std::cref(gegenalpha[1])));
121  return;
122  }
123  if (name.compare("K_star_P") == 0) {
124  ModelParamMap.insert(std::make_pair("MKstarP", std::cref(mass)));
125  ModelParamMap.insert(std::make_pair("tKstarP", std::cref(lifetime)));
126  ModelParamMap.insert(std::make_pair("FKstar", std::cref(decayconst)));
127  ModelParamMap.insert(std::make_pair("FKstarp", std::cref(decayconst_p)));
128  ModelParamMap.insert(std::make_pair("alpha1kst", std::cref(gegenalpha[0])));
129  ModelParamMap.insert(std::make_pair("alpha2kst", std::cref(gegenalpha[1])));
130  return;
131  }
132  if (name.compare("D_star_P") == 0) {
133  ModelParamMap.insert(std::make_pair("MDstarP", std::cref(mass)));
134  ModelParamMap.insert(std::make_pair("tDstarP", std::cref(lifetime)));
135  ModelParamMap.insert(std::make_pair("FDstarP", std::cref(decayconst)));
136  return;
137  }
138  if (name.compare("RHO") == 0) {
139  ModelParamMap.insert(std::make_pair("Mrho", std::cref(mass)));
140  ModelParamMap.insert(std::make_pair("trho", std::cref(lifetime)));
141  ModelParamMap.insert(std::make_pair("Frho", std::cref(decayconst)));
142  return;
143  }
144  if (name.compare("RHO_P") == 0) {
145  ModelParamMap.insert(std::make_pair("MrhoP", std::cref(mass)));
146  ModelParamMap.insert(std::make_pair("trho", std::cref(lifetime)));
147  ModelParamMap.insert(std::make_pair("Frho", std::cref(decayconst)));
148  return;
149  }
150  if (name.compare("OMEGA") == 0) {
151  ModelParamMap.insert(std::make_pair("Momega", std::cref(mass)));
152  ModelParamMap.insert(std::make_pair("tomega", std::cref(lifetime)));
153  ModelParamMap.insert(std::make_pair("Fomega", std::cref(decayconst)));
154  return;
155  } else throw std::runtime_error(name + " is not implemented in Meson class");
156 }
157 
158 std::vector<std::string> Meson::parameterList(std::string name_i)
159 {
160  if (name_i.compare("P_0") == 0) return make_vector<std::string>() << "MP0" << "tP0" << "FP0";
161  if (name_i.compare("P_P") == 0) return make_vector<std::string>() << "MPp" << "tPp" << "FPp";
162  if (name_i.compare("K_0") == 0) return make_vector<std::string>() << "MK0" << "tKl" << "FK";
163  if (name_i.compare("K_P") == 0) return make_vector<std::string>() << "MKp" << "tKp" << "FK" << "alpha1kp" << "alpha2kp";
164  if (name_i.compare("D_0") == 0) return make_vector<std::string>() << "MD" << "tD" << "FD";
165  if (name_i.compare("D_P") == 0) return make_vector<std::string>() << "MDP" << "tDP" << "FDP";
166  if (name_i.compare("B_D") == 0) return make_vector<std::string>() << "MBd" << "tBd" << "FBsoFBd" << "lambdaB";
167  if (name_i.compare("B_P") == 0) return make_vector<std::string>() << "MBp" << "tBp" << "FBsoFBd" << "lambdaB";
168  if (name_i.compare("B_S") == 0) return make_vector<std::string>() << "MBs" << "tBs" << "FBs" << "lambdaB" << "DGs_Gs";
169  if (name_i.compare("B_C") == 0) return make_vector<std::string>() << "MBc" << "tBc" << "FBc";
170  if (name_i.compare("PHI") == 0) return make_vector<std::string>() << "Mphi" << "tphi" << "Fphi" << "Fphip" << "alpha2phi";
171  if (name_i.compare("K_star") == 0) return make_vector<std::string>() << "MKstar" << "tKstar" << "FKstar" << "FKstarp" << "alpha1kst" << "alpha2kst";
172  if (name_i.compare("K_star_P") == 0) return make_vector<std::string>() << "MKstarP" << "tKstar" << "FKstar" << "FKstarp" << "alpha1kst" << "alpha2kst";
173  if (name_i.compare("D_star_P") == 0) return make_vector<std::string>() << "MDstarP" << "tDstarP" << "FDstarP";
174  if (name_i.compare("RHO") == 0) return make_vector<std::string>() << "Mrho" << "trho" << "Frho";
175  if (name_i.compare("RHO_P") == 0) return make_vector<std::string>() << "MrhoP" << "trho" << "Frho";
176  if (name_i.compare("OMEGA") == 0) return make_vector<std::string>() << "Momega" << "tomega" << "Fomega";
177  else throw std::runtime_error(name_i + " is not implemented in Meson class");
178 }
179 
180 bool Meson::setParameter(std::string name_i, double value)
181 {
182  if (name.compare("P_0") == 0) {
183  if (name_i.compare("MP0") == 0) {
184  mass = value;
185  return true;
186  }
187  if (name_i.compare("tP0") == 0) {
188  lifetime = value;
189  return true;
190  }
191  if (name_i.compare("FP0") == 0) {
192  decayconst = value;
193  return true;
194  }
195  }
196  if (name.compare("P_P") == 0) {
197  if (name_i.compare("MPp") == 0) {
198  mass = value;
199  return true;
200  }
201  if (name_i.compare("tPp") == 0) {
202  lifetime = value;
203  return true;
204  }
205  if (name_i.compare("FPp") == 0) {
206  decayconst = value;
207  return true;
208  }
209  }
210  if (name.compare("K_0") == 0) {
211  if (name_i.compare("MK0") == 0) {
212  mass = value;
213  return true;
214  }
215  if (name_i.compare("tKl") == 0) {
216  lifetime = value;
217  return true;
218  }
219  if (name_i.compare("FK") == 0) {
220  decayconst = value;
221  return true;
222  }
223  }
224  if (name.compare("K_P") == 0) {
225  if (name_i.compare("MKp") == 0) {
226  mass = value;
227  return true;
228  }
229  if (name_i.compare("tKp") == 0) {
230  lifetime = value;
231  return true;
232  }
233  if (name_i.compare("FK") == 0) {
234  decayconst = value;
235  return true;
236  }
237  if (name_i.compare("alpha1kp") == 0) {
238  gegenalpha[0] = value;
239  return true;
240  }
241  if (name_i.compare("alpha2kp") == 0) {
242  gegenalpha[1] = value;
243  return true;
244  }
245  }
246  if (name.compare("D_0") == 0) {
247  if (name_i.compare("MD") == 0) {
248  mass = value;
249  return true;
250  }
251  if (name_i.compare("tD") == 0) {
252  lifetime = value;
253  return true;
254  }
255  if (name_i.compare("FD") == 0) {
256  decayconst = value;
257  return true;
258  }
259  }
260  if (name.compare("D_P") == 0) {
261  if (name_i.compare("MDP") == 0) {
262  mass = value;
263  return true;
264  }
265  if (name_i.compare("tDP") == 0) {
266  lifetime = value;
267  return true;
268  }
269  if (name_i.compare("FDP") == 0) {
270  decayconst = value;
271  return true;
272  }
273  }
274  if (name.compare("B_D") == 0) {
275  if (name_i.compare("MBd") == 0) {
276  mass = value;
277  return true;
278  }
279  if (name_i.compare("tBd") == 0) {
280  lifetime = value;
281  return true;
282  }
283  if (name_i.compare("FBsoFBd") == 0) {
284  FBsoFBd = value;
285  return true;
286  }
287  if (name_i.compare("lambdaB") == 0) {
288  lambdaM = value;
289  return true;
290  }
291  }
292  if (name.compare("B_P") == 0) {
293  if (name_i.compare("MBp") == 0) {
294  mass = value;
295  return true;
296  }
297  if (name_i.compare("tBp") == 0) {
298  lifetime = value;
299  return true;
300  }
301  if (name_i.compare("FBsoFBd") == 0) {
302  FBsoFBd = value;
303  return true;
304  }
305  if (name_i.compare("lambdaB") == 0) {
306  lambdaM = value;
307  return true;
308  }
309  }
310  if (name.compare("B_S") == 0) {
311  if (name_i.compare("MBs") == 0) {
312  mass = value;
313  return true;
314  }
315  if (name_i.compare("tBs") == 0) {
316  lifetime = value;
317  return true;
318  }
319  if (name_i.compare("FBs") == 0) {
320  decayconst = value;
321  return true;
322  }
323  if (name_i.compare("lambdaB") == 0) {
324  lambdaM = value;
325  return true;
326  }
327  if (name_i.compare("DGs_Gs") == 0) {
328  Dgamma_gamma = value;
329  return true;
330  }
331  }
332  if (name.compare("B_C") == 0) {
333  if (name_i.compare("MBc") == 0) {
334  mass = value;
335  return true;
336  }
337  if (name_i.compare("tBc") == 0) {
338  lifetime = value;
339  return true;
340  }
341  if (name_i.compare("FBc") == 0) {
342  decayconst = value;
343  return true;
344  }
345  }
346  if (name.compare("PHI") == 0) {
347  if (name_i.compare("Mphi") == 0) {
348  mass = value;
349  return true;
350  }
351  if (name_i.compare("tphi") == 0) {
352  lifetime = value;
353  return true;
354  }
355  if (name_i.compare("Fphi") == 0) {
356  decayconst = value;
357  return true;
358  }
359  if (name_i.compare("Fphip") == 0) {
360  decayconst_p = value;
361  return true;
362  }
363  if (name_i.compare("alpha2phi") == 0) {
364  gegenalpha[1] = value;
365  return true;
366  }
367  }
368  if (name.compare("K_star") == 0) {
369  if (name_i.compare("MKstar") == 0) {
370  mass = value;
371  return true;
372  }
373  if (name_i.compare("tKstar") == 0) {
374  lifetime = value;
375  return true;
376  }
377  if (name_i.compare("FKstar") == 0) {
378  decayconst = value;
379  return true;
380  }
381  if (name_i.compare("FKstarp") == 0) {
382  decayconst_p = value;
383  return true;
384  }
385  if (name_i.compare("alpha1kst") == 0) {
386  gegenalpha[0] = value;
387  return true;
388  }
389  if (name_i.compare("alpha2kst") == 0) {
390  gegenalpha[1] = value;
391  return true;
392  }
393  }
394  if (name.compare("K_star_P") == 0) {
395  if (name_i.compare("MKstarP") == 0) {
396  mass = value;
397  return true;
398  }
399  if (name_i.compare("tKstar") == 0) {
400  lifetime = value;
401  return true;
402  }
403  if (name_i.compare("FKstar") == 0) {
404  decayconst = value;
405  return true;
406  }
407  if (name_i.compare("FKstarp") == 0) {
408  decayconst_p = value;
409  return true;
410  }
411  if (name_i.compare("alpha1kst") == 0) {
412  gegenalpha[0] = value;
413  return true;
414  }
415  if (name_i.compare("alpha2kst") == 0) {
416  gegenalpha[1] = value;
417  return true;
418  }
419  }
420  if (name.compare("D_star_P") == 0) {
421  if (name_i.compare("MDstarP") == 0) {
422  mass = value;
423  return true;
424  }
425  if (name_i.compare("tDstarP") == 0) {
426  lifetime = value;
427  return true;
428  }
429  if (name_i.compare("FDstarP") == 0) {
430  decayconst = value;
431  return true;
432  }
433  }
434  if (name.compare("RHO") == 0) {
435  if (name_i.compare("Mrho") == 0) {
436  mass = value;
437  return true;
438  }
439  if (name_i.compare("trho") == 0) {
440  lifetime = value;
441  return true;
442  }
443  if (name_i.compare("Frho") == 0) {
444  decayconst = value;
445  return true;
446  }
447  }
448  if (name.compare("RHO_P") == 0) {
449  if (name_i.compare("MrhoP") == 0) {
450  mass = value;
451  return true;
452  }
453  if (name_i.compare("trho") == 0) {
454  lifetime = value;
455  return true;
456  }
457  if (name_i.compare("Frho") == 0) {
458  decayconst = value;
459  return true;
460  }
461  }
462  if (name.compare("OMEGA") == 0) {
463  if (name_i.compare("Momega") == 0) {
464  mass = value;
465  return true;
466  }
467  if (name_i.compare("tomega") == 0) {
468  lifetime = value;
469  return true;
470  }
471  if (name_i.compare("Fomega") == 0) {
472  decayconst = value;
473  return true;
474  }
475  }
476  return false;
477 }
478 
479 double Meson::computeWidth() const
480 {
481  return (HCUT / lifetime);
482 }
std_make_vector.h
Meson::decayconst
double decayconst
The decay constant of the meson.
Definition: Meson.h:440
Meson::decayconst_p
double decayconst_p
The perpendicular decay constant of a vector meson.
Definition: Meson.h:441
Meson::FBsoFBd
double FBsoFBd
Definition: Meson.h:446
make_vector
Definition: std_make_vector.h:15
Meson::computeWidth
double computeWidth() const
A method to compute the width of the meson from its lifetime.
Definition: Meson.cpp:479
Particle::name
std::string name
The particle name.
Definition: Particle.h:171
Meson::gegenalpha
double gegenalpha[2]
Gegenbauer moments.
Definition: Meson.h:443
Meson::~Meson
virtual ~Meson()
The default destructor.
Definition: Meson.cpp:33
Meson::setParameter
bool setParameter(std::string name_i, double value)
Definition: Meson.cpp:180
Meson::parameterList
std::vector< std::string > parameterList(std::string name_i)
Definition: Meson.cpp:158
Meson::lifetime
double lifetime
The lifetime of the meson.
Definition: Meson.h:442
Meson::Meson
Meson()
The default constructor.
Definition: Meson.cpp:22
Meson.h
Particle::mass
double mass
The particle mass in GeV.
Definition: Particle.h:166
Meson::Dgamma_gamma
double Dgamma_gamma
Dgamma/gamma for neutral mesons.
Definition: Meson.h:445
Meson::ModelParameterMapInsert
void ModelParameterMapInsert(std::map< std::string, std::reference_wrapper< const double > > &ModelParamMap)
Definition: Meson.cpp:36
Meson::lambdaM
double lambdaM
First moment of LCDA.
Definition: Meson.h:444