1#ifndef __JPHYSICS__JCHARGES__
2#define __JPHYSICS__JCHARGES__
62 template<
typename T, std::enable_if_t<std::is_
integral_v<T>,
bool> = true>
65 const int Qabs = std::abs(
charge);
80 template<
typename T, std::enable_if_t<std::is_
floating_po
int_v<T>,
bool> = true>
83 static const double epsilon = 1e-3;
85 const double Q =
charge * 3.0;
86 const int q = std::round(Q);
88 if (fabs(Q - q) > epsilon) {
101 inline explicit operator int()
const
112 inline operator double()
const
114 return static_cast<double>(
static_cast<int>(this->
charge)) / 3.0;
160 template<
typename T, std::enable_if_t<std::is_
integral_v<T>,
bool> = true>
163 const int Yabs = std::abs(
Yw);
178 template<
typename T, std::enable_if_t<std::is_
floating_po
int_v<T>,
bool> = true>
181 static const double epsilon = 1e-3;
183 const double Y =
Yw * 3.0;
184 const int y = std::round(Y);
186 if (fabs(Y - y) > epsilon) {
199 inline explicit operator int()
const
210 inline operator double()
const
212 return static_cast<double>(
static_cast<int>(this->
Yw)) / 3.0;
252 template<
typename T, std::enable_if_t<std::is_
integral_v<T>,
bool> = true>
255 const int I3abs = std::abs(
I3);
260 THROW(
JValueOutOfRange,
"JWeakIsospinProjection::JWeakIsospinProjection(): Invalid weak isospin projection " <<
I3 <<
" [1/2]");
270 template<
typename T, std::enable_if_t<std::is_
floating_po
int_v<T>,
bool> = true>
273 static const double epsilon = 1e-3;
275 const double I =
I3 * 2.0;
276 const int i = std::round(I);
278 if (fabs(I - i) > epsilon) {
279 THROW(
JValueOutOfRange,
"JWeakIsospinProjection::JWeakIsospinProjection(): Invalid weak isospin projection " <<
I3);
291 inline explicit operator int()
const
302 inline operator double()
const
304 return static_cast<double>(
static_cast<int>(
I3)) / 2.0;
342 template<
typename T, std::enable_if_t<std::is_
integral_v<T>,
bool> = true>
362 inline operator int()
const
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.
Exception for accessing a value in a collection that is outside of its range.
Auxiliary methods for light properties of deep-sea water.
JColorFactor_t
Enumeration for color factors of SM fields.
JColorCharge_t
Enumeration for color charges of SM fields.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
Auxiliary class for color factors of SM fields.
JColorFactor(const JColorFactor_t &C)
Constructor.
JColorFactor(const T C)
Constructor.
JColorFactor_t
Enumeration of SM field color factors.
@ ONE
leptons, weak bosons, photon
JColorFactor_t C
Color factor.
Auxiliary class for electric charges of SM fields.
JElectricCharge_t charge
Electric charge.
JElectricCharge_t
Enumeration of SM field electric charges in units [e/3].
JElectricCharge(const T charge)
Constructor.
JElectricCharge(const JElectricCharge_t &charge)
Constructor.
Auxiliary class for weak hypercharges of SM fields.
JWeakHyperCharge_t Yw
Weak hypercharge.
JWeakHyperCharge(const JWeakHyperCharge_t &Yw)
Constructor.
JWeakHyperCharge_t
Enumeration of SM field weak hypercharges in units [1/3].
JWeakHyperCharge(const T Yw)
Constructor.
Auxiliary class for weak isospin projections of SM fields.
JWeakIsospinProjection(const JWeakIsospinProjection_t &I3)
Constructor.
JWeakIsospinProjection_t
Enumeration of SM field weak isospin projections in units [1/2].
@ PLUS_TWO
W^+ boson weak isospin projection.
@ MINUS_TWO
W^- boson weak isospin projection.
JWeakIsospinProjection(const T I3)
Constructor.
JWeakIsospinProjection_t I3
Weak isospin projection.