21 #ifndef QUANTUM_NUMBER_H_INCLUDED 22 #define QUANTUM_NUMBER_H_INCLUDED 51 using ID =
unsigned short;
86 static inline std::map<ID, std::string>&
name() {
87 static std::map<ID, std::string> m;
104 bool t_conserved =
true);
146 void setName(std::string
const& t_name);
156 bool appearsIn(std::vector<mty::QuantumField>
const& fields)
const;
183 return id == other.
id;
193 return id != other.
id;
ID id
ID of the quantum number.
Definition: quantumNumber.h:76
bool operator==(QuantumNumber const &other) const
Compares the ids of two quantum numbers.
Definition: quantumNumber.h:182
bool conserved
Tells if the quantum number is conserved.
Definition: quantumNumber.h:71
bool operator!=(QuantumNumber const &other) const
Compares the ids of two quantum numbers.
Definition: quantumNumber.h:192
bool appearsIn(std::vector< mty::QuantumField > const &fields) const
Tells if one of the fields has a non trivial value for the quantum number.
Definition: quantumNumber.cpp:54
bool isConserved() const
Returns the conservation property of the quantum number.
Definition: quantumNumber.cpp:34
Namespace of MARTY.
Definition: 2HDM.h:31
static ID current_id
Current id of QuantumNumber.
Definition: quantumNumber.h:64
This class represents quantum numbers of a theory, like for example baryon number B...
Definition: quantumNumber.h:44
int computeQuantumNumber(std::vector< mty::QuantumField > const &field) const
Calculates the value of the total quantum numbers carried by a list of fields.
Definition: quantumNumber.cpp:63
~QuantumNumber()
Destructor.
Definition: quantumNumber.cpp:29
ID getID() const
Returns the id of the quantum number.
Definition: quantumNumber.h:172
void setConservedProperty(bool t_conserved)
Sets the conserved property of the quantum number.
Definition: quantumNumber.cpp:44
int Value
Integer type for quantum number value.
Definition: quantumNumber.h:55
unsigned short ID
Integer type for QuantumNumber id.
Definition: quantumNumber.h:51
QuantumNumber & operator=(QuantumNumber const &)=default
Defaulted copy assignement operator.
void setName(std::string const &t_name)
Sets the name of the quantum number.
Definition: quantumNumber.cpp:49
std::string getName() const
Returns the name of the quantum number.
Definition: quantumNumber.cpp:39
QuantumNumber(std::string const &t_name, bool t_conserved=true)
Constructor with 2 parameters.
Definition: quantumNumber.cpp:21
static std::map< ID, std::string > & name()
Returns the map between ids and names for quantumNumbers.
Definition: quantumNumber.h:86