|
|
|||
File indexing completed on 2026-06-02 08:51:43
0001 #ifndef QUARK_NON_SINGLET_COMBINATION_H 0002 #define QUARK_NON_SINGLET_COMBINATION_H 0003 0004 /** 0005 * @file QuarkNonSingletCombination.h 0006 * @author Pawel Sznajder (NCBJ, Warsaw) 0007 * @date 06 July 2017 0008 * @version 1.0 0009 */ 0010 0011 #include <string> 0012 0013 namespace PARTONS { 0014 0015 /** 0016 * @class QuarkNonSingletCombination 0017 * 0018 * @brief Definition of enumeration values for quark non-singlet combinations. 0019 * 0020 * This class defines a set of enumeration values that are used to distinguish between quark non-singlet combinations. In addition, a declared object of this class is always associated to one quark flavor combination type (see QuarkNonSingletCombination::m_type), so member functions can act on it. E.g. 0021 \code{.cpp} 0022 //this is single enum variable - nothing to play with 0023 QuarkNonSingletCombination::Type enum_variable = QuarkNonSingletCombination::UP_NONSINGLET; 0024 0025 //this is declared object 0026 QuarkNonSingletCombination enum_object; 0027 0028 //let us assign some type (default is QuarkNonSingletCombination::UNDEFINED) 0029 enum_object.setType(enum_variable); 0030 0031 //with objects you can use available functions, e.g. you can represent enumeration type by a corresponding string 0032 std::string enum_string_1 = enum_object.toString(); 0033 0034 //you can achieve some basic operations without the explicit declaration of objects by using the assignment constructor 0035 std::string enum_string_2 = QuarkNonSingletCombination(QuarkNonSingletCombination::DOWN_NONSINGLET).toString(); 0036 0037 Partons::getInstance()->getLoggerManager()->info("example", __func__, ElemUtils::Formatter() << "Quark non-singlet combination is: " << enum_string_1); 0038 Partons::getInstance()->getLoggerManager()->info("example", __func__, ElemUtils::Formatter() << "Quark non-singlet combination is: " << enum_string_2); 0039 \endcode 0040 which gives via Logger: 0041 \code 0042 20-05-2017 12:09:19 [INFO] (example::main) Quark non-singlet combination is: UP_NONSINGLET 0043 20-05-2017 12:09:19 [INFO] (example::main) Quark non-singlet combination is: DOWN_NONSINGLET 0044 \endcode 0045 */ 0046 class QuarkNonSingletCombination { 0047 0048 public: 0049 0050 /** 0051 * Definition of enumerate values corresponding to quark flavors. 0052 */ 0053 enum Type { 0054 UNDEFINED = 0, //!< Undefined type. 0055 UP_NONSINGLET = 1, //!< Non-singlet combination for quark flavor u. 0056 DOWN_NONSINGLET = 2, //!< Non-singlet combination for quark flavor d. 0057 STRANGE_NONSINGLET = 3, //!< Non-singlet combination for quark flavor s. 0058 CHARM_NONSINGLET = 4, //!< Non-singlet combination for quark flavor c. 0059 BOTTOM_NONSINGLET = 5, //!< Non-singlet combination for quark flavor b. 0060 TOP_NONSINGLET = 6, //!< Non-singlet combination for quark flavor t. 0061 UP_MINUS_DOWN = 7, //!< GPD u minus GPD d. 0062 UP_MINUS_STRANGE = 8, //!< GPD u minus GPD s. 0063 UP_MINUS_CHARM = 9, //!< GPD u minus GPD c. 0064 UP_MINUS_BOTTOM = 10, //!< GPD u minus GPD b. 0065 UP_MINUS_TOP = 11 //!< GPD u minus GPD t. 0066 }; 0067 0068 /** 0069 * Default constructor. 0070 */ 0071 QuarkNonSingletCombination(); 0072 0073 /** 0074 * Copy constructor. 0075 * @param other Object to be copied. 0076 */ 0077 QuarkNonSingletCombination(const QuarkNonSingletCombination &other); 0078 0079 /** 0080 * Assignment constructor. 0081 * @param type Type to be assigned. 0082 */ 0083 QuarkNonSingletCombination(Type type); 0084 0085 /** 0086 * Destructor. 0087 */ 0088 virtual ~QuarkNonSingletCombination(); 0089 0090 /** 0091 * Automatic cast to enum. 0092 */ 0093 operator Type() const; 0094 0095 /** 0096 * Get string representation of type being assigned to a declared object of this class. 0097 * @return String representation of assigned type, like "UP" for QuarkNonSingletCombination::UP. 0098 */ 0099 std::string toString() const; 0100 0101 //******************************************************** 0102 //*** SETTERS AND GETTERS ******************************** 0103 //******************************************************** 0104 0105 /** 0106 * Get type being assigned to a declared object of this class. 0107 */ 0108 QuarkNonSingletCombination::Type getType() const; 0109 0110 /** 0111 * Assign type to a declared object of this class. 0112 */ 0113 void setType(Type type); 0114 0115 private: 0116 0117 /** 0118 * Type associated to a declared object of this class. 0119 */ 0120 QuarkNonSingletCombination::Type m_type; 0121 }; 0122 0123 } /* namespace PARTONS */ 0124 0125 #endif /* QUARK_NON_SINGLET_COMBINATION_H */
| [ Source navigation ] | [ Diff markup ] | [ Identifier search ] | [ general search ] |
|
This page was automatically generated by the 2.3.7 LXR engine. The LXR team |
|