Jpp 21.0.0
the software that should make you happy
Loading...
Searching...
No Matches
JPHYSICS::JWeakHyperCharge Struct Reference

Auxiliary class for weak hypercharges of SM fields. More...

#include <JCharges.hh>

Public Types

enum  JWeakHyperCharge_t {
  MINUS_SIX = -6 , MINUS_FOUR = -4 , MINUS_THREE = -3 , MINUS_TWO = -2 ,
  MINUS_ONE = -1 , ZERO = 0 , PLUS_ONE = +1 , PLUS_TWO = +2 ,
  PLUS_THREE = +3 , PLUS_FOUR = +4 , PLUS_SIX = +6
}
 Enumeration of SM field weak hypercharges in units [1/3]. More...
 

Public Member Functions

 JWeakHyperCharge (const JWeakHyperCharge_t &Yw)
 Constructor.
 
template<typename T , std::enable_if_t< std::is_integral_v< T >, bool > = true>
 JWeakHyperCharge (const T Yw)
 Constructor.
 
template<typename T , std::enable_if_t< std::is_floating_point_v< T >, bool > = true>
 JWeakHyperCharge (const T Yw)
 Constructor.
 
 operator int () const
 Conversion operator.
 
 operator double () const
 Conversion operator.
 

Public Attributes

JWeakHyperCharge_t Yw
 Weak hypercharge.
 

Detailed Description

Auxiliary class for weak hypercharges of SM fields.

Definition at line 125 of file JCharges.hh.

Member Enumeration Documentation

◆ JWeakHyperCharge_t

Enumeration of SM field weak hypercharges in units [1/3].

Enumerator
MINUS_SIX 
MINUS_FOUR 
MINUS_THREE 
MINUS_TWO 
MINUS_ONE 
ZERO 
PLUS_ONE 
PLUS_TWO 
PLUS_THREE 
PLUS_FOUR 
PLUS_SIX 

Definition at line 130 of file JCharges.hh.

130 {
131 MINUS_SIX = -6, // right-chiral leptons
132 MINUS_FOUR = -4, // right-chiral up-type anti-quarks
133 MINUS_THREE = -3, // neutrinos and left-chiral leptons
134 MINUS_TWO = -2, // right-chiral down-type quarks
135 MINUS_ONE = -1, // left-chiral anti-quarks
136 ZERO = 0, // photon, gluon, weak bosons
137 PLUS_ONE = +1, // left-chiral quarks
138 PLUS_TWO = +2, // right-chiral anti-type anti-quarks
139 PLUS_THREE = +3, // left-chiral anti-leptons, Higgs boson
140 PLUS_FOUR = +4, // right-chiral up-type quarks
141 PLUS_SIX = +6, // right-chiral anti-leptons
142 };

Constructor & Destructor Documentation

◆ JWeakHyperCharge() [1/3]

JPHYSICS::JWeakHyperCharge::JWeakHyperCharge ( const JWeakHyperCharge_t & Yw)
inline

Constructor.

Parameters
Ywweak hypercharge [1/3]

Definition at line 150 of file JCharges.hh.

150 :
151 Yw(Yw)
152 {}
JWeakHyperCharge_t Yw
Weak hypercharge.
Definition JCharges.hh:216

◆ JWeakHyperCharge() [2/3]

template<typename T , std::enable_if_t< std::is_integral_v< T >, bool > = true>
JPHYSICS::JWeakHyperCharge::JWeakHyperCharge ( const T Yw)
inline

Constructor.

Parameters
Ywweak hypercharge [1/3]

Definition at line 161 of file JCharges.hh.

162 {
163 const int Yabs = std::abs(Yw);
164
165 if (Yabs <= (int) PLUS_FOUR || Yabs == (int) PLUS_SIX) {
166 this->Yw = static_cast<JWeakHyperCharge_t>(Yw);
167 } else {
168 THROW(JValueOutOfRange, "JWeakHyperCharge::JWeakHyperCharge(): Invalid weak hypercharge " << Yw << " [1/3]");
169 }
170 }
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.
JWeakHyperCharge_t
Enumeration of SM field weak hypercharges in units [1/3].
Definition JCharges.hh:130

◆ JWeakHyperCharge() [3/3]

template<typename T , std::enable_if_t< std::is_floating_point_v< T >, bool > = true>
JPHYSICS::JWeakHyperCharge::JWeakHyperCharge ( const T Yw)
inline

Constructor.

Parameters
Ywweak hypercharge

Definition at line 179 of file JCharges.hh.

180 {
181 static const double epsilon = 1e-3;
182
183 const double Y = Yw * 3.0;
184 const int y = std::round(Y);
185
186 if (fabs(Y - y) > epsilon) {
187 THROW(JValueOutOfRange, "JWeakHyperCharge::JWeakHyperCharge(): Invalid weak hypercharge " << Yw);
188 }
189
190 *this = JWeakHyperCharge(y);
191 }
JWeakHyperCharge(const JWeakHyperCharge_t &Yw)
Constructor.
Definition JCharges.hh:150

Member Function Documentation

◆ operator int()

JPHYSICS::JWeakHyperCharge::operator int ( ) const
inlineexplicit

Conversion operator.

Returns
weak hypercharge [1/3]

Definition at line 199 of file JCharges.hh.

200 {
201 return this->Yw;
202 }

◆ operator double()

JPHYSICS::JWeakHyperCharge::operator double ( ) const
inline

Conversion operator.

Returns
weak hypercharge

Definition at line 210 of file JCharges.hh.

211 {
212 return static_cast<double>(static_cast<int>(this->Yw)) / 3.0;
213 }

Member Data Documentation

◆ Yw

JWeakHyperCharge_t JPHYSICS::JWeakHyperCharge::Yw

Weak hypercharge.

Definition at line 216 of file JCharges.hh.


The documentation for this struct was generated from the following file: