master
a Code for the Combination of Indirect and Direct Constraints on High Energy Physics Models
Particle.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 <string>
9
10
#include "
Particle.h
"
11
12
Particle::Particle
(std::string name,
double
mass,
double
mass_scale,
double
width,
double
charge,
double
isospin)
13
{
14
this->name =
name
;
15
this->mass =
mass
;
16
this->width =
width
;
17
this->charge =
charge
;
18
this->isospin =
isospin
;
19
this->mass_scale =
mass_scale
;
20
setIndex
();
21
}
22
23
bool
Particle::is
(std::string name_i)
const
24
{
25
if
(name_i.compare(
"LEPTON"
) == 0) {
26
if
(
index
>= 0 &&
index
<= 5)
27
return
true
;
28
else
29
return
false
;
30
}
31
if
(name_i.compare(
"QUARK"
) == 0) {
32
if
(
index
>= 6 &&
index
<= 11)
33
return
true
;
34
else
35
return
false
;
36
}
37
return
(
name
.compare(name_i) == 0);
38
}
39
40
void
Particle::setIndex
()
41
{
42
if
(
name
.compare(
"NEUTRINO_1"
) == 0)
43
index
= 0;
44
else
if
(
name
.compare(
"NEUTRINO_2"
) == 0)
45
index
= 2;
46
else
if
(
name
.compare(
"NEUTRINO_3"
) == 0)
47
index
= 4;
48
else
if
(
name
.compare(
"ELECTRON"
) == 0)
49
index
= 1;
50
else
if
(
name
.compare(
"MU"
) == 0)
51
index
= 3;
52
else
if
(
name
.compare(
"TAU"
) == 0)
53
index
= 5;
54
else
if
(
name
.compare(
"UP"
) == 0)
55
index
= 6;
56
else
if
(
name
.compare(
"CHARM"
) == 0)
57
index
= 8;
58
else
if
(
name
.compare(
"TOP"
) == 0)
59
index
= 10;
60
else
if
(
name
.compare(
"DOWN"
) == 0)
61
index
= 7;
62
else
if
(
name
.compare(
"STRANGE"
) == 0)
63
index
= 9;
64
else
if
(
name
.compare(
"BOTTOM"
) == 0)
65
index
= 11;
66
else
67
index
= -1;
68
}
Particle.h
Particle::is
bool is(std::string name_i) const
Definition:
Particle.cpp:23
Particle::name
std::string name
The particle name.
Definition:
Particle.h:171
Particle::setIndex
void setIndex()
Definition:
Particle.cpp:40
Particle::isospin
double isospin
The particle isospin.
Definition:
Particle.h:170
Particle::Particle
Particle()
The default constructor.
Definition:
Particle.h:33
Particle::charge
double charge
The particle charge.
Definition:
Particle.h:168
Particle::width
double width
The particle width in GeV.
Definition:
Particle.h:167
Particle::mass_scale
double mass_scale
The scale in GeV at which the particle mass is defined.
Definition:
Particle.h:169
Particle::mass
double mass
The particle mass in GeV.
Definition:
Particle.h:166
Particle::index
int index
The index of the particle.
Definition:
Particle.h:172
StandardModel
src
Particle.cpp
Generated on Mon Aug 4 2025 for $\texttt{HEPfit}$ using
1.9.2