Back to home page

EIC code displayed by LXR

 
 

    


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

0001 #ifndef PARTON_DISTRIBUTION_H
0002 #define PARTON_DISTRIBUTION_H
0003 
0004 /**
0005  * @file PartonDistribution.h
0006  * @author: Bryan BERTHOU (SPhN / CEA Saclay)
0007  * @date 26 April 2015
0008  * @version 1.0
0009  */
0010 
0011 #include <map>
0012 #include <string>
0013 #include <vector>
0014 
0015 #include "../List.h"
0016 #include "../QuarkFlavor.h"
0017 #include "GluonDistribution.h"
0018 #include "QuarkDistribution.h"
0019 
0020 namespace PARTONS {
0021 
0022 class ComparisonReport;
0023 
0024 /**
0025  * @class PartonDistribution
0026  *
0027  * @brief Parton distributions for single physics object.
0028  *
0029  * This class is used to store parton distributions for a single physics object (e.g. GPD of a given type). It contains quark distributions (QuarkDistribution objects) and a gluon distribution (GluonDistribution object). Each quark distribution is defined for a different quark flavor. This is illustrated by the following example:
0030  \code{.cpp}
0031  //create new parton distribution
0032  PartonDistribution partonDistribution;
0033 
0034  //since it is an empty container now, let us fill it:
0035 
0036  //with quark distributions for up and down quarks
0037  QuarkDistribution quarkDistributionUp(QuarkFlavor::UP, 1.123);
0038  QuarkDistribution quarkDistributionDown(QuarkFlavor::DOWN, 0.456);
0039 
0040  partonDistribution.addQuarkDistribution(quarkDistributionUp);
0041  partonDistribution.addQuarkDistribution(quarkDistributionDown);
0042 
0043  //with gluon distribution
0044  GluonDistribution gluonDistribution(2.345);
0045 
0046  partonDistribution.setGluonDistribution(gluonDistribution);
0047 
0048  //check what is inside
0049  Partons::getInstance()->getLoggerManager()->info("example", __func__, ElemUtils::Formatter() << "Parton distribution contains: " << partonDistribution.toString());
0050  \endcode
0051 which gives via Logger:
0052 \code
0053 20-05-2017 09:29:44 [INFO] (example::main) Parton distribution contains: [PartonDistribution]
0054 m_className = PartonDistribution - m_objectId = 195 indexId = -1
0055 GluonDistribution = 2.345
0056 u = 1.123
0057 u(+) = 0
0058 u(-) = 0
0059 d = 0.456
0060 d(+) = 0
0061 d(-) = 0
0062 \endcode
0063  * See the documentation of QuarkDistribution and GluonDistribution classes to check what kind of information you can access in objects of those types. Check also GPDResult class, where QuarkDistribution objects are used extensively.
0064  */
0065 class PartonDistribution: public BaseObject {
0066 public:
0067 
0068     /**
0069      * Default constructor.
0070      */
0071     PartonDistribution();
0072 
0073     /**
0074      * Copy constructor.
0075      * @param other Object to be copied.
0076      */
0077     PartonDistribution(const PartonDistribution &other);
0078 
0079     /**
0080      * Destructor.
0081      */
0082     virtual ~PartonDistribution();
0083 
0084     /**
0085      * Add quark distribution associated to given quark flavor that is defined in the object to be added.
0086      * @param quarkDistribution Reference to quark distribution to be added.
0087      */
0088     void addQuarkDistribution(const QuarkDistribution &quarkDistribution);
0089 
0090     /**
0091      * Add quark distribution associated to given quark flavor that is defined in the object to be added.
0092      * @param quarkDistribution Reference to quark distribution to be added.
0093      */
0094     void addQuarkDistribution(QuarkDistribution &quarkDistribution);
0095 
0096     /**
0097      * Get reference to quark distribution associated to given quark flavor.
0098      * @param quarkFlavorType Quark flavor associated to quark distribution to be selected.
0099      * @return Reference to selected quark distribution.
0100      */
0101     const QuarkDistribution& getQuarkDistribution(
0102             QuarkFlavor::Type quarkFlavorType) const;
0103 
0104     /**
0105      * Get list of quark flavors associated to stored quark distributions.
0106      * @return Vector of associated flavors.
0107      */
0108     std::vector<QuarkFlavor::Type> listTypeOfQuarkFlavor() const;
0109 
0110     /**
0111      * Get number of quark distributions stored in this object.
0112      * @return Number of quark distributions stored in this object.
0113      */
0114     unsigned int getQuarkDistributionsSize() const;
0115 
0116     /**
0117      * Get list of stored quark distributions.
0118      * @return Retrieved List of QuarkDistribution objects.
0119      */
0120     List<QuarkDistribution> getListOfQuarkDistribution() const;
0121 
0122     /**
0123      * Get sum of singlet values for stored quark distributions.
0124      * Return<br>
0125      * \f$\sum_q F^{q(+)}\f$ <br>
0126      * where F is physics object (e.g. GPD) for which distributions are defined.<br>
0127      * <br>
0128      * Note that sum elements are not weighted here by square of corresponding quark charges.
0129      * @return Sum of singlet values.
0130      */
0131     double getSinglet();
0132 
0133     virtual std::string toString() const;
0134 
0135     //********************************************************
0136     //*** SETTERS AND GETTERS ********************************
0137     //********************************************************
0138 
0139     /**
0140      * Get reference to map containing stored quark distributions distinguished by associated quark flavors.
0141      */
0142     const std::map<QuarkFlavor::Type, QuarkDistribution>& getQuarkDistributions() const;
0143 
0144     /**
0145      * Set map containing stored quark distributions distinguished by associated quark flavors.
0146      */
0147     void setQuarkDistributions(
0148             const std::map<QuarkFlavor::Type, QuarkDistribution>& quarkDistributions);
0149 
0150     /**
0151      * Get reference to gluon distribution.
0152      */
0153     const GluonDistribution& getGluonDistribution() const;
0154 
0155     /**
0156      * Set gluon distribution.
0157      */
0158     void setGluonDistribution(const GluonDistribution &gluonDistribution);
0159 
0160 private:
0161 
0162     /**
0163      * Map containing stored quark distributions distinguished by associated quark flavors.
0164      */
0165     std::map<QuarkFlavor::Type, QuarkDistribution> m_quarkDistributions;
0166 
0167      /**
0168      * Gluon distribution.
0169      */
0170     GluonDistribution m_gluonDistribution;
0171 };
0172 
0173 } /* namespace PARTONS */
0174 
0175 #endif /* PARTON_DISTRIBUTION_H */