Back to home page

EIC code displayed by LXR

 
 

    


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

0001 #ifndef GPD_MODULE_H
0002 #define GPD_MODULE_H
0003 
0004 /**
0005  * @file GPDModule.h
0006  * @author Bryan BERTHOU (SPhN / CEA Saclay)
0007  * @date August 06, 2014
0008  * @version 1.0
0009  */
0010 
0011 #include <ElementaryUtils/parameters/Parameters.h>
0012 #include <map>
0013 #include <string>
0014 
0015 #include "../../beans/automation/BaseObjectData.h"
0016 #include "../../beans/gpd/GPDType.h"
0017 #include "../../beans/List.h"
0018 #include "../../beans/parton_distribution/PartonDistribution.h"
0019 #include "../../ModuleObject.h"
0020 
0021 namespace PARTONS {
0022 class CollinearDistributionModule;
0023 class GPDEvolutionModule;
0024 class GPDKinematic;
0025 class GPDResult;
0026 } /* namespace PARTONS */
0027 
0028 namespace PARTONS {
0029 
0030 /**
0031  * @class GPDModule
0032  * @brief Abstract class that provides a skeleton to implement a Generalized Parton Distributions (GPD) module.
0033  *
0034  * It is best to use this module with the corresponding service: GPDService (see examples therein), as explained in the [general tutorial](@ref usage).
0035  */
0036 class GPDModule: public ModuleObject {
0037 
0038 public:
0039 
0040     static const std::string GPD_MODULE_CLASS_NAME; ///< Type of the module in XML automation.
0041 
0042     /**
0043      * Destructor.
0044      */
0045     virtual ~GPDModule();
0046 
0047     virtual GPDModule* clone() const = 0;
0048     virtual std::string toString() const;
0049     virtual void resolveObjectDependencies();
0050     virtual void run();
0051     void virtual configure(const ElemUtils::Parameters &parameters);
0052     virtual void prepareSubModules(
0053             const std::map<std::string, BaseObjectData>& subModulesData);
0054 
0055     virtual std::vector<double> test();
0056 
0057     /**
0058      * Virtual method, computes GPD with some input parameters.
0059      *
0060      * @param kinematic GPD kinematics object.
0061      * @param gpdType H, Ht, E, Et, ... or ALL. See GPDType for more details.
0062      * @param evolution Boolean to use evolution.
0063      *
0064      * @return PartonDistribution object.
0065      * Contains results for each flavor of partons.
0066      */
0067     virtual PartonDistribution compute(const GPDKinematic &kinematic,
0068             GPDType::Type gpdType);
0069 
0070     /**
0071      * Virtual method, computes GPD with some input parameters.
0072      *
0073      * @param kinematic GPD kinematics object.
0074      * @param gpdType H, Ht, E, Et, ... or ALL. See GPDType for more details.
0075      *
0076      * @return PartonDistribution object.
0077      * Contains results for each flavor of partons.
0078      */
0079     virtual GPDResult compute(const GPDKinematic &kinematic,
0080             const List<GPDType>& gpdType = List<GPDType>());
0081 
0082     /**
0083      * Get list of available GPDTypes in the model considered. This list is set in the child class.
0084      */
0085     List<GPDType> getListOfAvailableGPDTypeForComputation() const;
0086 
0087     // ##### IMPLEMENTATION FUNCTIONS #####
0088 
0089     /**
0090      * This method can be implemented in the child class if the GPD H is available to compute.
0091      *
0092      * @return PartonDistribution object.
0093      * Contains results for each flavor of partons.
0094      */
0095     virtual PartonDistribution computeH();
0096 
0097     /**
0098      * This method can be implemented in the child class if the GPD E is available to compute.
0099      *
0100      * @return PartonDistribution object.
0101      * Contains results for each flavor of partons.
0102      */
0103     virtual PartonDistribution computeE();
0104 
0105     /**
0106      * This method can be implemented in the child class if the GPD Ht is available to compute.
0107      *
0108      * @return PartonDistribution object.
0109      * Contains results for each flavor of partons.
0110      */
0111     virtual PartonDistribution computeHt();
0112 
0113     /**
0114      * This method can be implemented in the child class if the GPD Et is available to compute.
0115      *
0116      * @return PartonDistribution object.
0117      * Contains results for each flavor of partons.
0118      */
0119     virtual PartonDistribution computeEt();
0120 
0121     /**
0122      * This method can be implemented in the child class if the GPD HTrans is available to compute.
0123      *
0124      * @return PartonDistribution object.
0125      * Contains results for each flavor of partons.
0126      */
0127     virtual PartonDistribution computeHTrans();
0128 
0129     /**
0130      * This method can be implemented in the child class if the GPD ETrans is available to compute.
0131      *
0132      * @return PartonDistribution object.
0133      * Contains results for each flavor of partons.
0134      */
0135     virtual PartonDistribution computeETrans();
0136 
0137     /**
0138      * This method can be implemented in the child class if the GPD HtTrans is available to compute.
0139      *
0140      * @return PartonDistribution object.
0141      * Contains results for each flavor of partons.
0142      */
0143     virtual PartonDistribution computeHtTrans();
0144 
0145     /**
0146      * This method can be implemented in the child class if the GPD EtTrans is available to compute.
0147      *
0148      * @return PartonDistribution object.
0149      * Contains results for each flavor of partons.
0150      */
0151     virtual PartonDistribution computeEtTrans();
0152 
0153     /**
0154      * This method can be implemented in the child class if the GPD H3p is available to compute.
0155      *
0156      * @return PartonDistribution object.
0157      * Contains results for each flavor of partons.
0158      */
0159     virtual PartonDistribution computeH3p();
0160 
0161     /**
0162      * This method can be implemented in the child class if the GPD E3p is available to compute.
0163      *
0164      * @return PartonDistribution object.
0165      * Contains results for each flavor of partons.
0166      */
0167     virtual PartonDistribution computeE3p();
0168 
0169     /**
0170      * This method can be implemented in the child class if the GPD Ht3p is available to compute.
0171      *
0172      * @return PartonDistribution object.
0173      * Contains results for each flavor of partons.
0174      */
0175     virtual PartonDistribution computeHt3p();
0176 
0177     /**
0178      * This method can be implemented in the child class if the GPD Et3p is available to compute.
0179      *
0180      * @return PartonDistribution object.
0181      * Contains results for each flavor of partons.
0182      */
0183     virtual PartonDistribution computeEt3p();
0184 
0185     /**
0186      * This method can be implemented in the child class if the GPD H3m is available to compute.
0187      *
0188      * @return PartonDistribution object.
0189      * Contains results for each flavor of partons.
0190      */
0191     virtual PartonDistribution computeH3m();
0192 
0193     /**
0194      * This method can be implemented in the child class if the GPD E3m is available to compute.
0195      *
0196      * @return PartonDistribution object.
0197      * Contains results for each flavor of partons.
0198      */
0199     virtual PartonDistribution computeE3m();
0200 
0201     /**
0202      * This method can be implemented in the child class if the GPD Ht3m is available to compute.
0203      *
0204      * @return PartonDistribution object.
0205      * Contains results for each flavor of partons.
0206      */
0207     virtual PartonDistribution computeHt3m();
0208 
0209     /**
0210      * This method can be implemented in the child class if the GPD Et3m is available to compute.
0211      *
0212      * @return PartonDistribution object.
0213      * Contains results for each flavor of partons.
0214      */
0215     virtual PartonDistribution computeEt3m();
0216 
0217     /**
0218      * This method can be implemented in the child class if the GPD EbarTrans is available to compute.
0219      *
0220      * @return PartonDistribution object.
0221      * Contains results for each flavor of partons.
0222      */
0223     virtual PartonDistribution computeEbarTrans();
0224 
0225     // ##### GETTERS & SETTERS #####
0226 
0227     /**
0228      * Get reference factorization scale used by the GPD model before evolution.
0229      */
0230     double getMuF2Ref() const;
0231 
0232     /**
0233      * Set underlying GPD Evolution module.
0234      */
0235     const GPDEvolutionModule* getEvolQcdModule() const;
0236 
0237     /**
0238      * Get  underlying GPD Evolution module.
0239      */
0240     void setEvolQcdModule(GPDEvolutionModule* pEvolQcdModule);
0241 
0242     /**
0243      * Set underlying PDF module.
0244      */
0245     const CollinearDistributionModule* getPDFModule() const;
0246 
0247     /**
0248      * Get  underlying PDF module.
0249      */
0250     void setPDFModule(CollinearDistributionModule* pPDFModule);
0251 
0252 protected:
0253 
0254     /**
0255      * Default constructor.
0256      */
0257     GPDModule(const std::string &className);
0258 
0259     /**
0260      * Copy constructor.
0261      * @param other Object to be copied.
0262      */
0263     GPDModule(const GPDModule &other);
0264 
0265     /**
0266      * Set internal kinematics.
0267      * @param kinematic Kinematics to be set.
0268      */
0269     virtual void setKinematics(const GPDKinematic& kinematic);
0270 
0271     /**
0272      * Set current GPD type to be computed.
0273      */
0274     void setCurrentGPDType(GPDType::Type gpdType);
0275 
0276     /**
0277      * GPDResult to std::vector<double> (used by test()).
0278      */
0279     void gpdResultToStdVector(const GPDResult& r, std::vector<double>& v) const;
0280 
0281     virtual void initModule();
0282     virtual void isModuleWellConfigured();
0283 
0284     /**
0285      * List of GPD types that can be computed by the child class.
0286      * Needs to be set in the constructor of the child class, with the corresponding methods to be used.
0287      */
0288     std::map<GPDType::Type, PartonDistribution (GPDModule::*)()> m_listGPDComputeTypeAvailable;
0289 
0290     /**
0291      * Iterator.
0292      */
0293     std::map<GPDType::Type, PartonDistribution (GPDModule::*)()>::iterator m_it;
0294 
0295     double m_x; ///< Longitudinal momentum fraction of the active parton.
0296     double m_xi; ///< Skewness.
0297     double m_t; ///< Mandelstam variable, momentum transfer on the hadron target.
0298     double m_MuF2; ///< Factorization scale squared.
0299     double m_MuR2; ///< Renormalization scale squared.
0300     GPDType::Type m_currentGPDComputeType; ///< Current GPD type.
0301 
0302     double m_MuF2_ref; ///< Reference factorization scale used by the GPD model before evolution.
0303 
0304     GPDEvolutionModule* m_pGPDEvolutionModule; ///< Pointer to the underlying GPD Evolution module.
0305 
0306     CollinearDistributionModule* m_pCollinearDistributionModule; ///< Pointer to the underlying PDF module.
0307 };
0308 
0309 } /* namespace PARTONS */
0310 
0311 #endif /* GPD_MODULE_H */