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

Auxiliary class for weak isospin projections of SM fields. More...

#include <JCharges.hh>

Public Types

enum  JWeakIsospinProjection_t {
  MINUS_TWO = -2 , MINUS_ONE = -1 , ZERO = 0 , PLUS_ONE = +1 ,
  PLUS_TWO = +2
}
 Enumeration of SM field weak isospin projections in units [1/2]. More...
 

Public Member Functions

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

Public Attributes

JWeakIsospinProjection_t I3
 Weak isospin projection.
 

Detailed Description

Auxiliary class for weak isospin projections of SM fields.

Definition at line 223 of file JCharges.hh.

Member Enumeration Documentation

◆ JWeakIsospinProjection_t

Enumeration of SM field weak isospin projections in units [1/2].

Enumerator
MINUS_TWO 

W^- boson weak isospin projection.

MINUS_ONE 
ZERO 
PLUS_ONE 
PLUS_TWO 

W^+ boson weak isospin projection.

Definition at line 228 of file JCharges.hh.

228 {
229 MINUS_TWO = -2, //!< W^- boson weak isospin projection
230 MINUS_ONE = -1,
231 ZERO = 0,
232 PLUS_ONE = +1,
233 PLUS_TWO = +2 //!< W^+ boson weak isospin projection
234 };
@ PLUS_TWO
W^+ boson weak isospin projection.
Definition JCharges.hh:233
@ MINUS_TWO
W^- boson weak isospin projection.
Definition JCharges.hh:229

Constructor & Destructor Documentation

◆ JWeakIsospinProjection() [1/3]

JPHYSICS::JWeakIsospinProjection::JWeakIsospinProjection ( const JWeakIsospinProjection_t & I3)
inline

Constructor.

Parameters
I3weak isospin projection [1/2]

Definition at line 242 of file JCharges.hh.

242 :
243 I3(I3)
244 {}
JWeakIsospinProjection_t I3
Weak isospin projection.
Definition JCharges.hh:308

◆ JWeakIsospinProjection() [2/3]

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

Constructor.

Parameters
I3weak isospin projection [1/2]

Definition at line 253 of file JCharges.hh.

254 {
255 const int I3abs = std::abs(I3);
256
257 if (I3abs <= (int) PLUS_TWO) {
258 this->I3 = static_cast<JWeakIsospinProjection_t>(I3);
259 } else {
260 THROW(JValueOutOfRange, "JWeakIsospinProjection::JWeakIsospinProjection(): Invalid weak isospin projection " << I3 << " [1/2]");
261 }
262 }
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.
JWeakIsospinProjection_t
Enumeration of SM field weak isospin projections in units [1/2].
Definition JCharges.hh:228

◆ JWeakIsospinProjection() [3/3]

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

Constructor.

Parameters
I3weak isospin projection

Definition at line 271 of file JCharges.hh.

272 {
273 static const double epsilon = 1e-3;
274
275 const double I = I3 * 2.0;
276 const int i = std::round(I);
277
278 if (fabs(I - i) > epsilon) {
279 THROW(JValueOutOfRange, "JWeakIsospinProjection::JWeakIsospinProjection(): Invalid weak isospin projection " << I3);
280 }
281
282 *this = JWeakIsospinProjection(i);
283 }
JWeakIsospinProjection(const JWeakIsospinProjection_t &I3)
Constructor.
Definition JCharges.hh:242

Member Function Documentation

◆ operator int()

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

Conversion operator.

Returns
weak isospin projection

Definition at line 291 of file JCharges.hh.

292 {
293 return this->I3;
294 }

◆ operator double()

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

Conversion operator.

Returns
weak isospin projection

Definition at line 302 of file JCharges.hh.

303 {
304 return static_cast<double>(static_cast<int>(I3)) / 2.0;
305 }

Member Data Documentation

◆ I3

JWeakIsospinProjection_t JPHYSICS::JWeakIsospinProjection::I3

Weak isospin projection.

Definition at line 308 of file JCharges.hh.


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