Newer
Older
#include "Particle/Particle.hh"
#include <iostream>
#include <string>
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
Particle::Particle(ParticleData& data)
{
pdata = &data;
}
Particle::Particle(Particle& other)
{
pdata = other.data();
}
Particle::~Particle()
{
}
const std::string& Particle::name()
{
if (0 != pdata)
return pdata->name;
else {
std::cerr << "Error::Particle: accessing uninitialized data" << std::endl;
exit(1);
}
}
const std::string& Particle::texName()
{
if (0 != pdata)
return pdata->texName;
else {
std::cerr << "Error::Particle: accessing uninitialized data" << std::endl;
exit(1);
}
}
ParticleType Particle::type()
{
if (0 != pdata)
return pdata->type;
else {
std::cerr << "Error::Particle: accessing uninitialized data" << std::endl;
exit(1);
}
}
int Particle::charge()
{
if (0 != pdata)
return pdata->charge;
else {
std::cerr << "Error::Particle: accessing uninitialized data" << std::endl;
exit(1);
}
return 0;
}
double Particle::mass()
{
if (0 != pdata)
return pdata->mass;
else {
std::cerr << "Error::Particle: accessing uninitialized data" << std::endl;
exit(1);
}
return 0.;
}
double Particle::width()
{
if (0 != pdata)
return pdata->width;
else {
std::cerr << "Error::Particle: accessing uninitialized data" << std::endl;
exit(1);
}
return 0.;
}
int Particle::twoJ()
{
if (0 != pdata)
return pdata->twoJ;
else {
std::cerr << "Error::Particle: accessing uninitialized data" << std::endl;
exit(1);
}
return 0;
}
double Particle::J()
{
if (0 != pdata)
return double(pdata->twoJ)/2.;
else {
std::cerr << "Error::Particle: accessing uninitialized data" << std::endl;
exit(1);
}
return 0.;
}
Parity& Particle::parity()
{
if (0 != pdata)
return pdata->parity;
else {
std::cerr << "Error::Particle: accessing uninitialized data" << std::endl;
exit(1);
}
}
Parity& Particle::chargeParity()
{
if (0 != pdata)
return pdata->chargeParity;
else {
std::cerr << "Error::Particle: accessing uninitialized data" << std::endl;
exit(1);
}
}
Parity& Particle::gParity()
{
if (0 != pdata)
return pdata->gParity;
else {
std::cerr << "Error::Particle: accessing uninitialized data" << std::endl;
exit(1);
}
}
int Particle::iso()
{
if (0 != pdata)
return pdata->iso;
else {
std::cerr << "Error::Particle: accessing uninitialized data" << std::endl;
exit(1);
}
}
int Particle::iso3()
{
if (0 != pdata)
return pdata->isoThree;
else {
std::cerr << "Error::Particle: accessing uninitialized data" << std::endl;
exit(1);
}
}
int Particle::strange()
{
if (0 != pdata)
return pdata->strange;
else {
std::cerr << "Error::Particle: accessing uninitialized data" << std::endl;
exit(1);
}
}
int Particle::charm()
{
if (0 != pdata)
return pdata->charm;
else {
std::cerr << "Error::Particle: accessing uninitialized data" << std::endl;
exit(1);
}
}
ParticleData* Particle::data()
{
return pdata;
}
void Particle::print(std::ostream& out)
{
out << name() << "\tmass=" << mass() << "\twidth=" << width() << "\t3*q=" << charge()
<< "\t2*J=" << twoJ() << "\tP=" << parity().parity() << "\tC=" << chargeParity().parity()
<< "\tG=" << gParity().parity() << "\tI=" << iso() << "\tI3=" << iso3()
<< "\tcharm=" << charm() << "\tstrange=" << strange() << std::endl;
return;
}
Particle::Particle()
{
}