Back to home page

EIC code displayed by LXR

 
 

    


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

0001 #ifndef COLLINEAR_DISTRIBUTION_KINEMATIC_H
0002 #define COLLINEAR_DISTRIBUTION_KINEMATIC_H
0003 
0004 /**
0005  * @file CollinearDistributionKinematic.h
0006  * @author: Valerio BERTONE (CEA Saclay)
0007  * @date July 17, 2020
0008  * @version 1.0
0009  */
0010 
0011 #include <ElementaryUtils/parameters/GenericType.h>
0012 #include <ElementaryUtils/parameters/Parameters.h>
0013 #include <string>
0014 #include <vector>
0015 
0016 #include "../../utils/type/PhysicalType.h"
0017 #include "../../utils/type/PhysicalUnit.h"
0018 #include "../Kinematic.h"
0019 
0020 namespace ElemUtils {
0021 class Packet;
0022 } /* namespace ElemUtils */
0023 
0024 namespace PARTONS {
0025 
0026 /**
0027  * @class CollinearDistributionKinematic
0028  *
0029  * @brief Class representing a single collinear-distribution kinematics.
0030  *
0031  * This class represents a single collinear-distribution kinematics (x, \f$\mu_{F}^{2}\f$, \f$\mu_{F}^{2}\f$).
0032  */
0033 class CollinearDistributionKinematic: public Kinematic {
0034 
0035 public:
0036 
0037     static const std::string COLLINEAR_DISTRIBUTION_KINEMATIC_CLASS_NAME; ///< Type of the kinematic in XML automation.
0038 
0039     /**
0040      * Parameter name to set variable \f$x\f$ via configuration methods.
0041      */
0042     static const std::string KINEMATIC_PARAMETER_NAME_X;
0043 
0044     /**
0045      * Parameter name to set variable \f$\mu_{F}^{2}\f$ via configuration methods.
0046      */
0047     static const std::string KINEMATIC_PARAMETER_NAME_MUF2;
0048 
0049     /**
0050      * Parameter name to set variable \f$\mu_{R}^{2}\f$ via configuration methods.
0051      */
0052     static const std::string KINEMATIC_PARAMETER_NAME_MUR2;
0053 
0054     /**
0055      * Parameter name to set unit of variable \f$x\f$ via configuration methods.
0056      */
0057     static const std::string KINEMATIC_PARAMETER_NAME_X_UNIT;
0058 
0059     /**
0060      * Parameter name to set unit of variable \f$\mu_{F}^{2}\f$ via configuration methods.
0061      */
0062     static const std::string KINEMATIC_PARAMETER_NAME_MUF2_UNIT;
0063 
0064     /**
0065      * Parameter name to set unit of variable \f$\mu_{R}^{2}\f$ via configuration methods.
0066      */
0067     static const std::string KINEMATIC_PARAMETER_NAME_MUR2_UNIT;
0068 
0069     /**
0070      * Default constructor.
0071      */
0072     CollinearDistributionKinematic();
0073 
0074     /**
0075      * Assignment constructor.
0076      *
0077      * @param x Longitudinal momentum fraction of active parton.
0078      * @param MuF2 Factorization scale squared (in \f$GeV^{2}\f$).
0079      * @param MuR2 Renormalization scale squared (in \f$GeV^{2}\f$).
0080      */
0081     CollinearDistributionKinematic(double x, double MuF2, double MuR2);
0082 
0083     /**
0084      * Assignment constructor.
0085      *
0086      * @param x Longitudinal momentum fraction of active parton.
0087      * @param MuF2 Factorization scale squared (in \f$GeV^{2}\f$).
0088      * @param MuR2 Renormalization scale squared (in \f$GeV^{2}\f$).
0089      */
0090     CollinearDistributionKinematic(const PhysicalType<double> &x, const PhysicalType<double> &MuF2, const PhysicalType<double> &MuR2);
0091 
0092     /**
0093      * Assignment constructor.
0094      *
0095      * @param x Longitudinal momentum fraction of active parton.
0096      * @param MuF2 Factorization scale squared (in \f$GeV^{2}\f$).
0097      * @param MuR2 Renormalization scale squared (in \f$GeV^{2}\f$).
0098      */
0099     CollinearDistributionKinematic(const ElemUtils::GenericType &x, const ElemUtils::GenericType &MuF2, const ElemUtils::GenericType &MuR2);
0100 
0101     /**
0102      * Copy constructor.
0103      * @param other Object to be copied.
0104      */
0105     CollinearDistributionKinematic(const CollinearDistributionKinematic &other);
0106 
0107     /**
0108      * Destructor.
0109      */
0110     virtual ~CollinearDistributionKinematic();
0111 
0112     virtual void configure(const ElemUtils::Parameters &parameters);
0113     virtual std::string toString() const;
0114 
0115     /**
0116      * Serialize into given Packet.
0117      * @param packet Target Packet.
0118      */
0119     void serialize(ElemUtils::Packet &packet) const;
0120 
0121     /**
0122      * Retrieve data from given Packet.
0123      * @param packet Input Packet.
0124      */
0125     void unserialize(ElemUtils::Packet &packet);
0126 
0127     /**
0128      * Serialize to std::vector<double>.
0129      */
0130     void serializeIntoStdVector(std::vector<double>& vec) const;
0131 
0132     /**
0133      * Unserialize from std::vector<double>.
0134      */
0135     void unserializeFromStdVector(std::vector<double>::const_iterator& it,
0136             const std::vector<double>::const_iterator& end);
0137 
0138     /**
0139      * Is equal operator. Checks if values of kinematic variables are the same.
0140      */
0141     bool operator ==(const CollinearDistributionKinematic& other) const;
0142 
0143     /**
0144      * Is different operator. Checks of values of kinematic variables are different.
0145      */
0146     bool operator !=(const CollinearDistributionKinematic& other) const;
0147 
0148     //********************************************************
0149     //*** SETTERS AND GETTERS ********************************
0150     //********************************************************
0151 
0152     /**
0153      * Get longitudinal momentum fraction of active parton.
0154      */
0155     const PhysicalType<double>& getX() const;
0156 
0157     /**
0158      * Set longitudinal momentum fraction of active parton.
0159      */
0160     void setX(const PhysicalType<double>& x);
0161 
0162     /**
0163      * Set longitudinal momentum fraction of active parton.
0164      */
0165     void setX(double x, PhysicalUnit::Type unit = PhysicalUnit::NONE);
0166 
0167     /**
0168      * Get factorization scale squared.
0169      */
0170     const PhysicalType<double>& getMuF2() const;
0171 
0172     /**
0173      * Set factorization scale squared.
0174      */
0175     void setMuF2(const PhysicalType<double>& muF2);
0176 
0177     /**
0178      * Set factorization scale squared.
0179      */
0180     void setMuF2(double muF2, PhysicalUnit::Type unit = PhysicalUnit::GEV2);
0181 
0182     /**
0183      * Get renormalization scale squared.
0184      */
0185     const PhysicalType<double>& getMuR2() const;
0186 
0187     /**
0188      * Set renormalization scale squared.
0189      */
0190     void setMuR2(const PhysicalType<double>& muR2);
0191 
0192     /**
0193      * Set renormalization scale squared.
0194      */
0195     void setMuR2(double muR2, PhysicalUnit::Type unit = PhysicalUnit::GEV2);
0196 
0197 protected:
0198 
0199     virtual void updateHashSum() const;
0200 
0201 private:
0202 
0203     /**
0204      * Longitudinal momentum fraction of active parton.
0205      */
0206     PhysicalType<double> m_x;
0207 
0208     /**
0209      * Factorization scale squared (in \f$GeV^{2}\f$).
0210      */
0211     PhysicalType<double> m_MuF2;
0212 
0213     /**
0214      * Renormalization scale squared (in \f$GeV^{2}\f$).
0215      */
0216     PhysicalType<double> m_MuR2;
0217 };
0218 
0219 /**
0220  * Stream operator to serialize class into Packet. See also CollinearDistributionType::serialize().
0221  */
0222 ElemUtils::Packet& operator <<(ElemUtils::Packet& packet, CollinearDistributionKinematic& kinematic);
0223 
0224 /**
0225  * Stream operator to retrieve class from Packet. See also CollinearDistributionType::unserialize().
0226  */
0227 ElemUtils::Packet& operator >>(ElemUtils::Packet& packet, CollinearDistributionKinematic& kinematic);
0228 
0229 } /* namespace PARTONS */
0230 
0231 #endif /* COLLINEAR_DISTRIBUTION_KINEMATIC_H */