Back to home page

EIC code displayed by LXR

 
 

    


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

0001 #ifndef VCS_SUB_PROCESS_TYPE_H
0002 #define VCS_SUB_PROCESS_TYPE_H
0003 
0004 /**
0005  * @file VCSSubProcessType.h
0006  * @author Pawel Sznajder (NCBJ, Warsaw)
0007  * @date July 27, 2017
0008  * @version 1.0
0009  */
0010 
0011 #include <string>
0012 
0013 #include "../../BaseObject.h"
0014 
0015 namespace PARTONS {
0016 
0017 /**
0018  * @class VCSSubProcessType
0019  *
0020  * @brief Definition of enumeration values for VCS subprocess types.
0021  *
0022  * This class defines a set of enumeration values that are used to distinguish between VCS subprocess types. In addition, a declared object of this class is always associated to one VCS subrpocess type (see VCSSubProcessType::m_type), so member functions can act on it. E.g.
0023  \code{.cpp}
0024  //this is single enum variable - nothing to play with
0025  VCSSubProcessType::Type enum_variable = VCSSubProcessType::BH;
0026 
0027  //this is declared object
0028  VCSSubProcessType enum_object;
0029 
0030  //let us assign some type (default is VCSSubProcessType::UNDEFINED)
0031  enum_object.setType(enum_variable);
0032 
0033  //with objects you can use available functions, e.g. you can represent enumeration type by a corresponding string
0034  std::string enum_string_1 = enum_object.toString();
0035 
0036  //you can achieve some basic operations without the explicit declaration of objects by using the assignment constructor
0037  std::string enum_string_2 = VCSSubProcessType(VCSSubProcessType::DVCS).toString();
0038 
0039  Partons::getInstance()->getLoggerManager()->info("example", __func__, ElemUtils::Formatter() << "Subprocess is: " << enum_string_1);
0040  Partons::getInstance()->getLoggerManager()->info("example", __func__, ElemUtils::Formatter() << "Subprocess is: " << enum_string_2);
0041  \endcode
0042  which gives via Logger:
0043  \code
0044  20-05-2017 12:13:02 [INFO] (example::main) Subprocess is: BH
0045  20-05-2017 12:13:02 [INFO] (example::main) Subprocess is: DVCS
0046  \endcode
0047  */
0048 class VCSSubProcessType: public BaseObject {
0049 
0050 public:
0051 
0052     enum Type {
0053         UNDEFINED = 0,  //!< Undefined type.
0054         ALL = 1,        //!< All subprocesses, i.e. VCS, BH and INT.
0055         DVCS = 2,       //!< DVCS subprocess.
0056         BH = 3,         //!< Bethe-Heitler subrocess.
0057         INT = 4,   //!< Interference between VCS and Bethe-Heitler contribution.
0058         TCS = 5,        //!< TCS subprocess.
0059         DDVCS = 6       //!< DDVCS subprocess.
0060     };
0061 
0062     /**
0063      * Default constructor.
0064      */
0065     VCSSubProcessType();
0066 
0067     /**
0068      * Assignment constructor.
0069      * @param type Type to be assigned.
0070      */
0071     VCSSubProcessType(Type type);
0072 
0073     /**
0074      * Assignment constructor trying to match subprocess type from given string. If unable to match set VCSSubProcessType::UNDEFINED.
0075      * @param dvcsSubProcessTypeString String to be matched.
0076      */
0077     VCSSubProcessType(const std::string &dvcsSubProcessTypeString);
0078 
0079     /**
0080      * Get string representation of type being assigned to a declared object of this class.
0081      * @return String representation of assigned type, like "LO" for VCSSubProcessType::LO.
0082      */
0083     std::string toString() const;
0084 
0085     //********************************************************
0086     //*** SETTERS AND GETTERS ********************************
0087     //********************************************************
0088 
0089     /**
0090      * Get type being assigned to a declared object of this class.
0091      */
0092     VCSSubProcessType::Type getType() const;
0093 
0094     /**
0095      * Assign type to a declared object of this class.
0096      */
0097     void setType(Type type);
0098 
0099 private:
0100 
0101     /**
0102      * Type associated to a declared object of this class.
0103      */
0104     VCSSubProcessType::Type m_type;
0105 };
0106 
0107 } /* namespace PARTONS */
0108 
0109 #endif /* VCS_SUB_PROCESS_TYPE_H */