This class represents quantum numbers of a theory, like for example baryon number B, lepton number L etc. More...
#include <quantumNumber.h>
Public Types | |
| using | ID = unsigned short |
| Integer type for QuantumNumber id. | |
| using | Value = int |
| Integer type for quantum number value. | |
Public Member Functions | |
| QuantumNumber (std::string const &t_name, bool t_conserved=true) | |
| Constructor with 2 parameters. More... | |
| QuantumNumber (QuantumNumber const &)=default | |
| Defaulted copy constructor. | |
| QuantumNumber & | operator= (QuantumNumber const &)=default |
| Defaulted copy assignement operator. | |
| ~QuantumNumber () | |
| Destructor. | |
| bool | isConserved () const |
| Returns the conservation property of the quantum number. More... | |
| std::string | getName () const |
| Returns the name of the quantum number. More... | |
| void | setConservedProperty (bool t_conserved) |
| Sets the conserved property of the quantum number. More... | |
| void | setName (std::string const &t_name) |
| Sets the name of the quantum number. More... | |
| bool | appearsIn (std::vector< mty::QuantumField > const &fields) const |
| Tells if one of the fields has a non trivial value for the quantum number. More... | |
| int | computeQuantumNumber (std::vector< mty::QuantumField > const &field) const |
| Calculates the value of the total quantum numbers carried by a list of fields. More... | |
| ID | getID () const |
| Returns the id of the quantum number. More... | |
| bool | operator== (QuantumNumber const &other) const |
| Compares the ids of two quantum numbers. More... | |
| bool | operator!= (QuantumNumber const &other) const |
| Compares the ids of two quantum numbers. More... | |
Static Private Member Functions | |
| static std::map< ID, std::string > & | name () |
| Returns the map between ids and names for quantumNumbers. More... | |
Private Attributes | |
| bool | conserved |
| Tells if the quantum number is conserved. More... | |
| ID | id |
| ID of the quantum number. | |
Static Private Attributes | |
| static ID | current_id = 0 |
| Current id of QuantumNumber. More... | |
This class represents quantum numbers of a theory, like for example baryon number B, lepton number L etc.
When doing a calculation, you may give a list of independant quantum numbers (like B and L in the SM) to be conserved. This will not change the result but will allow MARTY to discard early diagrams that are zero. You must not give non-independant quantum numbers like F (fermion number) and B. If so, MARTY will discard diagrams that are actually possible because some particles (quarks in this example) may contribute in both numbers.
|
explicit |
Constructor with 2 parameters.
Initliazes the name, and possible the conserved property of the quantum number.
| t_name | Name. |
| t_conserved | Boolean that tells if the quantum number is conserved (default = true). |
| bool mty::QuantumNumber::appearsIn | ( | std::vector< mty::QuantumField > const & | fields | ) | const |
Tells if one of the fields has a non trivial value for the quantum number.
| fields | List of fields. |
| int mty::QuantumNumber::computeQuantumNumber | ( | std::vector< mty::QuantumField > const & | field | ) | const |
Calculates the value of the total quantum numbers carried by a list of fields.
For example, qqq has baryonic number B = 1, leptonic number L = 0, fermionic number F = 3.
| fields | List of fields |
|
inline |
Returns the id of the quantum number.
| std::string mty::QuantumNumber::getName | ( | ) | const |
Returns the name of the quantum number.
The name is not stored directly in the quantum number. Instead, the id is the key to get it. This function then determines the name corresponding to the quantum number's id, and returns it.
| bool mty::QuantumNumber::isConserved | ( | ) | const |
Returns the conservation property of the quantum number.
|
inlinestaticprivate |
Returns the map between ids and names for quantumNumbers.
This function allocates statically a map between IDs and names, and returns a reference to it.
|
inline |
Compares the ids of two quantum numbers.
|
inline |
Compares the ids of two quantum numbers.
| void mty::QuantumNumber::setConservedProperty | ( | bool | t_conserved | ) |
Sets the conserved property of the quantum number.
| t_conserved | Boolean. If true, the quantum number is conserved and may be used to simplify calculations. |
| void mty::QuantumNumber::setName | ( | std::string const & | t_name | ) |
Sets the name of the quantum number.
| t_name | New name of the quantum number. |
|
private |
Tells if the quantum number is conserved.
True by default. If false, the quantum number has no impact on any calculation.
|
inlinestaticprivate |
Current id of QuantumNumber.
This is used to define the id of new quantum numbers. Each time, this variable is incremented.
1.8.13