Commit 52b9b300 authored by Valerio Bertone's avatar Valerio Bertone
Browse files

refactoring GPD evolution modules

parent 54a6aa8a
......@@ -3,33 +3,22 @@
/**
* @file GPDEvolutionModule.h
* @author Pawel Sznajder (NCBJ)
* @date June 01, 2017
* @author Valerio BERTONE (CEA Saclay)
* @date Sptember 17, 2020
* @version 1.0
*/
#include <ElementaryUtils/parameters/Parameters.h>
#include <NumA/linear_algebra/matrix/MatrixD.h>
#include <stddef.h>
#include <map>
#include <string>
#include <vector>
#include "../../../beans/automation/BaseObjectData.h"
#include "../../../ModuleObject.h"
#include "../../../beans/gpd/GPDType.h"
#include "../../../beans/gpd/GPDKinematic.h"
#include "../../../beans/parton_distribution/PartonDistribution.h"
#include "../../../beans/parton_distribution/QuarkDistribution.h"
#include "../../../beans/PerturbativeQCDOrderType.h"
#include "../../../beans/QuarkFlavor.h"
#include "../../../beans/QuarkNonSingletCombination.h"
#include "../../../ModuleObject.h"
#include "../../MathIntegratorModule.h"
namespace PARTONS {
class ActiveFlavorsThresholdsModule;
class GPDModule;
class RunningAlphaStrongModule;
class ActiveFlavorsThresholdsModule;
/**
* @class GPDEvolutionModule
......@@ -38,7 +27,7 @@ class RunningAlphaStrongModule;
*
* This class acts as an abstract (mother) class for modules implementing GPD evolution.
*/
class GPDEvolutionModule: public ModuleObject, public MathIntegratorModule {
class GPDEvolutionModule: public ModuleObject {
public:
......@@ -59,61 +48,31 @@ public:
virtual ~GPDEvolutionModule();
virtual GPDEvolutionModule* clone() const = 0;
virtual void configure(const ElemUtils::Parameters &parameters);
virtual std::string toString() const;
virtual void resolveObjectDependencies();
virtual void prepareSubModules(
const std::map<std::string, BaseObjectData>& subModulesData);
virtual void configure(const ElemUtils::Parameters &parameters);
virtual void prepareSubModules(const std::map<std::string, BaseObjectData>& subModulesData);
/**
* Evaluate PartonDistribution.
* @param x Longitudinal momentum of active parton.
* @param xi Skewness variable.
* @param t Four-momentum transfer squared of hadron target (in \f$GeV^{2}\f$).
* @param MuF2 Factorization scale squared (in \f$GeV^{2}\f$).
* @param MuR2 Renormalization scale squared (in \f$GeV^{2}\f$).
* @param pGPDModule Pointer to GPD module to be evaluated.
* @param gpdType Type of GPD.
* @return Evaluated result encapsulated in PartonDistribution object.
*/
PartonDistribution compute(double x, double xi, double t, double MuF2,
double MuR2, GPDModule* pGPDModule, GPDType::Type gpdType);
PartonDistribution compute(const GPDKinematic &kinematic, GPDModule* pGPDModule, const GPDType::Type &type);
// GETTERS and SETTERS
// ##### GETTERS & SETTERS #####
/**
* Get pQCD order assumed in the calculation.
*/
PerturbativeQCDOrderType::Type getQcdOrderType() const;
/**
* Set pQCD order assumed in the calculation.
*/
void setQcdOrderType(PerturbativeQCDOrderType::Type qcdOrderType);
void setMuF2_ref(const double& MuF2_ref);
void setPertOrder(const PerturbativeQCDOrderType::Type& pertOrder);
void setGPDType(GPDType::Type type);
void setRunningAlphaStrongModule(RunningAlphaStrongModule* runningAlphaStrongModule);
void setActiveFlavorsModule(ActiveFlavorsThresholdsModule* activeFlavorsModule);
/**
* Set pointer to RunningAlphaStrongModule object.
*/
double getMuF2_ref() const;
double getMuF_ref() const;
PerturbativeQCDOrderType::Type getPertOrder() const;
GPDType::Type getGPDType() const;
RunningAlphaStrongModule* getRunningAlphaStrongModule() const;
/**
* Set pointer to RunningAlphaStrongModule object.
*/
void setRunningAlphaStrongModule(
RunningAlphaStrongModule* runningAlphaStrongModule);
/**
* Get pointer to ActiveFlavorsThresholdsModule object.
*/
ActiveFlavorsThresholdsModule* getActiveFlavorsModule() const;
/**
* Set pointer to ActiveFlavorsThresholdsModule object.
*/
void setActiveFlavorsModule(
ActiveFlavorsThresholdsModule* activeFlavorsModule);
protected:
/**
......@@ -122,152 +81,32 @@ protected:
*/
GPDEvolutionModule(const GPDEvolutionModule &other);
virtual void isModuleWellConfigured();
virtual void initModule();
virtual void isModuleWellConfigured();
/**
* Precompute (in particular set initial variables).
* @param x Longitudinal momentum of active parton.
* @param xi Skewness variable.
* @param t Four-momentum transfer squared of hadron target (in \f$GeV^{2}\f$).
* @param MuF2 Factorization scale squared (in \f$GeV^{2}\f$).
* @param MuR2 Renormalization scale squared (in \f$GeV^{2}\f$).
* @param pGPDModule Pointer to GPD module to be evaluated.
* @param gpdType Type of GPD.
*/
void preCompute(double x, double xi, double t, double MuF2, double MuR2,
GPDModule* pGPDModule, GPDType::Type gpdType);
virtual void setKinematics(const GPDKinematic& kinematic);
virtual GPDKinematic getKinematics() const;
/**
* Evaluate change of non-singlet for given factorization scale squared.
* @param MuF2 Factorization scale squared.
* @param quarkNonSingletCombination Type of non-singlet combinations.
* @return Evaluated change of non-singlet distibution.
*/
virtual double nonSingletMu2FDerivative(double MuF2,
QuarkNonSingletCombination::Type quarkNonSingletCombination) = 0;
virtual PartonDistribution compute(GPDModule* pGPDModule, const GPDType::Type &type) = 0;
/**
* Evaluate change of singlet for given factorization scale squared.
* @param MuF2 Factorization scale squared.
* @return Evaluated change of singlet distibution.
* Attributes
*/
virtual double singletMuF2Derivative(double MuF2) = 0;
double m_MuF2_ref; ///< Reference factorization scale squared (in \f$GeV^{2}\f$).
PerturbativeQCDOrderType::Type m_pertOrder; ///< pQCD order assumed in the calculation.
GPDType::Type m_type; ///< GPD distribution type.
RunningAlphaStrongModule* m_pRunningAlphaStrongModule; ///< Pointer to RunningAlphaStrongModule object being used.
ActiveFlavorsThresholdsModule* m_pActiveFlavorsModule; ///< Pointer to ActiveFlavorsThresholdsModule object being used.
/**
* Evaluate change of gluon distribution for given factorization scale squared.
* @param MuF2 Factorization scale squared.
* @return Evaluated change of gluon distibution.
* Kinematics
*/
virtual double gluonMuF2Derivative(double MuF2) = 0;
GPDModule* m_pGPDModule; ///< Pointer to GPD module.
double m_x; ///< Longitudinal momentum of active parton.
double m_x; ///< Longitudinal momentum
double m_xi; ///< Skewness variable.
double m_t; ///< Four-momentum transfer squared of hadron target (in \f$GeV^{2}\f$).
double m_t; ///< Four-momentum transfer squared of hadron target (in \f$GeV^{2}\f$).
double m_MuF2; ///< Factorization scale squared (in \f$GeV^{2}\f$).
double m_MuR2; ///< Renormalization scale squared (in \f$GeV^{2}\f$).
double m_MuF2_ref; ///< Reference factorization scale squared (in \f$GeV^{2}\f$).
GPDType::Type m_currentGPDComputeType; ///< GPD type.
size_t m_nFlavors; ///< Number of active flavors at current scale.
size_t m_nFlavors_ref; ///< Numer of active flavors at reference scale.
PerturbativeQCDOrderType::Type m_qcdOrderType; ///< pQCD order assumed in the calculation.
RunningAlphaStrongModule* m_pRunningAlphaStrong; ///< Pointer to RunningAlphaStrongModule object being used.
ActiveFlavorsThresholdsModule* m_pActiveFlavorsModule; ///< Pointer to ActiveFlavorsThresholdsModule object being used.
PartonDistribution m_PartonDistributionAtMuF2_ref; ///< PartonDistribution object evaluated at reference scale.
/**
* Get map containing non-singlet values for given number of active flavors from PartonDistribution object.
* @param nFlavors Number of active flavors.
* @param partonDistribution Input PartonDistribution object.
* @return Map containing non-singlet values.
*/
std::map<QuarkNonSingletCombination::Type, double> getNS(
const size_t nFlavors,
const PartonDistribution& partonDistribution) const;
/**
* Get singlet value for given number of active flavors from PartonDistribution object.
* @param nFlavors Number of active flavors.
* @param partonDistribution Input PartonDistribution object.
* @return Singlet value.
*/
double getS(const size_t nFlavors,
const PartonDistribution& partonDistribution) const;
/**
* Get value for gluon contribution from PartonDistribution object.
* @param partonDistribution Input PartonDistribution object.
* @return Value for gluon contribution.
*/
double getG(const PartonDistribution& partonDistribution) const;
/**
* Get PartonDistribution object for given number of active flavors from non-singlet, singlet and gluon values.
* @param nFlavors Number of active flavors.
* @param NS Map containing non-singlet values.
* @param S Singlet value.
* @param G Value for gluon contribution.
* @return PartonDistribution object.
*/
PartonDistribution getPartonDistribution(const size_t nFlavors,
const std::map<QuarkNonSingletCombination::Type, double>& NS,
double S, double G) const;
/**
* Get constant iterator for given std::map<QuarkFlavor::Type, QuarkDistribution> map and key.
* @param map Map.
* @param key Key.
* @param mapName Map name.
* @return Requested const iterator.
*/
inline std::map<QuarkFlavor::Type, QuarkDistribution>::const_iterator findInQuarkFlavorMap(
const std::map<QuarkFlavor::Type, QuarkDistribution>& map,
QuarkFlavor::Type key, const std::string& mapName) const;
/**
* Get constant iterator for given std::map<QuarkNonSingletCombination::Type, double> map and key.
* @param map Map.
* @param key Key.
* @param mapName Map name.
* @return Requested const iterator.
*/
inline std::map<QuarkNonSingletCombination::Type, double>::const_iterator findInQuarkNonSingletCombinationMap(
const std::map<QuarkNonSingletCombination::Type, double>& map,
QuarkNonSingletCombination::Type key,
const std::string& mapName) const;
private:
std::map<size_t, NumA::MatrixD> conversionMatrices; ///< Map containing conversion matrices.
/**
* Wrapper to integrate GPDEvolutionModule::nonSingletMu2FDerivative.
*/
double integrateComputeOutputNS(double MuF2, std::vector<double> par);
/**
* Wrapper to integrate GPDEvolutionModule::singletMuF2Derivative.
*/
double integrateComputeOutputS(double MuF2, std::vector<double> par);
/**
* Wrapper to integrate GPDEvolutionModule::gluonMuF2Derivative.
*/
double integrateComputeOutputG(double MuF2, std::vector<double> par);
/**
* Initialize functors for integration.
*/
void initFunctorsForIntegrations();
NumA::FunctionType1D* p_intIntegrateComputeOutputNS; ///< Functor to GPDEvolutionModule::integrateComputeOutputNS.
NumA::FunctionType1D* p_intIntegrateComputeOutputS; ///< Functor to GPDEvolutionModule::integrateComputeOutputS.
NumA::FunctionType1D* p_intIntegrateComputeOutputG; ///< Functor to GPDEvolutionModule::integrateComputeOutputG.
};
} /* namespace PARTONS */
......
......@@ -9,26 +9,30 @@
*/
#include <ElementaryUtils/parameters/Parameters.h>
#include <NumA/linear_algebra/matrix/MatrixD.h>
#include <NumA/integration/one_dimension/Integrator1D.h>
#include <stddef.h>
#include <map>
#include <string>
#include <vector>
#include "../../active_flavors_thresholds/ActiveFlavorsThresholdsModule.h"
#include "../../../beans/QuarkNonSingletCombination.h"
#include "../../MathIntegratorModule.h"
#include "GPDEvolutionModule.h"
namespace PARTONS {
/**
* @class GPDEvolutionVinnikov
*
* @brief GPD evolution according to Vinnikov routines.
*
* This class makes use of original Vinnikov routines for the GPD evolution. For the reference see Ref. \cite{Vinnikov:2006xw}.
*/
class GPDEvolutionVinnikov: public GPDEvolutionModule {
/**
* @class GPDEvolutionVinnikov
*
* @brief GPD evolution according to Vinnikov routines.
*
* This class makes use of original Vinnikov routines for the GPD evolution. For the reference see Ref. \cite{Vinnikov:2006xw}.
*/
class GPDEvolutionVinnikov: public GPDEvolutionModule, public MathIntegratorModule {
public:
public:
static const std::string PARAM_NAME_GRID_SIZE;
......@@ -36,7 +40,6 @@ public:
GPDEvolutionVinnikov(const std::string &className);
virtual ~GPDEvolutionVinnikov();
virtual GPDEvolutionVinnikov* clone() const;
virtual void configure(const ElemUtils::Parameters &parameters);
virtual void resolveObjectDependencies();
......@@ -44,25 +47,22 @@ public:
size_t getGridSize() const;
void setGridSize(size_t gridSize);
protected:
protected:
GPDEvolutionVinnikov(const GPDEvolutionVinnikov& other);
virtual void isModuleWellConfigured();
virtual void initModule();
virtual PartonDistribution compute(GPDModule* pGPDModule, const GPDType::Type &type);
virtual double nonSingletMu2FDerivative(double MuF2,
QuarkNonSingletCombination::Type quarkNonSingletCombination);
virtual double nonSingletMu2FDerivative(double MuF2, QuarkNonSingletCombination::Type quarkNonSingletCombination);
virtual double singletMuF2Derivative(double MuF2);
virtual double gluonMuF2Derivative(double MuF2);
void computeMuF2DerivativeNS(double MuF2, double MuF2Last,
QuarkNonSingletCombination::Type quarkNonSingletCombination);
void computeMuF2DerivativeNS(double MuF2, double MuF2Last, QuarkNonSingletCombination::Type quarkNonSingletCombination);
void computeMuF2DerivativeSG(double MuF2, double MuF2Last);
private:
size_t m_gridSize;
private:
std::map<QuarkNonSingletCombination::Type, std::vector<double> > m_NS;
std::vector<double> m_S;
......@@ -95,14 +95,17 @@ private:
void checkIfGridsValid();
void checkIfResultValid(const double x, double& value);
void checkEvolutionDirection(const double MuF2, const double MuF2Last) const;
void checkEvolutionDirection(const double MuF2,
const double MuF2Last) const;
size_t m_gridSize;
double m_xiLast;
double m_tLast;
double m_MuR2Last;
double m_MuF2RefLast;
size_t m_nFlavors;
size_t m_nFlavors_ref;
GPDModule* m_pGPDModule;
PartonDistribution m_PartonDistributionAtMuF2_ref;
static const double N_C;
static const double C_F;
......@@ -110,29 +113,104 @@ private:
static const double B_0;
static const double C_A;
static const double T_R;
double conv_int_ns(int const ix, double const xi, int const n,
const std::vector<double>& gpd, const std::vector<double>& x);
double conv_int_qq(int const ix, double const xi, int const n,
const std::vector<double>& gpd, const std::vector<double>& x);
double conv_int_gg(int const ix, double const xi, int const n,
const std::vector<double>& gpd, const std::vector<double>& x);
double conv_int_gq(int const ix, double const xi, int const n,
const std::vector<double>& gpd, const std::vector<double>& x);
double conv_int_qg(int const ix, double const xi, int const n,
const std::vector<double>& gpd, const std::vector<double>& x);
double conv_int_qq_pol(int const ix, double const xi, int const n,
const std::vector<double>& gpd, const std::vector<double>& x);
double conv_int_gg_pol(int const ix, double const xi, int const n,
const std::vector<double>& gpd, const std::vector<double>& x);
double conv_int_gq_pol(int const ix, double const xi, int const n,
const std::vector<double>& gpd, const std::vector<double>& x);
double conv_int_qg_pol(int const ix, double const xi, int const n,
const std::vector<double>& gpd, const std::vector<double>& x);
std::map<size_t, NumA::MatrixD> conversionMatrices;
/**
* Get constant iterator for given std::map<QuarkNonSingletCombination::Type, double> map and key.
* @param map Map.
* @param key Key.
* @param mapName Map name.
* @return Requested const iterator.
*/
inline std::map<QuarkNonSingletCombination::Type, double>::const_iterator findInQuarkNonSingletCombinationMap(
const std::map<QuarkNonSingletCombination::Type, double>& map,
QuarkNonSingletCombination::Type key,
const std::string& mapName) const;
double conv_int_ns(int const ix, double const xi, int const n, const std::vector<double>& gpd, const std::vector<double>& x);
double conv_int_qq(int const ix, double const xi, int const n, const std::vector<double>& gpd, const std::vector<double>& x);
double conv_int_gg(int const ix, double const xi, int const n, const std::vector<double>& gpd, const std::vector<double>& x);
double conv_int_gq(int const ix, double const xi, int const n, const std::vector<double>& gpd, const std::vector<double>& x);
double conv_int_qg(int const ix, double const xi, int const n, const std::vector<double>& gpd, const std::vector<double>& x);
double conv_int_qq_pol(int const ix, double const xi, int const n, const std::vector<double>& gpd, const std::vector<double>& x);
double conv_int_gg_pol(int const ix, double const xi, int const n, const std::vector<double>& gpd, const std::vector<double>& x);
double conv_int_gq_pol(int const ix, double const xi, int const n, const std::vector<double>& gpd, const std::vector<double>& x);
double conv_int_qg_pol(int const ix, double const xi, int const n, const std::vector<double>& gpd, const std::vector<double>& x);
int gpd_grid_ns(int const n, double const xi, std::vector<double>& x);
int gpd_grid_s(int const n, double const xi, std::vector<double>& x);
};
/**
* Get map containing non-singlet values for given number of active flavors from PartonDistribution object.
* @param nFlavors Number of active flavors.
* @param partonDistribution Input PartonDistribution object.
* @return Map containing non-singlet values.
*/
std::map<QuarkNonSingletCombination::Type, double> getNS(const size_t nFlavors, const PartonDistribution& partonDistribution) const;
/**
* Get singlet value for given number of active flavors from PartonDistribution object.
* @param nFlavors Number of active flavors.
* @param partonDistribution Input PartonDistribution object.
* @return Singlet value.
*/
double getS(const size_t nFlavors,
const PartonDistribution& partonDistribution) const;
/**
* Get value for gluon contribution from PartonDistribution object.
* @param partonDistribution Input PartonDistribution object.
* @return Value for gluon contribution.
*/
double getG(const PartonDistribution& partonDistribution) const;
/**
* Get constant iterator for given std::map<QuarkFlavor::Type, QuarkDistribution> map and key.
* @param map Map.
* @param key Key.
* @param mapName Map name.
* @return Requested const iterator.
*/
inline std::map<QuarkFlavor::Type, QuarkDistribution>::const_iterator findInQuarkFlavorMap(
const std::map<QuarkFlavor::Type, QuarkDistribution>& map,
QuarkFlavor::Type key, const std::string& mapName) const;
/**
* Get PartonDistribution object for given number of active flavors from non-singlet, singlet and gluon values.
* @param nFlavors Number of active flavors.
* @param NS Map containing non-singlet values.
* @param S Singlet value.
* @param G Value for gluon contribution.
* @return PartonDistribution object.
*/
PartonDistribution getPartonDistribution(const size_t nFlavors, const std::map<QuarkNonSingletCombination::Type, double>& NS, double S, double G) const;
/**
* Initialize functors for integration.
*/
void initFunctorsForIntegrations();
NumA::FunctionType1D* p_intIntegrateComputeOutputNS; ///< Functor to GPDEvolutionModule::integrateComputeOutputNS.
NumA::FunctionType1D* p_intIntegrateComputeOutputS; ///< Functor to GPDEvolutionModule::integrateComputeOutputS.
NumA::FunctionType1D* p_intIntegrateComputeOutputG; ///< Functor to GPDEvolutionModule::integrateComputeOutputG.
/**
* Wrapper to integrate GPDEvolutionModule::nonSingletMu2FDerivative.
*/
double integrateComputeOutputNS(double MuF2, std::vector<double> par);
/**
* Wrapper to integrate GPDEvolutionModule::singletMuF2Derivative.
*/
double integrateComputeOutputS(double MuF2, std::vector<double> par);
/**
* Wrapper to integrate GPDEvolutionModule::gluonMuF2Derivative.
*/
double integrateComputeOutputG(double MuF2, std::vector<double> par);
};
} /* namespace PARTONS */
......
......@@ -45,11 +45,12 @@ GPDModule::GPDModule(const GPDModule &other) :
}
GPDModule::~GPDModule() {
/*
if (m_pGPDEvolutionModule) {
setEvolQcdModule(0);
m_pGPDEvolutionModule = 0;
}
*/
}
std::string GPDModule::toString() const {
......@@ -189,8 +190,7 @@ GPDResult GPDModule::compute(const GPDKinematic &kinematic,
GPDModule* gpdModule =
m_pModuleObjectFactory->cloneModuleObject(this);
partonDistribution = m_pGPDEvolutionModule->compute(m_x, m_xi,
m_t, m_MuF2, m_MuR2, gpdModule, (m_it->first));
partonDistribution = m_pGPDEvolutionModule->compute(kinematic, gpdModule, (m_it->first));
m_pModuleObjectFactory->updateModulePointerReference(gpdModule,
0);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment