Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-06-02 08:51:43

0001 #ifndef MESON_TYPE_H
0002 #define MESON_TYPE_H
0003 
0004 /**
0005  * @file MesonType.h
0006  * @author Pawel Sznajder (NCBJ)
0007  * @date 23 April 2019
0008  * @version 1.0
0009  */
0010 
0011 #include <string>
0012 
0013 #include "gpd/GPDType.h"
0014 #include "List.h"
0015 
0016 namespace ElemUtils {
0017 class Packet;
0018 } /* namespace ElemUtils */
0019 
0020 namespace PARTONS {
0021 
0022 /**
0023  * @class MesonType
0024  *
0025  * @brief Definition of enumeration values for meson types.
0026  *
0027  * This class defines a set of enumeration values that are used to distinguish between meson types. In addition, a declared object of this class is always associated to one meson type (see MesonType::m_type), so member functions can act on it.
0028  */
0029 class MesonType {
0030 
0031 public:
0032 
0033     /**
0034      * Definition of enumerate values corresponding to meson types.
0035      */
0036     enum Type {
0037         UNDEFINED = 0,  //!< Undefined type.
0038 
0039         RHOMINUS = 1,   //!<  \f$\rho^{-}\f$
0040         RHO0 = 2,       //!<  \f$\rho^{0}\f$
0041         RHOPLUS = 3,    //!<  \f$\rho^{+}\f$
0042         OMEGA = 4,      //!<  \f$\omega\f$
0043         PHI = 5,        //!<  \f$\phi\f$
0044         JPSI = 6,       //!<  \f$J/\Psi\f$
0045         UPSILON = 7,    //!<  \f$\Upsilon\f$
0046 
0047         PIMINUS = 8,    //!<  \f$\pi^{-}\f$
0048         PI0 = 9,        //!<  \f$\pi^{0}\f$
0049         PIPLUS = 10     //!<  \f$\pi^{+}\f$
0050     };
0051 
0052     /**
0053      * Default constructor.
0054      */
0055     MesonType();
0056 
0057     /**
0058      * Assignment constructor.
0059      * @param type Type to be assigned.
0060      */
0061     MesonType(Type type);
0062 
0063     /**
0064      * Copy constructor.
0065      * @param other Object to be copied.
0066      */
0067     MesonType(const MesonType &other);
0068 
0069     /**
0070      * Automatic cast to enum.
0071      */
0072     operator Type() const;
0073 
0074     /**
0075      * Get list of GPD types probed by the meson.
0076      */
0077     List<GPDType> getPossibleGPDTypes() const;
0078 
0079     /**
0080      * Get mass associated to set meson type.
0081      */
0082     double getMass() const;
0083 
0084     /**
0085      * Get string representation of type being assigned to a declared object of this class.
0086      * @return String representation of assigned type.
0087      */
0088     std::string toString() const;
0089 
0090     /**
0091      * Serialize into given Packet.
0092      * @param packet Target Packet.
0093      */
0094     void serialize(ElemUtils::Packet &packet) const;
0095 
0096     /**
0097      * Retrieve data from given Packet.
0098      * @param packet Input Packet.
0099      */
0100     void unserialize(ElemUtils::Packet &packet);
0101 
0102     /**
0103      * Relation operator that checks if the value of left operand is less than the value of right operand (based on values assigned in the definition of MesonType::Type).
0104      * Used by std::sort function.
0105      * @param other Right hand value.
0106      * @return True if the value of left operand is less than the value of right operand, otherwise false.
0107      */
0108     bool operator <(const MesonType &other) const;
0109 
0110     /**
0111      * Try to match meson type from given string.
0112      * @param mesonTypeStr String to be matched.
0113      * @return Matched type or MesonType::UNDEFINED if unable to match.
0114      */
0115     static MesonType::Type fromString(const std::string & mesonTypeStr);
0116 
0117     //********************************************************
0118     //*** SETTERS AND GETTERS ********************************
0119     //********************************************************
0120 
0121     /**
0122      * Get type being assigned to a declared object of this class.
0123      */
0124     MesonType::Type getType() const;
0125 
0126     /**
0127      * Assign type to a declared object of this class.
0128      */
0129     void setType(Type type);
0130 
0131 private:
0132 
0133     /**
0134      * Type associated to a declared object of this class.
0135      */
0136     MesonType::Type m_type;
0137 };
0138 
0139 /**
0140  * Stream operator to serialize class into Packet. See also MesonType::serialize().
0141  */
0142 ElemUtils::Packet& operator <<(ElemUtils::Packet& packet, MesonType& mesonType);
0143 
0144 /**
0145  * Stream operator to retrieve class from Packet. See also MesonType::unserialize().
0146  */
0147 ElemUtils::Packet& operator >>(ElemUtils::Packet& packet, MesonType& mesonType);
0148 
0149 } /* namespace PARTONS */
0150 
0151 #endif /* MESON_TYPE_H */
0152